Skip to content
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

[docs] Resolve .tsx first #22315

Merged
merged 1 commit into from Oct 3, 2020

Conversation

oliviertassinari
Copy link
Member

We have some components that are duplicated, there is both a .tsx and .js version. I believe that in these cases, we should bundle the .tsx version, not the .jsx version. You can try the implications when loading http://0.0.0.0:3000/premium-themes/onepirate/forgot-password/ and editing the JS and TS version of docs/src/pages/premium-themes/onepirate/ForgotPassword to see what happens.

@oliviertassinari oliviertassinari added the docs Improvements or additions to the documentation label Aug 22, 2020
@mui-pr-bot
Copy link

Details of bundle changes

Generated by 🚫 dangerJS against d1e4686

Copy link
Member

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should never have used tsx for bundling in the first place. We have a separate task for that. You're just adding to the current confusion where it's unclear what file is used in the demo. It has caused me a lot of confusion in the past and I'm fairly certain others as well.

Ideally these should never have been placed next to the JS version. They're decorative only.

In the end JS should be bundled (since JS will end up in the bundle anyway) and if you want to code in TypeScript, run docs:typescript:formatted or yarn workspace docs typescript:transpile:dev in parallel.

@oliviertassinari
Copy link
Member Author

oliviertassinari commented Aug 23, 2020

@eps1lon Outside of your experience "It has caused me a lot of confusion in the past and I'm fairly certain others as well.", I disagree with this vision.

I think that the TypeScript files should be the source of truth, it should be the version bundled, the JavaScript demos should be decorative. The decorative JavaScript version should be right next to the TypeScript version. The mental model to understand it for contributors would be: if a TypeScript version of the demo exists, it's the source of truth, otherwise, we fall back to the JavaScript one. It doesn't have to complex. We aim to always have a TypeScript version of the content documented. The generation of the decorative JavaScript version should be limited to cases where its relevant. For instance, it would be useless for the Ad.tsx.

Why? So we always work on the TypeScript files FIRST, it's the source of truth, so we don't treat it as something secondary. This is the same motivation as for #15159.

@oliviertassinari
Copy link
Member Author

@eps1lon Does #22315 (comment) answer your concern? Can we move forward?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants