Tags: vercel/satori
Tags
fix: Performance improvement (#707) - Improve caching: generating images with the same font buffer will re-use the parsed font file; - Improve caching: avoid re-computing paths of the same glyph in one pass (this is highly inspired by @NiteshSingh17's work in #679). ``` clk: ~4.15 GHz cpu: Apple M4 Pro runtime: node 22.13.1 (arm64-darwin) benchmark avg (min … max) p75 / p99 (min … top 1%) ------------------------------------------- ------------------------------- satori 3.88 ms/iter 4.07 ms █ (3.40 ms … 7.24 ms) 6.00 ms █▅ ▆ ▃ ( 3.63 mb … 11.83 mb) 6.76 mb ███████▄▄▂▂▂▂▁▁▂▁▂▁▁▂ satori + resvg 31.76 ms/iter 32.07 ms █ █ █ (31.31 ms … 32.50 ms) 32.21 ms █▅▅█▅ ▅ ▅▅ ▅▅ ▅▅█▅ ( 6.78 mb … 6.82 mb) 6.79 mb █████▁█▁██▁▁▁██▁▁████ satori + sharp 14.30 ms/iter 14.36 ms █ ▅█ (13.95 ms … 15.21 ms) 15.11 ms ███▆██ ( 6.80 mb … 6.92 mb) 6.83 mb █▁████████▄▁▁▄▁▁▄▁▁▁▄ summary satori 3.69x faster than satori + sharp 8.19x faster than satori + resvg ``` Before this change: ``` satori 4.06 ms/iter 4.29 ms █ (3.47 ms … 7.41 ms) 6.48 ms ▅█▅▆▆ ▃ ( 3.57 mb … 11.78 mb) 6.60 mb ███████▄▆▄▂▁▂▁▂▁▂▂▁▁▂ ``` It's a ~7% change in P99.
fix: handle z-index as unitless property (#667) ## Description ### Current behavior: When setting z-index values in styles, a warning appears stating "Expected style 'zIndex: 1px' to be unitless". This warning is incorrect since z-index should be handled as a unitless property. While z-index has no effect in SVG (as elements are painted in document order), the warning itself needs to be fixed for better developer experience. ### Changes in this PR: - Added special case handling for `zIndex` property - Added clear warning message explaining that z-index is not supported in SVG - Improved developer experience by providing more accurate feedback about SVG limitations Closes #660 ## Test plan ### Before The floating warning appears in console when setting z-index: ```javascript style={{ zIndex: 1 }} ``` Shows warning: "Expected style 'zIndex: 1px' to be unitless"  ### After 1. Set z-index in styles 2. Verify the correct warning appears: "z-index is not supported in SVG. Elements are painted in the order they appear in the document." 3. Test with different z-index values 4. Verify the warning is clear and helpful for developers  --------- Co-authored-by: Shu Ding <g@shud.in>
feat: Switch to yoga-layout (#689) ## Summary Replace yoga-wasm-web with yoga-layout for better performance and maintainability. ## Test Plan - [x] All tests run - [x] Lint fixes applied - [x] Prettier formatting applied - [x] Playground tested and working ## Known Issues - Some snapshot tests have mismatches - Type errors present for "auto" and percentage string support in flexBasis and (max|min)(Height|Width) properties These will be addressed in follow-up commits. --------- Co-authored-by: Shu Ding <g@shud.in>
fix: allow lines to start with words that begin with special characte… …rs (#674) Closes #656. ## Current behavior <https://og-playground.vercel.app/?share=LY7BasMwEER_RUyugrrQQhFpCJT-QY662NHGUiJrjb2OCcb_HsnJaeftLDuz4MyOYLB34W6TUqM8Iv0uS9FKzcGJN-rzu9KvRVOfb-3AU3J_HHkwymL2Qcii-Otq06GIY_ao0-oY-nHKc_fm3cY27T9y3AEa3EvgNMIs2LJgfqpKw1NovcB8FXDUTC3MpY4jaVDH13B69KW0zBvlPxdO8t815GBkmGjVkLrJF55i5JmH6LA-AQ> ## Proposed behavior <https://satori-playground-git-fork-erxclau-special-character-word-wrap.vercel.sh/?share=LY7BasMwEER_RUyugrrQQhFpCJT-QY662NHGUiJrjb2OCcb_HsnJaeftLDuz4MyOYLB34W6TUqM8Iv0uS9FKzcGJN-rzu9KvRVOfb-3AU3J_HHkwymL2Qcii-Otq06GIY_ao0-oY-nHKc_fm3cY27T9y3AEa3EvgNMIs2LJgfqpKw1NovcB8FXDUTC3MpY4jaVDH13B69KW0zBvlPxdO8t815GBkmGjVkLrJF55i5JmH6LA-AQ> --------- Co-authored-by: Shu Ding <g@shud.in>
PreviousNext