Repository navigation
Conversation
The filter cluster was the only feature that forced a build-tool entry (@flux-ui/components/vite) into the core package. It now lives in its own package, which ships defineFilterMacro at @flux-ui/filter/vite. - Components, primitives, composables, util, injection key, styles and the Vite macro move to packages/filter. - VNodeRenderer and createLabelForDateRange move to @flux-ui/internals so both packages can reach them. - The filter dictionary keeps the existing flux.* key names, so existing translations still apply. - Drop the dead FluxFilterBase / FluxFilterItem / Flux*Entry types. - Docs get their own Filter section; the v4 upgrade guide covers the move. BREAKING CHANGE: the filter components, defineFilter, pickFilterCommon, useFilterInjection, isFluxFilterOption* and their types are imported from @flux-ui/filter; defineFilterMacro from @flux-ui/filter/vite. Closes #39
Adding the filter workspace made bun prune the orphaned pinia@3 lockfile entry the docs build silently relied on.
The filter badge and bar button override a component class at the same specificity; as separate stylesheets the components one has to load first. Also documents VNodeRenderer and createLabelForDateRange in internals and lists @flux-ui/filter as a sibling package.
Owner
Author
|
@coderabbitai review |
|
…nternals One dictionary per package under internals/src/data/i18n, merged into one english with a single useTranslate and FluxTranslate over every key. The filter bar reuses flux.filter from the components file instead of carrying a copy, and a defineFilter factory can translate any Flux key again. BREAKING CHANGE: FluxTranslate and FluxTranslation are no longer exported from @flux-ui/components; import them from @flux-ui/internals.
Also names the filter remove string on the filter translations page and limits the upgrade note on per-package translate exports to what shipped.
Owner
Author
|
@coderabbitai review |
|
Owner
Author
|
@coderabbitai review |
|
This branch has not been deployed
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.
This PR resolves #39. The filter components move out of
@flux-ui/componentsinto a new package,@flux-ui/filter.The reason is the Vite plugin.
defineFilter()is a compile-time macro, and its plugin forced a second build entry,@flux-ui/components/vite, into the core package. That entry now ships as@flux-ui/filter/vite, and the core package has one entry again.What moved
FluxFilter*components plusFluxFilterBaseandFluxFilterWindow, the fourFilter*primitives, three private composables,useFilterInjection,defineFilterand the other filter helpers, the injection key,Filter.module.scssanddefineFilterMacro.@flux-ui/componentsthrough its public barrel, the wayaidoes. Two internals they needed were private to components.VNodeRendererandcreateLabelForDateRangenow live in@flux-ui/internals.VNodeRendererbecame a functional component because tsdown's isolated declarations want an explicit type.createLabelForDateRangetakes the multi-year label as a string instead of a translate function, so internals doesn't need to know a dictionary key.@flux-ui/types, like the statistics types. I dropped the seven dead ones the issue lists (FluxFilterBase,FluxFilterItemand the fiveFlux*Entrytypes), and their section intypes.mdwith them.Translations
All dictionaries now live in
@flux-ui/internals, one file per package undersrc/data/i18n/, merged into oneenglish. Internals exports a singleuseTranslateand theFluxTranslateandFluxTranslationtypes over every key. The per-packageuseTranslatewrappers are gone.That has two effects on the filters. The filter bar reuses
flux.filterandflux.filterResetfrom the components file instead of carrying copies. And adefineFilterfactory can translate any Flux key,flux.cancelincluded.The filter keys keep their
flux.*names instead of moving toflux.filter.*. There are two reasons. Existing translations keep working, andflux.filter.*would collide with theflux.filterleaf thatFluxActionBaruses in a nested messages file.The cost is that every app ships all 164 strings, about 2.2 KB gzipped, including those of packages it does not install.
Docs and tooling
/filter/with an intro, installation, translations, the component pages,useFilterInjectionand a helpers page. The examples moved todocs/code/filter/.upgrading-v4.mdhas a new section with the import changes. I also corrected the translation key count and rewrote the section on the translate composable, since it now lives in internals.build.sh,transform-dts.mjs,generate-translations.tsandCLAUDE.mdall know about the new package.Checked
transform-dts.mjsand the docs build. No type errors in thevue-tscor dts output.check-contrast.ts,check-palette-refs.tsandgenerate-translations.ts --checkpass.bun install --frozen-lockfilepasses. Adding the workspace made bun prunepinia@3.0.4, an orphaned lockfile entry the docs build relied on without declaring it: the bundle of@basmilius/commonimports pinia. The first CI run failed on exactly that. Docs now declarespinia@^4as a dev dependency, the range@basmilius/commonasks for.The review subagent found one regression, and it is fixed. Two filter styles, the badge and the bar button, override a component class at the same specificity. On
mainthey won by sitting later in the same bundle. As separate stylesheets the import order decides. I tried raising their specificity, but that ties them with.secondary-button:active,.is-activeand.badge:is(a, button):hover, which win today, so the hover and active states would depend on order instead. The installation page and the upgrade guide now say to import@flux-ui/filter/style.cssafter the components stylesheet. The ai, flow and application install pages list the sibling stylesheet first. If one of those overrides a component class, it has the same latent problem. I did not check that here.I did not click through the filter examples in a browser. The docs prerender without errors, but that is all I verified.
Breaking for consumers
@flux-ui/filter, anddefineFilterMacroto@flux-ui/filter/vite.FluxTranslateandFluxTranslationmove from@flux-ui/componentsto@flux-ui/internals.@flux-ui/types.The upgrade guide covers all three.