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

fix(schema): show payloadExtraction warning only when unset #18516

Merged
merged 4 commits into from Mar 13, 2023
Merged

fix(schema): show payloadExtraction warning only when unset #18516

merged 4 commits into from Mar 13, 2023

Conversation

hslee2008
Copy link
Contributor

πŸ”— Linked issue

No linked issue.

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This is only a minor change and I am not sure if it is a good one.

This change should be made because when users sets experimental.payloadExtraction to true on purpose, they are hinting that either they are doing this on purpose or wanting the warnings to be gone.

This code change only changes the code so that if the enabled property is undefined (meaning the user did not set any configuration), it shows the warnings, but if the user sets it to true there will be no warnings.

πŸ§ͺ Tests / Examples

notdefined

setfalse
settrue

@codesandbox
Copy link

codesandbox bot commented Jan 25, 2023

CodeSandbox logoCodeSandbox logoΒ  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@hslee2008 hslee2008 marked this pull request as draft January 25, 2023 15:03
@hslee2008 hslee2008 marked this pull request as ready for review January 25, 2023 15:09
Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

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

This is a nice change, thank you!

@danielroe danielroe changed the title Show payloadExtraction warning only when null or undefined fix(schema): only show payloadExtraction warning when it is unset Jan 25, 2023
Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

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

Oops, my apologies; I forgot how we are doing this. In fact we set this here:

https://github.com/nuxt/nuxt.js/blob/6e78f9dbb03a059814d1284511f732b901dea4f6/packages/nuxi/src/commands/build.ts#L30-L34

So we don't want to show warning always if it is null or undefined because it is only on prerendering that it is in fact enabled, and in that case it is because it is set to true.

@hslee2008
Copy link
Contributor Author

I pressed the wrong button. Sorry.

@hslee2008
Copy link
Contributor Author

hslee2008 commented Jan 25, 2023

Oops, my apologies; I forgot how we are doing this. In fact we set this here:

https://github.com/nuxt/nuxt.js/blob/6e78f9dbb03a059814d1284511f732b901dea4f6/packages/nuxi/src/commands/build.ts#L30-L34

So we don't want to show warning always if it is null or undefined because it is only on prerendering that it is in fact enabled, and in that case it is because it is set to true.

I want to work on this, but I am not exactly sure how it works.

Could you explain it a bit more? I am not sure what prerender is nor how to get the argument prerender in the experimental.ts file.

Or could you help me on this?

@danielroe danielroe requested a review from pi0 March 11, 2023 22:52
@danielroe danielroe dismissed their stale review March 11, 2023 22:52

implemented differently

@danielroe danielroe changed the title fix(schema): only show payloadExtraction warning when it is unset fix(schema): show payloadExtraction warning only when unset Mar 13, 2023
@danielroe danielroe merged commit e42d63a into nuxt:main Mar 13, 2023
@danielroe danielroe mentioned this pull request Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants