Conversation
Importing join/isProd from frame-master/utils pulled the full plugin graph (Bun.file proxy, config loader) into Cloudflare Pages Functions. Move directiveManager to frame-master/plugin/utils and lock the helper module with a browser-bundle regression test.
Contributor
|
Important Review available on request
Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Docs config load failed because apply-react still imported directiveManager from frame-master/utils. Point the git dep at deb42cb which uses frame-master/plugin/utils instead.
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.
Why
The docs production build succeeds, but the Cloudflare Pages Functions output is not a valid Workers artifact.
frame-master/utilsis the public helper API (join,isProd,verboseLog). It importeddirectiveToolSingletonfrom./plugins— the full plugin barrel. That statically pulled:plugin-loaderandgetConfigvirtual-modulesmodule-scopeBun.fileproxyprocess.cwd()config loadingAny plugin that correctly used
join/isProdin code that ships to Pages Functions (apply-reactlayout.tsx→ThrowNotFound→ dynamic SSR pages) dragged the Bun server graph into the worker. Clean functions still compiled to ~17MB and containedBun.file.What this changes for plugin DX
frame-master/utilsis now a Worker/browser-safe helper module. Plugins can importjoin,isProd,isDev, andverboseLogfrom it without pulling plugin-loader or Bun APIs.directiveManagerlives onframe-master/plugin/utils(alias ofdirectiveToolSingleton), next to the other plugin-author APIs.frame-master/utilsgrows another plugin/server import.Migration
No plugin source changes are required for this fix to take effect once this core release is consumed.
Test plan
bun test packages/frame-master/test/utils.test.ts(including new browser-bundle assertion)bun testfocused directive + pipeline client-bundle testsbun run typecheckinpackages/frame-master