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(globImport): import.meta.glob second arguments compatible with template literal #10961

Closed
wants to merge 3 commits into from

Conversation

sun0day
Copy link
Member

@sun0day sun0day commented Nov 17, 2022

Description

fixes #10947

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 Commit 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.

patak-dev
patak-dev previously approved these changes Nov 17, 2022
@patak-dev patak-dev added the p3-minor-bug An edge case that only affects very specific usage (priority) label Nov 17, 2022
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.

Actually it looks like there's a lot of errors that can be improved in this file, but not completely necessary for this PR. It could be done as a followup.

packages/vite/src/node/plugins/importMetaGlob.ts Outdated Show resolved Hide resolved
packages/vite/src/node/plugins/importMetaGlob.ts Outdated Show resolved Hide resolved
@patak-dev
Copy link
Member

@sun0day we discussed this with other team members, and while we think that it is worth supporting template literals here. There are other places where we are using Json5 to do the options parsing and template literals aren't valid there either. So if we only support them here, it is going to be more surprising than at least being consistent. I'll put an on hold label to the PR, we should wait for full support in other options before merging it. Or we could decide the complexity and time isn't worth supporting this across the board. Leaving it open anyways to see if this is an important enough use case for others to keep digging into.

@sun0day
Copy link
Member Author

sun0day commented Nov 17, 2022

@sun0day we discussed this with other team members, and while we think that it is worth supporting template literals here. There are other places where we are using Json5 to do the options parsing and template literals aren't valid there either. So if we only support them here, it is going to be more surprising than at least being consistent. I'll put an on hold label to the PR, we should wait for full support in other options before merging it. Or we could decide the complexity and time isn't worth supporting this across the board. Leaving it open anyways to see if this is an important enough use case for others to keep digging into.

Ok, feel free to merge or close this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
on hold p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

import.meta.glob as: 'raw' fails for template strings
3 participants