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

"Annotate" exported object to fix named / namespace imports of our API in Node ESM #57133

Merged
merged 20 commits into from
Mar 4, 2024

Conversation

jakebailey
Copy link
Member

@jakebailey jakebailey commented Jan 23, 2024

Our current API bundle looks like this:

var ts = (() => { ... })();
if (typeof module !== "undefined" && module.exports) {
	module.exports = ts;
}

cjs-module-lexer cannot understand this. As such, this code fails:

import { createSourceFile } from "typescript";
file:///home/jabaile/work/TypeScript/complain.mjs:2
    createSourceFile,
    ^^^^^^^^^^^^^^^^
SyntaxError: Named export 'createSourceFile' not found. The requested module 'typescript' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'typescript';

This has been the case with TypeScript for the entire time that Node's ESM support has been around. Even before 5.0, it didn't work since our exported object was still complicated.

However, there's a footgun; this code will not error:

import * as ts from "typescript";

In TypeScript code, we'll emit helpers that fix this up. But in native ESM, this will only be an object with a default property! You'll write ts.createSourceFile, and it'll be undefined and fail later.

To fix this, we need to make cjs-module-lexer aware of our exports. When emitting cjs, esbuild uses a trick to "declare" the names to Node:

module.exports = someComplicatedThing();
0 && (module.exports = {
	foo,
	bar,
});

This is dead code, but Node will still read the names.

If we do this same thing at the bottom of our custom bundle, we can also get named imports working. Unfortunately, there's no static way within esbuild for us to know the names via the API (likely, evanw/esbuild#3110 or evanw/esbuild#3281; I also filed evanw/esbuild#3607), so we have to import the bundle and grab the names. But, once we have them, we can tack the output onto the bundle.

To fix this, the PR now instead emits CJS, then uses the header/footer (instead of just a footer + IIFE) to do something like UMD. This lets us use esbuild to make the annotations.

This now means that both of these imports work!

import * as ts from "typescript";
import { createSourceFile } from "typescript";

ts.createSourceFile(...);

Fixes #56366

Related: #54018

@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Jan 23, 2024
@jakebailey jakebailey changed the title Update checkModuleFormat.mjs to test imports Support named / namespace imports of TypeScript API Jan 23, 2024
@jakebailey
Copy link
Member Author

@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 23, 2024

Heya @jakebailey, I've started to run the tarball bundle task on this PR at 485ca88. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 23, 2024

Hey @jakebailey, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/159626/artifacts?artifactName=tgz&fileId=1C40E4A0A75979D60D03E8F99E4EF328CB048443A14379EF5CC79AF3DEEB466302&fileName=/typescript-5.4.0-insiders.20240123.tgz"
    }
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@5.4.0-pr-57133-2".;

@jakebailey
Copy link
Member Author

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 23, 2024

Heya @jakebailey, I've started to run the regular perf test suite on this PR at 485ca88. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

@jakebailey
The results of the perf run you requested are in!

Here they are:

tsc

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Angular - node (v18.15.0, x64)
Memory used 295,641k (± 0.01%) 295,659k (± 0.01%) ~ 295,628k 295,708k p=0.296 n=6
Parse Time 2.66s (± 0.31%) 2.67s (± 0.31%) ~ 2.66s 2.68s p=1.000 n=6
Bind Time 0.83s (± 0.62%) 0.83s (± 1.08%) ~ 0.82s 0.84s p=0.541 n=6
Check Time 8.19s (± 0.18%) 8.19s (± 0.34%) ~ 8.15s 8.23s p=0.742 n=6
Emit Time 7.09s (± 0.37%) 7.12s (± 0.66%) ~ 7.07s 7.20s p=0.198 n=6
Total Time 18.77s (± 0.18%) 18.81s (± 0.30%) ~ 18.73s 18.88s p=0.260 n=6
Compiler-Unions - node (v18.15.0, x64)
Memory used 193,926k (± 1.46%) 193,910k (± 1.48%) ~ 191,496k 197,406k p=0.689 n=6
Parse Time 1.35s (± 0.81%) 1.36s (± 0.77%) +0.01s (+ 1.11%) 1.35s 1.38s p=0.046 n=6
Bind Time 0.72s (± 0.00%) 0.72s (± 0.00%) ~ 0.72s 0.72s p=1.000 n=6
Check Time 9.35s (± 0.40%) 9.35s (± 0.34%) ~ 9.31s 9.40s p=0.808 n=6
Emit Time 2.61s (± 0.45%) 2.61s (± 0.86%) ~ 2.60s 2.66s p=0.933 n=6
Total Time 14.04s (± 0.24%) 14.04s (± 0.30%) ~ 14.00s 14.10s p=0.936 n=6
Monaco - node (v18.15.0, x64)
Memory used 347,455k (± 0.00%) 347,450k (± 0.00%) ~ 347,438k 347,481k p=0.520 n=6
Parse Time 2.47s (± 0.61%) 2.48s (± 0.47%) ~ 2.47s 2.50s p=0.367 n=6
Bind Time 0.93s (± 0.00%) 0.93s (± 0.44%) ~ 0.92s 0.93s p=0.405 n=6
Check Time 6.93s (± 0.61%) 6.91s (± 0.18%) ~ 6.90s 6.93s p=1.000 n=6
Emit Time 4.06s (± 0.29%) 4.05s (± 0.40%) ~ 4.03s 4.07s p=0.285 n=6
Total Time 14.39s (± 0.29%) 14.37s (± 0.13%) ~ 14.35s 14.40s p=0.517 n=6
TFS - node (v18.15.0, x64)
Memory used 302,860k (± 0.01%) 302,840k (± 0.00%) ~ 302,823k 302,860k p=0.378 n=6
Parse Time 2.01s (± 0.77%) 2.01s (± 0.73%) ~ 1.99s 2.03s p=0.934 n=6
Bind Time 1.01s (± 0.81%) 1.00s (± 0.98%) ~ 0.99s 1.02s p=0.282 n=6
Check Time 6.32s (± 0.33%) 6.32s (± 0.19%) ~ 6.31s 6.34s p=0.803 n=6
Emit Time 3.60s (± 0.42%) 3.60s (± 0.66%) ~ 3.57s 3.63s p=0.935 n=6
Total Time 12.94s (± 0.20%) 12.93s (± 0.23%) ~ 12.90s 12.99s p=0.934 n=6
material-ui - node (v18.15.0, x64)
Memory used 511,289k (± 0.00%) 511,298k (± 0.00%) ~ 511,276k 511,325k p=0.336 n=6
Parse Time 2.65s (± 0.41%) 2.65s (± 0.74%) ~ 2.63s 2.68s p=0.555 n=6
Bind Time 1.00s (± 1.05%) 1.00s (± 0.63%) ~ 0.99s 1.01s p=0.388 n=6
Check Time 17.26s (± 0.42%) 17.18s (± 0.48%) ~ 17.04s 17.27s p=0.196 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 20.90s (± 0.35%) 20.84s (± 0.37%) ~ 20.70s 20.91s p=0.295 n=6
mui-docs - node (v18.15.0, x64)
Memory used 1,696,143k (± 0.00%) 1,696,112k (± 0.00%) ~ 1,696,066k 1,696,173k p=0.199 n=6
Parse Time 6.54s (± 0.22%) 6.54s (± 0.34%) ~ 6.52s 6.58s p=0.622 n=6
Bind Time 2.35s (± 0.42%) 2.36s (± 0.51%) ~ 2.34s 2.37s p=0.507 n=6
Check Time 55.42s (± 0.56%) 55.47s (± 0.44%) ~ 55.18s 55.90s p=0.872 n=6
Emit Time 0.16s (± 0.00%) 0.16s (± 2.52%) ~ 0.16s 0.17s p=0.405 n=6
Total Time 64.47s (± 0.49%) 64.52s (± 0.38%) ~ 64.22s 64.95s p=0.810 n=6
self-build-src - node (v18.15.0, x64)
Memory used 2,413,093k (± 0.03%) 2,412,933k (± 0.01%) ~ 2,412,681k 2,413,207k p=1.000 n=6
Parse Time 4.94s (± 0.78%) 4.93s (± 0.86%) ~ 4.87s 4.98s p=0.936 n=6
Bind Time 1.87s (± 0.99%) 1.88s (± 0.82%) ~ 1.87s 1.90s p=0.797 n=6
Check Time 33.42s (± 0.23%) 33.51s (± 0.50%) ~ 33.29s 33.76s p=0.230 n=6
Emit Time 2.70s (± 0.80%) 2.69s (± 0.99%) ~ 2.66s 2.74s p=0.520 n=6
Total Time 42.95s (± 0.23%) 43.04s (± 0.27%) ~ 42.90s 43.21s p=0.230 n=6
self-compiler - node (v18.15.0, x64)
Memory used 419,692k (± 0.01%) 419,705k (± 0.01%) ~ 419,663k 419,745k p=0.689 n=6
Parse Time 2.71s (± 2.34%) 2.73s (± 2.87%) ~ 2.65s 2.82s p=0.872 n=6
Bind Time 1.17s (± 6.20%) 1.14s (± 6.58%) ~ 1.07s 1.22s p=0.413 n=6
Check Time 15.11s (± 0.32%) 15.11s (± 0.18%) ~ 15.06s 15.13s p=0.936 n=6
Emit Time 1.16s (± 1.84%) 1.16s (± 1.19%) ~ 1.14s 1.18s p=0.677 n=6
Total Time 20.16s (± 0.38%) 20.14s (± 0.11%) ~ 20.12s 20.18s p=1.000 n=6
vscode - node (v18.15.0, x64)
Memory used 2,807,583k (± 0.00%) 2,807,625k (± 0.00%) ~ 2,807,540k 2,807,696k p=0.173 n=6
Parse Time 10.62s (± 0.23%) 10.63s (± 0.28%) ~ 10.59s 10.67s p=0.469 n=6
Bind Time 3.39s (± 0.26%) 3.38s (± 0.44%) ~ 3.37s 3.41s p=0.284 n=6
Check Time 59.57s (± 0.31%) 59.56s (± 0.18%) ~ 59.41s 59.71s p=0.873 n=6
Emit Time 16.15s (± 0.52%) 16.11s (± 0.39%) ~ 16.00s 16.18s p=1.000 n=6
Total Time 89.72s (± 0.27%) 89.69s (± 0.09%) ~ 89.58s 89.76s p=0.872 n=6
webpack - node (v18.15.0, x64)
Memory used 392,437k (± 0.01%) 392,467k (± 0.02%) ~ 392,398k 392,622k p=0.689 n=6
Parse Time 3.08s (± 0.57%) 3.06s (± 1.04%) ~ 3.02s 3.11s p=0.418 n=6
Bind Time 1.40s (± 0.54%) 1.40s (± 0.99%) ~ 1.38s 1.41s p=0.453 n=6
Check Time 13.96s (± 0.32%) 13.96s (± 0.31%) ~ 13.92s 14.04s p=0.747 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 18.43s (± 0.26%) 18.42s (± 0.25%) ~ 18.37s 18.49s p=0.810 n=6
xstate - node (v18.15.0, x64)
Memory used 513,392k (± 0.01%) 513,428k (± 0.01%) ~ 513,355k 513,505k p=0.230 n=6
Parse Time 3.29s (± 0.31%) 3.28s (± 0.26%) ~ 3.26s 3.28s p=0.065 n=6
Bind Time 1.54s (± 0.53%) 1.54s (± 0.54%) ~ 1.54s 1.56s p=0.673 n=6
Check Time 2.85s (± 0.76%) 2.85s (± 0.38%) ~ 2.83s 2.86s p=1.000 n=6
Emit Time 0.08s (± 0.00%) 0.08s (± 0.00%) ~ 0.08s 0.08s p=1.000 n=6
Total Time 7.76s (± 0.23%) 7.75s (± 0.10%) ~ 7.74s 7.76s p=1.000 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Angular - node (v18.15.0, x64)
  • Compiler-Unions - node (v18.15.0, x64)
  • Monaco - node (v18.15.0, x64)
  • TFS - node (v18.15.0, x64)
  • material-ui - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

tsserver

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,351ms (± 0.32%) 2,352ms (± 0.66%) ~ 2,332ms 2,377ms p=1.000 n=6
Req 2 - geterr 5,490ms (± 1.16%) 5,492ms (± 1.56%) ~ 5,415ms 5,603ms p=0.575 n=6
Req 3 - references 322ms (± 0.48%) 323ms (± 0.51%) ~ 321ms 325ms p=0.438 n=6
Req 4 - navto 277ms (± 1.31%) 276ms (± 1.28%) ~ 271ms 279ms p=0.438 n=6
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) ~ 1,356 1,356 p=1.000 n=6
Req 5 - completionInfo 85ms (± 5.36%) 85ms (± 7.43%) ~ 79ms 93ms p=1.000 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,468ms (± 1.19%) 2,472ms (± 1.32%) ~ 2,413ms 2,506ms p=0.575 n=6
Req 2 - geterr 4,173ms (± 1.96%) 4,233ms (± 1.77%) ~ 4,134ms 4,296ms p=0.093 n=6
Req 3 - references 338ms (± 1.64%) 336ms (± 1.62%) ~ 331ms 343ms p=0.746 n=6
Req 4 - navto 285ms (± 0.41%) 284ms (± 0.36%) ~ 283ms 286ms p=0.456 n=6
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) ~ 1,518 1,518 p=1.000 n=6
Req 5 - completionInfo 84ms (± 7.13%) 85ms (± 6.65%) ~ 78ms 90ms p=0.683 n=6
xstateTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,610ms (± 0.46%) 2,614ms (± 0.66%) ~ 2,580ms 2,626ms p=0.261 n=6
Req 2 - geterr 1,739ms (± 1.70%) 1,715ms (± 2.21%) ~ 1,660ms 1,747ms p=0.149 n=6
Req 3 - references 124ms (± 6.95%) 110ms (± 7.26%) 🟩-14ms (-11.07%) 105ms 126ms p=0.043 n=6
Req 4 - navto 370ms (± 0.22%) 371ms (± 0.11%) ~ 370ms 371ms p=0.248 n=6
Req 5 - completionInfo count 2,078 (± 0.00%) 2,078 (± 0.00%) ~ 2,078 2,078 p=1.000 n=6
Req 5 - completionInfo 312ms (± 1.48%) 311ms (± 1.46%) ~ 304ms 316ms p=0.746 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • CompilerTSServer - node (v18.15.0, x64)
  • Compiler-UnionsTSServer - node (v18.15.0, x64)
  • xstateTSServer - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

