5 ms·
Looks really nice! Also, super happy that the interactive examples are not super sluggish code sandbox iframes, they're actually usable! A more typescript-first
by explodingcamera 4y ago
Looks really nice! Also, super happy that the interactive examples are not super sluggish code sandbox iframes, they're actually usable! A more typescript-first approach would have been nice, or at least typescript/JavaScript toggles, but the React team seems to be aware that that's an area they need to work on.
- johnny_canuck 4y agoThat is something I really dislike about the react-query docs, the examples are code sandboxes. Glad to see they didn't go that path here. I find they add a lot of friction when I am looking for a quick reference.
- danabramov 4y agoYeah we'd like to add TS throughout but it will require some technical and some content work. We didn't want to block the release on that.
- johtso 4y agoThe sexiest example I've seen is in the XState docs.. not sure what they're using to get the types into the tooltips.. https://stately.ai/docs/xstate/running-machines/react#usemachine-hook https://stately.ai/docs/xstate/running-machines/react#usemac...
- nawgz 4y agoLooks like Shiki: https://github.com/shikijs/shiki https://github.com/shikijs/shiki If you "inspect" the elements with the mouseovers, you can see they statically compiled the TS definition into the HTML. I guess it probably uses the same APIs to read the types VSCode does, given what they state the purpose of Shiki is.
- afidrya 4y agoIt's Docusaurus 2 + TwoSlash: https://docusaurus.io/blog/2022/08/01/announcing-docusaurus-2.0 https://docusaurus.io/blog/2022/08/01/announcing-docusaurus-...