bito-code-review[bot] commented on code in PR #37588:
URL: https://github.com/apache/superset/pull/37588#discussion_r2749408206


##########
docs/src/webpack.extend.ts:
##########
@@ -77,25 +77,35 @@ export default function webpackExtendPlugin(): Plugin<void> 
{
         test: /\.(tsx?|jsx?)$/,
         include: supersetFrontendPath,
         use: {
-          loader: 'babel-loader',
+          loader: 'swc-loader',
           options: {
-            presets: [
-              [
-                '@babel/preset-react',
-                {
+            // Ignore superset-frontend/.swcrc which references plugins not
+            // installed in the docs workspace (e.g. @swc/plugin-emotion)
+            swcrc: false,
+            jsc: {
+              parser: {
+                syntax: 'typescript',
+                tsx: true,
+              },
+              transform: {
+                react: {
                   runtime: 'automatic',
                   importSource: '@emotion/react',
                 },
-              ],
-              '@babel/preset-typescript',
-            ],
-            plugins: ['@emotion/babel-plugin'],
+              },
+            },
           },

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Emotion CSS-in-JS broken in SWC</b></div>
   <div id="fix">
   
   SWC config lacks @swc/plugin-emotion, which is required for Emotion 
CSS-in-JS features like `css` prop and `styled` used in `superset-frontend` 
files. Without it, components may render with broken styles (e.g., 
className="[object object]").
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #f08342</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to