Skip to content
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

feat: replace acorn with @babel/parser #663

Merged
merged 2 commits into from Sep 20, 2021
Merged

Conversation

eduardoboucas
Copy link
Member

- Summary

With this PR, we'll use @babel/parser instead of acorn to parse imports with dynamic expressions.

The AST format is fairly similar, except for some deviations.

- Test plan

N/A

- A picture of a cute animal (not mandatory but encouraged)

cute-bats-1024x759

Closes https://github.com/netlify/pod-serverless/issues/40.

@eduardoboucas eduardoboucas added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Sep 20, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Sep 20, 2021

⏱ Benchmark results

Comparing with b843aae

largeDepsEsbuild: 11.3s

⬆️ 4.50% increase vs. b843aae

^          13.9s   13.9s                           14.1s   14.2s                                          
│           ┌──┐    ┌──┐                            ┌──┐    ┌──┐   13.5s   13.2s           13.3s          
│           |  |    |  |                   12.8s    |  |    |  |    ┌──┐    ┌──┐            ┌──┐          
│ ──────────┼──┼────┼──┼────────────────────┌──┐────┼──┼────┼──┼────┼──┼────┼──┼────────────┼──┼──────────
│           |  |    |  |   11.4s            |  |    |  |    |  |    |  |    |  |   11.1s    |  |   11.3s  
│           |  |    |  |    ┌──┐            |  |    |  |    |  |    |  |    |  |    ┌──┐    |  |    ┌──┐  
│  10.3s    |  |    |  |    |  |   10.1s    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   ┌──┐    |  |    |  |    |  |    ┌──┐    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    T-12    T-11    T-10    T-9     T-8     T-7     T-6     T-5     T-4     T-3     T-2     T-1      T    
Legend

largeDepsZisi: 59.6s

⬆️ 4.84% increase vs. b843aae

^         1m 13.5s1m 14.3s                                1m 14.8s                                        
│           ┌──┐    ┌──┐                          1m 10.9s  ┌──┐  1m 11.3s1m 9.5s         1m 12.5s        
│           |  |    |  |                  1m 7.8s   ┌──┐    |  |    ┌──┐    ┌──┐            ┌──┐          
│ ──────────┼──┼────┼──┼────────────────────┌──┐────┼──┼────┼──┼────┼──┼────┼──┼──1m 2.7s───┼──┼──────────
│           |  |    |  |                    |  |    |  |    |  |    |  |    |  |    ┌──┐    |  |   59.6s  
│           |  |    |  |   57.6s            |  |    |  |    |  |    |  |    |  |    |  |    |  |    ┌──┐  
│  52.9s    |  |    |  |    ┌──┐   50.8s    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   ┌──┐    |  |    |  |    |  |    ┌──┐    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    T-12    T-11    T-10    T-9     T-8     T-7     T-6     T-5     T-4     T-3     T-2     T-1      T    
Legend

Copy link
Contributor

@ehmicky ehmicky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!
I checked for any Babel parser difference in dynamic_imports/parser.js and only found the one you changed (StringLiteral). 👍

@kodiakhq kodiakhq bot merged commit c28eaaf into main Sep 20, 2021
@kodiakhq kodiakhq bot deleted the feat/replace-acorn-with-babel branch September 20, 2021 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants