Skip to content

RawModuleDefV10 from V8 modules.#4194

Open
Shubham8287 wants to merge 9 commits intomasterfrom
shub/raw-def-v8-new
Open

RawModuleDefV10 from V8 modules.#4194
Shubham8287 wants to merge 9 commits intomasterfrom
shub/raw-def-v8-new

Conversation

@Shubham8287
Copy link
Contributor

@Shubham8287 Shubham8287 commented Feb 3, 2026

Description of Changes

V8 Modules to expose RawModuleDefV10

API and ABI breaking changes

It breaks client, hence should be merged in 2.0-breaking-changes

Testing

  • Existing smoketests with run on new module def to verify if its correct.

joshua-spacetime and others added 5 commits January 29, 2026 11:16
…ext (#4101)

# Description of Changes

Makes the `sender` field on `ViewContext` private and exposes a
`sender()` method. Does the same for `ReducerContext` and
`ProcedureContext`.

The purpose of this change: So that the host can determine if/when a
view invokes or reads the `sender`.

Currently, because `sender` is a field, the host assumes that it is
always read. This means views must be materialized per client, even if
the view doesn't actually depend on `sender`, resulting in data
duplication.

The initial solution for this problem was `AnonymousViewContext` which
doesn't have a `sender` field. The better solution is to make `sender` a
method so that it can call into the host and record when it's actually
invoked.

Note, this patch only updates the module API, so the current
implementation does not change. `ViewContext` views are still duplicated
across clients. Changing this requires a new host syscall and for
`sender()` to invoke that syscall. This however is backwards compatible
and can be done anytime after the module APIs for the other languages
(C#, TypeScript, C++) are updated.

Also note that `ReducerContext` and `ProcedureContext` were updated
purely for consistency. There are currently no plans to track reads of
`sender` in these contexts.

# API and ABI breaking changes

Breaks the rust module api.

# Expected complexity level and risk

1

# Testing

N/A
# Description of Changes

Make `Sender` a method on [Reducer|View|Procedure|Tx]Context in C#.
Equivalent changes to
#4101.

# API and ABI breaking changes

API breaking

# Expected complexity level and risk

1

# Testing

Pure refactor, no additional testing.
# Description of Changes

Switch Wasm module to `__describe_module_v10__` from
`__describe_module__` to expose `RawModuleDefV10`

# API and ABI breaking changes
2.0 breaking change.

# Expected complexity level and risk
1

# Testing
Exising smoketests should be enough.
@Shubham8287 Shubham8287 force-pushed the shub/raw-def-v8-new branch 3 times, most recently from 4c76c1c to 7526623 Compare February 3, 2026 20:18
@Shubham8287 Shubham8287 marked this pull request as draft February 3, 2026 20:20
@Shubham8287 Shubham8287 marked this pull request as ready for review February 3, 2026 20:20
@Shubham8287 Shubham8287 changed the base branch from master to 2.0-breaking-changes February 3, 2026 20:20
@Shubham8287 Shubham8287 changed the base branch from 2.0-breaking-changes to master February 3, 2026 20:21
# Description of Changes

Same changes as #4101
but for `connection_id`.

# API and ABI breaking changes

API Breaking

# Expected complexity level and risk

1

# Testing

Pure refactor. Tests and docs have been updated, but no new tests added.
@Shubham8287 Shubham8287 force-pushed the shub/raw-def-v8-new branch 4 times, most recently from 496e158 to fcef782 Compare February 5, 2026 10:40
@Shubham8287 Shubham8287 changed the base branch from master to 2.0-breaking-changes February 5, 2026 11:16
@Shubham8287 Shubham8287 changed the base branch from 2.0-breaking-changes to master February 5, 2026 11:28
@Shubham8287 Shubham8287 changed the base branch from master to 2.0-breaking-changes February 5, 2026 12:27
@Shubham8287
Copy link
Contributor Author

CIs are failing due to base branch.

})
}

/// Change the visibility of scheduled functions and lifecycle reducers to Internal.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a code motion from raw_def/v10.rs to here (in validation) to re-use logic across Rust, Typescript modules.

Copy link
Collaborator

@coolreader18 coolreader18 left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment on lines +119 to +123
export type ModuleDef = {
[S in Infer<typeof RawModuleDefV10Section> as Uncapitalize<
S['tag']
>]: S['value'];
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Clever!

@Shubham8287 Shubham8287 changed the base branch from 2.0-breaking-changes to master February 6, 2026 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants