-
-
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] Tutorial: Fix typos, snippets and file extensions #8607
Conversation
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.
Thanks!
60f79a3
to
e528407
Compare
^ Sorry! I tried to hit the buttons for both but GitHub is being weird. |
I'm sorry I should have say so in your initial issue :( |
…for TS in comments.
I'm sorry if I wan't clear. I meant the code should be pure JS, but the files should be |
I don't feel comfortable doing that. If the examples are JavaScript then own it. What's the value in the TypeScript extension if you are not actually using it? JavaScript code belongs in .js files, with notes on how to make it work in .ts. |
The tutorial directory (https://github.com/marmelab/react-admin/tree/master/examples/tutorial/src) is written with .ts files, so anyone reading both the code and the instructions will notice the difference. |
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.
Also, as asked by @fzaninotto , you should leave all the file extensions as *.ts
or *.tsx
.
Indeed the tutorial is written so that typescript is enabled, and also the file paths will match the files from the sample repository.
If ever a code snippet, written in pure JS but saved in a TS(X) file raises a warning in your IDE, we simply need to mention it beneath or inside the snippet as comment, just like you did.
I did not change any file extensions in the repo. If you are referring to the snippets' Walk through the tutorial yourself as a new user, like I did. It is confusing to make TypeScript files that do not compile. I would rather understand that the example is written in JS, and any upgrades to TS are on my own. I would understand that more is required from me. |
If the examples are written in TS, why not update the tutorial to reflect that? It would be clearer for everyone. |
@erikvanderwerf Yes I am referring to the snippets' I know it's a bit confusing, because we are currently between two seats. But I'll try my best to explain.
Hopefully this will make it clearer for you why we ask for these changes. |
Technological challenges are a valid reason for not upgrading the Tutorial code blocks 😄 So if I understand correctly:
It certainly is confusing (and I don't exactly agree, but I can live with it). If the above understanding is correct, I'll make the appropriate changes. |
@erikvanderwerf Yes that's correct! |
…d reference TS project files.
00ff34e
to
5b6eb33
Compare
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.
Thanks!
Fix #8606
typescript@4.9.4