Fixup TypeScript with export maps (#1284)
Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/1284 This makes TypeScript resolution play nicely with export maps, and converts the entrypoints to TypeScript. We remove the non-export-map fallbacks as well, so the export maps are always followed. Tests are moved to load yoga from its external export, testing the entrypoints. This moves the only untyped bit to the binary wrapper, which another diff will move. Reviewed By: yungsters Differential Revision: D45713689 fbshipit-source-id: 228e6f2c9d53520230707a81e76c3c35fcd46de5
This commit is contained in:
committed by
Facebook GitHub Bot
parent
104646d8ca
commit
af89315fd4
@@ -9,13 +9,13 @@
|
||||
|
||||
module.exports = async () => {
|
||||
if (process.env['SYNC'] === '1' && process.env['WASM'] === '1') {
|
||||
globalThis.Yoga = require('./dist/entrypoint/wasm-sync');
|
||||
globalThis.Yoga = require('yoga-layout/wasm-sync').default;
|
||||
} else if (process.env['SYNC'] === '1') {
|
||||
globalThis.Yoga = require('./dist/entrypoint/asmjs-sync');
|
||||
globalThis.Yoga = require('yoga-layout/asmjs-sync').default;
|
||||
} else if (process.env['WASM'] === '1') {
|
||||
globalThis.Yoga = await require('./dist/entrypoint/wasm-async').loadYoga();
|
||||
globalThis.Yoga = await require('yoga-layout/wasm-async').loadYoga();
|
||||
} else {
|
||||
globalThis.Yoga = await require('./dist/entrypoint/asmjs-async').loadYoga();
|
||||
globalThis.Yoga = await require('yoga-layout/asmjs-async').loadYoga();
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user