Uh oh!
There was an error while loading. Please reload this page.
[typescript] Support esbuild, second attempt - #11465
Merged
Merged
Conversation
bodograumannforce-pushed
the
ts-url-parse-import
branch
from
January 31, 2022 11:26
e715416 to
6879aaaCompare5 tasks
bodograumann
commented
Jan 31, 2022
ContributorAuthor
Ugh, seems pupeteer does not readily work in the pipeline:
I have added the chromium dependencies to circleci as per the pupeteer instructions. Hope this is the way to go. |
bodograumannforce-pushed
the
ts-url-parse-import
branch
3 times, most recently
from
January 31, 2022 13:03
69b39df to
5a9a281Comparebodograumann
commented
Jan 31, 2022
ContributorAuthor
Neither |
bodograumannforce-pushed
the
ts-url-parse-import
branch
from
March 31, 2022 11:58
5a9a281 to
1997a80Comparebodograumannforce-pushed
the
ts-url-parse-import
branch
2 times, most recently
from
April 6, 2022 07:27
005d2a5 to
b090cbfComparebodograumannforce-pushed
the
ts-url-parse-import
branch
from
April 6, 2022 08:10
b090cbf to
d74436cComparebodograumannforce-pushed
the
ts-url-parse-import
branch
from
April 6, 2022 08:31
d74436c to
44fd457Comparebodograumann
commented
Apr 6, 2022
ContributorAuthor
Yay it works! 🚀 Please have another look at this PR now. |
cachescrubber pushed a commit
to cachescrubber/openapi-generator
that referenced
this pull request
Apr 9, 2022
* Install correct typings for url-parse * Use es modules compat mode when es6 output is selected * Consolidate typescript sample generation naming scheme * Regenerate samples * Create new typescript sample to test esmodules in browser * Expose RequiredError type * Make browser integration tests pass locally * Remove cookie tests, because we don’t allow cross-origin cookies * Add output type to package definition * Execute new browser tests in pipeline * Install headless chromium dependencies in circle ci
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The first try in #11298 did not work, because it broke the commonjs output.
Now I have differentiated between the two. When es6 is activated, we build an esmodule and when it is deactivated we build the classic commonjs format. For commonjs we don’t need to change our imports, because the esmodule import restrictions don’t apply to the commonjs format. For esmodule output we use a default import.
To make sure everything works, I have added a new sample that has
supportsES6enabled. The tests for it use esbuild as bundler. (Unfortunately a bundler is needed in any case, because we include commonjs polyfills. Ideally the esmodule output could just run in the browser as-is, but that is something for another day.)As before I have included proper typings for url-parse.
I also had to expose the
RequiredErrorexception type to allow explicit casting to it, because typescript regards errors incatchasunknownthese days.Pet API tests are run against
http://localhost/v2as base server, to prevent HSTS in the browser from forcing https.Finally, I added more fields to
package.jsonthat include the module type and entry point, to improve compatibility with node and bundlers, especially when generating esmodule output.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)