Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: introduce browser support #201

Merged
merged 2 commits into from
Jun 10, 2020
Merged

Conversation

lance
Copy link
Member

@lance lance commented Jun 1, 2020

This commit introduces a second tsc execution which generates JS in ES5 form.
Then, webpack is used to generate a browser bundle.

Fixes: #94

WIP: Tests still pending.

Signed-off-by: Lance Ball lball@redhat.com

@lance lance added type/enhancement New feature or request module/browser Module capabilities in a browser environment labels Jun 1, 2020
@lance lance requested review from n3wscott and a team June 1, 2020 18:56
@lance lance self-assigned this Jun 1, 2020
@lance lance requested review from danbev, grant and fabiojose and removed request for a team June 1, 2020 18:56
@helio-frota
Copy link
Contributor

@lance probably package-lock needs to be pushed or something (?)

I got this after npm install / npm run build:

modified:   package-lock.json

@lance
Copy link
Member Author

lance commented Jun 3, 2020

@helio-frota good catch - thanks! I've updated it.

@lance lance force-pushed the 94-browser-support branch from da26838 to 0823aec Compare June 3, 2020 20:22
@helio-frota
Copy link
Contributor

@lance seems working

2020-06-03_17-54

@helio-frota helio-frota self-requested a review June 3, 2020 20:55
@helio-frota
Copy link
Contributor

@lance seems these (some of) directories should be added to .gitignore ?

_bundles/
browser/

@lance
Copy link
Member Author

lance commented Jun 4, 2020

@helio-frota they are https://github.com/cloudevents/sdk-javascript/pull/201/files#diff-a084b794bc0759e7a6b77810e01874f2R12-R13

@lholmquist
Copy link
Contributor

I got this warning about the webpack "mode"

WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configuration/mode/

Maybe it should be set explicitly to avoid any changes in default behavior during a webpack version bump?

This commit introduces a second `tsc` execution which generates JS in ES5 form.
Then, webpack is used to generate a browser bundle.

Signed-off-by: Lance Ball <lball@redhat.com>
@lance lance force-pushed the 94-browser-support branch from 0823aec to 143f6a8 Compare June 10, 2020 21:36
@lance lance marked this pull request as ready for review June 10, 2020 21:36
Signed-off-by: Lance Ball <lball@redhat.com>
@lance lance merged commit 8b2725b into cloudevents:master Jun 10, 2020
@lance lance mentioned this pull request Jul 7, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
module/browser Module capabilities in a browser environment type/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support browser usage
4 participants