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

Remove threads.js #160

Merged
merged 8 commits into from
Apr 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"presets": ["@babel/preset-env", "@babel/preset-react"],
// This is used for threads.js.
// This is for testing geotiff.
"plugins": ["@babel/plugin-transform-runtime"]
}
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### Added

- Remove threads.js and use WebWorkers.

### Changed

## 0.1.7
Expand Down
2 changes: 0 additions & 2 deletions docs/OMETIFF_LOADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,3 @@ A bit is going on under the hood here, though. Here are some of those things:
bioformats2raw input.ome.tif output.n5 --resolutions $REASONABLE_RESOLUTION --tile_width 512 --tile_height 512
raw2ometiff output.n5 output.ome.tif --compression=zlib
```

A final note: Viv uses [geotiff.js](https://github.com/geotiffjs/geotiff.js) for fetching data. It a great package and is very fast, thanks to its use of web workers via [threads.js](https://github.com/andywer/threads.js). However, this means that your application needs to handle this as it entails code splitting. Anecdotally, this should work out of the box (more-or-less) with [parcel](https://github.com/parcel-bundler/parcel) and via the [threads-plugin](https://github.com/andywer/threads-plugin) for webpack (which is what the demo uses). If you don't want to use threads, use the `noThreads` uption in `createOMETiffLoader` or pass in a funtion that can parse a file directory of a tiff page and implements `.decode` for the found compression to the `OMETiffLoader` (coming soon: this hopefully will be exported from `geotiff` - we are currently on a fork).
Binary file added hubmap-vitessce-image-viewer-0.1.6.tgz
Binary file not shown.
212 changes: 31 additions & 181 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 9 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"name": "@hubmap/vitessce-image-viewer",
"version": "0.1.7",
"main": "dist/index.umd.js",
"module": "dist/index.es5.js",
"main": "dist/bundle.umd.js",
"module": "dist/bundle.es.js",
"files": [
"dist",
"src"
],
"description": "High bit depth, high resolution, many channels, low overhead",
"scripts": {
"build-component": "mkdir dist || rm -r dist && rollup --config",
"build-site": "mkdir dist || rm -r dist && node_modules/.bin/webpack --config webpack.config.js --mode production",
"start": "node_modules/.bin/webpack-dev-server --mode development --open --hot",
"build-component": "mkdir dist || rm -r dist && node_modules/.bin/webpack --config webpack.config.component.js --mode production",
"build-site": "mkdir dist || rm -r dist && node_modules/.bin/webpack --config webpack.config.site.js --mode production",
"start": "node_modules/.bin/webpack-dev-server --config webpack.config.site.js --mode development --open --hot",
"test:layers_views": "mkdir test_dist || rm -r test_dist && node_modules/.bin/webpack --config webpack.config.test.layers.views.js --mode development",
"test:loaders": "mocha --require @babel/register tests/loaders/*.spec.js",
"test": "npm run-script test:loaders && npm run-script test:layers_views",
Expand All @@ -35,6 +35,7 @@
"homepage": "https://github.com/hubmapconsortium/vitessce-image-viewer#readme",
"devDependencies": {
"@babel/core": "^7.7.4",
"@babel/plugin-transform-regenerator": "^7.8.7",
"@babel/plugin-transform-runtime": "^7.9.0",
"@babel/preset-env": "^7.8.3",
"@babel/preset-react": "^7.8.3",
Expand All @@ -44,10 +45,6 @@
"@material-ui/core": "^4.9.9",
"@material-ui/icons": "^4.9.1",
"@probe.gl/test-utils": "^3.2.1",
"@rollup/plugin-commonjs": "^11.0.2",
"@rollup/plugin-json": "^4.0.2",
"@rollup/plugin-node-resolve": "^7.1.1",
"@rollup/plugin-replace": "^2.3.2",
"autoprefixer": "^9.7.4",
"babel-loader": "^8.0.6",
"babel-preset-stage-0": "^6.24.1",
Expand Down Expand Up @@ -79,20 +76,17 @@
"raw-loader": "^4.0.0",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"rollup": "^1.31.0",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-glslify": "^1.1.3",
"rollup-plugin-sourcemaps": "^0.4.2",
"tap-spec": "^5.0.0",
"tape": "4.13.0",
"tape-catch": "^1.0.6",
"tape-run": "^6.0.1",
"testling": "^1.7.3",
"threads-plugin": "^1.3.1",
"webpack": "^4.41.5",
"webpack-cli": "^3.3.10",
"webpack-dev-server": "^3.10.1",
"webpack-tape-run": "0.0.7"
"webpack-node-externals": "^1.7.2",
"webpack-tape-run": "0.0.7",
"worker-loader": "^2.0.0"
},
"dependencies": {
"@deck.gl/core": "^8.1.0",
Expand Down
Loading