Skip to content

Conversation

@markerikson
Copy link
Collaborator

@markerikson markerikson commented Jun 28, 2022

This PR:

  • Adds the ability to run a bundle size analysis on our Next builds
  • Updates Next to 12.2: https://nextjs.org/blog/next-12-2
    • Fixed a few new TS errors that popped up where some query params could be undefined apparently
  • Updates our build config to use Next's built-in SWC support for compiling JS instead of Babel, and customizes the browserslist setting to continue targeting "chrome 95" instead of the default list of browsers

Per local build checks, I've confirmed that SWC + the default browsers adds about 40KB per bundle on top of Babel (where we have about 550KB as a baseline), but SWC + "chrome 95" drops 8KB. So, a very small win for bundle size.

Compile times in dev seem to drop from 40s for / and 26s for /recording, to 20s and 13s respectively.

@markerikson markerikson requested review from bvaughn and jcmorrow June 28, 2022 20:53
@vercel
Copy link

vercel bot commented Jun 28, 2022

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

Name Status Preview Updated
devtools ✅ Ready (Inspect) Visit Preview Jun 28, 2022 at 9:49PM (UTC)

Comment on lines +87 to 89
const message = getQueryValue(req.query.error_description!);

res.redirect("/browser/error?type=auth&message=" + encodeURIComponent(message));
Copy link

Choose a reason for hiding this comment

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

Untrusted user input in redirect() can result in Open Redirect vulnerability. (Lines 87-89)

⚪️ This finding does not block your pull request.
🙈 From ajinabraham.njsscan.open_redirect.express_open_redirect.

@markerikson markerikson force-pushed the feature/FE-348-next-12.2 branch from b554dcc to a6a2be3 Compare June 28, 2022 21:22
Copy link
Contributor

@bvaughn bvaughn left a comment

Choose a reason for hiding this comment

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

👍🏼

@markerikson
Copy link
Collaborator Author

markerikson commented Jun 28, 2022

While not actually changes in the PR itself, I'm trying out some alternate settings with Vercel to see if I can get it to do a better job of caching Yarn's .yarn/cache folder and our root node_modules, by setting ENABLE_ROOT_PATH_BUILD_CACHE=1 as a Vercel env var, and changing the install command to be YARN_CACHE_FOLDER=./.next/cache/yarn-cache yarn install:

@markerikson
Copy link
Collaborator Author

Also: this PR does not update Jest to use SWC, or remove any of our Babel deps. We oughta try that later.

@markerikson
Copy link
Collaborator Author

Success!

Looking up build cache...
Build cache downloaded [445.98 MB]: 24700.046ms
Running "install" command: `YARN_CACHE_FOLDER=./.next/cache/yarn-cache yarn install`...
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed in 0s 679ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 2374 packages were already cached
➤ YN0000: └ Completed in 1s 541ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed in 9s 533ms

@markerikson markerikson merged commit e7536b6 into main Jun 28, 2022
@markerikson markerikson deleted the feature/FE-348-next-12.2 branch June 28, 2022 22:02
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.

3 participants