shuding / yoga-wasm-web Goto Github PK
View Code? Open in Web Editor NEWWASM build of Yoga, targeting the web worker runtime.
License: MIT License
WASM build of Yoga, targeting the web worker runtime.
License: MIT License
hello there, thanks for the great module. we are trying to integrate this into a webpack build. webpack isn't particularly happy with this module's use of import.meta.url
-- it interprets this to be the location at build time, which, for webpack, is not going to be the same as the location at runtime.
have you given any thoughts to this problem? we tried a few things, such as import("./yoga.wasm")
, and thus relying on webpack 5's direct support for webpack modules. but this kind of change will require some deeper modifications...
thanks!
I'm trying to update ink to add gap
support. The project hasn't been maintained for a long time, and adding ESM support doesn't seem feasible at this stage
Would it be possible to add a CJS build?
If anyone needed a workaround, you can do this in the mean time
import type Yoga from 'yoga-wasm-web';
import fs from 'fs';
const source = fs
.readFileSync(require.resolve('yoga-wasm-web/asm'), 'utf-8')
.replace(/export\s*\{(\w+)\s*as\s*default\}/, 'module.exports.default = $1');
const init = new Function('module', source);
const targetExports: any = {};
init({exports: targetExports});
export default targetExports.default() as any as ReturnType<typeof Yoga>;
export type {Node} from 'yoga-wasm-web';
The types exported from index.d.ts
do not match what is actually in index.js
Can you help me to make it works.
I don't see why it requires the boilerplate. This package could simply do the following internally: https://github.com/vadimdemedes/ink/pull/550/files#diff-71628bd9ca8b59e4cfa0d8ae58caf4e8d5072d71a34be7517b7876b27c415dff
I should be able to do this and be done:
import Yoga from 'yoga-wasm-web';
For custom loading of WASM, there could be an alternative sub-export or something, but the main export should be the nicest one.
Filing this bug with an initial hunch of what I'm seeing. I'll fill in this issue with more information as I narrow this down.
Given the following JSX:
<img src="http://example.com/image.png?param=true" />
The ?param=true
isn't being passed along. It appears as though only http://example.com/image.png
is being requested.
This wasn't an issue until we started using the WASM build. Thus I'm filing the issue here, but do let me know if this is better suited in the Satori repo.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.