Skip to content
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

Browser Build #39

Open
curran opened this issue Mar 4, 2022 · 2 comments
Open

Browser Build #39

curran opened this issue Mar 4, 2022 · 2 comments

Comments

@curran
Copy link
Contributor

curran commented Mar 4, 2022

It would be useful to have a UMD browser build for this library.

It might be as simple as adding a flag to tsc here https://github.com/ottypes/json1/blob/master/Makefile#L20

Perhaps tsc --module=umd? Though I'm not sure how to specify the name of the browser global introduced.

FWIW I gave the ShareDB Client a browser build treatment that looks like this: https://github.com/vizhub-core/sharedb-client-browser#readme

One option is to do something similar for JSON1, or even bundle JSON1 into that build, but it would be neat if JSON1 had its own browser build "out of the box".

Thanks!

@curran
Copy link
Contributor Author

curran commented Mar 5, 2022

Turns out TSC does not support UMD output with a browser global microsoft/TypeScript#46442 (comment)

@curran
Copy link
Contributor Author

curran commented Mar 5, 2022

I was able to generate a browser build of the ShareDB client that bundles ot-json1 as the default type (and excludes ot-json0 entirely from the bundle). See https://github.com/vizhub-core/sharedb-client-browser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant