-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Design Meeting Notes, 6/4/2021 #44442
Comments
So, I think there is no need to support I'm not a team member, I guess this issue is comment allowed, let me know if it's not, I'll delete this. |
Can you clarify on this point? Browsers don't care about file extensions (only mimetypes), and IIRC module specifier resolution is implementation-defined per ECMAScript. I don't think there's anything non-standard there? |
Try to say it clear, I mean the code might be an ECMAScript-module, but it doesn't mean they have the same implementation: // this line won't work in the browser
import fs from 'node:fs/promises';
// this line won't work in node.js
import func from 'http://example.org/test.js'; For a long time, we don't know |
I thought But now I realize |
Has there been any further decision on the adoption of an |
I'd love for TS to recognize both ".mtsx" & ".ctsx" file extensions! |
…sion by TypeScript See [TS6054](https://github.com/search?q=repo%3Amicrosoft%2FTypeScript%20ts6054&type=code) See also microsoft/TypeScript#44442
There is still no way now more than 2 years after this discussion to indicate in a CommonJS React project that a specific file is a TypeScript MJS module making it impossible in a TypeScript CJS application to use any ESM only dependency which now means I am forced to use a |
Wish there was a solution here; anybody have one? |
ES Modules in Node
https://gist.github.com/weswigham/22a064ffa961d5921077132ae2f8da78
.tsx
syntax and how it affected JS module support..cjs
and.mjs
need a corresponding input format for them..cts
and.mts
.jsx
->.tsx
.mjsx
->.mtsx
?.mts
..mjsx
a thing?.mjs
can contain JSX..js
files we always parse JSX anyway..cjs
and.mjs
allowJs
.js
files..cjsx
,.mjsx
..js
and.jsx
in today's implementation?.cts
and.mts
extensions.cjs
and.mjs
respectively..cjs
" and "emit as.mjs
" from.ts
input..ctsx
and.mtsx
?.cts
includes JSX,.mts
includes JSX.<Type>expression
)expression as Type
<T>(x: T) => x
)<T,>(x: T) => x
or<T extends unknown>(x: T) => x
>
in the arrow is not illegal..cjs
for React? It sounds like a Node-ism..cts
and.mts
without JSX support and add it later..ts
syntax conflicting with JSX syntax.let x = <Foo>yadda;
- have to disallow thislet f = <T>(x: T) => x;
- have to disallow this<T>3</T>
// @jsx: true
.tsx
->.mts
being weird...but works better for.ts
->.mts
..mts
and.cts
parsed as.ts
, additional grammar error to inform people of what you meant if you wrote specific constructs..cjs
,.mjs
.d.cts
,.d.mts
.d.mts
if you import with an.mjs
extension, right?.d.tson
?The text was updated successfully, but these errors were encountered: