Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: support import.meta.hot?.accept #12053

Conversation

sapphi-red
Copy link
Member

Description

Add support for import.meta.hot?.accept.

refs #11317

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the PR Title Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@sapphi-red sapphi-red added the p2-nice-to-have Not breaking anything but nice to have (priority) label Feb 14, 2023
Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

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

Nice!

Copy link
Member

@patak-dev patak-dev 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 great! Do you think we should wait until 4.2 to merge this one? I'm tempted to push it in a patch and consider it as a fix. Users may have expected this to work before.

@sapphi-red
Copy link
Member Author

Much credit goes to Antony and Lukas, who implemented/improved tree-shaking optional chaining.

I think we can release in a patch. I did a quick search but didn't find a code relying on static parsing. Also even if a code like that exists, it'd be easy to workaround.

@patak-dev patak-dev merged commit 081c27f into vitejs:main Feb 15, 2023
@sapphi-red sapphi-red deleted the feat/support-optional-chaining-import-meta-hot branch February 16, 2023 02:18
futurGH pushed a commit to futurGH/vite that referenced this pull request Feb 26, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants