-
Notifications
You must be signed in to change notification settings - Fork 30
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
Emoji support 🎉 and other updates #10
Conversation
Upgraded to the lastest JQ version Changes from -03 to -02 because emscripten wasn't making properly
We were having issues where JQ would crash if given JSON containing emojis. This PR contains updated encoding and decoding logic to support emojis and Unicode. It also updates the Makefile, pre, and post scripts to work with the lastest emscripten version 1.38.12 as well as support for JS modules.
* Changed from MODULARIZE_INSTANCE to MODULARIZE so that we can pass in module functions like locateFile to support webpack * Changed the way Module is handled in pre.js to allow functions to be passed in
* Added section on importing in Webpack * Expanded on Build and Test sections * Noted API changes
Updated README
Great changes, thank you! I'll do a quick test tomorrow and then merge this. |
The Why do you need that? Is it related to the way the wasm file is loaded? |
I can change the module name back to It would be great to get this all working with the Also is there any way I can help with your additional testing? I don't want to waste any of your time if I still have more work to do on this. Thus far I've only been using |
Currently the API doesn't require a constructor, there's a global / exported module that has the functions I'm not sure about how it is supposed to work now. My test is just loading If you want to help with tests perhaps you could implement a better way of doing tests in the browser, it could be with a headless browser or those test runners that run whenever you open the test.html -- I think But first we must do something about this API, I didn't find good documentation on how |
Awesome, thanks for the detailed response. I’ll get back with fixes in the next couple days. I would definitely like to get tape working with browser tests so that moving forward the test suite represents all the functionality we want. I agree that it’s annoying that the module now requires setting the constructor so I’m going to get it back to the way it behaved before and then figure out passing arguments to emscripten |
Removed need to create instance of module Added web_test.html for verify it works in the browser
Just pushed an update!
I think this addresses all of the points you made in your previous comment. Let me know if there is anything else that needs to be fixed :) |
Modified based on most recent update
Should we remove the |
Do you understand why the |
I was thinking about using something like the |
We should remove the
I'll put up another PR later today with fixes |
I think it will work if you define i've removed the I've also checked if you had removed code from the Makefile, but it seems you didn't. The problem is that everything seems to be working without the memfile so I'm confused. |
The .mem file is for It might make sense to change |
It used to be:
|
Oh, you've found the explanation! I don't know if we should change the defaults here, defaults are confusing (as we've just discovered), I think I'll make everything explicit, |
Features
toByteArray
andfromByteArray
to have more general support for Unicode including emojisMODULARIZE
flag to MakefilelocateFile
for Webpack supportpre.js
andpost.js
to work withMODULARIZE
API changes
jq(<object>, <filter>)
tojq.json(<object>, <filter>)
jq.promised(<object>, <filter>)
tojq.promised.json(<object>, <filter>)
Tests
jq.promised.*
testsREADME
.wasm
to load properly in Webpack