phryneas / remark-typescript-tools

MIT License
129 stars 7 forks source link

Support for Docusaurus v3 #13

Open ezzatron opened 7 months ago

ezzatron commented 7 months ago

I recently tried upgrading some Docusaurus sites I maintain to v3, and it seems like remark-typescript-tools doesn't work so well with Docusaurus v3 (or maybe MDX v3?). Here are some screenshots to illustrate what happens:


The import statements appear as plain text:

Screenshot 2023-11-16 at 12 53 06

So do the actual Tabs and TabItem components:

Screenshot 2023-11-16 at 12 54 00

Just checking if you're planning on supporting Docusarus v3? Thanks!

phryneas commented 7 months ago

As long as Redux Toolkit is on Docusaurus 2, I probably won't add support myself - but I'd be open to PRs.

One thing though: this looks like the output of this plugin isn't being parsed as mdx. There's not a lot this plugin can change about that in the first place - but maybe you were testing this in a .md file, not a .mdx file?

ezzatron commented 7 months ago

maybe you were testing this in a .md file, not a .mdx file?

Unfortunately, it is .mdx: https://github.com/snout-router/regexp/blob/main/docs/api/function/escape.mdx

aryaemami59 commented 7 months ago

Having the same issue, the code compiles just fine, but the tabs are not parsed. screencapture-localhost-3000-introduction-basic-usage-2023-11-21-16_24_09

phryneas commented 7 months ago

Seems like for Docusaurus 3, we need to pre-parse the JSX nodes we insert: https://github.com/facebook/docusaurus/discussions/9337

phryneas commented 7 months ago

I believe #14 might fix this, but I have no Docusaurus 3 project. Could someone try it and report back?

phryneas commented 7 months ago

@aryaemami59 I believe you were setting something up for reselect?

aryaemami59 commented 7 months ago

@aryaemami59 I believe you were setting something up for reselect?

Yes sir, I'm looking at the potential memory leak problem in reselect at the moment, when I'm done I'll try running the docs and let you know the results.

aryaemami59 commented 6 months ago

@phryneas I am so sorry I got caught up in other things and forgot about this, I just tested it and yes #14 fixes it. It is now compatible with docusaurus v3. You should be all good to close this issue.