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

Add test for proxying non-js files during bundle #3203

Closed
wants to merge 2 commits into from

Conversation

lukejacksonn
Copy link
Contributor

Changes

Add test for proxying non-js files during bundle; bug raised here #3109 and PR #3194.

Testing

This is the test.

Docs

Test for bug fix only.

@lukejacksonn lukejacksonn requested a review from a team as a code owner April 23, 2021 18:51
@vercel
Copy link

vercel bot commented Apr 23, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pikapkg/snowpack/6v3UK2fEFXdo9FWYRjYF2iZoY7sk
✅ Preview: https://snowpack-git-fork-lukejacksonn-optimize-bundle-pikapkg.vercel.app

@@ -110,8 +110,6 @@ export async function createBuildState(commandOptions: CommandOptions): Promise<
const isSSR = !!config.buildOptions.ssr;
const isHMR = getIsHmrEnabled(config);

// Seems like maybe we shouldn't be doing this...
config.buildOptions.resolveProxyImports = !config.optimize?.bundle;
Copy link
Collaborator

Choose a reason for hiding this comment

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

What’s the reason for this change? This is a big change to bundled behavior.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh—sorry. Just saw the linked issue / PR. Let me take a look at those.

Copy link
Collaborator

Choose a reason for hiding this comment

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

See comment here: #3194 (comment)

I’d like for this codechange NOT to land, because it‘s a breaking change. Reason our tests don’t catch it is because… well we just don’t have enough optimization tests. This is much riskier than our current test suite would indicate.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cool no worries, I was just writing a test for the change. Maybe we should look at increasing the coverage of the optimization tests generally in order to mitigate the chance of breakage in the future.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah I’d love to see that! And yeah as you pointed out in the PR, a file appearing that wasn’t there before was a hint that the output was very different. But in general, we have too few optimization tests. I added one recently using your new test setup and it wasn’t that hard to add (cssModules)! Once we have more of those, we can see how PRs like #3194 affect the output a lot better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed! Alright well I will close this here then and can look at adding more optimization tests once I've wrapped my head around what it is supposed to do in all the various configurations.

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