Closed
Description
Currently the playground fetches its compiler / react bundles from our CDN, but we need to manually adjust the CompilerManagerHook
module whenever a new playground version has been released.
This is tedious. Ideally we want to automate the playground bundle generation process for each proper version release. The website should update itself whenever a new playground version has been uploaded.
Proposed Architecture:
Playground / rescript-lang.org changes
- Use
getStaticProps
to generate the available versions data on incremental builds / revalidations - Within the
getStaticProps
logic, queryhttps://cdn.rescript-lang.org/
and enumerate allvX.X.X
versions- versions tagged as
alpha
orbeta
release should be separated in "experimental versions" - On initial load without version query param, the playground should load the latest official version
- versions tagged as
- Pass the information down to the playground page and introduce the data in the version select dropdown
- Introduce a protected revalidation route, as stated in the NextJS docs: https://nextjs.org/docs/basic-features/data-fetching/incremental-static-regeneration#using-on-demand-revalidation
- Introduce a secret for the revalidation logic and store it in the rescript-lang.org secrets
ReScript compiler repo changes:
- Store the revalidation key as a secret in the rescript-compiler repo
- In the
playground/update_bundle.sh
script, run the revalidation url with the stored secret after the newest bundle has been uploaded