Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
09df230
build: migrate tests from Jest to Vitest 5
tim-soft Nov 6, 2026
897106e
test: test every lightbox feature with realistic input
tim-soft Nov 6, 2026
d144cc1
ci: run the tests on GitHub Actions
tim-soft Nov 6, 2026
8633b16
test: drop a jsdom pinch finding that real browsers disprove
tim-soft Nov 6, 2026
b68eddb
test: add Playwright tests that drive real browsers
tim-soft Nov 6, 2026
a1c221a
ci: run the Playwright tests
tim-soft Nov 6, 2026
451d084
build: type-check against this repo's own type packages
tim-soft Nov 6, 2026
bd851c6
test: pin how zoom and pan gestures move and scale images
tim-soft Nov 6, 2026
f86921b
ci: run lint separately from the tests
tim-soft Nov 6, 2026
ecdba6e
test: cover how apps embed the lightbox
tim-soft Nov 6, 2026
fe40d4d
test: check the public types and the published bundle
tim-soft Nov 6, 2026
706bb38
test: add e2e tests for everyday use and the gaps they found
tim-soft Nov 6, 2026
7e41bd3
ci: track unit and e2e coverage on Codecov
tim-soft Nov 6, 2026
b1494ae
docs: show unit coverage in the README badge
tim-soft Nov 7, 2026
ba8d7f3
build: switch from Yarn 1 to npm, and the example to Next.js 16
tim-soft Nov 7, 2026
56927a4
ci: release with Changesets and require a changeset on every PR
tim-soft Nov 7, 2026
8cb4ccb
refactor(example): replace styled-components with Tailwind 4
tim-soft Nov 7, 2026
33c5a0d
fix(example): make the inline demo's buttons change its images
tim-soft Nov 7, 2026
d5dc897
feat: support React 19
tim-soft Nov 7, 2026
fb850b2
test: mark expected failures after their setup
tim-soft Nov 7, 2026
b9ba057
fix(example): open grid images from the keyboard
tim-soft Nov 7, 2026
6de6c85
docs(example): set up the demo app with npm
tim-soft Nov 7, 2026
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
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@4.0.0/schema.json",
"access": "public",
"baseBranch": "master",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"ignore": [],
"linked": [],
"updateInternalDependencies": "patch"
}
5 changes: 5 additions & 0 deletions .changeset/support-react-19.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'react-spring-lightbox': minor
---

