Skip to content

Commit

Permalink
feat(react): add react turbo fragments support (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
tchak authored Apr 25, 2024
2 parents de607e8 + a467d1b commit a8a0f43
Show file tree
Hide file tree
Showing 41 changed files with 1,817 additions and 2,544 deletions.
8 changes: 8 additions & 0 deletions .changeset/red-lemons-cross.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@coldwired/turbo-stream": minor
"@coldwired/actions": minor
"@coldwired/react": minor
"@coldwired/utils": minor
---

add support for react turbo fragments
27 changes: 15 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,23 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ 18, 20 ]
node: [18, 20]
name: Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- uses: pnpm/action-setup@v2.2.4
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- uses: pnpm/action-setup@v3

- name: Install Dependencies
run: pnpm install
- name: Install Dependencies
run: pnpm install

- name: Lint
run: pnpm lint
- name: Install Playwright
run: pnpm exec playwright install

- name: Test
run: pnpm test
- name: Lint
run: pnpm lint

- name: Test
run: pnpm test
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: pnpm/action-setup@v2.2.4
- uses: pnpm/action-setup@v3

- name: Install Dependencies
run: pnpm install
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy docs to GitHub Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
branches: ['main']

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -17,7 +17,7 @@ permissions:
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
group: 'pages'
cancel-in-progress: false

jobs:
Expand All @@ -29,27 +29,27 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: pnpm/action-setup@v2.2.4
- uses: pnpm/action-setup@v3

- name: Install Dependencies
run: pnpm install

- name: Build the docs
run: pnpm docs:build

- name: Setup Pages
uses: actions/configure-pages@v3
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: 'public'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v4
42 changes: 17 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
"description": "An implementation of @hotwired/turbo based on remix and morphdom",
"license": "MIT",
"repository": "tchak/coldwired",
"keywords": [
"remix",
"router",
"turbo",
"stimulus"
],
"keywords": ["turbo", "stimulus"],
"scripts": {
"turbo": "turbo run test lint build",
"build": "turbo run build --force",
"test": "turbo run test",
"test:webkit": "turbo run test:webkit",
"test:firefox": "turbo run test:firefox",
"lint": "turbo run lint",
"clean": "turbo run clean",
"prepare": "pnpm run build",
Expand All @@ -22,33 +19,28 @@
"devDependencies": {
"@axodotdev/oranda": "^0.6.1",
"@changesets/cli": "^2.27.1",
"@remix-run/node": "^2.7.2",
"@testing-library/dom": "^9.3.4",
"@typescript-eslint/eslint-plugin": "^7.0.2",
"@typescript-eslint/parser": "^7.0.2",
"@vitest/browser": "^1.3.1",
"@vitest/ui": "^1.3.1",
"@testing-library/dom": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^7.7.1",
"@typescript-eslint/parser": "^7.7.1",
"@vitest/browser": "^1.5.2",
"@vitest/ui": "^1.5.2",
"c8": "^9.1.0",
"del-cli": "^5.1.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"jsdom": "^24.0.0",
"eslint": "^8.50.0",
"eslint-config-prettier": "^8.0",
"npm-run-all": "^4.1.5",
"playwright": "^1.41.2",
"playwright": "^1.43.1",
"prettier": "^3.2.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rollup": "^4.12.0",
"turbo": "^1.12.4",
"typescript": "^5.3.3",
"vite": "^5.1.4",
"vitest": "^1.3.1",
"webdriverio": "^8.32.3"
"rollup": "^4.16.4",
"turbo": "^1.13.2",
"typescript": "^5.4.5",
"vite": "^5.2.10",
"vitest": "^1.5.2"
},
"engines": {
"node": ">=16"
},
"packageManager": "pnpm@8.6.9",
"packageManager": "pnpm@8.15.4",
"prettier": {
"singleQuote": true,
"printWidth": 100
Expand Down
42 changes: 18 additions & 24 deletions packages/actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
"name": "@coldwired/actions",
"description": "DOM manipulation actions based on morphdom",
"license": "MIT",
"files": [
"dist"
],
"files": ["dist"],
"main": "./dist/index.cjs.js",
"module": "./dist/index.es.js",
"types": "./dist/types/src/index.d.ts",
"types": "./dist/types/index.d.ts",
"exports": {
".": {
"import": "./dist/index.es.js",
"require": "./dist/index.cjs.js"
}
},
"type": "module",
"version": "0.11.2",
"keywords": [
"turbo"
],
"keywords": ["turbo"],
"scripts": {
"build": "run-s clean build:*",
"build:vite": "vite build",
"build:tsc": "tsc --emitDeclarationOnly",
"dev": "vitest",
"test": "vitest run",
"test:webkit": "vitest run --browser.name=webkit",
"test:firefox": "vitest run --browser.name=firefox",
"test:ui": "vitest --ui",
"coverage": "vitest run --coverage",
"lint": "run-s lint:*",
Expand All @@ -31,39 +31,30 @@
"clean": "del dist coverage node_modules/.vite"
},
"dependencies": {
"@coldwired/react": "*",
"@coldwired/utils": "^0.11.1",
"morphdom": "^2.7.2",
"tiny-invariant": "^1.3.2"
"morphdom": "^2.7.2"
},
"engines": {
"node": ">=16"
},
"packageManager": "pnpm@8.6.9",
"packageManager": "pnpm@8.15.4",
"prettier": {
"singleQuote": true,
"printWidth": 100
},
"eslintConfig": {
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"plugins": ["@typescript-eslint"],
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"],
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-redeclare": "off"
},
"overrides": [
{
"files": [
"vite.config.js",
"vitest.config.ts"
],
"files": ["vite.config.js", "vitest.config.ts"],
"env": {
"node": true
}
Expand All @@ -83,7 +74,10 @@
}
},
"devDependencies": {
"@hotwired/turbo": "^7.3.0",
"intersection-observer": "^0.12.2"
"@types/react": "^18.2.45",
"@types/react-dom": "^18.2.18",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"tiny-invariant": "^1.3.2"
}
}
Loading

0 comments on commit a8a0f43

Please sign in to comment.