diff --git a/Makefile b/Makefile index 287de6fd..89a42ed0 100644 --- a/Makefile +++ b/Makefile @@ -40,11 +40,9 @@ EMFLAGS = \ -s NODEJS_CATCH_REJECTION=0 EMFLAGS_ASM = \ - -s WASM=0 - -EMFLAGS_ASM_MEMORY_GROWTH = \ -s WASM=0 \ - -s ALLOW_MEMORY_GROWTH=1 + -s ALLOW_MEMORY_GROWTH=1 \ + -s LEGACY_VM_SUPPORT=1 EMFLAGS_WASM = \ -s WASM=1 \ @@ -90,7 +88,7 @@ dist/sql-wasm-debug.js: $(BITCODE_FILES) $(OUTPUT_WRAPPER_FILES) $(SOURCE_API_FI rm out/tmp-raw.js .PHONY: optimized -optimized: dist/sql-asm.js dist/sql-wasm.js dist/sql-asm-memory-growth.js +optimized: dist/sql-asm.js dist/sql-wasm.js dist/sql-asm.js: $(BITCODE_FILES) $(OUTPUT_WRAPPER_FILES) $(SOURCE_API_FILES) $(EXPORTED_METHODS_JSON_FILES) $(EMCC) $(EMFLAGS) $(EMFLAGS_OPTIMIZED) $(EMFLAGS_ASM) $(BITCODE_FILES) $(EMFLAGS_PRE_JS_FILES) -o $@ @@ -103,12 +101,9 @@ dist/sql-wasm.js: $(BITCODE_FILES) $(OUTPUT_WRAPPER_FILES) $(SOURCE_API_FILES) $ mv $@ out/tmp-raw.js cat src/shell-pre.js out/tmp-raw.js src/shell-post.js > $@ rm out/tmp-raw.js - -dist/sql-asm-memory-growth.js: $(BITCODE_FILES) $(OUTPUT_WRAPPER_FILES) $(SOURCE_API_FILES) $(EXPORTED_METHODS_JSON_FILES) - $(EMCC) $(EMFLAGS) $(EMFLAGS_OPTIMIZED) $(EMFLAGS_ASM_MEMORY_GROWTH) $(BITCODE_FILES) $(EMFLAGS_PRE_JS_FILES) -o $@ - mv $@ out/tmp-raw.js - cat src/shell-pre.js out/tmp-raw.js src/shell-post.js > $@ - rm out/tmp-raw.js + # TODO - remove code below in future releases to sunset sql-asm-memory-growth.js + printf 'console.error(\n "\\n\\nDEPRECATION WARNING.\\n"\n + "sql-asm-memory-growth.js will be removed in future releases.\\n"\n + "Use sql-asm.js instead, which now includes memory-growth support.\\n\\n"\n);\n' > dist/sql-asm-memory-growth.js + cat $@ >> dist/sql-asm-memory-growth.js # Web worker API .PHONY: worker diff --git a/README.md b/README.md index 8ce3066b..f74b9d48 100644 --- a/README.md +++ b/README.md @@ -276,8 +276,8 @@ You can always find the latest published artifacts on https://github.com/sql-js/ For each [release](https://github.com/sql-js/sql.js/releases/), you will find a file called `sqljs.zip` in the *release assets*. It will contain: - `sql-wasm.js` : The Web Assembly version of Sql.js. Minified and suitable for production. Use this. If you use this, you will need to include/ship `sql-wasm.wasm` as well. - `sql-wasm-debug.js` : The Web Assembly, Debug version of Sql.js. Larger, with assertions turned on. Useful for local development. You will need to include/ship `sql-wasm-debug.wasm` if you use this. - - `sql-asm.js` : The older asm.js version of Sql.js. Slower and larger. Provided for compatibility reasons. - - `sql-asm-memory-growth.js` : Asm.js doesn't allow for memory to grow by default, because it is slower and de-optimizes. If you are using sql-asm.js and you see this error (`Cannot enlarge memory arrays`), use this file. + - `sql-asm.js` : The older asm.js version of Sql.js. Slower and larger. Provided for compatibility reasons. Includes memory-growth and IE 11 compatibility. + - `sql-asm-memory-growth.js` : DEPRECATED and will be removed in future releases. Use sql-asm.js instead, which now includes memory-growth support. - `sql-asm-debug.js` : The _Debug_ asm.js version of Sql.js. Use this for local development. - `worker.*` - Web Worker versions of the above libraries. More limited API. See [examples/GUI/gui.js](examples/GUI/gui.js) for a good example of this. diff --git a/examples/requireJS.html b/examples/requireJS.html index bc1f6b2b..c97e8900 100644 --- a/examples/requireJS.html +++ b/examples/requireJS.html @@ -8,7 +8,7 @@ baseUrl: baseUrl }); - // Options: 'sql-wasm', 'sql-asm', 'sql-asm-memory-growth.js', 'sql-wasm-debug', 'sql-asm-debug' + // Options: 'sql-wasm', 'sql-asm', 'sql-wasm-debug', 'sql-asm-debug' require(['sql-wasm'], function success(initSqlJs) { console.log(typeof initSqlJs); diff --git a/package.json b/package.json index de41e1fc..2358c41e 100644 --- a/package.json +++ b/package.json @@ -21,12 +21,11 @@ "scripts": { "build": "make", "rebuild": "make clean && make", - "test": "npm run lint && npm run test-asm && npm run test-asm-debug && npm run test-wasm && npm run test-wasm-debug && npm run test-asm-memory-growth", + "test": "npm run lint && npm run test-asm && npm run test-asm-debug && npm run test-wasm && npm run test-wasm-debug", "lint": "eslint .", "prettify": "eslint . --fix", "test-asm": "node test/all.js asm", "test-asm-debug": "node test/all.js asm-debug", - "test-asm-memory-growth": "node test/all.js asm-memory-growth", "test-wasm": "node test/all.js wasm", "test-wasm-debug": "node test/all.js wasm-debug", "doc": "jsdoc -c .jsdoc.config.json" diff --git a/test/test_worker.js b/test/test_worker.js index 5e37f91d..76fcb3e6 100644 --- a/test/test_worker.js +++ b/test/test_worker.js @@ -36,7 +36,7 @@ class Worker { exports.test = async function test(SQL, assert) { var target = process.argv[2]; var file = target ? "sql-" + target : "sql-wasm"; - if (file.indexOf('wasm') > -1 || file.indexOf('memory-growth') > -1) { + if (file.indexOf('wasm') > -1) { console.error("Skipping worker test for " + file + ". Not implemented yet"); return; };