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

Making stretch-layout importable via ES Module CDN #103

Open
trusktr opened this issue Sep 18, 2022 · 1 comment
Open

Making stretch-layout importable via ES Module CDN #103

trusktr opened this issue Sep 18, 2022 · 1 comment

Comments

@trusktr
Copy link

trusktr commented Sep 18, 2022

This is possible with Yoga:

<script type="module">
	import yoga from 'https://jspm.dev/yoga-layout'

	// use yoga.Node, etc.
</script>

Need to investigate how they do it. The import * as wasm from './file.wasm' won't work because it is designed for someone to import using a build tool like Webpack.

Looks like they compile the Wasm to JavaScript for this use case: https://unpkg.com/browse/[email protected]/build/Release/nbind.js

Looks like perhaps a combination of https://github.com/charto/nbind and emscripten with asm.js output.

@jordan-schnur
Copy link

jordan-schnur commented Oct 10, 2022

@trusktr nbind seems to have been abandoned for some time and doesn't work natively with the current node LTS. I have also been looking for a way around this issue. I'd be interested to learn if you found anything.

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

2 participants