Skip to content

fix(dev): reload functions when base44/shared/ changes - #685

Open
base44-builder-dev[bot] wants to merge 1 commit into
mainfrom
fix/dev-reload-shared-code
Open

base44-builder-dev[bot] wants to merge 1 commit into
mainfrom
fix/dev-reload-shared-code

Conversation

@base44-builder-dev

Copy link
Copy Markdown

Problem

Functions can share code via base44/shared/ (#563): it is uploaded with every function and imported as ../../shared/.... But base44 dev only watched functions/ and entities/, so editing a shared file left running local functions on stale code until something under functions/ changed.

Change

  • core/resources/function/config.ts: export getSharedDir(functionsDir) (the existing base44/shared/ resolution), used by readSharedFiles.
  • cli/dev/dev-server/main.ts: also watch the shared dir; a change there reloads functions like a change in functions/. The watcher already handles the dir being absent or created later.

Tests

  • New dev.spec.ts case + with-shared-code fixture: serves a function importing ../../shared/greeting.ts, edits the shared file, waits for Reloaded functions: greet, and checks the new value is served. It fails without the fix (times out waiting for the reload) and passes with it.
  • Locally: 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 no deno binary. Typecheck and biome are clean.

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.2.6-pr.685.636d588

Prefer not to change any import paths? Install using npm alias so your code still imports base44:

npm i "base44@npm:@base44-preview/cli@0.2.6-pr.685.636d588"

Or add it to your package.json dependencies:

{
  "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
base44-builder-dev Bot force-pushed the fix/dev-reload-shared-code branch from 22d44fc to 20a9ba4 Compare October 29, 2026 15:31
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.

0 participants