Migrating to Meteor 1.3

Yes I am seeing the same thing. Are you by any chance using useraccounts:… packages? Because I see the error on the FlowRouter initialization made by useraccounts:flow-router. Although that might be just because it is the first FlowRouter calls to happen in the app…

@alonflowhub:

I’m trying to use import for an npm package, and I get this error:
W20160331-11:02:58.473(-6)? (STDERR) import barcode from “bwip-js”;

Sorry, I glossed over this too quickly. Npm packages aren’t processed by Meteor build plugins. It’s up to the npm package author to decide on which targets he builds for. It’s quite common today to find packages that automatically convert everything to ES5 (“old” javascript) before publishing, via babel (just like what Meteor does).

Also important to note that for server side npm packages, authors don’t usually bother to transpile with babel, because a lot of the ES6 features are already in node. Unfortunately Meteor 1.3 still uses quite an old version of node without these features, but the goods news is that this has been earmarked as a priority for the next few releases.

For now, as you noticed, it’s possible to change the imports by hand. You could also “convert” the module using babel; you can google how to do that if you want… but no need to worry with that if you already have it working.

I’ve had exactly the same issue with IronRouter - as in the same equivalent message. Never had to change my code for any meteor releases before, 1.3 is the first update that has broken my app

2 Likes

I am using the useraccounts package. As well I am using the alethes Pages package… Does anyone else encountering this issue happen to be using that package too?

(Edit: @wesleyfsmith confirmed that he is using the Pages + Flow packages, and removing Pages package fixed the problem!

It looks like Pages is in need of a fix! There’s some forks out there but I have not tried them to see if they fix the issue!)

Are there any nice Meteor 1.3 open source project except the todos?

I am currently refactoring an app to 1.3 and it would be nice to see more examples :slight_smile:

1 Like

Here’s one!

1 Like

Awesome! Thank you sashko

Hey @sashko, can event maps not now be documented with the more concise function format? Ex:

'click #myButton' (event){}

instead of:

'click #myButton': function(event){}

Are there any breaking changes to the publish subscribe functions that may cause percolate:find-from-publication to break? Percolate:find-from-publication and Meteor.users

The Meteor guide documents them in this way, I’d be more than happy to accept a PR changing the docs as well (those live as a Meteor app in this directory: https://github.com/meteor/meteor/tree/devel/docs)

Do you think it would be cleaner/simpler for people? If so I’ll happily submit a PR

Absolutely! I think using the object method shorthand is definitely the right way to write events. All of the code samples in the Meteor Guide do it, I think we just haven’t taken the time to update the docs with all new ES2015 stuff. (see the Blaze guide article here: http://guide.meteor.com/blaze.html)

Modified /docs/client/full-api/api/templates.md and submitted PR. Removed all the other uses of function in that file while I was at it.

1 Like

I have been struggling to get my app to run in 1.3 I have Error: “There are no routes on the client or server” I have tried both Iron Router and FlowRouter, route definitions are not being pick up. I have tried place and import my router.js in almost every directory according to the new recommended app files structure.
Is there something I could be missing? What’s strange is the two examples leaderboard(1.2way) and todos-master(1.3way) both compile and work fine in 1.3.

A question:

In order to control load order of files, I put everything in packages.
Given the introduction of import and export, is there any benefit to having locally built packages now?

Two of the biggest reasons for the “packages for everything” approach were load order control and dependency management. Both of these can now be handled easily with 1.3. There could still be other benefits though, such as needing to manage multiple builds for different environments/platforms, or splitting out functionality into “microservices” (buzzword insertion complete), but most of the advantages are now baked right into 1.3.

Did you import your route definitions from client/main.js and server/main.js?

I have tried that also.

Is it safe to update my mobile app to Meteor 1.3 without refactoring all the code just to get the new Cordova Hot Code push performance?

1 Like

Yes, I think so (you mean refactoring to use imports?)