Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #3030 and run relateive test in edge-runtime #3036

Merged
merged 3 commits into from
Nov 25, 2024
Merged

fix #3030 and run relateive test in edge-runtime #3036

merged 3 commits into from
Nov 25, 2024

Conversation

promer94
Copy link
Collaborator

@promer94 promer94 commented Nov 5, 2024

This pr intends to fix the inconsistent behavoir of swr's hash in edge-runtime dev mode.

The reason for this problem is because we're using node.js to simulate the edge-runtime for local development

The global Array and Object of edge-runtime are injected from node.js and the JS engine does not use global Array/Object constructor while building an array/object literal.

Then in dev mode

[].constructor !== Array.constructor
{}.construrtor !== Object.contructor

So we need find alternative to determine whether a key is an array or a plain object

Copy link

codesandbox-ci bot commented Nov 5, 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.

Copy link

socket-security bot commented Nov 5, 2024

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

Package New capabilities Transitives Size Publisher
npm/@edge-runtime/jest-environment@3.0.4 Transitive: environment, eval, unsafe +51 2.18 MB kikobeats

View full report↗︎

@promer94 promer94 requested a review from koba04 November 7, 2024 07:03
Copy link
Member

@huozhi huozhi left a comment

Choose a reason for hiding this comment

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

Can you add a PR description and some comments about the change in hash? It's important for others to understand the approach and grab the context when they read the code later unless directly by reading the code

Co-authored-by: Toru Kobayashi <koba0004@gmail.com>
@promer94 promer94 requested review from koba04 and huozhi November 25, 2024 07:41
@huozhi huozhi merged commit bd839a4 into main Nov 25, 2024
7 checks passed
@huozhi huozhi deleted the fix-3030 branch November 25, 2024 10:51
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.

3 participants