forked from sql-js/sql.js
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Wasm - Creating a PR in my branch of SQL.js #2
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If we compile without WASM, loading it's synchronous. If we compile with WASM on, loading is async. But we need a mechanism we can rely upon to tell us when the loading is complete, regardless of the underlying loading code. So, we now have a "ready" promise that we can listen for on the exported module. Also
This allows for `npm run test debug` to work and makes it easier to debug the worker.
Make the worker implementation respect the fact that the loading might be async Switch to tiny-worker because it is more actively maintained
There was an error in the way the optimized file was being made that caused certain parameters not to be passed to emcc. This new file isn't as DRY, but it is a bit easier to grok and debug
… worker emulation
(All tests pass) Adding .wasm files
"zero-three" does nothing. "Oh-three" is a valid option. This meant that our optimized output files were _way_ too big.
…s compiled scripts
* fix/async_loading: Add extra test scripts to make it more obvious how to test the various compiled scripts Replace invalid "-03" option with "-O3" As part of the merge, I am removing the new test-memory-growth and am recompiling with the new -O3 setting in the makefile. # Conflicts: # Makefile # js/sql-memory-growth.js # js/sql.js # js/worker.sql.js
No more "*-raw.wasm" files. They were somewhat confusing since sql.js loaded sql-raw.wasm rather than simply sql.wasm. The optimized build now runs closure on the sql.js loader. (The pre and post wrappers don't have closure applied).
This results in quite a few output files, and could likely be cleaned up
Use allocateUTF8StringOnStack instead
* fix/async_loading: Commit the latest compiled assets Don't use writeStringToMemory
(It doesn't due to the bug in node/worker detection though)
* fix/async_loading: Adding the load_sql_file.js that the tests depend upon The worker test would theoretically work if run by itself The test files now work correctly if run individually
Also: Add additional package.json scripts
I am purposefully not checking in the compiled assets just yet until this stabilizes
sql.js -> sql-asm.js sql-debug.js -> sql-asm-debug.js test/load_sql_file -> test/load_sql_lib More renames are to follow.
Commit other test files that use new `load_sql_lib` instead of old `load_sql_file`
More renames to come. This avoids mixing src and compiled assets
The old folder naming scheme was by language type (c, coffee, js, etc). This led to some confusion for those working on the project, since output files were not readily distinguishable from src/input files. The new folders are as follows: dist/* : Compiled assets used by end users (currently checked into git) out/* : Intermediate compiled assets generated while creating files in dist/* - Not checked into git src/* : Source files (coffee, js, etc) sqlite/* : Source files for sqlite.
Add a test to ensure that the modularization works correctly. Since we are doing our own modularization rather than relying upon emcc, we have to do a workaround to undo its attempts at exporting the SqlJs Module.
I took many of these examples from the gh-pages branch. These examples are useful even outside of a Github Pages context, so I wanted to include them here. This makes it easier for the README to reference them. Since they are now in the main branch, I have taken care to point to CDN libraries where I could so that it doesn't get cluttered with vendor code, like for the codemirror library.
Explain how to upgrade. Explain how to distribute wasm files. Update sample code.
Fixes kripken/sql.js/sql-js#173 Fixes kripken/sql.js/sql-js#262
…apper This is slow and somewhat error prone since it results in recompiling the .wasm files, so I am leaving it out for now. Also including some unused changes to test-worker.js that I added when trying to get that test running again.
Download sqlite on demand when building. Remove old unused static sqlite source files. No longer use keyword "nothing" in examples or tests because it leads to a SQL error. (NOTHING is now a reserved word in Sqlite)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This will help me see more easily what I've changed in #1