refactor(player-core): drop svelte for a signals-based dom layer, upgrade to TypeScript 7 - #9
Merged
Merged
Conversation
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.
Summary
Four commits:
build: share dependency versions through pnpm catalogs: shared dependencies (TypeScript, React, Tailwind, the Vite/Vitest/size tooling) live in named catalogs inpnpm-workspace.yaml.refactor(player-core): replace svelte with a signals-based dom layer: the player no longer ships or depends on a UI framework.build: upgrade to typescript 7: TypeScript 7 everywhere exceptplayer-vue, which stays on 6.chore(player-core): replace dist import check with a lint rule: the alien-signals import guard moves from a post-build script to a Biome rule.player-core without Svelte
The player is embedded in other people's apps, so it shouldn't make them install or download a framework runtime. The Svelte runtime was about half of the player's weight.
src/dom/: a small DOM layer over alien-signals.h()/svg()create elements, and a function prop or child stays bound to the signals it reads (one effect per binding, nothing re-renders).show()handles conditional views with exit animations,each()keyed lists,mount()scoped disposal, andbatch()grouped writes.src/ui/<Component>/: the seven components as plain functions, each with its CSS in<Component>.styles.ts. Selectors are scoped under.openshowcase-playerand keyframes prefixed withopenshowcase-, and the CSS is injected when the component is created, never at import time.src/core/: unchanged. The public API (new Player({...}).mount(),next(),goTo(),destroy()…) is the same, so the adapters and the extension needed no changes.Build and output
dts-bundle-generator.dist/has one readable, unminified ESM file per module (the host app minifies), declarations fromtsc, and"sideEffects": ["**/*.css"]. Tailwind ships asdist/app.css.dist/dom/signals.js: the published package depends on nothing but the schema. Onlysrc/dom/signals.tsmay import it, and a BiomenoRestrictedImportsrule enforces that: a direct import would stay indist/as an import of a package the published package doesn't declare.size-limitnow measures what a host ships (bundled and minified by esbuild), with a second budget that fails if the player stops tree-shaking away from the tooltip geometry.Player(JS + CSS)svelteHow it was verified
TypeScript 7
catalog:core→typescript7.0.2.tscis the native compiler, and Rslib generates declarations with it (tsgo).player-vuestays on 6 through a newcatalog:vue-tooling, likenest-cliin contapro:vue-tscand the Vue SFC loader load TypeScript's JS API, which 7 removed.player-coreno longer usesdts-bundle-generator, the other API-bound tool.Checks
biome ci, build,check-types,size(all 17 tasks) and every package's tests pass: player-core 140, extension 119, schema 27, exporter 8.No changeset: it will be added later with the other pending changes.