Tech debt
Pinned dependencies
In general we keep dependencies up to date. The following packages, however, need to be pinned to a specific version:
[email protected]
because of this (opens in a new tab) and this (opens in a new tab).[email protected]
because 6.x added a breaking change (opens in a new tab) where all component props that don't start with$
("transient props") are passed down to the underlying components, which in most cases are DOM elements that shouldn't receive random attributes. We can upgrade to 6.x safely after prefixing styled props with$
.
Code improvements
- Enabling
noUncheckedIndexedAccess
in TypeScript would improve the overall quality of all Cosmos packages. Some research is required to learn common ways of handling mapping and reducing arrays, where TypeScript can't infer that a mapped key isn't undefined. I don't want to add unnecessary checks either because it decreases code conciseness.
NPM optionalDependencies
When migrating from Yarn 1.x to NPM latest (opens in a new tab) some platform-specific optional dependencies had to be added here (opens in a new tab) and here (opens in a new tab) in order for GitHub Actions to work across Linux & Windows with the versioned package-lock.json
. This doesn't affect users as those optional dependencies aren't added to any of the published packages. It's just a minor nuisance. The NPM issue is tracked here (opens in a new tab). Vite discussion here (opens in a new tab).