From 6920fa828f98483070d3d9c90a2a1ffa128ea5e9 Mon Sep 17 00:00:00 2001 From: Ugo Stephant Date: Mon, 25 Nov 2024 16:07:46 +0100 Subject: [PATCH 1/4] chore: update next to latest --- examples/next/next-env.d.ts | 2 +- examples/next/package.json | 2 +- yarn.lock | 92 ++++++++++++++++++------------------- 3 files changed, 48 insertions(+), 48 deletions(-) diff --git a/examples/next/next-env.d.ts b/examples/next/next-env.d.ts index 4f11a03d..40c3d680 100644 --- a/examples/next/next-env.d.ts +++ b/examples/next/next-env.d.ts @@ -2,4 +2,4 @@ /// // NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. +// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information. diff --git a/examples/next/package.json b/examples/next/package.json index bc7417a6..41d7041a 100644 --- a/examples/next/package.json +++ b/examples/next/package.json @@ -2,7 +2,7 @@ "name": "poool-react-access-next-example", "dependencies": { "@poool/react-access": "portal:../../", - "next": "14.2.5", + "next": "14.2.16", "react": "18.3.1", "react-dom": "18.3.1" }, diff --git a/yarn.lock b/yarn.lock index fbbc61ee..63ce522e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1010,72 +1010,72 @@ __metadata: languageName: node linkType: hard -"@next/env@npm:14.2.5": - version: 14.2.5 - resolution: "@next/env@npm:14.2.5" - checksum: 10c0/63d8b88ac450b3c37940a9e2119a63a1074aca89908574ade6157a8aa295275dcb3ac5f69e00883fc55d0f12963b73b74e87ba32a5768a489f9609c6be57b699 +"@next/env@npm:14.2.16": + version: 14.2.16 + resolution: "@next/env@npm:14.2.16" + checksum: 10c0/e9d795727bc43f171557a7a91111c9b71833840061275b5d4adf96f416febf4f02afb9dac1f4275f4a3e96a0a0db22b58fe934483e2823e76a5d3c60a563394b languageName: node linkType: hard -"@next/swc-darwin-arm64@npm:14.2.5": - version: 14.2.5 - resolution: "@next/swc-darwin-arm64@npm:14.2.5" +"@next/swc-darwin-arm64@npm:14.2.16": + version: 14.2.16 + resolution: "@next/swc-darwin-arm64@npm:14.2.16" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@next/swc-darwin-x64@npm:14.2.5": - version: 14.2.5 - resolution: "@next/swc-darwin-x64@npm:14.2.5" +"@next/swc-darwin-x64@npm:14.2.16": + version: 14.2.16 + resolution: "@next/swc-darwin-x64@npm:14.2.16" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@next/swc-linux-arm64-gnu@npm:14.2.5": - version: 14.2.5 - resolution: "@next/swc-linux-arm64-gnu@npm:14.2.5" +"@next/swc-linux-arm64-gnu@npm:14.2.16": + version: 14.2.16 + resolution: "@next/swc-linux-arm64-gnu@npm:14.2.16" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@next/swc-linux-arm64-musl@npm:14.2.5": - version: 14.2.5 - resolution: "@next/swc-linux-arm64-musl@npm:14.2.5" +"@next/swc-linux-arm64-musl@npm:14.2.16": + version: 14.2.16 + resolution: "@next/swc-linux-arm64-musl@npm:14.2.16" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@next/swc-linux-x64-gnu@npm:14.2.5": - version: 14.2.5 - resolution: "@next/swc-linux-x64-gnu@npm:14.2.5" +"@next/swc-linux-x64-gnu@npm:14.2.16": + version: 14.2.16 + resolution: "@next/swc-linux-x64-gnu@npm:14.2.16" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@next/swc-linux-x64-musl@npm:14.2.5": - version: 14.2.5 - resolution: "@next/swc-linux-x64-musl@npm:14.2.5" +"@next/swc-linux-x64-musl@npm:14.2.16": + version: 14.2.16 + resolution: "@next/swc-linux-x64-musl@npm:14.2.16" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@next/swc-win32-arm64-msvc@npm:14.2.5": - version: 14.2.5 - resolution: "@next/swc-win32-arm64-msvc@npm:14.2.5" +"@next/swc-win32-arm64-msvc@npm:14.2.16": + version: 14.2.16 + resolution: "@next/swc-win32-arm64-msvc@npm:14.2.16" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@next/swc-win32-ia32-msvc@npm:14.2.5": - version: 14.2.5 - resolution: "@next/swc-win32-ia32-msvc@npm:14.2.5" +"@next/swc-win32-ia32-msvc@npm:14.2.16": + version: 14.2.16 + resolution: "@next/swc-win32-ia32-msvc@npm:14.2.16" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@next/swc-win32-x64-msvc@npm:14.2.5": - version: 14.2.5 - resolution: "@next/swc-win32-x64-msvc@npm:14.2.5" +"@next/swc-win32-x64-msvc@npm:14.2.16": + version: 14.2.16 + resolution: "@next/swc-win32-x64-msvc@npm:14.2.16" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -8305,20 +8305,20 @@ __metadata: languageName: node linkType: hard -"next@npm:14.2.5": - version: 14.2.5 - resolution: "next@npm:14.2.5" +"next@npm:14.2.16": + version: 14.2.16 + resolution: "next@npm:14.2.16" dependencies: - "@next/env": "npm:14.2.5" - "@next/swc-darwin-arm64": "npm:14.2.5" - "@next/swc-darwin-x64": "npm:14.2.5" - "@next/swc-linux-arm64-gnu": "npm:14.2.5" - "@next/swc-linux-arm64-musl": "npm:14.2.5" - "@next/swc-linux-x64-gnu": "npm:14.2.5" - "@next/swc-linux-x64-musl": "npm:14.2.5" - "@next/swc-win32-arm64-msvc": "npm:14.2.5" - "@next/swc-win32-ia32-msvc": "npm:14.2.5" - "@next/swc-win32-x64-msvc": "npm:14.2.5" + "@next/env": "npm:14.2.16" + "@next/swc-darwin-arm64": "npm:14.2.16" + "@next/swc-darwin-x64": "npm:14.2.16" + "@next/swc-linux-arm64-gnu": "npm:14.2.16" + "@next/swc-linux-arm64-musl": "npm:14.2.16" + "@next/swc-linux-x64-gnu": "npm:14.2.16" + "@next/swc-linux-x64-musl": "npm:14.2.16" + "@next/swc-win32-arm64-msvc": "npm:14.2.16" + "@next/swc-win32-ia32-msvc": "npm:14.2.16" + "@next/swc-win32-x64-msvc": "npm:14.2.16" "@swc/helpers": "npm:0.5.5" busboy: "npm:1.6.0" caniuse-lite: "npm:^1.0.30001579" @@ -8359,7 +8359,7 @@ __metadata: optional: true bin: next: dist/bin/next - checksum: 10c0/8df7d8ccc1a5bab03fa50dd6656c8a6f3750e81ef0b087dc329fea9346847c3094a933a890a8e87151dc32f0bc55020b8f6386d4565856d83bcc10895d29ec08 + checksum: 10c0/8cd036a6f30d4cc8ab8480c19339ee6134ffd5b18338ff5a07de397ed4e29fad54de5219f70aafabf1fe9c48a7d54b7df58ba1f29cfa5d3351ff7763e8d4844e languageName: node linkType: hard @@ -8969,7 +8969,7 @@ __metadata: resolution: "poool-react-access-next-example@workspace:examples/next" dependencies: "@poool/react-access": "portal:../../" - next: "npm:14.2.5" + next: "npm:14.2.16" react: "npm:18.3.1" react-dom: "npm:18.3.1" languageName: unknown From ce618cb17512bf7c6af2ffca5c92c49b324c555b Mon Sep 17 00:00:00 2001 From: Ugo Stephant Date: Mon, 25 Nov 2024 16:08:03 +0100 Subject: [PATCH 2/4] fix: audit not being reloaded correctly --- src/AccessContext/index.tsx | 6 ++---- src/AuditContext/index.tsx | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/AccessContext/index.tsx b/src/AccessContext/index.tsx index 283983f4..3bd4eae0 100644 --- a/src/AccessContext/index.tsx +++ b/src/AccessContext/index.tsx @@ -62,10 +62,8 @@ const AccessContext = ({ const init = async () => { if ( - !globalThis.Access || - !globalThis.Access.isPoool || - !globalThis.PooolAccess || - !globalThis.PooolAccess.isPoool + (!globalThis.Access || !globalThis.Access.isPoool) && + (!globalThis.PooolAccess || !globalThis.PooolAccess.isPoool) ) { await loadScript(scriptUrl, 'poool-react-access-lib', { timeout: scriptLoadTimeout, diff --git a/src/AuditContext/index.tsx b/src/AuditContext/index.tsx index 01a0d013..485439ae 100644 --- a/src/AuditContext/index.tsx +++ b/src/AuditContext/index.tsx @@ -53,10 +53,8 @@ const AuditContext = ({ const init = async () => { if ( - !globalThis.Audit || - !globalThis.Audit.isPoool || - !globalThis.PooolAudit || - !globalThis.PooolAudit.isPoool + (!globalThis.Audit || !globalThis.Audit.isPoool) && + (!globalThis.PooolAudit || !globalThis.PooolAudit.isPoool) ) { await loadScript(scriptUrl, 'poool-react-audit-lib', { timeout: scriptLoadTimeout, From e739d96af54c87006eb2d86bab296bdc656b8e01 Mon Sep 17 00:00:00 2001 From: Ugo Stephant Date: Mon, 25 Nov 2024 16:08:22 +0100 Subject: [PATCH 3/4] fix: multiple paywalls on pre-rendered content --- src/Paywall/index.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Paywall/index.tsx b/src/Paywall/index.tsx index 94b2e6cd..62da5649 100644 --- a/src/Paywall/index.tsx +++ b/src/Paywall/index.tsx @@ -114,9 +114,10 @@ const Paywall = forwardRef(({ } container.innerHTML = ''; - paywallRef.current.off('identityAvailable', onIdentityAvailable); - await destroyFactory?.(paywallRef.current); + const factory = paywallRef.current; + factory.off('identityAvailable', onIdentityAvailable); paywallRef.current = null; + await destroyFactory?.(factory); }; const recreate = async () => { From 1569c847d23ebd0c639ee6416209567e6d77ab0f Mon Sep 17 00:00:00 2001 From: Ugo Stephant Date: Mon, 25 Nov 2024 16:14:24 +0100 Subject: [PATCH 4/4] chore: prevent linting dts --- .eslintignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.eslintignore b/.eslintignore index 5bcb6fe8..f476db3f 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,5 @@ dist coverage node_modules + +*.d.ts