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(utils): setup extension by format in getRollupOutput (maybe breaking-change) #244

Merged
merged 1 commit into from
Jul 11, 2024

Conversation

syi0808
Copy link
Contributor

@syi0808 syi0808 commented Jul 11, 2024

What:
Set build output file extension by target format.

Why:
testing-library/react-testing-library#1338
I looking for a solution to this issue.
First of all, the issue was different from testing-library/dom, which is referred to in testing-library/react, and testing-library/dom, which is referred to in testing-library/user-event.
So I solved this problem by changing the extension of the esm file to .mjs.

testing-library was using that library as a build tool, and found out that within that library they were building extensions as fixed as .js and are trying to fix it.

Screenshot

Before change extension

Screenshot 2024-07-11 at 11 29 48 PM
After configure in testing-library/react, but getConfig().eventWrapper in testing-library/user-event is default function.

After change extension

Screenshot 2024-07-11 at 11 52 11 PM
After configure in testing-library/react, so getConfig().eventWrapper in testing-library/user-event is configured function.

How:
Set file extension string using format parameter.

Checklist:

  • Documentation
  • Tests
  • Ready to be merged

@syi0808 syi0808 changed the title fix(utils): setup extension by format in getRollupOutput fix(utils): setup extension by format in getRollupOutput (maybe breaking-change) Jul 11, 2024
@syi0808
Copy link
Contributor Author

syi0808 commented Jul 11, 2024

I think we would make BUILD_WITH_TYPE_EXTENSION as boolean option and applying extension if BUILD_WITH_TYPE_EXTENSION is true, it will be not breaking changes.

Copy link
Owner

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

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

I think this is fine, but I believe this would be a breaking change, no? I just want to verify that before I trigger a release.

@kentcdodds kentcdodds merged commit 530b9ea into kentcdodds:main Jul 11, 2024
7 checks passed
Copy link

🎉 This PR is included in version 16.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@syi0808
Copy link
Contributor Author

syi0808 commented Jul 12, 2024

I think this is fine, but I believe this would be a breaking change, no? I just want to verify that before I trigger a release.

I think so. Maybe libraries that use this should be change output file extension, if they want to upgrade version.
So maybe we change to optional this. and next major version set it default impl. How about it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants