Commit 41c4059
fix: keep theme bail in module-scoped style function paths
Address review comments: theme-rewritten expressions (theme.X from
useTheme()) cannot be placed in module-scoped stylex.create() style
functions since the theme variable is only available in the wrapper
component body.
- Restore bail in pseudo/media path of inline-style-props.ts where
the value expression goes into styleFnDecls (module scope)
- Restore bail in shouldForwardProp path of rule-interpolated-declaration.ts
where the expression also goes into module-scoped style functions
- Add regression tests for both scenarios
- The non-pseudo/non-media path remains fixed: theme expressions go into
callArg (component scope) where useTheme() is available
Co-authored-by: Kenneth Skovhus <skovhus@users.noreply.github.com>1 parent 87fbf8e commit 41c4059
File tree
3 files changed
+58
-21
lines changed- src
- __tests__
- internal/lower-rules
3 files changed
+58
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3597 | 3597 | | |
3598 | 3598 | | |
3599 | 3599 | | |
| 3600 | + | |
| 3601 | + | |
| 3602 | + | |
| 3603 | + | |
| 3604 | + | |
| 3605 | + | |
| 3606 | + | |
| 3607 | + | |
| 3608 | + | |
| 3609 | + | |
| 3610 | + | |
| 3611 | + | |
| 3612 | + | |
| 3613 | + | |
| 3614 | + | |
| 3615 | + | |
| 3616 | + | |
| 3617 | + | |
| 3618 | + | |
| 3619 | + | |
| 3620 | + | |
| 3621 | + | |
| 3622 | + | |
| 3623 | + | |
| 3624 | + | |
| 3625 | + | |
| 3626 | + | |
| 3627 | + | |
| 3628 | + | |
| 3629 | + | |
| 3630 | + | |
| 3631 | + | |
| 3632 | + | |
| 3633 | + | |
| 3634 | + | |
| 3635 | + | |
| 3636 | + | |
| 3637 | + | |
| 3638 | + | |
| 3639 | + | |
| 3640 | + | |
| 3641 | + | |
| 3642 | + | |
| 3643 | + | |
| 3644 | + | |
| 3645 | + | |
| 3646 | + | |
| 3647 | + | |
3600 | 3648 | | |
3601 | 3649 | | |
3602 | 3650 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
116 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| |||
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | 138 | | |
142 | 139 | | |
143 | | - | |
144 | | - | |
| 140 | + | |
| 141 | + | |
145 | 142 | | |
146 | 143 | | |
147 | 144 | | |
| |||
Lines changed: 5 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1964 | 1964 | | |
1965 | 1965 | | |
1966 | 1966 | | |
1967 | | - | |
1968 | | - | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
1969 | 1970 | | |
1970 | 1971 | | |
1971 | 1972 | | |
| |||
1977 | 1978 | | |
1978 | 1979 | | |
1979 | 1980 | | |
1980 | | - | |
1981 | | - | |
1982 | | - | |
1983 | 1981 | | |
1984 | 1982 | | |
1985 | 1983 | | |
1986 | 1984 | | |
1987 | 1985 | | |
1988 | | - | |
1989 | | - | |
| 1986 | + | |
1990 | 1987 | | |
1991 | 1988 | | |
1992 | 1989 | | |
| |||
2007 | 2004 | | |
2008 | 2005 | | |
2009 | 2006 | | |
2010 | | - | |
2011 | | - | |
2012 | | - | |
2013 | | - | |
2014 | | - | |
2015 | | - | |
| 2007 | + | |
2016 | 2008 | | |
2017 | 2009 | | |
2018 | 2010 | | |
| |||
0 commit comments