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

yoga-wasm-web@~0.3.3 can be replaced with officially published [email protected] #647

Open
erictheswift opened this issue Mar 6, 2024 · 0 comments

Comments

@erictheswift
Copy link

Hey!

Been using a patch that replaced yoga-wasm-web@~0.3.3 with official yoga-layout@2 package for a while.

Seems fb released v3 today that is essentially esm/wasm facebook/yoga#1559 (comment)

Bumped version - my scenarios still work. Feel free to evaluate it as replacement)

Here is the patch I use

diff --git a/node_modules/ink/build/dom.d.ts b/node_modules/ink/build/dom.d.ts
index c28c381..3e0ce25 100644
--- a/node_modules/ink/build/dom.d.ts
+++ b/node_modules/ink/build/dom.d.ts
-import { type Node as YogaNode } from 'yoga-wasm-web/auto';
+import { type Node as YogaNode } from 'yoga-layout';
 import { type Styles } from './styles.js';
 import { type OutputTransformer } from './render-node-to-output.js';
 type InkNode = {
diff --git a/node_modules/ink/build/dom.js b/node_modules/ink/build/dom.js
index c64a031..894b1c6 100644
--- a/node_modules/ink/build/dom.js
+++ b/node_modules/ink/build/dom.js
-// eslint-disable-next-line n/file-extension-in-import
-import Yoga from 'yoga-wasm-web/auto';
+import Yoga from 'yoga-layout';
 import measureText from './measure-text.js';
 import wrapText from './wrap-text.js';
 import squashTextNodes from './squash-text-nodes.js';
diff --git a/node_modules/ink/build/get-max-width.d.ts b/node_modules/ink/build/get-max-width.d.ts
index 373b6f8..caf50c1 100644
--- a/node_modules/ink/build/get-max-width.d.ts
+++ b/node_modules/ink/build/get-max-width.d.ts
-import { type Node as YogaNode } from 'yoga-wasm-web/auto';
+import { type Node as YogaNode } from 'yoga-layout';
 declare const getMaxWidth: (yogaNode: YogaNode) => number;
 export default getMaxWidth;
diff --git a/node_modules/ink/build/get-max-width.js b/node_modules/ink/build/get-max-width.js
index dc6a504..8a350d8 100644
--- a/node_modules/ink/build/get-max-width.js
+++ b/node_modules/ink/build/get-max-width.js
-// eslint-disable-next-line n/file-extension-in-import
-import Yoga from 'yoga-wasm-web/auto';
+import Yoga from 'yoga-layout';
diff --git a/node_modules/ink/build/ink.js b/node_modules/ink/build/ink.js
index ec11d33..1d0e8da 100644
--- a/node_modules/ink/build/ink.js
+++ b/node_modules/ink/build/ink.js
 import autoBind from 'auto-bind';
 import signalExit from 'signal-exit';
 import patchConsole from 'patch-console';
-// eslint-disable-next-line n/file-extension-in-import
-import Yoga from 'yoga-wasm-web/auto';
+import Yoga from 'yoga-layout';
 import reconciler from './reconciler.js';
diff --git a/node_modules/ink/build/reconciler.js b/node_modules/ink/build/reconciler.js
index a43c21d..cda8691 100644
--- a/node_modules/ink/build/reconciler.js
+++ b/node_modules/ink/build/reconciler.js
 import process from 'node:process';
 import createReconciler from 'react-reconciler';
 import { DefaultEventPriority } from 'react-reconciler/constants.js';
-// eslint-disable-next-line n/file-extension-in-import
-import Yoga from 'yoga-wasm-web/auto';
+import Yoga from 'yoga-layout';
diff --git a/node_modules/ink/build/render-node-to-output.js b/node_modules/ink/build/render-node-to-output.js
index 5c0fcf6..1035b5a 100644
--- a/node_modules/ink/build/render-node-to-output.js
+++ b/node_modules/ink/build/render-node-to-output.js
 import widestLine from 'widest-line';
 import indentString from 'indent-string';
-// eslint-disable-next-line n/file-extension-in-import
-import Yoga from 'yoga-wasm-web/auto';
+import Yoga from 'yoga-layout';
 import wrapText from './wrap-text.js';
 import getMaxWidth from './get-max-width.js';
 import squashTextNodes from './squash-text-nodes.js';
diff --git a/node_modules/ink/build/styles.d.ts b/node_modules/ink/build/styles.d.ts
index 28de00b..7fdbed1 100644
--- a/node_modules/ink/build/styles.d.ts
+++ b/node_modules/ink/build/styles.d.ts
 import { type Boxes, type BoxStyle } from 'cli-boxes';
 import { type LiteralUnion } from 'type-fest';
 import { type ForegroundColorName } from 'chalk';
-import { type Node as YogaNode } from 'yoga-wasm-web/auto';
+import { type Node as YogaNode } from 'yoga-layout';
diff --git a/node_modules/ink/build/styles.js b/node_modules/ink/build/styles.js
index 186db31..44ee12c 100644
--- a/node_modules/ink/build/styles.js
+++ b/node_modules/ink/build/styles.js
-// eslint-disable-next-line n/file-extension-in-import
-import Yoga from 'yoga-wasm-web/auto';
+import Yoga from 'yoga-layout';
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

No branches or pull requests

1 participant