-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release 1.5 #8327
Release 1.5 #8327
Conversation
Even though localStorage is a synchronous API, I wrote this code in an asynchronous style so that we can easily switch to an async API when/if that becomes preferable. While localStorage has stricter size limits than IndexedDB, retrieving data from IndexedDB is unbelievably slow (~10ms for each cache.check call). When developing locally, that delay pretty much destroys any benefit from caching.
Good to see the first beta! Is code splitting available at this time? |
We (@abernix and I) suspect the intermittent "died unexpectedly" failures of `meteor --get-ready` on Circle CI are due to hitting their (low) limit on the maximum number of open files. Although optimistic caching speeds up rebuilds considerably, it doesn't do much for initial builds, and it definitely keeps more files open. Disabling it here seems worth a try.
@laosb It should be working (after you |
Okay! The problem was that I hadn't republished the With that minor snag out of the way, I'm happy to announce that you can try Just run the following commands: meteor create --release 1.5-beta.2 dynamic-import-test
cd dynamic-import-test
meteor add dynamic-import
meteor npm install --save react Now, in Template.hello.events({
'click button'(event, instance) {
// increment the counter when button is clicked
instance.counter.set(instance.counter.get() + 1);
import("react").then(React => {
console.log(React);
});
},
}); You can inspect the In addition to importing npm packages, try creating a file called The same syntax works on the server, though of course it's more interesting on the client. |
Dynamic
|
@klaussner I tried using IndexedDB (via https://npmjs.org/package/localforage), but access times were unbelievably slow (5-10 milliseconds per query). Any thoughts about alternative client storage mechanisms? It's possible we could just rely on HTTP caching, though that would mean not using a web socket. I suppose we could use IndexedDB if we loaded the manifest (module identifiers, hashes) into memory eagerly when the application started (probably in this file). That way we wouldn't have to pay the API tax every time we check the cache. |
I think `real` is a better antonym for `meta`, and I appreciate that `real` and `meta` are both four letters long.
Fixes the first problem reported by @klaussner in this comment: #8327 (comment)
Also, the regular expression for removing existing source map comments now matches only if the comment starts at the beginning of a line, following previous behavior more closely. To get this exactly right, we would need to tokenize the source to avoid matching comments in string literals, for example, but that's hard because this logic needs to work for multiple file types, not just JavaScript.
With the proposed solution of in-memory management of identifiers and hashes, maybe something like this could be useful https://github.com/dumbmatter/fakeIndexedDB Also searching around I found these, which have adapters to persists with indexedDB but use indexes for fast queries once sync is done. |
Hooray! Good to see that! Actually we should have a suggested application structure for dynamic imports |
Weeeeeee!!!!! This is fantastic news! Thanks @benjamn <3 |
Question: should the |
👏 🎉 🥇.⓹ 💥 Wooooohooooo! Hurrah! 💥 🥇.⓹ 🎉 👏 |
👍👍👍 |
<3 |
The Meteor 1.5 release is now final, though you'll still need to run If you already miss living on the bleeding edge, now that Meteor 1.5 is out, there's a new edge to play with over here: #8728 |
Woot! 🎉 |
@abernix the new |
@mjmasn how do you use this package? There is no info in the repo |
You just add it I think! Then start your app. |
For two of our older apps I needed to You also have to remove the |
Dynamic |
Incredible ! |
This looks great, is there an example project using angular (2 or 4) with Meteor 1.5 anywhere? |
I've created (via 791d0cd) a /cc @sferoze (And thanks to @mjmasn for providing the details above). |
Hi @vladejs , Weird we don't use // this is an expensive polyfill for clientside Buffer usage
// but we recommend you refactor to remove this dependency
global.Buffer = global.Buffer || require("buffer").Buffer; // eslint-disable-line
// how to refactor
// you can easily drop a breakpoint on the error in your browser's inspector, then refresh the page to hit the breakpoint and see via the call stack which package is trying to use Buffer
// https://github.com/meteor/meteor/issues/8645 Hope this will fix it, I'm on major update of |
** SOLVED **
SORRY, it was because of static templates, not depending of uiRouter or Meteor 1.5!!! |
After upgrading to meteor 1.5 (from 1.5-rc.7), my app had been running with I start meteor with I fixed it by uninstalling and reinstalling meteor from scratch. |
Just as Meteor 1.4.2 took aim at rebuild performance, Meteor 1.5 will be all about production app performance, specifically client-side application startup time.
The banner feature of this effort will be first-class support for dynamic
import(...)
, which enables asynchronous module fetching (sometimes referred to as "code splitting"). Jump to this comment for an overview of how it works.As usual, this release will include any bug fixes since Meteor 1.4.3, though special attention will be paid to pull requests and issues that affect the performance of running applications.
You can update to the
latest release candidatefinal release by running: