Skip to content

Commit d10d4bb

Browse files
author
Robin Frischmann
committed
3.0.1 release
1 parent 1e8b248 commit d10d4bb

12 files changed

+2197
-307
lines changed

Changelog.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Changelog
22

33
## 3.0
4+
5+
### 3.0.1
6+
* performance improvements (~10% faster) ( [#115](https://github.com/rofrischmann/inline-style-prefixer/pull/115) ) ( [#116](https://github.com/rofrischmann/inline-style-prefixer/pull/116) )
7+
* ordering prefixed properties correctly ( [#117](https://github.com/rofrischmann/inline-style-prefixer/pull/117) )
8+
49
### 3.0.0
510

611
#### Complete Rewrite
@@ -10,6 +15,8 @@
1015
* new documentation using gitbook
1116
* integrated flowtype
1217

18+
------
19+
1320
## 2.0
1421
### 2.0.5
1522
* added style sorting to prepend prefixed properties ( [#105](https://github.com/rofrischmann/inline-style-prefixer/issues/105) )

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ If you're still using npm, you may run `npm i --save inline-style-prefixer`.
1818
We also provide [UMD](https://github.com/umdjs/umd) builds for each package in the `dist` folder. You can easily use them via [unpkg](https://unpkg.com/).
1919
```HTML
2020
<!-- Unminified versions -->
21-
<script src="https://unpkg.com/[email protected].0/dist/inline-style-prefixer.js"></script>
22-
<script src="https://unpkg.com/[email protected].0/dist/inline-style-prefix-all.js"></script>
21+
<script src="https://unpkg.com/[email protected].1/dist/inline-style-prefixer.js"></script>
22+
<script src="https://unpkg.com/[email protected].1/dist/inline-style-prefix-all.js"></script>
2323
<!-- Minified versions -->
24-
<script src="https://unpkg.com/[email protected].0/dist/inline-style-prefixer.min.js"></script>
25-
<script src="https://unpkg.com/[email protected].0/dist/inline-style-prefix-all.min.js"></script>
24+
<script src="https://unpkg.com/[email protected].1/dist/inline-style-prefixer.min.js"></script>
25+
<script src="https://unpkg.com/[email protected].1/dist/inline-style-prefix-all.min.js"></script>
2626
```
2727

2828
## Browser Support

benchmark/packages/301/static/createPrefixer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function createPrefixer(_ref) {
5757
style[property] = _processedValue;
5858
}
5959

60-
(0, _prefixProperty2.default)(prefixMap, property, style);
60+
style = (0, _prefixProperty2.default)(prefixMap, property, style);
6161
}
6262
}
6363

benchmark/packages/301/utils/prefixProperty.js

+21-5
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,27 @@ var _capitalizeString2 = _interopRequireDefault(_capitalizeString);
1212
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1313

1414
function prefixProperty(prefixProperties, property, style) {
15-
if (prefixProperties.hasOwnProperty(property)) {
16-
var requiredPrefixes = prefixProperties[property];
17-
for (var i = 0, len = requiredPrefixes.length; i < len; ++i) {
18-
style[requiredPrefixes[i] + (0, _capitalizeString2.default)(property)] = style[property];
19-
}
15+
if (!prefixProperties.hasOwnProperty(property)) {
16+
return style;
2017
}
18+
19+
// We need to preserve the order of the styles while inserting new prefixed
20+
// styles. Object order is not guaranteed, but this is better than nothing.
21+
// Note that this is brittle and is likely to break in older versions of
22+
// Node (e.g. Node 4).
23+
var newStyle = {};
24+
Object.keys(style).forEach(function (styleProperty) {
25+
if (styleProperty === property) {
26+
// We've found the style we need to prefix.
27+
var requiredPrefixes = prefixProperties[property];
28+
for (var i = 0, len = requiredPrefixes.length; i < len; ++i) {
29+
newStyle[requiredPrefixes[i] + (0, _capitalizeString2.default)(property)] = style[property];
30+
}
31+
}
32+
33+
newStyle[styleProperty] = style[styleProperty];
34+
});
35+
36+
return newStyle;
2137
}
2238
module.exports = exports['default'];

dist/inline-style-prefix-all.js

+30-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/inline-style-prefix-all.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/inline-style-prefix-all.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/inline-style-prefixer.js

+38-23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/inline-style-prefixer.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/inline-style-prefixer.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)