Skip to content

[NS 4] TypeScript: codegen and SDK support for module mounts#5170

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

[NS 4] TypeScript: codegen and SDK support for module mounts#5170
aasoni wants to merge 1 commit into
alessandro/typescript/runtime-changes-for-module-mountsfrom
alessandro/typescript/client-codegen-for-mounts

Conversation

@aasoni
Copy link
Copy Markdown
Contributor

@aasoni aasoni commented Jun 2, 2026

Description of Changes

Generate typescript client module bindings for mounted sub-modules. To avoid file name conflicts mounted code gen files are generated inside folders named after the mount's namespace. This is done recursively so folders containing client bindings for mounted types can in turn contain folders for mounted types.

API and ABI breaking changes

No

Expected complexity level and risk

3 - Code change is not overly complicated, and the risk not deemed to high as the change only applies to mounted types.

Testing

This set of of manual tests were done on the complete set of changes for namespaces, which includes 6 PRs.

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 changed the title TypeScript: codegen and SDK support for module mounts [NS 4] TypeScript: codegen and SDK support for module mounts Jun 2, 2026
@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/typescript/client-codegen-for-mounts branch from 6870b0c to f075552 Compare June 3, 2026 08:03
@aasoni aasoni force-pushed the alessandro/typescript/runtime-changes-for-module-mounts branch from f7a7693 to be4574a Compare June 3, 2026 12:22
@aasoni aasoni force-pushed the alessandro/typescript/client-codegen-for-mounts branch from f075552 to 3b6080d 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