Repository navigation
Conversation
…nario Renders real widgets in a Vite page with props backed by an in-memory store: live ListValue (filter, sort, paging, total count, loading delay), a mendix/filters/builders implementation, live props, and Playwright tests for Datagrid rendering, sorting, text filtering, paging and actions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request type
Test related change (New E2E test, test automation, etc.)
Why
Running a widget in a real browser today means mxbuild, mxruntime and Docker (
automation/run-e2e). This adds a lightweight harness that renders the real widget components with props backed by a live in-memory data store, so widgets can be exercised in Playwright in seconds. It fakes only the pluggable widget API props (mendixtypings) and the data behind them. It is not a Mendix client, and it is built only from the public typings and the widgets' own code.What changed
New private package
packages/shared/widget-harness:src/store(no React, no Jest):DataStoreholds plain entity objects and stableObjectItems.LiveListis a liveListValuethat appliessetFiltercondition trees,sortOrder,offset/limit,requestTotalCount/totalCount,hasMoreItemsandreload, and goesloading→availableafter a configurable delay. Each change publishes a new snapshot, like the client giving widgets new props.src/filters/builders.ts: amendix/filters/buildersimplementation;evaluateFilterruns its trees against rows.src/props/Harness.ts: live props on top of the store, with aversionthat changes whenever a widget-visible value changes.host/: Vite page that mounts a scenario and re-renders it with fresh props. First scenario:datagrid-basic, real Datagrid with the real text filter in a column header.e2e/: 5 Playwright tests: first page renders, sort asc/desc, case-insensitive text filter, paging, and a store mutation re-rendering a row plus a row click recordingonClick.Live vs stubbed:
ListValue(filter, sort, paging, total count, reload, loading delay)ListAttributeValue.get→EditableValue,setValuewrites to the storesetFormatter,setKeepSelectionare no-opsListExpressionValue,ListWidgetValueisExecutingis alwaysfalseActionValue,ListActionValue(record calls, can mutate the store)EditableValuewith validatorSelectionSingleValue/SelectionMultiValue,DynamicValueWhat Datagrid needed from the client: almost nothing. The
mendixpackage throws at runtime and esbuild doesn't inline its const enums, sohost/shims/mendix.tsprovidesValueStatus/FormatterType. Datagrid's setup is not StrictMode-safe, so the host doesn't use StrictMode (neither does the client).window.mxis only used optionally in export.How to run
window.harnessexposes the store and recorded action calls to tests.Scope
Only the new package plus
pnpm-lock.yaml. New devDeps:vite@7.3.7,sass@1.102.0,react/react-dom@18.3.1; depsbig.js,mendix(typings). Left out: Jest entry for the store core, other widgets/filters, CI wiring.Tradeoffs
src/so no prior build is needed. The cost:host/is excluded fromtsc(typecheckcoverssrc/ande2e/), because widget sources only typecheck against builtdisttypings.test:e2e, note2e, so the nightlypnpm -r run e2edoesn't pick it up until CI wiring is decided.Blast radius
None outside
packages/shared/widget-harness. No widget code changed.Verification
pnpm run lint,pnpm run typecheckandpnpm run test:e2e(5/5, stable over--repeat-each 3) in the package.🤖 Generated with Claude Code