Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
0238ef6
chore: yarn set version 4.18.0
Preeternal Sep 19, 2026
4fb9cae
chore: save lock file
Preeternal Sep 19, 2026
b92f534
feat!: migrate to React Native 0.86 and drop legacy architecture support
Preeternal Sep 20, 2026
4fcda16
feat(ios): add Swift Package Manager support
Preeternal Sep 20, 2026
96ae750
fix(ios): harden SwiftPM autolinking setup
Preeternal Sep 20, 2026
337507a
docs: new architecture only note
Preeternal Sep 20, 2026
23a69db
docs: planned before release
Preeternal Sep 20, 2026
6d5bbe9
fix(ci): example:spm spm:update
Preeternal Sep 20, 2026
9885559
feat: add iOS cookie change subscriptions
Preeternal Sep 20, 2026
a545d82
feat: add stable cookie manager error codes
Preeternal Sep 20, 2026
8b2cc2c
feat!: add structured cookie validation and iOS store options
Preeternal Sep 20, 2026
e61da74
fix: keep option validation errors in stable taxonomy
Preeternal Sep 21, 2026
5ba97f0
test: verify mutation-free validation and example lifecycle
Preeternal Sep 21, 2026
e81e9c2
docs: polish v7 release and example documentation
Preeternal Sep 21, 2026
4cb2e8d
test(ios): stabilize cookie change observer integration tests
Preeternal Sep 21, 2026
ed96bb2
feat!: rename cookie change event store field
Preeternal Sep 21, 2026
daa610d
test(ios): wait for WebKit store readiness
Preeternal Sep 21, 2026
901363a
test(ios): make WebKit observer test deterministic
Preeternal Sep 21, 2026
b59fd44
docs: guard iOS-only cookie listener example
Preeternal Sep 21, 2026
1fcd9f4
docs: simplify v7 release notes
Preeternal Sep 21, 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
65 changes: 65 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,22 @@ jobs:
- name: Test Expo config plugin
run: yarn test:plugin

test:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- name: Setup
uses: ./.github/actions/setup

- name: Run unit tests
run: yarn test --maxWorkers=2 --coverage

- name: Test example subscription lifecycle
run: yarn test:example

build-library:
runs-on: ubuntu-latest

Expand Down Expand Up @@ -243,9 +259,12 @@ jobs:
run: |
CLANG_MODULE_CACHE_PATH="$RUNNER_TEMP/clang-module-cache" \
SWIFT_MODULECACHE_PATH="$RUNNER_TEMP/swift-module-cache" \
COOKIE_MANAGER_SWIFT_TESTS=1 \
swift test

- name: Run iOS simulator tests
env:
COOKIE_MANAGER_SWIFT_TESTS: 1
run: |
set -euo pipefail

Expand Down Expand Up @@ -292,3 +311,49 @@ jobs:
name: ios-build-log
if-no-files-found: warn
path: ${{ runner.temp }}/ios-build.log

build-ios-spm-rn87:
runs-on: macos-latest

env:
XCODE_VERSION: latest-stable

steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- name: Setup
uses: ./.github/actions/setup

- name: Use appropriate Xcode version
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
with:
xcode-version: ${{ env.XCODE_VERSION }}

- name: Cache React Native SwiftPM artifacts
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ~/Library/Caches/ReactNative/spm-artifacts
key: ${{ runner.os }}-react-native-spm-${{ hashFiles('example-spm/package.json') }}
restore-keys: |
${{ runner.os }}-react-native-spm-

- name: Build RN 0.87 SwiftPM example for iOS
run: |
set -euo pipefail
IOS_BUILD_LOG="$RUNNER_TEMP/ios-spm-build.log"
if ! yarn example:spm build:ios 2>&1 | tee "$IOS_BUILD_LOG"; then
echo "::group::First iOS SwiftPM errors"
grep -nE " error: |fatal error:|Command PhaseScriptExecution failed|No such file|cannot find type " \
"$IOS_BUILD_LOG" | head -n 80 || true
echo "::endgroup::"
exit 1
fi

- name: Upload iOS SwiftPM build log
if: always()
uses: actions/upload-artifact@v4
with:
name: ios-spm-rn87-build-log
if-no-files-found: warn
path: ${{ runner.temp }}/ios-spm-build.log
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ android.iml
# Cocoapods
#
example/ios/Pods
example-spm/ios/Pods

# Ruby
example/vendor/
Expand Down
942 changes: 0 additions & 942 deletions .yarn/releases/yarn-4.11.0.cjs

This file was deleted.

1,000 changes: 1,000 additions & 0 deletions .yarn/releases/yarn-4.18.0.cjs

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
nodeLinker: node-modules
nmHoistingLimits: workspaces

yarnPath: .yarn/releases/yarn-4.11.0.cjs
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.18.0.cjs
52 changes: 52 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,58 @@

---

## v7.0.0 (unreleased): New Architecture, SwiftPM, and iOS cookie-store events

v7 requires the React Native New Architecture. It also adds Swift Package Manager support, iOS cookie change events, safer structured writes, named iOS store options, and stable error codes.

