korbit-ai[bot] commented on code in PR #35186:
URL: https://github.com/apache/superset/pull/35186#discussion_r2361879178
##########
docs/src/webpack.extend.ts:
##########
@@ -23,8 +23,8 @@ import type { Plugin } from '@docusaurus/types';
export default function webpackExtendPlugin(): Plugin<void> {
return {
name: 'custom-webpack-plugin',
- configureWebpack(config, isServer, utils) {
- const { isDev } = utils;
+ configureWebpack(config) {
+ const isDev = process.env.NODE_ENV === 'development';
return {
Review Comment:
### Direct environment variable dependency <sub></sub>
<details>
<summary>Tell me more</summary>
###### What is the issue?
The function directly accesses process.env.NODE_ENV instead of using the
utilities provided by the framework, creating tight coupling with Node.js
environment.
###### Why this matters
Direct environment variable access makes the code less portable and harder
to test, as it creates a direct dependency on Node.js environment variables.
###### Suggested change β *Feature Preview*
Utilize the framework's utilities or dependency injection:
```typescript
configureWebpack(config, isServer, utils) {
const { isDev } = utils;
return {
```
###### Provide feedback to improve future suggestions
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/0ad517a7-3c08-48bc-a847-a47240e3868b/upvote)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/0ad517a7-3c08-48bc-a847-a47240e3868b?what_not_true=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/0ad517a7-3c08-48bc-a847-a47240e3868b?what_out_of_scope=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/0ad517a7-3c08-48bc-a847-a47240e3868b?what_not_in_standard=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/0ad517a7-3c08-48bc-a847-a47240e3868b)
</details>
<sub>
π¬ Looking for more details? Reply to this comment to chat with Korbit.
</sub>
<!--- korbi internal id:7bebaee1-e47d-4055-9498-17f8ba526725 -->
[](7bebaee1-e47d-4055-9498-17f8ba526725)
##########
docs/src/pages/index.tsx:
##########
@@ -505,11 +506,12 @@ export default function Home(): JSX.Element {
}, []);
return (
- <Layout
- title="Welcome"
- description="Community website for Apache Supersetβ’, a data
visualization and data exploration platform"
- wrapperClassName="under-navbar"
- >
+ <Layout>
+ <Head>
+ <title>Welcome</title>
+ <meta name="description" content="Community website for Apache
Supersetβ’, a data visualization and data exploration platform" />
+ <body className="under-navbar" />
+ </Head>
Review Comment:
### Invalid body tag inside Head <sub></sub>
<details>
<summary>Tell me more</summary>
###### What is the issue?
Invalid body tag injection to set a page body class inside Head.
###### Why this matters
Putting a body tag inside the Head component produces invalid HTML and can
lead to rendering or hydration issues. The body element should not be nested
inside the head. Styling should be applied via Layout wrapperClassName or a
dedicated container element, not by injecting a body tag.
###### Suggested change β *Feature Preview*
Apply the desired class to the Layout wrapper or a container element instead
of injecting a body tag. Example:
```tsx
<Layout wrapperClassName="under-navbar">
<Head>
<title>Welcome</title>
<meta name="description" content="Community website for Apache
Supersetβ’, a data visualization and data exploration platform" />
</Head>
{/* page content */}
</Layout>
```
###### Provide feedback to improve future suggestions
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/7d9a9ea9-e80f-4e41-89bf-4086db97dfc9/upvote)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/7d9a9ea9-e80f-4e41-89bf-4086db97dfc9?what_not_true=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/7d9a9ea9-e80f-4e41-89bf-4086db97dfc9?what_out_of_scope=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/7d9a9ea9-e80f-4e41-89bf-4086db97dfc9?what_not_in_standard=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/7d9a9ea9-e80f-4e41-89bf-4086db97dfc9)
</details>
<sub>
π¬ Looking for more details? Reply to this comment to chat with Korbit.
</sub>
<!--- korbi internal id:911aba0a-f1c9-4bcb-ab79-7ef47bfef37e -->
[](911aba0a-f1c9-4bcb-ab79-7ef47bfef37e)
--
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]