-
Notifications
You must be signed in to change notification settings - Fork 1k
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
closurebuilder.py doesn't track requireType calls #1076
Comments
As mentioned in the script, Closure Compiler itself is better able to understand dependencies than this script. You should be able to migrate this workflow over to a direct compiler invocation by specifying the entry point. We'd prefer not to continue to support this tool when there is better native compiler support for managing dependencies. Is there a particular reason you need a minimal set of files for your tests (vs making all files available to load in a test via a simple http server and relying on a deps.js file to figure out which files and order to load in)? |
Skipping the py scripts sounds good (if it doesn't work... maybe it is time to remove it? or at least log very loud deprecation warnings?) - is there a convenient way to ask closure-compiler to dump the list of file names, rather than produce any kind of bundle/build? I know I could write a one-off main() to do it, but going from a one-line sh script to a java project is kind of a jolt. The purpose here is to emit just a subset of closure-library, just the minimal set of files required for
These files are merely archived into a zip, repackaged and used from other tooling since the other 1500-odd files are not needed by downstream projects, so there is no point for closure-compiler to parse all of them, since they will never matter. Also, isn't generating deps.js also typically done through these python scripts? We've additionally found BUNDLE at a minimum to be required to load moderately large apps - asking base.js to pull in thousands of files (j2cl emits two .js files per java class) to get the app going has been prohibitively slow. I had previously understood that a |
...and since I'm dumb and didn't say this before, the reason we don't see the logging you linked is that we use the default output_mode: |
@tjgq maybe you have some insight into this? |
I've been using this script to extract the minimal set of JS files required for closure-compiler to run its tests, but a minimal way to reproduce this is to invoke it on events/events.js and compare output with the various dependencies listed in the events/events.js file:
This is broken as of 803aa52#diff-ae4b8959b41e658aae28c9b7e0152987. It appears that prior to this, there was a
goog.forwardDeclare
on two dependencies (i.e. "this is optional, may not actually be necessary"), and that was changed togoog.requireType
, which will now fail in closure-compiler if the dependency is absent:Given that
goog.forwardDeclare
is deprecated, it probably either makes sense to updateclosurebuilder.py
to include these dependencies, or update closure-compiler to not require these apparently optional dependencies at compile time?I tried briefly to modify
source.py
's regex to match arequireType
call as if it were arequire
, but this leads to cycles (at least in this case), so obviously isn't suitable.Workaround: for each missing type, add a
-i
argument for that file toclosurebuilder.py
, or revert 803aa52 locally.The text was updated successfully, but these errors were encountered: