Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update swc #37149

Merged
merged 3 commits into from
May 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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