Repository navigation
Conversation
Add three Building Apps how-tos for React views, each verified in a running application: - Work Offline, from the client caching guide: cache the application with @pwa, keep service data in local storage with a fallback only for network errors, and clear it at logout. - Upload and Download Files: the Upload component posts multipart data to a Spring controller, with the CSRF header and the size limits, and a link with the download attribute downloads the file. The old guide's approach, cancelling the Upload request and calling a service, stops after three uploads (vaadin/web-components#13387). - Test React Views, rewritten for Vitest browser mode with Playwright and React Testing Library, with vi.mock() for the generated clients. Remove the Hilla guides for client caching, uploads and downloads, testing, data grids and From Java to React, the FAQ, and the now empty Guides index, with redirects. Update the links to them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vaadin-review-bot
left a comment
There was a problem hiding this comment.
Reviewed the changes — left 1 comment.
| Finding | |
|---|---|
| 🧩 | The upload and download snippets use a files signal that the page never shows. |
|
|
||
| [source,tsx] | ||
| ---- | ||
| include::{root}/frontend/demo/fusion/files/files-view.tsx[tags=upload,indent=0] |
There was a problem hiding this comment.
🧩 The upload and download snippets use a files signal that the page never shows.
The upload tag of files-view.tsx starts at the <Upload> element. The download tag starts at the <ul>. Both use files.value, but the shown code never declares it:
const files = useSignal<StoredFile[]>([]);The StoredFile type is also hidden. A reader who copies the two snippets gets files is not defined. Move the declaration and the type into a shown tag, or add a sentence that says the view keeps the uploaded files in a signal of { id, name } objects.
upload-download.adoc:57 · examples
Preview DeploymentThis PR has been deployed for preview. URL: https://docs-preview-pr-6630.fly.dev Changed pagesAdded content is highlighted in green; removed content is marked in red on each page.
Other changed files
Built from b531f1d |
Review risk: two-way door. Docs and examples only: three new how-to pages, seven removed pages with redirects, link updates, and one word in the Vale vocabulary. Reverting brings the old pages back.
Summary
Moves the React how-to guides from the Hilla section to Building Apps. This is the ninth step of dissolving the Hilla section, after #6611, #6616, #6618, #6620, #6621, #6622, #6624 and #6626. After it, only
articles/hilla/index.adocis left, for the last step.Each how-to was rewritten for 25.4 and run end to end in a scratch 25.4.0-alpha5 application. This pull request targets
mainonly, so it gets notarget/v25.3label.What changed
building-apps/react/work-offline), from the client caching guide:@PWA;cacheable()helper, which falls back to them only when a call can't reach the server and passesEndpointErrors on;building-apps/react/upload-download):uploadFormat="multipart"and the CSRF header from Vaadin's_csrfmeta tags;downloadattribute.building-apps/react/test-views), rewritten from the Hilla testing guide:vi.mock();mvn compile vaadin:generatefor CI.FileController,TaskServiceandTodoService, and views for each guide, replacing the old upload and download examples. The example controller is disabled in the docs application with the hidden@Profile("this-is-just-a-demo-class")line, because it stores uploads in memory.hilla/guides/client-caching→building-apps/react/work-offlinehilla/guides/uploads-downloads→building-apps/react/upload-downloadhilla/guides/testing→building-apps/react/test-viewshilla/guides/data-grids→components/auto-gridhilla/guides/from-java-to-react,hilla/faqand the now emptyhilla/guidesindex →building-apps/reactform-images, Lit FAQ, Lit client caching and Lit guides redirects point at the new pages.MultipartFilerow of Type Conversion.target.getByLabelText()on a Vaadin text field, andvi.spyOn()on a generated client all fail, and its view example didn't compile.Test summary
npm run check-redirectspasses.mvn spotless:applyandmvn compilepass. ESLint passes on the new examples.tsc -p src/test/frontendpasses;vi.spyOn(),getByLabelText(), no signals transform, nooptimizeDeps.include) fail as the page says.🤖 Generated with Claude Code