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(dynamic-import-vars): parameter types for dynamicImportToGlob #1166

Merged

Conversation

poyoho
Copy link
Contributor

@poyoho poyoho commented Apr 19, 2022

Rollup Plugin Name: {dynamic-import-vars}

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.

List any relevant issue numbers:

Description

I saw the code of dynamicImportToGlob, use case in plugin and I try to use the dynamicImportToGlob with (BaseNode, String), it call an error.

And I think the sourceString is just used to format error msg. The first params is the estree node use to generate glob pattern.

And I make the sourceString as any will pass in my use case. So I think this is a type error.

@poyoho poyoho requested a review from shellscape as a code owner April 19, 2022 15:06
Copy link
Collaborator

@shellscape shellscape left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. Per our policy, fixes require tests to be accepted. Please update the types test (https://github.com/rollup/plugins/blob/master/packages/dynamic-import-vars/test/types.ts) accordingly for this change.

@poyoho
Copy link
Contributor Author

poyoho commented Apr 19, 2022

done

@shellscape
Copy link
Collaborator

Thanks. Can you update the PR description to include information on why the previous typing was incorrect, and why it needed to change? It's important for people referencing this PR from the changelog to be able to discern what the change was for. This is a breaking change because it's changing a function signature in the types, so it's important we document that well.

@poyoho
Copy link
Contributor Author

poyoho commented Apr 19, 2022

I saw the code of dynamicImportToGlob, use case in plugin and I try to use the dynamicImportToGlob with (BaseNode, String), it call an error.

And I think the sourceString is just used to format error msg. The first params is the estree node use to generate glob pattern. So I send a PR try to fix it.

@shellscape
Copy link
Collaborator

Thanks for that info, that'll come in handy I'm sure.

@shellscape shellscape changed the title fix: error types for dynamic-import-vars fix(dynamic-import-vars): parameter types for dynamicImportToGlob Apr 19, 2022
@shellscape shellscape merged commit f1e1f0a into rollup:master Apr 19, 2022
@poyoho poyoho deleted the chore/dynamic-import-vars-types-export branch April 19, 2022 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants