Skip to content

Automate playground compiler versions updates #565

Closed
@ryyppy

Description

@ryyppy

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, query https://cdn.rescript-lang.org/ and enumerate all vX.X.X versions
    • versions tagged as alpha or beta release should be separated in "experimental versions"
    • On initial load without version query param, the playground should load the latest official version
  • 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions