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
64 changes: 63 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,35 @@ name: Tests
on: [pull_request]

jobs:
# Check if there are any code changes in the PR (not docs, examples, changelogs, etc.)
# If not, the tests will be skipped and marked as successful
check_for_code_changes:
runs-on: ubuntu-latest

permissions:
pull-requests: read

outputs:
changes: ${{ steps.filter.outputs.changes }}

steps:
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
predicate-quantifier: "every"
filters: |
changes:
- '**/*'
- '!docs/**'
- '!examples/**'
- '!guides/**'
- '!starter-kits/**'
- '!tutorials/**'
- '!CHANGELOG.md'
- '!CHANGELOG_PUBLIC.md'

test:
needs: check_for_code_changes
runs-on: ubuntu-latest

strategy:
Expand All @@ -30,19 +58,23 @@ jobs:

steps:
- name: Checkout
if: needs.check_for_code_changes.outputs.changes == 'true'
uses: actions/checkout@v4

- name: Use Node ${{ matrix.node-version }}
if: needs.check_for_code_changes.outputs.changes == 'true'
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: "**/package-lock.json"

- name: Install dependencies
if: needs.check_for_code_changes.outputs.changes == 'true'
run: npm install

- name: Turbo Cache
if: needs.check_for_code_changes.outputs.changes == 'true'
id: turbo-cache
uses: actions/cache@v4
with:
Expand All @@ -52,12 +84,15 @@ jobs:
turbo-cache-${{ matrix.node-version }}-${{ matrix.pkg }}-bust3

- name: Install Bun
if: needs.check_for_code_changes.outputs.changes == 'true'
uses: oven-sh/setup-bun@v1

- name: Build
if: needs.check_for_code_changes.outputs.changes == 'true'
run: npm run build -- --filter ${{ matrix.pkg }}

- name: Ensure no files are changed
if: needs.check_for_code_changes.outputs.changes == 'true'
run: |
CHANGED=$(git status --porcelain)
if [ -n "$CHANGED" ]; then
Expand All @@ -67,22 +102,28 @@ jobs:
fi

- name: Run unit tests
if: needs.check_for_code_changes.outputs.changes == 'true'
run: npm run test -- --filter ${{ matrix.pkg }} -- --coverage

- name: Run type tests
if: needs.check_for_code_changes.outputs.changes == 'true'
run: npm run test:types -- --filter ${{ matrix.pkg }}

- name: Run dependency tests
if: needs.check_for_code_changes.outputs.changes == 'true'
run: npm run test:deps -- --filter ${{ matrix.pkg }}

- name: Run lint checks
if: needs.check_for_code_changes.outputs.changes == 'true'
run: npm run lint -- --filter ${{ matrix.pkg }}

- name: Run public NPM packaging lint checks
if: needs.check_for_code_changes.outputs.changes == 'true'
run: npm run lint:package -- --filter ${{ matrix.pkg }}

# E2E tests defined in e2e/next-sandbox package
e2e-next-sandbox:
needs: check_for_code_changes
runs-on: ubuntu-latest

strategy:
Expand All @@ -100,22 +141,27 @@ jobs:

steps:
- name: Checkout
if: needs.check_for_code_changes.outputs.changes == 'true'
uses: actions/checkout@v4

- name: Use Node ${{ matrix.node-version }}
if: needs.check_for_code_changes.outputs.changes == 'true'
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: "**/package-lock.json"

- name: Install dependencies
if: needs.check_for_code_changes.outputs.changes == 'true'
run: npm install

- name: Install Playwright
if: needs.check_for_code_changes.outputs.changes == 'true'
run: npx playwright install chromium --no-shell --with-deps

- name: Run Playwright tests
if: needs.check_for_code_changes.outputs.changes == 'true'
run: npm run test -- --filter @liveblocks/next-sandbox

- uses: actions/upload-artifact@v4
Expand All @@ -127,6 +173,7 @@ jobs:

# E2E tests defined in e2e/next-ai-kitchen-sink package
e2e-next-ai-sandbox:
needs: check_for_code_changes
runs-on: ubuntu-latest

strategy:
Expand All @@ -144,22 +191,27 @@ jobs:

