Repository navigation
fix(dev): reload functions when base44/shared/ changes - #685
Open
base44-builder-dev[bot] wants to merge 1 commit into
Open
base44-builder-dev[bot] wants to merge 1 commit into
base44-builder-dev[bot] wants to merge 1 commit into
Conversation
Contributor
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.2.6-pr.685.636d588Prefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.2.6-pr.685.636d588"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.2.6-pr.685.636d588"
}
}
Preview published to npm registry — try new features instantly! |
base44 dev watched only the functions and entities directories, so editing a file under base44/shared/ - which functions import as ../../shared/... - left the running functions on the old code until something in functions/ changed. Watch the shared dir (resolved as function config does, via a new getSharedDir) and reload functions on a change there too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
base44-builder-dev
Bot
force-pushed
the
fix/dev-reload-shared-code
branch
from
October 29, 2026 15:31
22d44fc to
20a9ba4
Compare
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.
Problem
Functions can share code via
base44/shared/(#563): it is uploaded with every function and imported as../../shared/.... Butbase44 devonly watchedfunctions/andentities/, so editing a shared file left running local functions on stale code until something underfunctions/changed.Change
core/resources/function/config.ts: exportgetSharedDir(functionsDir)(the existingbase44/shared/resolution), used byreadSharedFiles.cli/dev/dev-server/main.ts: also watch the shared dir; a change there reloads functions like a change infunctions/. The watcher already handles the dir being absent or created later.Tests
dev.spec.tscase +with-shared-codefixture: serves a function importing../../shared/greeting.ts, edits the shared file, waits forReloaded functions: greet, and checks the new value is served. It fails without the fix (times out waiting for the reload) and passes with it.dev.spec.ts,function-config.spec.ts,functions_deploy.spec.ts,dev-actors.spec.ts: 49/50 passing. The one failure (Deno fallback runtime) also fails on main in my sandbox, which has nodenobinary. Typecheck and biome are clean.