Skip to content

refactor: Valtio useSnapshot issue, laboratory Next.js 15 upgrade, Next Auth v5 transition#4607

Merged
enesozturk merged 37 commits intomainfrom
enes/apkt-3125-finish-appkit-labdemo-migration-to-nextjs-153
Sep 1, 2025
Merged

refactor: Valtio useSnapshot issue, laboratory Next.js 15 upgrade, Next Auth v5 transition#4607
enesozturk merged 37 commits intomainfrom
enes/apkt-3125-finish-appkit-labdemo-migration-to-nextjs-153

Conversation

@enesozturk
Copy link
Copy Markdown
Contributor

@enesozturk enesozturk commented Jul 4, 2025

Description

This pull request includes several key updates and improvements across the codebase:

  • Valtio State Management Issue on React Hooks: Addressed a compatibility issue with Valtio's useSnapshot using useSyncExternalStore that fails on React v19.1.x. This issue was raised in Valtio Discussion #1115. The changes ensure compatibility with React versions <=19.0.0, preventing errors related to non-iterable proxyState.
  • Next Auth V5 Transition: Updated authentication configurations in auth.ts to transition to Next Auth V5, enhancing security measures and aligning with the latest best practices.
  • Next.js 15 on Laboratory app: Upgraded the laboratory app to Next.js 15, incorporating the latest features like Turbopack to enhance our development experience.

Refactor Verify tests

The routeInterceptUrl function has been used for malicious URL tests - what it does is replacing the current URL of the laboratory example with the malicious URL, but fetch the laboratory URL on Playwright browser. With this way, it's going to mimic the malicious URL but the page itself will be AppKit lab. It's a hack to continue using laboratory test utils modalPage.connectUri(), modalPage.sign() etc. But since we recently switched to search parameters approach on laboratory app, with the Next.js 15 this approach doesn't work. (I've did many debugs and investigations but couldn't find the root cause.

So what I did is the running the tests in our malicious URL directly instead: https://malicious-app-verify-simulation.vercel.app/

Updated ModalPage.ts and ModalValidator.ts to have separate utils:

  • connectUriMalicious
  • signMalicious etc.

So we don't need to make that trick any more bc that malicious app already using AppKit.

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Associated Issues

For Linear issues: Closes APKT-xxx
For GH issues: closes #...

Showcase (Optional)

If there is a UI change include the screenshots with before and after state.
If new feature is being introduced, include the link to demo recording.

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections
  • I have tested my changes on the preview link
  • Approver of this PR confirms that the changes are tested on the preview link

@linear
Copy link
Copy Markdown

linear bot commented Jul 4, 2025

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jul 4, 2025

🦋 Changeset detected

Latest commit: 6b20180

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 24 packages
Name Type
@reown/appkit-adapter-bitcoin Patch
@reown/appkit Patch
@reown/appkit-adapter-ethers Patch
@reown/appkit-adapter-ethers5 Patch
@reown/appkit-adapter-solana Patch
@reown/appkit-adapter-wagmi Patch
@reown/appkit-utils Patch
@reown/appkit-cdn Patch
@reown/appkit-cli Patch
@reown/appkit-codemod Patch
@reown/appkit-common Patch
@reown/appkit-controllers Patch
@reown/appkit-core Patch
@reown/appkit-experimental Patch
@reown/appkit-pay Patch
@reown/appkit-polyfills Patch
@reown/appkit-scaffold-ui Patch
@reown/appkit-siwe Patch
@reown/appkit-siwx Patch
@reown/appkit-testing Patch
@reown/appkit-ui Patch
@reown/appkit-wallet Patch
@reown/appkit-wallet-button Patch
@reown/appkit-universal-connector Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown

vercel bot commented Jul 4, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
appkit-basic-html Ready Ready Preview Comment Sep 1, 2025 0:47am
appkit-demo Ready Ready Preview Comment Sep 1, 2025 0:47am
appkit-gallery Canceled Canceled Sep 1, 2025 0:47am
appkit-laboratory Ready Ready Preview Comment Sep 1, 2025 0:47am
10 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
appkit-basic-example Ignored Ignored Sep 1, 2025 0:47am
appkit-basic-sign-client-example Ignored Ignored Sep 1, 2025 0:47am
appkit-basic-up-example Ignored Ignored Sep 1, 2025 0:47am
appkit-ethers5-bera Ignored Ignored Sep 1, 2025 0:47am
appkit-nansen-demo Ignored Ignored Sep 1, 2025 0:47am
appkit-vue-solana Ignored Ignored Sep 1, 2025 0:47am
appkit-wagmi-cdn-example Ignored Ignored Sep 1, 2025 0:47am
ethereum-provider-wagmi-example Ignored Ignored Sep 1, 2025 0:47am
next-wagmi-solana-bitcoin-example Ignored Ignored Sep 1, 2025 0:47am
vue-wagmi-example Ignored Ignored Sep 1, 2025 0:47am

@socket-security
Copy link
Copy Markdown

