Introducing Blaze "modules": locally scoped Blaze templates

Unfortunately, when I remove the blaze-templates and add your package, this happens and nothing gets rendered:

app.js:60 Uncaught SyntaxError: Unexpected token export
router.js:347There is no route for the path: /Router._notfoundRoute @ router.js:347

Are you on the latest version (0.0.5)? I forgot to bump a package version when I published a while back, so my local copy (and clones of the repo) worked fine but the Atmosphere package wasn’t compiling correctly. I updated it earlier this evening with the fix.

I have only just tried the blaze-modules and it appears to be exactly what I wanted, and after first tries it looks and ‘feels’ very simple and clear. The package is not very popular though, are there any better options for Blaze or everyone just left to React? :slight_smile:

Btw, it seem to be a great option for Meteor 1.5 with lazy loading…

I have converted rather substantial part of my app to use nathantreid:blaze-modules. So far I love it because it adds clear components structure similar to React yet keeps in line with standard Blaze callbacks, reactivity and other working code - seem to be a real evolution without any hassles. I have still to keep some templates because BlazeLayout does not work with them out of the box, but it seem to be not a big issue.

Guys, could you please comment on this until I convert most of the app to blaze-modules:

  1. @nathantreid, did you use it in any production environment, how stable it is and what kind of caveats there might be? Do you use BlazeLayout or render the templates/components directly with Blaze?
  2. @sashko, @benjamn, are there any plans for meteor 1.5 lazy loading to be used with Blaze? How it could look like? Can it break the proposed blaze-modules approach?
  3. Everyone who uses Blaze, did you try or use any similar components package?

I haven’t used this package in production, although I may soon. Ideally it or something similar will be integrated into Blaze proper soon!

1 Like

If anything, modular Blaze templates should work better with Meteor 1.5 dynamic imports and any other module-centric strategies we adopt in the future. For example, if we do some kind of tree-shaking (aka dead code elimination) within modules, then the import declarations you use to import the templates will make it easier to eliminate any not-imported templates.