Uh oh!
There was an error while loading. Please reload this page.
[typescript] Make module usable with esbuild - #11298
Conversation
bodograumann
commented
Jan 13, 2022
Test failures in pipeline seem unrelated. |
wing328
commented
Jan 16, 2022
Looks like this breaks the CircleCI build: |
macjohnny
commented
Jan 16, 2022
@bodograumann can you fix this? Or should we revert? |
bodograumann
commented
Jan 16, 2022
Yes. Sorry that I missed this. For now it is probably better to revert this PR. 🤕 🧱 |
macjohnny
commented
Jan 16, 2022
Reverted |
@bodograumann Babel has this setting enabled by default. But |
bodograumann
commented
Jan 17, 2022
Thanks for the hint @amakhrov . |
bodograumann
commented
Jan 28, 2022
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 |
amakhrov
commented
Jan 28, 2022
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? |
bodograumann
commented
Jan 28, 2022
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. 😐 |
amakhrov
commented
Jan 29, 2022
oh, ok! is there a reason not to change the url in the test spec from petstore.swagger.io to something else (e.g. |
bodograumann
commented
Jan 31, 2022
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-parseis 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)