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

Use of packagerollup to address packaging issues, browser compatability, etc. #422

Open
BurtHarris opened this issue Jul 18, 2019 · 1 comment
Assignees

Comments

@BurtHarris
Copy link
Collaborator

BurtHarris commented Jul 18, 2019

I've been thinking (for years now) that this project faces a number of issues regarding platform portability that must have some best-practice solutions in the existing node/browser/typescript ecosystem.

I think I've found a TypeScript based architype to consider at https://github.com/MattiasBuelens/web-streams-polyfill . Just examining the directory structure of this project makes clear some options I've only been guessing at till now.

The web-streams-polyfill package builds into a outputs with different JavaScript target flavors, (e.g. , including versions compatible with several different versions of both Node.js and different browser's. At build time, this is being done using a build-orchestrator tool called rollup.

Both rollup and web-streams-polyfill seem well maintained to have active user communities.
It appears that rollup may be an alternative to webpack for generating browser-consumable packaging, so this may be an alternative approach to implementing #343, and to fixing bugs reported in browser environments like #283, #310, #326, etc.

If anyone interested in the antler4ts has experience with rollup, now would be a good time to speak up.

@jimtendo
Copy link

jimtendo commented Dec 6, 2023

I played around with rollup for this quite a bit yesterday. In short, I don't think it'd work due to the circular dependency issues (your bundles would likely fail at runtime):

#466

That said, Webpack likely would work (there's an example in the link above of a package that wraps cashc + antlr4ts using Webpack).

There is this package now though https://github.com/antlr/antlr4/tree/dev/runtime/JavaScript which does have TS declarations (and is a bit more active), so it might be worth considering working off that base.

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

2 participants