-
-
Notifications
You must be signed in to change notification settings - Fork 9.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
CLI: Do not use modern TS assets in legacy TS projects #20458
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.
LGTM, @kasperpeulen can you please take a look?
@shilman @IanVS I think this will break angular and web components, as they have only a ts directory, as there is no special syntax for TS4.9 for those renderers. I didnt want to duplicate directories there. I think we may just have to be careful to always have a ts-legacy directory when there is a ts directory with new ts features. |
In that situation wouldn't it be better to name the folder ts-legacy? Then it would still be used by both, without the danger of breaking if someone creates just a new ts directory like almost just happened for Vue? |
Yeah, I understand that point, but there may never come a ts directory for angular, as I think it might be imposible to ever take adventage of satisfies there. So it would be also a bit weird to only having ts-legacy in the renderer, while we use it also for modern ts. 🤔 |
Thanks for explaining. I personally still think it's better to be safe and have an awkward folder name for Angular, or use a different word than |
@IanVS Hmm, I would say the correct approach would be to never have "only" have a I guess the approach of this PR is more safe, but not sure if it is more "right" :D Say someone makes a PR that would add a If we force such the Anyway, I understand your point as well. What do you think @shilman ? |
@kasperpeulen @IanVS I agree with both of you. I think the ideal approach would be to have the minimum version of TS that we require embedded in the directory name. So we could rename existing |
Yep, I like that approach. |
Marking as draft until I make the suggested change. |
The minimum TS version for our current examples is 3.8, because we use |
@kasperpeulen what do you think of this now? |
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.
LGTM!!
# Conflicts: # code/frameworks/nextjs/template/cli/ts-3-8/Introduction.mdx # code/frameworks/nextjs/template/cli/ts-3-8/Introduction.stories.mdx # code/frameworks/nextjs/template/cli/ts-legacy/Introduction.stories.mdx
Issue:
New TypeScript (4.9+) syntax components could be added to a project using an older version of TS, if the renderer did not include a
ts-legacy
folder.What I did
Removed that unsafe fallback, and added some tests.
How to test
If your answer is yes to any of these, please make sure to include it in your PR.