Universe Modules in Meteor JS (including imports from NPM)

I want to present our stuff for es6 modules / React ( import can be done by System.import without es6 ).

Universe Modules works on both sides[client/server], in application space but also in package.
The package provides also possibility of importing exported variables from regular Meteor packages.
We have support for npm packages by additional package Universe Modules NPM.

Modules imported from npm can have mixed dependencies (partly from npm, partly from Meteor or other places ) Good thing is that if we want use React from Meteor package then Universe Modules NPM will really exclude react from bundle
Not like usually happens by other solutions, which only change the references and source of unused packages is kept in bundle and downloaded by clients.

As soon as posible, We want to spend another package that will be providing support of modules for each files js and jsx. (Universe Modules provides for now support only for .import.js and .import.jsx, and for npm: .npm.json)

https://atmospherejs.com/universe/modules
https://atmospherejs.com/universe/modules-npm
https://atmospherejs.com/universe/ecmascript (imports/exports in all js and jsx)

Please write back about your reflections and proposition of improvements for modules packages.

1 Like

So, which way to go Meteor? System.js or Webpack? (In the context of es2015 modules) Is this a topic for https://github.com/meteor/guide ? :wink:

If you don’t want to be on the bleeding edge, just wait for Meteor 1.3 that will have ES2015 modules support. universe:modules is also a nice solution for Meteor 1.2 if you cannot wait and it integrates fairly well with the current system. Webpack is also in the exploration phase at MDG. I haven’t tried the community efforts regarding Webpack yet.

are you sure that? :wink: is there any commitment somewhere?

Yes, Ben is currently working on it as far as I know.

1 Like

IMHO one of the perks of webpack is dropping the reload times. 1.1 and 1.2 for me produces a 12-14 second reload on file change. The same project on webpack takes 1.2 seconds. For me this is a game changer as 12 seconds was not productive.

The most ‘integrated’ way is the kickstarter webpack project and Jedward’s project has a different take on it which is also good (project structure and configurability is the main diff.).

3 Likes

Could you provide a link to this Jedward project?

Also I’m curious if using webpack allows me to import third-party react modules (like datepicker, griddle table, etc.) from NPM… I’m currently trying to use cosmos:browserify and half the time I can’t figure out what’s going on, it fails all over the place.

1 Like

This is the link: https://github.com/jedwards1211/meteor-webpack-react

Yes, you can import any npm package. But as a precaution, check its compatibility with node 0.10.40 (since that’s the version that Meteor officially supports). For packages related to React, that’s unlikely to be a problem though.

1 Like

@gaurav7 beat me to it :laughing:

It’s basically a totally normal JS/NPM workflow except the scripts will transfer the build into an almost hidden ‘meteor_core’ folder. This is the main difference between Jedwards’ version and the other kickstart one. With Jedwards’ it’s almost like you’re using normal JS and there happens to be some Meteor globals you can count on at runtime.

Your loadtime will drop significantly compared to browserify too! (mine as 18s to 1.4s).

1 Like

Grabbed a rare opportunity :wink:

1 Like