Skip to content
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

Switching Vireo to Wasm from asm.js #512

Merged
merged 31 commits into from
Sep 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
183ebda
Bump compiler version and notes
rajsite Sep 10, 2018
5238232
Add rollup dev dependency
rajsite Sep 10, 2018
c92cab9
Proof of concept es6 modules and async load
rajsite Sep 11, 2018
694a267
Get WASM test running
rajsite Sep 11, 2018
4c486d1
Avoid minifying the vireo.js module
rajsite Sep 11, 2018
3f88ff3
Switch to wasm32-unknown-emscripten triple
rajsite Sep 12, 2018
fab357f
Test node.js execution and promisify executeSlicesUntilClumpsFinished
rajsite Sep 12, 2018
87672cf
Preserve wrapper behavior
rajsite Sep 12, 2018
6df6230
Enable vtr tests for node.js
rajsite Sep 12, 2018
59f0ae7
Rename to vireoHelpers.createInstance
rajsite Sep 12, 2018
ce70614
Update JS tests to use vireoHelpers.createInstance asynchronously
rajsite Sep 13, 2018
63fe6ed
Clean-up references to legacy browsers
rajsite Sep 13, 2018
11aee61
Enable release, profile, and debug builds of vireo.js
rajsite Sep 13, 2018
888c4dd
Enable BINARYEN_TRAP_MODE=js to get tests to pass
rajsite Sep 14, 2018
9a7bb5d
Pass empty array into UnflattenFromJSON for test
rajsite Sep 15, 2018
3d53443
Run make vjs on appveyor directory
rajsite Sep 15, 2018
17cbe4b
Minified build and test
rajsite Sep 17, 2018
92bec71
Switch to Firefox Headless for test coverage
rajsite Sep 17, 2018
1bd60a1
Switch to named AMD module
rajsite Sep 18, 2018
3f0a3d5
Add check for configuration object
rajsite Sep 19, 2018
c6de16a
Change executeSlicesUntilClumpsFinished to always return Promise
rajsite Sep 19, 2018
2e30854
Update the manual tests for JS loading
rajsite Sep 20, 2018
cab87a1
Don't add extra js test runs
rajsite Sep 20, 2018
1c47c8d
Remove unnecessary math comments
rajsite Sep 21, 2018
cf8346e
Clean-up karma files config
rajsite Sep 21, 2018
e620da3
Explicitly enable memory growth for WASM builds
rajsite Sep 25, 2018
8f80375
Update ManualLoaderTests to use async await
rajsite Sep 25, 2018
2e6b497
Add terminating newline to file
rajsite Sep 25, 2018
3829c03
Update test name for new behavior when using callbacks
rajsite Sep 25, 2018
de05513
findValueRef and findSubValueRef return undefined for nonexistent path
rajsite Sep 26, 2018
64de1ca
Enable the asmjs build using the new module system
rajsite Sep 26, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ install:
- pip install tox
- ps: Start-Process npm "run httpbin" -PassThru
- git clone https://github.com/juj/emsdk.git
- cd emsdk && git checkout 2da530aa5e6d6bcaf994ed1b2613a98872a428c8 && cd ..
- ps: emsdk\emsdk install sdk-1.37.36-64bit
- ps: emsdk\emsdk activate sdk-1.37.36-64bit
- cd emsdk && git checkout 0d8576c0e8f5ee09a36120b9d44184b5da2f2e7a && cd ..
- ps: emsdk\emsdk install sdk-1.38.12-64bit
- ps: emsdk\emsdk activate sdk-1.38.12-64bit
platform:
- Win32
configuration:
Expand All @@ -32,15 +32,14 @@ before_build:
build:
project: Vireo_VS/VireoCommandLine.sln
after_build:
- cmd /c make-it\appveyor-support\setup-env-and-make-vjs.bat
- make vjs
- ps: $env:package_version = (Get-Content -Raw -Path package.json | ConvertFrom-Json).version
- ps: nuget pack VireoSDK.nuspec -properties version="$env:package_version"
test_script:
- make testjs
- make testnative
- make testhttpbin
- npm run test -- --browsers FirefoxHeadless
- npm run test -- --browsers IE --skip-tags FailsIE
- npm run test-min -- --browsers FirefoxHeadless

# Using the same naming convention as rust https://forge.rust-lang.org/platform-support.html
after_test:
Expand Down
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ module.exports = {
'jasmine': true,
'es6': true
},
'parserOptions': {
'ecmaVersion': 2017
},
'rules': {
'no-console': 'off',

Expand Down
16 changes: 10 additions & 6 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
# npm will force include README*, LICENSE*, and package.json files
# so do not visit subdirectories using **/* patterns or extra files will be included
# can test output by running npm pack
!/dist/asmjs-unknown-emscripten/release/*.*
!/dist/asmjs-unknown-emscripten/debug/*.*
!/dist/asmjs-unknown-emscripten/profile/*.*
!/source/core/vireo.loader.js
!/source/core/module_*.js
!/source/io/module_*.js
!/dist/wasm32-unknown-emscripten/release/*.*
!/dist/wasm32-unknown-emscripten/debug/*.*
!/dist/wasm32-unknown-emscripten/profile/*.*

!/source/core/*.js
/source/core/library_*.js
/source/core/vireo.wrapper.js

!/source/io/*.js
/source/io/library_*.js
10 changes: 6 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ install:
- (cd emsdk-tools && ar xv libstdc++6_5.1.0-0ubuntu11~10.04.2_amd64.deb)
- tar -xzf emsdk-tools/data.tar.gz -C emsdk-tools
- git clone https://github.com/juj/emsdk.git
- (cd emsdk && git checkout 2da530aa5e6d6bcaf994ed1b2613a98872a428c8)
- emsdk/emsdk install sdk-1.37.36-64bit > emsdk-tools/emsdk_install_log.txt
- emsdk/emsdk activate sdk-1.37.36-64bit
- (cd emsdk && git checkout 0d8576c0e8f5ee09a36120b9d44184b5da2f2e7a)
- emsdk/emsdk install sdk-1.38.12-64bit > emsdk-tools/emsdk_install_log.txt
- emsdk/emsdk activate sdk-1.38.12-64bit
- cat ~/.emscripten
- (source make-it/travis-support/setup-env.sh && emcc -v)
before_script:
Expand All @@ -49,12 +49,14 @@ before_script:
- (source make-it/travis-support/setup-env.sh && make vjs)
- (source make-it/travis-support/setup-env.sh && make vjs BUILD=debug)
- (source make-it/travis-support/setup-env.sh && make vjs BUILD=profile)
- (source make-it/travis-support/setup-env.sh && make vjs BUILD=release TARGET=asmjs-unknown-emscripten)
- tar -tf $(npm pack)
script:
- make testjs
- make testnative
- make testhttpbin
- npm run test
- npm run test-min
- npm run test-asmjs
after_failure:
- cat emsdk-tools/emsdk_install_log.txt
before_deploy:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ The emsdk toolchain is used to cross-compile Vireo to Vireo.js to run in Node.js
4. From either the extracted folder or the cloned emsdk repository run the following commands:

```console
emsdk install sdk-1.37.36-64bit
emsdk activate sdk-1.37.36-64bit
emsdk install sdk-1.38.12-64bit
emsdk activate sdk-1.38.12-64bit
emcc -v # should say emcc version 1.37.36
```

Expand Down Expand Up @@ -108,7 +108,7 @@ To create a profile build of vireo.js:
make js BUILD=profile
```

Notice that vireo.js is created in the `dist` folder based on the `BUILD` type. For example, a default vireo.js build equivalent to `BUILD=release` will be located at: `dist/asmjs-unknown-emscripten/release/vireo.js`
Notice that vireo.js is created in the `dist` folder based on the `BUILD` type. For example, a default vireo.js build equivalent to `BUILD=release` will be located at: `dist/wasm32-unknown-emscripten/release/vireo.js`

## Vireo Windows Native target

Expand Down
21 changes: 21 additions & 0 deletions karma.asmjs.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Karma configuration

(function () {
'use strict';

module.exports = function (config) {
var getSharedConfig = require('./karma.shared.js');
var sharedConfig = getSharedConfig(config);

sharedConfig.files = [
...sharedConfig.filesPolyfills,
...sharedConfig.filesInfrastructure,
'dist/asmjs-unknown-emscripten/release/vireo.min.js',
...sharedConfig.filesSource,
...sharedConfig.filesFixtures,
...sharedConfig.filesSpecs
];

config.set(sharedConfig);
};
}());
36 changes: 14 additions & 22 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,21 @@
'use strict';

module.exports = function (config) {
var sharedConfig = require('./karma.shared.js');
var getSharedConfig = require('./karma.shared.js');
var sharedConfig = getSharedConfig(config);

sharedConfig.files = sharedConfig.files.concat([
// test assets
'test-it/karma/utilities/ExtendJasmineTimeout.js',

// test specs
'test-it/karma/helloworld/*.Test.js',
'test-it/karma/publicapi/*.Test.js',
'test-it/karma/vtrsuite/*.Test.js',
'test-it/karma/http/*.Test.js',
'test-it/karma/javascriptinvoke/*.Test.js',
'test-it/karma/propertynode/*.Test.js',
'test-it/karma/events/*.Test.js',
'test-it/karma/static/*.Test.js'
]);

// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
sharedConfig.logLevel = config.LOG_INFO;

// Timeout for jasmine set to 50000 in ExtendJasmineTimeout.js so warn if test time getting close
sharedConfig.reportSlowerThan = 40000;
sharedConfig.files = [
...sharedConfig.filesPolyfills,
rajsite marked this conversation as resolved.
Show resolved Hide resolved
...sharedConfig.filesInfrastructure,
'dist/wasm32-unknown-emscripten/release/vireo.js',
{
pattern: 'dist/wasm32-unknown-emscripten/release/vireo.core.wasm',
included: false
},
...sharedConfig.filesSource,
...sharedConfig.filesFixtures,
...sharedConfig.filesSpecs
];

config.set(sharedConfig);
};
Expand Down
38 changes: 18 additions & 20 deletions karma.coverage.conf.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,35 @@
// Karma configuration

(function () {
'use strict';

module.exports = function (config) {
var sharedConfig = require('./karma.shared.js');

sharedConfig.files = sharedConfig.files.concat([
// test assets
'test-it/karma/utilities/ExtendJasmineTimeout.js',

// test specs
'test-it/karma/helloworld/*.Test.js',
'test-it/karma/publicapi/*.Test.js',
'test-it/karma/vtrsuite/*.Test.js',
'test-it/karma/http/*.Test.js',
'test-it/karma/javascriptinvoke/*.Test.js'
]);

// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
sharedConfig.logLevel = config.LOG_INFO;
var getSharedConfig = require('./karma.shared.js');
var sharedConfig = getSharedConfig(config);

sharedConfig.files = [
...sharedConfig.filesPolyfills,
...sharedConfig.filesInfrastructure,
'dist/wasm32-unknown-emscripten/release/vireo.js',
{
pattern: 'dist/wasm32-unknown-emscripten/release/vireo.core.wasm',
included: false
},
...sharedConfig.filesSource,
...sharedConfig.filesFixtures,
...sharedConfig.filesSpecs
];

sharedConfig.browsers = [
'Firefox'
'FirefoxHeadless'
];

sharedConfig.reporters = [
'dots',
'coverage'
];

sharedConfig.preprocessors['source/core/*.js'] = ['coverage'];
sharedConfig.preprocessors['source/io/*.js'] = ['coverage'];
sharedConfig.preprocessors['dist/wasm32-unknown-emscripten/release/vireo.js'] = ['coverage'];
rajsite marked this conversation as resolved.
Show resolved Hide resolved

sharedConfig.coverageReporter = {
dir: 'coverage',
Expand Down
25 changes: 25 additions & 0 deletions karma.debug.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Karma configuration

(function () {
'use strict';

module.exports = function (config) {
var getSharedConfig = require('./karma.shared.js');
var sharedConfig = getSharedConfig(config);

sharedConfig.files = [
...sharedConfig.filesPolyfills,
...sharedConfig.filesInfrastructure,
'dist/wasm32-unknown-emscripten/debug/vireo.js',
{
pattern: 'dist/wasm32-unknown-emscripten/debug/vireo.core.wasm',
included: false
},
...sharedConfig.filesSource,
...sharedConfig.filesFixtures,
...sharedConfig.filesSpecs
];

config.set(sharedConfig);
};
}());
25 changes: 25 additions & 0 deletions karma.min.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Karma configuration

(function () {
'use strict';

module.exports = function (config) {
var getSharedConfig = require('./karma.shared.js');
var sharedConfig = getSharedConfig(config);

sharedConfig.files = [
...sharedConfig.filesPolyfills,
...sharedConfig.filesInfrastructure,
'dist/wasm32-unknown-emscripten/release/vireo.min.js',
{
pattern: 'dist/wasm32-unknown-emscripten/release/vireo.core.wasm',
included: false
},
...sharedConfig.filesSource,
...sharedConfig.filesFixtures,
...sharedConfig.filesSpecs
];

config.set(sharedConfig);
};
}());
Loading