steps:
- name: Checkout
if: needs.check_for_code_changes.outputs.changes == 'true'
uses: actions/checkout@v4

- name: Use Node ${{ matrix.node-version }}
if: needs.check_for_code_changes.outputs.changes == 'true'
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: "**/package-lock.json"

- name: Install dependencies
if: needs.check_for_code_changes.outputs.changes == 'true'
run: npm install

- name: Install Playwright
if: needs.check_for_code_changes.outputs.changes == 'true'
run: npx playwright install chromium --no-shell --with-deps

- name: Run AI Playwright tests
if: needs.check_for_code_changes.outputs.changes == 'true'
run: npm run test -- --filter @liveblocks/next-ai-kitchen-sink

- uses: actions/upload-artifact@v4
Expand All @@ -171,6 +223,7 @@ jobs:

# E2E tests defined in e2e/node-sandbox package
e2e-node-sandbox:
needs: check_for_code_changes
runs-on: ubuntu-latest

strategy:
Expand All @@ -189,23 +242,28 @@ jobs:

steps:
- name: Checkout
if: needs.check_for_code_changes.outputs.changes == 'true'
uses: actions/checkout@v4

- name: Use Node ${{ matrix.node-version }}
if: needs.check_for_code_changes.outputs.changes == 'true'
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: "**/package-lock.json"

- name: Install dependencies
if: needs.check_for_code_changes.outputs.changes == 'true'
run: npm install

- name: Run node-sandbox tests
if: needs.check_for_code_changes.outputs.changes == 'true'
run: npm run test -- --filter node-sandbox

# E2E tests defined in @liveblocks/core package
e2e-client-specs:
needs: check_for_code_changes
runs-on: ubuntu-latest

strategy:
Expand All @@ -219,18 +277,22 @@ jobs:

steps:
- name: Checkout
if: needs.check_for_code_changes.outputs.changes == 'true'
uses: actions/checkout@v4

- name: Use Node ${{ matrix.node-version }}
if: needs.check_for_code_changes.outputs.changes == 'true'
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: "**/package-lock.json"

- name: Run npm install
- name: Install dependencies
if: needs.check_for_code_changes.outputs.changes == 'true'
run: npm install

- name: Run e2e client specs tests
if: needs.check_for_code_changes.outputs.changes == 'true'
run: npm run test:e2e
working-directory: packages/liveblocks-core
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@

## 3.13.3

### @liveblocks/client
### `@liveblocks/client`

- Bump hardcoded client-side socket connection timeout from 10s to 20s
- Add more detailed timing info to `enableDebugLogging` to better debug
connection issues

### @liveblocks/react-ui
### `@liveblocks/react-ui`

- Fix an issue where `Composer` and `AiComposer` would throw an error when
mounted/unmounted.

## v3.13.2

### @liveblocks/node
### `@liveblocks/node`

- Add a new `alwaysUseKnowledge` option when creating or updating copilots. When
this option is enabled, the copilot retrieves and uses the uploaded knowledge
Expand Down
44 changes: 28 additions & 16 deletions CHANGELOG_PUBLIC.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,15 @@ list and feel free to give them credit at the end of a line, e.g.:
## Documentation

