-
Notifications
You must be signed in to change notification settings - Fork 26.9k
refactor(core): Add ngDevMode guards and new sanitization error codes
#66015
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
base: main
Are you sure you want to change the base?
Conversation
ngDevMode for tree-shaking in sanitizationngDevMode for tree-shaking in sanitization
202bd13 to
7350af6
Compare
| do { | ||
| if (mXSSAttempts === 0) { | ||
| throw new Error('Failed to sanitize html because the input is unstable'); | ||
| throw new Error( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those should be converted to RuntimeError. And error message without message nor code really isn't actionnable in a prod bundle.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
7350af6 to
e1ccc0a
Compare
ngDevMode for tree-shaking in sanitizationngDevMode guards and new sanitization error codes
e1ccc0a to
1508cf5
Compare
Adds new runtime sanitization error codes. Adds `ngDevMode` guards around error message strings to ensure detailed diagnostics are included only in development mode. This allows production builds to tree-shake verbose error descriptions, reducing bundle size.
1508cf5 to
1d143a8
Compare
JeanMeche
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reviewed-for: public-api, core
Adds new runtime sanitization error codes. Adds
ngDevModeguards arounderror message strings to ensure detailed diagnostics are included only
in development mode. This allows production builds to tree-shake
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information