Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

WIP: demo of using rollup code splitting prototype rule#76

Closed
gregmagolan wants to merge 6 commits intoangular:masterfrom
gregmagolan:rollup-code-splitting
Closed

WIP: demo of using rollup code splitting prototype rule#76
gregmagolan wants to merge 6 commits intoangular:masterfrom
gregmagolan:rollup-code-splitting

Conversation

@gregmagolan
Copy link
Contributor

No description provided.

@kylecordes
Copy link
Contributor

If I understand right from the bazel rule in here, it is hardcoded to know about the entry point for the lazy loaded foo module. I recently also used rollup to create a working set of lazy bundles, with that same manual gathering of the entry points. I'm really looking forward to seeing something to gather them automatically - from some chat discussion it sounds like the "official" way to do this could take a few months to come through.

@gregmagolan
Copy link
Contributor Author

@kylecordes Yes. This is an early prototype for this and the entry points are hard-coded in the rule and in index.html.

@alexeagle
Copy link
Contributor

Igor and I have been working here:
angular/angular#21431

in an earlier snapshot, there was an ng_entry_point rule that you could put in another package - but it only provided string data so it was simpler to just list them in the bundle.

Longer-term we should get them from a static analysis output from individual libraries.

src/index.html Outdated
this JS resource would be served from a static file.
<script src="/system.js"></script>

<script>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like this script could easily be another output of the rollup_bundle rule, placed in the runfiles.transitive_files so it's available to be loaded by anything with a transitive data[] dep

@alexeagle
Copy link
Contributor

Seems like some files are not git add'ed? Where's the change in rollup_bundle.bzl?

@kylecordes
Copy link
Contributor

@gregmagolan @alexeagle Thanks - I will keep an eye on that PR and any successors, and try to provide a bit of testing-with-code-out-here-in-the-wild where feasible.

@gregmagolan
Copy link
Contributor Author

gregmagolan commented Feb 2, 2018

Seems like some files are not git add'ed? Where's the change in rollup_bundle.bzl?

@alexeagle You mean the one in here? https://github.com/bazelbuild/rules_nodejs/pull/104/files :)

@alexeagle
Copy link
Contributor

Closing this PR since we don't plan to merge right now, the primary copy of this code is in Greg's fork

@alexeagle alexeagle closed this Mar 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants