Repository navigation
Serve apps/effect to hosted app Workers - #2620
Open
kristojorg wants to merge 1 commit into
Open
kristojorg wants to merge 1 commit into
kristojorg wants to merge 1 commit into
Conversation
The app bundler marks every apps/* import external and then provides a module only for each entry in frameworkExports. apps/effect was not in that list or in the framework's server runtime, so an app that imports wrap from apps/effect deployed but failed when its Worker loaded: No such module "apps/effect". Release-note: Fix: Apps can import apps/effect, so a tool's input can be an Effect Schema passed through wrap. Amp-Thread-ID: https://ampcode.com/threads/T-b202b012-54e3-4a0a-8c9e-3b9a240ce4f1 Co-authored-by: Kristo Jorgenson <[email protected]>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An app that imports
wrapfromapps/effect, to use an Effect Schema as a tool's input, deploys on Cloud but fails when its Worker starts:compileWorkerAppmarks everyapps/*import external. It then provides a module only for each name inframeworkExports, and the framework's server runtime (runtime.json) holds onlyserverEntries.apps/effectwas in neither list, so it only shipped to browser bundles. This adds it to both.bun run apps:protocolsreports no host protocol change.app-worker-modules.spec.tsnow also deploys an app whosegreetinput iswrap(Schema.Struct({ name: Schema.String }), false)and calls it cold.I couldn't run the Cloud target here: the stack runs out of memory under the 6 GB limit on my machine. Instead, I compiled that app with
compileWorkerApp(the builtappsdist ashost.apps) and loaded the reachable modules in workerd through Miniflare:v2:apps/effectis not in the bundle, and workerd fails withNo such module ".../apps/effect".apps/effect, and the Worker loads.bun run e2e:checkandoxfmt --checkpass. This changespackages/apps. If its release needs a version bump, I'll add it, or you can bump it when you port this.