Skip to content

Conversation

huozhi
Copy link
Member

@huozhi huozhi commented Feb 17, 2024

  • Simplify the export and mark swr context with "use client"
  • Upgrade bundler

@huozhi huozhi requested a review from shuding as a code owner February 17, 2024 20:56
Copy link

socket-security bot commented Feb 17, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/bunchee@4.4.8 environment, filesystem, unsafe Transitive: network, shell +81 49.5 MB huozhi

🚮 Removed packages: npm/bunchee@4.3.4

View full report↗︎

Copy link

codesandbox-ci bot commented Feb 17, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@huozhi huozhi marked this pull request as draft February 17, 2024 22:46
@huozhi huozhi marked this pull request as ready for review February 18, 2024 00:17
Copy link
Member

@shuding shuding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This approach now bundles the code for SWRConfig, whereas the current main branch re-exports SWRConfig from swr/_internal. So this change kinda "clones" the module instead of sharing the same instance.

We need to ensure that 1️⃣ and 2️⃣ are the same instance:

  • server layer, import SWRConfig

    • enters "use client"
      • exports SWRConfig // ← 1️⃣
  • client layer, import SWRConfig

    • exports SWRConfig // ← 2️⃣

@huozhi huozhi marked this pull request as draft February 18, 2024 20:27
@huozhi huozhi force-pushed the build/change-export branch from eb6a748 to f5a65cd Compare March 8, 2024 18:22
@huozhi huozhi marked this pull request as ready for review March 8, 2024 22:37
@huozhi huozhi requested a review from shuding March 8, 2024 22:37
@shuding shuding merged commit e4d3768 into main Mar 10, 2024
@shuding shuding deleted the build/change-export branch March 10, 2024 23:22
@huozhi huozhi added this to the v3 milestone Mar 10, 2024
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.

2 participants