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

fix: force esbuild target in zisi #681

Merged
merged 3 commits into from Sep 29, 2021
Merged

Conversation

eduardoboucas
Copy link
Member

- Summary

When parsing files with esbuild to find dependencies, we rely on the default target property set by esbuild, which is esnext. However, this is overridden by any compilerOptions.target property set in a tsconfig.json. When this value is set to es5, parsing with esbuild can fail because some expressions can't be lowered to ES5.

This PR explicitly sets target: "esnext" in esbuild so that no transpiling is required.

- Test plan

Added a new test.

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

f03a349219e07c262f961a9afefb9a66

@eduardoboucas eduardoboucas added the type: bug code to address defects in shipped code label Sep 27, 2021
@github-actions
Copy link
Contributor

⏱ Benchmark results

Comparing with 12a08ba

largeDepsZisi: 1m 11.3s

⬇️ 0.37% decrease vs. 12a08ba

^                                                                 1m 13.5s1m 14.3s                        
│                                 1m 10.3s        1m 11.6s          ┌──┐    ┌──┐                  1m 11.3s
│                         1m 7.4s   ┌──┐   1m 8s    ┌──┐            |  |    |  |                    ┌──┐  
│                           ┌──┐    |  |    ┌──┐    |  |            |  |    |  |                    |▒▒|  
│ ─57.6s────58s─────────────┼──┼────┼──┼────┼──┼────┼──┼────────────┼──┼────┼──┼────────────────────|▒▒|──
│   ┌──┐    ┌──┐   56.5s    |  |    |  |    |  |    |  |            |  |    |  |   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

@@ -0,0 +1 @@
module.exports = 'jam'
Copy link
Contributor

Choose a reason for hiding this comment

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

🇯🇲

@eduardoboucas eduardoboucas merged commit 6e74a0a into main Sep 29, 2021
@eduardoboucas eduardoboucas deleted the fix/esbuild-force-target branch September 29, 2021 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants