{"action":"created","issue":{"url":"https://api.github.com/repos/kripken/sql.js/issues/255","repository_url":"https://api.github.com/repos/kripken/sql.js","labels_url":"https://api.github.com/repos/kripken/sql.js/issues/255/labels{/name}","comments_url":"https://api.github.com/repos/kripken/sql.js/issues/255/comments","events_url":"https://api.github.com/repos/kripken/sql.js/issues/255/events","html_url":"https://github.com/kripken/sql.js/pull/255","id":376656625,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI3ODIxNjk4","number":255,"title":"Compile sql.js to wasm instead of \"just\" asm.js","user":{"login":"Taytay","id":1330693,"node_id":"MDQ6VXNlcjEzMzA2OTM=","avatar_url":"https://avatars3.githubusercontent.com/u/1330693?v=4","gravatar_id":"","url":"https://api.github.com/users/Taytay","html_url":"https://github.com/Taytay","followers_url":"https://api.github.com/users/Taytay/followers","following_url":"https://api.github.com/users/Taytay/following{/other_user}","gists_url":"https://api.github.com/users/Taytay/gists{/gist_id}","starred_url":"https://api.github.com/users/Taytay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Taytay/subscriptions","organizations_url":"https://api.github.com/users/Taytay/orgs","repos_url":"https://api.github.com/users/Taytay/repos","events_url":"https://api.github.com/users/Taytay/events{/privacy}","received_events_url":"https://api.github.com/users/Taytay/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2018-11-02T03:30:42Z","updated_at":"2018-12-22T11:11:04Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/kripken/sql.js/pulls/255","html_url":"https://github.com/kripken/sql.js/pull/255","diff_url":"https://github.com/kripken/sql.js/pull/255.diff","patch_url":"https://github.com/kripken/sql.js/pull/255.patch"},"body":"Fixes https://github.com/kripken/sql.js/issues/219\r\n\r\n@kripken : I wasn't sure what the best approach here was, so consider this a work in progress.\r\nI now emit both WASM and non-WASM targets when compiling.\r\nHowever, that results in quite a few targets:\r\nsql\r\nsql-debug\r\nsql-wasm\r\nsql-wasm-debug\r\nsql-worker\r\nsql-worker-debug\r\n\r\nI wanted to use the built-in modularize code, but I ran into some of the issues spelled out in https://github.com/kripken/emscripten/issues/5820, so I have continued the sql.js tradition of modularizing it manually via pre and post files. I now create a new `ready` property on the Module that is a proper promise. This promise can be waited for with either a WASM or non-WASM implementation.\r\n\r\nThese changes required to allow the module to be loaded in either synchronous (non-WASM) or async (WASM) fashion have been isolated in another branch: https://github.com/Taytay/sql.js/tree/fix/async_loading\r\n\r\nSince I made some more fundamental changes to how the module is loaded, and since this project now emits so many targets, I am not sure if it would be better to fork sql.js? (It is quite possible that the asm.js (sql.js) I am emitting is no longer drop-in compatible with previous versions due to some of the modularization and async code I added.) I still need to run more tests with sql.js in the browser to know more.\r\n\r\nI also ran into a bug involving the creation of the sql-optimized file, so I restructured the Makefile a fair amount. It's not as DRY/fancy now, but it was easier to fix the issue. I think some further improvements could be made to the build infrastructure like there are in https://github.com/mandel59/sqlite-wasm\r\n\r\nIt's worth mentioning that the worker test running in the node environment does not work with the latest version of emcc. In particular, the preamble detects that it's running in the worker environment rather than node, and a few things begin to fail. So, I've essentially skipped that test for now. \r\n\r\nI also intend to clean up other minor things in the async branch (unrelated to WASM), like the `stringToUTF8` issue (https://github.com/kripken/sql.js/issues/251), but that's for another day.\r\n\r\nI look forward to hearing your thoughts.\r\n\r\nTODOs:\r\n\r\n- [ ] Ensure that the mechanism for loading the module asynchronously works well in the browser\r\n- [ ] Update the readme for browser and Node usage\r\n- [ ] Add myself to AUTHORS\r\n- [ ] Bump major version\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/kripken/sql.js/issues/comments/449562958","html_url":"https://github.com/kripken/sql.js/pull/255#issuecomment-449562958","issue_url":"https://api.github.com/repos/kripken/sql.js/issues/255","id":449562958,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0OTU2Mjk1OA==","user":{"login":"lovasoa","id":552629,"node_id":"MDQ6VXNlcjU1MjYyOQ==","avatar_url":"https://avatars1.githubusercontent.com/u/552629?v=4","gravatar_id":"","url":"https://api.github.com/users/lovasoa","html_url":"https://github.com/lovasoa","followers_url":"https://api.github.com/users/lovasoa/followers","following_url":"https://api.github.com/users/lovasoa/following{/other_user}","gists_url":"https://api.github.com/users/lovasoa/gists{/gist_id}","starred_url":"https://api.github.com/users/lovasoa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lovasoa/subscriptions","organizations_url":"https://api.github.com/users/lovasoa/orgs","repos_url":"https://api.github.com/users/lovasoa/repos","events_url":"https://api.github.com/users/lovasoa/events{/privacy}","received_events_url":"https://api.github.com/users/lovasoa/received_events","type":"User","site_admin":false},"created_at":"2018-12-22T11:11:04Z","updated_at":"2018-12-22T11:11:04Z","author_association":"COLLABORATOR","body":"@Taytay : when do you think you can finish that ?"}}
{"actor":{"display_login":"lovasoa"}}