Move to 4 flavor build and tests
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
|
||||
const CONSTANTS = require('./YGEnums');
|
||||
import type {
|
||||
Yoga$Edge,
|
||||
@@ -238,7 +237,7 @@ type Yoga = {
|
||||
...typeof CONSTANTS,
|
||||
};
|
||||
|
||||
function wrapLib(lib: any): Yoga {
|
||||
module.exports = function wrapLib(lib: any): Yoga {
|
||||
function patch(prototype, name, fn) {
|
||||
let original = prototype[name];
|
||||
|
||||
@@ -378,7 +377,3 @@ function wrapLib(lib: any): Yoga {
|
||||
...CONSTANTS,
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = (libPromise: any) => ({
|
||||
initialize: () => libPromise.then(wrapLib)
|
||||
}: YogaConstructor);
|
||||
|
21
javascript/sources/index.asmjs.js
Normal file
21
javascript/sources/index.asmjs.js
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @flow
|
||||
* @format
|
||||
*/
|
||||
|
||||
const wrapLib = require('./entry');
|
||||
const loadYoga = require('./asmjs-async');
|
||||
|
||||
module.exports = {
|
||||
load: () => {
|
||||
return loadYoga().then(wrapLib);
|
||||
}
|
||||
}
|
||||
|
||||
export type * from './YGEnums.js';
|
||||
export type * from './entry';
|
@@ -8,10 +8,14 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
const entry = require('./entry');
|
||||
const yoga = require('./wasm');
|
||||
const wrapLib = require('./entry');
|
||||
const loadYoga = require('./wasm-async');
|
||||
|
||||
module.exports = entry(yoga());
|
||||
module.exports = {
|
||||
load: () => {
|
||||
return loadYoga().then(wrapLib);
|
||||
}
|
||||
}
|
||||
|
||||
export type * from './YGEnums.js';
|
||||
export type * from './entry';
|
||||
|
17
javascript/sources/sync.asmjs.js
Normal file
17
javascript/sources/sync.asmjs.js
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @flow
|
||||
* @format
|
||||
*/
|
||||
|
||||
const wrapLib = require('./entry');
|
||||
const loadYoga = require('./asmjs-sync');
|
||||
|
||||
module.exports = wrapLib(loadYoga());
|
||||
|
||||
export type * from './YGEnums.js';
|
||||
export type * from './entry';
|
@@ -8,10 +8,10 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
const entry = require('./entry');
|
||||
const yoga = require('./asm');
|
||||
const wrapLib = require('./entry');
|
||||
const loadYoga = require('./wasm-sync');
|
||||
|
||||
module.exports = entry(yoga());
|
||||
module.exports = wrapLib(loadYoga());
|
||||
|
||||
export type * from './YGEnums.js';
|
||||
export type * from './entry';
|
Reference in New Issue
Block a user