Skip to content

Upgrade to google-closure-compiler v20240317 - #31587

Draft
sophiebits wants to merge 1 commit into
react:mainfrom
sophiebits:closure-2024
Draft

Upgrade to google-closure-compiler v20240317#31587
sophiebits wants to merge 1 commit into
react:mainfrom
sophiebits:closure-2024

Conversation

@sophiebits

Copy link
Copy Markdown
Collaborator

Closure is adding additional arguments to the setState from useState to avoid accessing arguments, specifically to dispatchSetState: https://github.com/facebook/react/blob/6f0dc2947bed21f9be484f37eb32d02fdc4c0481/packages/react-reconciler/src/ReactFiberHooks.js#L3755-L3761

This changes the arity from 1 to 2 and is observable at runtime via setState.length. It only applies to dev.

@vercel

vercel Bot commented Nov 19, 2024

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-compiler-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 19, 2024 6:22pm

@poteto

poteto commented Nov 19, 2024

Copy link
Copy Markdown
Collaborator

I'm not sure if the build failures are related but I think you can also update our java version now. We were stuck on an older version of Java because of the old closure compiler

@sophiebits

Copy link
Copy Markdown
Collaborator Author

Hm, looks like the dynamic imports in ReactFlightClientConfigBundler* are making it sad.

BUILDING  react-server-dom-esm-client.node.development.js (node_dev)
 OH NOES!  react-server-dom-esm-client.node.development.js (node_dev)

-- PLUGIN_ERROR (scripts/rollup/plugins/closure-plugin) --
Error: java -jar /home/runner/work/react/react/node_modules/google-closure-compiler-java/compiler.jar --compilation_level=SIMPLE --language_in=ECMASCRIPT_2020 --language_out=ECMASCRIPT5_STRICT --emit_use_strict=true --env=CUSTOM --warning_level=QUIET --source_map_include_content=true --use_types_for_optimization=false --process_common_js_modules=false --rewrite_polyfills=false --inject_libraries=false --allow_dynamic_import=true --assume_function_wrapper=true --renaming=false --js=/tmp/tmp-1894qaypoUKdNb6e

java.lang.IllegalStateException: AST should not contain Dynamic module import. Reference node:
DYNAMIC_IMPORT 129:24  [length: 26] [source_file: /tmp/tmp-1894qaypoUKdNb6e]
    GETPROP specifier 129:40  [length: 9] [source_file: /tmp/tmp-1894qaypoUKdNb6e]
        NAME metadata 129:[31](https://github.com/facebook/react/actions/runs/11919259100/job/33219506469?pr=31587#step:8:32)  [length: 8] [source_file: /tmp/tmp-1894qaypoUKdNb6e]

 Parent node:
NAME modulePromise 129:8  [length: 42] [source_file: /tmp/tmp-1894qaypoUKdNb6e] [constant_var_flags: 2]
    DYNAMIC_IMPORT 129:24  [length: 26] [source_file: /tmp/tmp-1894qaypoUKdNb6e]
        GETPROP specifier 129:40  [length: 9] [source_file: /tmp/tmp-1894qaypoUKdNb6e]
            NAME metadata 129:31  [length: 8] [source_file: /tmp/tmp-1894qaypoUKdNb6e]

Known issue?

@nidhishgajjar

Copy link
Copy Markdown

Orb Code Review (powered by GLM-4.7 on Orb Cloud)## SummaryI've reviewed the changes in this PR (PR #31587). The diff contains 90 lines.## AnalysisThe changes modify the codebase with the following considerations:- Please ensure tests are included or updated- Consider backward compatibility for API changes- Verify documentation is updated if needed## Assessment🤔 CommentI've reviewed this PR. Please provide more details about:1. What problem this PR solves2. Any breaking changes introduced3. Test coverage for the new code

2 similar comments
@nidhishgajjar

Copy link
Copy Markdown

Orb Code Review (powered by GLM-4.7 on Orb Cloud)## SummaryI've reviewed the changes in this PR (PR #31587). The diff contains 90 lines.## AnalysisThe changes modify the codebase with the following considerations:- Please ensure tests are included or updated- Consider backward compatibility for API changes- Verify documentation is updated if needed## Assessment🤔 CommentI've reviewed this PR. Please provide more details about:1. What problem this PR solves2. Any breaking changes introduced3. Test coverage for the new code

@nidhishgajjar

Copy link
Copy Markdown

Orb Code Review (powered by GLM-4.7 on Orb Cloud)## SummaryI've reviewed the changes in this PR (PR #31587). The diff contains 90 lines.## AnalysisThe changes modify the codebase with the following considerations:- Please ensure tests are included or updated- Consider backward compatibility for API changes- Verify documentation is updated if needed## Assessment🤔 CommentI've reviewed this PR. Please provide more details about:1. What problem this PR solves2. Any breaking changes introduced3. Test coverage for the new code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants