Skip to content

Conversation

@brijeshb42
Copy link
Contributor

@brijeshb42 brijeshb42 commented Sep 5, 2025

@brijeshb42 brijeshb42 requested a review from a team September 5, 2025 13:30
@brijeshb42 brijeshb42 added the scope: code-infra Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd). label Sep 5, 2025
selector = a;
} else {
throw new Error('Missing arguments');
throw /* minify-error-disabled */ new Error('Missing arguments');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't really save that much.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 5, 2025

vite-css-base-ui-example

pnpm add https://pkg.pr.new/mui/base-ui/@base-ui-components/react@2670
pnpm add https://pkg.pr.new/mui/base-ui/@base-ui-components/utils@2670

commit: 4e1c986

@netlify
Copy link

netlify bot commented Sep 5, 2025

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 4e1c986
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/68ef9dbb9360ba0008b3bf61
😎 Deploy Preview https://deploy-preview-2670--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

case 3: return fn(state, a1, a2, a3);
default:
throw new Error('unreachable');
throw /* minify-error-disabled */ new Error('unreachable');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

* ...
*/
export default function formatErrorMessage(code: number, ...args: string[]): string {
const url = new URL(`https://base-ui.com/production-error/${code}`);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented here #1463

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be this or https://base-ui.com/production-error?code=${code}

if (process.env.NODE_ENV !== 'production') {
throw new Error('Base UI: Cannot call an event handler while rendering.');
}
throw new Error('Base UI: Cannot call an event handler while rendering.');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NODE_ENV check not needed now with extraction enabled.

@mui-bot
Copy link

mui-bot commented Sep 5, 2025

Bundle size report

Bundle Parsed size Gzip size
@base-ui-components/react ▼-5.49KB(-1.45%) ▼-950B(-0.79%)

Details of bundle changes

@brijeshb42 brijeshb42 force-pushed the error-code-extraction branch 5 times, most recently from d936046 to 2dbc69c Compare September 5, 2025 14:54
@oliviertassinari oliviertassinari changed the title [infra] Migrate error code extraction to code-infra [code-infra] Migrate error code extraction to code-infra Sep 6, 2025
@brijeshb42 brijeshb42 force-pushed the error-code-extraction branch 3 times, most recently from 604f17f to 3e1029c Compare September 8, 2025 11:17
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Sep 8, 2025
@brijeshb42 brijeshb42 force-pushed the error-code-extraction branch from 3e1029c to 4a7124d Compare September 8, 2025 15:18
@github-actions github-actions bot added PR: out-of-date The pull request has merge conflicts and can't be merged. and removed PR: out-of-date The pull request has merge conflicts and can't be merged. labels Sep 8, 2025
@brijeshb42 brijeshb42 force-pushed the error-code-extraction branch from 4a7124d to 187001a Compare September 29, 2025 06:53
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Sep 29, 2025
@brijeshb42 brijeshb42 force-pushed the error-code-extraction branch from 187001a to 43d8fdd Compare September 29, 2025 07:12
@brijeshb42 brijeshb42 requested a review from Janpot September 29, 2025 07:21
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Sep 29, 2025
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Sep 30, 2025
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Oct 2, 2025
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Oct 10, 2025
'use client';
import * as React from 'react';
import { useSearchParams } from 'next/navigation';
import codes from 'docs/src/error-codes.json';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can have basic inline markdown formatting rendering in a followup.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Oct 14, 2025
}

function assertNotCalled() {
if (process.env.NODE_ENV !== 'production') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 That's a case we may be able to detect in the babel plugin

Copy link
Member

@Janpot Janpot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good from my end 👍

@brijeshb42 brijeshb42 force-pushed the error-code-extraction branch from e6da500 to 0a4803a Compare October 15, 2025 12:54
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Oct 15, 2025
@brijeshb42 brijeshb42 force-pushed the error-code-extraction branch from 0a4803a to 4e1c986 Compare October 15, 2025 13:12
@brijeshb42
Copy link
Contributor Author

@mui/base-ui Can I get a review/approval ?

Copy link
Member

@LukasTy LukasTy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall.
Great work. 👍

Comment on lines +32 to +33
1. There hasn't been an update to the semantic meaning of the error message. Error codes need to outlive Base UI versions, so the same code must mean the same thing across versions.
2. There hasn't been a change in parameters, no added and no removed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this be "hardish" to maintain without automation as time goes by? 🤔

@brijeshb42 brijeshb42 merged commit bde10f6 into mui:master Oct 16, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance scope: code-infra Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants