GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Fix __importDefault when used on typescript libraries by jakebailey · Pull Request #51474 · microsoft/TypeScript Conversation
|
|
TypeScript Bot (@typescript-bot) pack this |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Heya Jake Bailey (@jakebailey), I've started to run the tarball bundle task on this PR at d25da73. You can monitor the build here. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Hey Jake Bailey (@jakebailey), I've packed this into an installable tgz. You can install it for testing by referencing it in your and then running There is also a playground for this build and an npm module you can use via |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This does fix the issue, but, I'm not 100% sure this is good or not. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Not sure if this is any help, but esbuild mention this in their docs |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Yeah, I've seen that, and https://github.com/evanw/bundler-esm-cjs-tests. Unfortunately it seems like in addition to this other stuff, tslib / TS's helpers are another aspect that need to be considered, so I don't know if I can extract a decision out of that. I'll just have to test a bunch of cases, I guess. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
A table of behaviors, where
Without hacking things to drop |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Maybe Wesley Wigham (@weswigham) or Ron Buckton (@rbuckton) have some insight here? (See also the issue in question, #51473.) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I'm not a huge fan - we tell people not to do this all the time. Since we only want this for compat, I imagine manipulating the marker may be better. Which, on that note, can't we make the marker not be emitted by using |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I haven't found a way yet. esbuild's Also, I guess I can just hack it... |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Wait, I'm wrong, |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hm, but that only helps the bundler. It breaks everything else :( |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Wot? It's definitely a runtime feature we transpile to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
With a hack in place to drop this helper:
So, that restores the status quo. See also evanw/esbuild#1971 but this does seem to be exactly the thing the esbuild docs refer to. I was unable to get the suggestions there to work; neither |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Huh, you're right. I must have tested and gotten an error for this a while ago and then assumed it was because |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Okay, changed to
So, this makes us match old TS when bundled, which was the goal. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I can't read. It's fine. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This should be final now, if you wanted to take another look. I plan to add smoke tests for this to #51464. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
__esModule in ts cause breaking change
There was an error while loading. Please reload this page.