-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Update all remaining code blocks to have TS/JS toggles #1203
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Hi Mark, is this supposed to be done using the same remark tool? |
In the long run we might switch to shiki-twoslash once they add a feature like that, but for now yes. Generally: rename file to |
@phryneas great! just a quick query, the |
I assume that is the default docusaurus README, just ignore it for now. We will switch over to a yarn monorepo soon anyways. |
Also, you might run into memory problems on the main branch. Update remark-typescript-tools to 1.0.7 to fix that. |
@phryneas I'm trying to use the remark-typescript-tools on jsx snippets, but it doesn't seem to work. I have updated it to v1.0.7 before using, so I'm a bit confused here. Sorry if I'm missing something here 😅 Snippet // file: App.tsx noEmit
import React from 'react'
export default function App() {
return <div>...</div>
}
// file: app/store.ts noEmit
import { configureStore } from '@reduxjs/toolkit'
export default configureStore({
reducer: {},
})
// file: index.tsx
import React from 'react'
import ReactDOM from 'react-dom'
import './index.css'
import App from './App'
// highlight-start
import store from './app/store'
import { Provider } from 'react-redux'
// highlight-end
ReactDOM.render(
// highlight-next-line
<Provider store={store}>
<App />
</Provider>,
document.getElementById('root')
) Works fine with "jsx": "react" Doesn't work with "jsx": "preserve" |
Uhh, good question. I think we never had this use case before 😅 I might need to investigate that. But probably not before friday. |
@PrinceRajRoy I just pushed remark-typescript-tools 1.0.8 which should be able to handle |
@phryneas just updated, works perfectly fine now 😄 |
@phryneas @markerikson the |
We have a number of code blocks that are still JS-only. It would be useful to convert all of them to be toggleable TS/JS blocks instead. As an example, the initial example in
createAsyncThunk
:https://redux-toolkit.js.org/api/createAsyncThunk#overview
The text was updated successfully, but these errors were encountered: