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

Make the CLI bundle analysis compatible with older Remix versions that don't output a metafile #1357

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

blittle
Copy link
Contributor

@blittle blittle commented Sep 21, 2023

WHY are these changes introduced?

Fixes #0000

WHAT is this pull request doing?

HOW to test your changes?

Post-merge steps

Checklist

  • I've read the Contributing Guidelines
  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've added a changeset if this PR contains user-facing or noteworthy changes
  • I've added tests to cover my changes
  • I've added or updated the documentation

@@ -66,7 +75,7 @@ export async function getBundleAnalysisSummary(bundlePath: string) {
.split('\n')
.filter((line) => {
const match = line.match(
/(.*)\/node_modules\/(react-dom|@remix-run|@shopify\/hydrogen|react-router|react-router-dom)\/(.*)/g,
/(.*)(node_modules\/|server-assets-manifest:|server-entry-module:)(react-dom|@remix-run|@shopify\/hydrogen|react-router|react-router-dom)\/(.*)/g,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

An unrelated fix to the Regular expression hiding in the bundle summary Remix/React and other dependencies that are always present.

sizeMB: number,
bundleStats: boolean,
remixConfig: RemixConfig,
) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All the bundle analysis logic is moved in here, and only executed if the metafile exists

buildPathWorkerFile: string,
sizeMB: number,
remixConfig: RemixConfig,
) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If it doesn't exist, output this simple status, which is essentially what the CLI did prior to the new bundle analytics.

@blittle blittle merged commit 49974e7 into main Sep 21, 2023
10 checks passed
@blittle blittle deleted the bl-fix-bundle-metafile branch September 21, 2023 18:53
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.

None yet

2 participants