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

babel-make-styles plugin causing build failures after migrating react-avatar to new DX #18903

Closed
Hotell opened this issue Jul 12, 2021 · 4 comments

Comments

@Hotell
Copy link
Contributor

Hotell commented Jul 12, 2021

After migrating react-avatar to new DX via yarn nx workspace-generator migrate-converged-pkg build started failing

#18866


The CI file is caused by babel-make-styles plugin:

Current:

2021-07-12 at 13 51

After removing make styles plugin from babelrc:
2021-07-12 at 13 56

↓↓↓↓

yarn lage build --to @fluentui/react-avatar

↓↓↓↓

2021-07-12 at 13 52

can you help us out @layershifter ?


there is also another issue, that is caused by make-styles - it uses ES2015+ language features, thus API extractor will properly notify us that something is not ok. (this was reported/discovered by @ling1726 )

2021-07-12 at 13 53

You'll need to change lib to es2015
2021-07-12 at 13 53

Originally posted by @Hotell in #18866 (comment)

@Hotell
Copy link
Contributor Author

Hotell commented Jul 12, 2021

quick fix provided by @layershifter

This looks like an issue with @linaria/shaker, I will debug the problem and report it. Currently, to unblock the PR I suggest to apply the following change:

  const rootClasses = styles.root;
  const svgClasses = styles.svg;

  return { containerProps, nativeProps, rootClasses, svgClasses };
};

+export const renderIcon = (
-const renderIcon = (
  SVGElement: (props: { svgClasses: string }) => JSX.Element,
): React.FC<React.HTMLAttributes<HTMLSpanElement>> => props => {
  const { containerProps, nativeProps, rootClasses, svgClasses } = useIconProps(props);

@ling1726
Copy link
Member

ling1726 commented Jul 21, 2021

I managed to get a minimal repro thanks to debugging guidance from @layershifter. It seems that this is an issue with linaria shaker.

Submitted issue: callstack/linaria#804 to them with the minimal repro

@Hotell
Copy link
Contributor Author

Hotell commented Aug 25, 2021

@layershifter @ling1726 I see this issue was closed callstack/linaria#804, does it mean this one could be closed as well?

@layershifter
Copy link
Member

@Hotell yes, this was fixed and can be closed.

@microsoft microsoft locked as resolved and limited conversation to collaborators Sep 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants