-
-
Notifications
You must be signed in to change notification settings - Fork 5.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
[Doc] Automatically convert TS examples to JS #9005
Conversation
When I click on a language tab, the screen "jumps". Can we avoid that? |
Also, it seems the indentation differs between JS and TS. Can we make it consistent? |
I don't see how. This is because we often have more code in TS |
I'm afraid we have inconsistent indentation everywhere so we'd have to apply the same everywhere as well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code seems good.
BUT, I saw 2 issues:
- Once you switch to TSX, all JSX code snippets disappear! (it can be seen in
AccordionForm.md
) - New lines are not preserved when they are in the JSX code. Example in the code below taken from
Tutorial.md
:
// in src/App.tsx
import { Admin, Resource, ListGuesser, EditGuesser, ShowGuesser } from 'react-admin';
import { dataProvider } from './dataProvider';
export const App = () => (
<Admin dataProvider={dataProvider}>
</Admin>
);
The new lines between <Admin>
and </Admin>
are not preserved.
.language-switcher.active { | ||
background-color: #f5f2f0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't you rename this file to style-v18
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed with Francois, it's actually unnecessary. @fzaninotto Did I get that right?
@fzaninotto I'll let you check one last time 😉 |
Done client side and only when needed.
I compared locally with the previous docs and didn't notice any difference even with CPU throttling x6 on slow 3G
How to test