Skip to content

Migrate pycon styleguide into the monorepo#4605

Draft
marcoacierno wants to merge 1 commit intomainfrom
migrate-styleguide
Draft

Migrate pycon styleguide into the monorepo#4605
marcoacierno wants to merge 1 commit intomainfrom
migrate-styleguide

Conversation

@marcoacierno
Copy link
Copy Markdown
Member

What

ToDo

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pycon Ready Ready Preview Apr 22, 2026 8:41pm

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Apr 22, 2026

This PR migrates the @python-italia/pycon-styleguide npm package into the monorepo as frontend-styleguide/, adding ~34,500 lines. It is marked as a draft and is not yet wired up to replace the external dependency.


Blocking Issues

No pnpm workspace integration
frontend/package.json still references "@python-italia/pycon-styleguide": "0.1.210" (external npm). Without a pnpm-workspace.yaml at the repo root and a workspace:* reference in frontend/package.json, the migrated code has no effect — the frontend will continue fetching from npm.

JSX attribute errors in ticket/wrapper.tsx
Lines use HTML attribute syntax instead of JSX equivalents (stroke-widthstrokeWidth, fill-opacityfillOpacity, fill-rulefillRule, etc.). With strict mode enabled in tsconfig.json this is a TypeScript compilation failure. There are also thousands of lines of commented-out SVG code in this file that should be cleaned up.

Separate pnpm-lock.yaml not integrated
frontend-styleguide/pnpm-lock.yaml is a standalone lockfile. A pnpm monorepo should use a single root lockfile; the separate file means pnpm install at the root won't install these dependencies and CI pipelines need explicit updates.


Significant Issues

Severely outdated toolchain vs. rest of monorepo

  • Storybook 6.5 (EOL, current is 8.x — has known security vulnerabilities)
  • Rollup 2.79 (current: 4.x; plugin ecosystem is incompatible)
  • Jest 27 / ts-jest 27 (current: 29)
  • TypeScript 4.9.5 vs. ^5.5.4 in frontend/
  • @types/react: "^17.0.80" vs. React 19 in frontend/

This creates a two-tier maintenance burden and may cause type conflicts when the internal package is consumed.

No unit tests
Jest + ts-jest infrastructure exists but zero test files (*.test.tsx) are included. The schedule logic, countdown math, filter state machine, and carousel pagination all have non-trivial branching with no coverage.


Bugs

Countdown component is non-reactive (countdown/countdown.tsx): timeLeftUntil(deadline) is called at render time with no setInterval/useEffect. The displayed time will never update.

DayHeader crashes on empty events (schedule/schedule.tsx): day.events[0].start is accessed without a guard — throws if a day has no scheduled events.

Hardcoded 3-day schedule (schedule/schedule.tsx line ~32080): const days = [program.days[0], program.days[1], program.days[2]] silently drops any day beyond day 3.

countFilters logic bug (filter-bar/filter-bar.tsx): Object.keys(Object.values(...).filter(...)) returns array indices, not a meaningful count. Should be Object.values(appliedFilters).filter((v) => v.length).length.

onReset inverted behavior (filter-bar/filter-bar.tsx): When isDirty=true (user made changes), Reset reverts to previously applied filters instead of clearing. When isDirty=false, it clears everything. The branches are backwards from user expectations.


Performance

O(n²) schedule slot lookup (schedule/schedule.tsx): slots.find(...) runs inside day.events.map(). For large schedules, use a Map keyed by slot key for O(1) lookup.

Intl.DateTimeFormat created on every render (days-selector/days-selector.tsx): Expensive Intl object instantiation should be wrapped in useMemo.


Minor

Biome config inconsistency: frontend-styleguide/biome.json disables rules (useExhaustiveDependencies, noNonNullAssertion, noExplicitAny, noArrayIndexKey, etc.) that the root config does not. The pre-commit hook runs from the repo root and may apply the wrong config to this directory.

Version decision needed: package.json has version: "0.1.210" with prepublishOnly script and main/module/types fields suggesting continued npm publishing. The PR should clarify whether this package will still be published to npm from the monorepo, or consumed only internally via workspace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant