-
-
Notifications
You must be signed in to change notification settings - Fork 7k
[typescript] Make module usable with esbuild #11298
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
[typescript] Make module usable with esbuild #11298
Conversation
Test failures in pipeline seem unrelated. |
Looks like this breaks the CircleCI build:
|
@bodograumann can you fix this? Or should we revert? |
Yes. Sorry that I missed this. For now it is probably better to revert this PR. 🤕 🧱 |
This reverts commit 7129cde.
Reverted |
@bodograumann Babel has this setting enabled by default. But |
Thanks for the hint @amakhrov . |
I’m trying to add some proper tests for esmodules in browser, but cannot get them to run. Cf. https://github.com/bodograumann/openapi-generator/tree/ts-url-parse-import |
As to why https is enforced - it's HSTS preloaded: https://hstspreload.org/?domain=petstore.swagger.io Surprised that using https website with a good certificate cause any troubles. Any details on the issue you're seeing? |
We don’t actually run the integration tests against the real petstore.swagger.io instance, @amakhrov. Doing so would cause various issues. E.g. there are multiple instances behind that domain and on each request you get a random one. So if you create a pet with an id, it might be unknown on the next request. This is no problem at all when running outside the browser. However, as you correctly noticed, the browser uses HSTS and there are also other security features that cause problems in the browser. E.g. I had to disable CORS. It just seems like there is no way to disable the preloaded HSTS domains. 😐 |
oh, ok! is there a reason not to change the url in the test spec from petstore.swagger.io to something else (e.g. |
Given that the server actually runs on It looks quite good so far. Let me create a new pull request. |
When trying to use the current output code from the typescript generator with esbuild (or vite to be more specific) the import from
url-parse
is not usable. This template-only change works around the problem.I was also able to use typings for
url-parse
.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.3.0),6.0.x
@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)