perf: run lint while constructing nodes#5207
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov Report
@@ Coverage Diff @@
## master #5207 +/- ##
==========================================
+ Coverage 98.82% 98.89% +0.06%
==========================================
Files 231 231
Lines 8863 8926 +63
Branches 2317 2332 +15
==========================================
+ Hits 8759 8827 +68
+ Misses 43 40 -3
+ Partials 61 59 -2
|
|
Thanks for the review! I'm currently a bit busy, so I would take a look next month. |
If you do not mind, that is the route I will be going 😉 |
…le-constructing-nodes
1e936fd to
fc3c4b5
Compare
|
Thanks for changes! I'm starting to have some time. Are there any places where it'd be better for me to work on? |
|
I have some more I want to push tomorrow. Hopefully, I have it working by then. I added a ton of tests and even found some subtle bugs, and got a much better grasp on how catch scoping works... |
TODO: Parameter redeclaration
|
Ok, it is more complicated than I first thought. So if the declaration uses destructuring and/or is part of a comma-separated declaration for multiple variables, there is some work I need to put in here. I found a simple hack: I make it two separate variables but "link" them so that including one includes the other and they are always rendered with the same name. |
|
This is good to go from my side. If nothing else comes up, I would merge this tomorrow. |
|
Thanks a lot! 💚 |
|
Great work, especially for checking the acorn test cases ❤️ |
Otherwise, it will throw an internal error
|
I changed the handling of missing entry exports so that it shows a proper error instead of this bug. This error will also be shown for invalid cases like |
|
This PR has been released as part of rollup@4.4.0. You can test it via |
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
#5205
Description
This PR implements this idea (#5205 (comment)) of running lint when initialising AST nodes instead of running in SWC side.
Running the benchmark in #5182 (actually I used the esbuild repo instead), I got ~300ms / ~5% improvement on my laptop.
Benchmark results
rollup 3.29.4
rollup 4.1.4
This PR
Specs of my laptop
References
rollup/src/ast/nodes/Identifier.ts
Lines 110 to 112 in a6448b9