You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
stdlib: remove dependency on polyfill module #13769
Our official modules import a "polyfill" module for features that want in the engine, but didn't have the patience to wait for :)
At 1.0 launch, the number of official modules that import polyfill should be ideally zero, or at most a very small number for niche use cases.
As it stands today, aspiring module developers that peek at our own modules, will undoubtebly have to learn about polyfill, which will make their learning and development journey more complicated.
Solution
Remove all dependencies on github.com/dagger/polyfill (and legacy github.com/dagger/sdk-sdk/polyfill) in all modules under github.com/dagger
github.com/dagger/polyfill was a temporary compatibility module created while the native Workspace API was still missing behavior needed by official SDKs and toolchains. The goal here is simple:
native engine APIs
↓
migrate every consumer
↓
archive dagger/polyfill
The catch is that we cannot remove it by blindly swapping API names. A few polyfill behaviors have become part of the UX people rely on, so the engine needs to absorb those behaviors first.
Who uses the polyfill today?
There are 16 current consumers:
9 ordinary toolchains—go, docker, jest, vitest, pytest, ruff, bun, mochajs, and deno—use project discovery.
6 SDK generators—go, python, typescript, php, java, and dang—also need isolated staging, module loading, and correctly rooted generated changes.
dagger/sdk-sdk exercises the SDK contract through ModuleSource.
dang-sdk additionally edits module configuration.
After looking through every consumer, this is the native API split that seems simplest:
findConfigDirs is the ordinary toolchain UX: find projects below the cwd plus the nearest enclosing project. It is intentionally more opinionated than glob or findUp; neither existing primitive provides that combined contract by itself.
SDK generators have different information available. The engine already knows which managed Dagger modules are registered, so modulesInScope selects from that list instead of scanning for dagger.toml, dagger-module.toml, or dagger.json.
Why do we need fork() and automatic path correction?
workspace changes before SDK runs: A
SDK stages generated change: B
Workspace.changes() → A + B
Workspace.fork().changes() → B only
Returned changesets are applied by the CLI from the caller's cwd. The engine therefore corrects paths at the two boundaries that return generated edits:
Workspace.fork().changes()
ModuleSource.generatedContextChangeset
↓
paths measured from cwd
Ordinary non-forked Workspace.changes() and internal generateLocalDependencies changes stay workspace-root-relative. Helpers such as withDirectory, changeset merging, and config edits do not each need their own remapping API: they compose edits, while remapping happens once when the final generated changeset crosses back to the caller.
What needs to change in the engine?
#13854: Workspace.findConfigDirs, CurrentModule.asSDK(workspace).modulesInScope, preserve literal "latest", and pin local-dependency loading through Workspace.moduleSource.
#13855: Workspace.fork, fork isolation, and automatic cwd-relative rooting for forked and generated changesets.
Ship a release containing both PRs.
The cross-repository E2E pass found one additional engine bug: a reduced generated context could report unrelated workspace files as removals, and independently generated changesets could then cancel each other during composition. #13855 now sparsifies generated diffs to their touched paths and includes a regression test.
How do we migrate safely?
Each consumer migration must remove the polyfill and bump engineVersion in the same commit:
bump only engine and polyfill both re-root paths ✗ double translation
remove only neither layer re-roots paths ✗ wrong paths
do both exactly one layer re-roots paths ✓
There is no flag day. The engine changes are additive or gated by the calling module's declared engineVersion, so migrated and unmigrated modules can coexist in one workspace.
Official modules: Go 11/11, Docker 1/1, Jest 6/6, Vitest 6/6, Pytest 3/3, Ruff 5/5, Bun 12/12, MochaJS 9/9, Deno 16/16.
Engine schema tests and focused integration coverage for discovery, module scope, fork isolation/rooting, local dependencies, literal latest, and generated-context composition are green.
Hosted consumer checks currently error because the drafts use the provisional v1.0.0-beta.10 cutover, which has not been released. Replace it with the actual release version before merging.
What happens after the migrations?
Re-pin dagger/dagger's SDK locks.
Archive dagger/polyfill after the final consumer migration lands.
AI disclosure: I used an AI assistant to audit the current polyfill consumer set and prepare a candidate Elixir migration; I reviewed and edited this comment before posting.
One consumer appears to have been added after the migration inventory above: dagger/elixir-sdk. On its current default head (a50635d43806c146765921c9e0ad84902f309e12), the root module still references dagger/polyfill, and the dev module also carries the dependency. I found no open Elixir polyfill-removal PR, issue, or branch.
I have a six-file migration packet prepared against that exact head that removes both dependency declarations, moves discovery/generation onto the native Workspace/ModuleSource APIs, updates lock/docs state, and includes a fail-closed zero-polyfill check plus lint/SDK/codegen/sdk-sdk verification harness.
Since #13769 is actively owned and the existing consumer migrations are being coordinated here, I don't want to treat the newly discovered Elixir slice as unowned just because it isn't in the original list. If you're not already covering dagger/elixir-sdk, would it be useful for me to take that migration as a separate PR and run it through the same release/version cutover as the other consumers? If you are already planning it, I'll leave the lineage with you.
Activity
grouville commentedon Aug 7, 2026
Some context first, for anyone landing here cold.
What are we trying to do?
github.com/dagger/polyfillwas a temporary compatibility module created while the native Workspace API was still missing behavior needed by official SDKs and toolchains. The goal here is simple:The catch is that we cannot remove it by blindly swapping API names. A few polyfill behaviors have become part of the UX people rely on, so the engine needs to absorb those behaviors first.
Who uses the polyfill today?
There are 16 current consumers:
dagger/sdk-sdkexercises the SDK contract throughModuleSource.After looking through every consumer, this is the native API split that seems simplest:
Why do we need both discovery APIs?
findConfigDirsis the ordinary toolchain UX: find projects below the cwd plus the nearest enclosing project. It is intentionally more opinionated thangloborfindUp; neither existing primitive provides that combined contract by itself.SDK generators have different information available. The engine already knows which managed Dagger modules are registered, so
modulesInScopeselects from that list instead of scanning fordagger.toml,dagger-module.toml, ordagger.json.Why do we need
fork()and automatic path correction?Returned changesets are applied by the CLI from the caller's cwd. The engine therefore corrects paths at the two boundaries that return generated edits:
Ordinary non-forked
Workspace.changes()and internalgenerateLocalDependencieschanges stay workspace-root-relative. Helpers such aswithDirectory, changeset merging, and config edits do not each need their own remapping API: they compose edits, while remapping happens once when the final generated changeset crosses back to the caller.What needs to change in the engine?
Workspace.findConfigDirs,CurrentModule.asSDK(workspace).modulesInScope, preserve literal"latest", and pin local-dependency loading throughWorkspace.moduleSource.Workspace.fork, fork isolation, and automatic cwd-relative rooting for forked and generated changesets.The cross-repository E2E pass found one additional engine bug: a reduced generated context could report unrelated workspace files as removals, and independently generated changesets could then cancel each other during composition. #13855 now sparsifies generated diffs to their touched paths and includes a regression test.
How do we migrate safely?
Each consumer migration must remove the polyfill and bump
engineVersionin the same commit:There is no flag day. The engine changes are additive or gated by the calling module's declared
engineVersion, so migrated and unmigrated modules can coexist in one workspace.SDK migration PRs
Official-module migration PRs
What has been tested?
All migrations are rebased, pushed as drafts, and tested locally against a dev engine containing both engine PRs:
latest, and generated-context composition are green.Hosted consumer checks currently error because the drafts use the provisional
v1.0.0-beta.10cutover, which has not been released. Replace it with the actual release version before merging.What happens after the migrations?
dagger/polyfillafter the final consumer migration lands.Full API review and diagrams: https://gist.github.com/grouville/fbbe5836b8e46ecf25bf5c626cd206e7
core(schema): add Workspace.findConfigDirs
core(integration): pin module-source loading with local deps
core: keep a floating "latest" engineVersion floating
core: add Workspace.fork
core: measure returned changesets from the workspace cwd
Drop the polyfill for native workspace APIs
Drop the polyfill for native workspace APIs
Drop the polyfill for native workspace APIs
Drop the polyfill for native workspace APIs
Drop the polyfill for native workspace APIs
Drop the polyfill for the engine's findConfigDirs
8 remaining items
core: measure returned changesets from the workspace cwd
core(schema): add Workspace.findConfigDirs
core(integration): pin module-source loading with local deps
core: keep a floating "latest" engineVersion floating
core(schema): add Workspace.findConfigDirs
core(integration): pin module-source loading with local deps
core: keep a floating "latest" engineVersion floating
core: add Workspace.fork
core: measure returned changesets from the workspace cwd
keeltrace commentedon Aug 21, 2026
AI disclosure: I used an AI assistant to audit the current polyfill consumer set and prepare a candidate Elixir migration; I reviewed and edited this comment before posting.
One consumer appears to have been added after the migration inventory above:
dagger/elixir-sdk. On its current default head (a50635d43806c146765921c9e0ad84902f309e12), the root module still referencesdagger/polyfill, and the dev module also carries the dependency. I found no open Elixir polyfill-removal PR, issue, or branch.I have a six-file migration packet prepared against that exact head that removes both dependency declarations, moves discovery/generation onto the native Workspace/ModuleSource APIs, updates lock/docs state, and includes a fail-closed zero-polyfill check plus lint/SDK/codegen/
sdk-sdkverification harness.Since #13769 is actively owned and the existing consumer migrations are being coordinated here, I don't want to treat the newly discovered Elixir slice as unowned just because it isn't in the original list. If you're not already covering
dagger/elixir-sdk, would it be useful for me to take that migration as a separate PR and run it through the same release/version cutover as the other consumers? If you are already planning it, I'll leave the lineage with you.Drop the polyfill for the engine's findRoots
Drop the polyfill for the engine's findRoots (#29)
Drop the polyfill for the engine's findRoots (#3)
Drop the polyfill for the engine's findRoots (#2)