Skip to content
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

Background load bundles. #19

Open
justinbmeyer opened this issue May 10, 2015 · 7 comments
Open

Background load bundles. #19

justinbmeyer opened this issue May 10, 2015 · 7 comments

Comments

@justinbmeyer
Copy link
Contributor

It would be nice to show background loading of bundles. This would load other bundles sometime after the first page draw so they are ready.

@matthewp
Copy link
Contributor

Interesting idea, I haven't seen this done before. Something like:

steal.done().then(function(){
  var bundles = System.bundles;

  Promise.all(
    Object.keys(bundles).map(function(bundleName){ return System.import(bundleName); })
  );
});

@justinbmeyer
Copy link
Contributor Author

I've done this in other projects. Works pretty well. Especially if you have a "prioritized" knowledge of the other modules.

Btw, I'm not sure this would use System.import. It's likely you want to load the module, but not execute it. I think there's a way to do this.

@matthewp
Copy link
Contributor

We could fetch them which would put them in the browser cache for when they are imported. I don't know of another way to load without executing.

@matthewp
Copy link
Contributor

We could put this in Steal, perhaps as:

{
  "system": {
    "backgroundLoadBundles": true
  }
}

Long option name but I can't think of any better.

@matthewp
Copy link
Contributor

Or alternatively just as another project that you can just require ala steal-qunit, steal-benchmark, etc. That might be better.

@matthewp
Copy link
Contributor

Ideally this would be aware of done-autorender so that it waits until the first render() has finished before loading them.

@chasenlehara
Copy link
Member

Similar idea implemented for Angular: https://github.com/AngularClass/angular2-idle-preload

@matthewp matthewp removed their assignment Dec 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants