Skip to content

Commit 977fdc7

Browse files
greenkeeper[bot]NataliaDSmirnova
authored andcommitted
Update three to 0.109.0 🚀 (#223)
* Add safety to Vector3.angleTo usage as threejs requires * Transpile three.module.js using babel as it starts migration to ES6
1 parent 4312e0c commit 977fdc7

File tree

5 files changed

+20
-10
lines changed

5 files changed

+20
-10
lines changed

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@
168168
"style-loader": "^1.0.0",
169169
"stylelint": "^11.0.0",
170170
"stylelint-config-standard": "^19.0.0",
171-
"three": "=0.108.0",
171+
"three": "0.109.0",
172172
"toastr": "^2.1.4",
173173
"uglify-js": "^3.6.0",
174174
"url-loader": "^2.1.0",

‎rollup.config.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import rollupPluginReplace from 'rollup-plugin-replace';
66
import rollupPluginNodeResolve from 'rollup-plugin-node-resolve';
77
import rollupPluginString from 'rollup-plugin-string';
88

9+
import path from 'path';
910
import version from './tools/version';
1011
import packageJson from './package.json';
1112

@@ -51,11 +52,12 @@ export default {
5152
rollupPluginBabel({
5253
runtimeHelpers: true,
5354
exclude: [
54-
'./node_modules/**',
55+
/node_modules[\\/](?!three)/,
5556
'./vendor/js/**',
5657
'./src/utils/SelectionParser',
5758
'./src/utils/MiewCLIParser.js',
5859
],
60+
extends: path.join(__dirname, '/.babelrc'),
5961
}),
6062

6163
],

‎src/chem/Residue.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,11 @@ class Residue {
185185
const vectorB = prevLeadPos.clone().sub(prevWingPos);
186186
vectorB.crossVectors(vectorA, vectorB);
187187
vectorB.crossVectors(vectorA, vectorB).normalize();
188-
if (prevWing !== null && Math.abs(prevWing.angleTo(vectorB)) > Math.PI / 2) {
189-
vectorB.negate();
188+
if (prevWing !== null && prevWing.length() > 0.0001) {
189+
const needToNegate = vectorB.length() > 0.0001 && Math.abs(prevWing.angleTo(vectorB)) > Math.PI / 2;
190+
if (needToNegate) {
191+
vectorB.negate();
192+
}
190193
}
191194
return vectorB;
192195
}

‎webpack.config.babel.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,13 @@ const configure = (prod) => ({
2222
module: {
2323
rules: [{
2424
test: /\.js$/,
25-
exclude: /(node_modules|vendor)/,
26-
use: ['babel-loader'],
25+
exclude: /(node_modules[\\/](?!three))|vendor/,
26+
use: {
27+
loader: 'babel-loader',
28+
options: {
29+
extends: path.join(__dirname, '/.babelrc'),
30+
},
31+
},
2732
}, {
2833
test: /\.[sp]?css$/,
2934
use: [

‎yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -8812,10 +8812,10 @@ text-table@^0.2.0:
88128812
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
88138813
integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=
88148814

8815-
three@=0.108.0:
8816-
version "0.108.0"
8817-
resolved "https://registry.yarnpkg.com/three/-/three-0.108.0.tgz#53d26597c7932f214bb43f4655e566d2058143b5"
8818-
integrity sha512-d1ysIXwi8qTlbmMwrTxi5pYiiYIflEr0e48krP0LAY8ndS8c6fkLHn6NvRT+o76/Fs9PBLxFViuI62iGVWwwlg==
8815+
three@0.109.0:
8816+
version "0.109.0"
8817+
resolved "https://registry.yarnpkg.com/three/-/three-0.109.0.tgz#611c9ef860d10bd107695cead6c6abcd2422e5fd"
8818+
integrity sha512-XT99T3Hvgh2CEvwPdHYEunNE+clLK6KiT1U8En7YOgIqTUw4MrLeIc8zxQAJ6wbP8hhJaY5+Cff3jwBPpBa0gA==
88198819

88208820
through2@^2.0.0:
88218821
version "2.0.5"

0 commit comments

Comments
 (0)