- New quickstart flow, prioritizing products, and use cases.
- New [quickstart guides for Notifications](https://liveblocks.io/docs/get-started/notifications) in two different categories.
- New [quickstart guide for Tldaw](https://liveblocks.io/docs/get-started/nextjs-tldraw).
- New guide: [How to notify users about unread custom notifications outside of your app](https://liveblocks.io/docs/guides/how-to-notify-users-about-unread-custom-notifications-outside-of-your-app).
- New guide: [How to notify users about unread comments outside of your app](https://liveblocks.io/docs/guides/how-to-notify-users-about-unread-comments-outside-of-your-app).
- New
[quickstart guides for Notifications](https://liveblocks.io/docs/get-started/notifications)
in two different categories.
- New
[quickstart guide for Tldaw](https://liveblocks.io/docs/get-started/nextjs-tldraw).
- New guide:
[How to notify users about unread custom notifications outside of your app](https://liveblocks.io/docs/guides/how-to-notify-users-about-unread-custom-notifications-outside-of-your-app).
- New guide:
[How to notify users about unread comments outside of your app](https://liveblocks.io/docs/guides/how-to-notify-users-about-unread-comments-outside-of-your-app).
- A number of updated dashboard screenshots.

## Dashboard
Expand All @@ -47,13 +52,13 @@ ctnicholas, stevenfabre, pierrelevaillant

## 3.13.3

### @liveblocks/client
### `@liveblocks/client`

- Bump hardcoded client-side socket connection timeout from 10s to 20s.
- Add more detailed timing info to `enableDebugLogging` to better debug
connection issues.

### @liveblocks/react-ui
### `@liveblocks/react-ui`

- Fix an issue where `Composer` and `AiComposer` would throw an error when
mounted/unmounted.
Expand All @@ -66,7 +71,7 @@ nvie, marcbouchenoire

## v3.13.2

### @liveblocks/node
### `@liveblocks/node`

- Add a new `alwaysUseKnowledge` option when creating or updating copilots. When
this option is enabled, the copilot retrieves and uses the uploaded knowledge
Expand Down Expand Up @@ -164,13 +169,14 @@ ctnicholas

## Infrastructure

- We've been doing lots of prep work to enable a new opt-in storage engine for Liveblocks
rooms that will bring performance benefits like faster room connection speed and larger
document sizes to everyone—stay tuned!
- We've been doing lots of prep work to enable a new opt-in storage engine for
Liveblocks rooms that will bring performance benefits like faster room
connection speed and larger document sizes to everyone—stay tuned!

## Documentation

- Fix `useThreads` API reference, it returns _oldest_ threads first, not _newest_ threads.
- Fix `useThreads` API reference, it returns _oldest_ threads first, not
_newest_ threads.

## Contributors

Expand All @@ -197,12 +203,16 @@ jrowny

## Examples

- New example: [Comments search](https://liveblocks.io/examples/comments-search).
- Add custom “Copy link” comment dropdown item to the [Linear-like Issue Tracker](https://liveblocks.io/examples/linear-like-issue-tracker) example.
- New example:
[Comments search](https://liveblocks.io/examples/comments-search).
- Add custom “Copy link” comment dropdown item to the
[Linear-like Issue Tracker](https://liveblocks.io/examples/linear-like-issue-tracker)
example.

## Showcase

- New item: [Search through comments](https://liveblocks.io/showcase/search-through-comments).
- New item:
[Search through comments](https://liveblocks.io/showcase/search-through-comments).

## Contributors

Expand Down Expand Up @@ -231,8 +241,10 @@ ctnicholas

## Documentation

- New guide: [Can I use my own database with Yjs?](https://liveblocks.io/docs/guides/can-i-use-my-own-database-with-yjs)
- New guide: [Why you can’t delete Yjs documents](https://liveblocks.io/docs/guides/why-you-cant-delete-yjs-documents).
- New guide:
[Can I use my own database with Yjs?](https://liveblocks.io/docs/guides/can-i-use-my-own-database-with-yjs)
- New guide:
[Why you can’t delete Yjs documents](https://liveblocks.io/docs/guides/why-you-cant-delete-yjs-documents).
- Add info on mass deleting rooms.
- Rename "Liveblocks" notification kinds as "Collaboration" kinds.

Expand Down
15 changes: 14 additions & 1 deletion docs/pages/authentication/access-token/nextjs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ start building your own security logic in Next.js’ `/app` directory.

</StepContent>

</Step>
<Step>
<StepTitle>Add your project’s secret key</StepTitle>
<StepContent>

Create a new `.env.local` file and add your Liveblocks secret key from the [dashboard](/dashboard/apikeys).

```env file=".env.local"
LIVEBLOCKS_SECRET_KEY="{{SECRET_KEY}}"
```

</StepContent>

</Step>
<Step>
<StepTitle>Set up authentication endpoint</StepTitle>
Expand All @@ -40,7 +53,7 @@ start building your own security logic in Next.js’ `/app` directory.
import { Liveblocks } from "@liveblocks/node";

const liveblocks = new Liveblocks({
secret: "{{SECRET_KEY}}",
secret: process.env.LIVEBLOCKS_SECRET_KEY!,
});

export async function POST(request: Request) {
Expand Down
Loading
Loading