Ngx-bootstrap: rename lib

Created on 1 Dec 2016  路  18Comments  路  Source: valor-software/ngx-bootstrap

Since Angular use semver, ng2- prefix's anti pattern, might be:

  • vs-bootstrap
  • valor-bootstrap
question

Most helpful comment

Google wants that we all use the word "Angular" instead of "AngularJS", "Angular 2", "ng2", "Angular 4" or "ng4". So why not angular-bootstrap?

All 18 comments

in my opinion, company name in lib name is inappropriate.
so it could be ng-bootstrap (and produce complete mess)
or @ng/bootstrap or @ngx/bootstrap

@istiti what about ngx- prefix?

I found this. A prefix is definitely needed if anything just to mark your territory so to speak. Helps me easily identify which library a component belongs too. Using ngx- doesn't feel right because it is random and has no connection back to Valor Software. I'd have no problem with valor-. Or ngv- maybe?

Also don't miss this.

ngx- is an initiative by @ocombe and @amcdnl
as a common name space for angular 2+ libs

So what will Valor Software use for the ng2-charts library? @amcdnl already has a ngx-charts.

I liken these Angular namespaces to how Java uses the reverse domain name for their name spacing. Like com.valorsoftware.ng.bootstrap for example. They are guaranteed unique in the Java world where in Angular... not so much; but at least we are trying. This is why I like @istiti's valor- suggestion.

Having a common ngx- prefix doesn't solve anything IMO. Unless what you put in it is truly common, like reusable pipes or something.

(I'm using ng2-charts. Very nice work and the library is simple to use. The other chart libraries didn't have what I needed.)

I'd go for ngx-bootstrap.

@critchie - This isn't Java so I don't think we should emulate that pattern. Also in JavaScript, name lengths are KB's sent to the browser, so shorter is better.

If scoping is an issue, I'd do @valor-software\ngx-bootstrap in npm.

I agree with @critchie

Like @amcdnl said, the name on npm is irrelevant, you can use a scoped module.
And the collisions in the code are probably not a real problem either because if two libraries have the same name then they probably do something similar and you won't use both at the same time.

I will leave it to you component experts on this. I appreciate what you guys do. I can only speak from experience from my days in Angular 1 of trying to get UI Bootstrap and AngularStrap to work in the same project.

@ocombe - "And the collisions in the code are probably not a real problem either because if two libraries have the same name then they probably do something similar and you won't use both at the same time."

That's a dangerous assumption if I interpret what you are saying correctly.

I have designers and end users that are pretty demanding in how their apps work. Sometimes I have to pick and choose components from libraries that are trying to accomplish the same thing. For example, I came to ng2-bootstrap because it has a typeahead that handles grouping of results. Now that I am using ng2-bootstrap I will do my best to use only ng2-bootstrap to keep the headaches down. But, I may get to a point where I need to bring in ng-bootstrap because, as an example, their datepicker does what my users want (more like demand).

I really like with ng2-bootstrap that I can import just what I need from the library and this should help with collisions and tree-shaking. (I think it does anyway... I could be wrong on this. Tree-shaking may work no matter how the library is structured.)

yes, if the library is modularized you should not have name collisions.
You can always rename services, I wish you could rename directives / pipes selectors as well... it's a design flaw in my opinion.

Anyway exported modules are usually just for convenience, you can import just a small component from a library if you need (you'll have to be careful about its dependencies though)

ngv- is relatively clean, safe, memorable, easy, and relatable to Valor. valor- sort of limits Valor to ng2 project.

We use ngbTabset for type pills and I like how it is easy to identify in our code.

Of course, I don't care a lot, and appreciate being able to use all this clever work -- regardless of the name space.

bs* prefix for modules and directives and components and ngx-* prefix for libs,
ok?

sounds good to me

Google wants that we all use the word "Angular" instead of "AngularJS", "Angular 2", "ng2", "Angular 4" or "ng4". So why not angular-bootstrap?

done, renamed to ngx-bootstrap

good news :) too much time to decide, name not so important

wonder if google succeeded with "google" name

@istiti problems was not with decision, ngx-bootstrap npm name was busy
so I had to go through npm dispute process

bs* prefix for modules and directives and components and ngx-* prefix for libs,
ok?

What happened to the above comment? I can see a lot of selectors not being prefixed. cc @valorkin

Was this page helpful?
0 / 5 - 0 ratings