3074 Commits

Author SHA1 Message Date
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
Kornel Dubieniecki
4f96af7008 Create main.yml 2019-11-08 11:28:08 +01:00
Evan Jacobs
96ed2ec455 remove canary branch disclosure from README 2019-11-07 16:33:24 -05:00
Evan Jacobs
062cfca5a9 fix building benchmarks 2019-11-07 16:29:15 -05:00
Evan Jacobs
c11750e464 upgrade wsrun, its buggy output has been annoying me 2019-11-07 16:19:19 -05:00
Evan Jacobs
e4b7fd4e14 remove some rebasing artifacts 2019-11-07 16:14:03 -05:00
Samuli Ulmanen
e2e93a635e [styled-components] add ThemeProvider to Example (#2856) 2019-11-07 16:10:19 -05:00
Samuli Ulmanen
02aaba9b70 [styled-components] streaming ssr example to devServer (#2855) 2019-11-07 16:09:50 -05:00
Evan Jacobs
12a9f3c847 (v5) aggregate classNames passed via attrs (#2859)
* add failing test

* aggregate classNames passed via attrs

fixes #2839

Normally attrs fully override the previous value, but in the case of
className they're often composed additively and it's desired to retain
the previous value in a HOC or folding scenario.

* changelog entry [skip ci]

* add simple joining util

* add function signature
2019-11-07 16:03:00 -05:00
Evan Jacobs
df36f93b76 remove the theme usage dev-time check
this was also removed in a later v4 version but missed doing it here
2019-11-07 16:03:00 -05:00
Evan Jacobs
d2f4509254 fix a few missed cases where attrs were not preferred over props 2019-11-07 16:03:00 -05:00
Evan Jacobs
5485947008 v5.0.0-rc.1 2019-11-07 16:02:59 -05:00
Evan Jacobs
4ee67293c6 inline mixinDeep util (#2846)
* inline mixinDeep util

This will ensure the ES6 syntax gets transpiled properly

* inline MIT license from mixin-deep
2019-11-07 16:02:59 -05:00