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

Handle xmldom dependency in web module #264

Open
kavitharaju opened this issue Oct 23, 2024 · 1 comment
Open

Handle xmldom dependency in web module #264

kavitharaju opened this issue Oct 23, 2024 · 1 comment

Comments

@kavitharaju
Copy link
Collaborator

As of now the other dependency of web module, tree-sitter-web is included in the bundle by copying the tree-sitter's code and wasm into our repo and building the usfm-grammar-web bundle with it.

❓ How to handle the xmldom dependency? How will it impact the library's usage in frontend?

  • If not bundling,
    • we expect users to install xmldom also when installing usfm-grammar-web in react etc.
    • using from environment like the script tag of an HTML page, how to handle this dependency? Will importing their bundling also to the same scope work? Is that a possible?
  • If bundling it in our build,
    • How to do that? Will passing it as some external module in Parcel work?
    • Would it cause licensing issues?

Whichever approach is adopted, need to test the published version from at least a react and HTML script environments.

@shadow-light
Copy link

If xmldom is specified as a dependency then it will be auto-installed by npm when installing this module. So it doesn't need to be bundled. Since this is a fairly low level module, I imagine most users will be using their own bundler. It would be pretty rare to manually load this via a script element I would think.

I'll be using it in a Vue app, bundled with Vite. But whether this module is bundled or published as an esm module, it doesn't matter all that much. Many developers publish both a bundled version and esm.

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

No branches or pull requests

2 participants