Open dddlr opened 8 months ago
Also applies to this example: (I'm sure there are many others)
const UNSAFE_container = Object.freeze({
below: {
xs: "@container not all and (min-width: 30rem)",
sm: "@container not all and (min-width: 48rem)",
md: "@container not all and (min-width: 64rem)",
lg: "@container not all and (min-width: 90rem)",
xl: "@container not all and (min-width: 110rem)"
}
});
const myStyles = css({
[UNSAFE_container.below.xs]: ...
});
<div css={myStyles}>
hello world
</div>
Imagine we have a project with the following code:
Here, index.ts is acting as a barrel file, re-exporting an already exported constant.
This cannot be statically evaluated by
@compiled/babel-plugin
, and thus we get an error (Cannot statically evaluate the value of "MemberExpression
)Ideally, we should provide a more descriptive error than this that provides some actionable information. For example:
Ideally this message should address all the common things we can think of that
@compiled/babel-plugin
cannot statically analyse, not just barrel files.