-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
[Experiment] Direct imports #51504
[Experiment] Direct imports #51504
Conversation
Thanks for the PR! It looks like you've changed the TSServer protocol in some way. Please ensure that any changes here don't break consumers of the current TSServer API. For some extra review, we'll ping @sheetalkamat, @amcasey, @mjbvz, @minestarks for you. Feel free to loop in other consumers/maintainers if necessary |
3f784b4
to
c30f78c
Compare
Impressive; this one is definitely tricky as there are still cycles. There is tooling to help with that. FWIW you can just start using Object.entries unconditionally; the new target is ES2018 so a lot more is fair game, though I haven't made an issue for that and we will need to performance test as we suspect that our hand written ones are faster. |
Yep :(. I decided to start by converting to direct imports, the second step should be to resolve the circular dependencies.
I know about |
Madge is the one I had tried, but I forgot the name and while searching I found https://github.com/Soontao/cycle-import-check Funnily, the most reliable one I found was running rollup on the codebase, since it complains about it too. Maybe using type imports would help the tooling as well. |
But seriously, you got further than I did. I'm really shocked you got the tests to pass and tsc to run. I gave up and started working on other stuff instead... |
Can we move TypeScript/src/compiler/debug.ts Lines 135 to 142 in b553aff
TypeScript/src/compiler/debug.ts Lines 150 to 208 in b553aff
|
00f7493
to
9f7d90d
Compare
My Debug PR (#51455) does mend some of this, though it's not final at all. I'm not really sure how far we want to stretch debug; I think that for now the best we should try to do is to make |
@typescript-bot perf test this faster |
Heya @DanielRosenwasser, I've started to run the abridged perf test suite on this PR at 9f7d90d. You can monitor the build here. Update: The results are in! |
@DanielRosenwasser Here they are:Comparison Report - main..51504
System
Hosts
Scenarios
Developer Information: |
If this is to be trusted, then it's a tiny win. I was expecting roughly no change since esbuild devirtualizes everything already in the current bundle. But maybe there's more being done and we can diff the two tsc.js files. |
Yep, |
My general feeling (and I think this is shared) is that the namespace stuff is really just a temporary hack and we'd like to have direct imports anyhow. |
Are you planning on reopening this again somewhere else? I am wanting this change, though I don't know when we will "click the button" so I understand that it'd be a maintenance pain until then. |
Honestly, I just wanted to check the performance impact. These changes are difficult to maintain and after merging this PR #51565, these changes will be completely useless as they will affect all imports in all files. I think it would take less time to make all the changes from scratch than to fix merge conflicts :). |
No problem! I appreciate that you showed it was possible, at least. |
d3e2db1
to
e99c935
Compare
@jakebailey Write me when you decide to do this migration and I'll try to restore these changes. |
@jakebailey #51443 (comment) Curious about how direct imports impact performance