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

Is there a plan to support chunking? #59

Closed
sgammon opened this issue Jul 11, 2019 · 6 comments
Closed

Is there a plan to support chunking? #59

sgammon opened this issue Jul 11, 2019 · 6 comments

Comments

@sgammon
Copy link
Contributor

sgammon commented Jul 11, 2019

If this question is related to build, please include version of Bazel that you are running J2CL with:

Build label: 0.27.0
Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Mon Jun 17 13:03:58 2019 (1560776638)
Build timestamp: 1560776638
Build timestamp as int: 1560776638

I'm wondering if J2CL plans to support JS chunking? We are very happy with J2CL so far. But, if we want to build a large application and serve it efficiently, we're worried about packaging everything up in one JS target.

Surely Gmail, Calendar, and the other examples cited, must have some wiring for chunking built in. Just curious if there is a plan or ideas to do this with J2CL.

@tbroyer
Copy link
Contributor

tbroyer commented Jul 11, 2019

"Bundling" is not done by J2Cl, but by the Closure Compiler (or anything else that's compatible with Closure's way of loading modules).

@sgammon
Copy link
Contributor Author

sgammon commented Jul 11, 2019

@tbroyer, yes, indeed. however, Closure Compiler won't "chunk" (bundling is another term) without proper invocation.

i know there is a CLI-based set of flags for defining chunk boundaries, and optimization passes specific to chunking. however, i do not think J2CL is equipped to invoke Closure this way.

@gkdn
Copy link
Member

gkdn commented Sep 11, 2019

Until this is high level support at underlying rules level (closure), we are not planning to do our own solution.

@gkdn gkdn closed this as completed Sep 11, 2019
@sgammon
Copy link
Contributor Author

sgammon commented Sep 11, 2019

@gkdn okay but do you care if users want it? i'm the author of a proposal to bring this to Rules Closure. it would be useful to keep this issue open to track how it might be adopted in J2CL

https://docs.google.com/document/d/1LxcJhpv5YEWAO28SiFYdKavIkSno4I4rY8UX3w_krKg

we can't really adopt J2CL without some form of chunking (it's not bundling because we're splitting code here, this is the terminology the compiler uses).

@gkdn
Copy link
Member

gkdn commented Sep 12, 2019

I closed the issue because it was a question.

Internally, our users didn't need anything beyond the chunking provided by the underlying closure rules. However internally, we didn't provide a j2cl_application rule as well (since most users didn't need such a bootstrap).
Anyway; if we need to update j2cl_application rule to adapt chunking, that's not a problem. We will be happy to do that.

@sgammon
Copy link
Contributor Author

sgammon commented Sep 12, 2019

@gkdn understood

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