Port @sanity/language-filter v4.1.0 to monorepo with git subtree#586
Port @sanity/language-filter v4.1.0 to monorepo with git subtree#586
Conversation
Upgraded with "npx @sanity/plugin-kit inject --preset semver-workflow --preset renovatebot"
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR ports the @sanity/language-filter plugin from its standalone repository to the Sanity plugins monorepo using git subtree, preserving the complete git history. The migration updates the plugin to v4.1.0, which adds a new parentValue parameter to the filterField function, enabling more advanced filtering based on the parent object's current value.
Changes:
- Ported plugin to monorepo with monorepo-compatible configurations (package.json, tsconfig, vitest, package.config.ts)
- Replaced deprecated hooks and modernized code (useClickOutside → useClickOutsideEvent, removed styled-components)
- Added v4.1.0 feature:
parentValueparameter tofilterFieldfunction signature - Converted tests from Jest to Vitest and added package exports validation
Reviewed changes
Copilot reviewed 23 out of 24 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-workspace.yaml | Added @sanity/util to catalog at ^5.8.1 |
| pnpm-lock.yaml | Updated lockfile with new plugin dependencies and workspace references |
| plugins/@sanity/language-filter/package.json | Configured as monorepo plugin with catalog dependencies |
| plugins/@sanity/language-filter/src/*.ts(x) | Plugin source code with modernized hooks and new parentValue support |
| plugins/@sanity/language-filter/tsconfig*.json | TypeScript configurations with isolatedDeclarations disabled |
| plugins/@sanity/language-filter/vitest.config.ts | Vitest test configuration for jsdom environment |
| plugins/@sanity/language-filter/package.config.ts | React Compiler configuration targeting React 19 |
| plugins/@sanity/language-filter/README.md | Updated documentation with parentValue parameter |
| plugins/@sanity/language-filter/CHANGELOG.md | Historical changelog from git subtree |
| plugins/@sanity/language-filter/LICENSE | MIT license with 2026 copyright |
| dev/test-studio/package.json | Updated to use workspace:* for language-filter |
| .changeset/language-filter-monorepo-port.md | Changeset documenting major breaking changes |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot add a changeset for the array internationalization update |
Co-authored-by: pedrobonamin <46196328+pedrobonamin@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 27 changed files in this pull request and generated 3 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: pedrobonamin <46196328+pedrobonamin@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 25 out of 26 changed files in this pull request and generated no new comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Migrate @sanity/language-filter to monorepo
Migration complete! The @sanity/language-filter plugin has been successfully ported to the monorepo with full git history preserved via git subtree.
Key Changes
Dependencies:
styled-componentsandbabel-plugin-styled-components- replaced styled component with inline styles@sanity/uiand@sanity/utilto use catalog versions@sanity/utilto the monorepo catalog at version ^5.8.1workspace:*for @sanity/language-filter dependencyNew Features (v4.1.0):
parentValueparameter tofilterFieldfunction, allowing more advanced filtering based on the parent object's current valuefilterFieldfunction now receives four parameters:enclosingType,field,selectedLanguageIds, andparentValueCode Modernization:
useClickOutsidehook withuseClickOutsideEventlanguageSubscription.tsmodule (state management now uses React Context)Companion Changes:
sanity-plugin-internationalized-arrayto support new language-filter v4.1.0 API@sanity/language-filterfrom dependencies to devDependencies/peerDependencies in internationalized-arrayTesting:
parentValueparameterBreaking Changes:
filterFieldfunction signature changed: now accepts fourth parameterparentValue(type:Record<string, unknown> | undefined)languageSubscription.tsmodule and its exports (createSelectedLanguageIdsBus,SelectedLanguageIdsBus,LanguageSubscription,Unsubscribe,LanguageSubscribe) have been removed in favor of React Context✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.