Skip to content

Commit b1cd92a

Browse files
committed
[change] update Animated
Fix #309
1 parent d87f71e commit b1cd92a

File tree

6 files changed

+13
-34
lines changed

6 files changed

+13
-34
lines changed

examples/.storybook/webpack.config.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ module.exports = {
2424
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development'),
2525
'process.env.__REACT_NATIVE_DEBUG_ENABLED__': DEV
2626
}),
27-
// https://github.com/animatedjs/animated/issues/40
28-
new webpack.NormalModuleReplacementPlugin(
29-
/es6-set/,
30-
path.join(__dirname, '../../src/modules/polyfills/Set.js')
31-
),
3227
new webpack.optimize.OccurenceOrderPlugin()
3328
],
3429
resolve: {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"test:watch": "npm run test:jest -- --watch"
2323
},
2424
"dependencies": {
25-
"animated": "^0.1.3",
25+
"animated": "^0.1.5",
2626
"array-find-index": "^1.0.2",
2727
"asap": "^2.0.5",
2828
"babel-runtime": "^6.11.6",

src/apis/StyleSheet/injector.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*/
55

66
import asap from 'asap';
7-
import ExecutionEnvironment from 'fbjs/lib/ExecutionEnvironment';
87

98
const hasOwnProperty = Object.prototype.hasOwnProperty;
109

@@ -27,7 +26,7 @@ const getStyleText = () => {
2726

2827
// TODO: SSR support
2928
const getAvailableClassNames = () => {
30-
if (ExecutionEnvironment.canUseDOM) {
29+
if (global.document) {
3130
if (!styleNode) {
3231
styleNode = document.getElementById(STYLE_ELEMENT_ID);
3332
}
@@ -45,8 +44,7 @@ const getAvailableClassNames = () => {
4544
const createStyleHTML = (text) => `<style id="${STYLE_ELEMENT_ID}">${text}</style>`;
4645

4746
const frame = () => {
48-
if (!isDirty || !ExecutionEnvironment.canUseDOM) { return; }
49-
47+
if (!isDirty || !global.document) { return; }
5048
isDirty = false;
5149
styleNode = styleNode || document.getElementById(STYLE_ELEMENT_ID);
5250

@@ -74,7 +72,7 @@ const addRule = (key, rule) => {
7472
registry[key] = rule;
7573
if (!isDirty) {
7674
isDirty = true;
77-
if (ExecutionEnvironment.canUseDOM) {
75+
if (global.document) {
7876
asap(frame);
7977
}
8078
}

src/modules/polyfills/Set.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

webpack.config.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ module.exports = {
3131
}),
3232
new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify('production') }),
3333
new webpack.optimize.DedupePlugin(),
34-
// https://github.com/animatedjs/animated/issues/40
35-
new webpack.NormalModuleReplacementPlugin(
36-
/es6-set/,
37-
path.join(__dirname, 'dist/modules/polyfills/Set.js')
38-
),
3934
new webpack.optimize.OccurenceOrderPlugin(),
4035
new webpack.optimize.UglifyJsPlugin({
4136
compress: {

yarn.lock

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,12 @@ amdefine@>=0.0.4:
181181
version "1.0.1"
182182
resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5"
183183

184-
animated@^0.1.3:
185-
version "0.1.4"
186-
resolved "https://registry.yarnpkg.com/animated/-/animated-0.1.4.tgz#1e7d119ea0027e1279b96ec309f5cb54935a915a"
184+
animated@^0.1.5:
185+
version "0.1.5"
186+
resolved "https://registry.yarnpkg.com/animated/-/animated-0.1.5.tgz#83df8dc443d57abab7b0bb04818b0b655b31c9b9"
187187
dependencies:
188-
es6-set "^0.1.4"
189188
invariant "^2.2.0"
190-
tinycolor "0.0.1"
189+
normalize-css-color "^1.0.1"
191190

192191
ansi-escapes@^1.1.0, ansi-escapes@^1.4.0:
193192
version "1.4.0"
@@ -2045,7 +2044,7 @@ es6-map@^0.1.3:
20452044
es6-symbol "~3.1.0"
20462045
event-emitter "~0.3.4"
20472046

2048-
es6-set@^0.1.4, es6-set@~0.1.3:
2047+
es6-set@~0.1.3:
20492048
version "0.1.4"
20502049
resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.4.tgz#9516b6761c2964b92ff479456233a247dc707ce8"
20512050
dependencies:
@@ -4017,6 +4016,10 @@ nopt@3.x, nopt@~3.0.6:
40174016
dependencies:
40184017
abbrev "1"
40194018

4019+
normalize-css-color@^1.0.1:
4020+
version "1.0.1"
4021+
resolved "https://registry.yarnpkg.com/normalize-css-color/-/normalize-css-color-1.0.1.tgz#792f59cae25036950a9127cfcfddc073048f4f9d"
4022+
40204023
normalize-package-data@^2.3.2, normalize-package-data@^2.3.4:
40214024
version "2.3.5"
40224025
resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.3.5.tgz#8d924f142960e1777e7ffe170543631cc7cb02df"
@@ -5452,10 +5455,6 @@ timers-browserify@^1.0.1:
54525455
dependencies:
54535456
process "~0.11.0"
54545457

5455-
tinycolor@0.0.1:
5456-
version "0.0.1"
5457-
resolved "https://registry.yarnpkg.com/tinycolor/-/tinycolor-0.0.1.tgz#320b5a52d83abb5978d81a3e887d4aefb15a6164"
5458-
54595458
tmpl@1.0.x:
54605459
version "1.0.4"
54615460
resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1"

0 commit comments

Comments
 (0)