From 51fbfa0ccb10404b4b3ef539726fb37181f60f4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Phil=20Pl=C3=BCckthun?= Date: Wed, 7 Jun 2017 16:24:04 +0100 Subject: [PATCH] Remove unused autoprefixing code and inline-style-prefixer --- CHANGELOG.md | 1 + flow-typed/inline-style-prefixer_vx.x.x.js | 256 --------------------- package.json | 1 - src/utils/autoprefix.js | 28 --- yarn.lock | 15 -- 5 files changed, 1 insertion(+), 300 deletions(-) delete mode 100644 flow-typed/inline-style-prefixer_vx.x.x.js delete mode 100644 src/utils/autoprefix.js diff --git a/CHANGELOG.md b/CHANGELOG.md index f995ac64b..28e481250 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file. If a contri - Added a test for `withComponent` followed by `attrs`, thanks to [@btmills](https://github.com/btmills). (see [#851](https://github.com/styled-components/styled-components/pull/851)) - Fix Flow type signatures for compatibility with Flow v0.47.0 (see [#840](https://github.com/styled-components/styled-components/pull/840)) - Upgraded stylis to v3.0. (see [#829](https://github.com/styled-components/styled-components/pull/829) and [#876](https://github.com/styled-components/styled-components/pull/876)) +- Remove dead code used previously for auto-prefixing. (see [#881](https://github.com/styled-components/styled-components/pull/881)) ## [v2.0.0] - 2017-05-25 diff --git a/flow-typed/inline-style-prefixer_vx.x.x.js b/flow-typed/inline-style-prefixer_vx.x.x.js deleted file mode 100644 index 428e4b5d2..000000000 --- a/flow-typed/inline-style-prefixer_vx.x.x.js +++ /dev/null @@ -1,256 +0,0 @@ -// flow-typed signature: 2ab55e903767f1d4cde6a118971f3c19 -// flow-typed version: <>/inline-style-prefixer_v2.0.4/flow_v0.34.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'inline-style-prefixer' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'inline-style-prefixer' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'inline-style-prefixer/dist/inline-style-prefix-all' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/dist/inline-style-prefix-all.min' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/dist/inline-style-prefixer' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/dist/inline-style-prefixer.min' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/lib/plugins/calc' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/lib/plugins/flex' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/lib/plugins/flexboxIE' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/lib/plugins/flexboxOld' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/lib/plugins/grabCursor' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/lib/plugins/gradient' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/lib/plugins/sizing' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/lib/plugins/transition' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/lib/plugins/zoomCursor' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/lib/Prefixer' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/lib/prefixProps' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/lib/static/plugins/calc' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/lib/static/plugins/cursor' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/lib/static/plugins/flex' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/lib/static/plugins/flexboxIE' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/lib/static/plugins/flexboxOld' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/lib/static/plugins/gradient' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/lib/static/plugins/sizing' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/lib/static/plugins/transition' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/lib/static/prefixAll' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/lib/static/prefixProps' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/lib/utils/capitalizeString' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/lib/utils/getBrowserInformation' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/lib/utils/getPrefixedKeyframes' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/lib/utils/getPrefixedValue' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/lib/utils/isPrefixedValue' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/lib/utils/joinPrefixedValue' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/lib/utils/unprefixProperty' { - declare module.exports: any; -} - -declare module 'inline-style-prefixer/static' { - declare module.exports: any; -} - -// Filename aliases -declare module 'inline-style-prefixer/dist/inline-style-prefix-all.js' { - declare module.exports: $Exports<'inline-style-prefixer/dist/inline-style-prefix-all'>; -} -declare module 'inline-style-prefixer/dist/inline-style-prefix-all.min.js' { - declare module.exports: $Exports<'inline-style-prefixer/dist/inline-style-prefix-all.min'>; -} -declare module 'inline-style-prefixer/dist/inline-style-prefixer.js' { - declare module.exports: $Exports<'inline-style-prefixer/dist/inline-style-prefixer'>; -} -declare module 'inline-style-prefixer/dist/inline-style-prefixer.min.js' { - declare module.exports: $Exports<'inline-style-prefixer/dist/inline-style-prefixer.min'>; -} -declare module 'inline-style-prefixer/lib/plugins/calc.js' { - declare module.exports: $Exports<'inline-style-prefixer/lib/plugins/calc'>; -} -declare module 'inline-style-prefixer/lib/plugins/flex.js' { - declare module.exports: $Exports<'inline-style-prefixer/lib/plugins/flex'>; -} -declare module 'inline-style-prefixer/lib/plugins/flexboxIE.js' { - declare module.exports: $Exports<'inline-style-prefixer/lib/plugins/flexboxIE'>; -} -declare module 'inline-style-prefixer/lib/plugins/flexboxOld.js' { - declare module.exports: $Exports<'inline-style-prefixer/lib/plugins/flexboxOld'>; -} -declare module 'inline-style-prefixer/lib/plugins/grabCursor.js' { - declare module.exports: $Exports<'inline-style-prefixer/lib/plugins/grabCursor'>; -} -declare module 'inline-style-prefixer/lib/plugins/gradient.js' { - declare module.exports: $Exports<'inline-style-prefixer/lib/plugins/gradient'>; -} -declare module 'inline-style-prefixer/lib/plugins/sizing.js' { - declare module.exports: $Exports<'inline-style-prefixer/lib/plugins/sizing'>; -} -declare module 'inline-style-prefixer/lib/plugins/transition.js' { - declare module.exports: $Exports<'inline-style-prefixer/lib/plugins/transition'>; -} -declare module 'inline-style-prefixer/lib/plugins/zoomCursor.js' { - declare module.exports: $Exports<'inline-style-prefixer/lib/plugins/zoomCursor'>; -} -declare module 'inline-style-prefixer/lib/Prefixer.js' { - declare module.exports: $Exports<'inline-style-prefixer/lib/Prefixer'>; -} -declare module 'inline-style-prefixer/lib/prefixProps.js' { - declare module.exports: $Exports<'inline-style-prefixer/lib/prefixProps'>; -} -declare module 'inline-style-prefixer/lib/static/plugins/calc.js' { - declare module.exports: $Exports<'inline-style-prefixer/lib/static/plugins/calc'>; -} -declare module 'inline-style-prefixer/lib/static/plugins/cursor.js' { - declare module.exports: $Exports<'inline-style-prefixer/lib/static/plugins/cursor'>; -} -declare module 'inline-style-prefixer/lib/static/plugins/flex.js' { - declare module.exports: $Exports<'inline-style-prefixer/lib/static/plugins/flex'>; -} -declare module 'inline-style-prefixer/lib/static/plugins/flexboxIE.js' { - declare module.exports: $Exports<'inline-style-prefixer/lib/static/plugins/flexboxIE'>; -} -declare module 'inline-style-prefixer/lib/static/plugins/flexboxOld.js' { - declare module.exports: $Exports<'inline-style-prefixer/lib/static/plugins/flexboxOld'>; -} -declare module 'inline-style-prefixer/lib/static/plugins/gradient.js' { - declare module.exports: $Exports<'inline-style-prefixer/lib/static/plugins/gradient'>; -} -declare module 'inline-style-prefixer/lib/static/plugins/sizing.js' { - declare module.exports: $Exports<'inline-style-prefixer/lib/static/plugins/sizing'>; -} -declare module 'inline-style-prefixer/lib/static/plugins/transition.js' { - declare module.exports: $Exports<'inline-style-prefixer/lib/static/plugins/transition'>; -} -declare module 'inline-style-prefixer/lib/static/prefixAll.js' { - declare module.exports: $Exports<'inline-style-prefixer/lib/static/prefixAll'>; -} -declare module 'inline-style-prefixer/lib/static/prefixProps.js' { - declare module.exports: $Exports<'inline-style-prefixer/lib/static/prefixProps'>; -} -declare module 'inline-style-prefixer/lib/utils/capitalizeString.js' { - declare module.exports: $Exports<'inline-style-prefixer/lib/utils/capitalizeString'>; -} -declare module 'inline-style-prefixer/lib/utils/getBrowserInformation.js' { - declare module.exports: $Exports<'inline-style-prefixer/lib/utils/getBrowserInformation'>; -} -declare module 'inline-style-prefixer/lib/utils/getPrefixedKeyframes.js' { - declare module.exports: $Exports<'inline-style-prefixer/lib/utils/getPrefixedKeyframes'>; -} -declare module 'inline-style-prefixer/lib/utils/getPrefixedValue.js' { - declare module.exports: $Exports<'inline-style-prefixer/lib/utils/getPrefixedValue'>; -} -declare module 'inline-style-prefixer/lib/utils/isPrefixedValue.js' { - declare module.exports: $Exports<'inline-style-prefixer/lib/utils/isPrefixedValue'>; -} -declare module 'inline-style-prefixer/lib/utils/joinPrefixedValue.js' { - declare module.exports: $Exports<'inline-style-prefixer/lib/utils/joinPrefixedValue'>; -} -declare module 'inline-style-prefixer/lib/utils/unprefixProperty.js' { - declare module.exports: $Exports<'inline-style-prefixer/lib/utils/unprefixProperty'>; -} -declare module 'inline-style-prefixer/static.js' { - declare module.exports: $Exports<'inline-style-prefixer/static'>; -} diff --git a/package.json b/package.json index 569a1b284..0f99bff48 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,6 @@ "css-to-react-native": "^2.0.3", "fbjs": "^0.8.9", "hoist-non-react-statics": "^1.2.0", - "inline-style-prefixer": "^2.0.5", "is-function": "^1.0.1", "is-plain-object": "^2.0.1", "prop-types": "^15.5.4", diff --git a/src/utils/autoprefix.js b/src/utils/autoprefix.js deleted file mode 100644 index ec8259c94..000000000 --- a/src/utils/autoprefix.js +++ /dev/null @@ -1,28 +0,0 @@ -// @flow -import camelizeStyleName from 'fbjs/lib/camelizeStyleName' -import hyphenateStyleName from 'fbjs/lib/hyphenateStyleName' - -// eslint-disable-next-line -import prefixAll from 'inline-style-prefixer/static' -import type Container from '../vendor/postcss/container' - -export default (root: Container) => { - root.walkDecls(decl => { - /* No point even checking custom props */ - if (/^--/.test(decl.prop)) return - - const objStyle = { [camelizeStyleName(decl.prop)]: decl.value } - const prefixed = prefixAll(objStyle) - Object.keys(prefixed).forEach(newProp => { - const newVals = prefixed[newProp] - const newValArray = Array.isArray(newVals) ? newVals : [newVals] - newValArray.forEach(newVal => { - decl.cloneBefore({ - prop: hyphenateStyleName(newProp), - value: newVal, - }) - }) - }) - decl.remove() - }) -} diff --git a/yarn.lock b/yarn.lock index 06a71dbdf..e19608ae2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1120,10 +1120,6 @@ boom@2.x.x: dependencies: hoek "2.x.x" -bowser@^1.0.0: - version "1.6.1" - resolved "https://registry.yarnpkg.com/bowser/-/bowser-1.6.1.tgz#9157e9498f456e937173a2918f3b2161e5353eb3" - boxen@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/boxen/-/boxen-1.0.0.tgz#b2694baf1f605f708ff0177c12193b22f29aaaab" @@ -2924,10 +2920,6 @@ http-signature@~1.1.0: jsprim "^1.2.2" sshpk "^1.7.0" -hyphenate-style-name@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/hyphenate-style-name/-/hyphenate-style-name-1.0.2.tgz#31160a36930adaf1fc04c6074f7eb41465d4ec4b" - iconv-lite@0.4.11: version "0.4.11" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.11.tgz#2ecb42fd294744922209a2e7c404dac8793d8ade" @@ -2989,13 +2981,6 @@ ini@~1.3.0: version "1.3.4" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e" -inline-style-prefixer@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/inline-style-prefixer/-/inline-style-prefixer-2.0.5.tgz#c153c7e88fd84fef5c602e95a8168b2770671fe7" - dependencies: - bowser "^1.0.0" - hyphenate-style-name "^1.0.1" - inquirer@^0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.12.0.tgz#1ef2bfd63504df0bc75785fff8c2c41df12f077e"