Skip to content

Commit 9f54081

Browse files
committed
Add multi-parquet Shiny test, clean up stale plan doc text
1 parent 8eb7b71 commit 9f54081

File tree

2 files changed

+48
-2
lines changed

2 files changed

+48
-2
lines changed

design/duckdb-wasm-engine/duckdb-wasm-engine-test.Rmd

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,54 @@ server <- function(input, output, session) {
947947
shinyApp(ui, server)
948948
```
949949

950+
### Multiple Parquet tables in Shiny
951+
952+
Test that multiple Parquet-backed tables on the same Shiny page resolve their sidecar
953+
files independently. Each table has its own `parquetId` and locator script, so the
954+
querySelector fallback must use a table-specific selector (not just `parquet-locator`).
955+
956+
Test steps:
957+
1. Both tables should render with correct data.
958+
2. Sorting and filtering should work independently on each table.
959+
3. Check browser console for errors (wrong Parquet URL would cause a fetch failure).
960+
961+
```{r eval=FALSE}
962+
library(shiny)
963+
library(reactable)
964+
965+
ui <- fluidPage(
966+
h3("Multiple Parquet tables in Shiny"),
967+
h4("Table 1: mtcars"),
968+
reactableOutput("table1"),
969+
h4("Table 2: iris"),
970+
reactableOutput("table2")
971+
)
972+
973+
server <- function(input, output, session) {
974+
output$table1 <- renderReactable({
975+
reactable(
976+
mtcars,
977+
backend = backendDuckDB(mode = "client", format = "parquet"),
978+
defaultPageSize = 10,
979+
sortable = TRUE,
980+
filterable = TRUE
981+
)
982+
})
983+
984+
output$table2 <- renderReactable({
985+
reactable(
986+
iris,
987+
backend = backendDuckDB(mode = "client", format = "parquet"),
988+
defaultPageSize = 10,
989+
sortable = TRUE,
990+
filterable = TRUE
991+
)
992+
})
993+
}
994+
995+
shinyApp(ui, server)
996+
```
997+
950998
### Arrow IPC in Shiny (client mode)
951999

9521000
Test that embedded Arrow IPC works in a Shiny app with DuckDB client mode.

design/server-side-data/server-side-data.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,6 @@ When server-side search returns zero results, pagination shows "1-10 of 0 rows"
194194
- Parquet sidecar files: same `querySelector` fallback in the Parquet locator script and a runtime URL resolution fallback in `useEffect`
195195
- Both `format = "arrow"` and `format = "parquet"` work correctly
196196
- Warning suppressed when user explicitly sets `mode = "client"` (only warns for auto-resolved client mode)
197-
- This is acceptable behavior matching other table libraries
198-
- Much simpler than full server-side implementation
199197

200198
**Future simplification: consider removing pre-rendered first page.** The R-side pre-rendering of the first page (to avoid a blank flash while WASM loads) adds significant JS complexity: `canSkipInitialDuckDBQuery`, `duckdbQueryCount`, `stateMatchesPrerender` comparison against `defaultSorted`, the groupBy special case (pre-rendered data is flat so we must query immediately), and race conditions when users interact before DuckDB is ready. Without pre-rendering, the query effect fires unconditionally after init and the entire skip optimization disappears. The tradeoff is showing a loading/empty state during WASM init instead of instant first-page display.
201199

0 commit comments

Comments
 (0)