Skip to content

feat: configure custom source maps through generic PrinterOptions - #22

Open
intellild wants to merge 1 commit into
codex/rstack-rename-sourcemap-featurefrom
codex/rstack-generic-printer-options
Open

intellild wants to merge 1 commit into
codex/rstack-rename-sourcemap-featurefrom
codex/rstack-generic-printer-options

Conversation

@intellild

@intellild intellild commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add custom source map support through PrinterOptions<'a, S> and keep a single StyleSheet::to_css(options) entry point.
  • Implement Default for the no-map specialization so ordinary calls can keep using PrinterOptions::default().
  • Extract the map when constructing the printer. Serialization helpers continue to read the same options type, and the concrete map type handles inline map parsing and writing through static dispatch.

Example

An embedder can use its own map implementation while ordinary callers keep the same entry point.

let css = stylesheet.to_css(PrinterOptions::default())?;
let css_with_mappings = stylesheet.to_css(
  PrinterOptions::default().with_source_map(&mut custom_map),
)?;

Validation

  • Workspace check with all features
  • Root crate tests with all features (189 passed)
  • Custom bundler source map tests without default features (3 passed)
  • Custom at-rule example and test compilation with only visitor enabled
  • Transform benchmark compilation

Stack

  1. Fix bundled source-map indices
  2. Use std::fmt::Write for printer output
  3. Serialize CSS through PrinterTrait
  4. Introduce the custom_sourcemap feature flag
  5. This PR

by OpenAI Codex

@codspeed

codspeed Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 12 untouched benchmarks
⏩ 4 skipped benchmarks1


Comparing codex/rstack-generic-printer-options (a002b2f) with codex/rstack-rename-sourcemap-feature (43b17bc)

Open in CodSpeed

Footnotes

  1. 4 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T02:23:13.082148Z a002b2f Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants