You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace Apollo Wind's shared cn implementation with cnfast.
Remove Apollo Wind's direct runtime dependency on clsx and tailwind-merge.
Keep the final diff focused on the production migration; the temporary benchmark harness was removed before this PR.
Benchmarking
Benchmarks were run locally before removing the harness from the final diff.
Command:
pnpm --filter @uipath/apollo-wind bench:cn
Benchmark corpus:
packages/apollo-wind/src: 155 files
packages/apollo-react/src/canvas: 387 files
Apollo React perf stories: CanvasPerformance.stories.tsx, Flow.stories.tsx
Total source profiles: 544 files
Harvested class strings: 2,934
Parity: 0 mismatches across 17,241 generated Apollo cases
Workload
Cases/pass
Old twMerge(clsx) time/pass
cnfast time/pass
Speedup
Saved/pass
Apollo cn() call-site replay
707
3.53 ms
0.06 ms
54.73x
3.47 ms
Apollo class corpus/cache pressure
2,934
44.99 ms
15.03 ms
2.99x
29.96 ms
Consumer override matrix
1,600
25.97 ms
6.77 ms
3.83x
19.20 ms
Live grid frame stress
12,000
252.24 ms
75.85 ms
3.33x
176.38 ms
Notes:
The call-site replay is the closest profile to real Apollo code shape: it materializes actual cn(...) calls from Apollo Wind and Apollo React canvas sources, including the existing perf stories.
The class corpus/cache-pressure profile stresses broad Tailwind conflict resolution across harvested Apollo class strings plus arbitrary values and consumer overrides.
The consumer override matrix models Apollo base component classes merged with likely downstream className overrides.
These numbers isolate class merging cost only. They do not include React reconciliation, layout, paint, browser scheduling, or FPS.
Supply-chain and compatibility checks
cnfast is pinned to exact version 0.0.8 in packages/apollo-wind/package.json and pnpm-lock.yaml.
The package has no runtime dependencies and no install-time lifecycle scripts in its published package.json.
It does expose a CLI binary via bin, but Apollo Wind imports only the package entrypoint. The binary is not executed by this change.
cnfast publishes conditional exports for both ESM and CJS:
import -> dist/index.mjs
require -> dist/index.cjs
Apollo Wind build output was checked:
ESM output imports cnfast.
CJS output requires cnfast.
Generated declarations keep a local Apollo Wind cn(...inputs): string wrapper signature.
Local smoke checks passed for both module modes:
require('cnfast').cn('px-2', 'px-4') === 'px-4'
import { cn } from 'cnfast'; cn('px-2', 'px-4') === 'px-4'
Automated PR supply-chain/security checks passed on GitHub, including dependency review, production dependency audit, package signature audit, license check, Socket Security, and CodeQL. If a separate manual third-party approval is required, this PR should remain draft until that approval is complete.
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR updates @uipath/apollo-wind’s cn (class merging) utility to use cnfast, aiming to improve class merge performance while removing the previous clsx + tailwind-merge implementation.
Changes:
Replace local cn implementation with cnfast.
Remove clsx and tailwind-merge from packages/apollo-wind dependencies; add cnfast@0.0.8.
Update pnpm-lock.yaml to reflect the dependency swap.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
File
Description
pnpm-lock.yaml
Removes clsx/tailwind-merge from the apollo-wind importer and adds cnfast@0.0.8 snapshot/package entry.
packages/apollo-wind/src/lib/utils.ts
Switches cn export to come from cnfast rather than a local implementation.
packages/apollo-wind/package.json
Updates runtime dependencies: adds cnfast, removes clsx and tailwind-merge.
Per-package coverage and bundle size on this PR. New-line coverage = of the source lines this PR adds or changes, the % hit by tests.
Package
Coverage
New-line coverage
Packed (gzip)
Unpacked
vs main
@uipath/apollo-core
9.0%
—
43.82 MB
57.31 MB
±0
@uipath/apollo-react
34.5%
—
7.27 MB
27.60 MB
±0
@uipath/apollo-wind
40.3%
100.0% (1/1)
394.9 KB
2.57 MB
−51 B
@uipath/ap-chat
85.8%
—
43.41 MB
55.85 MB
±0
"Coverage" is each package's own coverage.include scope (e.g. apollo-core instruments only scripts/). "Packed"/"Unpacked" come from npm pack --dry-run and only cover built packages — "—" means not measured this run (package not affected / not built). "vs main" is the packed (gzipped) delta against the last successful main build (the package-sizes artifact from the Release workflow); "—" there means no main baseline was available this run. The baseline is main's latest build, not this PR's exact merge-base, so it includes any drift since the branch diverged. Packages with no vitest config are omitted.
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
Files not reviewed (1)
pnpm-lock.yaml: Generated file
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
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.
Summary
cnimplementation withcnfast.clsxandtailwind-merge.Benchmarking
Benchmarks were run locally before removing the harness from the final diff.
Command:
Benchmark corpus:
packages/apollo-wind/src: 155 filespackages/apollo-react/src/canvas: 387 filesCanvasPerformance.stories.tsx,Flow.stories.tsxtwMerge(clsx)time/passcnfasttime/passcn()call-site replayNotes:
cn(...)calls from Apollo Wind and Apollo React canvas sources, including the existing perf stories.classNameoverrides.Supply-chain and compatibility checks
cnfastis pinned to exact version0.0.8inpackages/apollo-wind/package.jsonandpnpm-lock.yaml.dependenciesand no install-time lifecycle scripts in its publishedpackage.json.bin, but Apollo Wind imports only the package entrypoint. The binary is not executed by this change.cnfastpublishes conditional exports for both ESM and CJS:import->dist/index.mjsrequire->dist/index.cjscnfast.cnfast.cn(...inputs): stringwrapper signature.require('cnfast').cn('px-2', 'px-4') === 'px-4'import { cn } from 'cnfast'; cn('px-2', 'px-4') === 'px-4'Validation
pnpm --filter @uipath/apollo-wind exec biome lint src/lib/utils.ts package.jsonpnpm --filter @uipath/apollo-wind test -- src/lib/utils.test.tspnpm --filter @uipath/apollo-wind build