Commit Graph

334 Commits

Author SHA1 Message Date
Phil Pluckthun
489c0f2980 Remove stream require switch with __SERVER__ build global
Instead, we can dynamically require "stream" with an expression
that prevents it from being bundled in client-side bundling
processes. This may still fail in some folding scenarios, but
I've personally successfully applied it here before:
3455401e6f/exchanges/persisted-fetch/src/sha256.ts (L33-L40)

This is guaranteed to at least work against Webpack, Rollup, and
other 'primitive' bundlers.
2021-08-09 20:54:42 +01:00
Rogin Farrer
9fa16b0cec Support use of css tagged template inside style objects (#3469) 2021-07-08 16:59:59 -04:00
Evan Jacobs
14e215811b v5.3.0 2021-05-04 22:17:17 -04:00
liorEhrlich
02ec0d5648 Fix - add textpath element v5 (#3461)
* Add textPath to domElements

* Update CHANGELOG
2021-05-04 22:12:19 -04:00
tkow
b0a80410aa Fix style prop accepts function in native components for v5 (#3389)
* Fix style prop accepts function in native components for v5

* update: add a change log entry
2021-05-04 22:09:45 -04:00
Aron Griffis
010f1d79ae feat: pass elementToBeCreated to shouldForwardProp (#3451)
The internal decision whether to forward a prop is based on the
combination of the key and elementToBeCreated, but only the former was
passed to shouldForwardProp.

This is a port of #3436 to legacy-v5
2021-04-06 11:29:50 -04:00
Evan Jacobs
4b23158620 v5.2.3 2021-03-31 10:14:58 -04:00
Till Hainbach
d8f7b05c41 fix(ssr): fix 'window' undefined reference error 2021-03-31 09:20:40 +02:00
Evan Jacobs
bdde5e2d82 v5.2.2 2021-03-30 11:44:43 -04:00
Evan Jacobs
99e5731fba Merge pull request #3397 from Smart-Tag-Studio/legacy-v5
[fix] COMPLEX_SELECTOR_PREFIX.includes wasn't transpiled
2021-03-30 11:37:25 -04:00
Aron Griffis
6661228cca feat: macro can customize importModuleName
If `styled` should come from a wrapper instead of directly from
styled-components, this enables users of the macro to customize the
import by configuring in `packages.json`:

    "babelMacros": {
      "styledComponents": {
        "importModuleName": "my-styled-components"
      }
    }

Previously similar functionality landed in
babel-plugin-styled-components so users of the plugin could use
a wrapper at that level, but it wasn't available to users of the macro.
This builds on that work by passing the customized module name through
to the plugin. Consequently we also update the dependency to ensure the
plugin supports `topLevelImportPaths`

See 325167bb57

Fixes https://github.com/gregberge/xstyled/issues/44

Cherry picked from 83c8b0ccd0
2021-03-10 14:03:04 -05:00
Aron Griffis
7b1c3aaffe fix macro test regression (#3420)
We don't need the mock at all, because babel-plugin-tester provides
pluginOptions to override.

Cherry picked from 17d7e01e77
2021-03-10 13:51:57 -05:00
Torgeir Skjøtskift
15b0796071 use window.__webpack_nonce__ to avoid overwriting by react-scripts 2021-03-01 13:28:26 +01:00
gatsbimantico
8d13a04793 [fix] COMPLEX_SELECTOR_PREFIX.includes wasn't transpiled 2021-02-08 17:08:55 +00:00
Gautham Chandra
cf9c674005 Ensure components for react-native pass testID
When developing for react native, components are sometimes marked with
the `testID` prop. This prop is functionally similar to the
`data-testid` attached for react web components.

Unfortunately, styled components for react native didn't pass this prop
down, making it difficult for react native test frameworks like Detox to
test.

This change fixes that so when a `testID` prop is specified for a styled
component for react-native, it is passed down to the corresponding
native component it represents
2021-01-09 13:48:28 -05:00
Evan Jacobs
683b668d92 v5.2.1 2020-10-30 11:02:53 -04:00
Yuki Ito
cd3070b183 fix styles not being added when using toHaveStyle() 2020-10-12 20:29:59 -04:00
hero
0c029557d8 Enable new style rules can be inserted in the middle of existing sheet when rendering on client after rehydrate (#3233) 2020-10-02 16:19:01 -04:00
Trevor Lohrbeer
26827b644a fix: Allow DISABLE_SPEEDY to be set to false (#3289)
* fix: Allow `DISABLE_SPEEDY` to be set to `false`

The old initialization of `DISABLE_SPEEDY` meant that the only way it could be set to a falsey value was if `NODE_ENV` was set to `production` and no other setting was set. Setting `SC_DISABLE_SPEEDY` or the environment variables to false would be overridden by `NODE_ENV`.

The new initialization ensures that if one of these options is set, it’s value is respected.

This change should only affect the computed value of `DISABLE_SPEEDY` if one of the settings has the value `false` or `’false’`. Otherwise it should have the same truthy or falsey value.

Since the expected behavior of setting one of the configuration variables to `false` is to have `DISABLE_SPEEDY` set to false, this should be a fix and not a breaking change.

* test: Add tests for setting `DISABLE_SPEEDY` to `false`

* fix: Ensure `DISABLE_SPEEDY` boolean type

Technically not needed, but makes the tests pass when passing in the string values of `’false’` without needing to modify the compare values. And is a bit cleaner to have it as a boolean type.

* fix: Inline `process.env` references

Per [this comment](https://github.com/styled-components/styled-components/pull/3289#issuecomment-699171576)

* docs: Add changelog entry
2020-09-30 22:21:03 +01:00
Evan Jacobs
e0286a105c Merge pull request #3285 from strozw/fix-benchmark
Fix module resolve error in benchmarks package
2020-09-29 11:25:10 -04:00
Shannon Rothe
c3e9da12f8 Fix wording src/packages/styled-components/base.js 2020-09-28 13:04:18 +10:00
strozw
80611faed0 change to using self styled-components 2020-09-25 10:23:17 +09:00
strozw
7e780a9e0f fix module resolve error 2020-09-24 09:38:34 +09:00
Evan Jacobs
c5c610e88c Merge pull request #3248 from styled-components/memo-if-static
update flow, rework types for StyledComponent model
2020-09-22 13:38:26 -04:00
Evan Jacobs
b8645706b2 Merge pull request #3271 from strozw/fix-sandbox-undefined-error
Fix sandbox error displaying "__SERVER__ is not defined"
2020-09-15 09:56:25 -04:00
strozw
6272fb2391 fix __SERVER__ is not defined 2020-09-14 10:34:31 +09:00
Niclas Lindgren
df94ac4132 Fix regex breaking on IE in hyphenateStyleName (#3267) 2020-09-08 11:32:50 +01:00
Evan Jacobs
4d459d4a89 v5.2.0 2020-09-04 09:16:23 -04:00
Evan Jacobs
d4b9ee8a3c v5.2.0-test.12 2020-09-02 11:46:47 -04:00
Will Heslam
dd6b3028f9 speed up hyphenating style names (#3251)
by:
1. avoiding work if not needed
2. lower casing individual upper case characters instead of entire strings
2020-09-02 11:46:01 -04:00
Will Heslam
792e41d809 fix static styles wrapping dynamic styles being wrongly identified as static (#3250) 2020-09-02 11:27:55 -04:00
Evan Jacobs
dee6c04ce2 fix build & some tweaks 2020-08-31 20:58:49 -04:00
Evan Jacobs
ee3cc0e24c update flow 2020-08-31 20:25:39 -04:00
Evan Jacobs
5f6942f0b1 v5.2.0-test.11 2020-08-31 17:10:42 -04:00
Evan Jacobs
4351e2b6da adjust minification mechanism 2020-08-31 17:10:02 -04:00
Evan Jacobs
106e5bbcf5 use github actions (#3242)
* use github actions

* remove travis

* fix step name

* do less work

* switch to bundlewatch

* set proper branch

* fix repo name env variable

* try running on branch instead
2020-08-30 16:38:43 -04:00
Evan Jacobs
0f4c55f891 nicer snapshots 2020-08-30 14:11:21 -04:00
Evan Jacobs
9e073e3140 nicer inline snapshots for HTML 2020-08-30 13:16:31 -04:00
Evan Jacobs
c8f11532e6 add test to codify cGS injection order as part of the API 2020-08-30 13:06:01 -04:00
Evan Jacobs
55427174b0 switch tests to getRenderedCSS 2020-08-30 13:05:55 -04:00
Evan Jacobs
6b0d0c5d90 v5.2.0-test.10 2020-08-30 12:27:00 -04:00
Evan Jacobs
70792e8726 preallocate global styles on cGS instantiation
Fixes #2993
2020-08-30 12:25:54 -04:00
Evan Jacobs
e6ed8a94f8 v5.2.0-test.9 2020-08-30 11:42:26 -04:00
Evan Jacobs
d85d99ad49 fix some dev warnings being accidentally removed by the minifier 2020-08-30 11:40:02 -04:00
Evan Jacobs
f12b943658 use __SERVER__ magic string 2020-08-29 22:21:10 -04:00
Evan Jacobs
b1f263234d v5.2.0-test.8 2020-08-29 22:17:54 -04:00
Evan Jacobs
f5582d9784 use yarn feature to alias npm-trunk version of styled-components 2020-08-29 22:17:15 -04:00
Evan Jacobs
2214485f9c remove browser code from server bundles 2020-08-29 22:06:22 -04:00
Evan Jacobs
b3438f7650 v5.2.0-test.7 2020-08-29 22:01:13 -04:00
Evan Jacobs
f4fd56cc7d make createGlobalStyle strict-mode compliant 2020-08-29 22:00:11 -04:00