-
Notifications
You must be signed in to change notification settings - Fork 2.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
fix(core): move generator should work if there are comments in tsconfig #13740 #13866
fix(core): move generator should work if there are comments in tsconfig #13740 #13866
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
be28482
to
4618d0b
Compare
The jsonc parser is significantly slower than JSON.parse. Nx Console used to use jsonc parser everywhere and it was basically unusable in large workspaces. The base tsconfig is unlikely to be large enough for the performance difference to matter, but this can't be the solution for every JSON file. |
Why are we doing this? JSON doesn't support comments and anyone who adds them should be doing so at their own risk. |
@isaacplmann This is only going to be used in one file during the move generator command. The tsconfig file. I should also note that @jdpearce Adding this here so that the context remains in the PR: Angular CLI generates a tsconfig with comments. I'll update the PR to only use jsonc-parser if the initial JSON.parse fails. |
4618d0b
to
75ef20c
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.
Using jsonc-parser as a fallback sounds good to me. Especially if that's what devkit is already doing.
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
If there are comments in the tsconfig, the move generator will fall over right away.
Expected Behavior
It shouldn't fall over if there are comments in the base tsconfig
Notes
Comments will be removed from the tsconfig file, but there is no good way to keep them there.
Related Issue(s)
Fixes #13740