Babylon.js: Rename npm packages with scoped names

Created on 27 Sep 2018  路  18Comments  路  Source: BabylonJS/Babylon.js

https://docs.npmjs.com/getting-started/scoped-packages

Instead of having https://www.npmjs.com/~babylonjs we can have scoped npm package names:

Examples of the scoped name change:

  • babylonjs -> @babylonjs/core
  • babylonjs-inspector -> @babylonjs/inspector
  • babylonjs-materials -> @babylonjs/materials
  • babylonjs-loaders -> @babylonjs/loaders

That will prove that all @babylonjs packages are official ones 馃槈

More informations https://babeljs.io/blog/2017/12/27/nearing-the-7.0-release#renames-scoped-packages-babel-x

discussion

Most helpful comment

All 18 comments

I'm afraid this will break all existing setup right?

I meant: We have a lot of users referencing the current packages so we are reluctant to change everything :)

I don't think so, everything went well for babel.

Nothing will break because existing published packages will not be removed..

The only thing to do for users wanting to update babylons to the next version (with scoped package names) is to rename babylonsjs packages in their package.json files (and of course batch replace import from with new names)

This is what I meant. We will force all the users to do that. Not sure it is worth the pain

Okay.. I'm just exited about the new modules feature.. and babylonjs looks more and more like a mono repo like many other projects.

I also like scoped package names because they are grouped in npm_modules

But for next release (4.0) we will ship new packages for each project to support ES6
so we could start using that for them

something like @babylonjs/core-es6, @babylonjs/gui-es6, etc...

Edit: Just saw your answer :) So yeah definitely for the new package we could do that

This could represent an opportunity 馃憤

Are you sure to suffix new package names with -es6?

New scoped package names can be modules by default.

By the way the terms es6, es7, etc.. are not really appropriate nowadays. I think it's more about modules than esx

So something like @babylonjs/core-modules ?

I don't understand the suffix.. Modules are that new way to go anyway 馃 Why not @babylonjs/core?

By the way I think the exact term is module (or sometimes ES modules)

I want to make sure we see a difference with the previous packages (the one that will stay unchanged)

To be fair, I like the @babylonjs/core, @babylonjs/gui, @babylonjs/materials naming

Simple, easy and we can consider that what is not in the scope is not using modules..

The new packages will be scoped @babylonjs/core and the old ones unscoped babylonjs

I'm not sure adding a specific technical JavaScript feature as a package name suffix is a good idea 馃

It looks to me like prefixing/suffixing variable names with types const fooString = "FOO";

Well ok I guess you are right :) So new ones will be @babylons/xxxx only

Good, (JavaScript) modules definitely are the new standard 馃憤

Also scoped package names will allow you to more easily manage npm permissions for collaborators

This is an extremely good idea. 馃帀 馃憤

It should also make it easy to split out more stuff, so that people don't end up with two physics engines for example, and lots of stuff they aren't using. There's alot of good stuff in Babylon, but i bet most people aren't using everything. This should make the end bundle for people much more focused and smaller.

I also agree that the ES6 prefix is unnecessary, it is perfectly fine to assume ES6 modules by default for this (also prefixing like that is not commonplace in NPM land as far as I know)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

individ2016 picture individ2016  路  39Comments

Nodragem picture Nodragem  路  22Comments

nbduke picture nbduke  路  21Comments

deltakosh picture deltakosh  路  91Comments

deltakosh picture deltakosh  路  61Comments