Repository navigation
feat(sdk/typescript): no codegen at runtime - #13621
Conversation
ecc2435 to
63878d4
Compare
f5816c2 to
8ee95f3
Compare
|
I tested the PR manually and so far so good, the only issue is the same as in #13593 (comment), if you have a module that install another local module that exist in the workspace, List of things I tested:
Multi module test
|
4a913de to
132435c
Compare
132435c to
9412566
Compare
|
Ok so I tested with the new typescript-sdk that supports cwd aware and so far it works. If you change something in a local dep of a local module, you need to run generate 2 times:
You do not need to change your cwd but that's possible if something goes wrong so you can on purpose regenerate the 1 local dep and then the second. The DX is slightly weird but it works, it will be better once we support collection.
This behaviour should be fixed by #13662 |
|
The PR is mergeable but I'm gonna wait for #13593 to be mergeable too so we have both in the same beta release. |
|
We should wait for #13706 to be complete before merging this PR so we have a nice DX. |
9412566 to
e393d0a
Compare
|
I'm rebasing this PR since the work to fix dependency loading is merge on both engine and the typescript-sdk, so this PR is mergeable now with the expected DX |
Align the TypeScript SDK with the Go SDK's no-codegen-at-runtime model: modules in the workspace config format (dagger-module.toml) run at `dagger call` time straight from their committed generated files, with no codegen pass. The engine gates this by config format and omits the moduleRuntime introspectionJson argument for those modules. - Drop the `ModuleTypes` SDK function: remove the method, `Introspector.AsEntrypoint`, and the dispatcher case in the generated client. Type discovery now flows through the runtime `getModDef` path, served by the committed static `__dagger.entrypoint.ts` `register()`, mirroring the Go SDK. - Add the no-codegen runtime path: mark `ModuleRuntime`'s `introspectionJSON` argument optional so the engine can omit it; each runtime's `SetupContainer` (node/deno/bun) then branches on nil and mounts the committed tree, installs dependencies and runs the committed entrypoint instead of regenerating. `requireGeneratedFiles` fails with an actionable "run `dagger generate`" error when a committed file is missing. - Make the static `register()` a faithful replacement for the old runtime introspection: propagate source-map locations for objects, functions, fields, arguments, enums and enum members through the typedef JSON into the generated entrypoint, and register explicit `null` argument defaults. Without this, a no-codegen dependency lost its source-map comments and null defaults in dependents' bindings. - Add a `DaggerModule` -> introspection-JSON emitter (`introspection_json.ts`) and an `EMIT_INTROSPECTION_JSON_FILE` introspector sink, mirroring the Go `introspect_emit.go`. Staged for self-call bindings; not yet wired into Codegen (self calls are a follow-up). - Add the design doc under hack/designs. Signed-off-by: Tom Chauveau <[email protected]>
e393d0a to
d6963b6
Compare
|
Same as #13720 (comment), it looks like there's a flack in golang:test-all |
Align the TypeScript SDK with the Go SDK's no-codegen-at-runtime model: modules in the workspace config format (dagger-module.toml) run at
dagger calltime straight from their committed generated files, with no codegen pass. The engine gates this by config format and omits the moduleRuntime introspectionJson argument for those modules.Drop the
ModuleTypesSDK function: remove the method,Introspector.AsEntrypoint, and the dispatcher case in the generated client. Type discovery now flows through the runtimegetModDefpath, served by the committed static__dagger.entrypoint.tsregister(), mirroring the Go SDK.Add the no-codegen runtime path: mark
ModuleRuntime'sintrospectionJSONargument optional so the engine can omit it; each runtime'sSetupContainer(node/deno/bun) then branches on nil and mounts the committed tree, installs dependencies and runs the committed entrypoint instead of regenerating.requireGeneratedFilesfails with an actionable "rundagger generate" error when a committed file is missing.Add a
DaggerModule-> introspection-JSON emitter (introspection_json.ts) and anEMIT_INTROSPECTION_JSON_FILEintrospector sink, mirroring the Gointrospect_emit.go. Staged for self-call bindings; not yet wired into Codegen (self calls are a follow-up).Add the design doc under hack/designs.