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

refactor: ExportData.imports to ExportData.hasImports #8355

Merged
merged 1 commit into from
May 27, 2022

Conversation

sapphi-red
Copy link
Member

@sapphi-red sapphi-red commented May 27, 2022

Description

ExportData.imports was only used for import.length > 0.
Rewrote imports into hasImports to remove depending on es-module-lexer's type.

refs #8352

Additional context

ExportData types needs to be exported because

  • optimizeDeps which is exported from src/node/index.ts returns DepOptimizationMetadata type including ExportData type
    • the return type of optimizeDeps could be changed to Promise<void> to avoid breaking change. I think the return type of optimizeDeps is too specific if it is considered as an public api.
    • optimizeDeps is used only from the cli
  • resolvedConfig.createResolver's param type is InternalResolveOptions and it includes ExportData
    • getDepsOptimizer could be removed from resolvedConfig.createResolver's param type

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.

@sapphi-red sapphi-red added the p1-chore Doesn't change code behavior (priority) label May 27, 2022
@sapphi-red
Copy link
Member Author

It look like this PR makes CI super flaky. 🤨

@patak-dev
Copy link
Member

I don't think it is the PR, the CI is super flaky today. Failing even before starting, when it is installing pnpm in mac os for example.

Also, wow... nice move with this change 🙌🏼

@patak-dev patak-dev changed the title refactor(optimizer): ExportData.imports to ExportData.hasImports refactor: ExportData.imports to ExportData.hasImports May 27, 2022
@patak-dev patak-dev merged commit 168de2d into vitejs:main May 27, 2022
@sapphi-red sapphi-red deleted the refactor/exports-data branch May 28, 2022 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p1-chore Doesn't change code behavior (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants