Add version selector to web demo #283
Merged
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.
This involves switching to dynamic loading of the WASM module, and also
involves changing how the GitHub pages is built and deployed.
The idea is that the latest version of the web demo site should be
backwards compatible with all the previous versions of the WASM module,
and the
gh-pagesbranch will simply keep all the old WASM modulebuilds, while new ones are added and the web demo site is updated.
The default module version loaded is whatever is first in the
versions.json file that exists at the root of the
gh-pagesbranch,which the workflow makes sure to sort according to
sort -Vr(versionsort in descending order). This means that the latest tagged version
should be first, and all the branches will be after all the tags.
In order to make switching between and comparing versions more
streamlined, I also implemented a function to migrate the settings as
you change the selected version. This comments and uncomments lines that
correspond to settings that were removed or added when moving between
versions.
The selected version is also a query parameter now, so old examples
shared via URL should remain stable as new versions are released.