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

🏗🚮 Clean up closure compiler code paths no longer used by amp dist #37173

Merged
merged 1 commit into from
Jan 4, 2022
Merged

🏗🚮 Clean up closure compiler code paths no longer used by amp dist #37173

merged 1 commit into from
Jan 4, 2022

Conversation

rsimha
Copy link
Contributor

@rsimha rsimha commented Dec 10, 2021

The coast is clear to delete all the closure compilation code paths used during minification. The guts of the actual compilation still remain because they're used during type checking. They can be cleaned up after type checking moves to TS.

Related to #35264

@rsimha rsimha self-assigned this Dec 10, 2021
@samouri
Copy link
Member

samouri commented Dec 10, 2021

Lets wait until next week when the esbuild build hits stable. In case we need to revert, deleting this code prematurely could get ugly.

That said, I'm very excited about all the deletion we can do :)

Copy link
Contributor

@rileyajones rileyajones left a comment

Choose a reason for hiding this comment

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

Awesome cleanup! I second @samouri 's suggestion to wait until esbuild is in stable though

Copy link
Contributor

@jridgewell jridgewell left a comment

Choose a reason for hiding this comment

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

Blocking until esbuild+terser is stable.

@kristoferbaxter
Copy link
Contributor

Looks good to me too, but agree with @jridgewell about holding off until stable.

Verification question too: do we have checks for the quality of sourcemaps with this change applied? I believe we do, but just want to verify as there are MagicString removals.

Copy link
Member

@samouri samouri left a comment

Choose a reason for hiding this comment

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

New stable is now live, built with esbuild.
Good to merge ⭐

@samouri samouri requested a review from jridgewell December 14, 2021 23:16
@rsimha rsimha merged commit 0c7afec into ampproject:main Jan 4, 2022
@rsimha rsimha deleted the 2021-12-10-Closure branch January 4, 2022 16:29
@rsimha
Copy link
Contributor Author

rsimha commented Jan 4, 2022

Verification question too: do we have checks for the quality of sourcemaps with this change applied? I believe we do, but just want to verify as there are MagicString removals.

We have amp check-sourcemaps which inspects various fields in the sourcemap file for module and nomodule output. Anything else you think we need?

image

@kristoferbaxter
Copy link
Contributor

The on-call folks noticed that sourcemaps didn't match after the esbuild version was shipped to production traffic. Perhaps there is some additional coverage needed? Might be worth syncing with @jridgewell or @rcebulko.

@samouri
Copy link
Member

samouri commented Jan 4, 2022

@kristoferbaxter / @rsimha: the current check-sourcemaps verification is quite coarse. It works well for ensuring our sourcemaps are at least somewhat correct. Maybe we can modify the check to also look for specific identifiers which would give us significantly more confidence.

The current issue we've noticed is that StackDriver error reports are displaying traces with _AMP_PRIVATE_, which is a suffix we give to private identifiers during a babel pass. That identifier should be mapped back to the original source instead of the post-babel name. We are still investigating why this is happening, and Justin has a PR that might fix it: #37238. The current theory is that terser isn't using the sourcemap we hand it from babel properly.

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

Successfully merging this pull request may close these issues.

6 participants