fix(emcn): Calendar icon collision + prism side-effect registration#5261
Conversation
…rve prism side effects Two post-extraction regressions: 1. The barrel resolves the Calendar name-collision to the date-picker COMPONENT (symmetric with Table). Scheduled-tasks imported Calendar from the barrel but used it as an ICON, so its header rendered a date picker. Route the icon consumers (scheduled-tasks + loading) to @sim/emcn/icons, matching the 'icons come from the /icons subpath' convention. 2. The package's new sideEffects: ['**/*.css'] marked code/prism.ts as side-effect-free, but it registers prismjs languages on the global Prism (a real JS side effect). The bundler could drop/reorder its core init, causing 'Prism is not defined'. Add code/prism.ts to sideEffects so the bundler preserves it.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryLow Risk Overview Scheduled Tasks header imported
Reviewed by Cursor Bugbot for commit 9417da2. Configure here. |
Greptile SummaryThis PR fixes two regressions from the EMCN extraction. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (1): Last reviewed commit: "fix(emcn): resolve Calendar icon/compone..." | Re-trigger Greptile |
Summary
Two regressions surfaced after the
@sim/emcnextraction (#5257):Calendarname-collision to the date-picker component (symmetric withTable). Scheduled-tasks importedCalendarfrom the barrel but used it as an icon, so it rendered the picker. Routed the icon consumers (scheduled-tasks.tsx,loading.tsx) to@sim/emcn/icons, matching the "icons come from the/iconssubpath" convention. Added a barrel note so the component re-export isn't re-introduced.Prism is not definedon page load. The package's newsideEffects: ["**/*.css"]markedcode/prism.tsas side-effect-free, but it registers prismjs languages on the globalPrism(a real JS side effect). The bundler could drop/reorder its core init. Addedcode/prism.tstosideEffects.Type of Change
Testing
apps/simtypecheck clean (0 errors); a comprehensive sweep confirms no remaining collision-named icon (Calendar/Table) is imported from the barrel as an icon. High confidence.sideEffectsfix: config-correct (prism.tsgenuinely has JS side effects), but it's a bundler-level change that typecheck/static analysis cannot confirm — needs a runtime check on a real build to verifyPrism is not definedis gone.Not in scope (verified NOT emcn-caused)
<path> dSVG warnings live inapps/sim/components/icons.tsx(block icons), which the emcn move never touched — pre-existing onmain.Checklist