Skip to content

Drop the polyfill for native workspace APIs - #14

Open
grouville wants to merge 1 commit into
dagger:mainfrom
grouville:polyfill-removal
Open

Drop the polyfill for native workspace APIs#14
grouville wants to merge 1 commit into
dagger:mainfrom
grouville:polyfill-removal

Conversation

@grouville

@grouville grouville commented Aug 7, 2026

Copy link
Copy Markdown
Member

sdk-sdk used dagger/polyfill indirectly through the module-source type returned by its harness.

The harness now returns the native ModuleSource, so aliases such as workspaceView and sourceRootPath become their native equivalents, contextDirectory and sourceRootSubpath. The contract tests otherwise keep the same behavior and now exercise the path every migrated SDK uses.

Test

dagger check

Comment thread harness.dang
pub sdkTarget(ws: Workspace!): SdkTarget! {
let module = sdkModule(ws)
target(module.workspaceView, module.sourceRootPath)
target(module.contextDirectory, module.sourceRootSubpath)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't understand that change, it was already using the native API, why this part changes?

@grouville grouville Aug 12, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, it's surprising 😇

The polyfill usage is hidden in this line: let sdkModule(ws: Workspace!): PolyfillModuleSource!

So workspaceView and sourceRootPath were fields from the polyfill wrapper PolyfillModuleSource.

Now sdkModule returns a native ModuleSource, whose equivalents are contextDirectory and sourceRootSubpath.

No behavior change was intended, just converting the types

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Okay lgtm then!

Comment thread harness.dang
view.withFile("dagger.json", view.file(module.sourceRootSubpath + "/dagger.json"))
} else {
view.withFile("dagger-module.toml", view.file(module.sourceRootPath + "/dagger-module.toml"))
view.withFile("dagger-module.toml", view.file(module.sourceRootSubpath + "/dagger-module.toml"))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same here, we're not using the polyfill module is this function so why does it changes? is there a bug in the sdk-sdk module?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Same as above

Signed-off-by: Guillaume de Rouville <guillaume@dagger.io>
@TomChv
TomChv marked this pull request as ready for review August 13, 2026 13:10
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.

2 participants