Update container-views example to match external-views infrastructure#26613
Update container-views example to match external-views infrastructure#26613ChumpChief merged 11 commits intomicrosoft:mainfrom
Conversation
Replace example-utils/aqueduct abstractions with example-driver and direct container-loader APIs. Restructure src into container/ subdirectory, switch to default html-webpack-plugin template, add multi-service support (local/t9s/odsp), and modernize tests to use puppeteer directly. The container-views pattern is preserved via an IContainerView entry point that bundles mount/unmount with the container. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The package is private and nothing imports it; the webpack entry point is app.ts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use ContainerViewRuntimeFactory, IFluidMountableViewEntryPoint, and MountableView from @fluid-example/example-utils instead of the custom IContainerView interface and DiceRollerContainerRuntimeFactory, matching the pattern used by the diceroller example. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use named React imports (createElement, FC, useState, useEffect) in both - Rename view prop to diceRoller and destructure in parameter in both - Add missing "react" type to container-views tsconfig.json - Align test name to "The page loads and there's a button with Roll" - Add "// Render view" comment to container-views app.ts - Fix missing const in diceroller jest.config.cjs - Fix "device" typo to "dice" in diceroller JSDoc - Remove unused uuid dependency from diceroller Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Apply external-views dice styling (dynamic color, centered layout, larger fonts) to container-views and diceroller. Align external-views with the other examples: add explicit return type on useEffect cleanup, add react to tsconfig types, update test name, remove dead main/types fields, remove unused uuid and process dependencies, fix description. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…back Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Human note: This PR updates container-views in the same way that I've updated external-views and diceroller in the past, so most of the changes are there (esp. app.ts). The changes in external-views and diceroller are more minor or stylistic changes to better align the three examples. |
There was a problem hiding this comment.
Pull request overview
Updates the container-views example app (and aligns related dice roller examples) to match the newer “external-views” infrastructure/patterns, including multi-service driver support, modernized runtime/view wiring, and refreshed tests/styling.
Changes:
- Restructures
container-viewsto useContainerViewRuntimeFactory+FluidDataStoreRuntime(removing Aqueduct/DataObject usage) and adopts the shared example-driver + webpack-integration service selection flow. - Modernizes browser tests to use puppeteer directly and adds a cross-container event propagation test.
- Aligns dice roller UI and React usage across
container-views,external-views, anddiceroller, plus trims unused deps/config entries.
Reviewed changes
Copilot reviewed 29 out of 30 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Updates lockfile for removed/added example dependencies. |
| examples/view-integration/external-views/tsconfig.json | Adds react to types for TS in this example. |
| examples/view-integration/external-views/tests/externalViews.test.ts | Renames a test for consistency. |
| examples/view-integration/external-views/src/view.tsx | Adds explicit (): void return type to effect cleanup. |
| examples/view-integration/external-views/package.json | Cleans description/fields and removes unused deps. |
| examples/view-integration/container-views/webpack.config.cjs | Switches to example-driver service plugin + ODSP middleware wiring and updates HTML plugin usage. |
| examples/view-integration/container-views/tsconfig.json | Updates TS types list and includes tests in compilation. |
| examples/view-integration/container-views/tests/diceRoller.test.ts | Removes obsolete skipped test file. |
| examples/view-integration/container-views/tests/containerViews.test.ts | Adds puppeteer-driven integration tests including cross-container event propagation. |
| examples/view-integration/container-views/src/view.tsx | Removes old view implementation (moved under src/container/). |
| examples/view-integration/container-views/src/model.ts | Removes Aqueduct DataObject-based implementation. |
| examples/view-integration/container-views/src/interface.ts | Removes old interface (replaced by new diceRoller interface). |
| examples/view-integration/container-views/src/index.ts | Removes unused package entrypoint exports. |
| examples/view-integration/container-views/src/index.html | Removes custom HTML template in favor of default html-webpack-plugin template. |
| examples/view-integration/container-views/src/containerCode.ts | Removes old ModelContainerRuntimeFactory-based wiring. |
| examples/view-integration/container-views/src/container/view.tsx | Adds new container-scoped React view aligned with other examples. |
| examples/view-integration/container-views/src/container/index.ts | Exports fluidExport via ContainerViewRuntimeFactory and binds view callback. |
| examples/view-integration/container-views/src/container/diceRoller/interface.ts | Defines typed events + public dice roller API via core-interfaces. |
| examples/view-integration/container-views/src/container/diceRoller/index.ts | Barrel exports for dice roller types/factory. |
| examples/view-integration/container-views/src/container/diceRoller/diceRoller.ts | Implements dice roller as a FluidDataStoreRuntime-based store + factory. |
| examples/view-integration/container-views/src/app.ts | Reworks app bootstrap to use example-driver multi-service flow and mount the container-provided view. |
| examples/view-integration/container-views/package.json | Updates scripts for multi-service start modes and adjusts deps (removes Aqueduct, adds driver + lower-level runtime packages). |
| examples/view-integration/container-views/jest.config.cjs | Fixes missing const and keeps jest-puppeteer preset setup. |
| examples/view-integration/container-views/jest-puppeteer.config.cjs | Updates server command to use start:test. |
| examples/view-integration/container-views/eslint.config.mts | Switches eslint config from minimalDeprecated to recommended. |
| examples/view-integration/container-views/README.md | Updates example description and data model summary (needs terminology corrections). |
| examples/apps/diceroller/src/container/main.tsx | Aligns React usage, prop naming, styling, and fixes typo (“dice”). |
| examples/apps/diceroller/src/container/index.ts | Switches to createElement + aligns callback parameter naming/typing. |
| examples/apps/diceroller/package.json | Removes unused uuid dependency. |
| examples/apps/diceroller/jest.config.cjs | Fixes missing const for mappedPort. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
examples/view-integration/container-views/src/container/diceRoller/interface.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output |
| * Licensed under the MIT License. | ||
| */ | ||
|
|
||
| import React, { type FC, useEffect, useState } from "react"; |
There was a problem hiding this comment.
Same question, why the mix of specific and general imports
| DiceRoller uses the following distributed data structures: | ||
|
|
||
| - SharedDirectory - root | ||
| - SharedMap |
There was a problem hiding this comment.
In general, seems like a good follow up to probably switch our examples to SharedTree since that is what we'd like all new customers to use. But obviously not needed as part of this PR
alexvy86
left a comment
There was a problem hiding this comment.
Infra changes look good, in line with the ones in the other examples. Shahar's comments are worth addressing IMO. Since it's a relatively mechanical change replicating what you've done before I didn't scrutinize every line, but overall it looked fine.
I'm actually attempting an update to use React's new JSX transform at this very moment :) |
Summary
container-views restructuring
src/intosrc/container/subdirectory matching external-views layout (diceRoller/,view.tsx,container/index.ts)IContainerViewinterface withContainerViewRuntimeFactory,IFluidMountableViewEntryPoint, andMountableViewfrom@fluid-example/example-utils(matching the diceroller example pattern)FluidDataStoreRuntimeandIFluidDataStoreFactoryfor the DiceRoller data store (instead ofDataObject/DataObjectFactoryfrom aqueduct)src/index.tspackage entry point and@fluidframework/aqueductdependency@fluid-example/example-driverand@fluid-example/example-webpack-integrationsrc/index.html)minimalDeprecatedtorecommendedAlign all three dice roller examples (container-views, external-views, diceroller)
createElement,FC,useState,useEffect) instead of defaultReact.xxxstylediceRolleras the view prop name with destructured parameters(): voidreturn type on useEffect cleanup functions"react"to tsconfig types in external-viewsconstin dicerollerjest.config.cjsuuidfrom diceroller;uuid,processfrom external-viewsmain/typesfields from external-viewspackage.jsonDiceRollerFactory.typeto areadonlypropertyTest plan
pnpm run buildpasses (biome, tsc, eslint)pnpm run test:jestpasses (puppeteer tests validate button loads and cross-container sync)pnpm run start:local— app loads at localhost:8080, dice rolls work🤖 Generated with Claude Code