Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

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
Skn0tt pushed a commit to netlify/build that referenced this pull request May 21, 2024
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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