Skip to content

Conversation

@sliemeobn
Copy link
Contributor

as discussed in #477

This PR

  • makes sure the Runtime remains compatible with "isolatedModules" (ie: esbuild, rollup, ...)
  • move the JSBridge stubs out of the plugin template for better reusability

I think these changes are good even when the whole "how to best bundle/deploy/build/package" is not fully clear yet.

@sliemeobn
Copy link
Contributor Author

unfortunately this tsconfig setting "isolatedModules": true messes up the codegen for export const enum Kind
I reverted it for now, but maybe we should add CI checks for the Runtime "buildability" somehow?

@kateinoigakukun
Copy link
Member

I still do not want to expose the Runtime code as an API because maintaining a stable interface at that layer requires much effort.

@sliemeobn
Copy link
Contributor Author

@kateinoigakukun I understand the concern. I don't think this PR changes anything in that regard.

@kateinoigakukun
Copy link
Member

kateinoigakukun commented Dec 24, 2025

Sorry, I still can't see a clear benefit in merging this change.

I've gone through the discussion and the measurements again, and I still can't support this direction. The latency we are seeing comes from the implementation details of SwiftPM's plugin evaluator with native build system (especially the manifest caching disablement is the major 100ms-level bottleneck), not from the SwiftPM's plugin architecture itself. Once SwiftPM's swift-build migration lands, that overhead disappears, so we don't have a strong reason to work around plugins on our side.

Also the BridgeJS stubs are just a hack, and they won't be necessary after we start using BridgeJS inside JavaScriptKit, so I don't want to split it out now.

@MaxDesiatov
Copy link
Member

MaxDesiatov commented Dec 24, 2025

Once SwiftPM's swift-build migration lands, that overhead disappears, so we don't have a strong reason to work around plugins on our side.

Have either of you tested how this works with --build-system swiftbuild that's already available in main and 6.3 toolchain snapshots? We need to make sure that any bugs in that flow are found early, reported back, and ideally fixed before it eventually becomes the default.

@kateinoigakukun
Copy link
Member

@MaxDesiatov It's not working today swiftlang/swift-package-manager#9364

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.

4 participants