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

Add web workflow to build Repl with Emscripten #222

Merged
merged 6 commits into from
Nov 22, 2021
Merged

Add web workflow to build Repl with Emscripten #222

merged 6 commits into from
Nov 22, 2021

Conversation

zeux
Copy link
Collaborator

@zeux zeux commented Nov 22, 2021

Fixes #177

The build artifact produced after this change can be attached to releases; https://luau-lang.org/demo references a specific pinned release (0.505 at the moment) to fetch the JS binary.

We can probably change the JS code later to try to find the latest release using a GitHub API or binary search...

This was clearly a better idea as it cleans up CMakeLists.txt and allows
us to add more functionality in the future that's specific to web.
This means Emscripten build is now completely decoupled which should
make future changes easier.
@zeux zeux marked this pull request as ready for review November 22, 2021 04:17
Copy link
Collaborator

@dcope-rbx dcope-rbx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 😊

@zeux zeux merged commit 5961261 into master Nov 22, 2021
@zeux zeux deleted the web branch November 22, 2021 17:59
@tiffany352
Copy link
Contributor

We can probably change the JS code later to try to find the latest release using a GitHub API or binary search...

There's a relatively simple way to get info about the latest release in json format:

curl -H 'Accept: application/json' https://api.github.com/repos/Roblox/luau/releases/latest
{
  // snip
  "tag_name": "0.505",
  "target_commitish": "master",
  "name": "0.505",
  "draft": false,
  "prerelease": false,
  "created_at": "2021-11-19T16:10:07Z",
  "published_at": "2021-11-19T16:14:25Z",
  // snip
  assets: [
    // snip
    {
      "url": "https://api.github.com/repos/Roblox/luau/releases/assets/50013249",
      "id": 50013249,
      "node_id": "RA_kwDOCN7VCM4C-yRB",
      "name": "Luau.Web.js",
      // snip
    }
  ]
}

@zeux
Copy link
Collaborator Author

zeux commented Nov 22, 2021

@tiffany352 Nice! Is this something the browser can just query, or does this run into rate limiting et al?
We could probably also use this as a default and fall back to the hardcoded version.

PRs welcome in either case ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add Web REPL using Emscripten
3 participants