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

Upgrade clipboard-polyfill to drop custom typings #7587

Closed
wants to merge 1 commit into from

Conversation

aduth
Copy link
Member

@aduth aduth commented Jan 6, 2023

🛠 Summary of changes

Updates clipboard-polyfill to the latest version to be able to remove a workaround which was added in #5977 for compatibility with default TypeScript DOM types (see upstream lgarron/clipboard-polyfill#148).

Draft until the new version is stable, not release candidate

📜 Testing Plan

As of #7563, clipboard-polyfill is only relevant for tests, so there should be no user-facing impact by this upgrade.

  1. yarn test and yarn typecheck should both pass

changelog: Internal, Dependencies, Update dependencies to latest versions
@aduth
Copy link
Member Author

aduth commented Jan 9, 2023

I may need to put this on pause for now, as it appears that clipboard-polyfill is going ESM-only with the v4 release, and our Mocha tests still rely on CommonJS, which is not compatible. We should probably seek to go ESM, but it's a bit tricky to do for the moment, since we use Babel's on-the-fly transpilation, for which there's not stable support in ESM currently.

See the "Note" at the very end of the above documentation:

Note: @babel/register does not support compiling native Node.js ES modules on the fly, since currently there is no stable API for intercepting ES modules loading.

I notice there are some community projects implementing the experimental Loader API, but (1) I'd prefer something official and (2) as not-unexpected, the experimental APIs have changed such that those projects don't appear to be functional anymore anyways.

@aduth aduth closed this Jan 9, 2023
@aduth aduth deleted the aduth-clipboard-polyfill-types branch January 9, 2023 14:31
This pull request was closed.
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.

2 participants