-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
📝 Enable codeblock TS transpilation #4149
📝 Enable codeblock TS transpilation #4149
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 886999e:
|
✅ Deploy Preview for redux-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
We shouldn't have the |
@phryneas has advised:
So theoretically it might be possible for all of the packages to stick under |
I definitely don't want to move the |
4e1ee88
to
f821145
Compare
@timdorr @markerikson: The resultant changes to the I've converted the 'writing tests' page to transpile the codeblocks, which can be previewed here: https://deploy-preview-4149--redux-docs.netlify.app/usage/writing-tests @timdorr I recommend specifically having a look at the snippet changes involved in Note that the benefit here is more than just creating a TS/JS tab - It also ensures that the snippet is actually valid code. I fixed up a couple of mistakes/missing imports while converting this page thanks to that. |
Looks pretty good to me! Do we have full Netlify caching turned on for the core docs site atm, the way we do for RTK? |
I have no idea personally. I can say that the netlify build did seem fast, but that could be because only this one page has any transpilation going on so far |
Well, the good news is GitHub knows exactly what mdx is and displays it the same as plain Markdown: https://github.com/Shrugsy/redux/blob/docs/enable-ts-codeblock-transpilation/docs/usage/WritingTests.mdx |
Yeah good point. Basically the thing I want to point out as a 'potential concern' is that the raw markdown will include portions in the snippet that are intended for use as virtual files, but not intended to be included on the final snippet (anything marked as For efficiency's sake, these may often be be partial pieces of code that aren't intended to make much sense for someone reading the docs, but are created to have the correct type signature, and may only include the necessary content that the relevant snippet file wants to import |
Oh hey, I completely forgot this was here :) @Shrugsy: any chance you could rebase this against the changes on |
63d6a67
to
886999e
Compare
@markerikson FYI - I've rebased this branch and adjusted for the collisions. FYI - I've made some (admittedly opinionated) adjustments to Rather than exporting |
For clarity - what this MR really does is allow for the documentation to:
e.g.
|
SWEEEEET let's do this! |
name: 📖 New/Updated Documentation Content
about: Updating content in an existing docs page
PR Type
Does this PR add a new page, or update an existing page?
Updates an existing page (Writing Tests).
Also adds the ability to transpile doc codeblocks from TS to show both TS & JS tabs.
Checklist
What docs page is being added or updated?
For Updating Existing Content
What updates should be made to the page?
Do these updates change any of the assumptions or target audience? If so, how do they change?
Yes - now targeted to accommodate both TS & JS users