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 @koddson/textarea-caret breaking non-ESM builds #2244

Conversation

iansan5653
Copy link
Contributor

Fixes #2238 breaking non-ESM builds by inlining the entire module. This also allows us to inline the bug fixes / workaround hacks that we were originally calling after importing. In addition, it allows us to inline the types instead of defining a .d.ts file.

I have tested this in Storybook and backported the change to Memex to test there as well.

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

@iansan5653 iansan5653 self-assigned this Aug 18, 2022
@iansan5653 iansan5653 requested a review from a team August 18, 2022 15:52
@changeset-bot
Copy link

changeset-bot bot commented Aug 18, 2022

🦋 Changeset detected

Latest commit: d9cac67

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment on lines +58 to +59
* Adapted from https://github.com/koddsson/textarea-caret-position, which was itself
* forked from https://github.com/component/textarea-caret-position.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm no expert on licensing. Both source projects are MIT-licensed - is this sufficient attribution? Do we also need to pull in the copyright statements from those licenses?

Copy link
Contributor

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 👍

@github-actions
Copy link
Contributor

github-actions bot commented Aug 18, 2022

size-limit report 📦

Path Size
dist/browser.esm.js 75.62 KB (-0.19% 🔽)
dist/browser.umd.js 76.23 KB (-0.17% 🔽)

@iansan5653 iansan5653 temporarily deployed to github-pages August 18, 2022 16:04 Inactive
Copy link
Contributor

@colebemis colebemis left a comment

Choose a reason for hiding this comment

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

Thank you, @iansan5653 💖

Comment on lines +58 to +59
* Adapted from https://github.com/koddsson/textarea-caret-position, which was itself
* forked from https://github.com/component/textarea-caret-position.
Copy link
Contributor

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 👍

@colebemis colebemis enabled auto-merge (squash) August 18, 2022 20:43
@colebemis colebemis temporarily deployed to github-pages August 18, 2022 20:51 Inactive
@colebemis colebemis merged commit cf6f0e6 into main Aug 18, 2022
@colebemis colebemis deleted the 2238-regression-inlineautocomplete-uses-esm-only-module-textarea-caret-breaking-nextjs branch August 18, 2022 20:53
@primer-css primer-css mentioned this pull request Aug 18, 2022
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.

[Regression] InlineAutocomplete uses ESM only module textarea-caret breaking Next.js
2 participants