Repository navigation
[WIP] Fix url() css function removal in styled-components - #5639
Conversation
🦋 Changeset detectedLatest commit: 2e0a7db The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@copilot Ensure this is comprehensively fixed for all types of CSS functions and single/double/no-quote scenarios. This includes @font-face statements that have URLs and any other realistic scenario where a URL might occur in modern CSS. Use jest for both testing and experimentation to avoid dealing with typescript conversion issues. |
…stripping Co-authored-by: quantizor <[email protected]>
Co-authored-by: quantizor <[email protected]>
Fixed in commits cca71a8 and 861cd9d. The fix now comprehensively handles all URL scenarios:
Also added word boundary checking to prevent false matches like Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot This is one of the hottest paths in the system, please microbenchmark your approach and remove anything "extra" that does not directly contribute to the fix. |
Co-authored-by: quantizor <[email protected]>
Optimized in ad51318. Microbenchmark results:
Benchmark: ~304ns per call, adding only ~8ns overhead to the original implementation. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot run the formatter, add an instruction to AGENTS.md to ensure the formatter is always run before committing code changes |
Co-authored-by: quantizor <[email protected]>
Done in 2e0a7db. Ran the formatter and added the following rule to AGENTS.md: |
url()CSS function values containing//(likehttps://) were being stripped because//was treated as a line commenturl()context instripLineCommentsfunction to skip comment detection inside URL functionsisWordCharfunction and word boundary check| 32for efficient case-insensitive comparisonOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.