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

React: Fix missing framework options in shim #21644

Merged
merged 2 commits into from
Mar 17, 2023

Conversation

tmeasday
Copy link
Member

Closes #21632

What I did

Don't assume presets.apply('frameworkOptions') will return an object, as we explicitly return null in some cases:

How to test

Comment out framework.options in a vite sandbox.

Checklist

  • Make sure your changes are tested (stories and/or unit, integration, or end-to-end tests)
  • Make sure to add/update documentation regarding your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Maintainers

  • If this PR should be tested against many or all sandboxes,
    make sure to add the ci:merged or ci:daily GH label to it.
  • Make sure this PR contains one of the labels below.

["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]

@tmeasday
Copy link
Member Author

@ndelangen an alternative solution here would be to always return an object for the frameworkOptions. Then we could call presets.apply('frameworkOptions', {}) and know we'll get an object back (we don't currently due to the common preset linked above).

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

LGTM!

@shilman shilman changed the title Core: Allow missing framework options in Vite Core: Fix missing react framework options Mar 17, 2023
@shilman shilman changed the title Core: Fix missing react framework options React: Fix missing framework options in shim Mar 17, 2023
@shilman shilman added react and removed core labels Mar 17, 2023
@shilman shilman merged commit 64ada05 into next Mar 17, 2023
@shilman shilman deleted the tom/21632-fix-missing-framework-options branch March 17, 2023 01:05
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.

[Bug]: Cannot destructure property 'legacyRootApi' of '(intermediate value)' as it is undefined.
2 participants