Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Dependency management with npm #772
Comments
|
There are a few other dependencies spread around the repo:
|
|
I think the main reason for not using npm is because we don't use anything like commonjs or amd. That's where i think bower would be a bit nicer, for pulling static files. Makes complete sense in that case. Still if we slowly transition to using es6 modules, i don't see why we shouldn't use NPM at that point. |
|
Most packages in npm don't support the ES6 module pattern, either. But yeah, pretty much what you said. |
|
it's polyfilled through some matter. My point is we would have the ability to require npm dependencies quite easily. Given Olivier mentioned doing it at sometime, it would be the best time to switch to pulling npm vs static files via html/grunt concat ordering. |
|
It's been my experience that packages in npm tend to expect CommonJS+Browserify, or go all in with ES6 |
|
I like the idea, but don't we have custom code on literally each of them ? maybe a good start would be to push back all the changes we did on all respective repos ? |
|
I did similar work on the tutorials; they now have dependency management through npm. For example: https://github.com/melonjs/tutorial-space-invaders/blob/fd5e86b018e60dce53675c5289d9bc77d54100a2/package.json#L7 Install devDependencies with npm, then run that npm script to copy the dependencies to a location that the browser can reach. This allows us to commit only the built dependency files, and not the entire source tree for them. $ npm install
$ npm run update:deps |
|
I've really enjoyed npm as the dependency manager because it can be locally managed to the solution. That might be because I've used npm a lot. |
|
After using The one missing piece is native ES6 module support. It's being worked on right now, but there's still the problem of backward compatibility. |
|
+1 on using npm |
|
Agreed. Updated title. |
|
@parasyte @obiot @krojew Curious on what you guys think. For building a solution here, i wonder if we need to update the build system. Whether we keep with grunt or w/e, but more importantly do we need to use modules? Or do we just have one file that has the require() vendors, and still do a concat? |
|
Modules will finally give us #212 |
|
Fair point. Since we updated to use eslint, i'd love to take it the next step and start leveraging things like webpack, as i find it builds faster, easier to integrate the watch changes workflow as well. I'm more of a mocha + chai fan these days instead of jasmine, though unless updating build system demands it, i'm not rushed to change the testing framework. |
|
Also with ES6 module support coming soon |
|
Yeah, but native support is coming to every browser already... It's one of those features you can't polyfill. The source has to be transpiled, so you lose native capability altogether. |
|
Would be nice to have the library in // src/scenes/MyScene.js
import {LevelDirector, ScreenObject} from "melonjs";
class MyScene extends ScreenObject {
onResetEvent() {
LevelDirector.loadLevel("Level_01");
}
}
export default MyScene;I have a workaround with You can see an example in the source code of my game prototype: https://github.com/pokettomonstaa/NewBark It is also necessary that the library does not initialize anything by its own. Right now it is doing it with the preloading screen, etc. |
this does not really use rollup as it should be, as melonjs is still not properly using package/module, but at least the new process is in place
properly include back bable transpiling, and show bundle size upon completion
and removes all copyright per file, whihc was a pain in the *** to manage/update :)
|
For those of you still reading these comments here : build process has finally be changed to npm, and external dependencies managed through npm and rollup ! I realized i just broke karma with my last commit, but else its working like a charm :) |
|
all done, jasmine fixed, the new build process is a success ! I even added a dependencies badge on the README :P |
this time with minpubsub; importing MinPubSub through npm and then adding link to the main functions through me.event.
- tweens is way too much customized, so move it to its own folder - vendors is now empty and can be removed
note: the Jay export does not appears to run, but anyway once the package is imported it will always define window.Jay as previously, so "import "jay-extend" does it well enough.
|
@parasyte could you add me as a collaborator on npm, looks like I have no right to publish any new version there :) thanks! (my username is obiot13) |
|
I added you @obiot |
|
@itsjavi thanks ! finally we have an updated version of melonJS on npm :) |
|
Sorry about that. I would have gotten to it sooner, but I was asleep. :) |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

We have a couple of third-party dependencies: https://github.com/melonjs/melonJS/tree/0b92a9c8868d63358f9ce756af620457a27ac176/src/vendors
It would be way better to maintain these through a package manager like Bower or npm. I'm slightly opposed to using npm for managing dependencies in a web framework (it's the right tool for node dependencies) regardless of the claims. I could enumerate the reasons, but suffice to say the npm ecosystem is not ready for this; the npm tool and service are. (Hint: CommonJS is dead.)
Anyway, we just choose a package manager and maintain our dependencies with a manifest. It will ease the maintenance burden for sure.