feat(facade): tanstack passthrough + theme persistence; Web Host CDN 1.0.41 (EE2-2265, EE2-2274)#66
Merged
Conversation
…ppConfig.tanstack
Expose a `tanstack` JSON requirement (default "{}") that the config handler
decodes and returns as top-level `tanstack` in /api/public/facade/config, so the
Web Host can apply TanStack Query defaults globally and per role-based category
(content/lists). Mirrors the api_routes/axios_defaults JSON-requirement pattern.
- config_handler.lua: read tanstack via non_empty_map_or_nil(get_req_json_any),
add `tanstack` to the returned config table
- _index.yaml: tanstack ns.requirement → wippy.facade:tanstack .default
- config_handler_test.lua: tanstack in REQ_NAMES + defaults; default + decode tests
- README: tanstack row in the optional JSON parameters table
Stacked on the theme_mode facade branch (config_handler already returns themeMode).
Point fe_facade_url default (+ Makefile/README/config_handler_test) at the 1.0.40 host bundle, matching the tanstack + postMessage-hardening release. Pairs with the facade tanstack requirement on this branch (publish 0.6.13).
- New `theme_persist` (none|cookie|localStorage, default none) + `theme_storage_key` (default @wippy-theme-mode) requirements, returned by /facade/config. Opt-in. - Generated script at GET /facade/theme-persist.js (theme_persist_handler) with the key + mode baked in: early-applies the stored theme class and exposes window.wippyThemePersist (read/write/apply). One <script src> integrates any page. - Shell converted to a Jet-rendered endpoint (index.jet + index_handler): in cookie mode it reads the cookie server-side and bakes the w-theme-* class onto <html> (no flash); seeds the persisted value into initWippyApp and persists changes via the host's themeChanged event. - Bump Web Host CDN ref 1.0.40 -> 1.0.41 (fe_facade_url in _index.yaml, Makefile, README.md, config_handler_test.lua). Verified: facade test suite green; cookie SSR + endpoints validated against a real consumer (app-template-raw, 6/6 Playwright e2e green).
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.
EE2-2265 — facade
tanstackparam + CDN 1.0.40Rebased onto current
master(preserves the strict security policies from9d624bc/f01b29d). Adds, on top:tanstackrequirement (default{}) →config_handlerreturns it as top-leveltanstackin/api/public/facade/config({ default?, content?, lists? }— global + per-role TanStack Query defaults). Mirrors theapi_routes/axios_defaultsJSON-requirement pattern.1.0.39→1.0.40(_index.yamlfe_facade_urldefault,Makefile,README,config_handler_test).config_handler_testcase for the tanstack decode.EE2-2274 — theme persistence (cookie / localStorage / none) + Jet SSR shell
Facade-owned theme persistence; the Web Host stays persist-agnostic (it only emits a new
themeChangedevent). Published aswippy/facade@0.6.17./api/public/facade/config—theme_persist(nonedefault |cookie|localStorage) →themePersist;theme_storage_key(default@wippy-theme-mode) →themeStorageKey. Clamped (unknown value →none, empty key → default) withconfig_handler_testcoverage.theme_persist_handler.luaservesGET /facade/theme-persist.js(application/javascript) with KEY/MODE baked in — early-applies thew-theme-*class from storage and exposeswindow.wippyThemePersist { mode, key, read, write, apply }. One render-blocking<script src>integrates any page, including non-Wippy-hosted ones.index.jet+index_handler.luaread the theme cookie server-side and bakeclass="w-theme-dark"/color-schemeonto<html>for zero-flash in cookie mode, and seed the persisted value intoinitWippyApp. The host applies it via the existingapplyThemeMode— no host persist logic.1.0.40→1.0.41(_index.yamlfe_facade_url,Makefile,README,config_handler_test).