-
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
Module documentation tracking issue #52593
Module documentation tracking issue #52593
Comments
Proposed, very ambitious outline, subject to change:
|
Approximately everybody 😄 |
Another section we'll need is effectively "What is the right thing to put on DefinitelyTyped?" |
What module settings should my new project use? |
@DanielRosenwasser please refer to section 3.i |
All of them |
@andrewbranch Two more fields worth covering in 4.iii.c: |
I'm not sure which section this would go in, but there is a semi-obscure question/choice I'd like to get an authoritative answer on, so I'm kinda hijacking this issue as a place to resolve it. Question
It's common to have local files in which you might store utility types. Maybe you put them in a directory called
Here's some example usage in a multi-file playground. // @filename: index.ts
import type { Point } from "./util-types/only-types"
export const location: Point = {
x: 0,
y: 0,
} // @filename: util-types/only-types.d.ts
export interface Point {
x: number,
y: number,
} Potential AnswersI'm looking for a steer on whether the use of
The answer will help inform whether we should internally force the use of |
The answer to this question is unsatisfying to me. I would say it’s discouraged or even harmful (though it won’t be “deprecated”). At best, it’s a technique with serious pitfalls that can be leveraged by people who understand them enough to set up additional tooling and safeguards to make it viable. Because But the main reason I personally avoid this is just because it doesn’t copy into |
Never been so hyped for documentation |
How to make dual-mode packages? #53045 |
I'm not sure if this is too much, but guidance on how to navigate incompatible packages when migrating a TS project from CJS to ESM would be helpful. I can file tickets on projects to fix their package.json and build processes all day, but ultimately it can be very hard to know precisely what is broken, what to tell library authors, and what patch I need to apply to the package to hold me over in nodenext + CJS mode to prepare to go to nodenext + ESM mode. |
There’s enough done now to start sharing some in-progress content for those interested. I’ll keep this gist up to date as I finish significant chunks. Feel free to leave feedback in the gist comments. |
Quick update: this is getting fairly close to being done and anticipate getting a PR up to put this on the website in the coming weeks. I just pushed a fairly large update to the gist. |
I’m getting ready to merge this. There’s still more to do, but it’s complete enough to publish and iterate on. Feedback is welcome, so I’ll mention the things I already have on my immediate to-do that I won’t get to before merging
|
Amazing work, congrats @andrewbranch! 👏 One suggestion for now: have you considered putting the Theory section after Guides and References? In my experience most learners will not have the time or patience to read through all of it - they just want to learn how to fix a broken build or type errors. The guides could get them where they need to go quickly while forward-linking to references and theory as needed. |
Just a couple of feedback points:
|
|
|
I’m working on new documentation for modules in TypeScript. I’ll use this issue to track progress. Related:
baseUrl
does something it doesn't #51267The text was updated successfully, but these errors were encountered: