-
Notifications
You must be signed in to change notification settings - Fork 51
Version 5 re-preparation #491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
454249f
c79d830
d741337
addd198
0ca4074
08e20c6
80c196f
2d6d917
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,4 +31,5 @@ jobs: | |
| - uses: JS-DevTools/npm-publish@v3 | ||
| with: | ||
| access: "public" | ||
| tag: "next" | ||
| token: ${{ secrets.NPM_TOKEN }} | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| // @ts-expect-error The react team don't expose types for the eslint plugin currently | ||
| import * as reactCompiler from "eslint-plugin-react-compiler"; | ||
| import * as tseslint from "typescript-eslint"; | ||
| import { includeIgnoreFile } from "@eslint/compat"; | ||
| import eslint from "@eslint/js"; | ||
| import { resolve } from "node:path"; | ||
| import { dirname } from "path"; | ||
| import { type ConfigArray } from "typescript-eslint"; | ||
|
|
||
| const configDirectory: string = dirname(import.meta.dirname); | ||
| const rootDirectory: string = dirname(configDirectory); | ||
| const gitignore: string = resolve(rootDirectory, ".gitignore"); | ||
|
|
||
| const config: ConfigArray = tseslint.config( | ||
| eslint.configs.recommended, | ||
| tseslint.configs.strict, | ||
| tseslint.configs.stylistic, | ||
| includeIgnoreFile(gitignore), | ||
| { | ||
| ...reactCompiler.configs.recommended, | ||
| languageOptions: { | ||
| parserOptions: { | ||
| project: true, | ||
| tsconfigRootDir: rootDirectory | ||
| } | ||
| } | ||
| } | ||
| ); | ||
|
|
||
| export default config; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,23 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "target": "ESNext", | ||
| "composite": true, | ||
| "useDefineForClassFields": true, | ||
| "types": ["vite/client"], | ||
| "lib": ["DOM", "DOM.Iterable", "ESNext"], | ||
| "allowJs": false, | ||
| "allowJs": true, | ||
| "skipLibCheck": true, | ||
| "esModuleInterop": false, | ||
| "allowSyntheticDefaultImports": true, | ||
| "strict": true, | ||
| "forceConsistentCasingInFileNames": true, | ||
| "module": "ESNext", | ||
| "moduleResolution": "bundler", | ||
| "moduleResolution": "node", | ||
| "resolveJsonModule": true, | ||
| "isolatedModules": true, | ||
| "noEmit": false, | ||
| "jsx": "react-jsx", | ||
| "noImplicitAny": true | ||
| }, | ||
| "include": ["../../"], | ||
| "include": ["../../config", "../../src", "../../tests", "../../demo"], | ||
| "references": [{ "path": "./tsconfig.node.json" }] | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |||||
| "compilerOptions": { | ||||||
| "composite": true, | ||||||
| "module": "ESNext", | ||||||
| "moduleResolution": "bundler", | ||||||
| "moduleResolution": "node", | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to check on my end if this has any effect. If not, it's definitely a worthy change considering 'node' is deprecated. Could be a separate ticket though. |
||||||
| "allowSyntheticDefaultImports": true | ||||||
| }, | ||||||
| "include": ["../vite/vite.component.config.ts"] | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| { | ||
| "name": "@p5-wrapper/react", | ||
| "description": "A wrapper component that allows you to utilise P5 sketches within React apps.", | ||
| "version": "5.0.0-rc.1", | ||
| "version": "5.0.0-rc.2", | ||
| "type": "module", | ||
| "homepage": "https://github.com/P5-wrapper/react", | ||
| "license": "MIT", | ||
|
|
@@ -20,17 +20,17 @@ | |
| }, | ||
| "scripts": { | ||
| "build": "rimraf dist && pnpm build:component && pnpm build:demo", | ||
| "build:component": "tsc --declaration --noEmit && vite build --config config/vite/vite.component.config.ts", | ||
| "build:component": "tsc --noEmit && vite build --config config/vite/vite.component.config.ts", | ||
| "build:demo": "vite build --config config/vite/vite.demo.config.ts", | ||
| "ci": "pnpm format:check && pnpm lint && pnpm test && pnpm build", | ||
| "dev": "vite --config config/vite/vite.demo.config.ts --host", | ||
| "format": "pnpm prettier --write .", | ||
| "format:check": "pnpm prettier --check .", | ||
| "lint": "eslint --ignore-pattern dist --config config/eslint/eslint.config.js .", | ||
| "lint": "eslint --config config/eslint/eslint.config.ts", | ||
| "lint:fix": "pnpm lint --fix", | ||
| "prettier": "prettier --config config/prettier/prettier.json --ignore-path .gitignore", | ||
| "test": "vitest run --config config/vite/vite.component.config.ts", | ||
| "test:coverage": "vitest run --coverage --config config/vite/vite.component.config.ts", | ||
| "test": "vitest run --silent --config config/vite/vite.component.config.ts", | ||
| "test:coverage": "vitest run --silent --coverage --config config/vite/vite.component.config.ts", | ||
| "test:watch": "vitest watch --config config/vite/vite.component.config.ts" | ||
| }, | ||
| "keywords": [ | ||
|
|
@@ -77,43 +77,48 @@ | |
| "bugs": { | ||
| "url": "https://github.com/P5-wrapper/react/issues" | ||
| }, | ||
| "dependencies": { | ||
| "microdiff": "^1.5.0", | ||
| "react-error-boundary": "^5.0.0" | ||
| }, | ||
| "peerDependencies": { | ||
| "p5": ">= 1.4.1", | ||
| "react": ">= 18.2.0", | ||
| "react-dom": ">= 18.2.0" | ||
| "p5": ">= 1.11.3", | ||
| "react": ">= 19.0.0", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will complain (albeit not critically) if the consumer doesn't have Is that intended? Ideally, the library should probably support the earliest possible version of React.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe the 5th version should be available for users on both React 18 and 19 to provide a lighter wrapper. This is the primary difference from version 4. Otherwise, it won't be accessible until the app is updated to React 19, which could be a blocker due to breaking changes.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe but if we use 18 and 19 we could cause issues for the people on 19 since theres some deprecations in that version and also we use the react compiler in the vite setup now also. I don't know if we can reasonably guarantee full support for users of both 18 and 19, at least not 100% compatability can be guaranteed, thin or not. Does that make sense what I am trying to say?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That makes sense, but maybe we can add improvements that reduce package size to version 4 as well. WDYT?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jamesrweb Taking into account that these changes work in both version 18 and 19 of React, maybe we can leave the requirements for React peer dependencies as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would agree with @yevdyko. |
||
| "react-dom": ">= 19.0.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@testing-library/jest-dom": "6.6.2", | ||
| "@testing-library/react": "^16.0.0", | ||
| "@trivago/prettier-plugin-sort-imports": "^5.1.0", | ||
| "@types/jest": "^29.5.12", | ||
| "@types/node": "^22.0.0", | ||
| "@babel/eslint-plugin": "^7.25.9", | ||
| "@eslint/compat": "^1.2.6", | ||
| "@eslint/js": "^9.20.0", | ||
| "@testing-library/jest-dom": "6.6.3", | ||
| "@testing-library/react": "^16.2.0", | ||
| "@trivago/prettier-plugin-sort-imports": "^5.2.2", | ||
| "@types/jest": "^29.5.14", | ||
| "@types/node": "^22.13.4", | ||
| "@types/p5": "^1.7.6", | ||
| "@types/react": "^18.3.3", | ||
| "@types/react-dom": "^18.3.0", | ||
| "@typescript-eslint/eslint-plugin": "^8.1.0", | ||
| "@vitejs/plugin-react": "^4.3.0", | ||
| "@vitest/coverage-v8": "^3.0.4", | ||
| "babel-plugin-react-compiler": "0.0.0-experimental-938cd9a-20240601", | ||
| "eslint": "^9.4.0", | ||
| "eslint-plugin-react": "^7.34.2", | ||
| "eslint-plugin-react-compiler": "0.0.0-experimental-0998c1e-20240625", | ||
| "eslint-plugin-react-hooks": "^5.0.0", | ||
| "gh-pages": "^6.1.1", | ||
| "@types/react": "^19.0.8", | ||
| "@types/react-dom": "^19.0.3", | ||
| "@typescript-eslint/eslint-plugin": "^8.24.0", | ||
| "@vitejs/plugin-react": "^4.3.4", | ||
| "@vitest/coverage-v8": "^3.0.5", | ||
| "babel-plugin-react-compiler": "19.0.0-beta-30d8a17-20250209", | ||
| "eslint": "^9.20.1", | ||
| "eslint-plugin-react": "^7.37.4", | ||
| "eslint-plugin-react-compiler": "19.0.0-beta-30d8a17-20250209", | ||
| "eslint-plugin-react-hooks": "^5.1.0", | ||
| "gh-pages": "^6.3.0", | ||
| "jiti": "^2.4.2", | ||
| "js": "^0.1.0", | ||
| "jsdom": "^26.0.0", | ||
| "prettier": "^3.3.0", | ||
| "react": "19.0.0-rc.0", | ||
| "react-dom": "19.0.0-rc.0", | ||
| "prettier": "^3.5.1", | ||
| "react": "19.0.0", | ||
| "react-dom": "19.0.0", | ||
| "rimraf": "^6.0.1", | ||
| "typescript": "^5.4.5", | ||
| "typescript-eslint": "^8.0.0", | ||
| "vite": "^6.0.2", | ||
| "vite-plugin-dts": "^4.0.2", | ||
| "vitest": "^1.6.0", | ||
| "typescript": "^5.7.3", | ||
| "typescript-eslint": "^8.24.0", | ||
| "vite": "^6.1.0", | ||
| "vite-plugin-dts": "^4.5.0", | ||
| "vitest": "^3.0.5", | ||
| "vitest-canvas-mock": "^0.3.3" | ||
| }, | ||
| "dependencies": { | ||
| "microdiff": "^1.4.0", | ||
| "react-error-boundary": "^5.0.0" | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be as is, since it has no effect on compilation errors