diff --git a/.eslintrc b/.eslintrc
index a552b8009..998f15edd 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -1,20 +1,12 @@
{
"parser": "babel-eslint",
- "extends": [
- "airbnb",
- "prettier",
- "prettier/flowtype"
- ],
+ "extends": ["airbnb", "prettier", "prettier/flowtype"],
"globals": {
"__SERVER__": true
},
"plugins": ["flowtype", "flowtype-errors", "prettier"],
"rules": {
- "semi": 0,
- "quotes": 0,
- "comma-dangle": 0,
"curly": [2, "multi-line"],
- "arrow-parens": 0,
"class-methods-use-this": 0,
"symbol-description": 0,
"no-unused-vars": [2, { "varsIgnorePattern": "^_+$" }],
@@ -23,10 +15,15 @@
"no-else-return": 0,
"react/sort-comp": 0,
"react/jsx-filename-extension": 0,
+ "react/require-default-props": 0,
"flowtype-errors/show-errors": 2,
"no-prototype-builtins": 0,
"no-duplicate-imports": 0,
- "flowtype/require-valid-file-annotation": [2, "always", {"annotationStyle": "line"}],
+ "flowtype/require-valid-file-annotation": [
+ 2,
+ "always",
+ { "annotationStyle": "line" }
+ ],
"flowtype/boolean-style": [2, "boolean"],
"flowtype/no-dupe-keys": 2,
"flowtype/union-intersection-spacing": [2, "always"],
@@ -37,7 +34,8 @@
"ForOfStatement",
"LabeledStatement",
"WithStatement"
- ]
+ ],
+ "no-return-assign": 0
},
"env": {
"jest": true,
diff --git a/.flowconfig b/.flowconfig
index 6699ccfb1..b3951bd22 100644
--- a/.flowconfig
+++ b/.flowconfig
@@ -22,4 +22,3 @@
[options]
suppress_comment=.*\\$FlowFixMe
suppress_comment=.*\\$FlowInvalidInputTest
-unsafe.enable_getters_and_setters=true
diff --git a/.gitignore b/.gitignore
index 9717997c0..dc0613080 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,4 @@ __diff_output__
lib
sandbox/node_modules
*.log
+test-results.json
diff --git a/.travis.yml b/.travis.yml
index 254a970e4..1982af072 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,6 +6,8 @@ addons:
packages:
- libnss3
- google-chrome-beta
+branches:
+ only: master
env:
global:
- GOOGLE_CHROME_BINARY="/usr/bin/google-chrome-beta"
@@ -16,13 +18,15 @@ node_js:
script:
- node --version
- yarn --version
- - yarn run build
+ - yarn build
+ - yarn test
# Tests have to run before Danger runs because
# danger-plugin-jest references the test output
- - yarn run test
- - yarn run danger
- - yarn run flow
- - yarn run lint && yarn run typescript && yarn run tslint
+ # - yarn danger
+ - yarn flow
+ - yarn lint
+ - yarn typescript
+ - yarn tslint
notifications:
email:
on_failure: change
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2a108daba..868d79049 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,9 +6,29 @@ _The format is based on [Keep a Changelog](http://keepachangelog.com/) and this
## Unreleased
-* Fix off-by-one error in insertRuleHelpers.js, by [@migueloller](https://github.com/migueloller) (see [#1749](https://github.com/styled-components/styled-components/pull/1749))
+- [placeholder]
-* Add first-class support for objects:
+## [v3.3.2] - 2018-06-04
+
+* Allow non-plain objects as `ThemeProvider` themes, by @phyllisstein (see #1780)
+
+* Upgrade flow-bin to latest, by @halvves (see #1748)
+
+* Update various CI bits, by @probablyup (see #1769)
+
+* Reimplement SSR stream handling as a transform stream rather than a second-order readable stream, by @probablyup (see #1768)
+
+* Allow React Component as attr, by @valerybugakov (see #1751)
+
+* Added pointer events to valid attributes check, by @plankguy (see #1790)
+
+_v3.3.1 was skipped due to a bad deploy._
+
+## [v3.3.0] - 2018-05-25
+
+* Fix off-by-one error in insertRuleHelpers.js, by @migueloller (see #1749)
+
+* Add first-class support for objects, by @mxstbr (see #1732)
```JS
const Component = styled.div({
@@ -16,15 +36,15 @@ _The format is based on [Keep a Changelog](http://keepachangelog.com/) and this
})
```
-- Fix typo in console warning about multiple instances, by [@lucianbuzzo] (see [#1730](https://github.com/styled-components/styled-components/pull/1730))
+- Fix typo in console warning about multiple instances, by @lucianbuzzo (see #1730)
-- Make the multiple instance warning criteria a little more strict to avoid badgering people running unit tests ([see #1693](https://github.com/styled-components/styled-components/pull/1693))
+- Make the multiple instance warning criteria a little more strict to avoid badgering people running unit tests, by @probablyup (see #1693)
-- Fix `React.createRef()` values for `innerRef` being ignored in React Native, by @simonbuchan (see [#1718](https://github.com/styled-components/styled-components/pull/1718))
+- Fix `React.createRef()` values for `innerRef` being ignored in React Native, by @simonbuchan (see #1718)
- Hoist non-react static properties on wrapped classes, by @probablyup (see #1750)
-- Support attributes prefixed by `x-` (see [#1753](https://github.com/styled-components/styled-components/pull/1753))
+- Support attributes prefixed by `x-`, by @mlecoq (see #1753)
## [v3.2.6] - 2018-04-17
@@ -474,7 +494,8 @@ _The format is based on [Keep a Changelog](http://keepachangelog.com/) and this
* Fixed compatibility with other react-broadcast-based systems (like `react-router` v4)
-[unreleased]: https://github.com/styled-components/styled-components/compare/v3.2.6...master
+[unreleased]: https://github.com/styled-components/styled-components/compare/v3.3.0...master
+[v3.3.0]: https://github.com/styled-components/styled-components/compare/v3.2.6...v3.3.0
[v3.2.6]: https://github.com/styled-components/styled-components/compare/v3.2.5...v3.2.6
[v3.2.5]: https://github.com/styled-components/styled-components/compare/v3.2.3...v3.2.5
[v3.2.3]: https://github.com/styled-components/styled-components/compare/v3.2.2...v3.2.3
diff --git a/appveyor.yml b/appveyor.yml
index 8dce4d446..6eda6300b 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -1,4 +1,7 @@
version: "{build}"
+branches:
+ only:
+ - master
skip_tags: true
build: off
clone_depth: 1
@@ -7,12 +10,11 @@ matrix:
fast_finish: true
environment:
matrix:
- - nodejs_version: 7
- - nodejs_version: 6
+ - nodejs_version: 8
init:
- git config --global core.autocrlf input
install:
- - ps: Install-Product node $env:nodejs_version x64
+ - ps: 'Install-Product node $env:nodejs_version x64'
- set CI=true
- yarn
cache:
@@ -20,6 +22,6 @@ cache:
test_script:
- node --version
- yarn --version
- - yarn run build
- - yarn run flow
- - yarn run lint && npm run test
+ - yarn build
+ - yarn flow
+ - yarn test
diff --git a/dangerfile.js b/dangerfile.js
index af431cce8..bd7c2ec7a 100644
--- a/dangerfile.js
+++ b/dangerfile.js
@@ -7,17 +7,27 @@ import jest from 'danger-plugin-jest'
jest()
-const jsModifiedFiles = danger.git.modified_files.filter(path => path.startsWith('src') && path.endsWith('js'))
-const vendorModifiedFiles = danger.git.modified_files.filter(path => path.startsWith('src/vendor') && path.endsWith('js'))
+const jsModifiedFiles = danger.git.modified_files.filter(
+ path => path.startsWith('src') && path.endsWith('js')
+)
+const vendorModifiedFiles = danger.git.modified_files.filter(
+ path => path.startsWith('src/vendor') && path.endsWith('js')
+)
-const hasAppChanges = jsModifiedFiles.filter(filepath => !filepath.endsWith('test.js')).length > 0
-const jsTestChanges = jsModifiedFiles.filter(filepath => filepath.endsWith('test.js'))
+const hasAppChanges =
+ jsModifiedFiles.filter(filepath => !filepath.endsWith('test.js')).length > 0
+const jsTestChanges = jsModifiedFiles.filter(filepath =>
+ filepath.endsWith('test.js')
+)
const hasTestChanges = jsTestChanges.length > 0
// Congrats, version bump up!
danger.git.diffForFile('package.json').then(packageDiff => {
if (
- packageDiff && packageDiff.version && packageDiff.version.before && packageDiff.version.after
+ packageDiff &&
+ packageDiff.version &&
+ packageDiff.version.before &&
+ packageDiff.version.after
) {
if (semver.lt(packageDiff.version.before, packageDiff.version.after)) {
message(':tada: Version BUMP UP!')
@@ -25,33 +35,46 @@ danger.git.diffForFile('package.json').then(packageDiff => {
}
})
-// Warn when there is a big PR
-const bigPRThreshold = 500
-if (danger.github.pr.additions + danger.github.pr.deletions > bigPRThreshold) {
- warn(':exclamation: Big PR')
-}
-
// Fail if there are app changes without a CHANGELOG
if (!danger.git.modified_files.includes('CHANGELOG.md') && hasAppChanges) {
- const changelogLink = 'https://github.com/styled-components/styled-components/blob/master/CHANGELOG.md'
- fail(`Please include a CHANGELOG entry. You can find it at CHANGELOG.md`)
+ const changelogLink =
+ 'https://github.com/styled-components/styled-components/blob/master/CHANGELOG.md'
+ fail(
+ `Please include a CHANGELOG entry. You can find it at CHANGELOG.md`
+ )
}
// Warn if there are library changes, but not tests (excluding vendor)
-const libraryOnlyFiles = jsModifiedFiles.filter(file => !vendorModifiedFiles.includes(file))
+const libraryOnlyFiles = jsModifiedFiles.filter(
+ file => !vendorModifiedFiles.includes(file)
+)
if (libraryOnlyFiles.length > 0 && !hasTestChanges) {
- warn("There are library changes, but not tests. That's OK as long as you're refactoring existing code")
+ warn(
+ "There are library changes, but not tests. That's OK as long as you're refactoring existing code"
+ )
}
// Warn if StyledComponent.js was edited but not StyledNativeComponent.js or viceversa
-const hasStyledChanges = danger.git.modified_files.find(path => path.endsWith('StyledComponent.js')) !== null
-const hasNativeStyledChanges = danger.git.modified_files.find(path => path.endsWith('StyledNativeComponent.js')) !== null
+const hasStyledChanges =
+ danger.git.modified_files.find(path =>
+ path.endsWith('StyledComponent.js')
+ ) !== null
+const hasNativeStyledChanges =
+ danger.git.modified_files.find(path =>
+ path.endsWith('StyledNativeComponent.js')
+ ) !== null
if (hasStyledChanges && !hasNativeStyledChanges) {
- warn("A change was made in StyledComponent.js that wasn't made in StyledNativeComponent.js or viceversa.")
+ warn(
+ "A change was made in StyledComponent.js that wasn't made in StyledNativeComponent.js or viceversa."
+ )
}
// Changes to these files may need SemVer bumps
-const semverBumpFiles = ['ThemeProvider.js', 'StyledComponent.js', 'StyledNativeComponent.js']
+const semverBumpFiles = [
+ 'ThemeProvider.js',
+ 'StyledComponent.js',
+ 'StyledNativeComponent.js',
+]
semverBumpFiles.forEach(file => {
if (jsModifiedFiles.includes(file)) {
warn('Changes to #{file} might be SemVer major changes.')
@@ -61,5 +84,7 @@ semverBumpFiles.forEach(file => {
// Be careful of leaving testing shortcuts in the codebase
jsTestChanges.forEach(file => {
const content = fs.readFileSync(file).toString()
- if (content.includes('it.only') || content.includes('describe.only')) { fail(`an \`only\` was left in tests (${file})`) }
+ if (content.includes('it.only') || content.includes('describe.only')) {
+ fail(`an \`only\` was left in tests (${file})`)
+ }
})
diff --git a/flow-typed/lodash_v4.x.x.js b/flow-typed/lodash_v4.x.x.js
deleted file mode 100644
index 90715876b..000000000
--- a/flow-typed/lodash_v4.x.x.js
+++ /dev/null
@@ -1,499 +0,0 @@
-// Manually modified version of flow-typed/lodash
-
-declare module 'lodash' {
- declare type TemplateSettings = {
- escape?: RegExp,
- evaluate?: RegExp,
- imports?: Object,
- interpolate?: RegExp,
- variable?: string,
- };
-
- declare type TruncateOptions = {
- length?: number,
- omission?: string,
- separator?: RegExp|string,
- };
-
- declare type DebounceOptions = {
- leading?: bool,
- maxWait?: number,
- trailing?: bool,
- };
-
- declare type ThrottleOptions = {
- leading?: bool,
- trailing?: bool,
- };
-
- declare type NestedArray = Array>;
-
- declare type OPredicate =
- | ((value: A, key: string, object: O) => any)
- | Object
- | string;
- declare type OIterateeWithResult = Object|string|((value: V, key: string, object: O) => R);
- declare type OIteratee = OIterateeWithResult;
-
- declare type Predicate =
- | ((value: T, index: number, array: Array) => any)
- | Object
- | string;
- declare type _Iteratee = (item: T, index: number, array: ?Array) => mixed;
- declare type Iteratee = _Iteratee|Object|string;
- declare type Iteratee2 = ((item: T, index: number, array: ?Array) => U)|Object|string;
- declare type FlatMapIteratee = ((item: T, index: number, array: ?Array) => Array)|Object|string;
- declare type Comparator = (item: T, item2: T) => bool;
-
- declare type MapIterator1 = (item: T) => U;
- declare type MapIterator2 = (item: T, index: number) => U;
- declare type MapIterator3 = (item: T, index: number, array: Array) => U;
- declare type MapIterator = MapIterator1|MapIterator2|MapIterator3;
-
- declare class Lodash {
- // Array
- chunk(array: ?Array, size?: number): Array>;
- compact(array: Array): Array;
- concat(base: Array, ...elements: Array): Array;
- difference(array: ?Array, values?: Array): Array;
- differenceBy(array: ?Array, values: Array, iteratee: Iteratee): T[];
- differenceWith(array: T[], values: T[], comparator?: Comparator): T[];
- drop(array: ?Array, n?: number): Array;
- dropRight(array: ?Array, n?: number): Array;
- dropRightWhile(array: ?Array, predicate?: Predicate): Array;
- dropWhile(array: ?Array, predicate?: Predicate): Array;
- fill(array: ?Array, value: U, start?: number, end?: number): Array;
- findIndex(array: ?Array, predicate?: Predicate): number;
- findLastIndex(array: ?Array, predicate?: Predicate): number;
- // alias of _.head
- first(array: ?Array): T;
- flatten(array: Array|X>): Array;
- flattenDeep(array: any[]): Array;
- flattenDepth(array: any[], depth?: number): any[];
- fromPairs(pairs: Array): Object;
- head(array: ?Array): T;
- indexOf(array: ?Array, value: T, fromIndex?: number): number;
- initial(array: ?Array): Array;
- intersection(...arrays: Array>): Array;
- //Workaround until (...parameter: T, parameter2: U) works
- intersectionBy(a1: Array, iteratee?: Iteratee): Array;
- intersectionBy(a1: Array, a2: Array, iteratee?: Iteratee): Array;
- intersectionBy(a1: Array, a2: Array, a3: Array, iteratee?: Iteratee): Array;
- intersectionBy(a1: Array, a2: Array, a3: Array, a4: Array, iteratee?: Iteratee): Array;
- //Workaround until (...parameter: T, parameter2: U) works
- intersectionWith(a1: Array, comparator: Comparator): Array;
- intersectionWith(a1: Array, a2: Array, comparator: Comparator): Array;
- intersectionWith(a1: Array, a2: Array, a3: Array, comparator: Comparator): Array;
- intersectionWith(a1: Array, a2: Array, a3: Array, a4: Array, comparator: Comparator): Array;
- join(array: ?Array, separator?: string): string;
- last(array: ?Array): T;
- lastIndexOf(array: ?Array, value: T, fromIndex?: number): number;
- nth(array: T[], n?: number): T;
- pull(array: ?Array, ...values?: Array): Array;
- pullAll(array: ?Array, values: Array): Array;
- pullAllBy(array: ?Array, values: Array, iteratee?: Iteratee): Array;
- pullAllWith(array?: T[], values: T[], comparator?: Function): T[];
- pullAt(array: ?Array, ...indexed?: Array): Array;
- pullAt(array: ?Array, indexed?: Array): Array;
- remove(array: ?Array, predicate?: Predicate): Array;
- reverse(array: ?Array): Array;
- slice(array: ?Array, start?: number, end?: number): Array;
- sortedIndex(array: ?Array, value: T): number;
- sortedIndexBy(array: ?Array, value: T, iteratee?: Iteratee): number;
- sortedIndexOf(array: ?Array, value: T): number;
- sortedLastIndex(array: ?Array, value: T): number;
- sortedLastIndexBy(array: ?Array, value: T, iteratee?: Iteratee): number;
- sortedLastIndexOf(array: ?Array, value: T): number;
- sortedUniq(array: ?Array): Array;
- sortedUniqBy(array: ?Array, iteratee?: (value: T) => mixed): Array;
- tail(array: ?Array): Array;
- take(array: ?Array, n?: number): Array;
- takeRight(array: ?Array, n?: number): Array;
- takeRightWhile(array: ?Array, predicate?: Predicate): Array;
- takeWhile(array: ?Array, predicate?: Predicate): Array;
- union(array?: Array): Array;
- unionBy(array?: Array, iteratee?: Iteratee): Array;
- //Workaround until (...parameter: T, parameter2: U) works
- unionWith(a1: Array, comparator?: Comparator): Array;
- unionWith(a1: Array, a2: Array, comparator?: Comparator): Array;
- unionWith(a1: Array, a2: Array, a3: Array, comparator?: Comparator): Array;
- unionWith(a1: Array, a2: Array, a3: Array, a4: Array, comparator?: Comparator): Array;
- uniq(array: ?Array): Array;
- uniqBy(array: ?Array, iteratee?: Iteratee): Array;
- uniqWith(array: ?Array, comparator?: Comparator): Array;
- unzip(array: ?Array): Array;
- unzipWith(array: ?Array, iteratee?: Iteratee): Array