Repository navigation
Type-check samples in CI - #1132
Merged
Merged
Conversation
Samples are outside `astro check`, and their own tsconfigs mostly use `moduleResolution: node`, which cannot see the types the IG packages publish through `exports`. Every IG component types as `any`, so a prop the component does not have passes unnoticed; vnext merged two color-picker samples that way. `npm run check:samples` checks every published sample in one program with tsconfig.samples.json: the add:sample settings, bundler resolution, not strict. It takes about 30 seconds. A shim restores the global JSX.Element that @types/react 19 removed, which 683 generated samples still use. 25 samples fail today. They are listed with the reason in scripts/lib/known-type-errors.json, so CI blocks only new errors. A listed sample that no longer fails also fails the check, so the list only shrinks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ChronosSF
force-pushed
the
sstoychev/samples-type-check
branch
from
October 22, 2026 10:59
c7f50de to
fe42b96
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
The allowlist can silently accept unrelated diagnostics in samples with known failures, so the checker needs tightening before approval.
No open issues 🎉
What changed in this PR
Adds a shared TypeScript validation workflow for published samples, exposing npm run check:samples and running it in CI to catch errors that astro check does not cover.
Changes:
- Adds shared sample compiler configuration and a React JSX compatibility declaration.
- Adds the sample checker, known-error allowlist, and npm script.
- Documents the command and runs it in CI after
astro check.
| File | Summary | Review |
|---|---|---|
tsconfig.samples.json |
Defines shared compiler settings for sample type-checking. | — |
scripts/lib/sample-globals.d.ts |
Restores the global JSX.Element type used by generated samples. |
— |
scripts/lib/known-type-errors.json |
Records currently known sample type failures. | — |
scripts/check-samples.js |
Runs the shared check and validates expected failures. | Moderate: Slug-level allowlisting can accept unrelated new diagnostics in an allowlisted sample. |
README.md |
Documents the sample type-checking command and workflow. | Nit: Clarify that the command checks every published sample, excluding unpublished samples. |
package.json |
Adds the check:samples npm script. |
— |
.github/workflows/ci.yml |
Runs sample type-checking in CI after astro check. |
— |
Review effort: Lite
Drop the known-failures list: the check now fails on any type error in a published sample, so CI stays red until the 25 samples it listed are fixed. Samples in unpublished.json are still skipped, as everywhere else. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A failed step skips every later one, so the red sample type check hid whether the build and smoke tests pass. The build now runs regardless, and the smoke tests whenever the build succeeds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The errors `npm run check:samples` found in the 20 samples maintained here, not exported from igniteui-xplat-examples: - x-date-picker date-limits, editing, format: create `root` before root.render(), as the other x-date-picker samples do. They threw when run on their own; the browser strips the mount, so its build is byte-identical. - grid editing-excel-style, date-range-picker slots: give useRef() an initial value, which React 19 requires. - grid localization: type the IgrSelect change handler as the CustomEvent it is, reading the value from the selected item. - grid-lite sort-config-events, sort-config-pipeline: readOnly, not the attribute name readonly. The ratings were read-only already. - grid-lite styling-config-themes: declare its igc-* tags in React.JSX, which React 19 reads instead of the global JSX namespace. - badge dot, icon, overview, tailwind-styling, type; color-picker tailwind-styling: drop size, removed from every component in igniteui-webcomponents 5.0. The badge CSS already sets --ig-size. - color-picker styling: drop placeholder, which it does not have. - button-group custom-toggle: selection="multiple", not selectionMode="multi". The buttons were single-select; they now multi-select, as in the Web Components sample. - chat features: pass createChatMarkdownRenderer() its options object; every option is optional. Screenshots of the 15 samples that render deterministically are pixel-identical before and after. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Five samples exported from igniteui-xplat-examples fail the check; a fix made here is lost at the next export. scripts/lib/skip-type-check.json lists them with their errors until the fix lands there. They stay published: unpublished.json would also drop them from the site and the docs code viewer. Turn off noUncheckedSideEffectImports, as in the TypeScript 5.9 the samples build with: igniteui-react-grids/grids/combined is an untyped side-effect entry, not an error in the two samples that import it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ChronosSF
added a commit
that referenced
this pull request
Oct 22, 2026
Bring in the Astro migration (#1110), the sample type check (#1132) and AGENTS.md (#1133). Conflicts: chip outlined, overview, size and styling. This branch had already rewritten them as function components with new content, so its side is kept, in vnext's style: no JSX.Element return type, which React 19's types no longer declare, no unused React import, and the `getElementById('root')!` mount. The seven new chip samples (area, interaction-state, layout, remove, state, tailwind-styling, types) get what vnext did to every sample: no sandbox.config.json, README.md (tailwind-styling had ReadMe.md) in the current format without the CodeSandbox link, the strict add:sample tsconfig, and package versions from scripts/lib/versions.js. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Adds
npm run check:samples, runs it in CI right afterastro check, and fixes what it found.Why
astro checkdoesn't coversamples/. Most samples' own tsconfigs usemoduleResolution: node, which can't see the types the IG packages publish throughexports, so every IG component types asany. That's how vnext merged two color-picker samples that pass propsIgrColorPickerdoesn't have (placeholder,size).The check
tsconfig.samples.jsontype-checks every published sample in one program. It uses theadd:samplesettings (bundler resolution) withoutstrict, because the generated samples aren't written for strict mode. It takes about 30 s and about 2.7 GB of memory; runningtsc -ponce per sample would take about an hour.noUncheckedSideEffectImports, as in the TypeScript 5.9 the samples build with. TypeScript 6 turns it on, and then rejectsigniteui-react-grids/grids/combined, an untyped side-effect import that is valid.scripts/lib/sample-globals.d.tsrestores the globalJSX.Elementthat@types/react19 removed. 683 generated samples still annotaterender()with it.unpublished.json, as everything else does, and the ones inscripts/lib/skip-type-check.json(below).Fixed: 20 hand-maintained samples
editors/x-date-picker/date-limits,editing,formatrootbeforeroot.render(); they threw when run on their owngrids/grid/editing-excel-style,scheduling/date-range-picker/slotsuseRef(null); React 19 requires an initial valuegrids/grid/localizationIgrSelectchange handler typed as itsCustomEvent, readinge.detail.valuegrids/grid/disabled-summaries,remote-paging-gridgrids/grid-lite/sort-config-events,sort-config-pipelinereadOnly, not the attribute namereadonlygrids/grid-lite/styling-config-themesigc-*tags declared inReact.JSX, which React 19 reads instead of the globalJSXinputs/badge/dot,icon,overview,tailwind-styling,type;inputs/color-picker/tailwind-stylingsize, removed from all components in igniteui-webcomponents 5.0; the badge CSS already sets--ig-sizeinputs/color-picker/stylingplaceholder, which it doesn't haveinputs/button-group/custom-toggleselection="multiple", notselectionMode="multi"(behavior change, below)interactions/chat/featurescreateChatMarkdownRenderer({}); every option is optionalVerified against the previous build:
Skipped: 5 generated samples
These are exported from igniteui-xplat-examples, so a fix made only here is lost at the next export.
skip-type-check.jsonlists each with its error until the fix lands in xplat. They stay published: putting them inunpublished.jsonwould also drop them from the site and the docs code viewer.grids/data-grid/column-resizing: renders<DataGridColumnResizing/>; the component isGridColumnResizinggrids/data-grid/row-selection:root.render()without creatingrootgrids/grid/row-pinning-extra-column:rowListis an array; it has notoArray()maps/geo-map/display-azure-imagery,display-bing-imagery: ref callbacks return a value, which React 19 reads as a cleanup functionVerify
🤖 Generated with Claude Code