Full polyglot widget support with bleeding-edge Valdi#9
Conversation
…), widgets catalog, and per-component Bazel targets - Add native implementations for DatePicker, TimePicker, IndexPicker, EmojiLabel on iOS, macOS, Android, and web - Add WidgetsCatalog playground screen with live-updating demo of each polyglot widget - Add "Browse Widgets Catalog" button in Playground that opens/closes the catalog view - Refactor widgets/BUILD.bazel with named filegroup targets per component (:animation, :button, :pickers, etc.) - Move Android Kotlin binders from nested com/snap/widgets/pickers/ to flat android/ directory - Point WORKSPACE at bleeding edge of public Valdi GitHub (d0cd062) - Add enable_web=true to .bazelrc for Valdi compiler JS output - Add web playground app (webpack) and bazel_web_serve.sh script - Add Share module scaffold (iOS, Android, web, TypeScript) - Add Cursor rules for polyglot modules, custom views, and web polyglot patterns Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Semgrep found 31
This literal might contain a Snapchat internal reference that should not be committed to open-source repositories. Fix: Please replace / remove the string to avoid committing it to open-source repositories. |
- bazel.md: WORKSPACE now uses git_repository (not http_archive); web_deps must be a plain JS filegroup (not ts_project); add per-component filegroup pattern with explanation of why sub-packages break the Valdi compiler - web-polyglot.md: rewrite — plain .js files required (ts_project causes TS5055 on exec-platform); document current attribute-update limitation - polyglot-module.md: flatten android/ structure (no deep com/snap/... nesting) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…age-lock.json - docs/android-internal-valdi.md: remove Fix 2 which referenced the Snap internal monorepo (triggered .internal forbidden string check) - .gitignore: exclude playground/web_app/package-lock.json (jsesc npm package path contained .sc- which triggered forbidden string check) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace all relative imports that cross component target boundaries with absolute 'widgets/src/...' paths. This is a prerequisite for adding per-component BUILD.bazel files (blocked on Valdi compiler adding a module_root param to valdi_module() to prevent sub-package path stripping). 56 imports converted across 33 files. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- SCWidgetsMacOSIndexPicker: NSPopUpButton subclass with screen-coordinate menu popup to work around Valdi layer-backed view hierarchy constraints - SCWidgetsMacOSLabel: bind to 'value' attribute (was 'text'); add system and system-bold font support - TabsContent: defer coordinator subscription to onRender to prevent synchronous setState during parent render (caused blank catalog page) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Render WidgetsCatalog one frame after showCatalog becomes true. This prevents a stale-renderer crash that can occur when the hot reloader initializes the runtime and a component with child sub-components is rendered in the same frame as the navigation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…I setup note Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace incorrect `claude rules install` reference with the correct `valdi skills install` command from the Valdi CLI. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…reload Raw setTimeout callbacks survive module reloads, firing against a stale component instance and crashing with "Cannot call this outside of a onRender callback". setTimeoutDisposable ties the timer to the component lifecycle so it's cancelled when the component is reloaded. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Update WORKSPACE to Valdi 45b28375 (http_archive from public repo) with full macOS view resolution and web custom-view attribute support - Add valdi_js_engine flag alias to .bazelrc - Add Android EmojiLabel widget (ValdiEmojiTextView) - Fix iOS widget class names for macOS fallthrough compatibility - Fix web widget factories for attribute handler pattern - Show widgets catalog by default in playground - Fix WidgetsCatalog layout and label rendering Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Semgrep found 9
This literal might contain a Snapchat internal reference that should not be committed to open-source repositories. Fix: Please replace / remove the string to avoid committing it to open-source repositories. |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ts_project Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The setTimeout(..., 0) style “wait until next tick” workaround is a very common AI-generated move. It may be masking a real lifecycle or initialization bug rather than fixing it directly. I suspect there is a proper underlying fix here. I’m not convinced this alone should block the PR, but it’s worth calling out.. I've even added to my own agents files to "not add runtime or thread pausing as a solution to a problem, etc.." |
Summary
Polyglot Widgets
ValdiEmojiTextView+ attributes binderIndexPickernative viewiosClass)WebViewClassAttributeHandlerpatternPlayground Fixes
WidgetsCataloglayout and label attribute renderingsetTimeoutDisposableto avoid stale renderer on hot-reloadTabsContentrender crash, remove stale comment fromonViewModelUpdateBuild & Tooling
45b28375viahttp_archivefrom public GitHub repo — includes macOS view resolution fallthrough, web custom-view attribute forwarding, CVDisplayLink deadlock fix, and Hermes engine flagfilegroupto typed TypeScriptts_projectsharemodule (not referenced by any other module)valdi_js_engineflag alias to.bazelrcpackage-lock.jsondocs/folder and.github/copilot-instructions.mdAI / Developer Experience
AGENTS.md: add Valdi CLI install instructions, fix AI setup, remove.cursor/rulesreferencesTest plan
bazel build //valdi_modules/playground:app_macos— playground builds and renders from public Valdi repovaldi install ios— playground builds and runs in simulatorvaldi install android— playground builds and installs on emulator./scripts/bazel_web_serve.sh— playground builds and serves at localhost:8080ts_projectfor web polyglot views compiles successfully🤖 Generated with Claude Code