You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/advanced/index.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,10 +12,9 @@ title: Advanced Cheatsheet
12
12
13
13
**Creating React + TypeScript Libraries**
14
14
15
-
The best tool for creating React + TS libraries right now is [`tsdx`](https://github.com/palmerhq/tsdx). Run `npx tsdx create` and select the "react" option. You can view [the React User Guide](https://github.com/palmerhq/tsdx/issues/5) for a few tips on React+TS library best practices and optimizations for production.
15
+
The best tool for creating React + TS libraries right now is [`tsdx`](https://github.com/palmerhq/tsdx). Run `npx tsdx create` and select the "react" option.
16
16
17
17
Another option is [Rollpkg](https://github.com/rafgraph/rollpkg), which uses Rollup and the TypeScript compiler (not Babel) to create packages. It includes default configs for TypeScript, Prettier, ESLint, and Jest (setup for use with React), as well as Bundlephobia package stats for each build.
18
18
19
-
- Be sure to also check [`basarat`'s guide](https://basarat.gitbooks.io/typescript/content/docs/quick/library.html) for library tsconfig settings.
20
19
- Alec Larson: [The best Rollup config for TypeScript libraries](https://gist.github.com/aleclarson/9900ed2a9a3119d865286b218e14d226)
21
20
- From the Angular world, check out https://github.com/bitjson/typescript-starter
TypeScript uses [TSDoc](https://github.com/Microsoft/tsdoc), a variant of JSDoc for TypeScript. This is very handy for writing component libraries and having useful descriptions pop up in autocomplete and other tooling (like the [Docz PropsTable](https://www.docz.site/docs/components-api#propstable)). The main thing to remember is to use `/** YOUR_COMMENT_HERE */` syntax in the line just above whatever you're annotating.
31
+
TypeScript uses [TSDoc](https://github.com/Microsoft/tsdoc), a variant of JSDoc for TypeScript. This is very handy for writing component libraries and having useful descriptions pop up in autocomplete and other tooling. The main thing to remember is to use `/** YOUR_COMMENT_HERE */` syntax in the line just above whatever you're annotating.
32
32
33
33
```tsx
34
34
interfaceMyComponentProps {
@@ -87,26 +87,6 @@ For developing with Storybook, read the docs I wrote over here: [https://storybo
87
87
88
88
[Something to add? File an issue](https://github.com/typescript-cheatsheets/react/issues/new).
89
89
90
-
## Migrating From Flow
91
-
92
-
You should check out large projects that are migrating from flow to pick up concerns and tips:
Integrating this with ESlint may be a problem. We haven't written much on this yet, please contribute if you have a strong opinion. [Here's a helpful gist.](https://gist.github.com/JirkaVebr/519c7597517e4ba756d5b89e7cb4cc0e)
146
126
147
-
For library authors, this is set up for you in [tsdx](https://github.com/palmerhq/tsdx/pull/45/files). You may also wish to check out the newer https://ts-engine.dev/ project.
127
+
For library authors, this is set up for you in [tsdx](https://github.com/palmerhq/tsdx/pull/45/files).
148
128
149
129
## Testing
150
130
@@ -188,7 +168,7 @@ Any other tips? Please contribute on this topic! [We have an ongoing issue here
188
168
Compiling large TS projects can get slow. Here are some tips:
189
169
190
170
- We have a dedicated repo tracking TS speed recommendations: https://github.com/typescript-cheatsheets/speed
191
-
- Use [TS 3.0 Project references](https://react-typescript-cheatsheet.netlify.app/docs/advanced/patterns_by_version#typescript-30)
171
+
- Use [TypeScript Project references](https://www.typescriptlang.org/docs/handbook/project-references.html)
192
172
- Check the official [TS performance wiki guidelines](https://github.com/microsoft/TypeScript/wiki/Performance) - note that [Dan Rossenwasser says to take it with a grain of salt](https://news.ycombinator.com/item?id=25199070)
0 commit comments