Skip to content

Commit

Permalink
fix(use-files): make files reference more stable (#760)
Browse files Browse the repository at this point in the history
  • Loading branch information
danilowoz authored Feb 24, 2023
1 parent 721ad28 commit 32ab419
Show file tree
Hide file tree
Showing 11 changed files with 125 additions and 469 deletions.
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

1 comment on commit 32ab419

@vercel
Copy link

@vercel vercel bot commented on 32ab419 Feb 24, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

sandpack-docs – ./website/docs

sandpack-docs-codesandbox1.vercel.app
sandpack-docs-git-main-codesandbox1.vercel.app
sandpack.vercel.app

Please sign in to comment.