Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
92b575c
Initial commit
ChrisLaRocque Nov 27, 2024
d78be4b
begin
ChrisLaRocque Nov 28, 2024
ef6973a
Tweaks
ChrisLaRocque Nov 29, 2024
23aeb0d
remove yalc
ChrisLaRocque Nov 29, 2024
eb635a2
Update async-list.tsx
ChrisLaRocque Nov 29, 2024
5dc5ad0
Update async-list.tsx
ChrisLaRocque Nov 29, 2024
e97fecf
update tsconfigs
ChrisLaRocque Nov 29, 2024
10ece12
Type tweaks and naming changes
ChrisLaRocque Nov 30, 2024
46c5d59
i
ChrisLaRocque Nov 30, 2024
2171b2b
feat: add semver config
ChrisLaRocque Nov 30, 2024
6cc04a9
Update README.md
ChrisLaRocque Dec 1, 2024
4b55d67
revert semver
ChrisLaRocque Dec 1, 2024
647bd95
remove built-in studio
ChrisLaRocque Dec 1, 2024
2991ca7
Move plugin to root
ChrisLaRocque Dec 1, 2024
d5aaa98
Update async-list.tsx
ChrisLaRocque Dec 1, 2024
0919d49
feat: add semantic-release workflow
ChrisLaRocque Dec 1, 2024
df9a4ac
fix: updates action
ChrisLaRocque Dec 1, 2024
112d45e
feat: remove dry-run
ChrisLaRocque Dec 1, 2024
e2d68ea
fix: env name
ChrisLaRocque Dec 1, 2024
4959984
fix: tweak workflow
ChrisLaRocque Dec 1, 2024
0b1ae86
fix: deps for semantic-release
ChrisLaRocque Dec 1, 2024
87605b6
fix: remove semantic-release for now
ChrisLaRocque Dec 1, 2024
8dd8899
fix: ui was being bundled
ChrisLaRocque Dec 1, 2024
c177212
fix: bump version and pull deps
ChrisLaRocque Dec 1, 2024
539590a
fix: deps
ChrisLaRocque Dec 2, 2024
04e5cec
chore: bump
ChrisLaRocque Dec 2, 2024
07effa4
chore: bump
ChrisLaRocque Dec 2, 2024
e445900
refactor: replace url+fetchOptions props with loader
ChrisLaRocque Dec 3, 2024
3f80e26
Merge pull request #1 from ChrisLaRocque/SA-82
ChrisLaRocque Dec 3, 2024
ec0d82c
feat: semver workflow
ChrisLaRocque Dec 5, 2024
e821466
Merge pull request #4 from sanity-io/sa-85
ChrisLaRocque Dec 5, 2024
b925b17
fix: make public
ChrisLaRocque Dec 5, 2024
94d050a
feat: swap to yarn
ChrisLaRocque Dec 5, 2024
ca36861
fix: engines
ChrisLaRocque Dec 5, 2024
2edca7f
fix: update action
ChrisLaRocque Dec 5, 2024
c52d630
Merge pull request #5 from sanity-io/sa-109
ChrisLaRocque Dec 5, 2024
be5f805
fix: tweak action
ChrisLaRocque Dec 5, 2024
54007e7
revert: add yarn
ChrisLaRocque Dec 5, 2024
ff3d149
fix: regenerate package-lock.json
ChrisLaRocque Dec 5, 2024
a56051b
fix: resolve peer deps issues
ChrisLaRocque Dec 5, 2024
bacefea
fix: resolutions
ChrisLaRocque Dec 6, 2024
5b63a30
fix: regenerate package-lock
ChrisLaRocque Dec 6, 2024
4c32e55
fix: regenerate
ChrisLaRocque Dec 6, 2024
10a1227
fix: overrides
ChrisLaRocque Dec 6, 2024
aa1c96f
fix: pull dry-run
ChrisLaRocque Dec 6, 2024
a535c4f
chore(release): 1.0.0 [skip ci]
semantic-release-bot Dec 6, 2024
f3d5049
feat: expose secrets (#3)
ChrisLaRocque Dec 6, 2024
a3fd820
chore(release): 1.1.0 [skip ci]
semantic-release-bot Dec 6, 2024
a99e8e5
fix: package.json
ChrisLaRocque Dec 6, 2024
e71d2c0
Merge branch 'main' of https://github.com/sanity-io/sanity-plugin-asy…
ChrisLaRocque Dec 6, 2024
8f62107
chore(release): 1.1.1 [skip ci]
semantic-release-bot Dec 6, 2024
7794480
feat: pass search query back to loader (#6)
ChrisLaRocque Dec 8, 2024
18817a6
chore(release): 1.2.0 [skip ci]
semantic-release-bot Dec 8, 2024
6ff14b0
fix: infinite fetch when used as component (#7)
ChrisLaRocque Dec 13, 2024
8564e46
chore(release): 1.2.1 [skip ci]
semantic-release-bot Dec 13, 2024
1ab559c
chore: update README example (#8)
ChrisLaRocque Dec 13, 2024
3015c15
fix: readonly and docs on schema options (#9)
ChrisLaRocque Dec 13, 2024
a427610
chore(release): 1.2.2 [skip ci]
semantic-release-bot Dec 13, 2024
226331a
feat: expose client to loader (#10)
ChrisLaRocque Dec 13, 2024
d8adf0f
chore(release): 1.3.0 [skip ci]
semantic-release-bot Dec 13, 2024
9c712cd
docs: adds screenshot to readme (#11)
ChrisLaRocque Mar 15, 2025
92e9f8b
fix: add support for react 19 (#13)
ChrisLaRocque Apr 4, 2025
87b958a
chore(release): 1.3.1 [skip ci]
semantic-release-bot Apr 4, 2025
b830f22
docs: update README screenshot (#14)
ChrisLaRocque Jul 5, 2025
2926c2f
fix(deps): allow studio v4 in peer dep ranges
RitaDias Jul 10, 2025
b8003e4
Merge pull request #15 from sanity-io/sapp-2826
RitaDias Jul 10, 2025
8fafe79
chore(release): 1.3.2 [skip ci]
semantic-release-bot Jul 10, 2025
acd969f
Update README.md
RitaDias Jul 11, 2025
d90b92d
fix: allow sanity v5 in peer dep ranges
KJHeartbreaker Dec 24, 2025
bb3fbdb
Merge pull request #18 from sanity-io/fix-sanity-v5
bjoerge Dec 29, 2025
766de08
chore(release): 1.3.3 [skip ci]
semantic-release-bot Dec 29, 2025
8440966
Add 'plugins/@sanity/sanity-plugin-async-list/' from commit '766de08c…
cursoragent Jun 12, 2026
608eda3
chore(@sanity/sanity-plugin-async-list): remove files that will be re…
cursoragent Jun 12, 2026
24b1e90
feat(async-list): port @sanity/sanity-plugin-async-list to the monorepo
cursoragent Jun 12, 2026
2cd6053
fix(test-studio): deduplicate async-list search loader option values
cursoragent Jun 12, 2026
9b0b345
Merge remote-tracking branch 'origin/main' into cursor/migrate-async-…
cursoragent Jun 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .changeset/async-list-transfer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'@sanity/sanity-plugin-async-list': major
---

Port @sanity/sanity-plugin-async-list to the Sanity plugins monorepo

This major release includes several breaking changes as part of the migration to the monorepo:

- **React Compiler enabled**: The package is now built with React Compiler targeting React 19
- **ESM-only**: CommonJS support has been removed. The package now ships only ESM
- **React 19.2+ required**: Minimum React version is now 19.2 (previously ^18 || ^19)
- **react-dom 19.2+ required**: `react-dom` is now a required peer dependency
- **Sanity Studio v5+ required**: Minimum Sanity version is now v5 (Sanity v3 and v4 are no longer supported)
- **Node.js 20.19+ required**: Minimum Node.js version is now 20.19 (previously >=18)
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ Sessions can be compared in the DevTools UI to diff bundle changes between build
| [`@sanity/orderable-document-list`](./plugins/@sanity/orderable-document-list) | Drag-and-drop document ordering without leaving the editing surface |
| [`@sanity/presets`](./plugins/@sanity/presets) | Experimental preset patterns for Sanity Studio |
| [`@sanity/rich-date-input`](./plugins/@sanity/rich-date-input) | Timezone-aware datetime input for Sanity Studio |
| [`@sanity/sanity-plugin-async-list`](./plugins/@sanity/sanity-plugin-async-list) | Autocomplete string input with options loaded from an external API |
| [`@sanity/studio-secrets`](./plugins/@sanity/studio-secrets) | Manage Studio secrets at runtime |
| [`@sanity/vercel-protection-bypass`](./plugins/@sanity/vercel-protection-bypass) | Setup tool for Vercel Deployment Protection in previews |
| [`sanity-plugin-aprimo`](./plugins/sanity-plugin-aprimo) | Aprimo asset selector integration |
Expand Down
1 change: 1 addition & 0 deletions dev/test-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@sanity/orderable-document-list": "workspace:*",
"@sanity/presets": "workspace:*",
"@sanity/rich-date-input": "workspace:*",
"@sanity/sanity-plugin-async-list": "workspace:*",
"@sanity/sfcc": "workspace:*",
"@sanity/studio-secrets": "workspace:*",
"@sanity/ui": "catalog:",
Expand Down
2 changes: 2 additions & 0 deletions dev/test-studio/sanity.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {structureTool} from 'sanity/structure'

import {aprimoExample} from '#aprimo'
import {assistExample} from '#assist'
import {asyncListExample} from '#async-list'
import {bynderExample} from '#bynder'
import {codeInputExample} from '#code-input'
import {colorExample} from '#color'
Expand Down Expand Up @@ -104,6 +105,7 @@ export default defineConfig([
assistExample(),
googleTranslateExample(),
// add new plugins here
asyncListExample(),
orderableDocumentListExample(),
latexInputExample(),
debugLiveSyncTagsExample(),
Expand Down
60 changes: 60 additions & 0 deletions dev/test-studio/src/async-list/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import {asyncList} from '@sanity/sanity-plugin-async-list'
import {definePlugin, defineType} from 'sanity'

const asyncListTest = defineType({
type: 'document',
name: 'asyncListTest',
title: 'Async List',
fields: [
{type: 'string', name: 'title', title: 'Title'},
{type: 'pokemon', name: 'pokemon', title: 'Pokemon (seed loader)'},
{type: 'disneyCharacter', name: 'disneyCharacter', title: 'Disney Character (search loader)'},
],
})

export const asyncListExample = definePlugin(() => ({
name: 'async-list-example',
schema: {types: [asyncListTest]},
plugins: [
// Seed loader: fetches the options once when the field is rendered
asyncList({
schemaType: 'pokemon',
loader: async () => {
const response = await fetch('https://pokeapi.co/api/v2/pokemon?limit=151&offset=0')
const result: {results: {name: string}[]} = await response.json()

return result.results.map((item) => ({value: item.name}))
},
autocompleteProps: {
placeholder: 'Search Pokemon',
},
}),
// Search loader: re-runs the loader with the user's query as they type
asyncList({
schemaType: 'disneyCharacter',
loaderType: 'search',
loader: async ({query}) => {
const url = query
? `https://api.disneyapi.dev/character?name=${encodeURIComponent(query)}`
: 'https://api.disneyapi.dev/character'

const response = await fetch(url)
const result: {data: {name: string}[] | {name: string} | null} = await response.json()
const characters = Array.isArray(result.data)
? result.data
: result.data
? [result.data]
: []

// The API can return multiple characters with the same name, but
// option values must be unique
const names = new Set<string>()
return characters.flatMap((item) => {
if (names.has(item.name)) return []
names.add(item.name)
return [{value: item.name}]
})
},
}),
],
}))
9 changes: 9 additions & 0 deletions knip.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,15 @@
],
},
// add new plugin workspaces here
"plugins/@sanity/sanity-plugin-async-list": {
"entry": ["package.config.ts"],
"project": ["src/**/*.{ts,tsx}"],
"ignoreDependencies": [
// Used by @sanity/pkg-utils babel transform, not directly imported
"babel-plugin-styled-components",
],
},

"plugins/sanity-plugin-documents-pane": {
"entry": ["package.config.ts"],
"project": ["src/**/*.{ts,tsx}"],
Expand Down
91 changes: 91 additions & 0 deletions plugins/@sanity/sanity-plugin-async-list/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# @sanity/sanity-plugin-async-list

## [1.3.3](https://github.com/sanity-io/sanity-plugin-async-list/compare/v1.3.2...v1.3.3) (2025-12-29)

### Bug Fixes

- allow sanity v5 in peer dep ranges ([d90b92d](https://github.com/sanity-io/sanity-plugin-async-list/commit/d90b92d60715012a95c13702dedcbb9ec7ba8400))

## [1.3.2](https://github.com/sanity-io/sanity-plugin-async-list/compare/v1.3.1...v1.3.2) (2025-07-10)

### Bug Fixes

- **deps:** allow studio v4 in peer dep ranges ([2926c2f](https://github.com/sanity-io/sanity-plugin-async-list/commit/2926c2f53c256aea7f6c6e53b6fe3667a5735d6c))

## [1.3.1](https://github.com/sanity-io/sanity-plugin-async-list/compare/v1.3.0...v1.3.1) (2025-04-04)

### Bug Fixes

- add support for react 19 ([#13](https://github.com/sanity-io/sanity-plugin-async-list/issues/13)) ([92e9f8b](https://github.com/sanity-io/sanity-plugin-async-list/commit/92e9f8b75000435acfb5f9b6c713a74f2eb7cd18))

## [1.3.0](https://github.com/sanity-io/sanity-plugin-async-list/compare/v1.2.2...v1.3.0) (2024-12-13)

### Features

- expose client to loader ([#10](https://github.com/sanity-io/sanity-plugin-async-list/issues/10)) ([226331a](https://github.com/sanity-io/sanity-plugin-async-list/commit/226331a63b77bb06a5c2011f30e0ea2b087da316))

## [1.2.2](https://github.com/sanity-io/sanity-plugin-async-list/compare/v1.2.1...v1.2.2) (2024-12-13)

### Bug Fixes

- readonly and docs on schema options ([#9](https://github.com/sanity-io/sanity-plugin-async-list/issues/9)) ([3015c15](https://github.com/sanity-io/sanity-plugin-async-list/commit/3015c150184add8e82906dc15a60cbf452c7a61f))

## [1.2.1](https://github.com/sanity-io/sanity-plugin-async-list/compare/v1.2.0...v1.2.1) (2024-12-13)

### Bug Fixes

- infinite fetch when used as component ([#7](https://github.com/sanity-io/sanity-plugin-async-list/issues/7)) ([6ff14b0](https://github.com/sanity-io/sanity-plugin-async-list/commit/6ff14b020534a1d46fc35ac67e91d0a9ef3bd820))

## [1.2.0](https://github.com/sanity-io/sanity-plugin-async-list/compare/v1.1.1...v1.2.0) (2024-12-08)

### Features

- pass search query back to loader ([#6](https://github.com/sanity-io/sanity-plugin-async-list/issues/6)) ([7794480](https://github.com/sanity-io/sanity-plugin-async-list/commit/7794480f41a4040bddaab359071cd9769bb13ec9))

## [1.1.1](https://github.com/sanity-io/sanity-plugin-async-list/compare/v1.1.0...v1.1.1) (2024-12-06)

### Bug Fixes

- package.json ([a99e8e5](https://github.com/sanity-io/sanity-plugin-async-list/commit/a99e8e5093ac2ec21d0ac74b9b0489a4f95a5213))

## [1.1.0](https://github.com/sanity-io/sanity-plugin-async-list/compare/v1.0.0...v1.1.0) (2024-12-06)

### Features

- expose secrets ([#3](https://github.com/sanity-io/sanity-plugin-async-list/issues/3)) ([f3d5049](https://github.com/sanity-io/sanity-plugin-async-list/commit/f3d50498b9f8992783cb6fd2cb6f4973b4e95b6f))

## 1.0.0 (2024-12-06)

### Features

- add semantic-release workflow ([0919d49](https://github.com/sanity-io/sanity-plugin-async-list/commit/0919d49a8d75162c057eac05d4830742d11682fc))
- add semver config ([2171b2b](https://github.com/sanity-io/sanity-plugin-async-list/commit/2171b2bd41d95f2accaf99e9bc19503a689d1e9f))
- remove dry-run ([112d45e](https://github.com/sanity-io/sanity-plugin-async-list/commit/112d45e9f87443418adbb6337a5ee64cb3bf7572))
- semver workflow ([ec0d82c](https://github.com/sanity-io/sanity-plugin-async-list/commit/ec0d82c27624a9ba8da0723f78f207d4b40de586))
- swap to yarn ([94d050a](https://github.com/sanity-io/sanity-plugin-async-list/commit/94d050aa30aaae8b8a7f05d8548e2fb72faa7507))

### Bug Fixes

- bump version and pull deps ([c177212](https://github.com/sanity-io/sanity-plugin-async-list/commit/c17721269fe3fcd9e85e148220c4e06907ca7754))
- deps ([539590a](https://github.com/sanity-io/sanity-plugin-async-list/commit/539590abfddc5721585aa81d43be3e911430fed5))
- deps for semantic-release ([0b1ae86](https://github.com/sanity-io/sanity-plugin-async-list/commit/0b1ae86705659641101518b56ed3b6d3aa6d9a97))
- engines ([ca36861](https://github.com/sanity-io/sanity-plugin-async-list/commit/ca36861a0279dd7ef0132d0858444f33107a74fe))
- env name ([e2d68ea](https://github.com/sanity-io/sanity-plugin-async-list/commit/e2d68ea72344f28cbc7e5bd0197f7917ae8920e2))
- make public ([b925b17](https://github.com/sanity-io/sanity-plugin-async-list/commit/b925b172029398044fa2ebea05d4a13d17d1f0e3))
- overrides ([10a1227](https://github.com/sanity-io/sanity-plugin-async-list/commit/10a12277d181f41a76982d521730e3a0b6367784))
- pull dry-run ([aa1c96f](https://github.com/sanity-io/sanity-plugin-async-list/commit/aa1c96f3fe16af1311f184e5483d556339dd2b1a))
- regenerate ([4c32e55](https://github.com/sanity-io/sanity-plugin-async-list/commit/4c32e553c93a35d002abd2f4c0dcccd12aff45b9))
- regenerate package-lock ([5b63a30](https://github.com/sanity-io/sanity-plugin-async-list/commit/5b63a3088b517318accb87a3c7ecf4042f2452c7))
- regenerate package-lock.json ([ff3d149](https://github.com/sanity-io/sanity-plugin-async-list/commit/ff3d1491a2dac7c032ac3f1568939b9080c1361e))
- remove semantic-release for now ([87605b6](https://github.com/sanity-io/sanity-plugin-async-list/commit/87605b63ca75dfa0d7e6a50291b097c6ee187d9c))
- resolutions ([bacefea](https://github.com/sanity-io/sanity-plugin-async-list/commit/bacefea1986d3db9e9b57885036753e0ae84793d))
- resolve peer deps issues ([a56051b](https://github.com/sanity-io/sanity-plugin-async-list/commit/a56051b7e94bf57b1f527b51d4b70845102e9e03))
- tweak action ([be5f805](https://github.com/sanity-io/sanity-plugin-async-list/commit/be5f805cfbdd687bbd8177ca76024fbf887010ab))
- tweak workflow ([4959984](https://github.com/sanity-io/sanity-plugin-async-list/commit/4959984dda49fe85581ef4c2a0bc7c14204fd6dc))
- ui was being bundled ([8dd8899](https://github.com/sanity-io/sanity-plugin-async-list/commit/8dd889936d6750c85af2a824507b9dada2e045bb))
- update action ([2edca7f](https://github.com/sanity-io/sanity-plugin-async-list/commit/2edca7fe28629e2e6bb9db0ad8ef2333018dfbdd))
- updates action ([df9a4ac](https://github.com/sanity-io/sanity-plugin-async-list/commit/df9a4ac5b22330a3043cfdbe6ad0ca1c1a443926))

### Reverts

- add yarn ([54007e7](https://github.com/sanity-io/sanity-plugin-async-list/commit/54007e710f1c9515bd1fd39b4220dcfe53d52c42))
Loading
Loading