startup

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
tsc-startup - node (v18.15.0, x64)
Execution time 154.08ms (± 0.19%) 153.86ms (± 0.19%) -0.22ms (- 0.14%) 152.74ms 157.53ms p=0.000 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time 229.82ms (± 0.17%) 229.62ms (± 0.17%) -0.21ms (- 0.09%) 228.06ms 235.49ms p=0.000 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time 231.44ms (± 0.19%) 232.80ms (± 0.18%) +1.37ms (+ 0.59%) 231.10ms 239.00ms p=0.000 n=600
typescript-startup - node (v18.15.0, x64)
Execution time 231.16ms (± 0.19%) 232.48ms (± 0.17%) +1.32ms (+ 0.57%) 230.92ms 236.22ms p=0.000 n=600
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • tsc-startup - node (v18.15.0, x64)
  • tsserver-startup - node (v18.15.0, x64)
  • tsserverlibrary-startup - node (v18.15.0, x64)
  • typescript-startup - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@fatcerberus
Copy link

But in native ESM, this is the empty object! You'll write ts.createSourceFile, and it'll be undefined and fail later.

This feels like it should be considered a bug in Node. IMO if it's going to error on named imports because it doesn't understand how module.exports is constructed, then it should also error on a wildcard import instead of just silently returning an empty object. That's a pretty big footgun; I don't imagine TS users are the only victims of it.

@jakebailey jakebailey changed the title Support named / namespace imports of TypeScript API Support native ESM named / namespace imports of TypeScript API Jan 23, 2024
@jakebailey
Copy link
Member Author

But in native ESM, this is the empty object! You'll write ts.createSourceFile, and it'll be undefined and fail later.

This feels like it should be considered a bug in Node. IMO if it's going to error on named imports because it doesn't understand how module.exports is constructed, then it should also error on a wildcard import instead of just silently returning an empty object. That's a pretty big footgun; I don't imagine TS users are the only victims of it.

I think I over simplified; .default works, so it's not the empty object.

@jakebailey jakebailey marked this pull request as draft January 23, 2024 20:42
@fatcerberus
Copy link

