Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"packages": ["/packages/fiber", "/packages/test-renderer", "/packages/eslint-plugin"],
"sandboxes": ["/example"],
"node": "20"
}
59 changes: 29 additions & 30 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,29 @@
"plugin:import/recommended",
"plugin:@react-three/recommended"
],
"plugins": ["@typescript-eslint", "react", "react-hooks", "import", "jest", "prettier", "@react-three"],
"plugins": ["@typescript-eslint", "react", "react-hooks", "import", "vitest", "prettier", "@react-three"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module",
"warnOnUnsupportedTypeScriptVersion": false,
"rules": {
"curly": ["warn", "multi-line", "consistent"],
"no-console": "off",
"no-empty-pattern": "warn",
"no-duplicate-imports": "error",
"import/no-unresolved": "off",
"import/export": "error",
// https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/FAQ.md#eslint-plugin-import
// We recommend you do not use the following import/* rules, as TypeScript provides the same checks as part of standard type checking:
"import/named": "off",
"import/namespace": "off",
"import/default": "off",
"no-unused-vars": ["warn", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }],
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }],
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-explicit-any": "off",
"jest/consistent-test-it": ["error", { "fn": "it", "withinDescribe": "it" }]
}
"sourceType": "module"
},
"rules": {
"curly": ["warn", "multi-line", "consistent"],
"no-console": "off",
"no-empty-pattern": "warn",
"no-duplicate-imports": "error",
"import/no-unresolved": "off",
"import/export": "error",
"no-unused-vars": ["warn", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }],
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }],
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-explicit-any": "off",
"vitest/consistent-test-it": ["error", { "fn": "it", "withinDescribe": "it" }]
},
"settings": {
"react": {
Expand All @@ -67,12 +61,17 @@
"parserOptions": {
"project": "./tsconfig.json"
}
},
{
"files": ["**/tests/**/*.{ts,tsx}", "**/*.test.{ts,tsx}"],
"extends": ["plugin:vitest/recommended"],
"rules": {
"vitest/no-disabled-tests": "warn",
"vitest/no-focused-tests": "error",
"vitest/no-identical-title": "error",
"vitest/prefer-to-have-length": "warn",
"vitest/valid-expect": "error"
}
}
],
"rules": {
"import/no-unresolved": "off",
"import/named": "off",
"import/namespace": "off",
"import/no-named-as-default-member": "off"
}
]
}
48 changes: 20 additions & 28 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,51 +20,43 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9.15.2
run_install: false

- name: Use Node 22
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'

- name: Enable Corepack (for Yarn 4)
run: corepack enable

- name: Cache node_modules and Yarn cache
uses: actions/cache@v4
with:
path: |
**/node_modules
~/.yarn/berry/cache
key: >
${{ runner.os }}-yarn4-node22-react-${{ matrix.react-version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn4-node22-react-${{ matrix.react-version }}-

- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1
with:
install-command: yarn --immutable --silent

- name: Override React version (${{ matrix.react-version }})
- name: Set React version (${{ matrix.react-version }})
run: |
yarn add @types/react@${{ matrix.react-version }} react@${{ matrix.react-version }} @types/react-dom@${{ matrix.react-version }} react-dom@${{ matrix.react-version }} -D
npm pkg set devDependencies.react=${{ matrix.react-version }}
npm pkg set devDependencies.react-dom=${{ matrix.react-version }}

- name: Install deps
run: pnpm install --no-frozen-lockfile

- name: Build
run: yarn run build
run: pnpm run build

- name: Check types
run: yarn run typecheck
run: pnpm run typecheck

- name: Check lint
run: yarn run eslint
run: pnpm run eslint

- name: Jest run
run: yarn run dev && yarn run test
run: pnpm run dev && pnpm run test

- name: Report Fiber size
run: yarn run analyze-fiber
run: pnpm run analyze-fiber

- name: Report Test Renderer size
run: yarn run analyze-test
run: pnpm run analyze-test

- name: Check formatting
run: yarn run format
run: pnpm run format
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ node_modules/
packages/fiber/react-reconciler/
.yarn/
*.gltf
*.mdx
*.mdx
pnpm-lock.yaml
15 changes: 0 additions & 15 deletions .yarnrc.yml

This file was deleted.

51 changes: 25 additions & 26 deletions docs/development/ALPHA-RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ This guide covers how to create and publish alpha releases for the v10 branch to
Before releasing, ensure:

1. You are on the `v10` branch
2. All tests pass: `yarn test`
3. Build succeeds: `yarn build`
4. Bundle verification passes: `yarn verify-bundles`
2. All tests pass: `pnpm test`
3. Build succeeds: `pnpm build`
4. Bundle verification passes: `pnpm verify-bundles`

```bash
# Verify you're on the correct branch
git branch --show-current # Should output: v10

# Run the full CI check
yarn ci
pnpm ci
```

---
Expand All @@ -46,7 +46,7 @@ cat .changeset/pre.json
If the file doesn't exist, enter prerelease mode:

```bash
yarn changeset pre enter alpha
pnpm changeset pre enter alpha
```

This creates `.changeset/pre.json` which tells changesets to version packages as `X.X.X-alpha.X`.
Expand All @@ -56,7 +56,7 @@ This creates `.changeset/pre.json` which tells changesets to version packages as
Describe what changed in this release:

```bash
yarn changeset:add
pnpm changeset:add
```

You'll be prompted to:
Expand All @@ -76,7 +76,7 @@ Added WebGPU support with new entry point @react-three/fiber/webgpu
Apply the changesets to update package versions:

```bash
yarn vers
pnpm vers
```

This will:
Expand Down Expand Up @@ -105,7 +105,7 @@ Before publishing, build and verify what will be published:

```bash
# Build all packages
yarn build
pnpm build

# Dry run to see exactly what will be published (without actually publishing)
cd packages/fiber && npm publish --dry-run --tag alpha
Expand All @@ -130,7 +130,7 @@ cd ../../

```bash
# Publish with alpha tag
yarn changeset publish --tag alpha
pnpm changeset publish --tag alpha
```

Or manually for each package:
Expand Down Expand Up @@ -170,25 +170,25 @@ latest: 9.x.x

```bash
# Enter alpha prerelease mode (first time only)
yarn changeset pre enter alpha
pnpm changeset pre enter alpha

# Add a changeset describing your changes
yarn changeset:add
pnpm changeset:add

# Version packages (applies changesets)
yarn vers
pnpm vers

# Build packages
yarn build
pnpm build

# Dry-run to verify package contents (IMPORTANT!)
cd packages/fiber && npm pack --dry-run

# Publish with alpha tag
yarn changeset publish --tag alpha
pnpm changeset publish --tag alpha

# Exit prerelease mode (when ready for stable v10)
yarn changeset pre exit
pnpm changeset pre exit

# Check npm tags
npm dist-tag ls @react-three/fiber
Expand All @@ -198,13 +198,13 @@ npm dist-tag ls @react-three/fiber

## Safety Checklist Before Publishing

Before running `yarn changeset publish`:
Before running `pnpm changeset publish`:

- [ ] Verified on `v10` branch: `git branch --show-current`
- [ ] Prerelease mode is active: Check `.changeset/pre.json` exists
- [ ] Version looks correct: `grep version packages/fiber/package.json` shows `-alpha.X`
- [ ] Tests pass: `yarn test`
- [ ] Build passes: `yarn build`
- [ ] Tests pass: `pnpm test`
- [ ] Build passes: `pnpm build`
- [ ] **Dry-run verified**: `npm publish --dry-run --tag alpha` shows `dist/` files included (~1 MB package size)
- [ ] Will use `--tag alpha` flag

Expand Down Expand Up @@ -251,28 +251,28 @@ When v10 is ready to become the new stable version:
### 1. Exit Prerelease Mode

```bash
yarn changeset pre exit
pnpm changeset pre exit
```

### 2. Create Final Changeset

```bash
yarn changeset:add
pnpm changeset:add
```

### 3. Version as Stable

```bash
yarn vers
pnpm vers
```

This will produce `10.0.0` (no alpha suffix).

### 4. Publish to Latest

```bash
yarn build
yarn changeset publish # No --tag flag = publishes to latest
pnpm build
pnpm changeset publish # No --tag flag = publishes to latest
```

### 5. Update Branch Strategy
Expand All @@ -290,7 +290,7 @@ After stable v10 release:

You're trying to publish a version that already exists. Either:

- Create a new changeset and run `yarn vers` again
- Create a new changeset and run `pnpm vers` again
- Or increment the prerelease number manually

### Changesets not detecting changes
Expand All @@ -314,7 +314,7 @@ cat .changeset/pre.json
If missing, re-enter prerelease mode:

```bash
yarn changeset pre enter alpha
pnpm changeset pre enter alpha
```

### Dry-run shows package is too small / missing dist/
Expand All @@ -328,7 +328,6 @@ If `npm pack --dry-run` shows ~100-200 KB instead of ~1 MB, the `dist/` folder i
```json
"files": [
"dist",
"types",
"react-reconciler",
"readme.md"
]
Expand Down
Loading
Loading