Skip to content

Commit

Permalink
Merge branch 'main' into chore/dev-store
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed Dec 20, 2024
2 parents 5d920a8 + 7883c4e commit e34ffcf
Show file tree
Hide file tree
Showing 26 changed files with 658 additions and 534 deletions.
1 change: 0 additions & 1 deletion .github/workflows/compressed-size-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ jobs:
with:
node-version: 20
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- uses: preactjs/compressed-size-action@v2
with:
pattern: './dist/**/*.{js,mjs}'
2 changes: 1 addition & 1 deletion .github/workflows/cr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/ecosystem-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ jobs:
with:
node-version: 22
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- run: pnpm install --frozen-lockfile
- run: pnpm install
- name: Get Short SHA
id: short_sha
run: |
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/lint-and-type.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ jobs:
with:
node-version: 20
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- run: pnpm install --frozen-lockfile
- run: pnpm install
- run: pnpm test:format
- run: pnpm test:types
- run: pnpm test:lint
3 changes: 1 addition & 2 deletions .github/workflows/livecodes-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ jobs:
with:
node-version: 20
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- uses: live-codes/preview-in-livecodes@v1
with:
install-command: pnpm install --frozen-lockfile
install-command: pnpm install
build-command: pnpm build
base-url: 'https://{{LC::REF}}.preview-in-livecodes-demo.pages.dev'
3 changes: 1 addition & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ jobs:
node-version: 20
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- run: pnpm install --frozen-lockfile
- run: pnpm install
- run: pnpm test
- run: pnpm build
- run: npm publish
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/test-multiple-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ jobs:
with:
node-version: 20
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- run: pnpm install --frozen-lockfile
- run: pnpm install
- run: pnpm build
- name: Use React 17 for production test
if: ${{ matrix.env == 'production' }}
run: |
pnpm json -I -f package.json -e "this.pnpm.patchedDependencies={};"
pnpm add -D [email protected] [email protected] @testing-library/[email protected]
- name: Patch for DEV-ONLY
if: ${{ matrix.env == 'development' }}
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/test-multiple-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ jobs:
with:
node-version: 20
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- run: pnpm install --frozen-lockfile
- run: pnpm install
- run: pnpm build # we don't have any other workflows to test build
- run: pnpm test:spec

Expand All @@ -43,12 +42,10 @@ jobs:
with:
node-version: 20
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- run: pnpm install --frozen-lockfile
- run: pnpm install
- name: Install legacy testing-library
if: ${{ startsWith(matrix.react, '16.') || startsWith(matrix.react, '17.') }}
run: |
pnpm json -I -f package.json -e "this.pnpm.patchedDependencies={};"
pnpm add -D @testing-library/[email protected]
- name: Patch for React 16
if: ${{ startsWith(matrix.react, '16.') }}
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/test-old-typescript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ jobs:
with:
node-version: 20
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- run: pnpm install --frozen-lockfile
- run: pnpm install
- run: pnpm build
- name: Patch for all TS
run: |
Expand Down Expand Up @@ -91,7 +90,6 @@ jobs:
- name: Patch testing setup for older TS
if: ${{ matrix.typescript == '4.0.5' || startsWith(matrix.typescript, '3.') }}
run: |
pnpm json -I -f package.json -e "this.pnpm.patchedDependencies={};"
pnpm add -D @testing-library/[email protected] @testing-library/[email protected] @types/[email protected]
rm node_modules/vitest/dist/*.d.ts
echo "declare module 'vitest'" >> ./src/types.d.ts
Expand Down
9 changes: 2 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@
"jsdom": "^25.0.1",
"json": "^11.0.0",
"prettier": "^3.4.2",
"react": "19.0.0",
"react-dom": "19.0.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"rollup": "^4.28.1",
"rollup-plugin-banner2": "^1.3.1",
"rollup-plugin-esbuild": "^6.1.1",
Expand All @@ -182,10 +182,5 @@
"react": {
"optional": true
}
},
"pnpm": {
"patchedDependencies": {
"@testing-library/[email protected]": "patches/@[email protected]"
}
}
}
22 changes: 0 additions & 22 deletions patches/@[email protected]

This file was deleted.

20 changes: 7 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

74 changes: 43 additions & 31 deletions tests/react/abortable.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,17 @@ describe('abortable atom test', () => {
)
}

render(
<StrictMode>
<Suspense fallback="loading">
<Component />
<Controls />
</Suspense>
</StrictMode>,
)
// eslint-disable-next-line testing-library/no-unnecessary-act
await act(async () => {
render(
<StrictMode>
<Suspense fallback="loading">
<Component />
<Controls />
</Suspense>
</StrictMode>,
)
})

await screen.findByText('loading')

Expand Down Expand Up @@ -95,14 +98,17 @@ describe('abortable atom test', () => {
)
}

render(
<StrictMode>
<Suspense fallback="loading">
<Component />
<Controls />
</Suspense>
</StrictMode>,
)
// eslint-disable-next-line testing-library/no-unnecessary-act
await act(async () => {
render(
<StrictMode>
<Suspense fallback="loading">
<Component />
<Controls />
</Suspense>
</StrictMode>,
)
})

await screen.findByText('loading')
resolve.splice(0).forEach((fn) => fn())
Expand Down Expand Up @@ -154,13 +160,16 @@ describe('abortable atom test', () => {
)
}

render(
<StrictMode>
<Suspense fallback="loading">
<Parent />
</Suspense>
</StrictMode>,
)
// eslint-disable-next-line testing-library/no-unnecessary-act
await act(async () => {
render(
<StrictMode>
<Suspense fallback="loading">
<Parent />
</Suspense>
</StrictMode>,
)
})

await screen.findByText('loading')

Expand Down Expand Up @@ -203,14 +212,17 @@ describe('abortable atom test', () => {
)
}

render(
<StrictMode>
<Suspense fallback="loading">
<Component />
<Controls />
</Suspense>
</StrictMode>,
)
// eslint-disable-next-line testing-library/no-unnecessary-act
await act(async () => {
render(
<StrictMode>
<Suspense fallback="loading">
<Component />
<Controls />
</Suspense>
</StrictMode>,
)
})

await screen.findByText('loading')

Expand Down
Loading

0 comments on commit e34ffcf

Please sign in to comment.