-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Experimental-[Typescript] Use default import instead of namespaced import #8634
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
base: master
Are you sure you want to change the base?
Conversation
Using the star import makes rollup barf all over the place because it doesn't know url-parse is a cjs module.
|
Thank you for the PR! Looks like there is some issue with the way the default import works versus what we had before - see the CI output below. Is it possible that we would have to call a function of URLParse or remove the |
|
I'm not entirely sure what is going on but I'm using es6 in my tsconfig via the es6 flag unlike the tests that use es5 and commonjs. Should there be another build for es6 only? |
|
We could do a separate build for es6 - either way the code would have to work for both es5 and es6. Could you elaborate a bit more on what trouble you ran into with the namespaced import? |
|
I'm using vite for an app. As I understand it it uses different build systems for development and production. In dev mode it works fine but in production mode it switches to rollup. So when I use rollup to build the code I end up with this error message: |
|
Mhh, to me that sounds like an issue with rollout - or an incompatibility between ES5 and 6. My way forward would either be raising this with rollout and getting their opinion on this issue - or looking at what the difference in generated code is between |
Shall we consider dropping es5 support in the TS generators? We've already done it in the |
In this PR I changed the namespaced import of
url-parseto default import. The namespaced import caused all kinds of trouble with my rollup configuration and it seems to work either way. I might be wrong but to my knowledge TS doesn't need namespaced imports anymore. Let me know if this is totally off and should be solved differently.PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.For Windows users, please run the script in Git BASH.
master,5.1.x,6.0.xThank you for looking into this: @TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) @macjohnny (2018/01) @topce (2018/10) @akehir (2019/07) @petejohansonxo (2019/11) @amakhrov (2020/02)