socket-security bot commented Jul 4, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedvaltio@​2.1.710010010090100

View full report

@enesozturk enesozturk changed the title Enes/apkt 3125 finish appkit labdemo migration to nextjs 153 refactor: Valtio useSnapshot issue, laboratory Next.js 15 upgrade, Next Auth v5 transition Jul 4, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 4, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 78.33% 34820 / 44452
🔵 Statements 78.33% 34820 / 44452
🔵 Functions 76.08% 3837 / 5043
🔵 Branches 86.72% 8223 / 9482
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/adapters/ethers/src/client.ts 64.82% 73.1% 69.44% 64.82% 51-52, 55-56, 63-65, 87-88, 102-105, 147-148, 179-180, 194-217, 230-266, 272-273, 280-297, 369-391, 394-399, 411-412, 422-443, 448-449, 472, 499-500, 509-510, 555-601, 608-609, 631, 660-661, 672-673, 707-708, 712, 739-744, 753-771, 777-778, 787-788, 799-800, 806-818
packages/adapters/ethers5/src/client.ts 55.65% 72.44% 61.11% 55.65% 48-134, 150-151, 182-183, 197-220, 233-269, 275-276, 283-300, 372-394, 397-402, 414-415, 425-446, 451-452, 475, 502-503, 512-513, 543-589, 611-612, 634, 663-664, 676-677, 714-715, 719, 738-752, 760-778, 784-785, 794-795, 806-807, 813-825
packages/appkit-utils/exports/index.ts 100% 100% 100% 100%
packages/appkit/exports/react.ts 50% 100% 33.33% 50% 50-62, 65-72
packages/appkit/src/client/appkit-base-client.ts 71.87% 87.24% 75.55% 71.87% 184, 197-200, 203, 212-213, 282-283, 285-286, 291-292, 373-374, 410-416, 481-482, 508-509, 512-513, 555-556, 559, 600-604, 611-612, 615-616, 627-650, 659-660, 677-689, 693-714, 717-723, 726-732, 735-741, 744-750, 753-763, 766-772, 775-781, 801-810, 813-819, 822-823, 826-827, 846-847, 871-913, 920-932, 938-971, 974-984, 1036-1037, 1042, 1057-1073, 1087, 1091-1098, 1127-1128, 1165-1167, 1171-1184, 1189-1190, 1198-1199, 1201-1202, 1251-1260, 1305-1306, 1318-1319, 1324, 1347-1352, 1395, 1416-1417, 1427, 1429-1445, 1450, 1495-1496, 1509-1520, 1566-1579, 1624, 1630-1634, 1653-1654, 1673-1676, 1712-1731, 1754-1765, 1794-1795, 1801-1827, 2037-2038, 2070-2071, 2074-2075, 2088-2091, 2094-2095, 2115-2116, 2119-2120, 2132-2142, 2160-2161, 2164-2171, 2175-2176, 2190, 2198, 2201, 2205, 2210-2229, 2232-2241, 2248-2249, 2263-2264, 2267-2268, 2275-2276, 2315-2316, 2399-2400, 2403-2404, 2407-2410, 2413-2414, 2417-2418, 2421-2422, 2425-2426, 2429-2433, 2442-2451, 2460-2471, 1182-1258, 1761, 2212-2233
packages/appkit/src/client/appkit.ts 45.77% 78.09% 82.14% 45.77% 67-115, 118-132, 135-142, 145-161, 164-176, 181-191, 197-198, 223-224, 231-232, 245-291, 299-311, 313, 315-334, 336-350, 375-381, 397, 418-419, 424-425, 440-524, 563, 594-595, 618-620, 628-629, 664-665, 672-673, 676-679, 269-280
packages/appkit/src/library/react/index.ts 11.42% 100% 16.66% 11.42% 77-113, 116-129, 132-150, 153-181, 184-201
packages/appkit/src/library/vue/index.ts 24.1% 100% 28.57% 24.1% 85-119, 122-138, 141-156, 159-179, 182-197
packages/controllers/exports/index.ts 100% 100% 100% 100%
packages/controllers/exports/react.ts 85.71% 92.1% 43.75% 85.71% 55-64, 85-93, 100-107, 122, 130, 148
packages/experimental/src/smart-session/controllers/SmartSessionsController.ts 62.63% 61.53% 50% 62.63% 52-56, 58-81, 89-90, 97-98, 125-126, 156-157, 165-168, 172-173, 176-178, 186-187, 195, 201-239
packages/pay/src/controllers/PayController.ts 87.71% 82.79% 85.71% 87.71% 102-103, 163-164, 198, 300-301, 304-306, 310-322, 332-333, 339-340, 345-346, 351-352, 355-356, 398-406, 424-425, 538-551, 560-561
packages/pay/src/utils/PaymentUtil.ts 87.5% 88.37% 100% 87.5% 82-86, 90-91, 116-120, 193-197
Generated in workflow #14671 for commit 6b20180 by the Vitest Coverage Report Action

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants