Skip to content

[NS 3] TypeScript: server module runtime API for module mounts#5169

Open
aasoni wants to merge 1 commit into
alessandro/module-ids-handle-mountsfrom
alessandro/typescript/runtime-changes-for-module-mounts
Open

[NS 3] TypeScript: server module runtime API for module mounts#5169
aasoni wants to merge 1 commit into
alessandro/module-ids-handle-mountsfrom
alessandro/typescript/runtime-changes-for-module-mounts

Conversation

@aasoni
Copy link
Copy Markdown
Contributor

@aasoni aasoni commented Jun 2, 2026

Description of Changes

Changes the typescript runtime and query builder to handle mounted sub-modules.

API and ABI breaking changes

No

Expected complexity level and risk

4 - Changes in runtime.ts are quite extensive as they require each dispatch (table/reducer/procedure/view) to go through mounts logic.

Testing

Beyond the typescript tests in this PR, the following testing was done

Module:

  • root module can import another module and mount it with a namespace under its schema
  • root module and submodule can have the same function and table names without conflicting
  • ctx.db.lib.lib_table is readable/writable inside root module reducer
  • ctx.db.lib.lib_table is readable/writable inside root module procedure withTx block
  • library_reducer(ctx.as.lib) is callable inside root module reducer

Client

  • Client can subscribe to lib.library_table
  • Client can subscribe to lib.library_view
  • Client can call lib/library_reducer
  • Client can call lib/library_procedure
  • Client can subscribe to lib.sublib.sublib_table
  • Client can subscribe to lib.sublib.sublib_view
  • Client can call lib/sublib/sublib_reducer
  • Client can call lib/sublib/sublib_procedure

CLI

  • CLI can subscribe to lib.library_table
  • CLI can subscribe to lib.library_view
  • CLI can call lib/library_reducer
  • CLI can call lib/library_procedure
  • CLI can subscribe to lib.sublib.sublib_table
  • CLI can subscribe to lib.sublib.sublib_view
  • CLI can call lib/sublib/sublib_reducer
  • CLI can call lib/sublib/sublib_procedure

Migration

  • Module migrates without issue from having a submodule to not having a submodule
  • Module migrates without issue from not having a submodule to having a submodule
  • Module migrates without issue when having a submodule and root module change occurs (change reducer signature, add table, add column with default, change reducer function body, change index)
  • Module migrates without issue when having a submodule and a submodule change occurs (change reducer signature, add table, add column with default, change reducer function body, change index)

Commit Log

  • Module loads fine from commit log
  • Module snapshot is created without issue
  • Module loads fine from snapshot

@aasoni aasoni force-pushed the alessandro/typescript/runtime-changes-for-module-mounts branch from f6591d8 to f7a7693 Compare June 3, 2026 08:03
@aasoni aasoni force-pushed the alessandro/module-ids-handle-mounts branch 2 times, most recently from 50ab365 to 02954c6 Compare June 3, 2026 12:19
@aasoni aasoni force-pushed the alessandro/typescript/runtime-changes-for-module-mounts branch from f7a7693 to be4574a Compare June 3, 2026 12:22
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.

1 participant