RFC 0073 — Every row out: a paged list's export
Status: implemented (2026-11-29) · Target: 0.65.0 · builds on RFC 0066 and RFC 0071 · see Decisions
Summary
RFC 0066 took a table out: copy, copy the table, save as CSV. Over a
plain rows array that's every row; over a live page, the list
make:resource makes, it's the page that's loaded, and RFC 0066 left
"every row of a server-paged query" for later. Since RFC 0071 the lists
over a Laravel backend are server-paged too, and filtered there: the
accountant's "the overdue invoices for Q3, as a file" is 25 rows of 340.
This RFC lets a paged table fetch every row the user's query matches, for Copy table, Save as CSV… and the app's own buttons:
<Table
page={list}
bind:query
every={(q) => api.customers_index(q)}
label="Customers"
/>
every={(query) => Promise<Page>}: how the table asks for a page outside the live query. With it, and more than one page, Copy table is Copy all 340 rows and Save as CSV… saves all 340.- The user's query: the search, the filters and the sort as they are, page by page at the largest page the command allows, the rows in order.
- Progress, and a way out: the table's bar says "Fetching rows… 100 of 340" with Cancel (and Esc); nothing is written or copied if it's cancelled or fails.
make:resourcepasseseveryin the lists it writes, local and over a backend.
Motivation
- The list is filtered for a reason. RFC 0069's filters and RFC 0070's views make a list the user can name ("Overdue, Q3"), and the first thing done with it is to send it on. A page of it is the wrong file, and it doesn't say so.
- The app can't do it alone without repeating the table. It knows the
command, but not the user's search, filters and sort unless it reads
queryand re-pages itself, and then it has no progress, no cancel, and its CSV isn't the table's (the columns the user chose, their order, labels andformat). - The server caps a page. Both
make:resource's commands and the Laravel package'selyraListstop at 100 a page (RFC 0071), on purpose: "every row" is many requests, which is why it needs a progress bar and a cancel.
Current state (0.64)
Tabletakespage(a live store or aPage) and writes the user'ssearch,sort,direction,pageandfiltersintoquery(RFCs 0012, 0069).csv(),copy()andsave()takeeveryRow(), which is the loaded page when the table is paged (RFC 0066).- A
Pagehasdata,total,per_page,current_page,last_pageand, since RFC 0071,totalsover every match. make:resource's index command clampsper_pagetoMAX_PER_PAGE(100);elyraListtomax_per_page(100 by default). Both answer theper_pagethey used.- The generated index view has
api.{p}_index, the same command aslive.{p}_index, already imported.
Design
every
every?: (query: ListQuery) => Promise<Page<Row>>
A function from a query to a page: in an app, the index command through
api. The table calls it with the user's query as it stands (search,
sort, direction, filters, and the app's own keys in query), with
page from 1 and per_page: 100. It reads last_page from the first
answer and asks for the rest, one at a time, in order. The server's own
per_page (if it answers less) is what's used; the rows are joined as they
come.
Without every, nothing changes: a paged table exports the loaded page.
With every and one page (last_page <= 1), the table exports what it
has, without asking again.
What's taken
without every |
with every, several pages |
|
|---|---|---|
Copy table, save() |
the loaded page | every row, fetched |
| Copy (a row, the selected rows) | the same | the same: only what's on the page |
csv() |
the loaded page | the loaded page (it's synchronous) |
csvAll() |
— | every row, fetched: the CSV |
The menu says what it takes: Copy all 340 rows and Save 340 rows as
CSV… (from the page's total), so a user doesn't wait for 40,000 rows by
surprise. The foot's totals are the page's totals (RFC 0071), which are
already over every match: the CSV's total line is the same.
csvAll() and rows() are new on the component, through bind:this:
rows() the rows themselves (for an app's own export, an XLSX or a
report), csvAll() the CSV of them. Both reject with an AbortError if
the user cancels.
Progress and cancel
While it fetches, the table's bar (where the search is) shows a Progress
with "Fetching rows… 100 of 340" and a Cancel button; Esc on
the table cancels too, and the region is announced as it starts and ends.
The table stays usable: the live page isn't touched, and a second export
while one runs is refused (the menu's items are disabled).
A cancel, or a page that fails, stops it: nothing is copied or written, the failure is the toast RFC 0066 already shows ("Couldn't export: …").
A large list
Above 10,000 rows (the total), the table asks first through the
runtime's confirm: "Fetch 42,100 rows? It can take a while." The limit
is everyLimit (default 10000; Infinity to never ask). Nothing caps
the export itself: an app that wants a cap has every to say so (it can
answer fewer pages).
Consistency
Pages fetched one after another over a list that changes in between can
skip or repeat a row (offset paging). The table drops a row it has
already taken, by its key (key, id by default). A skipped row is a
real gap, said in the docs: an export that must be exact belongs to the
server (a command that writes the file), which is the app's.
make:resource
The index view it writes passes every={(q) => api.{p}_index(q)}; over
a backend, the same command calls Laravel's elyraList. Nothing changes
in the commands: they already take per_page, clamped.
Implementation plan
ui/src/internal/every.js:fetchEvery(every, query, { signal, onprogress, keyOf })— pages in order,per_pagefrom the first answer, de-duplicated by key, anAbortSignal. Unit-tested without a table.Table.svelte: theeveryandeveryLimitprops, the menu's labels,rows()andcsvAll(),save()and Copy table through them, the progress bar with Cancel and Esc, the words (en, nb).make:resource:everyin the index view; the browser smoke checks (scripts/smoke/harness.js) save a list of three pages and count its lines.- Docs:
table.md(Taking it out),resources.md, the ui skill; the CHANGELOG; the roadmap.
Open questions
- A prop that's a function, or the table asking
page's source? Recommendation: a function. Alive.*store doesn't carry its command or say how to ask it again for another page, and the function is a line the app (ormake:resource) writes. per_page: 100, or the page's ownper_page? Recommendation: 100, the cap both servers have; a server that answers less is followed. Fewer requests, the same rows.- Ask above 10,000 rows?
Recommendation: yes, with
everyLimitto change it. At 100 a page that's 100 requests: worth a question, not a wall. - Should Copy of selected rows fetch too? Recommendation: no: a selection over a paged list is the page's (RFC 0012), and what's selected is what's on the screen.
csv()async withevery? Recommendation: no,csv()stays synchronous and the page's;csvAll()is the new, asynchronous one. Changingcsv()'s type would break the apps that call it.
As built
internal/every.js:fetchEvery(every, query, { signal, onprogress, keyOf })andfetches(every, page), plain functions. A page that comes back empty before the last ends the fetch (the list shrank).allRows(), notrows():rowsis already the table's prop (a plain array), and a component's export can't share a prop's name. The RFC'srows()isallRows();csvAll()is as designed.copy()andsave()answernullwhen the user cancels (assave()did for the dialog), so the menu's "Copied" isn't shown;allRows()andcsvAll()reject with anAbortError.- The progress is a
Progressunder the table's bar, in a group named "Fetching every row", with the count and Cancel; the start, the end and a cancel are said in the table's live region. While it runs, the menu's Copy all and Save are disabled. - The confirm above
everyLimitis the runtime's, with "Fetch them" and "Cancel". - Checked in the browser: the resource smoke test makes a list of six pages, opens the table's menu ("Copy all 130 rows") and sees the index command asked for pages 1 and 2 at 100 a page.
Decisions
Accepted 2026-11-29, with every recommendation:
everyis a function from a query to a page, not read frompage.- Pages of 100; a server that answers fewer is followed.
- Above 10,000 rows the table asks first;
everyLimitchanges it. - Copy of the selected rows takes the page's, as it is.
csv()stays synchronous and the page's;csvAll()androws()fetch.
Not in this RFC
- An export the server writes (a command that streams the file).
- Formats other than CSV and the clipboard (XLSX):
rows()gives the rows to an app that writes them. - Background exports that outlive the window.
Alternatives considered
- A large
per_pagefor exports. Lifting the cap for an "export" flag makes one request of 40,000 rows, which the server and the IPC bridge pay for at once, without progress or a way to stop it. - Cursor paging. Exact over a changing list, but neither
make:resource's commands norelyraListpage by cursor, and the de-duplication covers the common case.