Skip to content

feat: introduce browser support - #201

Merged
lance merged 2 commits into
cloudevents:masterfrom
lance:94-browser-support
Jun 10, 2020
Merged

lance merged 2 commits into
cloudevents:masterfrom
lance:94-browser-support

Conversation

@lance

@lance lance commented Jun 1, 2020

Copy link
Copy Markdown
Member

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 a team and n3wscott June 1, 2020 18:56
@lance lance self-assigned this Jun 1, 2020
@lance
lance requested review from danbev, fabiojose and grant and removed request for a team June 1, 2020 18:56
@helio-frota

Copy link
Copy Markdown
Member

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

I got this after npm install / npm run build:

modified:   package-lock.json

@lance

lance commented Jun 3, 2020

Copy link
Copy Markdown
Member Author

@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
Copy Markdown
Member

@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
Copy Markdown
Member

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

_bundles/
browser/

@lance

lance commented Jun 4, 2020

Copy link
Copy Markdown
Member Author

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

@lholmquist

Copy link
Copy Markdown
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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