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(use-files): make files reference more stable #760

Merged
merged 26 commits into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"packages": ["sandpack-client", "sandpack-react"],
"sandboxes": ["sowx8r"],
"sandboxes": ["sowx8r", "909l3f"],
"node": "16"
}
3 changes: 1 addition & 2 deletions sandpack-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,10 @@
],
"dependencies": {
"@codesandbox/nodebox": "0.1.0",
"lodash.isequal": "^4.5.0",
"dequal": "^2.0.2",
"outvariant": "1.3.0"
},
"devDependencies": {
"@types/lodash.isequal": "^4.5.2",
"@types/node": "^9.3.0",
"console-feed": "3.3.0",
"del": "^6.0.0",
Expand Down
4 changes: 2 additions & 2 deletions sandpack-client/src/clients/base.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import isEqual from "lodash.isequal";
import { dequal as deepEqual } from "dequal";

import type {
ClientOptions,
Expand Down Expand Up @@ -35,7 +35,7 @@ export class SandpackClient {
* Clients handles
*/
public updateOptions(options: ClientOptions): void {
if (!isEqual(this.options, options)) {
if (!deepEqual(this.options, options)) {
this.options = options;
this.updateSandbox();
}
Expand Down
4 changes: 2 additions & 2 deletions sandpack-client/src/clients/runtime/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import isEqual from "lodash.isequal";
import { dequal as deepEqual } from "dequal";

import type { SandpackMessage } from "../..";
import { nullthrows } from "../..";
Expand Down Expand Up @@ -163,7 +163,7 @@ export class SandpackRuntime extends SandpackClient {
}

updateOptions(options: ClientOptions): void {
if (!isEqual(this.options, options)) {
if (!deepEqual(this.options, options)) {
this.options = options;
this.updateSandbox();
}
Expand Down
4 changes: 2 additions & 2 deletions sandpack-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"README.md"
],
"dependencies": {
"use-deep-compare-effect": "1.8.1",
"@code-hike/classer": "^0.0.0-aa6efee",
"@codemirror/autocomplete": "^6.4.0",
"@codemirror/commands": "^6.1.3",
Expand All @@ -51,7 +52,7 @@
"ansi-to-react": "6.1.6",
"clean-set": "^1.1.2",
"codesandbox-import-util-types": "^2.2.3",
"lodash.isequal": "^4.5.0",
"dequal": "^2.0.2",
"lz-string": "^1.4.4",
"react-devtools-inline": "4.4.0",
"react-is": "^17.0.2"
Expand All @@ -66,7 +67,6 @@
"@testing-library/react-hooks": "8.0.1",
"@types/fs-extra": "^5.0.4",
"@types/glob": "^5.0.35",
"@types/lodash.isequal": "^4.5.2",
"@types/lz-string": "^1.3.34",
"@types/node": "^9.4.6",
"@types/react": "^18.0.15",
Expand Down
Loading