next.js
2225e589 - [dev-overlay] minify css (#76370)

Commit
309 days ago
[dev-overlay] minify css (#76370) ### Why? Our internal comments in the css literal templates, are being shipped to the client along with the dev overlay, which is a bad practice. https://github.com/vercel/next.js/blob/7f5a1d39e8a94b0b424ef9538be9dd2802e6ccb6/packages/next/src/client/components/react-dev-overlay/ui/components/errors/error-overlay-bottom-stack/index.tsx#L104-L107 ### How? Added minifying css util that includes removing comments. | Before | After | |--------|--------| | ![CleanShot 2025-02-22 at 17 56 33@2x](https://github.com/user-attachments/assets/7af3d4a2-2ca2-4702-991d-beef84587837) | ![CleanShot 2025-02-22 at 17 56 18@2x](https://github.com/user-attachments/assets/8fa9a3b7-b475-448f-a4ff-63f517f8df90) | - Renamed `noop` util to `css`. - Added minifying in `css` util. - Added unit test for `css` util. - Removed unnecessary `css` util usage as it's only required for the entry point (where it injects to `<style>` tag). - Updated README (will follow up to improve). Note: This loses the benefit of VS Code extension `styled-components.vscode-styled-components`, so dropping it from recommendations. | Before | After | |--------|--------| | ![CleanShot 2025-02-22 at 17 24 52@2x](https://github.com/user-attachments/assets/4b73f1b9-42a8-44f0-9083-7117be973bed) | ![CleanShot 2025-02-22 at 17 24 58@2x](https://github.com/user-attachments/assets/1b5e9448-0802-4abc-8bb5-01bacdb2d2c5) | Closes NDX-750 Closes NDX-839
Author
Parents
Loading