Skip to content

Commit

Permalink
#2654 - Improve WASM loading performance (#4893)
Browse files Browse the repository at this point in the history
- added two ketcher-standalone builds: with base64 indigo wasm and with separate wasm file
- updated indigo to 2.22.0-rc.2
  • Loading branch information
rrodionov91 authored Jun 26, 2024
1 parent 1d4c2fa commit ea4a36b
Show file tree
Hide file tree
Showing 5 changed files with 283 additions and 30 deletions.
11 changes: 11 additions & 0 deletions example/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const {
const webpack = require('webpack');
const HtmlReplaceWebpackPlugin = require('html-replace-webpack-plugin');
const GitRevisionPlugin = require('git-revision-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');

const gitRevisionPlugin = new GitRevisionPlugin();
const applicationVersion = gitRevisionPlugin.version().split('-')[0];
Expand Down Expand Up @@ -35,6 +36,16 @@ module.exports = override(
},
]),
),
addWebpackPlugin(
new CopyPlugin({
patterns: [
{
from: '../node_modules/ketcher-standalone/**/*.wasm',
to: '[name][ext]',
},
],
}),
),
);

module.exports.envVariables = envVariables;
1 change: 1 addition & 0 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"@types/react-dom": "^18.0.8",
"@vitejs/plugin-react": "^4.0.0",
"@welldone-software/why-did-you-render": "^4.3.1",
"copy-webpack-plugin": "^12.0.2",
"cross-env": "^7.0.3",
"customize-cra": "^1.0.0",
"eslint": "^8.44.0",
Expand Down
198 changes: 192 additions & 6 deletions package-lock.json

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

19 changes: 15 additions & 4 deletions packages/ketcher-standalone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"node": ">=14"
},
"scripts": {
"build": "cross-env NODE_ENV=production rollup -c -m true",
"build": "cross-env NODE_ENV=production rollup -c -m true && cross-env NODE_ENV=production BINARY_WASM=true rollup -c -m true",
"start": "cross-env NODE_ENV=development rollup -c -m true -w",
"test": "run-s test:prettier test:eslint:quiet test:types test:unit",
"test:eslint": "eslint . --ext .ts,.js",
Expand All @@ -42,17 +42,18 @@
},
"dependencies": {
"@babel/runtime": "^7.17.9",
"indigo-ketcher": "1.21.0-rc.1",
"indigo-ketcher": "1.22.0-dev.2",
"ketcher-core": "*"
},
"devDependencies": {
"@babel/core": "^7.17.9",
"@babel/plugin-transform-runtime": "^7.17.0",
"@babel/preset-env": "^7.16.11",
"@babel/preset-typescript": "^7.16.7",
"@rollup/plugin-alias": "^3.1.9",
"@rollup/plugin-babel": "^5.2.1",
"@rollup/plugin-commonjs": "^16.0.0",
"@rollup/plugin-node-resolve": "^10.0.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-strip": "^2.0.0",
"@types/jest": "^27.0.3",
"@types/node": "^16.11.12",
Expand All @@ -74,5 +75,15 @@
},
"files": [
"dist"
]
],
"exports": {
".": {
"import": "./dist/index.modern.js",
"require": "./dist/index.js"
},
"./dist/binaryWasm": {
"import": "./dist/binaryWasm/index.modern.js",
"require": "./dist/binaryWasm/index.js"
}
}
}
Loading

0 comments on commit ea4a36b

Please sign in to comment.