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

TypeScript 5.2, use tshy for hybrid builds #886

Merged
merged 1 commit into from Sep 13, 2023
Merged

TypeScript 5.2, use tshy for hybrid builds #886

merged 1 commit into from Sep 13, 2023

Conversation

isaacs
Copy link
Member

@isaacs isaacs commented Sep 13, 2023

This is a massive patch, but only a few things have really changed.

TypeScript upgraded to version 5.2, which has new and more restrictive behaviors around module loading and ESM/CommonJS dialect emitting.

To work around this, and provide a simpler and more consistent build experience, tshy is now used to build all modules, the built Test code, and used in the @tapjs/create-plugin initializer for use in future plugins.

The dist directories are thus renamed from mjs and cjs to the more comprehensible esm and commonjs. This is a no-op for most users, but it did mean a lot of edits to import paths in tests.

A shortcoming that was surfaced by the build change showed that it was possible to add a plugin that can only be loaded by require(), and not by import(). This is now detected, and the plugin addition is prevented in that case.

@isaacs isaacs force-pushed the isaacs/tshy branch 3 times, most recently from 276232e to d26788c Compare September 13, 2023 16:34
This is a massive patch, but only a few things have really changed.

TypeScript upgraded to version 5.2, which has new and more restrictive
behaviors around module loading and ESM/CommonJS dialect emitting.

To work around this, and provide a simpler and more consistent build
experience, tshy is now used to build all modules, the built Test code,
and used in the @tapjs/create-plugin initializer for use in future
plugins.

The dist directories are thus renamed from `mjs` and `cjs` to the more
comprehensible `esm` and `commonjs`. This is a no-op for most users, but
it did mean a lot of edits to import paths in tests.

A shortcoming that was surfaced by the build change showed that it was
possible to add a plugin that can _only_ be loaded by `require()`, and
not by `import()`. This is now detected, and the plugin addition is
prevented in that case.
@isaacs isaacs merged commit 0f27f73 into main Sep 13, 2023
6 checks passed
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

1 participant