Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I don't think that the way astexplorer currently works (building everything as a single web app) is very maintainable. Bundling so many packages seems to be destined to fail at some point.
With this commit I'm trying a new approach: Building separate bundles
for parsers. The main reasoning behind the current approach is:
I plan to roll this out to more parsers over time. Things will probably have to change to accommodate every parser and maybe even more stuff to accommodate transforms.
Also I will need to find a way to automatically deploy updates to the
parsers/
directory.Note: I want to refrain from using babel to transpile parsers. Many parsers are actually already transformed and I don't think it's too unreasonable to assume that people will use a relatively recent browser.
How it works
parsers/build.sh
traverses all parser folders, usesnpm
to check whether the local version needs an update and invokes the parsersMakefile
. Bundles are put in an output folder and links are created for major and minor versions. That is, the bundle process will create something like[email protected]
and also links[email protected]
and[email protected]
to it. The bundles are UMD/AMD builds since that makes it easier to load them in the browser.Because of the links, a parser wrapper an just load
acorn@1
and will get the latest version of that major version.parsers/build.sh
will run periodically as a cronjob.Safe to say that it works fine locally. Any feedback is welcome!