-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Design Meeting Notes, 6/15/2022 #49579
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
Comments
The module resolution is extremely confusing, and this doesn't even take into account tools like ESLint that traverse the file system ( What if the extension in imports were ditched, and instead assumed/derived by compiler options?
Or if that is still too confusing, being explicit with an |
That just moves the problem elsewhere and introduces more configuration. You can't unconditionally add file extensions -- importing from import 'vs/editor/editor.all'; so now we need some additional configuration that controls which imports of the form All of this configuration effectively takes us backwards in the journey to making sure files are transpilable without needing extra information from the file system or from other files in the system, which is a key source of performance gain in a ton of scenarios including extant bundlers like esbuild, and our own ability to parallelize emit in the future. |
Please add "we hand-write ambient declarations" to the "hypotheses" 😅 https://github.com/facebook/docusaurus/blob/5746c58f4145f56b92512095bce71428638d9d45/packages/docusaurus-plugin-content-docs/src/plugin-content-docs.d.ts#L620-L622 Now we compile with |
Hey folks, thanks so much for making these meeting notes public like this! It provides wonderful transparency to the community. I learned a lot from reading this issue and the linked gist. ❤️ I don't have much in the way of useful solutions to add, but I wanted to share my own confusion with TypeScript's This project uses Rollup to build package outputs, and TypeScript is just used to produce type declaration files. It supports building packages with multiple entry-points using the following kind-of-awkward pattern where, in addition to {
"exports": {
".": {
"quilt:from-source": "./source/index.ts",
"quilt:esnext": "./build/esnext/index.esnext",
"import": "./build/esm/index.mjs",
"require": "./build/cjs/index.cjs"
},
"./testing": {
"quilt:from-source": "./source/testing/index.ts",
"quilt:esnext": "./build/esnext/testing/index.esnext",
"import": "./build/esm/testing/index.mjs",
"require": "./build/cjs/testing/index.cjs"
}
},
"types": "./build/typescript/index.d.ts",
"typesVersions": {
"*": {
"testing": [
"./build/typescript/testing/index.d.ts"
]
}
}
} These can get pretty annoying to maintain — here’s the most complex version of this pattern in the monorepo — so I was really excited by the news that a I totally understand there are problems with allowing you to import from the |
@lemonmade I think you may have lost me between what configuration you are using for the development of Quilt and what configuration Quilt is generating for users. E.g., you said
but the |
Consider this a voice of demand then 😄 In SvelteKit we have to keep a somewhat ugly ambient modules hack because of this (similar to @Josh-Cena) (https://github.com/sveltejs/kit/blob/master/packages/kit/types/ambient.d.ts#L71) and we'd very much like to switch to using export maps only instead, which right now doesn't work because the export resolution is not part of the It's also very strange that we need to reference ambient files (d.ts files) like |
More-Specific
TemplateStringsArray
#49552
TemplateStringsArray
type.tsc
, but the type-system might be powerful enough now.A Tour of Module Resolution Strategies
https://gist.github.com/andrewbranch/3020c4e24092bd37f7e210d6f050ef26
.js
as a module extension" for Node.js.node
.--moduleResolution node
.exports
field.node
mode doesn't understand that.node
?exports
..ts
to.js
?.d.ts
resolution?.ts
extensions get preserved in.d.ts
files?.js
files? They aren't.ts
files.The text was updated successfully, but these errors were encountered: