|
| 1 | +# Legacy `tokenhost-web-template` Notes (Archived) |
| 2 | + |
| 3 | +This document preserves practical insights from the deprecated in-repo `tokenhost-web-template/` before removal. |
| 4 | + |
| 5 | +Status: |
| 6 | +- Source of truth now lives outside this repo: `tokenhost/app-tokenhost-com-frontend`. |
| 7 | +- In this repo, the legacy template is removed to reduce dependency/security noise and avoid dual UI pipelines. |
| 8 | + |
| 9 | +## What was worth preserving |
| 10 | + |
| 11 | +1. Chain mismatch handling and wallet chain add/switch UX |
| 12 | +- Legacy helper implemented explicit `wallet_switchEthereumChain` and fallback `wallet_addEthereumChain`. |
| 13 | +- This behavior remains important for local Anvil onboarding and should be retained in generated UI runtimes. |
| 14 | + |
| 15 | +2. Read/write provider separation |
| 16 | +- Legacy runtime kept a read-capable contract binding and swapped in a signer-backed contract after wallet connect. |
| 17 | +- This pattern avoids write failures during unauthenticated reads and should remain part of runtime architecture. |
| 18 | + |
| 19 | +3. Auth endpoint base URL normalization |
| 20 | +- Legacy utility normalized external auth host using `NEXT_PUBLIC_GOOGLE_AUTH_DOMAIN` with trailing-slash cleanup. |
| 21 | +- Keep this pattern (or equivalent) whenever cross-origin auth endpoints are used by generated UIs. |
| 22 | + |
| 23 | +4. Practical UX components to keep in mind |
| 24 | +- Pagination (`Pager.hbs`) and upload progress UI (`ImageUpload.js`) are useful behavior references. |
| 25 | +- The specific implementation/dependencies are outdated, but the interaction patterns are still relevant. |
| 26 | + |
| 27 | +## What was intentionally not preserved |
| 28 | + |
| 29 | +- Dependency stack and lockfile (`next@13`, `web3`, mixed lint/prettier setup) due to drift and security churn. |
| 30 | +- Handlebars-era file/layout conventions that conflict with the current THS + generated Next export flow. |
| 31 | + |
| 32 | +## Follow-up expectations |
| 33 | + |
| 34 | +- Any necessary visual/UX patterns should be reintroduced in the spec-aligned UI generator under `packages/templates/next-export-ui`. |
| 35 | +- Keep design evolution tied to generated-app test coverage and CI, not legacy template branches. |
0 commit comments