3086 Commits

Author SHA1 Message Date
Evan Jacobs
2aa15b3da6 adjust changelog v5.1.0 2020-04-07 01:21:36 -04:00
Evan Jacobs
c57a273ed7 v5.1.0 2020-04-07 01:20:46 -04:00
Evan Jacobs
58538b72be shouldForwardProp receives the second argument, a default filter function 2020-04-07 00:59:07 -04:00
Evan Jacobs
8836289376 add knowledge of react-is "typeof" to rollup 2020-04-07 00:47:41 -04:00
dependabot[bot]
55fc70a4d2 Bump acorn from 5.7.3 to 7.1.1 in /packages/styled-components (#3092)
Bumps [acorn](https://github.com/acornjs/acorn) from 5.7.3 to 7.1.1.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/5.7.3...7.1.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-04-07 00:46:19 -04:00
Keegan Street
843b018873 Change isPlainObject to support objects created in a different context (#3068)
* Changed isPlainObject to support objects created in a different context

* Update isPlainObject test to support objects without a toString method

Co-authored-by: Keegan Street <keegan.street@rea-group.com>
2020-04-07 00:46:04 -04:00
Evan Jacobs
0c6852bd86 transient props (#3052) 2020-04-07 00:42:33 -04:00
Evan Jacobs
4293579342 minor dep updates (#3091)
* minor dep updates

* move stuff out of dependencies that shouldn't be there
2020-04-07 00:41:06 -04:00
egdbear
94df8bb57c Bump is-prop-valid (#3058) 2020-03-10 14:24:17 -04:00
Evan Jacobs
e02109e626 shouldForwardProp support (#3006)
* Add support for shouldForwardProp

adds support for use of `shouldForwardProp` config method, which can be used to explicitly determine which props should be forwarded on
if this config is not provided then existing functionality is preserved (i.e. all props passed to components, or for HTML elements check using `validAttr`)

Inspired by the same feature in emotion

* refactor of shouldForwardProp support

following feedback from @kitten, `shouldForwardProp` now has a proper flow-type definition
refactor how `shouldForwardProp` is used to make code slightly clearer
code to compose `shouldForwardProp` now in-lined into `createStyledCompontent`

* minor logic tweak following review
2020-03-05 15:31:58 -05:00
Evan Jacobs
e56952a7d7 revise SSR+hydration functionality to be more fault-tolerant (#3018)
* Fix RULE_RE to reduce backtracking

Fix #3017

* Add CHANGELOG entry

* revise SSR emitter & rehydrator to use a split sequence instead of regex

* Fix splitting to be per rule

* Update CHANGELOG entry

* Add newline to SPLITTER constant

* skip garbage nodes

* adjust snapshot

Co-authored-by: Evan Jacobs <probablyup@gmail.com>
2020-03-05 15:23:35 -05:00
Phil Pluckthun
d0e8eab8cf Emphasise removal of deprecated API in CHANGELOG
See #3003
2020-02-05 20:46:15 +00:00
Evan Jacobs
4440112278 v5.0.1 v5.0.1 2020-02-04 12:42:11 -05:00
Phil Plückthun
3390244224 Add warning for components that are created dynamically (#2998)
* Add check for whether component is used dynamically

* Fix checkDynamicCreation call and dedup by message

* Add tests for dynamic creation warning
2020-02-04 12:38:53 -05:00
Evan Jacobs
581993b039 add dev-time warning discouraging usage of @import (#2997)
* add dev-time warning discouraging usage of @import

* includes -> indexOf for IE compat
2020-01-31 17:31:40 -05:00
Evan Jacobs
a35d01e7fc update lockfile 2020-01-30 23:11:30 -05:00
Phil Plückthun
4bf44fcd44 Fix upper group limit in GroupedTag (#2996)
* Fix upper group limit to allow for 2^31 components.

Previously the formula for increasing the size of Uint32Arrays
in the GroupedTag was a little aggressive and would cut of very
short of 2^31 groups. Instead it would cut off between 2^12 and
2^13 components, which isn't quite a lot.

This new upper boundary is the absolute limit of how many slots
a Uint32Array is defined to be able to hold. After this limit we'll
see an error.

Instead of letting this error leak out we now throw a more clear
error that hints at this limitation.

* Add test for upper group limit

* Add additional check for GroupIDAllocator

We can make it easier to track the offending
dynamic components in development by adding another
SMI overflow check to the GroupIDAllocator

* Replace TypeError in dom utils with throwStyledError

* changelog entry

Co-authored-by: Evan Jacobs <probablyup@gmail.com>
2020-01-30 23:10:09 -05:00
Evan Jacobs
216f03deb0 attempt to resolve a SSR deopt in the hashing function (#2983)
* remove unnecessary int coercion in phash

* remove unnecessary int32 cast on the string length

* add baseline v5.0.0 benchmark to suite

* clip hash result to 32bit range

* treat benchmark compiled v5 file as binary

* fix hash not being empty in the case of no plugins

* attempt to resolve smi deopt

* faster variant of djb2
2020-01-30 11:11:08 -05:00
Matt Lubner
3f6c31a29b Skip multi-instance warning in test environments (#2991) 2020-01-27 14:43:55 -05:00
Samuli Ulmanen
93a00472e3 Fix xhtml compat for ssr stylesheet (works in v4) (#2968)
* [styled-components] fix xhtml compat for ssr stylesheet by mirroring attribute key in value

* [styled-components] data-styled=true for xhtml compat instead of copying the attribute
2020-01-27 10:49:36 +00:00
Matt Lubner
092ebcfc42 Regenerate yarn.lock to update fsevents for node>=12 (#2990)
* Regenerate yarn.lock to update fsevents for node>=12

* Update snapshots to reflect minor differences in generated output
2020-01-26 23:17:09 +00:00
Jacob Duval
d9a3becc14 Add useTheme to the list of native exports (#2982)
* Add useTheme to the default export

* Update CHANGELOG.md

Co-authored-by: Evan Jacobs <probablyup@gmail.com>
2020-01-25 15:00:28 -05:00
Evan Jacobs
c1a7c32c81 update changelog 2020-01-22 14:52:36 -05:00
Evan Jacobs
63b083d43a dynamic size badge 2020-01-14 16:09:16 -05:00
Evan Jacobs
6ec9dd2e09 Update README.md 2020-01-13 18:19:38 -05:00
Evan Jacobs
53bc31f8fb add note on TS 2020-01-13 18:17:02 -05:00
Evan Jacobs
60d02ee0b4 v5.0.0 v5.0.0 2020-01-13 13:13:32 -05:00
Evan Jacobs
147b0e9a1f Merge pull request #2863 from styled-components/v5
v5
2020-01-13 13:05:27 -05:00
Evan Jacobs
aca9186920 allocate cGS instances from the stylesheet instead (#2947)
* remove an unnecessary allocation in cGS

* allocate cGS instances from the stylesheet instead

fixes #2913

Previously the cGS instance count was managed locally in the cGS factory,
which works fine client-side but will never be reset properly for
server-side rendering (in this case, each cGS factory should be reset
to an instance count of 0 per rendering run.)
2020-01-13 13:00:47 -05:00
Evan Jacobs
fe2a2ccfa4 adjust rehydration regex to handle deeply-nested MQs (#2949)
fixes #2946
2020-01-06 16:29:03 -05:00
Evan Jacobs
d227ec9bdc Add componentId to "Over 200 classes..." warning (#2948)
* Add componentId to "Over 200 classes..." warning

Two minor changes:
- Add optional `componentId` parameter to `src/utils/createWarnTooManyClasses.js` that is then rendered in the warning if it exists.
- Pass in `componentId` in `src/models/StyledComponent.js`

Implements #2776

(cherry picked from commit c1c02425dcd5367bccd543332b8833d29e38b4ee)

* Remove `$FlowFixMe`

 This was likely added during rebase / was brought over from the master branch.

(cherry picked from commit 0314552eafc090b63d4bbe2f0f907a2e468b4a30)

* minor adjustments

Co-authored-by: Bee Ellis <44533466+hegelocampus@users.noreply.github.com>
2020-01-06 16:27:54 -05:00
Evan Jacobs
dff9510b0b inline stylis-rule-sheet (#2940)
fixes #2874

(and saves some bytes)
2020-01-03 12:06:24 -05:00
Evan Jacobs
37f472da70 v5.0.0-rc.3 v5.0.0-rc.3 2019-12-29 22:54:20 -05:00
Evan Jacobs
cd3ef89673 refactor stylis management (#2936)
* emit differentiated dynamic hashes for subtrees with different stylis plugins

* reorganize hashing files to avoid a cycle

* prehash the stylis plugin function bodies to make later hashing faster

* look for plugin.name in stylisPlugins for uniqueness

* throw an error instead of a dev-time warning if stylis plugins aren't named

minification can introduce the issue, so a dev warning isn't sufficient

* remove unused fallback code

* use stylis-plugin-rtl

* actually add the plugin

* just use phash

* cache djb2 seed
2019-12-29 22:35:55 -05:00
James Armenta
7ea065cba6 Expose version in API (#2888)
* Export bundle version

* Comment for version export

* Better version comment
2019-12-27 16:10:17 -05:00
Evan Jacobs
67ddce95fb run ci against v5 2019-12-25 23:15:06 -05:00
Evan Jacobs
bef7299b73 fix usage of nested stylesheetmanagers in SSR 2019-12-25 23:15:06 -05:00
Toru Kobayashi
9aaac333e9 use funding field instead of post install script (#2931) 2019-12-23 11:27:37 -05:00
Evan Jacobs
7e11092c7a switch back to mainline hoist-non-react-statics (#2934)
should fix #2930
2019-12-23 11:27:01 -05:00
Max Stoiber
9e29e497a1 Merge pull request #2898 from vepor/css-without-interpolations
Unnecessary flattening and interleave of css without interpolations
2019-12-02 10:34:44 +01:00
Luděk Vepřek
ffa7d5a895 Unnecessary flattening and interleave of css without interpolations 2019-12-02 09:46:26 +01:00
Jafar Rezaei
9b7a60c3f5 Make useTheme cleaner (#2879) 2019-11-30 18:05:25 -05:00
Max Stoiber
921e14f7af Merge pull request #2887 from styled-components/vulnerable-workflow
Remove vulnerable workflow
2019-11-21 08:56:45 +01:00
Kornel Dubieniecki
ce0b708c43 Remove vulnerable workflow 2019-11-20 22:27:33 +01:00
Evan Jacobs
50d1284518 v5.0.0-rc.2 v5.0.0-rc.2 2019-11-12 16:48:04 -05:00
Evan Jacobs
270d464a94 replace rehydration from CSSOM with progressive regex (#2872)
* replace rehydration from CSSOM with progressive regex

* lighter suppression comment, remove some unnecessary allocations
2019-11-12 16:42:44 -05:00
Max Stoiber
c914e00378 Merge pull request #2868 from styled-components/lekterable-patch-1
Update `inclusive organization` action to add contributors to a team and add a comment
2019-11-09 11:12:29 +01:00
Kornel Dubieniecki
6667e7bb0e Update main.yml 2019-11-09 10:12:16 +01:00
Max Stoiber
7a8c817574 Merge pull request #2867 from lekterable/master
Use 'Inclusive Organization' action to invite contributors to organization
2019-11-08 11:58:39 +01:00
Kornel Dubieniecki
ec9fa146c7 Update .github/workflows/main.yml
Co-Authored-By: Max Stoiber <contact@mxstbr.com>
2019-11-08 11:48:27 +01:00