Skip to content

Sync standalone Custom Code Files (ENG-12383)#24

Merged
sbis04 merged 2 commits into
FlutterFlow:mainfrom
sbis04:souvik/eng-12383-custom-code-files
Jun 24, 2026
Merged

Sync standalone Custom Code Files (ENG-12383)#24
sbis04 merged 2 commits into
FlutterFlow:mainfrom
sbis04:souvik/eng-12383-custom-code-files

Conversation

@sbis04

@sbis04 sbis04 commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Fixes ENG-12383

Companion extension PR: FlutterFlow/flutterflow#7516.

Custom Code Files (FF's standalone .dart files at lib/custom_code/<name>.dart) couldn't be synced from the extension — only functions/actions/widgets. The extension had no concept of them: CodeType was A/W/F/D/O only, and the manifest was built solely from the three barrels, so a code file classified as OTHER → not tracked → not pushed.

Changes

  • New CodeType.CODE_FILE = 'C'.
  • buildCustomCodeManifest also scans lib/custom_code/ (non-recursive) for top-level *.dart files (excluding index.dart), registering each as a code file with identifierName = basename incl. .dart.
  • classifyRelativePath: a path exactly lib/custom_code/<name>.dart (no deeper segment, not index.dart) → CODE_FILE; the actions//widgets//functions/ subdirs are unaffected.
  • Tracked + editable + pushed like other custom code; file renames blocked (a code file's identity is its filename); no false "won't sync" warning.
  • Wire contract: type 'C', basename (incl. .dart) as both the zip entry and fileMap key; the server matches FFCustomCodeFile.identifier.name.

Verified empirically (dev project customcodetest-zh0bi3): code files are always flat at lib/custom_code/<name>.dart in both legacy and folder-organized projects (panel folder is display-only), so path-based discovery is correct in both modes.

Tests: jest 36/36, mocha 29 passing, tsc + eslint clean. New fixtures + classify/manifest/edit-tracked/rename-blocked tests.

⚠️ Deployment ordering: publish this only after the server PR (#7516) is deployed — an old server mis-handles a 'C' entry (falls into the custom-function branch).

sbis04 and others added 2 commits June 18, 2026 14:31
The extension only tracked custom functions/actions/widgets via the three
barrel files, so standalone Custom Code Files (generated flat under
lib/custom_code/<name>.dart) classified as OTHER and were never pushed.

Add a CODE_FILE ('C') type that classifies any *.dart directly under
lib/custom_code/ (excluding the actions/widgets/functions subfolders and
index.dart) and scan that directory non-recursively when building the
manifest. A code file's identifier is its basename including .dart, matching
the server's FFCustomCodeFile.identifier.name. Renames of code files are
blocked like other custom code, and they are tracked (no "won't sync" warning)
and pushed by basename via the existing wire file map.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LmtfBu7w6GTyDUa2j2gKWR
@sbis04 sbis04 merged commit 78647ce into FlutterFlow:main Jun 24, 2026
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.

1 participant