Skip to content

Commit

Permalink
Update swc (#37149)
Browse files Browse the repository at this point in the history
* Update swc

* Update test refs

* Update test refs
  • Loading branch information
kdy1 authored May 24, 2022
1 parent 76fbae9 commit a463553
Show file tree
Hide file tree
Showing 34 changed files with 128 additions and 239 deletions.
37 changes: 18 additions & 19 deletions packages/next-swc/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ export default function Home() {

<div data-custom="2">

<h1 nested={()=><div >nested</div>
}>Hello World!</h1>
<h1 nested={()=><div >nested</div>}>Hello World!</h1>

</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ export default (()=><_StyledDiv >

</Card>

</_StyledDiv>
);
</_StyledDiv>);
var _StyledDiv = _styled("div")`
width: 35em;
`;
Original file line number Diff line number Diff line change
Expand Up @@ -18,72 +18,55 @@ const Thing2 = styled(Thing).withConfig({
`;
/*
* Basic fixtures
*/ const StaticString = (p)=><_StyledP >A</_StyledP>
;
*/ const StaticString = (p)=><_StyledP >A</_StyledP>;
const StaticTemplate = (p)=><_StyledP2 >

A

</_StyledP2>
;
const ObjectProp = (p)=><_StyledP3 >A</_StyledP3>
;
const NoChildren = (p)=><_StyledP4 />
;
</_StyledP2>;
const ObjectProp = (p)=><_StyledP3 >A</_StyledP3>;
const NoChildren = (p)=><_StyledP4 />;
const CssHelperProp = (p)=><_StyledP5 >

A

</_StyledP5>
;
</_StyledP5>;
/*
* Dynamic prop
*/ const CustomComp = (p)=><_StyledParagraph >H</_StyledParagraph>
;
const DynamicProp = (p)=><_StyledP6 $_css={props.cssText}>H</_StyledP6>
;
*/ const CustomComp = (p)=><_StyledParagraph >H</_StyledParagraph>;
const DynamicProp = (p)=><_StyledP6 $_css={props.cssText}>H</_StyledP6>;
const LocalInterpolation = (p)=><_StyledP7 $_css2={props.bg}>

H

</_StyledP7>
;
</_StyledP7>;
const FuncInterpolation = (p)=><_StyledP8 >

H

</_StyledP8>
;
</_StyledP8>;
const radius = 10;
const GlobalInterpolation = (p)=><_StyledP9 >

H

</_StyledP9>
;
</_StyledP9>;
const LocalCssHelperProp = (p)=><_StyledP10 $_css3={p.color}>

A

</_StyledP10>
;
</_StyledP10>;
const DynamicCssHelperProp = (p)=><_StyledP11 >

A

</_StyledP11>
;
const CustomCompWithDot = (p)=><_StyledButtonGhost >H</_StyledButtonGhost>
;
const NestedCompWithDot = (p)=><_StyledButtonGhostNew >H</_StyledButtonGhostNew>
;
const CustomCompWithDotLowerCase = (p)=><_StyledButtonGhost2 >H</_StyledButtonGhost2>
;
const CustomElement = (p)=><_StyledButtonGhost3 >H</_StyledButtonGhost3>
;
</_StyledP11>;
const CustomCompWithDot = (p)=><_StyledButtonGhost >H</_StyledButtonGhost>;
const NestedCompWithDot = (p)=><_StyledButtonGhostNew >H</_StyledButtonGhostNew>;
const CustomCompWithDotLowerCase = (p)=><_StyledButtonGhost2 >H</_StyledButtonGhost2>;
const CustomElement = (p)=><_StyledButtonGhost3 >H</_StyledButtonGhost3>;
const globalVar = '"foo"';
const getAfterValue = ()=>'"bar"'
;
const getAfterValue = ()=>'"bar"';
const ObjectPropMixedInputs = (p)=>{
const color = 'red';
return <_StyledP12 $_css4={p.background} $_css5={color} $_css6={globalVar} $_css7={getAfterValue()}>
Expand All @@ -100,8 +83,7 @@ const SpreadObjectPropMixedInputs = (p)=>{

</_StyledP13>;
};
/* styled component defined after function it's used in */ const EarlyUsageComponent = (p)=><_StyledThing />
;
/* styled component defined after function it's used in */ const EarlyUsageComponent = (p)=><_StyledThing />;
const Thing3 = styled.div.withConfig({
displayName: "code__Thing3",
componentId: "sc-867225be-2"
Expand All @@ -112,34 +94,27 @@ var _StyledThing6 = _styled(Thing3)((p)=>({
[p.$_css19]: {
color: 'red'
}
})
);
}));
var _StyledThing5 = _styled(Thing3)((p)=>({
[p.$_css18]: {
color: 'red'
}
})
);
}));
var _StyledThing4 = _styled(Thing3)((p)=>({
[p.$_css17]: {
color: 'red'
}
})
);
}));
var _StyledThing3 = _styled(Thing3)((p)=>({
color: p.$_css16
})
);
}));
var _StyledThing = _styled(Thing3)`color: red;`;
const EarlyUsageComponent2 = (p)=><_StyledThing2 />
;
const EarlyUsageComponent2 = (p)=><_StyledThing2 />;
function Thing4(props) {
return <div {...props}/>;
}
/* insert before usage for non-local scope styled HOC targets */ const ImportedComponentUsage = (p)=><_StyledSomeComponent />
;
const RequiredComponentUsage = (p)=><_StyledSomeOtherComponent />
;
/* insert before usage for non-local scope styled HOC targets */ const ImportedComponentUsage = (p)=><_StyledSomeComponent />;
const RequiredComponentUsage = (p)=><_StyledSomeOtherComponent />;
const ObjectInterpolation = (p)=>{
const theme = useTheme();
return <_StyledP14 $_css15={theme.colors.red}>
Expand Down Expand Up @@ -205,26 +180,21 @@ var _StyledP5 = _styled("p")`
color: blue;
`;
var _StyledParagraph = _styled(Paragraph)`flex: 1`;
var _StyledP6 = _styled("p")`${(p)=>p.$_css
}`;
var _StyledP6 = _styled("p")`${(p)=>p.$_css}`;
var _StyledP7 = _styled("p")`
background: ${(p)=>p.$_css2
};
background: ${(p)=>p.$_css2};
`;
var _StyledP8 = _styled("p")`
color: ${(props)=>props.theme.a
};
color: ${(props)=>props.theme.a};
`;
var _StyledP9 = _styled("p")`
border-radius: ${radius}px;
`;
var _StyledP10 = _styled("p")`
color: ${(p)=>p.$_css3
};
color: ${(p)=>p.$_css3};
`;
var _StyledP11 = _styled("p")`
color: ${(props)=>props.theme.color
};
color: ${(props)=>props.theme.color};
`;
var _StyledButtonGhost = _styled(Button.Ghost)`flex: 1`;
var _StyledButtonGhostNew = _styled(Button.Ghost.New)`flex: 1`;
Expand All @@ -240,8 +210,7 @@ var _StyledP12 = _styled("p")((p)=>({
'::after': {
content: p.$_css7
}
})
);
}));
var _StyledP13 = _styled("p")((p)=>({
...{
'::before': {
Expand All @@ -267,14 +236,11 @@ var _StyledP13 = _styled("p")((p)=>({
'::after': {
content: p.$_css14
}
})
);
}));
var _StyledP14 = _styled("p")((p)=>({
color: p.$_css15
})
);
}));
var _StyledDiv = _styled("div")((p)=>({
...p.$_css20,
...p.$_css21
})
);
}));
Loading

0 comments on commit a463553

Please sign in to comment.