-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Migrate to emscripten #1177
Migrate to emscripten #1177
Conversation
@NickGerleman hello, I'm back The bindings are ready so let's discuss the migration and the next steps.
|
This is incredible! I will take a close look soon. I think it is okay to fully replace nbind. It has been a long time since folks used it for Node native module versions of Yoga compared to packages like yoga-layout-prebuilt, so it is better imo to have something working, compared to full parity. Re dev vs prod, I know Emscripten has options for what it emits (it will already minify), so I’m guessing the extra bits would be for the JavaScript frontend to it? If we can avoid the complexity, it might be better to distribute the package without running through another bundler, then the consuming project could bundle using the bundler they are already using. I’d love it if we could add GitHub Actions validation, but I know it isn’t present right now. There are some workflows I added recently that could be pattern matched, and it would document how we are running tests against this. The website build is currently using the last published version of yoga-layout instead of the one in the repo too, so we don’t get validation from the website build job (tried to move this to workspaces recently but the website setup needs some serious renovation to support it). |
I got the warning
do you have any idea why it is here and maybe it can be fixed |
I think this means the build isn’t picking up yoga/event/event.cpp. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm super grateful for this work. Given how the nbind version was long-term broken, we should be aggressive in taking improvements here.
If you don't mind, I'm going to try to push a commit to this PR adding the yarn test
script you wrote to GitHub workflows. The previous lack of coverage for bindings let a lot of bad code slip into them, so if we have a working test script, it would help to both protect the change and demonstrate it is working when I import it 🙂.
I pushed a couple of changes here:
|
Interesting. I'm not sure how representative these benchmarks are, but ~13ms for the "huge nested layout" was also what I was getting by using the I can't understand why "Align stretch in undefined axis" is so slow though. That only has 10 nodes (compared to 10,000 for the huge nested layout)! Admittedly it's not the same benchmark, but I was able to run a variant of the "huge nested layout" with depth of 1 instead of depth of 4 (so 10^1 = 10 rather than 10^4 = 10,000 nodes) in ~45 micro seconds. One thing I did notice when benchmarking |
I haven't tried to debug it to see if it is working as expected, but there is some mention in the script on skipping the first few iterations to avoid one-time costs, then averaging the rest. Some of the tests I can see like "Align stretch in undefined axis" add 2000 child nodes under the root node, so there still is a lot there. That 2000 node count is the same for other tests, but "huge nested layout" is triply nested of 6 children it looks like. |
@NickGerleman has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@NickGerleman merged this pull request in 1813748. |
Summary: Removes a couple config files from the last version of the JS bindings I accidentally left in facebook#1177. We can remove: 1. The .flowconfig because there isn't any more Flow 2. The .npmignore, because we use the package.json "files" field Differential Revision: D42265713 fbshipit-source-id: 426fde57545dc56bf0254a0a05375b90ffe3dda8
Summary: Pull Request resolved: #1197 Removes a couple config files from the last version of the JS bindings I accidentally left in #1177. We can remove: 1. The .flowconfig because there isn't any more Flow 2. The .npmignore, because we use the package.json "files" field Reviewed By: rshest Differential Revision: D42265713 fbshipit-source-id: 9911416d36136d89cf7360180901673181238abe
No description provided.