Even so, that’s still a pretty big footgun. Anyone successfully doing a wildcard import from a CJS module probably expects to be able to do more than just foo.default.bar(), else they would just default-import in the first place.

@jakebailey
Copy link
Member Author

One problem with this approach is that live bindings don't actually work if you use named or namespace imports from native ESM. I'm not totally sure why, as my understanding was that they worked in esbuild thanks to all of the getters and such.

I can reproduce exactly the same behavior using esbuild's CJS output, so maybe this isn't a deal breaker and I'm misunderstanding things (live bindings work for the default export). Node also says that they don't update: https://nodejs.org/api/esm.html#:~:text=Live%20binding%20updates%20or%20new%20exports%20added%20to%20module.exports%20are%20not%20detected%20for%20these%20named%20exports.

It's not like we have any actual bindings that update after the fact, besides say, sys, which is our only mutable export for "reasons".

The default export is definitely a better thing to be doing at the user level, though, but I'm not sure how to statically force users of the TS API to do so (and people definitely use a star import more often than a default).

@jakebailey
Copy link
Member Author

During the design meeting, @andrewbranch pointed to #54018, which funnily contains the same explanation I independently described (which I am going to place on the Somerton Scale as "subconscious appropriation" 😄)

@jakebailey jakebailey marked this pull request as ready for review January 25, 2024 03:38
@jakebailey
Copy link
Member Author

@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 29, 2024

Heya @jakebailey, I've started to run the tarball bundle task on this PR at b1acdfa. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 29, 2024

Hey @jakebailey, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/160113/artifacts?artifactName=tgz&fileId=7CE6B3A2C4D1133E45A86C1029B1616B6BEF1F12A951A3B21769438F7E0FD2B502&fileName=/typescript-5.5.0-insiders.20240229.tgz"
    }
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@5.5.0-pr-57133-18".;

@jakebailey
Copy link
Member Author

Oof, this breaks monaco.

@jakebailey jakebailey marked this pull request as draft February 29, 2024 00:21
@jakebailey
Copy link
Member Author

@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 29, 2024

Heya @jakebailey, I've started to run the tarball bundle task on this PR at c798c02. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 29, 2024

Hey @jakebailey, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/160127/artifacts?artifactName=tgz&fileId=C762915C3F64666910B8DC510CBE50E0FEAC170213C029F3A7BBD0247C117D2D02&fileName=/typescript-5.5.0-insiders.20240229.tgz"
    }
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@5.5.0-pr-57133-22".;

@jakebailey
Copy link
Member Author

@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 29, 2024

Heya @jakebailey, I've started to run the tarball bundle task on this PR at 66ee8fe. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 29, 2024

Hey @jakebailey, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/160128/artifacts?artifactName=tgz&fileId=B6BB6961BE8626E907D82AD74F66A3F8751FFDA8CB194984935EBB67A304FD5202&fileName=/typescript-5.5.0-insiders.20240229.tgz"
    }
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@5.5.0-pr-57133-25".;

@jakebailey
Copy link
Member Author

Alright, it's fixed now. Arguably monaco is doing the wrong thing in their build by using var ts instead of the fake module.exports I added (my fault for not doing that when I fixed their codebase a while ago), but it's not hard to keep working in case someone else does this same thing.

@jakebailey jakebailey marked this pull request as ready for review February 29, 2024 20:15
@@ -2749,6 +2749,5 @@ export function isNodeLikeSystem(): boolean {
// and definitely exist.
return typeof process !== "undefined"
&& !!process.nextTick
&& !(process as any).browser
&& typeof module === "object";
Copy link
Member Author

Choose a reason for hiding this comment

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

In the new version, module is a parameter and is always provided. This check would no longer do anything. I'm not sure that it really matters that we don't have this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, I'm going to switch this back to the same definition it used to be, e.g. checking for require. The comment I left above about require stopped being correct at some point as I refined our output bundle format to rewrite require temporarily.

Copy link
Member Author

Choose a reason for hiding this comment

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

(I don't believe this will end up mattering in practice, but that's why we merge these sorts of things early in the cycle...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Milestone Bug PRs that fix a bug with a specific milestone
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

TS Build api failed when using node ESM module (mjs)
5 participants