Support React 19. The lightbox now depends on `@react-spring/web` 10, which accepts React 19, so npm no longer refuses to install it next to React 19. Two-finger pinch zoom no longer stops after its first step under React 19. React 18 keeps working.
10 changes: 8 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@ example/node_modules/**
/build
/dist
/coverage
/playwright-report
/test-results
/blob-report
/e2e/harness/images
/e2e/harness/index.html

# misc
.DS_Store
.env
npm-debug.log*
yarn-debug.log*
yarn-error.log*
yarn.lock*
package-lock.json*
package.json*
CHANGELOG.md*
README.md*
Expand All @@ -25,4 +30,5 @@ example/.env
example/npm-debug.log*
example/yarn-debug.log*
example/yarn-error.log*
example/yarn.lock*
example/next-env.d.ts
*.css
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ module.exports = {
env: {
browser: true,
es6: true,
jest: true,
},
extends: [
'plugin:react/recommended',
Expand Down
20 changes: 20 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# The test and e2e jobs in workflows/test.yml each upload a report,
# flagged unit and e2e.
coverage:
status:
# The test job already fails when unit coverage drops, so these checks
# only report
project:
default:
informational: true
patch:
default:
informational: true

comment:
layout: 'condensed_header, flags, condensed_files, condensed_footer'

flag_management:
default_rules:
# A commit whose e2e job didn't upload shows its parent's e2e coverage
carryforward: true
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release

on:
push:
branches: [master]

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
contents: write
# Lets npm use trusted publishing once it's set up for the package on npmjs.com
id-token: write
pull-requests: write

jobs:
release:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-node@v7
with:
node-version: 24
cache: npm
registry-url: https://registry.npmjs.org
- run: npm ci
# While master has changesets, this opens or updates the Version Packages PR,
# which bumps the version and dates the new CHANGELOG.md entry. Merging that
# PR publishes to npm, then pushes the version's tag and GitHub release.
- uses: changesets/action@ae32849d5ba541f9ae29e40e22a623bc13562f51 # v2.1.2
with:
publish-script: npm run ch:publish
version-script: npm run ch:version
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
100 changes: 100 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Tests

on:
push:
branches: [master]
pull_request:
branches: [master]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
changeset:
# Every PR needs a changeset, except the Version Packages PR, which uses them up
if: ${{ github.event_name == 'pull_request' && github.head_ref != 'changeset-release/master' }}
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-node@v7
with:
node-version: 24
cache: npm
- run: npm ci --ignore-scripts
- run: npx changeset status --since=origin/master

lint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 24
cache: npm
- run: npm ci
- run: npm run lint:eslint
- run: npm run lint:prettier
# Vitest doesn't type-check, so tsc checks the tests along with the source
- run: npm run lint:ts

test:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 24
cache: npm
- run: npm ci
- run: npm test
# Uploads even when coverage misses a threshold, so Codecov shows the
# uncovered lines. Errors never fail this required job. Fork PRs
# upload without a token, and Dependabot PRs need CODECOV_TOKEN as a
# Dependabot secret.
- uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
if: ${{ !cancelled() }}
with:
disable_search: true
fail_ci_if_error: false
files: coverage/unit/lcov.info
flags: unit
token: ${{ secrets.CODECOV_TOKEN }}

e2e:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 24
cache: npm
- run: npm ci
- run: npx playwright install --with-deps chromium firefox webkit
- run: npm run test:e2e
env:
# Records the library lines Chromium runs, in coverage/e2e
E2E_COVERAGE: true
- uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
if: ${{ !cancelled() }}
with:
disable_search: true
fail_ci_if_error: false
files: coverage/e2e/lcov.info
flags: e2e
token: ${{ secrets.CODECOV_TOKEN }}
- uses: actions/upload-artifact@v7
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 14
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ node_modules

# builds
coverage
playwright-report
test-results
blob-report
build
dist
.rpt2_cache
.next
next-env.d.ts

# misc
.DS_Store
Expand Down
6 changes: 4 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ node_modules/**
.next/**
dist/**
coverage/**
playwright-report/**
test-results/**
blob-report/**
e2e/harness/images/**
example/node_modules/**
example/.next/**
yarn.lock
yarn-error.log
.editorconfig
.eslintignore
.gitignore
Expand Down
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

6 changes: 0 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# Changelog

All notable changes to this project will be documented in this file.

## Upcoming

- Add `swipe up` to close lightbox

## [1.9.0] - 2026-07-29

- Drop `styled-components` dependency
Expand Down
34 changes: 25 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
[![NPM](https://img.shields.io/npm/l/react-spring-lightbox.svg?color=brightgreen&style=popout-square)](https://github.com/tim-soft/react-spring-lightbox/blob/master/LICENSE)
![npm bundle size](https://img.shields.io/bundlephobia/minzip/react-spring-lightbox.svg?style=popout-square)
![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=popout-square)
[![Travis (.org)](https://img.shields.io/travis/tim-soft/react-spring-lightbox?style=flat-square)](https://travis-ci.org/tim-soft/react-spring-lightbox)
[![Tests](https://img.shields.io/github/actions/workflow/status/tim-soft/react-spring-lightbox/test.yml?branch=master&style=flat-square&label=tests)](https://github.com/tim-soft/react-spring-lightbox/actions/workflows/test.yml)
[![Coverage](https://img.shields.io/codecov/c/github/tim-soft/react-spring-lightbox/master?flag=unit&style=flat-square&label=coverage)](https://codecov.io/gh/tim-soft/react-spring-lightbox)

React-spring-lightbox is a flexible image gallery lightbox with native-feeling touch gestures and buttery smooth animations.

Expand Down Expand Up @@ -144,29 +145,44 @@ git clone https://github.com/tim-soft/react-spring-lightbox.git react-spring-lig
cd react-spring-lightbox
```

Setup symlinks
Install the library's dependencies

```bash
yarn link
cd example
yarn link react-spring-lightbox
npm install
```

Run the library in development mode
Run the library in development mode, which rebuilds it on every change

```bash
yarn start
npm start
```

Run the example app in development mode
In another terminal, install and run the example app. Its `file:` dependencies are symlinks to the library and to the library's own React, so both use one copy of React.

```bash
cd example
yarn dev
npm install
npm run dev
```

Changes to the library code should hot reload in the demo app

## Releasing

Every pull request needs a changeset, a short note in `.changeset/` that says what changed for people who use the library and whether that's a patch, minor or major change. The `changeset` check fails without one.

```bash
npm run ch
```

For a change that doesn't need a release, such as one to tests or CI, add an empty changeset instead.

```bash
npx changeset add --empty
```

Once changesets reach master, a Version Packages pull request collects them. It bumps the version and adds a dated entry to [CHANGELOG.md](./CHANGELOG.md). Merging it publishes the new version to npm, tags it, and creates its GitHub release.

## License

MIT © [Tim Ellenberger](https://github.com/tim-soft)
Loading
Loading