Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

WIP: react-hooks v3 main branch #68

Draft
wants to merge 61 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
49c43b2
Add eslint and prettier config and CI steps
stmoreau Jul 19, 2023
d6f3ecf
Add line ending for .prettierignore
stmoreau Jul 19, 2023
ea62765
Merge pull request #50 from ably-labs/eslint-and-prettier-with-scripts
stmoreau Jul 19, 2023
0d93913
feat!: add `<AblyProvider>` and `useAbly`
owenpearson Jul 25, 2023
06cf0ca
docs: update README with context provider API
owenpearson Jul 25, 2023
a3cb538
fix: avoid mutation of user client options
owenpearson Aug 7, 2023
9b05bea
Merge pull request #57 from ably-labs/context
owenpearson Aug 7, 2023
f54cca1
useChannelState and useConnectionState initial implementation
stmoreau Jul 20, 2023
defa93c
update useChannelStateListener to receive state and listener params
stmoreau Jul 21, 2023
e028495
update useChannelStateListener signatures
stmoreau Jul 22, 2023
18c4852
test: add tests for useChannelStateListener
owenpearson Aug 9, 2023
eb0c355
feat: add `useConnectionStateListener`
owenpearson Aug 9, 2023
1aedf57
refactor: remove `useChannelState` and `useConnectionState`
owenpearson Aug 9, 2023
d63153a
docs: add README usage examples for channel/connection state hooks
owenpearson Aug 9, 2023
2e5f263
refactor: remove useState from event listener hooks
owenpearson Aug 9, 2023
702043d
refactor: use shared `useEventListener` hook for channel/connection s…
owenpearson Aug 9, 2023
46f98d6
refactor: simplify `useChannelStateListener`
owenpearson Aug 10, 2023
33a441d
Merge pull request #65 from ably-labs/add-useConnectionState-and-useC…
owenpearson Aug 10, 2023
662cf01
fix: `useChannel` hook with `ChannelOptions` throws error when compon…
ttypic Aug 9, 2023
96882d5
Merge remote-tracking branch 'origin/main' into integration/v3-update
ttypic Aug 10, 2023
b6a8d67
Merge pull request #69 from ably-labs/integration/v3-update
ttypic Aug 10, 2023
4624170
refactor: standardise argument normalisation
owenpearson Aug 10, 2023
a61a436
refactor!: return objects from `useChannel` and `usePresence`
owenpearson Aug 10, 2023
fc71762
fix: channelStateListener channel name set to id
owenpearson Aug 11, 2023
3440435
fix: allow string channelName with useChannelState signature
owenpearson Aug 11, 2023
e344f83
feat: add APIs for error handling
owenpearson Aug 11, 2023
0cc2bdc
docs: update contribution guide link
owenpearson Aug 11, 2023
6f5afc7
docs: remove outdated docs for passing in realtime instance
owenpearson Aug 11, 2023
335f374
Merge pull request #72 from ably-labs/fix-contributing-link
owenpearson Aug 11, 2023
a177230
feat!: add React 16.8+ support for the library
ttypic Aug 14, 2023
de2aeef
Merge pull request #71 from ably-labs/improve-error-handling
ttypic Aug 15, 2023
8a6e85a
chore(eslint): linting improvements
ttypic Aug 11, 2023
7525117
Merge pull request #70 from ably-labs/eslint-improvements
ttypic Aug 15, 2023
2837f96
fix: using stale version of message callback for `useChannel` hook
ttypic Aug 15, 2023
6df3f31
Merge pull request #73 from ably-labs/provide-own-realtime-docs-fix
stmoreau Aug 16, 2023
8f22297
Merge pull request #75 from ably-labs/update-supported-react
stmoreau Aug 16, 2023
5dd7bec
test: using stale version of message callback for useChannel hook
stmoreau Aug 16, 2023
10ff4fd
test: update use of the latest version of the message callback
stmoreau Aug 17, 2023
c858428
Merge pull request #78 from ably-labs/update-channel-callback
ttypic Aug 17, 2023
7c72e9e
fix: make AblyProvider work with options parameter
stmoreau Aug 17, 2023
191ecbb
fix: add missing dependencies for closing realtime connection on Ably…
stmoreau Aug 17, 2023
17e083c
Merge pull request #79 from ably-labs/make-AblyProvider-work-with-opt…
stmoreau Aug 17, 2023
2b110fa
fix: use fully qualified imports with `.js` extension for ESM build
ttypic Aug 18, 2023
ec82536
fix: use eslint-plugin-import
stmoreau Aug 18, 2023
c589f46
Merge pull request #80 from ably-labs/fix-imports
stmoreau Aug 18, 2023
fcba72a
test: await publishing channel messages
owenpearson Aug 25, 2023
5b9b6d7
test: display all channel state changes in sample app
owenpearson Aug 25, 2023
b414bfa
feat: skip param for `usePresence` and `useChannel`
owenpearson Aug 25, 2023
f507c3e
Merge pull request #81 from ably-labs/skip-param
owenpearson Aug 29, 2023
8693955
docs: document requirement for client side rendering
owenpearson Aug 29, 2023
57220c9
docs: add migration guide
owenpearson Aug 29, 2023
e2ca52d
feat: send agent with `/time` request upon init
owenpearson Aug 29, 2023
15b59ff
Merge pull request #82 from ably-labs/readme-ssr-note
owenpearson Aug 30, 2023
e4c0a7f
Merge pull request #83 from ably-labs/migration-guide
owenpearson Aug 30, 2023
0677af8
fix: ensure time request is only sent once
owenpearson Aug 30, 2023
89cc11a
refactor: send react-hooks version in /time request
owenpearson Aug 30, 2023
9063283
feat: allow `useChannel` without message callback
owenpearson Aug 30, 2023
0ae21ab
Merge pull request #84 from ably-labs/send-agent-upon-init
owenpearson Aug 30, 2023
60f11e6
Merge pull request #85 from ably-labs/optional-msg-callback-2
owenpearson Aug 30, 2023
b9cd4a1
feat: ably-js peerDependency
owenpearson Aug 31, 2023
684540b
Merge pull request #86 from ably-labs/ably-peer-dep
owenpearson Aug 31, 2023
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
43 changes: 43 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "react", "react-hooks", "import"],
"rules": {
// we should remove these at some point
"@typescript-eslint/no-explicit-any": 0
},
"settings": {
"react": {
"version": "detect"
}
},
"overrides": [
{
"files": ["**/*.{ts,tsx}"],
"rules": {
// see:
// https://github.com/microsoft/TypeScript/issues/16577#issuecomment-703190339
"import/extensions": [
"error",
"always",
{
"ignorePackages": true
}
]
}
}
]
}
30 changes: 16 additions & 14 deletions .github/workflows/dev-ci.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
name: Build and test

on:
workflow_dispatch:
pull_request:
push:
branches:
- main
workflow_dispatch:
pull_request:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16
- run: npm ci
- run: npm run test
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16
- run: npm ci
- run: npm run lint
- run: npm run format:check
- run: npm run test
51 changes: 27 additions & 24 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
name: Release NPM package

on:
workflow_dispatch:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16
- run: npm ci
- run: npm run test
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16
- run: npm ci
- run: npm run lint
- run: npm run format:check
- run: npm run test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run lint
- run: npm run format:check
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,5 @@ dist

# TernJS port file
.tern-port

.DS_Store
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
build
Coverage
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 4,
"semi": true,
"singleQuote": true
}
Loading
Loading