Skip to content
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

refactor!: rewrite #46

Draft
wants to merge 42 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
7cd888b
refactor!: rewrite
sibbng Mar 1, 2022
190abcf
feat: deep unwrap objects, don't unwrap arrays
sibbng Mar 2, 2022
07973b3
chore: fix types
sibbng Mar 2, 2022
a2d303a
chore: fix array types
sibbng Mar 2, 2022
1840022
chore: remove release.yml
sibbng Mar 3, 2022
2f57745
feat: support omitting render function
sibbng Mar 3, 2022
52ac31a
refactor: update logic
sibbng Mar 3, 2022
50dd982
chore: types
sibbng Mar 3, 2022
a6e28c9
feat: babel plugin to wrap components with `computed`
sibbng Mar 4, 2022
e693bc5
fix: update state
sibbng Mar 4, 2022
15c149d
fix: babel plugin preact support
sibbng Mar 4, 2022
c6e897c
feat: `onPropsUpdated` hook
sibbng Mar 4, 2022
0eac261
feat: babel plugin for react
sibbng Mar 5, 2022
38fb83d
release v1.0.0-beta.1
sibbng Mar 5, 2022
728ce8f
release v1.0.1-beta.1
sibbng Mar 5, 2022
2c753cf
refactor: remove lifecycle hooks that are unsupported in setup
sibbng Mar 5, 2022
7bbd749
refactor: remove create hooks in solid
sibbng Mar 5, 2022
b91db98
feat: auto import preset
sibbng Mar 5, 2022
05924a5
chore: better typing for imports
sibbng Mar 5, 2022
96f3d39
chore: fix type issue
sibbng Mar 5, 2022
d96ee2e
release v1.0.1-beta.2
sibbng Mar 5, 2022
442ea6d
chore: fix types
sibbng Mar 5, 2022
a38577c
feat: patch `VNode` type (https://github.com/vuejs/core/issues/1033)
sibbng Mar 5, 2022
261dab0
release v1.0.0-beta.2
sibbng Mar 6, 2022
ed6e6e1
fix: run cleanups after hmr updates
sibbng Mar 7, 2022
d0580cf
refactor: stop scope before unmounted hook
sibbng Mar 7, 2022
239d0a1
refactor: better patch for vue jsx types (https://github.com/vuejs/co…
sibbng Mar 8, 2022
21c8976
feat(babel): allow returning anything in `defineComponent`
sibbng Mar 8, 2022
a6705da
release v1.0.0-beta.3
sibbng Mar 8, 2022
c532fef
fix(babel): callee check
sibbng Mar 8, 2022
43f8afe
feat: pass original props as second argument
sibbng Mar 8, 2022
4cb8039
chore: unwrap ref type
sibbng Mar 8, 2022
0f73997
feat(react): `useProps` helper
sibbng Mar 8, 2022
a5cb89a
release v1.0.0-beta.4
sibbng Mar 8, 2022
c695209
fix: run cleanups after unmount (fix #50)
sibbng Mar 29, 2022
652881b
release v1.0.0-beta.5
sibbng Mar 29, 2022
00188fe
fix: restore parent instance after unmount (fix #50)
sibbng Mar 29, 2022
426a45a
release v1.0.0-beta.6
sibbng Mar 29, 2022
de66fab
fix: suppress `setState` error (#50)
sibbng Mar 30, 2022
f1a6062
release v1.0.0-beta.7
sibbng Mar 30, 2022
e9a4a13
chore: add `peerDependencies` field
sibbng Apr 1, 2022
7d4a59d
chore: allow react 18 as peer
sibbng Apr 1, 2022
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
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
node_modules
6 changes: 6 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "@antfu",
"rules": {
"react/prop-types": "off"
}
}
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [antfu]
37 changes: 37 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Lint

on:
push:
branches:
- main

pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install pnpm
uses: pnpm/action-setup@v2.0.1
with:
version: 6.15.1

- name: Set node
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: 'pnpm'

- name: Setup
run: npm i -g @antfu/ni

- name: Install
run: nci

- name: Lint
run: nr lint
46 changes: 33 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,45 @@ name: Test

on:
push:
branches: [ master ]
branches:
- main

pull_request:
branches: [ master ]
branches:
- main

jobs:
build:

runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}

strategy:
matrix:
node-version: [12.x, 14.x, 15.x]
node-version: [14.x, 16.x]
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: yarn install --frozen-lockfile
- run: yarn test
- run: yarn build
- uses: actions/checkout@v2

- name: Install pnpm
uses: pnpm/action-setup@v2.0.1
with:
version: 6.15.1

- name: Set node version to ${{ matrix.node_version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node_version }}
cache: "pnpm"

- name: Setup
run: npm i -g @antfu/ni

- name: Install
run: nci

- name: Install
run: nr build

- name: Test
run: nr test --if-present
86 changes: 80 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,81 @@
node_modules
dist
.DS_Store
# Created by .ignore support plugin (hsz.mobi)
### Node template
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# parcel-bundler cache (https://parceljs.org/)
.cache
packages/reactivue/README.md
.idea/
preact

# next.js build output
.next

# nuxt.js build output
.nuxt

# Nuxt generate
dist

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless

# IDE
.idea
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ignore-workspace-root-check=true
shamefully-hoist=true
6 changes: 0 additions & 6 deletions .vscode/settings.json

This file was deleted.

4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020-present, Anthony Fu <anthonyfu117@hotmail.com>
Copyright (c) 2021 Anthony Fu <https://github.com/antfu>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<p align="center">
<img src="./screenshots/logo.svg" height="180"/></p>

<p align="center">Use Vue Composition API in React components</p>
<p align="center">Use Vue 3 Composition API in React and Solid components</p>

<p align="center">
<a href="https://www.npmjs.com/package/reactivue"><img src="https://img.shields.io/npm/v/reactivue?color=53c2df&label"/></a>
Expand Down
3 changes: 3 additions & 0 deletions bin/reactivue-fix.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env node
'use strict'
import('../scripts/postinstall.js')
19 changes: 0 additions & 19 deletions examples/preact-htm-browser/README.md

This file was deleted.

11 changes: 0 additions & 11 deletions examples/preact-htm-browser/index.html

This file was deleted.

49 changes: 0 additions & 49 deletions examples/preact-htm-browser/script.js

This file was deleted.

16 changes: 0 additions & 16 deletions examples/react-ts-vite/README.md

This file was deleted.

28 changes: 0 additions & 28 deletions examples/react-ts-vite/index.html

This file was deleted.

31 changes: 0 additions & 31 deletions examples/react-ts-vite/package.json

This file was deleted.

Loading