Meteor 1.3 beta (modules, mobile, and testing) now available!

We’ve just released a new Meteor 1.3 beta, which combines the earlier modules and Cordova betas and now also includes a new version of the application testing changes that we’ve been working on.

Try the release by running meteor update --release 1.3-beta.12 in your app directory.

Please comment here if you have questions about how things are supposed to work. Open a GitHub issue about bugs that you find, or missing features that you need.

Modules

Meteor 1.3 gives apps full ES6 (ES2015) modules support and better NPM support. Apps and packages can now load NPM modules that are installed via npm install on client and on server. Amongst other benefits, modules let you control file load order in much more precise way than naming your files in special ways.

@benjamn wrote a great document explaining how to use modules in Meteor.

Also refer to the existing issue for the earlier 1.3 modules beta for more details.

Cordova

Meteor 1.3 upgrades the Cordova dependencies to their latest versions, now uses WKWebView on iOS for improved JavaScript performance by default, and includes completely rewritten plugins for iOS and Android that make file serving and hot code push much more reliable and performant.

For now, please refer to the existing issue for the earlier 1.3 Cordova beta for a more complete list of changes. The guide for 1.3 will include a section on mobile, so we’ll update this when we have something to share.

Testing

  • You can read a little about the way that the system works in the draft guide article (please excuse the incompleteness).

  • At the moment the system comes with some caveats as it is not quite complete – you can read about them on the ticket, but the main one is you can only use mocha tests using the avital:mocha reporter (a fork of practicalmeteor:mocha) as of this writing. We plan on working with popular testing package authors to change this very soon.

  • There are some specific things you need to make unit tests work properly with imports that the guide article will document soon, but you can refer to the tests in the Todos example app for now.

  • If you have specific issues or questions with the tests, it’s probably best to comment on the relevant issue for now.

38 Likes

Great work! I’d love to see how to use the new testing tools with React. Do the Meteor test tools work alongside react-test-utils?

Awesome work! The modules stuff is great. One thing to mention is that you might run into issues with having conflicting versions of React if you’re using Npm.depends in your packages.

I don’t know what the official stance on this is, but I would probably suggest using NPM packages only via the “new” package.json method (i.e. the standard Node method), if possible.

Also make sure you remove meteorhacks:npm if you were using it in your app.

4 Likes

Yes, check out the example 1.3 branch automated-testing-best-practices repository

I’m working on implementing the new unit/integration testing mode next.

2 Likes

The updating process to beta.11 is very slow on my laptop and it seems to make no progress on “Updating package catalog”.

Is there some way to enable a progress indicator to see whether it hangs somewhere or if the download just slow?

Okay, I then tried a different approach and did this:

meteor create test
cd ./test
meteor update --release 1.3-beta.11

which then yielded the message:

This project uses Meteor 1.3-beta.11 which isn't available on Windows...

However, my desktop (also on Windows) yields this message:

This project is already at Meteor 1.3-beta.11

This is very confusing. Particularly in light of the fact that the desktop version runs without a hitch.

@rhywden: I’m not sure what is going on, but it seems this might be related to issues with the package server. I noticed you already found the GitHub issue tracking this, so let’s continue the conversation there.

Hi @martijnwalraven I would like to know what is the maximum db size for localstorage on Cordova iOS/Androïd. I heard that, with the default localstorage, the max is 10mb. Is this still the case?

More globally, what improvements on offline persistance and offline/online sync can we expect for 1.3?

I recall the Cordova update for Android was going to be pushed back to a later release, but it looks like like you guys have it now? If so, that’s great news.

By the way, one thing I’ve noticed is Meteor adds its own Cordova plug-in but omits it from the .meteor/cordova file. It would be great if it would list it there, because then we’d know it’s there but default and can download the package to use from local source

Benefits would be 1) ability to modify package easily, 2) no need to re-download package each time you re-build 3) would always work offline.

Perhaps the Meteor plug-in could be added to the file manually and then linked to local file - I have not tried that yet.

I haven’t found more recent information, but this report suggests localStorage indeed maxes out at 10mb or even less depending on the OS and web view version. This isn’t Meteor or even Cordova-specific though, these are just the limitations set by the web view.

There are no improvements to offline persistence and data sync in 1.3. (Note that we don’t use localStorage for minimongo, data is just kept in memory.)

1 Like

Yep, the plugin has been rewritten for both iOS and Android. The Android version wasn’t in an earlier beta, but it has been out for a couple of weeks now.

The reason the plugin isn’t listed in the .meteor/cordova-file is because it is a dependency of the webapp package. The plugin file is only used for plugins added at the app-level through meteor add cordova:<...>, not those added through Cordova.depends in a package.js.

I’m not sure I understand the benefits you mention. Independent of where a plugin is added, plugin download and installation is handled by Cordova. It always redownloads plugins downloaded from Git (which is where the plugin comes from right now), but caches those downloaded through npm. That does remind me I should release the plugin on npm, thanks!

Haha nice, glad that helped, and that Andriod made the cut.

Maybe I’m having an odd experience, but whenever I try to meteor run ios it ends up downloading the Meteor plug-in from git instead of caching it (on current v1.2). It usually takes a good minute or so depending on connection, but sometimes I don’t have a connection, so it makes it tougher.

For example, if I am connectionless and my Cordova build breaks due to a bad HCP, I’d have to re-run meteor run ios , then I have to pause work until I have a connection.

For mobile configuration, will the App.accessRule be updated to support the new whitelisting directions for iOS?

According to Cordova whitelisting guide:

iOS Whitelisting
The allow-intent and allow-navigation tags are new for cordova-ios 4.x and greater, see the cordova-plugin-whitelist documentation for details. cordova-ios version 4.0 and greater does not require the cordova-plugin-whitelist plugin to be installed.

I have a Meteor app that utilizes the Braintree drop-in UI plugin for payment processing. The drop-in UI uses an iFrame.

I just tested the app with Meteor 1.3 beta 11 and found that without adding the allow-navigation directive manually to the config.xml of the cordova project, the Braintree drop-in UI would not function properly on iOS. It does work properly on Android.

1 Like

@jmanos3: Good point. We do set <allow-navigation> by default to allow access to the local server, but we haven’t exposed this to App.accessRule. Could you file an issue for this?

1 Like

So we should just use npm install to install npm modules.
That means we have to install node, that brings up the question: what version for it to work.
Meteor’s internal is 0.10.40 if I remember correctly.
Do we need to follow that, or any will work for us ?

For development, any version will do as long as npm works. At least that’s the way it is for me.

Done - https://github.com/meteor/meteor/issues/6280

Let me know if you need anything else.

Thanks for all your work on the mobile side for Meteor 1.3 - it is very much appreciated.

I don’t remember where, but I had some issue with the newest node version (maybe building packages wrong or requireing incompatible ones). So I use n and switch to node v0.10.40 when ever working with meteor