Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
freem
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Openai/695d28c7-94c8-8006-836b-96dbe559b5eb
(section)
Add languages
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Assistant: My suggestions only work if they create enforceable contracts. === My suggestions only work if they create enforceable contracts. The tools (workspace packages, semver, “affected” CI, Storybook/visual tests) are just the mechanics that make a contract real. If they only “reorganize folders” inside the monorepo, nothing is fixed. ==== At minimum, it has to be true that: ==== # There is a defined public API surface * Only exported components/types are allowed for consumers. '' Consumers cannot reach into internal files (components/Button/internal/''). * Styling tokens, CSS variables, DOM structure expectations are either part of the contract or explicitly not. # Breaking changes are detectable and gated * A change that would break consumers requires an explicit “major” bump. * PR checks can fail if someone introduces a breaking change without bumping appropriately. # Consumers can opt in * They don’t automatically get breaking changes “because main changed.” * Upgrading is an explicit dependency bump (even inside a monorepo). # There’s a support/deprecation policy * You can’t keep Button.v1 forever. You need a window: “2 majors supported” or similar. ==== ### ==== Yes — this is the core contract mechanism. It makes upgrades explicit and creates a place to put “this is breaking” vs “this is safe.” Without it, you’ll always have fear-driven QA. ===== Helpful, but it’s not the contract. It just prevents wasting time when changes are localized. If you change a widely-used component, “affected” will still be big, and that’s correct. ===== ===== This is how you validate the contract cheaply. It reduces the need for manual full-product QA for non-breaking changes. But it doesn’t replace versioning. ===== So the real answer is: they need contracts, and the suggested architecture is how you enforce them. ==== If they want the shortest path to “teams stop being afraid”: ==== # Turn <code>components/</code> into a package (@org/ui) with strict exports * Enforce with lint rules like “no deep imports” and TS path restrictions. * Treat anything not exported as private. # Adopt semver releases inside the monorepo * Every component change comes with a patch/minor/major classification. * Consumers update by bumping the package version (can be automated PRs). # Define “what is breaking” Examples that are usually breaking: * removing/renaming props * changing default behavior in a user-visible way * changing DOM in a way tests or CSS selectors rely on * token changes that alter appearance beyond tolerance # Add fast regression at the component boundary * Visual snapshots on every story (PR-gated) * a11y checks * interaction tests for key components # Set a deprecation window * “We support the last 2 majors.” * Old majors get only critical fixes (security/a11y), then get removed on a schedule. ==== If their “shared components” are actually a grab-bag of UI + business rules + feature-specific behavior, contracts will keep failing. In that case, they need to split the library (still in the monorepo) into: ==== * pure primitives (Button, Input, Modal) * composed design-system patterns (FormField, DataTable wrapper) * feature-level components (should live with the feature) That’s also contract work: deciding what’s truly shared. If you want, I can write what a minimal contract doc looks like (“UI library compatibility policy”) plus the CI gates that enforce it.
Summary:
Please note that all contributions to freem are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 (see
Freem:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)