Separate Node and Web Binaries (#1325)
Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/1325 Fixes https://github.com/facebook/yoga/issues/1321 Reviewed By: cortinico Differential Revision: D47368830 fbshipit-source-id: 570a45ad7fd182ef82e6edda4037ae2f6faa0c75
This commit is contained in:
committed by
Nick Gerleman
parent
edf91b245d
commit
6628873c2a
26
javascript/src/entrypoint/asmjs-async-node.ts
Normal file
26
javascript/src/entrypoint/asmjs-async-node.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
import wrapAssembly from '../wrapAssembly';
|
||||
import type {Yoga} from '../wrapAssembly';
|
||||
|
||||
export * from '../generated/YGEnums';
|
||||
export type {
|
||||
Config,
|
||||
DirtiedFunction,
|
||||
MeasureFunction,
|
||||
Node,
|
||||
Yoga,
|
||||
} from '../wrapAssembly';
|
||||
|
||||
const loadAssembly = require('../../binaries/asmjs-async-node');
|
||||
|
||||
export async function loadYoga(): Promise<Yoga> {
|
||||
return wrapAssembly(await loadAssembly());
|
||||
}
|
@@ -19,7 +19,7 @@ export type {
|
||||
Yoga,
|
||||
} from '../wrapAssembly';
|
||||
|
||||
const loadAssembly = require('../../binaries/wasm-async');
|
||||
const loadAssembly = require('../../binaries/asmjs-async-web');
|
||||
|
||||
export async function loadYoga(): Promise<Yoga> {
|
||||
return wrapAssembly(await loadAssembly());
|
23
javascript/src/entrypoint/asmjs-sync-node.ts
Normal file
23
javascript/src/entrypoint/asmjs-sync-node.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
import wrapAssembly from '../wrapAssembly';
|
||||
|
||||
export * from '../generated/YGEnums';
|
||||
export type {
|
||||
Config,
|
||||
DirtiedFunction,
|
||||
MeasureFunction,
|
||||
Node,
|
||||
Yoga,
|
||||
} from '../wrapAssembly';
|
||||
|
||||
const loadAssembly = require('../../binaries/asmjs-sync-node');
|
||||
const Yoga = wrapAssembly(loadAssembly());
|
||||
export default Yoga;
|
@@ -18,6 +18,6 @@ export type {
|
||||
Yoga,
|
||||
} from '../wrapAssembly';
|
||||
|
||||
const loadAssembly = require('../../binaries/wasm-sync');
|
||||
const loadAssembly = require('../../binaries/asmjs-sync-web');
|
||||
const Yoga = wrapAssembly(loadAssembly());
|
||||
export default Yoga;
|
26
javascript/src/entrypoint/wasm-async-node.ts
Normal file
26
javascript/src/entrypoint/wasm-async-node.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
import wrapAssembly from '../wrapAssembly';
|
||||
import type {Yoga} from '../wrapAssembly';
|
||||
|
||||
export * from '../generated/YGEnums';
|
||||
export type {
|
||||
Config,
|
||||
DirtiedFunction,
|
||||
MeasureFunction,
|
||||
Node,
|
||||
Yoga,
|
||||
} from '../wrapAssembly';
|
||||
|
||||
const loadAssembly = require('../../binaries/wasm-async-node');
|
||||
|
||||
export async function loadYoga(): Promise<Yoga> {
|
||||
return wrapAssembly(await loadAssembly());
|
||||
}
|
@@ -19,7 +19,7 @@ export type {
|
||||
Yoga,
|
||||
} from '../wrapAssembly';
|
||||
|
||||
const loadAssembly = require('../../binaries/asmjs-async');
|
||||
const loadAssembly = require('../../binaries/wasm-async-web');
|
||||
|
||||
export async function loadYoga(): Promise<Yoga> {
|
||||
return wrapAssembly(await loadAssembly());
|
23
javascript/src/entrypoint/wasm-sync-node.ts
Normal file
23
javascript/src/entrypoint/wasm-sync-node.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
import wrapAssembly from '../wrapAssembly';
|
||||
|
||||
export * from '../generated/YGEnums';
|
||||
export type {
|
||||
Config,
|
||||
DirtiedFunction,
|
||||
MeasureFunction,
|
||||
Node,
|
||||
Yoga,
|
||||
} from '../wrapAssembly';
|
||||
|
||||
const loadAssembly = require('../../binaries/wasm-sync-node');
|
||||
const Yoga = wrapAssembly(loadAssembly());
|
||||
export default Yoga;
|
@@ -18,6 +18,6 @@ export type {
|
||||
Yoga,
|
||||
} from '../wrapAssembly';
|
||||
|
||||
const loadAssembly = require('../../binaries/asmjs-sync');
|
||||
const loadAssembly = require('../../binaries/wasm-sync-web');
|
||||
const Yoga = wrapAssembly(loadAssembly());
|
||||
export default Yoga;
|
Reference in New Issue
Block a user