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

chore: Analyze NextJS bundle size action #2803

Merged
merged 3 commits into from
Nov 14, 2023
Merged

chore: Analyze NextJS bundle size action #2803

merged 3 commits into from
Nov 14, 2023

Conversation

usame-algan
Copy link
Member

@usame-algan usame-algan commented Nov 13, 2023

What it solves

Resolves #2802

How this PR fixes it

Adds a new action to analyze bundle size changes of the nextjs app

Copy link

github-actions bot commented Nov 13, 2023

Branch preview

✅ Deploy successful!

https://bundle_analyzer--walletweb.review-wallet-web.5afe.dev

Copy link

github-actions bot commented Nov 13, 2023

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

Copy link

github-actions bot commented Nov 13, 2023

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 75.04% 10107/13469
🔴 Branches 49.57% 2054/4144
🔴 Functions 57.54% 1500/2607
🟡 Lines 76.6% 9142/11934

Test suite run success

1105 tests passing in 155 suites.

Report generated by 🧪jest coverage report action from f913961

@usame-algan usame-algan marked this pull request as ready for review November 14, 2023 09:21
Comment on lines +8 to +10
push:
branches:
- dev
Copy link
Member

Choose a reason for hiding this comment

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

Do we need this?

Copy link
Member Author

Choose a reason for hiding this comment

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

According to the template this should be the default branch which is dev for us so it can compare bundle sizes with dev later on.

defaults:
run:
# change this if your nextjs app does not live at the root of the repo
working-directory: ./
Copy link
Member

Choose a reason for hiding this comment

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

This is the root, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, and I think its correct since the generated artifact includes all our routes and the global chunk size: https://github.com/safe-global/safe-wallet-web/actions/runs/6853583646

Copy link
Member

Choose a reason for hiding this comment

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

I mean, you don't need to specify it as per the comment above.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah ok, I will try to remove it completely and see if it works.

Copy link
Member Author

Choose a reason for hiding this comment

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

Still works as expected 👍

Comment on lines 31 to 41
- name: Restore next build
uses: actions/cache@v3
id: restore-build-cache
env:
cache-name: cache-next-build
with:
# if you use a custom build directory, replace all instances of `.next` in this file with your build directory
# ex: if your app builds to `dist`, replace `.next` with `dist`
path: .next/cache
# change this if you prefer a more strict cache
key: ${{ runner.os }}-build-${{ env.cache-name }}
Copy link
Member

Choose a reason for hiding this comment

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

This should probably be in the build job in workflows/build?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we can remove this part since our ./.github/workflows/yarn already caches the result.

Copy link
Member

@katspaugh katspaugh left a comment

Choose a reason for hiding this comment

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

Lovely jobly

@usame-algan usame-algan merged commit 34f1bae into dev Nov 14, 2023
11 of 12 checks passed
@usame-algan usame-algan deleted the bundle-analyzer branch November 14, 2023 12:49
@github-actions github-actions bot locked and limited conversation to collaborators Nov 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add bundle analyzer action
2 participants