Skip to content

Commit

Permalink
Update all deps (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
vikingair authored May 30, 2024
1 parent fb818f7 commit cc85cb3
Show file tree
Hide file tree
Showing 20 changed files with 4,085 additions and 3,258 deletions.
38 changes: 0 additions & 38 deletions .eslintrc

This file was deleted.

10 changes: 5 additions & 5 deletions .github/actions/pnpm-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ inputs:
runs:
using: "composite"
steps:
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
env:
NODE_VERSION: "16"
NODE_VERSION: "20"
with:
node-version: "${{ env.NODE_VERSION }}"
- name: Install pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v4
id: pnpm-install
with:
version: 8
version: 9
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- name: Setup pnpm cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ env.NODE_VERSION }}-${{ hashFiles('**/pnpm-lock.yaml') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/pnpm-install
with:
target: '.'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/pnpm-install
with:
target: '.'
- name: Test
run: pnpm test
- name: Coveralls
uses: coverallsapp/github-action@master
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
9 changes: 0 additions & 9 deletions .prettierrc

This file was deleted.

5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
}
44 changes: 43 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,87 +1,129 @@
# Changelog

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

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [4.0.0] - 2024-05-30

### Changed

- Dropped support for Node < 18
- Using `act` from `@testing-library/react` in test util to avoid warnings being printed

## [3.0.1] - 2022-10-15

### Fixed

- SSR was not working properly, because of missing mandatory `getServerSnapshot` implementation.

### Changed
- Dropped Node12 support. At least Node14 required now.

- Dropped Node12 support. At least Node14 required now.

## [3.0.0] - 2022-06-07

### Added

- [Migration Guide Next](https://github.com/fdc-viktor-luft/react-use-sub/blob/master/MIGRATIONGUIDE.md#300)

### Changed

- Not compatible anymore to earlier versions of React than 18, because
it makes use of the new hook `useSyncExternalStore` and relies on automatic batching.

## [2.2.2] - 2022-02-15

### Fixed

- Generating type interface instead of shipping real types to prevent TS errors for consumers.

## [2.2.1] - 2021-11-01

### Fixed

- Include React 17 as valid peer dependency.

## [2.2.0] - 2021-07-06

### Changed

- Optional state does not need to be initialized with explicit `undefined` value anymore.
The store updates allow now also to set data that does not belong into the store. Using
strict TS checks, should avoid this to happen, so it's not enforced by the given code
anymore.

## [2.1.1] - 2021-06-30

### Fix

- NextJS stopped working because setting `"type": "module"` in own `package.json` was overriding
the default of the package importer. Hence, the package could only be used as ESM.

## [2.1.0] - 2021-05-02

### Added

- `Store.listen` allows adding (and removing) listeners on the store outside react components.

## [2.0.0] - 2021-03-21

### Added

- [Migration Guide v2](https://github.com/fdc-viktor-luft/react-use-sub/blob/master/MIGRATIONGUIDE.md#200)

### Changed

- Allowing `undefined` types on top-level thanks to
[hint](https://github.com/microsoft/TypeScript/issues/13195#issuecomment-802213410)
of [@InExtremaRes](https://github.com/InExtremaRes).

## [1.2.0] - 2021-03-17

### Added

- Test-Util `react-use-sub/test-util`. [More details](https://github.com/fdc-viktor-luft/react-use-sub#testing).

## [1.1.1] - 2021-03-14

### Changed

- Node version >= 12 requirement. Possibly still works with older Node versions.

## [1.1.0] - 2020-09-03

### Added

- Conditional store updates.

## [1.0.4] - 2020-09-03

### Added

- Improve IDE auto-import by moving index file into root directory.

## [1.0.3] - 2020-08-28

### Added

- Fix rarely omitted re-rendering

## [1.0.2] - 2020-08-17

### Added

- Fix error on update with external deps

## [1.0.1] - 2020-04-08

### Added

- Export some utility types
- Lower peer deps requirements

## [1.0.0] - 2020-02-06

### Added

- Publish first stable version
14 changes: 8 additions & 6 deletions MIGRATIONGUIDE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Migration Guide

You can find here tips for migrating breaking changes.

## 3.0.0

Breaking changes are that you will need to install React 18.
Also `useSub` now doesn't require the definition of external dependencies anymore.

```tsx
// before
export const FancyItemPrev: React.FC<{ id: string }> = ({ id }) => {
Expand All @@ -20,15 +23,16 @@ export const FancyItemNext: React.FC<{ id: string }> = ({ id }) => {
}
```

In addition, the new mechanism using the new `useSyncExternalStore` will make subscriptions
log errors if you use mapper functions that don't produce shallow
equal objects. Previously, this was just silently causing always updating components
In addition, the new mechanism using the new `useSyncExternalStore` will make subscriptions
log errors if you use mapper functions that don't produce shallow
equal objects. Previously, this was just silently causing always updating components
on all store updates. But now, you will be logged an error message like this
`Your mapper does not produce shallow comparable results`. If you have a solid test coverage
and were already using the `react-use-sub/test-utils` you should be able to find all broken
mappers when executing your tests as affected will fail.

An example demonstrates how to fix this issue.

```tsx
// before
export const FancyItemsPrev: React.FC = () => {
Expand Down Expand Up @@ -66,8 +70,8 @@ import { _config } from 'react-use-sub';
_config.onError = (_: Error) => undefined;
```


## 2.0.0

Possible breaking change since the lax rule to ignore passed `undefined` values on
top-level were removed now. Migration tip:

Expand All @@ -89,5 +93,3 @@ const update = { lastSuccess: Date.now() };
if (!success) delete update.lastSuccess;
Store.set(update);
```


Loading

0 comments on commit cc85cb3

Please sign in to comment.