Skip to content

fix(build): Fix temporary sucrase CI jobs #5021

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

Merged
merged 4 commits into from
Apr 29, 2022

Conversation

lobsterkatie
Copy link
Member

@lobsterkatie lobsterkatie commented Apr 29, 2022

Until we officially switch over to rullup/sucrase builds, there are extra CI jobs running to test the build changes so far without us having had to switch to them yet. That said, the first attempt at creating such a system had a significant flaw, in that the supposedly-sucrase unit tests were actually running against the normal tsc build output. Further, it was very flaky, but it seems there might occasionally have been some scope bleed between the tsc-built file cache and the sucrase-built one. (It seems unlikely, I know, and I could be imagining it. Regardless, the changes here make it a moot point.)

This fixes those unit tests to run against sucrase builds, by adding a script to build with sucrase in the test job itself (and all other sucrase test jobs). It also moves a prior hack (rebuilding in es5 for node 8 tests) from the main test script into the new hacky script, so it can't get missed when pulling these temporary fixes out of the code when we switch. (That move is why our regular unit tests also run that script, to get the prior hack.) Finally, it makes a temporary modification to our base rollup config when in node 8, to enable the just-in-time rollup builds.

Disclaimer: This is definitely a hack, and is a little ugly, but it's also coming out in a week, so... ¯\(ツ)

Note: Node 8 sucrase tests are an xfail at this point, until more of the new build pipeline is merged. [ UPDATE: Fixed in #5022. ]

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 18.72 KB (-7.06% 🔽)
@sentry/browser - ES5 CDN Bundle (minified) 58.39 KB (-9.64% 🔽)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 17.42 KB (-7.67% 🔽)
@sentry/browser - ES6 CDN Bundle (minified) 52.55 KB (-9.36% 🔽)
@sentry/browser - Webpack (gzipped + minified) 19.18 KB (-17.46% 🔽)
@sentry/browser - Webpack (minified) 62.04 KB (-24.08% 🔽)
@sentry/react - Webpack (gzipped + minified) 19.2 KB (-17.51% 🔽)
@sentry/nextjs Client - Webpack (gzipped + minified) 42.87 KB (-10.8% 🔽)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 24.51 KB (-6% 🔽)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 22.98 KB (-6.14% 🔽)

@lobsterkatie lobsterkatie merged commit 69e6275 into 7.x Apr 29, 2022
@lobsterkatie lobsterkatie deleted the kmclb-fix-temporary-sucrase-ci-jobs branch April 29, 2022 23:08
@AbhiPrasad AbhiPrasad added this to the 7.0.0 milestone May 12, 2022
AbhiPrasad pushed a commit that referenced this pull request May 30, 2022
Until we officially switch over to rullup/sucrase builds, there are extra CI jobs running to test the build changes so far without us having had to switch to them yet. That said, the first attempt at creating such a system had a significant flaw, in that the supposedly-sucrase unit tests were actually running against the normal tsc build output. Further, it was very flaky, but it seems there might occasionally have been some scope bleed between the tsc-built file cache and the sucrase-built one. (It seems unlikely, I know, and I could be imagining it. Regardless, the changes here make it a moot point.)

This fixes those unit tests to run against sucrase builds, by adding a script to build with sucrase in the test job itself (and all other sucrase test jobs). It also moves a prior hack (rebuilding in es5 for node 8 tests) from the main test script into the new hacky script, so it can't get missed when pulling these temporary fixes out of the code when we switch. (That move is why our regular unit tests also run that script, to get the prior hack.) Finally, it makes a temporary modification to our base rollup config when in node 8, to enable the just-in-time rollup builds.

Disclaimer: This is definitely a hack, and is a little ugly, but it's also coming out in a week, so... ¯\\_(ツ)_/¯

Note: Node 8 sucrase tests are an xfail at this point, until more of the new build pipeline is merged.
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

Successfully merging this pull request may close these issues.

2 participants