chore: deprecate output.legalComments#8254
Conversation
How to use the Graphite Merge QueueAdd the label graphite: merge-when-ready to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
hyf0
left a comment
There was a problem hiding this comment.
Ensure if both are set, new one should take precdent. If each of it is set, it should work also but with a deprecation warning.
There was a problem hiding this comment.
Pull request overview
This PR deprecates the output.legalComments option in favor of the newer output.comments.legal configuration, aligning the public JS/TS API with the newer comment-control model.
Changes:
- Emit a runtime deprecation warning when
output.legalCommentsis used. - Update
OutputOptionsJSDoc to marklegalCommentsas deprecated and point users tocomments.legal. - Mark
NormalizedOutputOptions.legalCommentsas deprecated in its JSDoc.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/rolldown/src/utils/bindingify-output-options.ts | Adds a warning when deprecated legalComments is present. |
| packages/rolldown/src/options/output-options.ts | Updates legalComments documentation to reflect deprecation and migration path. |
| packages/rolldown/src/options/normalized-output-options.ts | Marks normalized legalComments as deprecated in docs. |
| * Control legal comments in the output. | ||
| * | ||
| * - `none`: no comments | ||
| * - `inline`: preserve comments that contain `@license`, `@preserve` or starts with `//!` `/*!` |
There was a problem hiding this comment.
The JSDoc for legalComments now says it controls legal comments, but the bullet none: no comments reads like it disables all comments. Consider rewording to something like “no legal comments”, and clarify the inline bullet (e.g., “starts with //! or /*!”) to avoid ambiguity.
| * Control legal comments in the output. | |
| * | |
| * - `none`: no comments | |
| * - `inline`: preserve comments that contain `@license`, `@preserve` or starts with `//!` `/*!` | |
| * Control which legal comments are preserved in the output. | |
| * | |
| * - `none`: no legal comments | |
| * - `inline`: preserve legal comments that contain `@license` or `@preserve`, or that start with `//!` or `/*!` |
Applies #8254, which was accidentally dropped during a merge

No description provided.