Skip to content

Commit

Permalink
Update dependencies (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tymek authored Oct 31, 2023
1 parent c4f31e9 commit 7a993e8
Show file tree
Hide file tree
Showing 17 changed files with 1,109 additions and 779 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
shell: bash
strategy:
matrix:
node-version: [16.x, 18.x, 19.x]
node-version: [18.x, 20.x, 21.x]

steps:
- uses: actions/setup-node@v3
Expand Down
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ You can use both to have different values on client-side and server-side.

---


# Usage

## A). 🌟 **App directory** (new)
Expand Down
14 changes: 8 additions & 6 deletions common/eslint-config-custom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
"license": "MIT",
"private": true,
"dependencies": {
"eslint": "^8.43.0",
"eslint-config-next": "^13.4.7",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-react": "^7.32.2",
"eslint-config-turbo": "latest"
"@typescript-eslint/eslint-plugin": "^6.9.0",
"@typescript-eslint/parser": "^6.9.0",
"eslint": "^8.52.0",
"eslint-config-next": "^14.0.0",
"eslint-config-prettier": "^9.0.0",
"eslint-config-turbo": "1.10.16",
"eslint-plugin-react": "^7.33.2"
},
"devDependencies": {
"typescript": "^5.1.3"
"typescript": "^5.2.2"
},
"publishConfig": {
"access": "public"
Expand Down
1 change: 1 addition & 0 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Next.js with Unleash

To run this code locally:

```bash
git clone https://github.com/Unleash/unleash-client-nextjs.git
cd unleash-client-nextjs/example
Expand Down
22 changes: 11 additions & 11 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@
},
"dependencies": {
"@unleash/nextjs": "workspace:*",
"@vercel/examples-ui": "1.0.5",
"next": "13.4.4",
"@vercel/examples-ui": "2.0.3",
"next": "14.0.0",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"@babel/core": "^7.22.5",
"@types/node": "^20.3.1",
"@types/react": "^18.2.13",
"@types/react-dom": "^18.2.6",
"autoprefixer": "^10.4.14",
"eslint": "^8.43.0",
"@babel/core": "^7.23.2",
"@types/node": "^20.8.9",
"@types/react": "^18.2.33",
"@types/react-dom": "^18.2.14",
"autoprefixer": "^10.4.16",
"eslint": "^8.52.0",
"eslint-config-custom": "workspace:*",
"postcss": "^8.4.24",
"tailwindcss": "^3.3.2",
"postcss": "^8.4.31",
"tailwindcss": "^3.3.5",
"tsconfig": "workspace:*",
"typescript": "^5.1.3"
"typescript": "^5.2.2"
}
}
34 changes: 17 additions & 17 deletions lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,32 @@
"dev": "tsc -w"
},
"devDependencies": {
"@types/murmurhash3js": "3.0.3",
"@types/node": "20.4.5",
"@types/react": "18.2.17",
"@types/react-dom": "18.2.7",
"@types/semver": "7.5.0",
"@unleash/client-specification": "4.5.0",
"@types/murmurhash3js": "3.0.6",
"@types/node": "20.8.9",
"@types/react": "18.2.33",
"@types/react-dom": "18.2.14",
"@types/semver": "7.5.4",
"@unleash/client-specification": "5.0.2",
"@vitest/coverage-c8": "^0.33.0",
"@vitest/coverage-v8": "^0.32.2",
"@vitest/coverage-v8": "^0.34.6",
"eslint-config-custom": "workspace:*",
"next": "13.4.12",
"next": "14.0.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"tsconfig": "workspace:*",
"typescript": "5.1.6",
"vite": "4.4.7",
"vitest": "0.33.0"
"typescript": "5.2.2",
"vite": "4.5.0",
"vitest": "0.34.6"
},
"dependencies": {
"@commander-js/extra-typings": "11.0.0",
"@next/env": "13.4.12",
"@unleash/proxy-client-react": "3.6.0",
"commander": "11.0.0",
"@commander-js/extra-typings": "11.1.0",
"@next/env": "14.0.0",
"@unleash/proxy-client-react": "4.0.3",
"commander": "11.1.0",
"murmurhash3js": "3.0.1",
"semver": "7.5.4",
"unleash-client": "4.2.0-beta.0",
"unleash-proxy-client": "2.5.0"
"unleash-client": "5.0.0",
"unleash-proxy-client": "3.1.0"
},
"peerDependencies": {
"next": ">=12",
Expand Down
2 changes: 1 addition & 1 deletion lib/src/core/client/strategy/flexible-rollout-strategy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Strategy } from './strategy';
import { Context } from '../context';
import normalizedValue from './util';
import normalizedValue from '../../hash';
import { resolveContextValue } from '../helpers';

const STICKINESS = {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/core/client/strategy/gradual-rollout-session-id.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Strategy } from './strategy';
import normalizedValue from './util';
import normalizedValue from '../../hash';
import { Context } from '../context';

export default class GradualRolloutSessionIdStrategy extends Strategy {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/core/client/strategy/gradual-rollout-user-id.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Strategy } from './strategy';
import { Context } from '../context';
import normalizedValue from './util';
import normalizedValue from '../../hash';

export default class GradualRolloutUserIdStrategy extends Strategy {
constructor() {
Expand Down
5 changes: 0 additions & 5 deletions lib/src/core/client/strategy/util.ts

This file was deleted.

5 changes: 3 additions & 2 deletions lib/src/core/hash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import * as murmurHash3 from 'murmurhash3js';
export default function normalizedValue(
id: string,
groupId: string,
normalizer = 100
normalizer = 100,
seed = 0
): number {
return (murmurHash3.x86.hash32(`${groupId}:${id}`) % normalizer) + 1;
return (murmurHash3.x86.hash32(`${groupId}:${id}`, seed) % normalizer) + 1;
}
5 changes: 4 additions & 1 deletion lib/src/core/variant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ type Override = {
values: string[];
};

const VARIANT_HASH_SEED = 86028157;

export function getDefaultVariant(): Variant {
return {
name: "disabled",
Expand Down Expand Up @@ -76,7 +78,8 @@ export function selectVariantDefinition(
const target = normalizedValue(
getSeed(context, stickiness),
groupId,
totalWeight
totalWeight,
VARIANT_HASH_SEED
);

let counter = 0;
Expand Down
1 change: 1 addition & 0 deletions lib/src/flagsClient.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { flagsClient } from "./flagsClient";

describe("flagsClient", () => {
// @ts-expect-error undici-types polluting global TS namespace
global.fetch = vi.fn();

it("should return methods", () => {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
},
"devDependencies": {
"eslint-config-custom": "workspace:*",
"prettier": "^2.8.8",
"turbo": "^1.10.5"
"prettier": "^3.0.3",
"turbo": "^1.10.16"
},
"engines": {
"node": ">=16.0.0"
Expand Down
Loading

0 comments on commit 7a993e8

Please sign in to comment.