Skip to content

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Sep 23, 2025

Description of Changes

This PR:

  1. Exposes V8/JS modules via the unstable feature flag on the host. To publish a JS module, --javascript --bin-path path/to/module.js needs to be used. This mechanism is provisional until we come up with something better.
  2. Bumps V8 to 140.2.
  3. Shares more logic with WASM and makes some minor refactorings to energy/budget logic.
  4. Moves logic from WasmInstanceEnv to InstanceEnv and friends.
  5. Makes JS modules actually work in terms of create_instance, make_actor,
  6. Fleshes out call_reducer with timeouts and long-running logs added as well.
  7. Adds all the syscalls with associated documentation as well.

API and ABI breaking changes

None

Expected complexity level and risk

3? It's only available on unstable and mostly touches V8 stuff, but the PR is fairly big.

Testing

Follow up PRs will add unit tests for parts.
We'll also need to add integration tests for whole modules.

@Centril Centril changed the title V8: Add syscalls, TODO V8: Enable as unstable, add syscalls, TODO Sep 23, 2025
@Centril Centril changed the title V8: Enable as unstable, add syscalls, TODO V8: Enable as unstable, add syscalls, flesh out call_reducer, etc. Sep 23, 2025
@bfops
Copy link
Collaborator

bfops commented Sep 23, 2025

Is this meant to be reviewed or just here for a demo?

@Centril
Copy link
Contributor Author

Centril commented Sep 23, 2025

Is this meant to be reviewed or just here for a demo?

It's meant to be reviewed.

@Centril Centril force-pushed the centril/v8-syscalls branch from 5e12f1a to e5f893d Compare September 24, 2025 10:21
.requires("wasm_file")
.hide(true)
.help("UNSTABLE: interpret `--bin-path` as a JS module"),
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I haven't been keeping context on the timelines/milestones for the V8 stuff. Is the "demo" here meaning an internal demo, or a beta release to users?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

More of the former. I'm not sure this is the UX we want to expose to beta users, but I'd like to merge something provisional into master that lets us test stuff. I'd love to discuss with you what a good UX would be, but we can probably do that on Discord for now.

Copy link
Contributor

@cloutiertyler cloutiertyler Sep 25, 2025

Choose a reason for hiding this comment

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

I discussed this with @Centril today in the Core daily meeting. For the beta release we decided to have parity with the UX of both Rust and C#, so this will not be necessary because SpacetimeDB will detect that you have an npm package and will build your app for you.

// i.e. This will just work
spacetime publish

However, we also want to achieve parity with manual way of specifying the --bin-path arg for wasm by introducing a new --js-path manual way of publishing after having already bundled your javascript.

Once @Centril makes that change I will approve this PR for the files that I am a code owner of.

github-merge-queue bot pushed a commit that referenced this pull request Sep 25, 2025
# Description of Changes

Implements `Serialize` and `Deserialize` for tuples.
Extracted from #3276.

# API and ABI breaking changes

None

# Expected complexity level and risk

2

# Testing

A test `roundtrip_tuples_in_different_data_formats` is added.
@Centril Centril force-pushed the centril/v8-syscalls branch from 69222d0 to e563b93 Compare September 26, 2025 08:57
@Centril Centril force-pushed the centril/v8-syscalls branch from 0454ff8 to cfc090d Compare September 26, 2025 13:06
@bfops bfops added the release-any To be landed in any release window label Sep 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-any To be landed in any release window
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants