Docs: bring CLAUDE.md, the transition roadmap and the README up to date

CLAUDE.md: localization now describes core's locale middleware,
$currentLocale/$altLocales and storefront.* Language Lines (there are
no lang/ files or SetLocale); the stack is Lunar 1.5, Postgres,
Meilisearch, Caddy, no Turbo; the design-reference section pointed at
files nobody has, and the component checklist was out of date.

CACHING-TRANSITION.md: records the 2026-11-06 changes (no Turbo, JSON
islands and writes, one bb_state cookie, prefetch instead of prerender),
a status table per task, the A4/A9 rework, and sources that the team
can actually reach.

README: known issues found while writing the boboko plugin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
lexxandClaude Opus 5.5 committed 2026-11-06 18:49:52 +02:00
1 parent f9b2756456
commit 81e70de70f
3 files changed
+114 -70

No files matched your search

+70 -25
View File
@@ -9,10 +9,17 @@ # Caching transition: context and first tasks (for Claude)
file wins on style, Greek register, localization and performance rules.
Source documents (outside this repo, read-only for context):
- `/Users/farenoubi/Projects/boboko-research/caching-islands.md`: the target design
- `/Users/farenoubi/Projects/boboko-research/tech-platform.md`: the platform plan
- `/Users/farenoubi/Projects/boboko-research/tasks.md`: the full task list (3dealer, boboko-core, infra, parked). **The source of truth for task ids**
- `/Users/farenoubi/Projects/boboko-research/team-discussion.md`: decisions, and the open items (D7, D10)
- The research repo (`lexx/research` on code.radical-elements.com), `products/boboko/`:
- `caching-islands.md`: the target design (partly superseded, see "Changed on 2026-11-06")
- `tech-platform.md`: the platform plan
- `manifesto.md`: the principles decisions are checked against
- `tasks.md` (the full task list and **source of truth for task ids**) and `team-discussion.md`
(open items D7, D10) were written in the same planning session but aren't in the research
repo. Ask the team for them.
The rules that come out of this work are written up as skills in the **`boboko` Claude Code
plugin** (re-skills marketplace): `cacheable-pages` above all, plus `storefront-frontend`,
`storefront-performance` and `storefront-translations`.
Every task is also a card on the Planka board (3dealer.gr → Development,
label **Transition**). The task id (A1, W1…) is in each card's description.
@@ -26,23 +33,38 @@ ## Where we're going
(probably as static files Caddy serves without PHP). Anything personal (cart,
login state, wishlist, CSRF token) comes from **one small "islands" request**
that runs only when the visitor has a state cookie, and is answered with
**Turbo Streams** rendered from Blade.
**JSON** that Stimulus applies to elements already in the page.
- Cacheable routes (home, category, product, `/products`, FAQ, legal pages)
will run **without a session**: no cookies, no CSRF token, no `auth()`, no
flash, no `old()`, no `$errors`.
- Session routes (cart, checkout, account, login, contact, islands, writes)
stay in `web`.
- Writes (add to cart, wishlist toggle, review) answer with Turbo Streams that
update every affected place at once.
- Writes (add to cart, wishlist toggle, review) are normal forms enhanced with
`fetch`, answered with JSON. New markup (e.g. a new review) is cloned from a
Blade-rendered `<template>` of the same component.
**Changed on 2026-11-06 (these replace the matching 2026-11-02 decisions below):**
- **No Turbo at all**: no Drive, Frames or Streams. Islands and writes answer with
**JSON**; Stimulus applies it as text and attributes on existing targets. New
markup comes from a Blade `<template>` of the same component, filled with
`textContent`, the same pattern as the Meilisearch search cards. Existing Turbo
code (listing/search Frames, the review Streams from A4) gets replaced.
- **One hint cookie, `bb_state=1`** (has a cart, a login or a wishlist item), with
no count in it. One `GET /{locale}/islands` when it's present, nothing otherwise.
- **Speculation Rules: `prefetch`, not `prerender`.** Prerender runs every analytics,
pixel and consent script on pages nobody may see. Revisit only once pages are
cached and the pilot shows analytics stay correct.
- **Where the standard storefront template lives** (core or starter) is decided once
3dealer is ready.
**Decided (2026-11-02):**
- Turbo Streams for islands and writes (JSON only for consumers that aren't
HTML); the cart badge starts as a fixed-size placeholder.
- ~~Turbo Streams for islands and writes~~ (replaced: JSON, see above); the cart
badge starts as a fixed-size placeholder.
- Laravel 13 (core C0, then A0 here), once core work resumes.
- **Page cache: static files** served by Caddy (later tasks P1–P3).
- **No Turbo Drive.** A normal multi-page site plus Speculation Rules, View
Transitions and back/forward cache (A7–A9 here).
- **No Turbo Drive** (now: no Turbo at all). A normal multi-page site plus
Speculation Rules, View Transitions and back/forward cache (A7–A9 here).
- **Caddy** replaces nginx (W1, the last task in this file).
- **Search and filters will run in the browser against Meilisearch** through
Caddy on a subdomain, with the card as one Blade component reused through a
@@ -65,8 +87,9 @@ ## Where 3dealer is today (personal state found in catalogue pages)
Other facts worth knowing:
- Turbo is installed, but **Drive is off** (`window.Turbo.session.drive = false`
in `resources/js/app.js`). Only Frames are used. **Keep it off**: that's
now decided.
in `resources/js/app.js`). Frames drive the listing, search and sort. **The
direction is no Turbo at all**: don't add to it; Frames go away with the
Meilisearch track, and `@hotwired/turbo` is removed once nothing uses it.
- Catalogue data comes from Meilisearch via boboko-core's `ProductService`.
Listings use query-string filters. Don't change that in these tasks; the
browser-side rewrite is the M track.
@@ -88,8 +111,24 @@ ## Rules for this work
- Follow the `{locale}` controller rule in CLAUDE.md (`$locale` is the first
parameter).
- UI strings: reuse existing `storefront.*` keys where possible. New keys are
DB-backed Language Lines: use the `boboko-translations` skill, never `lang/`
files.
DB-backed Language Lines (the `storefront-translations` skill), never `lang/`
files, and they must reach core's seeder (`boboko:translations:pull`).
## Status (2026-11-06)
| Task | Status |
|---|---|
| A0 Laravel 13 | Waiting for core C0 |
| A1 Cart badge placeholder | Done (`6948c13`) |
| A2 Header without login checks | Done (`702609d`) |
| A3 Stable island targets | Done (`4fc7880`) |
| A4 Reviews without a redirect | Done with Turbo Streams (`f0a1b92`). **Rework to JSON** (see A4 below) |
| A5 Personal-state test | Not started |
| A6 `view:cache` in deploy | Done (`1ff55ac`) |
| A7 View Transitions | Done (`bad5a7d`) |
| A8 Back/forward cache | No commit yet |
| A9 Speculation Rules | Done with `prerender` (`c1acc00`). **Switch to `prefetch`** (see A9 below) |
| W1 Caddy | Done (`6d88d53`) |
## Tasks to work on now
@@ -152,16 +191,18 @@ ### A4. Review submission without a redirect (M)
calls `searchableSync()`, and redirects to `?tab=reviews#product-tabs` with
`withErrors`/`withInput` or a `reviewSubmitted` + `justSubmittedReview` flash.
Change it to:
- A fetch or Turbo form submit (with Drive off, check whether `data-turbo="true"`
on the form is enough, or use a Stimulus controller with
`Turbo.renderStreamMessage`).
- **Success:** a Turbo Stream response that inserts the new review at the top
of the reviews list (rendered from the same Blade partial as the existing
reviews), updates the count and average if shown, and swaps the form for the
thank-you message.
- **Validation errors:** a stream (or 422 + stream) that re-renders the form
with inline errors and the entered values. No session `old()`/`$errors`.
Change it to (**updated 2026-11-06: JSON, no Turbo**; the first version used
Turbo Streams and needs reworking):
- A Stimulus controller that submits the form with `fetch` and
`Accept: application/json`. Remove `data-turbo="true"` and the stream views
(`product/streams/`).
- **Success:** a JSON response (the review, display-ready, plus count and
average). The controller clones a Blade-rendered `<template>` of the same
review component, fills its slots with `textContent`, prepends it to the
list, updates the count and average, and swaps the form for the thank-you.
- **Validation errors:** 422 with `{ "errors": { … } }` (what
`$request->validate()` already returns for a JSON request), filled into the
form's existing error slots, with `aria-invalid`. No session `old()`/`$errors`.
- Remove `session('reviewSubmitted')` from `product/show.blade.php`,
`old()`/`$errors` from `review-form.blade.php`, and
`mergeJustSubmittedReview` and the `justSubmittedReview` flash from the
@@ -231,6 +272,10 @@ ### A8. Back/forward cache eligibility (S)
### A9. Speculation Rules (S)
> **Updated 2026-11-06:** use `prefetch`, not `prerender` (see "Changed on
> 2026-11-06"). The rest of this task stands; once Turbo Frames are gone, the
> Frame-link exclusions can go too.
- In the layout, a `<script type="speculationrules">` with `prerender`,
`eagerness: "moderate"` (hover or press), for same-origin links.
- **Exclude:** cart, checkout, account, login, logout (it's a POST, but