### Added

- Added iOS-only `addCookieChangeListener()` for Foundation and the default persistent WebKit store. The event identifies the changed store through `{ iosCookieStore }`; it is an invalidation signal, not a cookie delta or a one-event-per-mutation guarantee. Android reports `not_supported`.
- Added named `{ iosCookieStore }` options to the store-selecting methods. Omitting the option continues to select Foundation on iOS; Android continues to use its single shared store.
- Added structured validation for `set()` on both platforms. Input is validated before the native store is changed, while ordinary printable values remain accepted without extra encoding.
- Added `CookieManagerError`, `CookieManagerErrorCode`, and `isCookieManagerError()`. Errors now use the same public codes on iOS, Android, and JavaScript: `invalid_url`, `invalid_cookie`, `domain_mismatch`, `not_supported`, `storage_error`, and `network_error`.
- Added Swift Package Manager support for iOS. CocoaPods remains supported.
- Added a podless React Native 0.87 SwiftPM example app.

### Breaking changes

- Removed the legacy iOS bridge. Projects that still require the Old Architecture must stay on `v6.x`.
- Replaced the old method-specific rejection codes with the new shared error codes. Applications that inspect errors should migrate to `isCookieManagerError()` and `CookieManagerErrorCode`.
- `set()` now rejects malformed structured cookies before mutation. A literal `;` in a structured cookie value is always rejected because Android cannot pass it to the WebView store without changing its meaning.

### Compatibility

- The development and example-app baseline is React Native `0.86.2`.
- SwiftPM support is currently opt-in and verified with React Native `0.87.1`; CocoaPods remains the default production path.
- Android now targets Java 17.
- Existing positional `useWebKit` calls remain compatible throughout v7, but are deprecated in favor of `{ iosCookieStore }`.
- URL acceptance remains delegated to the selected native store, as it was in v6.

### Deprecated

- Deprecated positional `useWebKit` arguments in favor of `{ iosCookieStore }`. They will remain available throughout v7.
- Added the temporary `{ validate: false }` compatibility option for applications migrating unusual v6 cookie input. It does not disable structural safety checks and will be removed in the next major release.

### Security

- Hardened raw `setFromResponse()` imports against invalid host URLs and CR/LF/NUL header injection. Raw cookie attributes remain available through this API.

### Tooling

- Updated the project scaffold and development tooling.
- Added CI coverage for the React Native 0.87 SwiftPM example.

### Tests

- Expanded automated coverage for the new APIs and verified that rejected writes leave native stores unchanged.
- Both CocoaPods and SwiftPM example builds are covered by CI.

### Documentation

- Updated the README and both example apps for v7.

---

## v6.4.1: AGP 9 Kotlin compatibility fix

### Fixes
Expand Down
36 changes: 35 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ We want this community to be friendly and respectful to each other. Please follo
This project is a monorepo managed using [Yarn workspaces](https://yarnpkg.com/features/workspaces). It contains the following packages:

- The library package in the root directory.
- An example app in the `example/` directory.
- A CocoaPods example app in the `example/` directory.
- A React Native 0.87 SwiftPM example app in the `example-spm/` directory.

To get started with the project, make sure you have the correct version of [Node.js](https://nodejs.org/) installed. See the [`.nvmrc`](./.nvmrc) file for the version used in this project.

Expand Down Expand Up @@ -49,6 +50,12 @@ To run the example app on iOS:
yarn example ios
```

To regenerate and build the SwiftPM example for an iOS Simulator:

```sh
yarn example:spm ios
```

To confirm that the app is running with the new architecture, you can check the Metro logs for a message like this:

```sh
Expand All @@ -75,7 +82,30 @@ To fix formatting errors, run the following:
yarn lint --fix
```

Run the JavaScript unit tests with:

```sh
yarn test
yarn test:example
```

Run the standalone Swift unit tests with:

```sh
COOKIE_MANAGER_SWIFT_TESTS=1 swift test
```

### Commit message convention

We follow the [Conventional Commits specification](https://www.conventionalcommits.org/en) for commit messages. Lefthook runs lint and type checks before a commit and Commitlint validates commit messages.

### Publishing to npm

Release It handles version bumps, tags, GitHub releases, and npm publishing:

```sh
yarn release
```

### Scripts

Expand All @@ -84,9 +114,13 @@ The `package.json` file contains various scripts for common tasks:
- `yarn`: setup project by installing dependencies.
- `yarn typecheck`: type-check files with TypeScript.
- `yarn lint`: lint files with [ESLint](https://eslint.org/).
- `yarn test`: run library unit tests with [Jest](https://jestjs.io/).
- `yarn test:example`: verify the example subscription lifecycle.
- `yarn release`: prepare and publish a release with [Release It](https://github.com/release-it/release-it).
- `yarn example start`: start the Metro server for the example app.
- `yarn example android`: run the example app on Android.
- `yarn example ios`: run the example app on iOS.
- `yarn example:spm ios`: regenerate and build the React Native 0.87 SwiftPM example.

### Sending a pull request

Expand Down
Loading
Loading