<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>Lynx 博客</title>
        <link>https://lynxjs.org/</link>
        <description>Empower the web community and invite more to build cross-platform apps</description>
        <lastBuildDate>Thu, 16 Jul 2026 08:49:03 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>zh-CN</language>
        <item>
            <title><![CDATA[A2UI 驱动的 Lynx 生成式界面]]></title>
            <link>https://lynxjs.org/zh/blog/lynx-a2ui</link>
            <guid isPermaLink="false">/zh/blog/lynx-a2ui</guid>
            <pubDate>Mon, 08 Jun 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[今天，我们正式发布 A2UI 渲染器，基于 Agent-to-UI 开放协议，把生成式 UI 带到 Lynx 上，让 AI 生成的界面原生渲染，支持流式生成与可定制组件目录。]]></description>
            <content:encoded><![CDATA[<h1 class="rp-toc-include" id="a2ui-驱动的-lynx-生成式界面"><span>A2UI 驱动的 Lynx 生成式界面</span><a href="#a2ui-驱动的-lynx-生成式界面" class="rp-header-anchor rp-link" aria-hidden="true">#</a> </h1><div class="rp-not-doc rp-llms-container"><button class="rp-not-doc rp-llms-button rp-llms-copy-button"><div class="rp-llms-copy-button__icon-wrapper"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg></div><span>复制 Markdown</span></button><button class="rp-llms-button rp-llms-view-options__trigger "><svg width="1em" height="1em" viewBox="0 0 32 32" class="rp-llms-view-options__arrow "><path fill="currentColor" d="M16 22 6 12l1.4-1.4 8.6 8.6 8.6-8.6L26 12z"></path></svg></button></div><!--$--><a href="/next/zh/blog/" class="backLink-lQPNH7">← <!-- -->所有文章</a><div class="blogHeader-ZKfIZ_"><span class="date-aB5gkw">2026年6月8日</span><div class="blog-avatar-frame-G1eJ1T avatars-aaQ1Kf"><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/HuJean.png" alt="胡静"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">胡静</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">工程师 @ Lynx</span></div></span><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/PupilTong.png" alt="王浩阳"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">王浩阳</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">工程师 @ Lynx</span></div></span><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/Sherry-hue.png" alt="艾浩"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">艾浩</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">工程师 @ Lynx</span></div></span><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/gaoachao.png" alt="高晨超"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">高晨超</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">工程师 @ Lynx</span></div></span><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/fzx2666-fz.png" alt="方舟"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">方舟</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">工程师 @ Lynx</span></div></span><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/MoonfaceX.png" alt="夏梦非"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">夏梦非</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">组件主管 @ Lynx</span></div></span><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/jkzing.png" alt="赵靖凯"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">赵靖凯</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="14" viewBox="0 0 300 271" class="icon-x-XK0uad"><path fill="currentColor" d="M236 0h46L181 115l118 156h-92.6l-72.5-94.8-83 94.8h-46l107-123L-1.1 0h94.9l65.5 86.6zm-16.1 244h25.5L80.4 26H53z"></path></svg></span><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">框架主管 @ Lynx</span></div></span><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/huxpro.png" alt="黄玄"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">黄玄</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="14" viewBox="0 0 300 271" class="icon-x-XK0uad"><path fill="currentColor" d="M236 0h46L181 115l118 156h-92.6l-72.5-94.8-83 94.8h-46l107-123L-1.1 0h94.9l65.5 86.6zm-16.1 244h25.5L80.4 26H53z"></path></svg></span><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">架构师 @ Lynx</span></div></span></div><div class="rp-not-doc rp-llms-container"><button class="rp-not-doc rp-llms-button rp-llms-copy-button"><div class="rp-llms-copy-button__icon-wrapper"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg></div><span>复制 Markdown</span></button><button class="rp-llms-button rp-llms-view-options__trigger "><svg width="1em" height="1em" viewBox="0 0 32 32" class="rp-llms-view-options__arrow "><path fill="currentColor" d="M16 22 6 12l1.4-1.4 8.6 8.6 8.6-8.6L26 12z"></path></svg></button></div></div>
<p>自 AI Agent 兴起以来，我们一直在思考：如何让 Agent 驱动的生成式 UI 真正像原生 UI 一样融入真实的应用。Lynx 在这件事上有天然优势：它在 Mobile、Web、Desktop 上原生渲染，并能直接嵌入到你已有的应用中。所以当 Google 推出 Agent-to-UI 协议 <a href="https://a2ui.org/" target="_blank" rel="noopener noreferrer" class="rp-link">A2UI</a>，一个让 AI Agent 安全生成富交互界面、无需执行任意代码的开放协议时，我们觉得这是个很自然的契合点。</p>
<p>今天，我们的 A2UI 渲染器正式发布，把生成式 UI 带到 Lynx 上。</p>
<div style="padding:10px;border-radius:8px;border:1px solid var(--semi-color-border)"><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/plugin/static/overview_zh.png" alt="Lynx A2UI Overview"/></div>
<div style="margin-top:12px;font-size:14px;text-align:center;color:var(--rp-c-text-3)">Agent 负责推理，Lynx 负责渲染。</div>
<h2 class="rp-toc-include" id="流式生成原生渲染"><a href="#流式生成原生渲染" class="rp-header-anchor rp-link" aria-hidden="true">#</a>流式生成，原生渲染</h2>
<p>A2UI 协议天然支持<a href="https://a2ui.org/concepts/data-flow/" target="_blank" rel="noopener noreferrer" class="rp-link">流式传输</a>：
Agent 一边推理一边发送 UI 片段，客户端逐步渲染。
这种渐进式的交互模式让用户不再面对空白等待，而是看着界面随 Agent 的输出逐步成型。</p>
<p>Lynx A2UI 继承了 Lynx 的 <a href="/zh/react/thinking-in-reactlynx.html" class="rp-link">双线程架构</a>：A2UI 协议消息在后台线程完成解析，UI 更新则提交到主线程呈现，两者并行互不阻塞。
即使 Agent 高频输出大量 UI 片段，界面依然保持流畅响应。</p>
<div class="box-LTvjqb   "><div class="container-qARFbv"><div class="content-Yzcw9o"><div class="code-wrap-jURSQJ"><div class="code-tab-container-5FhsBL"><div class="code-view-container-lgwabm "><div class="code-kbFEhm"><div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables" data-lang="tsx"><code style="padding:1rem 1.25rem"></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div><div class="footer-KtlqMk"><div class="semi-space semi-space-align-center semi-space-horizontal" style="max-width:100%;overflow:hidden;white-space:nowrap;row-gap:2px;column-gap:2px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><span role="img" aria-label="list" class="semi-icon semi-icon-default semi-icon-list" style="color:var(--semi-color-text-2)"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><g opacity="0.99"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9.5 3a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM8 11.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 11.5Zm0 7c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 18.5Zm-2-7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-2 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></g></svg></span></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="overflow:hidden;row-gap:2px;column-gap:2px" x-semi-prop="children"><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>a2ui</span></span><span role="img" aria-label="chevron_right_stroked" class="semi-icon semi-icon-default semi-icon-chevron_right_stroked" style="color:var(--semi-color-text-2);font-size:12px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.9 20.17a1.25 1.25 0 0 1-.07-1.77l5.71-6.15-5.7-6.15a1.25 1.25 0 0 1 1.83-1.7l6.5 7c.44.48.44 1.22 0 1.7l-6.5 7c-.47.5-1.26.54-1.77.07Z" fill="currentColor"></path></svg></span><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>src/gallery/Gallery.tsx</span></span></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:7px;column-gap:7px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg></span></button><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div></div></div></div>
<div style="margin-top:12px;font-size:14px;text-align:center;color:var(--rp-c-text-3)"><p><code>&lt;A2UI&gt;</code> 容器在后台线程解析协议消息，在主线程提交 UI
更新；即使消息频率很高，界面也能保持响应。</p></div>
<h2 class="rp-toc-include" id="基于-lynx-ui-的能力目录"><a href="#基于-lynx-ui-的能力目录" class="rp-header-anchor rp-link" aria-hidden="true">#</a>基于 lynx-ui 的能力目录</h2>
<p>A2UI 的核心机制是 <a href="https://a2ui.org/concepts/catalogs/" target="_blank" rel="noopener noreferrer" class="rp-link">能力目录（Catalog）</a>：
客户端向 Agent 声明自己支持哪些组件、函数和参数，Agent 只能在授权范围内选择。
这约束了生成边界，而每个组件具体如何渲染，则交由各端的渲染器决定。</p>
<p>Lynx A2UI 内置了一套基于 <a href="/zh/lynx-ui/index.html" class="rp-link">lynx-ui</a> 的 <a href="https://lynx-stack.dev/genui/#/a2ui/catalog" target="_blank" rel="noopener noreferrer" class="rp-link">默认组件目录</a>，涵盖按钮、列表、弹窗等常见组件，开箱即用。
在默认目录之外，开发者通常还会 <a href="https://lynx-stack.dev/zh/guide/genui/a2ui/catalog-guide" target="_blank" rel="noopener noreferrer" class="rp-link">定义自己的组件</a>，将业务能力注册到 Catalog 中，供 Agent 在对话中按需调用。</p>
<div style="overflow:hidden;height:500px;position:relative;border-radius:8px;border:1px solid var(--semi-color-border);box-sizing:border-box"><iframe src="https://lynx-stack.dev/genui/?embed=1&amp;theme=light#/a2ui/catalog" title="Lynx A2UI Catalog" sandbox="allow-scripts allow-same-origin" style="display:block;width:100%;height:100%;border:none"></iframe></div>
<div style="margin-top:12px;font-size:14px;text-align:center;color:var(--rp-c-text-3)">Lynx GenUI Playground 中的默认 Catalog，可直接交互。</div>
<h2 class="rp-toc-include" id="可编程的-action"><a href="#可编程的-action" class="rp-header-anchor rp-link" aria-hidden="true">#</a>可编程的 Action</h2>
<p>A2UI 通过 <a href="https://a2ui.org/concepts/actions/" target="_blank" rel="noopener noreferrer" class="rp-link"><code>Action</code> 机制</a> 处理用户交互：组件以结构化的方式描述用户意图，而不是执行任意代码。协议层面还把 Action 分成了两类：<a href="https://a2ui.org/concepts/actions/" target="_blank" rel="noopener noreferrer" class="rp-link"><code>functionCall</code></a> 在本地执行，Agent 完全不知情；<code>event</code> 则会回传给 Agent 继续推理。</p>
<p>Lynx A2UI 在协议之上提供了一层 API 抽象。<code>&lt;A2UI&gt;</code> 渲染容器订阅一个 <code>MessageStore</code>，按到达顺序保存原始协议消息。每当一个 Action 触发，<code>onAction</code> 会把它整理成统一的 <code>{ name, context }</code> 交给应用：要么往同一个 store 里塞一条新消息，让界面立刻更新；要么发给后端 Agent，再把流式响应写回同一个 store。</p>
<div class="box-LTvjqb   "><div class="container-qARFbv"><div class="content-Yzcw9o"><div class="code-wrap-jURSQJ"><div class="code-tab-container-5FhsBL"><div class="code-view-container-lgwabm "><div class="code-kbFEhm"><div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables" data-lang="tsx"><code style="padding:1rem 1.25rem"></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div><div class="footer-KtlqMk"><div class="semi-space semi-space-align-center semi-space-horizontal" style="max-width:100%;overflow:hidden;white-space:nowrap;row-gap:2px;column-gap:2px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><span role="img" aria-label="list" class="semi-icon semi-icon-default semi-icon-list" style="color:var(--semi-color-text-2)"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><g opacity="0.99"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9.5 3a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM8 11.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 11.5Zm0 7c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 18.5Zm-2-7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-2 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></g></svg></span></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="overflow:hidden;row-gap:2px;column-gap:2px" x-semi-prop="children"><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>a2ui</span></span><span role="img" aria-label="chevron_right_stroked" class="semi-icon semi-icon-default semi-icon-chevron_right_stroked" style="color:var(--semi-color-text-2);font-size:12px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.9 20.17a1.25 1.25 0 0 1-.07-1.77l5.71-6.15-5.7-6.15a1.25 1.25 0 0 1 1.83-1.7l6.5 7c.44.48.44 1.22 0 1.7l-6.5 7c-.47.5-1.26.54-1.77.07Z" fill="currentColor"></path></svg></span><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>src/actions/Actions.tsx</span></span></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:7px;column-gap:7px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg></span></button><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div></div></div></div>
<div style="margin-top:12px;font-size:14px;text-align:center;color:var(--rp-c-text-3)">将 Action 转发给 Agent，或在渲染侧消费它，直接驱动 UI 更新。</div>
<h2 class="rp-toc-include" id="立即体验"><a href="#立即体验" class="rp-header-anchor rp-link" aria-hidden="true">#</a>立即体验</h2>
<p><a href="https://lynx-stack.dev/genui/#/a2ui" target="_blank" rel="noopener noreferrer" class="rp-link">Lynx GenUI Playground</a> 提供了完整的交互体验，覆盖从模型对话到 UI 渲染的全链路。
无需本地搭建，打开浏览器即可与 Agent 对话并实时观察界面逐步生成。如果想在真机上感受原生渲染的效果，下载 <a href="/zh/guide/start/quick-start.html#%E5%87%86%E5%A4%87-lynx-explorer" class="rp-link">Lynx Explorer</a>，扫描页面中的二维码即可在移动设备上实时体验。</p>
<p>阅读 <a href="/zh/react/genui/a2ui.html" class="rp-link">ReactLynx 中的 A2UI 指南</a>，或直接查看更详细的 <a href="https://lynx-stack.dev/zh/guide/genui/a2ui" target="_blank" rel="noopener noreferrer" class="rp-link">接入文档预览版</a> 将 Lynx A2UI 集成到你的应用中。对应的 npm 包是 <a href="/zh/api/genui/a2ui/index.html" class="rp-link"><code>@lynx-js/genui/a2ui</code></a>，支持从 <a href="https://a2ui.org/specification/v0.9-a2ui/" target="_blank" rel="noopener noreferrer" class="rp-link">A2UI 0.9</a> 开始；我们也会与 Google 的 A2UI 团队一起适配 <a href="https://a2ui.org/specification/v1.0-a2ui/" target="_blank" rel="noopener noreferrer" class="rp-link">v1.0 候选版本</a>。
如果你在使用中遇到问题、有功能建议，或想分享你的实践案例，欢迎在 <a href="https://github.com/lynx-family/lynx-stack" target="_blank" rel="noopener noreferrer" class="rp-link">GitHub</a> 上提交 Issue 或参与讨论。</p>
<p>我们相信，AI 时代的跨平台框架不应只是能运行 AI 生成的代码，而应当为 Agent 提供一条安全、高效、原生的界面通道。Lynx A2UI 是我们在这个方向上迈出的第一步，我们也期待与社区一起探索 Open UI 等生成式 UI 的更多可能。</p><!--/$-->]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lynx 3.8：Android 上的 WebAssembly、自适应布局与更多能力]]></title>
            <link>https://lynxjs.org/zh/blog/lynx-3-8</link>
            <guid isPermaLink="false">/zh/blog/lynx-3-8</guid>
            <pubDate>Sun, 31 May 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Lynx 3.8 开启月度发布节奏，带来 Android 上的 WebAssembly、自适应布局与文本适配、HarmonyOS SessionStorage、LynxEngine 复用和 DevTool 协议支持。]]></description>
            <content:encoded><![CDATA[<h1 class="rp-toc-include" id="lynx-38android-上的-webassembly自适应布局与更多能力"><span>Lynx 3.8：Android 上的 WebAssembly、自适应布局与更多能力</span><a href="#lynx-38android-上的-webassembly自适应布局与更多能力" class="rp-header-anchor rp-link" aria-hidden="true">#</a> </h1><div class="rp-not-doc rp-llms-container"><button class="rp-not-doc rp-llms-button rp-llms-copy-button"><div class="rp-llms-copy-button__icon-wrapper"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg></div><span>复制 Markdown</span></button><button class="rp-llms-button rp-llms-view-options__trigger "><svg width="1em" height="1em" viewBox="0 0 32 32" class="rp-llms-view-options__arrow "><path fill="currentColor" d="M16 22 6 12l1.4-1.4 8.6 8.6 8.6-8.6L26 12z"></path></svg></button></div><!--$--><a href="/next/zh/blog/" class="backLink-lQPNH7">← <!-- -->所有文章</a><div class="blogHeader-ZKfIZ_"><span class="date-aB5gkw">2026年5月31日</span><div class="blog-avatar-frame-G1eJ1T avatars-aaQ1Kf"><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/mitchilling.png" alt="岳明"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">岳明</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="14" viewBox="0 0 300 271" class="icon-x-XK0uad"><path fill="currentColor" d="M236 0h46L181 115l118 156h-92.6l-72.5-94.8-83 94.8h-46l107-123L-1.1 0h94.9l65.5 86.6zm-16.1 244h25.5L80.4 26H53z"></path></svg></span><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">基础设施主管 @ Lynx</span></div></span><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/lynx-family.png" alt="Lynx 团队"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">Lynx 团队</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="14" viewBox="0 0 300 271" class="icon-x-XK0uad"><path fill="currentColor" d="M236 0h46L181 115l118 156h-92.6l-72.5-94.8-83 94.8h-46l107-123L-1.1 0h94.9l65.5 86.6zm-16.1 244h25.5L80.4 26H53z"></path></svg></span><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">lynxjs.org</span></div></span></div><div class="rp-not-doc rp-llms-container"><button class="rp-not-doc rp-llms-button rp-llms-copy-button"><div class="rp-llms-copy-button__icon-wrapper"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg></div><span>复制 Markdown</span></button><button class="rp-llms-button rp-llms-view-options__trigger "><svg width="1em" height="1em" viewBox="0 0 32 32" class="rp-llms-view-options__arrow "><path fill="currentColor" d="M16 22 6 12l1.4-1.4 8.6 8.6 8.6-8.6L26 12z"></path></svg></button></div></div>
<p>Lynx 3.8 已经正式发布！</p>
<p>正如 <a href="/next/zh/blog/lynx-open-source-roadmap-2026.html" class="rp-link">2026 路线图</a>中提到的规划，Lynx 3.8 开启了新的月度发布节奏。切换到月度发布后，每个版本都会更小、更聚焦。3.8 的重点包括 Android 上的 <strong>WebAssembly</strong>、<code>&lt;frame&gt;</code> 自适应尺寸、按行数调整字号、HarmonyOS SessionStorage、<code>LynxEngine</code> 复用和 DevTool 协议更新。</p>
<p>进入 3.8 之前，也别错过我们最近发布的 <a href="/next/zh/blog/lynx-ui.html" class="rp-link">lynx-ui</a>：一套开箱即用的组件库，帮助你构建跨平台 Lynx 界面。</p>
<h2 class="rp-toc-include" id="android-上的-webassembly"><a href="#android-上的-webassembly" class="rp-header-anchor rp-link" aria-hidden="true">#</a>Android 上的 WebAssembly</h2>
<p>本次发布通过 PrimJS 运行时集成，在 Android 上引入了 <a href="/zh/guide/scripting-runtime/webassembly.html" class="rp-link">WebAssembly</a> 初步支持。Lynx 应用现在可以在后台线程加载和执行 WebAssembly 模块，让计算密集型逻辑在 JavaScript 性能不够时获得另一种实现选择。</p>
<p>当前实现主要覆盖常见的构造函数式使用方式：</p>
<div class="rp-codeblock language-js"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables has-highlighted" style="background-color:var(--shiki-background);color:var(--shiki-foreground)" tabindex="0" data-lang="js"><code><span class="line"><span style="color:var(--shiki-token-keyword)">const</span><span style="color:var(--shiki-token-constant)"> module</span><span style="color:var(--shiki-token-keyword)"> =</span><span style="color:var(--shiki-token-keyword)"> new</span><span style="color:var(--shiki-token-constant)"> WebAssembly</span><span style="color:var(--shiki-token-function)">.Module</span><span style="color:var(--shiki-foreground)">(wasmBytes);</span></span>
<span class="line"><span style="color:var(--shiki-token-keyword)">const</span><span style="color:var(--shiki-token-constant)"> instance</span><span style="color:var(--shiki-token-keyword)"> =</span><span style="color:var(--shiki-token-keyword)"> new</span><span style="color:var(--shiki-token-constant)"> WebAssembly</span><span style="color:var(--shiki-token-function)">.Instance</span><span style="color:var(--shiki-foreground)">(</span><span style="color:var(--shiki-token-constant)">module</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-foreground)"> imports);</span></span>
<span class="line"></span>
<span class="line"><span style="color:var(--shiki-token-keyword)">const</span><span style="color:var(--shiki-token-constant)"> result</span><span style="color:var(--shiki-token-keyword)"> =</span><span style="color:var(--shiki-token-constant)"> instance</span><span style="color:var(--shiki-token-function)">.</span><span style="color:var(--shiki-token-constant)">exports</span><span style="color:var(--shiki-token-function)">.add</span><span style="color:var(--shiki-foreground)">(</span><span style="color:var(--shiki-token-constant)">1</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-token-constant)"> 2</span><span style="color:var(--shiki-foreground)">);</span></span></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div>
<p>下面这个完整的 Lynx 页面示例展示了同样的调用流程：</p>
<div class="box-LTvjqb   "><div class="container-qARFbv"><div class="content-Yzcw9o"><div class="code-wrap-jURSQJ"><div class="code-tab-container-5FhsBL"><div class="code-view-container-lgwabm "><div class="code-kbFEhm"><div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables" data-lang="tsx"><code style="padding:1rem 1.25rem"></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div><div class="footer-KtlqMk"><div class="semi-space semi-space-align-center semi-space-horizontal" style="max-width:100%;overflow:hidden;white-space:nowrap;row-gap:2px;column-gap:2px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><span role="img" aria-label="list" class="semi-icon semi-icon-default semi-icon-list" style="color:var(--semi-color-text-2)"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><g opacity="0.99"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9.5 3a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM8 11.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 11.5Zm0 7c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 18.5Zm-2-7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-2 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></g></svg></span></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="overflow:hidden;row-gap:2px;column-gap:2px" x-semi-prop="children"><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>webassembly</span></span><span role="img" aria-label="chevron_right_stroked" class="semi-icon semi-icon-default semi-icon-chevron_right_stroked" style="color:var(--semi-color-text-2);font-size:12px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.9 20.17a1.25 1.25 0 0 1-.07-1.77l5.71-6.15-5.7-6.15a1.25 1.25 0 0 1 1.83-1.7l6.5 7c.44.48.44 1.22 0 1.7l-6.5 7c-.47.5-1.26.54-1.77.07Z" fill="currentColor"></path></svg></span><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>src/App.tsx</span></span></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:7px;column-gap:7px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg></span></button><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div></div></div></div>
<p>当前实现完整支持 <code>WebAssembly.Module</code> 和 <code>WebAssembly.Instance</code>，并覆盖 <code>WebAssembly.Memory</code>、<code>WebAssembly.Table</code> 和 <code>WebAssembly.Global</code> 的常见用法。</p>
<h2 class="rp-toc-include" id="自适应布局文本适配与平台行为"><a href="#自适应布局文本适配与平台行为" class="rp-header-anchor rp-link" aria-hidden="true">#</a>自适应布局、文本适配与平台行为</h2>
<p>本次版本改进了 Lynx 内容对宿主容器的适配、受限布局中的文本呈现，并补齐了一些平台行为差异。</p>
<h3 class="rp-toc-include" id="frame-自适应尺寸与加载指标"><a href="#frame-自适应尺寸与加载指标" class="rp-header-anchor rp-link" aria-hidden="true">#</a><code>&lt;frame&gt;</code> 自适应尺寸与加载指标</h3>
<p><a href="/zh/api/elements/built-in/frame.html" class="rp-link"><code>&lt;frame&gt;</code></a> 现在可以通过新的 <code>auto-width</code> 和 <code>auto-height</code> 属性，根据嵌入 Lynx 页面的内容确定自身尺寸，减少宿主侧手动计算尺寸的需要。</p>
<div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables has-highlighted" style="background-color:var(--shiki-background);color:var(--shiki-foreground)" tabindex="0" data-lang="tsx"><code><span class="line"><span style="color:var(--shiki-foreground)">&lt;</span><span style="color:var(--shiki-token-string-expression)">frame</span><span style="color:var(--shiki-token-function)"> src</span><span style="color:var(--shiki-token-keyword)">=</span><span style="color:var(--shiki-foreground)">{url} </span><span style="color:var(--shiki-token-function)">auto-width</span><span style="color:var(--shiki-token-function)"> auto-height</span><span style="color:var(--shiki-foreground)"> /&gt;</span></span></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div>
<p>它也增强了启动和可观测性支持，包括预设布局、更好的 <code>data</code> 与 <code>global-props</code> 传递、通过 <code>layoutchange</code> 上报固有尺寸，以及 Android 和 iOS 上的 <code>&lt;frame&gt;</code> 加载指标。</p>
<h3 class="rp-toc-include" id="按行数调整字号"><a href="#按行数调整字号" class="rp-header-anchor rp-link" aria-hidden="true">#</a>按行数调整字号</h3>
<p>新的 <a href="/zh/api/css/properties/-x-auto-font-size-line-ranges.html" class="rp-link"><code>-x-auto-font-size-line-ranges</code></a> CSS 属性可以根据实际渲染行数，为不同文本行数设置不同的字号搜索范围。配合 <code>-x-auto-font-size: true</code> 使用：</p>
<div class="rp-codeblock language-css"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables has-highlighted" style="background-color:var(--shiki-background);color:var(--shiki-foreground)" tabindex="0" data-lang="css"><code><span class="line"><span style="color:var(--shiki-token-function)">.title</span><span style="color:var(--shiki-foreground)"> {</span></span>
<span class="line"><span style="color:var(--shiki-token-constant)">  -x-auto-font-size</span><span style="color:var(--shiki-token-keyword)">:</span><span style="color:var(--shiki-token-constant)"> true</span><span style="color:var(--shiki-foreground)">;</span></span>
<span class="line"><span style="color:var(--shiki-token-constant)">  -x-auto-font-size-line-ranges</span><span style="color:var(--shiki-token-keyword)">:</span></span>
<span class="line"><span style="color:var(--shiki-token-constant)">    line-range(1</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-token-constant)"> 18</span><span style="color:var(--shiki-token-keyword)">px</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-token-constant)"> 22</span><span style="color:var(--shiki-token-keyword)">px</span><span style="color:var(--shiki-foreground)">), </span><span style="color:var(--shiki-token-constant)">line-range</span><span style="color:var(--shiki-foreground)">(2, 16</span><span style="color:var(--shiki-token-constant)">px</span><span style="color:var(--shiki-foreground)">, 18</span><span style="color:var(--shiki-token-constant)">px</span><span style="color:var(--shiki-foreground)">),</span></span>
<span class="line"><span style="color:var(--shiki-token-constant)">    line-range</span><span style="color:var(--shiki-foreground)">(3 </span><span style="color:var(--shiki-token-constant)">to</span><span style="color:var(--shiki-token-constant)"> infinity</span><span style="color:var(--shiki-foreground)">, 14</span><span style="color:var(--shiki-token-constant)">px</span><span style="color:var(--shiki-foreground)">);</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">}</span></span></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div>
<p>这适用于标题、卡片和信息流等场景，让单行、双行和多行文本分别使用更合适的字号范围。</p>
<div class="box-LTvjqb   "><div class="container-qARFbv"><div class="content-Yzcw9o"><div class="split-pane" style="display:flex;flex-direction:row;width:100%;height:100%;min-height:0"><div class="split-pane__first" style="flex:1;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="code-wrap-jURSQJ"><div class="code-tab-container-5FhsBL"><div class="code-view-container-lgwabm "><div class="code-kbFEhm"><div class="rp-codeblock language-scss"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables" data-lang="scss"><code style="padding:1rem 1.25rem"></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div><div role="separator" class="split-pane__divider" tabindex="0" style="flex:0 0 10px;cursor:col-resize;display:flex;align-items:center;justify-content:center;position:relative;z-index:1;touch-action:none" aria-orientation="vertical"><span role="img" aria-label="handle" class="semi-icon semi-icon-default semi-icon-handle" style="font-size:10px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M9 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M9 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M11 19a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M17 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></svg></span></div><div class="split-pane__second" style="flex:0 0 auto;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="preview-wrap-un0XJO"><div class="preview-wrap-content-TYo6um"><div class="preview-header-zYAZlz"><div style="width:24px;flex-shrink:0"></div><div class="semi-radioGroup semi-radioGroup-wrapper semi-radioGroup-buttonRadio" style="display:flex;flex:1;min-width:0;justify-content:center"><div style="width:100%;height:32px"></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div><div class="preview-body-YE5PSF"><div class="preview-panel-amOf1r" style="z-index:1;visibility:visible;pointer-events:auto"><div style="min-height:0px;display:flex;width:100%;height:100%;align-items:center;justify-content:center"><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/doc/auto-font-size-line-ranges.jpeg" alt="" loading="eager" decoding="async" style="max-width:100%;max-height:100%;object-fit:contain"/></div></div></div></div></div></div></div></div><div class="footer-KtlqMk"><div class="semi-space semi-space-align-center semi-space-horizontal" style="max-width:100%;overflow:hidden;white-space:nowrap;row-gap:2px;column-gap:2px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><span role="img" aria-label="list" class="semi-icon semi-icon-default semi-icon-list" style="color:var(--semi-color-text-2)"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><g opacity="0.99"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9.5 3a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM8 11.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 11.5Zm0 7c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 18.5Zm-2-7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-2 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></g></svg></span></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="overflow:hidden;row-gap:2px;column-gap:2px" x-semi-prop="children"><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>css-api</span></span><span role="img" aria-label="chevron_right_stroked" class="semi-icon semi-icon-default semi-icon-chevron_right_stroked" style="color:var(--semi-color-text-2);font-size:12px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.9 20.17a1.25 1.25 0 0 1-.07-1.77l5.71-6.15-5.7-6.15a1.25 1.25 0 0 1 1.83-1.7l6.5 7c.44.48.44 1.22 0 1.7l-6.5 7c-.47.5-1.26.54-1.77.07Z" fill="currentColor"></path></svg></span><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>src/-x-auto-font-size-line-ranges/index.scss</span></span></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:7px;column-gap:7px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">Code</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">预览</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div></div></div></div>
<h3 class="rp-toc-include" id="桌面端曝光"><a href="#桌面端曝光" class="rp-header-anchor rp-link" aria-hidden="true">#</a>桌面端曝光</h3>
<p>macOS 和 Windows 现在支持 <a href="/zh/api/elements/built-in/view.html#enable-exposure-ui-clip" class="rp-link"><code>enable-exposure-ui-clip</code></a>，让开发者可以在复杂布局中更精细地控制曝光计算。</p>
<h2 class="rp-toc-include" id="原生侧集成"><a href="#原生侧集成" class="rp-header-anchor rp-link" aria-hidden="true">#</a>原生侧集成</h2>
<h3 class="rp-toc-include" id="lynxviewgroup-中的引擎复用"><a href="#lynxviewgroup-中的引擎复用" class="rp-header-anchor rp-link" aria-hidden="true">#</a>LynxViewGroup 中的引擎复用</h3>
<p>在 Android 上，<code>LynxViewGroup</code> 现在可以为同一个组创建出的 <code>LynxView</code> 缓存并复用 <code>LynxEngine</code>。当应用反复基于同一个 template bundle 创建视图时，例如多页面或嵌入式视图场景，这一能力会很有用。</p>
<p>不少应用里，用户会反复离开并重新进入同一个 Lynx 页面。此时，缓存 <code>LynxEngine</code> 可以避免反复创建和销毁引擎，并复用引擎已经完成的工作，例如已经构建好的 UI 树，从而让页面再次进入时更快完成渲染。</p>
<p>应用无需直接管理 <code>LynxEngine</code>。创建启用缓存的 group，将它传给每个 <code>LynxViewBuilder</code>，并在不再需要时释放即可：</p>
<div class="rp-codeblock language-java"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables has-highlighted" style="background-color:var(--shiki-background);color:var(--shiki-foreground)" tabindex="0" data-lang="java"><code><span class="line"><span style="color:var(--shiki-token-keyword)">ILynxViewGroup</span><span style="color:var(--shiki-foreground)"> group </span><span style="color:var(--shiki-token-keyword)">=</span><span style="color:var(--shiki-token-keyword)"> new</span><span style="color:var(--shiki-token-function)"> LynxViewGroupBuilder()</span></span>
<span class="line"><span style="color:var(--shiki-token-punctuation)">    .</span><span style="color:var(--shiki-token-function)">setContext</span><span style="color:var(--shiki-foreground)">(context)</span></span>
<span class="line"><span style="color:var(--shiki-token-punctuation)">    .</span><span style="color:var(--shiki-token-function)">setTemplateBundle</span><span style="color:var(--shiki-foreground)">(templateBundle)</span></span>
<span class="line"><span style="color:var(--shiki-token-punctuation)">    .</span><span style="color:var(--shiki-token-function)">setGlobalProps</span><span style="color:var(--shiki-foreground)">(globalProps)</span></span>
<span class="line"><span style="color:var(--shiki-token-punctuation)">    .</span><span style="color:var(--shiki-token-function)">setEnableCacheEngine</span><span style="color:var(--shiki-foreground)">(</span><span style="color:var(--shiki-token-constant)">true</span><span style="color:var(--shiki-foreground)">) </span><span style="color:var(--shiki-token-comment)">// 启用缓存。</span></span>
<span class="line"><span style="color:var(--shiki-token-punctuation)">    .</span><span style="color:var(--shiki-token-function)">build</span><span style="color:var(--shiki-foreground)">();</span></span>
<span class="line"></span>
<span class="line"><span style="color:var(--shiki-token-keyword)">LynxView</span><span style="color:var(--shiki-foreground)"> first </span><span style="color:var(--shiki-token-keyword)">=</span><span style="color:var(--shiki-token-keyword)"> new</span><span style="color:var(--shiki-token-function)"> LynxViewBuilder()</span></span>
<span class="line"><span style="color:var(--shiki-token-punctuation)">    .</span><span style="color:var(--shiki-token-function)">setLynxViewGroup</span><span style="color:var(--shiki-foreground)">(group)</span></span>
<span class="line"><span style="color:var(--shiki-token-punctuation)">    .</span><span style="color:var(--shiki-token-function)">build</span><span style="color:var(--shiki-foreground)">(context);</span></span>
<span class="line"></span>
<span class="line"><span style="color:var(--shiki-token-comment)">// 稍后，使用同一个 group 创建的另一个 LynxView 可以复用缓存的引擎。</span></span>
<span class="line"><span style="color:var(--shiki-token-keyword)">LynxView</span><span style="color:var(--shiki-foreground)"> second </span><span style="color:var(--shiki-token-keyword)">=</span><span style="color:var(--shiki-token-keyword)"> new</span><span style="color:var(--shiki-token-function)"> LynxViewBuilder()</span></span>
<span class="line"><span style="color:var(--shiki-token-punctuation)">    .</span><span style="color:var(--shiki-token-function)">setLynxViewGroup</span><span style="color:var(--shiki-foreground)">(group)</span></span>
<span class="line"><span style="color:var(--shiki-token-punctuation)">    .</span><span style="color:var(--shiki-token-function)">build</span><span style="color:var(--shiki-foreground)">(context);</span></span>
<span class="line"></span>
<span class="line"><span style="color:var(--shiki-token-constant)">group</span><span style="color:var(--shiki-token-punctuation)">.</span><span style="color:var(--shiki-token-function)">release</span><span style="color:var(--shiki-foreground)">();</span></span></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div>
<h3 class="rp-toc-include" id="资源加载回调"><a href="#资源加载回调" class="rp-header-anchor rp-link" aria-hidden="true">#</a>资源加载回调</h3>
<p><code>LynxViewClientV2</code> 新增 <code>onResourceLoaded</code> 回调，使客户端可以在原生侧观察资源加载过程。这为宿主应用提供了统一入口，用来收集资源耗时、成功或失败状态以及其他诊断信息。</p>
<h3 class="rp-toc-include" id="harmonyos-上的-sessionstorage"><a href="#harmonyos-上的-sessionstorage" class="rp-header-anchor rp-link" aria-hidden="true">#</a>HarmonyOS 上的 SessionStorage</h3>
<p>HarmonyOS 现在支持 SessionStorage API，可用于跨页面数据共享。前端代码可以在 HarmonyOS 上使用已有的 <a href="/zh/api/lynx-api/lynx/lynx-set-session-storage.html" class="rp-link"><code>lynx.setSessionStorageItem</code></a>、<a href="/zh/api/lynx-api/lynx/lynx-get-session-storage.html" class="rp-link"><code>lynx.getSessionStorageItem</code></a>、<a href="/zh/api/lynx-api/lynx/lynx-subscribe-session-storage.html" class="rp-link"><code>lynx.subscribeSessionStorage</code></a> 和 <a href="/zh/api/lynx-api/lynx/lynx-unsubscribe-session-storage.html" class="rp-link"><code>lynx.unsubscribeSessionStorage</code></a> API，管理 session 级的跨页面状态。</p>
<h2 class="rp-toc-include" id="devtool-协议与调试"><a href="#devtool-协议与调试" class="rp-header-anchor rp-link" aria-hidden="true">#</a>DevTool 协议与调试</h2>
<p>DevTool 协议和调试能力改进包括：</p>
<ul>
<li>MTS 调试现在支持已预执行、已预解码的 <code>MTSRuntime</code> 实例。</li>
<li>CDP 支持新增 <code>DOM.describeNode</code>。</li>
<li><code>DOM.getDocument</code> 现在支持 <code>depth</code> 参数。</li>
<li>DevTool 可以通过 CDP Performance domain 查询 <code>PerformanceEntry</code> 数据。</li>
</ul>
<h2 class="rp-toc-include" id="升级指南"><a href="#升级指南" class="rp-header-anchor rp-link" aria-hidden="true">#</a>升级指南</h2>
<p>参照官网<a href="https://lynxjs.org/3.8/zh/guide/start/integrate-with-existing-apps.html" target="_blank" rel="noopener noreferrer" class="rp-link">接入 Lynx 到现有应用</a>，更新 Lynx 依赖版本，即可完成 Lynx 3.8 版本升级。</p>
<h2 class="rp-toc-include" id="感谢"><a href="#感谢" class="rp-header-anchor rp-link" aria-hidden="true">#</a>感谢</h2>
<p>Lynx 3.8 是月度发布节奏的第一步：更小的版本、更清晰的升级路径，也让我们更快响应反馈。</p>
<p>感谢每一位正在使用 Lynx、尽早试用新版本、提交 issue，并帮助项目在开放社区中持续进步的开发者。下次月度发布再见。</p><!--/$-->]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[lynx-ui 正式发布]]></title>
            <link>https://lynxjs.org/zh/blog/lynx-ui</link>
            <guid isPermaLink="false">/zh/blog/lynx-ui</guid>
            <pubDate>Fri, 22 May 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[lynx-ui 正式发布，一套开箱即用的组件库，在保留原生用户体验的同时提供 Web 级别的开发速度。搭载 LUNA 设计语言和 Motion 动效集成，首发适配 iOS、Android 和 HarmonyOS 三端。]]></description>
            <content:encoded><![CDATA[<h1 class="rp-toc-include" id="lynx-ui-正式发布"><span>lynx-ui 正式发布</span><a href="#lynx-ui-正式发布" class="rp-header-anchor rp-link" aria-hidden="true">#</a> </h1><div class="rp-not-doc rp-llms-container"><button class="rp-not-doc rp-llms-button rp-llms-copy-button"><div class="rp-llms-copy-button__icon-wrapper"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg></div><span>复制 Markdown</span></button><button class="rp-llms-button rp-llms-view-options__trigger "><svg width="1em" height="1em" viewBox="0 0 32 32" class="rp-llms-view-options__arrow "><path fill="currentColor" d="M16 22 6 12l1.4-1.4 8.6 8.6 8.6-8.6L26 12z"></path></svg></button></div><!--$--><a href="/next/zh/blog/" class="backLink-lQPNH7">← <!-- -->所有文章</a><div class="blogHeader-ZKfIZ_"><span class="date-aB5gkw">2026年5月22日</span><div class="blog-avatar-frame-G1eJ1T avatars-aaQ1Kf"><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/fzx2666-fz.png" alt="方舟"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">方舟</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">工程师 @ Lynx</span></div></span><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/f0rdream.png" alt="王洋"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">王洋</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">工程师 @ Lynx</span></div></span><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/AdrianLCA.png" alt="罗昶安"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">罗昶安</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">工程师 @ Lynx</span></div></span><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/MoonfaceX.png" alt="夏梦非"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">夏梦非</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">组件主管 @ Lynx</span></div></span><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/Dugyu.png" alt="杜光瑜"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">杜光瑜</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="14" viewBox="0 0 300 271" class="icon-x-XK0uad"><path fill="currentColor" d="M236 0h46L181 115l118 156h-92.6l-72.5-94.8-83 94.8h-46l107-123L-1.1 0h94.9l65.5 86.6zm-16.1 244h25.5L80.4 26H53z"></path></svg></span><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">设计工程 @ Lynx</span></div></span><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/huxpro.png" alt="黄玄"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">黄玄</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="14" viewBox="0 0 300 271" class="icon-x-XK0uad"><path fill="currentColor" d="M236 0h46L181 115l118 156h-92.6l-72.5-94.8-83 94.8h-46l107-123L-1.1 0h94.9l65.5 86.6zm-16.1 244h25.5L80.4 26H53z"></path></svg></span><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">架构师 @ Lynx</span></div></span></div><div class="rp-not-doc rp-llms-container"><button class="rp-not-doc rp-llms-button rp-llms-copy-button"><div class="rp-llms-copy-button__icon-wrapper"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg></div><span>复制 Markdown</span></button><button class="rp-llms-button rp-llms-view-options__trigger "><svg width="1em" height="1em" viewBox="0 0 32 32" class="rp-llms-view-options__arrow "><path fill="currentColor" d="M16 22 6 12l1.4-1.4 8.6 8.6 8.6-8.6L26 12z"></path></svg></button></div></div>
<p><a href="https://github.com/lynx-family/lynx-ui" target="_blank" rel="noopener noreferrer" class="rp-link">lynx-ui</a> 在去年 12 月的 <a href="https://reactadvanced.com/" target="_blank" rel="noopener noreferrer" class="rp-link">React Advanced London</a> 上首次亮相并开源。几个月来，我们一直在打磨组件、完善文档、丰富示例。今天，lynx-ui 正式发布。</p>
<style>[data-image-wall=&quot;image-wall-R1baed&quot;]{--image-wall-cols:4;--image-wall-gap:8px;--image-wall-aspect-ratio:1;}
@media (min-width:768px){[data-image-wall=&quot;image-wall-R1baed&quot;]{--image-wall-cols:8;--image-wall-gap:8px;--image-wall-aspect-ratio:1;}}</style><div class="" data-image-wall="image-wall-R1baed" style="display:grid;grid-template-columns:repeat(var(--image-wall-cols, 8), minmax(0, 1fr));gap:var(--image-wall-gap, 8px)"><button type="button" class="block w-full overflow-hidden rounded-md bg-muted/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"><div class="relative w-full" style="aspect-ratio:var(--image-wall-aspect-ratio, 1)"><div class="absolute inset-0 bg-muted/30 animate-pulse"></div><video src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/lynx-ui/lynx-ui-cover-button.webm" muted="" loop="" autoplay="" playsinline="" preload="metadata" class="absolute inset-0 h-full w-full object-cover transition-opacity duration-200 opacity-0"></video></div></button><button type="button" class="block w-full overflow-hidden rounded-md bg-muted/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"><div class="relative w-full" style="aspect-ratio:var(--image-wall-aspect-ratio, 1)"><div class="absolute inset-0 bg-muted/30 animate-pulse"></div><video src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/lynx-ui/lynx-ui-cover-checkbox.webm" muted="" loop="" autoplay="" playsinline="" preload="metadata" class="absolute inset-0 h-full w-full object-cover transition-opacity duration-200 opacity-0"></video></div></button><button type="button" class="block w-full overflow-hidden rounded-md bg-muted/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"><div class="relative w-full" style="aspect-ratio:var(--image-wall-aspect-ratio, 1)"><div class="absolute inset-0 bg-muted/30 animate-pulse"></div><video src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/lynx-ui/lynx-ui-cover-switch.webm" muted="" loop="" autoplay="" playsinline="" preload="metadata" class="absolute inset-0 h-full w-full object-cover transition-opacity duration-200 opacity-0"></video></div></button><button type="button" class="block w-full overflow-hidden rounded-md bg-muted/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"><div class="relative w-full" style="aspect-ratio:var(--image-wall-aspect-ratio, 1)"><div class="absolute inset-0 bg-muted/30 animate-pulse"></div><video src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/lynx-ui/lynx-ui-cover-radio-group.webm" muted="" loop="" autoplay="" playsinline="" preload="metadata" class="absolute inset-0 h-full w-full object-cover transition-opacity duration-200 opacity-0"></video></div></button><button type="button" class="block w-full overflow-hidden rounded-md bg-muted/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"><div class="relative w-full" style="aspect-ratio:var(--image-wall-aspect-ratio, 1)"><div class="absolute inset-0 bg-muted/30 animate-pulse"></div><video src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/lynx-ui/lynx-ui-cover-input.webm" muted="" loop="" autoplay="" playsinline="" preload="metadata" class="absolute inset-0 h-full w-full object-cover transition-opacity duration-200 opacity-0"></video></div></button><button type="button" class="block w-full overflow-hidden rounded-md bg-muted/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"><div class="relative w-full" style="aspect-ratio:var(--image-wall-aspect-ratio, 1)"><div class="absolute inset-0 bg-muted/30 animate-pulse"></div><video src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/lynx-ui/lynx-ui-cover-form.webm" muted="" loop="" autoplay="" playsinline="" preload="metadata" class="absolute inset-0 h-full w-full object-cover transition-opacity duration-200 opacity-0"></video></div></button><button type="button" class="block w-full overflow-hidden rounded-md bg-muted/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"><div class="relative w-full" style="aspect-ratio:var(--image-wall-aspect-ratio, 1)"><div class="absolute inset-0 bg-muted/30 animate-pulse"></div><video src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/lynx-ui/lynx-ui-cover-popover.webm" muted="" loop="" autoplay="" playsinline="" preload="metadata" class="absolute inset-0 h-full w-full object-cover transition-opacity duration-200 opacity-0"></video></div></button><button type="button" class="block w-full overflow-hidden rounded-md bg-muted/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"><div class="relative w-full" style="aspect-ratio:var(--image-wall-aspect-ratio, 1)"><div class="absolute inset-0 bg-muted/30 animate-pulse"></div><video src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/lynx-ui/lynx-ui-cover-dialog.webm" muted="" loop="" autoplay="" playsinline="" preload="metadata" class="absolute inset-0 h-full w-full object-cover transition-opacity duration-200 opacity-0"></video></div></button><button type="button" class="block w-full overflow-hidden rounded-md bg-muted/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"><div class="relative w-full" style="aspect-ratio:var(--image-wall-aspect-ratio, 1)"><div class="absolute inset-0 bg-muted/30 animate-pulse"></div><video src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/lynx-ui/lynx-ui-cover-swiper.webm" muted="" loop="" autoplay="" playsinline="" preload="metadata" class="absolute inset-0 h-full w-full object-cover transition-opacity duration-200 opacity-0"></video></div></button><button type="button" class="block w-full overflow-hidden rounded-md bg-muted/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"><div class="relative w-full" style="aspect-ratio:var(--image-wall-aspect-ratio, 1)"><div class="absolute inset-0 bg-muted/30 animate-pulse"></div><video src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/lynx-ui/lynx-ui-cover-sheet.webm" muted="" loop="" autoplay="" playsinline="" preload="metadata" class="absolute inset-0 h-full w-full object-cover transition-opacity duration-200 opacity-0"></video></div></button><button type="button" class="block w-full overflow-hidden rounded-md bg-muted/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"><div class="relative w-full" style="aspect-ratio:var(--image-wall-aspect-ratio, 1)"><div class="absolute inset-0 bg-muted/30 animate-pulse"></div><video src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/lynx-ui/lynx-ui-cover-swipe-action.webm" muted="" loop="" autoplay="" playsinline="" preload="metadata" class="absolute inset-0 h-full w-full object-cover transition-opacity duration-200 opacity-0"></video></div></button><button type="button" class="block w-full overflow-hidden rounded-md bg-muted/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"><div class="relative w-full" style="aspect-ratio:var(--image-wall-aspect-ratio, 1)"><div class="absolute inset-0 bg-muted/30 animate-pulse"></div><video src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/lynx-ui/lynx-ui-cover-sortable.webm" muted="" loop="" autoplay="" playsinline="" preload="metadata" class="absolute inset-0 h-full w-full object-cover transition-opacity duration-200 opacity-0"></video></div></button><button type="button" class="block w-full overflow-hidden rounded-md bg-muted/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"><div class="relative w-full" style="aspect-ratio:var(--image-wall-aspect-ratio, 1)"><div class="absolute inset-0 bg-muted/30 animate-pulse"></div><video src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/lynx-ui/lynx-ui-cover-draggable.webm" muted="" loop="" autoplay="" playsinline="" preload="metadata" class="absolute inset-0 h-full w-full object-cover transition-opacity duration-200 opacity-0"></video></div></button><button type="button" class="block w-full overflow-hidden rounded-md bg-muted/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"><div class="relative w-full" style="aspect-ratio:var(--image-wall-aspect-ratio, 1)"><div class="absolute inset-0 bg-muted/30 animate-pulse"></div><video src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/lynx-ui/lynx-ui-cover-scroll-view.webm" muted="" loop="" autoplay="" playsinline="" preload="metadata" class="absolute inset-0 h-full w-full object-cover transition-opacity duration-200 opacity-0"></video></div></button><button type="button" class="block w-full overflow-hidden rounded-md bg-muted/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"><div class="relative w-full" style="aspect-ratio:var(--image-wall-aspect-ratio, 1)"><div class="absolute inset-0 bg-muted/30 animate-pulse"></div><video src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/lynx-ui/lynx-ui-cover-feed-list.webm" muted="" loop="" autoplay="" playsinline="" preload="metadata" class="absolute inset-0 h-full w-full object-cover transition-opacity duration-200 opacity-0"></video></div></button><button type="button" class="block w-full overflow-hidden rounded-md bg-muted/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"><div class="relative w-full" style="aspect-ratio:var(--image-wall-aspect-ratio, 1)"><div class="absolute inset-0 bg-muted/30 animate-pulse"></div><video src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/lynx-ui/lynx-ui-cover-lazy-component.webm" muted="" loop="" autoplay="" playsinline="" preload="metadata" class="absolute inset-0 h-full w-full object-cover transition-opacity duration-200 opacity-0"></video></div></button></div>
<div style="margin-top:12px;font-size:14px;text-align:center;color:var(--rp-c-text-3)">lynx-ui 组件一览</div>
<h2 class="rp-toc-include" id="原生基础web-速度"><a href="#原生基础web-速度" class="rp-header-anchor rp-link" aria-hidden="true">#</a>原生基础，Web 速度</h2>
<p><a href="/zh/guide/ui/elements-components.html#%E5%86%85%E7%BD%AE%E5%85%83%E4%BB%B6" class="rp-link">内置元素</a>和 <a href="/zh/guide/ui/elements-components.html#xelement" class="rp-link">XElement</a> 为 Lynx 提供了至关重要的底层能力：流畅滚动、精准手势、<a href="/zh/guide/ui/elements-components.html#%E5%85%83%E4%BB%B6%E7%9A%84%E8%83%8C%E5%90%8E%E5%8E%9F%E7%94%9F%E6%B8%B2%E6%9F%93" class="rp-link">原生渲染</a>。但产品不是仅靠原子就能构建的，这正是<a href="/zh/guide/ui/elements-components.html#%E7%BB%84%E4%BB%B6%E5%B0%86%E5%85%83%E4%BB%B6%E8%BF%9B%E8%A1%8C%E7%BB%84%E5%90%88" class="rp-link">组件</a>的意义所在。Lynx 采用分层架构：原生层提供底层基础能力，Web 前端技术栈则在其上负责组件组合、状态管理、样式系统与产品特定行为的扩展。</p>
<p>lynx-ui 落地了这一分层思路：<strong>保留原生用户体验，提供 Web 级别的开发速度。</strong></p>
<div class="box-LTvjqb   "><div class="container-qARFbv"><div class="content-Yzcw9o"><div class="split-pane" style="display:flex;flex-direction:row;width:100%;height:100%;min-height:0"><div class="split-pane__first" style="flex:1;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="code-wrap-jURSQJ"><div class="code-tab-container-5FhsBL"><div class="code-view-container-lgwabm "><div class="code-kbFEhm"><div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables" data-lang="tsx"><code style="padding:1rem 1.25rem"></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div><div role="separator" class="split-pane__divider" tabindex="0" style="flex:0 0 10px;cursor:col-resize;display:flex;align-items:center;justify-content:center;position:relative;z-index:1;touch-action:none" aria-orientation="vertical"><span role="img" aria-label="handle" class="semi-icon semi-icon-default semi-icon-handle" style="font-size:10px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M9 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M9 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M11 19a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M17 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></svg></span></div><div class="split-pane__second" style="flex:0 0 auto;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="preview-wrap-un0XJO"><div class="preview-wrap-content-TYo6um"><div class="preview-header-zYAZlz"><div style="width:24px;flex-shrink:0"></div><div class="semi-radioGroup semi-radioGroup-wrapper semi-radioGroup-buttonRadio" style="display:flex;flex:1;min-width:0;justify-content:center"><div style="width:100%;height:32px"></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div><div class="preview-body-YE5PSF"><div class="preview-panel-amOf1r" style="z-index:1;visibility:visible;pointer-events:auto"><div style="min-height:0px;display:flex;width:100%;height:100%;align-items:center;justify-content:center"><video muted="" loop="" playsinline="" autoplay="" preload="auto" style="max-width:100%;max-height:100%;object-fit:contain"><source src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/lynx-ui/lynx-ui-cover-scroll-view.webm"/></video></div></div></div></div></div></div></div></div><div class="footer-KtlqMk"><div class="semi-space semi-space-align-center semi-space-horizontal" style="max-width:100%;overflow:hidden;white-space:nowrap;row-gap:2px;column-gap:2px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><span role="img" aria-label="list" class="semi-icon semi-icon-default semi-icon-list" style="color:var(--semi-color-text-2)"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><g opacity="0.99"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9.5 3a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM8 11.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 11.5Zm0 7c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 18.5Zm-2-7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-2 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></g></svg></span></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="overflow:hidden;row-gap:2px;column-gap:2px" x-semi-prop="children"><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>lynx-ui-scroll-view</span></span><span role="img" aria-label="chevron_right_stroked" class="semi-icon semi-icon-default semi-icon-chevron_right_stroked" style="color:var(--semi-color-text-2);font-size:12px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.9 20.17a1.25 1.25 0 0 1-.07-1.77l5.71-6.15-5.7-6.15a1.25 1.25 0 0 1 1.83-1.7l6.5 7c.44.48.44 1.22 0 1.7l-6.5 7c-.47.5-1.26.54-1.77.07Z" fill="currentColor"></path></svg></span><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>Basic/index.tsx</span></span></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:7px;column-gap:7px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">Code</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">预览</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div></div></div></div>
<div style="margin-top:12px;font-size:14px;text-align:center;color:var(--rp-c-text-3)"><p>lynx-ui 的 <a href="/zh/lynx-ui/components/scroll-view.html" class="rp-link"><code>ScrollView</code></a> 基于原生
<a href="/zh/api/elements/built-in/scroll-view.html" class="rp-link"><code>&lt;scroll-view&gt;</code></a>
原语构建</p></div>
<h2 class="rp-toc-include" id="可组合的原语primitive"><a href="#可组合的原语primitive" class="rp-header-anchor rp-link" aria-hidden="true">#</a>可组合的原语（Primitive）</h2>
<p>当一个组件把所有东西都封在里面，每来一个新需求就要加一个 prop，最终会变成谁也不敢动的黑盒。lynx-ui 是一个 <a href="/zh/lynx-ui/styling-theming.html" class="rp-link">unstyled</a> 组件库。每个组件是一个 <strong>primitive</strong>，负责行为和状态，但不附带任何视觉样式。一个 primitive 由多个 <strong>part</strong> 组成，每个 part 独立渲染、独立样式化。</p>
<p><a href="/zh/lynx-ui/components/popover.html" class="rp-link"><code>Popover</code></a> 展示了这个思路。它不是一个不透明的单体组件，而是由各司其职的 part 组合而成：<code>PopoverRoot</code> 管理状态，<code>PopoverTrigger</code> 定义意图，<code>PopoverPositioner</code> 处理定位，<code>PopoverContent</code> 保持结构独立。</p>
<div class="box-LTvjqb   "><div class="container-qARFbv"><div class="content-Yzcw9o"><div class="split-pane" style="display:flex;flex-direction:row;width:100%;height:100%;min-height:0"><div class="split-pane__first" style="flex:1;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="code-wrap-jURSQJ"><div class="code-tab-container-5FhsBL"><div class="code-view-container-lgwabm "><div class="code-kbFEhm"><div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables" data-lang="tsx"><code style="padding:1rem 1.25rem"></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div><div role="separator" class="split-pane__divider" tabindex="0" style="flex:0 0 10px;cursor:col-resize;display:flex;align-items:center;justify-content:center;position:relative;z-index:1;touch-action:none" aria-orientation="vertical"><span role="img" aria-label="handle" class="semi-icon semi-icon-default semi-icon-handle" style="font-size:10px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M9 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M9 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M11 19a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M17 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></svg></span></div><div class="split-pane__second" style="flex:0 0 auto;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="preview-wrap-un0XJO"><div class="preview-wrap-content-TYo6um"><div class="preview-header-zYAZlz"><div style="width:24px;flex-shrink:0"></div><div class="semi-radioGroup semi-radioGroup-wrapper semi-radioGroup-buttonRadio" style="display:flex;flex:1;min-width:0;justify-content:center"><div style="width:100%;height:32px"></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div><div class="preview-body-YE5PSF"><div class="preview-panel-amOf1r" style="z-index:1;visibility:visible;pointer-events:auto"><div style="min-height:0px;display:flex;width:100%;height:100%;align-items:center;justify-content:center"><video muted="" loop="" playsinline="" autoplay="" preload="auto" style="max-width:100%;max-height:100%;object-fit:contain"><source src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/lynx-ui/lynx-ui-cover-popover.webm"/></video></div></div></div></div></div></div></div></div><div class="footer-KtlqMk"><div class="semi-space semi-space-align-center semi-space-horizontal" style="max-width:100%;overflow:hidden;white-space:nowrap;row-gap:2px;column-gap:2px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><span role="img" aria-label="list" class="semi-icon semi-icon-default semi-icon-list" style="color:var(--semi-color-text-2)"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><g opacity="0.99"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9.5 3a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM8 11.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 11.5Zm0 7c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 18.5Zm-2-7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-2 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></g></svg></span></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="overflow:hidden;row-gap:2px;column-gap:2px" x-semi-prop="children"><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>lynx-ui-popover</span></span><span role="img" aria-label="chevron_right_stroked" class="semi-icon semi-icon-default semi-icon-chevron_right_stroked" style="color:var(--semi-color-text-2);font-size:12px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.9 20.17a1.25 1.25 0 0 1-.07-1.77l5.71-6.15-5.7-6.15a1.25 1.25 0 0 1 1.83-1.7l6.5 7c.44.48.44 1.22 0 1.7l-6.5 7c-.47.5-1.26.54-1.77.07Z" fill="currentColor"></path></svg></span><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>Basic/index.tsx</span></span></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:7px;column-gap:7px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">Code</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">预览</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div></div></div></div>
<div style="margin-top:12px;font-size:14px;text-align:center;color:var(--rp-c-text-3)">Composition is all you need.</div>
<p>正因为 primitive 是 unstyled 的，同样的可组合模型也为设计系统奠定了基础。你可以通过<a href="/zh/lynx-ui/styling-theming.html" class="rp-link">样式与主题</a>机制定义自己的主题，也可以按照 <a href="https://ui.shadcn.com/" target="_blank" rel="noopener noreferrer" class="rp-link">shadcn/ui</a> 的模式在 primitive 之上组合出带主题的 wrapper。</p>
<h3 class="rp-toc-include" id="luna"><a href="#luna" class="rp-header-anchor rp-link" aria-hidden="true">#</a>LUNA</h3>
<p><a href="/zh/lynx-ui/luna-themes-tokens.html" class="rp-link">LUNA</a> 是我们在此基础上构建的参考设计语言。</p>
<p>LUNA 从 Lynx 标志性的渐变色出发，将品牌表达调适为更柔和的 UI 色调：温暖的粉红和玫瑰色渐变至薰衣草和水蓝色。在 LUNA 中，渐变作为一等视觉材质，用于表达形态和运动，赋予组件一种流动介质的质感。这种细腻也延伸到了 token 命名：LUNA 描述的是表面的感受，而非其位置——<code>ambient</code> 融入背景，<code>faint</code> 处于感知的阈值，<code>veil</code> 和 <code>film</code> 创造柔和的半透明层。</p>
<div class="relative isolate w-full overflow-hidden rounded-[24px] transition-all duration-300 @container bg-canvas-ambient text-foreground"><div class="relative z-0 w-full p-8 px-10 @xl:px-12 @3xl:px-14 h-[360px] @sm:h-[400px] @md:h-[440px] @lg:h-[480px] @xl:h-[500px] @2xl:h-[520px] @3xl:h-[580px]"><div class="gap-4" style="width:100%;height:100%;pointer-events:none;position:relative;display:grid;grid-template-columns:repeat(5, minmax(0, 1fr));grid-template-rows:repeat(2, minmax(0, 1fr));align-items:stretch"><div style="grid-column:5 / 6;grid-row:1 / 2;z-index:0;pointer-events:none;display:flex;justify-content:center;align-items:center;overflow:hidden"><div style="position:relative;width:4px;height:4px;display:flex;justify-content:center;align-items:center;overflow:visible"><div style="position:relative;width:4px;height:4px;display:flex;justify-content:center;align-items:center;overflow:visible;transform-origin:center;opacity:0;transform:translateX(-300px)"><div style="position:relative;width:0;height:0;overflow:visible;pointer-events:none"><div style="background-color:rgb(0 0 0 / 0.04);position:absolute;top:0;left:0;transform-origin:top left;pointer-events:none;will-change:transform;width:387px;height:824px;clip-path:path(&quot;M0 96C0 62.3968 0 45.5953 6.53961 32.7606C12.292 21.4708 21.4708 12.292 32.7606 6.53961C45.5953 0 62.3969 0 96 0H291C324.603 0 341.405 0 354.239 6.53961C365.529 12.292 374.708 21.4708 380.46 32.7606C387 45.5953 387 62.3968 387 96V728C387 761.603 387 778.405 380.46 791.239C374.708 802.529 365.529 811.708 354.239 817.46C341.405 824 324.603 824 291 824H96C62.3969 824 45.5953 824 32.7606 817.46C21.4708 811.708 12.292 802.529 6.53961 791.239C0 778.405 0 761.603 0 728V96Z&quot;);transform:translate(0px, 0px) translate(0px, 0px) scale(0)"></div><div style="position:absolute;top:0;left:0;transform-origin:top left;pointer-events:auto;will-change:transform;overflow:hidden;width:375px;height:812px;clip-path:path(&quot;M0 86.4C0 56.1572 0 41.0357 5.88565 29.4845C11.0628 19.3238 19.3238 11.0628 29.4845 5.88565C41.0357 0 56.1572 0 86.4 0H288.6C318.843 0 333.964 0 345.516 5.88565C355.676 11.0628 363.937 19.3238 369.114 29.4845C375 41.0357 375 56.1572 375 86.4V725.6C375 755.843 375 770.964 369.114 782.516C363.937 792.676 355.676 800.937 345.516 806.114C333.964 812 318.843 812 288.6 812H86.4C56.1572 812 41.0357 812 29.4845 806.114C19.3238 800.937 11.0628 792.676 5.88565 782.516C0 770.964 0 755.843 0 725.6V86.4Z&quot;);transform:translate(0px, 0px) translate(0px, 0px) scale(0)"></div><div style="position:absolute;top:0;left:0;transform-origin:top left;pointer-events:none;will-change:transform;width:375px;height:812px;clip-path:path(&quot;M0 86.4C0 56.1572 0 41.0357 5.88565 29.4845C11.0628 19.3238 19.3238 11.0628 29.4845 5.88565C41.0357 0 56.1572 0 86.4 0H288.6C318.843 0 333.964 0 345.516 5.88565C355.676 11.0628 363.937 19.3238 369.114 29.4845C375 41.0357 375 56.1572 375 86.4V725.6C375 755.843 375 770.964 369.114 782.516C363.937 792.676 355.676 800.937 345.516 806.114C333.964 812 318.843 812 288.6 812H86.4C56.1572 812 41.0357 812 29.4845 806.114C19.3238 800.937 11.0628 792.676 5.88565 782.516C0 770.964 0 755.843 0 725.6V86.4Z&quot;);background-color:#f5f5f5;transform:translate(0px, 0px) translate(0px, 0px) scale(0)"></div></div></div></div></div><div style="grid-column:1 / 2;grid-row:1 / 2;z-index:0;pointer-events:none;display:flex;justify-content:center;align-items:center;overflow:hidden"><div style="position:relative;width:4px;height:4px;display:flex;justify-content:center;align-items:center;overflow:visible"><div style="position:relative;width:4px;height:4px;display:flex;justify-content:center;align-items:center;overflow:visible;transform-origin:center;opacity:0;transform:translateX(-300px)"><div style="position:relative;width:0;height:0;overflow:visible;pointer-events:none"><div style="background-color:rgb(0 0 0 / 0.04);position:absolute;top:0;left:0;transform-origin:top left;pointer-events:none;will-change:transform;width:387px;height:824px;clip-path:path(&quot;M0 96C0 62.3968 0 45.5953 6.53961 32.7606C12.292 21.4708 21.4708 12.292 32.7606 6.53961C45.5953 0 62.3969 0 96 0H291C324.603 0 341.405 0 354.239 6.53961C365.529 12.292 374.708 21.4708 380.46 32.7606C387 45.5953 387 62.3968 387 96V728C387 761.603 387 778.405 380.46 791.239C374.708 802.529 365.529 811.708 354.239 817.46C341.405 824 324.603 824 291 824H96C62.3969 824 45.5953 824 32.7606 817.46C21.4708 811.708 12.292 802.529 6.53961 791.239C0 778.405 0 761.603 0 728V96Z&quot;);transform:translate(0px, 0px) translate(0px, 0px) scale(0)"></div><div style="position:absolute;top:0;left:0;transform-origin:top left;pointer-events:auto;will-change:transform;overflow:hidden;width:375px;height:812px;clip-path:path(&quot;M0 86.4C0 56.1572 0 41.0357 5.88565 29.4845C11.0628 19.3238 19.3238 11.0628 29.4845 5.88565C41.0357 0 56.1572 0 86.4 0H288.6C318.843 0 333.964 0 345.516 5.88565C355.676 11.0628 363.937 19.3238 369.114 29.4845C375 41.0357 375 56.1572 375 86.4V725.6C375 755.843 375 770.964 369.114 782.516C363.937 792.676 355.676 800.937 345.516 806.114C333.964 812 318.843 812 288.6 812H86.4C56.1572 812 41.0357 812 29.4845 806.114C19.3238 800.937 11.0628 792.676 5.88565 782.516C0 770.964 0 755.843 0 725.6V86.4Z&quot;);transform:translate(0px, 0px) translate(0px, 0px) scale(0)"></div><div style="position:absolute;top:0;left:0;transform-origin:top left;pointer-events:none;will-change:transform;width:375px;height:812px;clip-path:path(&quot;M0 86.4C0 56.1572 0 41.0357 5.88565 29.4845C11.0628 19.3238 19.3238 11.0628 29.4845 5.88565C41.0357 0 56.1572 0 86.4 0H288.6C318.843 0 333.964 0 345.516 5.88565C355.676 11.0628 363.937 19.3238 369.114 29.4845C375 41.0357 375 56.1572 375 86.4V725.6C375 755.843 375 770.964 369.114 782.516C363.937 792.676 355.676 800.937 345.516 806.114C333.964 812 318.843 812 288.6 812H86.4C56.1572 812 41.0357 812 29.4845 806.114C19.3238 800.937 11.0628 792.676 5.88565 782.516C0 770.964 0 755.843 0 725.6V86.4Z&quot;);background-color:#f5f5f5;transform:translate(0px, 0px) translate(0px, 0px) scale(0)"></div></div></div></div></div><div style="grid-column:5 / 6;grid-row:2 / 3;z-index:0;pointer-events:none;display:flex;justify-content:center;align-items:center;overflow:hidden"><div style="position:relative;width:4px;height:4px;display:flex;justify-content:center;align-items:center;overflow:visible"><div style="position:relative;width:4px;height:4px;display:flex;justify-content:center;align-items:center;overflow:visible;transform-origin:center;opacity:0;transform:translateX(-300px)"><div style="position:relative;width:0;height:0;overflow:visible;pointer-events:none"><div style="background-color:rgb(0 0 0 / 0.04);position:absolute;top:0;left:0;transform-origin:top left;pointer-events:none;will-change:transform;width:387px;height:824px;clip-path:path(&quot;M0 96C0 62.3968 0 45.5953 6.53961 32.7606C12.292 21.4708 21.4708 12.292 32.7606 6.53961C45.5953 0 62.3969 0 96 0H291C324.603 0 341.405 0 354.239 6.53961C365.529 12.292 374.708 21.4708 380.46 32.7606C387 45.5953 387 62.3968 387 96V728C387 761.603 387 778.405 380.46 791.239C374.708 802.529 365.529 811.708 354.239 817.46C341.405 824 324.603 824 291 824H96C62.3969 824 45.5953 824 32.7606 817.46C21.4708 811.708 12.292 802.529 6.53961 791.239C0 778.405 0 761.603 0 728V96Z&quot;);transform:translate(0px, 0px) translate(0px, 0px) scale(0)"></div><div style="position:absolute;top:0;left:0;transform-origin:top left;pointer-events:auto;will-change:transform;overflow:hidden;width:375px;height:812px;clip-path:path(&quot;M0 86.4C0 56.1572 0 41.0357 5.88565 29.4845C11.0628 19.3238 19.3238 11.0628 29.4845 5.88565C41.0357 0 56.1572 0 86.4 0H288.6C318.843 0 333.964 0 345.516 5.88565C355.676 11.0628 363.937 19.3238 369.114 29.4845C375 41.0357 375 56.1572 375 86.4V725.6C375 755.843 375 770.964 369.114 782.516C363.937 792.676 355.676 800.937 345.516 806.114C333.964 812 318.843 812 288.6 812H86.4C56.1572 812 41.0357 812 29.4845 806.114C19.3238 800.937 11.0628 792.676 5.88565 782.516C0 770.964 0 755.843 0 725.6V86.4Z&quot;);transform:translate(0px, 0px) translate(0px, 0px) scale(0)"></div><div style="position:absolute;top:0;left:0;transform-origin:top left;pointer-events:none;will-change:transform;width:375px;height:812px;clip-path:path(&quot;M0 86.4C0 56.1572 0 41.0357 5.88565 29.4845C11.0628 19.3238 19.3238 11.0628 29.4845 5.88565C41.0357 0 56.1572 0 86.4 0H288.6C318.843 0 333.964 0 345.516 5.88565C355.676 11.0628 363.937 19.3238 369.114 29.4845C375 41.0357 375 56.1572 375 86.4V725.6C375 755.843 375 770.964 369.114 782.516C363.937 792.676 355.676 800.937 345.516 806.114C333.964 812 318.843 812 288.6 812H86.4C56.1572 812 41.0357 812 29.4845 806.114C19.3238 800.937 11.0628 792.676 5.88565 782.516C0 770.964 0 755.843 0 725.6V86.4Z&quot;);background-color:#f5f5f5;transform:translate(0px, 0px) translate(0px, 0px) scale(0)"></div></div></div></div></div><div style="grid-column:2 / 3;grid-row:1 / 2;z-index:0;pointer-events:none;display:flex;justify-content:center;align-items:center;overflow:hidden"><div style="position:relative;width:4px;height:4px;display:flex;justify-content:center;align-items:center;overflow:visible"><div style="position:relative;width:4px;height:4px;display:flex;justify-content:center;align-items:center;overflow:visible;transform-origin:center;opacity:0;transform:translateX(-300px)"><div style="position:relative;width:0;height:0;overflow:visible;pointer-events:none"><div style="background-color:rgb(0 0 0 / 0.04);position:absolute;top:0;left:0;transform-origin:top left;pointer-events:none;will-change:transform;width:387px;height:824px;clip-path:path(&quot;M0 96C0 62.3968 0 45.5953 6.53961 32.7606C12.292 21.4708 21.4708 12.292 32.7606 6.53961C45.5953 0 62.3969 0 96 0H291C324.603 0 341.405 0 354.239 6.53961C365.529 12.292 374.708 21.4708 380.46 32.7606C387 45.5953 387 62.3968 387 96V728C387 761.603 387 778.405 380.46 791.239C374.708 802.529 365.529 811.708 354.239 817.46C341.405 824 324.603 824 291 824H96C62.3969 824 45.5953 824 32.7606 817.46C21.4708 811.708 12.292 802.529 6.53961 791.239C0 778.405 0 761.603 0 728V96Z&quot;);transform:translate(0px, 0px) translate(0px, 0px) scale(0)"></div><div style="position:absolute;top:0;left:0;transform-origin:top left;pointer-events:auto;will-change:transform;overflow:hidden;width:375px;height:812px;clip-path:path(&quot;M0 86.4C0 56.1572 0 41.0357 5.88565 29.4845C11.0628 19.3238 19.3238 11.0628 29.4845 5.88565C41.0357 0 56.1572 0 86.4 0H288.6C318.843 0 333.964 0 345.516 5.88565C355.676 11.0628 363.937 19.3238 369.114 29.4845C375 41.0357 375 56.1572 375 86.4V725.6C375 755.843 375 770.964 369.114 782.516C363.937 792.676 355.676 800.937 345.516 806.114C333.964 812 318.843 812 288.6 812H86.4C56.1572 812 41.0357 812 29.4845 806.114C19.3238 800.937 11.0628 792.676 5.88565 782.516C0 770.964 0 755.843 0 725.6V86.4Z&quot;);transform:translate(0px, 0px) translate(0px, 0px) scale(0)"></div><div style="position:absolute;top:0;left:0;transform-origin:top left;pointer-events:none;will-change:transform;width:375px;height:812px;clip-path:path(&quot;M0 86.4C0 56.1572 0 41.0357 5.88565 29.4845C11.0628 19.3238 19.3238 11.0628 29.4845 5.88565C41.0357 0 56.1572 0 86.4 0H288.6C318.843 0 333.964 0 345.516 5.88565C355.676 11.0628 363.937 19.3238 369.114 29.4845C375 41.0357 375 56.1572 375 86.4V725.6C375 755.843 375 770.964 369.114 782.516C363.937 792.676 355.676 800.937 345.516 806.114C333.964 812 318.843 812 288.6 812H86.4C56.1572 812 41.0357 812 29.4845 806.114C19.3238 800.937 11.0628 792.676 5.88565 782.516C0 770.964 0 755.843 0 725.6V86.4Z&quot;);background-color:#f5f5f5;transform:translate(0px, 0px) translate(0px, 0px) scale(0)"></div></div></div></div></div><div style="grid-column:3 / 4;grid-row:1 / 2;z-index:0;pointer-events:none;display:flex;justify-content:center;align-items:center;overflow:hidden"><div style="position:relative;width:4px;height:4px;display:flex;justify-content:center;align-items:center;overflow:visible"><div style="position:relative;width:4px;height:4px;display:flex;justify-content:center;align-items:center;overflow:visible;transform-origin:center;opacity:0;transform:translateX(-300px)"><div style="position:relative;width:0;height:0;overflow:visible;pointer-events:none"><div style="background-color:rgb(0 0 0 / 0.04);position:absolute;top:0;left:0;transform-origin:top left;pointer-events:none;will-change:transform;width:387px;height:824px;clip-path:path(&quot;M0 96C0 62.3968 0 45.5953 6.53961 32.7606C12.292 21.4708 21.4708 12.292 32.7606 6.53961C45.5953 0 62.3969 0 96 0H291C324.603 0 341.405 0 354.239 6.53961C365.529 12.292 374.708 21.4708 380.46 32.7606C387 45.5953 387 62.3968 387 96V728C387 761.603 387 778.405 380.46 791.239C374.708 802.529 365.529 811.708 354.239 817.46C341.405 824 324.603 824 291 824H96C62.3969 824 45.5953 824 32.7606 817.46C21.4708 811.708 12.292 802.529 6.53961 791.239C0 778.405 0 761.603 0 728V96Z&quot;);transform:translate(0px, 0px) translate(0px, 0px) scale(0)"></div><div style="position:absolute;top:0;left:0;transform-origin:top left;pointer-events:auto;will-change:transform;overflow:hidden;width:375px;height:812px;clip-path:path(&quot;M0 86.4C0 56.1572 0 41.0357 5.88565 29.4845C11.0628 19.3238 19.3238 11.0628 29.4845 5.88565C41.0357 0 56.1572 0 86.4 0H288.6C318.843 0 333.964 0 345.516 5.88565C355.676 11.0628 363.937 19.3238 369.114 29.4845C375 41.0357 375 56.1572 375 86.4V725.6C375 755.843 375 770.964 369.114 782.516C363.937 792.676 355.676 800.937 345.516 806.114C333.964 812 318.843 812 288.6 812H86.4C56.1572 812 41.0357 812 29.4845 806.114C19.3238 800.937 11.0628 792.676 5.88565 782.516C0 770.964 0 755.843 0 725.6V86.4Z&quot;);transform:translate(0px, 0px) translate(0px, 0px) scale(0)"></div><div style="position:absolute;top:0;left:0;transform-origin:top left;pointer-events:none;will-change:transform;width:375px;height:812px;clip-path:path(&quot;M0 86.4C0 56.1572 0 41.0357 5.88565 29.4845C11.0628 19.3238 19.3238 11.0628 29.4845 5.88565C41.0357 0 56.1572 0 86.4 0H288.6C318.843 0 333.964 0 345.516 5.88565C355.676 11.0628 363.937 19.3238 369.114 29.4845C375 41.0357 375 56.1572 375 86.4V725.6C375 755.843 375 770.964 369.114 782.516C363.937 792.676 355.676 800.937 345.516 806.114C333.964 812 318.843 812 288.6 812H86.4C56.1572 812 41.0357 812 29.4845 806.114C19.3238 800.937 11.0628 792.676 5.88565 782.516C0 770.964 0 755.843 0 725.6V86.4Z&quot;);background-color:#f5f5f5;transform:translate(0px, 0px) translate(0px, 0px) scale(0)"></div></div></div></div></div><div style="grid-column:4 / 5;grid-row:1 / 2;z-index:0;pointer-events:none;display:flex;justify-content:center;align-items:center;overflow:hidden"><div style="position:relative;width:4px;height:4px;display:flex;justify-content:center;align-items:center;overflow:visible"><div style="position:relative;width:4px;height:4px;display:flex;justify-content:center;align-items:center;overflow:visible;transform-origin:center;opacity:0;transform:translateX(-300px)"><div style="position:relative;width:0;height:0;overflow:visible;pointer-events:none"><div style="background-color:rgb(0 0 0 / 0.04);position:absolute;top:0;left:0;transform-origin:top left;pointer-events:none;will-change:transform;width:387px;height:824px;clip-path:path(&quot;M0 96C0 62.3968 0 45.5953 6.53961 32.7606C12.292 21.4708 21.4708 12.292 32.7606 6.53961C45.5953 0 62.3969 0 96 0H291C324.603 0 341.405 0 354.239 6.53961C365.529 12.292 374.708 21.4708 380.46 32.7606C387 45.5953 387 62.3968 387 96V728C387 761.603 387 778.405 380.46 791.239C374.708 802.529 365.529 811.708 354.239 817.46C341.405 824 324.603 824 291 824H96C62.3969 824 45.5953 824 32.7606 817.46C21.4708 811.708 12.292 802.529 6.53961 791.239C0 778.405 0 761.603 0 728V96Z&quot;);transform:translate(0px, 0px) translate(0px, 0px) scale(0)"></div><div style="position:absolute;top:0;left:0;transform-origin:top left;pointer-events:auto;will-change:transform;overflow:hidden;width:375px;height:812px;clip-path:path(&quot;M0 86.4C0 56.1572 0 41.0357 5.88565 29.4845C11.0628 19.3238 19.3238 11.0628 29.4845 5.88565C41.0357 0 56.1572 0 86.4 0H288.6C318.843 0 333.964 0 345.516 5.88565C355.676 11.0628 363.937 19.3238 369.114 29.4845C375 41.0357 375 56.1572 375 86.4V725.6C375 755.843 375 770.964 369.114 782.516C363.937 792.676 355.676 800.937 345.516 806.114C333.964 812 318.843 812 288.6 812H86.4C56.1572 812 41.0357 812 29.4845 806.114C19.3238 800.937 11.0628 792.676 5.88565 782.516C0 770.964 0 755.843 0 725.6V86.4Z&quot;);transform:translate(0px, 0px) translate(0px, 0px) scale(0)"></div><div style="position:absolute;top:0;left:0;transform-origin:top left;pointer-events:none;will-change:transform;width:375px;height:812px;clip-path:path(&quot;M0 86.4C0 56.1572 0 41.0357 5.88565 29.4845C11.0628 19.3238 19.3238 11.0628 29.4845 5.88565C41.0357 0 56.1572 0 86.4 0H288.6C318.843 0 333.964 0 345.516 5.88565C355.676 11.0628 363.937 19.3238 369.114 29.4845C375 41.0357 375 56.1572 375 86.4V725.6C375 755.843 375 770.964 369.114 782.516C363.937 792.676 355.676 800.937 345.516 806.114C333.964 812 318.843 812 288.6 812H86.4C56.1572 812 41.0357 812 29.4845 806.114C19.3238 800.937 11.0628 792.676 5.88565 782.516C0 770.964 0 755.843 0 725.6V86.4Z&quot;);background-color:#f5f5f5;transform:translate(0px, 0px) translate(0px, 0px) scale(0)"></div></div></div></div></div><div style="grid-column:1 / 2;grid-row:2 / 3;z-index:0;pointer-events:none;display:flex;justify-content:center;align-items:center;overflow:hidden"><div style="position:relative;width:4px;height:4px;display:flex;justify-content:center;align-items:center;overflow:visible"><div style="position:relative;width:4px;height:4px;display:flex;justify-content:center;align-items:center;overflow:visible;transform-origin:center;opacity:0;transform:translateX(-300px)"><div style="position:relative;width:0;height:0;overflow:visible;pointer-events:none"><div style="background-color:rgb(0 0 0 / 0.04);position:absolute;top:0;left:0;transform-origin:top left;pointer-events:none;will-change:transform;width:387px;height:824px;clip-path:path(&quot;M0 96C0 62.3968 0 45.5953 6.53961 32.7606C12.292 21.4708 21.4708 12.292 32.7606 6.53961C45.5953 0 62.3969 0 96 0H291C324.603 0 341.405 0 354.239 6.53961C365.529 12.292 374.708 21.4708 380.46 32.7606C387 45.5953 387 62.3968 387 96V728C387 761.603 387 778.405 380.46 791.239C374.708 802.529 365.529 811.708 354.239 817.46C341.405 824 324.603 824 291 824H96C62.3969 824 45.5953 824 32.7606 817.46C21.4708 811.708 12.292 802.529 6.53961 791.239C0 778.405 0 761.603 0 728V96Z&quot;);transform:translate(0px, 0px) translate(0px, 0px) scale(0)"></div><div style="position:absolute;top:0;left:0;transform-origin:top left;pointer-events:auto;will-change:transform;overflow:hidden;width:375px;height:812px;clip-path:path(&quot;M0 86.4C0 56.1572 0 41.0357 5.88565 29.4845C11.0628 19.3238 19.3238 11.0628 29.4845 5.88565C41.0357 0 56.1572 0 86.4 0H288.6C318.843 0 333.964 0 345.516 5.88565C355.676 11.0628 363.937 19.3238 369.114 29.4845C375 41.0357 375 56.1572 375 86.4V725.6C375 755.843 375 770.964 369.114 782.516C363.937 792.676 355.676 800.937 345.516 806.114C333.964 812 318.843 812 288.6 812H86.4C56.1572 812 41.0357 812 29.4845 806.114C19.3238 800.937 11.0628 792.676 5.88565 782.516C0 770.964 0 755.843 0 725.6V86.4Z&quot;);transform:translate(0px, 0px) translate(0px, 0px) scale(0)"></div><div style="position:absolute;top:0;left:0;transform-origin:top left;pointer-events:none;will-change:transform;width:375px;height:812px;clip-path:path(&quot;M0 86.4C0 56.1572 0 41.0357 5.88565 29.4845C11.0628 19.3238 19.3238 11.0628 29.4845 5.88565C41.0357 0 56.1572 0 86.4 0H288.6C318.843 0 333.964 0 345.516 5.88565C355.676 11.0628 363.937 19.3238 369.114 29.4845C375 41.0357 375 56.1572 375 86.4V725.6C375 755.843 375 770.964 369.114 782.516C363.937 792.676 355.676 800.937 345.516 806.114C333.964 812 318.843 812 288.6 812H86.4C56.1572 812 41.0357 812 29.4845 806.114C19.3238 800.937 11.0628 792.676 5.88565 782.516C0 770.964 0 755.843 0 725.6V86.4Z&quot;);background-color:#f5f5f5;transform:translate(0px, 0px) translate(0px, 0px) scale(0)"></div></div></div></div></div><div style="grid-column:4 / 5;grid-row:2 / 3;z-index:0;pointer-events:none;display:flex;justify-content:center;align-items:center;overflow:hidden"><div style="position:relative;width:4px;height:4px;display:flex;justify-content:center;align-items:center;overflow:visible"><div style="position:relative;width:4px;height:4px;display:flex;justify-content:center;align-items:center;overflow:visible;transform-origin:center;opacity:0;transform:translateX(-300px)"><div style="position:relative;width:0;height:0;overflow:visible;pointer-events:none"><div style="background-color:rgb(0 0 0 / 0.04);position:absolute;top:0;left:0;transform-origin:top left;pointer-events:none;will-change:transform;width:387px;height:824px;clip-path:path(&quot;M0 96C0 62.3968 0 45.5953 6.53961 32.7606C12.292 21.4708 21.4708 12.292 32.7606 6.53961C45.5953 0 62.3969 0 96 0H291C324.603 0 341.405 0 354.239 6.53961C365.529 12.292 374.708 21.4708 380.46 32.7606C387 45.5953 387 62.3968 387 96V728C387 761.603 387 778.405 380.46 791.239C374.708 802.529 365.529 811.708 354.239 817.46C341.405 824 324.603 824 291 824H96C62.3969 824 45.5953 824 32.7606 817.46C21.4708 811.708 12.292 802.529 6.53961 791.239C0 778.405 0 761.603 0 728V96Z&quot;);transform:translate(0px, 0px) translate(0px, 0px) scale(0)"></div><div style="position:absolute;top:0;left:0;transform-origin:top left;pointer-events:auto;will-change:transform;overflow:hidden;width:375px;height:812px;clip-path:path(&quot;M0 86.4C0 56.1572 0 41.0357 5.88565 29.4845C11.0628 19.3238 19.3238 11.0628 29.4845 5.88565C41.0357 0 56.1572 0 86.4 0H288.6C318.843 0 333.964 0 345.516 5.88565C355.676 11.0628 363.937 19.3238 369.114 29.4845C375 41.0357 375 56.1572 375 86.4V725.6C375 755.843 375 770.964 369.114 782.516C363.937 792.676 355.676 800.937 345.516 806.114C333.964 812 318.843 812 288.6 812H86.4C56.1572 812 41.0357 812 29.4845 806.114C19.3238 800.937 11.0628 792.676 5.88565 782.516C0 770.964 0 755.843 0 725.6V86.4Z&quot;);transform:translate(0px, 0px) translate(0px, 0px) scale(0)"></div><div style="position:absolute;top:0;left:0;transform-origin:top left;pointer-events:none;will-change:transform;width:375px;height:812px;clip-path:path(&quot;M0 86.4C0 56.1572 0 41.0357 5.88565 29.4845C11.0628 19.3238 19.3238 11.0628 29.4845 5.88565C41.0357 0 56.1572 0 86.4 0H288.6C318.843 0 333.964 0 345.516 5.88565C355.676 11.0628 363.937 19.3238 369.114 29.4845C375 41.0357 375 56.1572 375 86.4V725.6C375 755.843 375 770.964 369.114 782.516C363.937 792.676 355.676 800.937 345.516 806.114C333.964 812 318.843 812 288.6 812H86.4C56.1572 812 41.0357 812 29.4845 806.114C19.3238 800.937 11.0628 792.676 5.88565 782.516C0 770.964 0 755.843 0 725.6V86.4Z&quot;);background-color:#f5f5f5;transform:translate(0px, 0px) translate(0px, 0px) scale(0)"></div></div></div></div></div><div style="grid-column:3 / 4;grid-row:2 / 3;z-index:0;pointer-events:none;display:flex;justify-content:center;align-items:center;overflow:hidden"><div style="position:relative;width:4px;height:4px;display:flex;justify-content:center;align-items:center;overflow:visible"><div style="position:relative;width:4px;height:4px;display:flex;justify-content:center;align-items:center;overflow:visible;transform-origin:center;opacity:0;transform:translateX(-300px)"><div style="position:relative;width:0;height:0;overflow:visible;pointer-events:none"><div style="background-color:rgb(0 0 0 / 0.04);position:absolute;top:0;left:0;transform-origin:top left;pointer-events:none;will-change:transform;width:387px;height:824px;clip-path:path(&quot;M0 96C0 62.3968 0 45.5953 6.53961 32.7606C12.292 21.4708 21.4708 12.292 32.7606 6.53961C45.5953 0 62.3969 0 96 0H291C324.603 0 341.405 0 354.239 6.53961C365.529 12.292 374.708 21.4708 380.46 32.7606C387 45.5953 387 62.3968 387 96V728C387 761.603 387 778.405 380.46 791.239C374.708 802.529 365.529 811.708 354.239 817.46C341.405 824 324.603 824 291 824H96C62.3969 824 45.5953 824 32.7606 817.46C21.4708 811.708 12.292 802.529 6.53961 791.239C0 778.405 0 761.603 0 728V96Z&quot;);transform:translate(0px, 0px) translate(0px, 0px) scale(0)"></div><div style="position:absolute;top:0;left:0;transform-origin:top left;pointer-events:auto;will-change:transform;overflow:hidden;width:375px;height:812px;clip-path:path(&quot;M0 86.4C0 56.1572 0 41.0357 5.88565 29.4845C11.0628 19.3238 19.3238 11.0628 29.4845 5.88565C41.0357 0 56.1572 0 86.4 0H288.6C318.843 0 333.964 0 345.516 5.88565C355.676 11.0628 363.937 19.3238 369.114 29.4845C375 41.0357 375 56.1572 375 86.4V725.6C375 755.843 375 770.964 369.114 782.516C363.937 792.676 355.676 800.937 345.516 806.114C333.964 812 318.843 812 288.6 812H86.4C56.1572 812 41.0357 812 29.4845 806.114C19.3238 800.937 11.0628 792.676 5.88565 782.516C0 770.964 0 755.843 0 725.6V86.4Z&quot;);transform:translate(0px, 0px) translate(0px, 0px) scale(0)"></div><div style="position:absolute;top:0;left:0;transform-origin:top left;pointer-events:none;will-change:transform;width:375px;height:812px;clip-path:path(&quot;M0 86.4C0 56.1572 0 41.0357 5.88565 29.4845C11.0628 19.3238 19.3238 11.0628 29.4845 5.88565C41.0357 0 56.1572 0 86.4 0H288.6C318.843 0 333.964 0 345.516 5.88565C355.676 11.0628 363.937 19.3238 369.114 29.4845C375 41.0357 375 56.1572 375 86.4V725.6C375 755.843 375 770.964 369.114 782.516C363.937 792.676 355.676 800.937 345.516 806.114C333.964 812 318.843 812 288.6 812H86.4C56.1572 812 41.0357 812 29.4845 806.114C19.3238 800.937 11.0628 792.676 5.88565 782.516C0 770.964 0 755.843 0 725.6V86.4Z&quot;);background-color:#f5f5f5;transform:translate(0px, 0px) translate(0px, 0px) scale(0)"></div></div></div></div></div><div style="grid-column:2 / 3;grid-row:2 / 3;z-index:0;pointer-events:none;display:flex;justify-content:center;align-items:center;overflow:hidden"><div style="position:relative;width:4px;height:4px;display:flex;justify-content:center;align-items:center;overflow:visible"><div style="position:relative;width:4px;height:4px;display:flex;justify-content:center;align-items:center;overflow:visible;transform-origin:center;opacity:0;transform:translateX(-300px)"><div style="position:relative;width:0;height:0;overflow:visible;pointer-events:none"><div style="background-color:rgb(0 0 0 / 0.04);position:absolute;top:0;left:0;transform-origin:top left;pointer-events:none;will-change:transform;width:387px;height:824px;clip-path:path(&quot;M0 96C0 62.3968 0 45.5953 6.53961 32.7606C12.292 21.4708 21.4708 12.292 32.7606 6.53961C45.5953 0 62.3969 0 96 0H291C324.603 0 341.405 0 354.239 6.53961C365.529 12.292 374.708 21.4708 380.46 32.7606C387 45.5953 387 62.3968 387 96V728C387 761.603 387 778.405 380.46 791.239C374.708 802.529 365.529 811.708 354.239 817.46C341.405 824 324.603 824 291 824H96C62.3969 824 45.5953 824 32.7606 817.46C21.4708 811.708 12.292 802.529 6.53961 791.239C0 778.405 0 761.603 0 728V96Z&quot;);transform:translate(0px, 0px) translate(0px, 0px) scale(0)"></div><div style="position:absolute;top:0;left:0;transform-origin:top left;pointer-events:auto;will-change:transform;overflow:hidden;width:375px;height:812px;clip-path:path(&quot;M0 86.4C0 56.1572 0 41.0357 5.88565 29.4845C11.0628 19.3238 19.3238 11.0628 29.4845 5.88565C41.0357 0 56.1572 0 86.4 0H288.6C318.843 0 333.964 0 345.516 5.88565C355.676 11.0628 363.937 19.3238 369.114 29.4845C375 41.0357 375 56.1572 375 86.4V725.6C375 755.843 375 770.964 369.114 782.516C363.937 792.676 355.676 800.937 345.516 806.114C333.964 812 318.843 812 288.6 812H86.4C56.1572 812 41.0357 812 29.4845 806.114C19.3238 800.937 11.0628 792.676 5.88565 782.516C0 770.964 0 755.843 0 725.6V86.4Z&quot;);transform:translate(0px, 0px) translate(0px, 0px) scale(0)"></div><div style="position:absolute;top:0;left:0;transform-origin:top left;pointer-events:none;will-change:transform;width:375px;height:812px;clip-path:path(&quot;M0 86.4C0 56.1572 0 41.0357 5.88565 29.4845C11.0628 19.3238 19.3238 11.0628 29.4845 5.88565C41.0357 0 56.1572 0 86.4 0H288.6C318.843 0 333.964 0 345.516 5.88565C355.676 11.0628 363.937 19.3238 369.114 29.4845C375 41.0357 375 56.1572 375 86.4V725.6C375 755.843 375 770.964 369.114 782.516C363.937 792.676 355.676 800.937 345.516 806.114C333.964 812 318.843 812 288.6 812H86.4C56.1572 812 41.0357 812 29.4845 806.114C19.3238 800.937 11.0628 792.676 5.88565 782.516C0 770.964 0 755.843 0 725.6V86.4Z&quot;);background-color:#f5f5f5;transform:translate(0px, 0px) translate(0px, 0px) scale(0)"></div></div></div></div></div></div></div><div class="absolute z-50 rounded-full shadow-sm backdrop-blur transform-gpu bottom-2 left-1/2 -translate-x-1/2 @3xl:left-auto @3xl:right-2 @3xl:translate-x-0 bg-soft"><div class="flex items-center gap-1 px-2 py-2 @3xl:flex-col @3xl:justify-between @3xl:gap-2 @3xl:px-2 @3xl:py-3"><button class="inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 [&amp;_svg]:pointer-events-none [&amp;_svg]:size-4 [&amp;_svg]:shrink-0 h-9 w-9 rounded-full border transition-all hover:scale-110 focus-visible:ring-2 focus-visible:ring-offset-2 border-black/10 focus-visible:ring-black/30 focus-visible:ring-offset-background bg-transparent text-black/60 opacity-70 hover:bg-black/5 hover:text-black hover:opacity-100" type="button" aria-pressed="false" aria-label="Compare" title="Compare"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-columns2 h-4 w-4 md:h-5 md:w-5"><rect width="18" height="18" x="3" y="3" rx="2"></rect><path d="M12 3v18"></path></svg></button><button class="inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 [&amp;_svg]:pointer-events-none [&amp;_svg]:size-4 [&amp;_svg]:shrink-0 h-9 w-9 rounded-full border transition-all hover:scale-110 focus-visible:ring-2 focus-visible:ring-offset-2 border-black/10 focus-visible:ring-black/30 focus-visible:ring-offset-background bg-transparent text-black/60 opacity-70 hover:bg-black/5 hover:text-black hover:opacity-100" type="button" aria-pressed="false" aria-label="Focus" title="Focus"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-gallery-horizontal-end h-4 w-4 md:h-5 md:w-5"><path d="M2 7v10"></path><path d="M6 5v14"></path><rect width="12" height="18" x="10" y="3" rx="2"></rect></svg></button><button class="inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 [&amp;_svg]:pointer-events-none [&amp;_svg]:size-4 [&amp;_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground h-9 w-9 rounded-full border transition-all hover:scale-110 focus-visible:ring-2 focus-visible:ring-offset-2 border-black/10 focus-visible:ring-black/30 focus-visible:ring-offset-background bg-black text-white ring-1 ring-black/20 shadow-sm" type="button" aria-pressed="true" aria-label="Lineup" title="Lineup"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-grid2x2 h-4 w-4 md:h-5 md:w-5"><rect width="18" height="18" x="3" y="3" rx="2"></rect><path d="M3 12h18"></path><path d="M12 3v18"></path></svg></button><div class="mx-1 h-px w-2 @3xl:mx-0 @3xl:h-6 @3xl:w-px bg-rule"></div><button class="inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 [&amp;_svg]:pointer-events-none [&amp;_svg]:size-4 [&amp;_svg]:shrink-0 h-9 w-9 rounded-full border transition-all hover:scale-110 focus-visible:ring-2 focus-visible:ring-offset-2 border-black/10 focus-visible:ring-black/30 focus-visible:ring-offset-background bg-transparent text-black/60 opacity-70 hover:bg-black/5 hover:text-black hover:opacity-100" type="button" aria-pressed="false" aria-label="Luna" title="Luna"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-sparkle h-4 w-4 md:h-5 md:w-5"><path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"></path></svg></button><button class="inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 [&amp;_svg]:pointer-events-none [&amp;_svg]:size-4 [&amp;_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground h-9 w-9 rounded-full border transition-all hover:scale-110 focus-visible:ring-2 focus-visible:ring-offset-2 border-black/10 focus-visible:ring-black/30 focus-visible:ring-offset-background bg-black text-white ring-1 ring-black/20 shadow-sm" type="button" aria-pressed="true" aria-label="Lunaris" title="Lunaris"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-sparkles h-4 w-4 md:h-5 md:w-5"><path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"></path><path d="M20 3v4"></path><path d="M22 5h-4"></path><path d="M4 17v2"></path><path d="M5 18H3"></path></svg></button><div class="mx-1 h-px w-2 @3xl:mx-0 @3xl:h-6 @3xl:w-px bg-rule"></div><button class="inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 [&amp;_svg]:pointer-events-none [&amp;_svg]:size-4 [&amp;_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground h-9 w-9 rounded-full border transition-all hover:scale-110 focus-visible:ring-2 focus-visible:ring-offset-2 border-black/10 focus-visible:ring-black/30 focus-visible:ring-offset-background bg-black text-white ring-1 ring-black/20 shadow-sm" type="button" aria-pressed="true" aria-label="Light" disabled="" title="Light"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-sun h-4 w-4 md:h-5 md:w-5"><circle cx="12" cy="12" r="4"></circle><path d="M12 2v2"></path><path d="M12 20v2"></path><path d="m4.93 4.93 1.41 1.41"></path><path d="m17.66 17.66 1.41 1.41"></path><path d="M2 12h2"></path><path d="M20 12h2"></path><path d="m6.34 17.66-1.41 1.41"></path><path d="m19.07 4.93-1.41 1.41"></path></svg></button><button class="inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 [&amp;_svg]:pointer-events-none [&amp;_svg]:size-4 [&amp;_svg]:shrink-0 h-9 w-9 rounded-full border transition-all hover:scale-110 focus-visible:ring-2 focus-visible:ring-offset-2 border-black/10 focus-visible:ring-black/30 focus-visible:ring-offset-background bg-transparent text-black/60 opacity-70 hover:bg-black/5 hover:text-black hover:opacity-100" type="button" aria-pressed="false" aria-label="Dark" disabled="" title="Dark"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-moon h-4 w-4 md:h-5 md:w-5"><path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"></path></svg></button><div class="mx-1 h-px w-1 @3xl:mx-0 @3xl:h-6 @3xl:w-px bg-rule"></div><button class="inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 [&amp;_svg]:pointer-events-none [&amp;_svg]:size-4 [&amp;_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground h-9 w-9 rounded-full border transition-all hover:scale-110 focus-visible:ring-2 focus-visible:ring-offset-2 border-black/10 focus-visible:ring-black/30 focus-visible:ring-offset-background bg-black text-white ring-1 ring-black/20 shadow-sm" type="button" aria-pressed="true" aria-label="Theme synced" title="Theme synced"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-lock h-4 w-4 md:h-5 md:w-5"><rect width="18" height="11" x="3" y="11" rx="2" ry="2"></rect><path d="M7 11V7a5 5 0 0 1 10 0v4"></path></svg></button></div></div></div>
<div style="margin-top:12px;font-size:14px;text-align:center;color:var(--rp-c-text-3)">L.U.N.A Studio</div>
<h2 class="rp-toc-include" id="可编程的交互"><a href="#可编程的交互" class="rp-header-anchor rp-link" aria-hidden="true">#</a>可编程的交互</h2>
<p>手势驱动的组件对两件事要求很高：行为要可定制，响应要低延迟。滑动、拖拽、轻扫，每一帧都在被用户感知。反馈一旦跟不上手势，体验就不再是原生的。</p>
<p>Lynx 采用<a href="/next/zh/blog/lynx-unlock-native-for-more.html#%E8%AE%A9%E4%B8%BB%E7%BA%BF%E7%A8%8B%E4%B8%93%E8%B4%A3%E6%9C%8D%E5%8A%A1%E4%BA%8E%E4%BA%A4%E4%BA%92%E4%BD%93%E9%AA%8C" class="rp-link">双线程模型</a>，JavaScript 默认跑在后台线程，主线程专注渲染。需要时，<a href="/zh/react/main-thread-script.html" class="rp-link">主线程脚本</a>可以把交互逻辑搬到主线程，逐帧行为因此完全可编程。<a href="/zh/lynx-ui/components/swiper.html" class="rp-link"><code>Swiper</code></a> 就是一个例子：拖拽时卡片逐帧跟手，不会事后追赶。</p>
<div class="box-LTvjqb   "><div class="container-qARFbv"><div class="content-Yzcw9o"><div class="split-pane" style="display:flex;flex-direction:row;width:100%;height:100%;min-height:0"><div class="split-pane__first" style="flex:1;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="code-wrap-jURSQJ"><div class="code-tab-container-5FhsBL"><div class="code-view-container-lgwabm "><div class="code-kbFEhm"><div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables" data-lang="tsx"><code style="padding:1rem 1.25rem"></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div><div role="separator" class="split-pane__divider" tabindex="0" style="flex:0 0 10px;cursor:col-resize;display:flex;align-items:center;justify-content:center;position:relative;z-index:1;touch-action:none" aria-orientation="vertical"><span role="img" aria-label="handle" class="semi-icon semi-icon-default semi-icon-handle" style="font-size:10px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M9 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M9 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M11 19a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M17 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></svg></span></div><div class="split-pane__second" style="flex:0 0 auto;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="preview-wrap-un0XJO"><div class="preview-wrap-content-TYo6um"><div class="preview-header-zYAZlz"><div style="width:24px;flex-shrink:0"></div><div class="semi-radioGroup semi-radioGroup-wrapper semi-radioGroup-buttonRadio" style="display:flex;flex:1;min-width:0;justify-content:center"><div style="width:100%;height:32px"></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div><div class="preview-body-YE5PSF"><div class="preview-panel-amOf1r" style="z-index:1;visibility:visible;pointer-events:auto"><div style="min-height:0px;display:flex;width:100%;height:100%;align-items:center;justify-content:center"><video muted="" loop="" playsinline="" autoplay="" preload="auto" style="max-width:100%;max-height:100%;object-fit:contain"><source src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/lynx-ui/lynx-ui-cover-swiper.webm"/></video></div></div></div></div></div></div></div></div><div class="footer-KtlqMk"><div class="semi-space semi-space-align-center semi-space-horizontal" style="max-width:100%;overflow:hidden;white-space:nowrap;row-gap:2px;column-gap:2px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><span role="img" aria-label="list" class="semi-icon semi-icon-default semi-icon-list" style="color:var(--semi-color-text-2)"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><g opacity="0.99"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9.5 3a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM8 11.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 11.5Zm0 7c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 18.5Zm-2-7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-2 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></g></svg></span></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="overflow:hidden;row-gap:2px;column-gap:2px" x-semi-prop="children"><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>lynx-ui-swiper</span></span><span role="img" aria-label="chevron_right_stroked" class="semi-icon semi-icon-default semi-icon-chevron_right_stroked" style="color:var(--semi-color-text-2);font-size:12px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.9 20.17a1.25 1.25 0 0 1-.07-1.77l5.71-6.15-5.7-6.15a1.25 1.25 0 0 1 1.83-1.7l6.5 7c.44.48.44 1.22 0 1.7l-6.5 7c-.47.5-1.26.54-1.77.07Z" fill="currentColor"></path></svg></span><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>CustomTinder/index.tsx</span></span></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:7px;column-gap:7px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">Code</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">预览</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div></div></div></div>
<div style="margin-top:12px;font-size:14px;text-align:center;color:var(--rp-c-text-3)"><p>通过 <code>main-thread:customAnimation</code> 传入 <code>&#x27;main thread&#x27;</code> <!-- -->
函数，逐帧逻辑运行在主线程</p></div>
<p>有了原生基础和可编程的交互，动效不再只是装饰，而是组件行为的一部分。</p>
<h3 class="rp-toc-include" id="motion"><a href="#motion" class="rp-header-anchor rp-link" aria-hidden="true">#</a>Motion</h3>
<p><a href="https://motion.dev/" target="_blank" rel="noopener noreferrer" class="rp-link">Motion</a> 是 Web 社区最知名的动画库之一，同时支持弹簧和贝塞尔曲线过渡。有了<a href="/zh/react/main-thread-script.html" class="rp-link">主线程脚本</a>的可编程性做基础，我们把 Motion 搬到了 Lynx 上，实验版随 lynx-ui 一起发布。<a href="/zh/lynx-ui/motion.html" class="rp-link"><code>@lynx-js/motion</code></a> 通过一层很薄的适配直接使用 Motion 源码，保持了和 Web 完全一致的使用方式。</p>
<p><a href="/zh/lynx-ui/components/sheet.html" class="rp-link"><code>Sheet</code></a> 是一个很好的例子。拖拽、阻尼、释放、归位，这些需要连贯成一个完整的行为。主线程脚本让交互紧贴渲染，Motion 控制面板怎么动，两者配合之下，面板给人一种被&quot;握住&quot;的感觉，而不是在回放动画。</p>
<div class="box-LTvjqb   "><div class="container-qARFbv"><div class="content-Yzcw9o"><div class="split-pane" style="display:flex;flex-direction:row;width:100%;height:100%;min-height:0"><div class="split-pane__first" style="flex:1;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="code-wrap-jURSQJ"><div class="code-tab-container-5FhsBL"><div class="code-view-container-lgwabm "><div class="code-kbFEhm"><div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables" data-lang="tsx"><code style="padding:1rem 1.25rem"></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div><div role="separator" class="split-pane__divider" tabindex="0" style="flex:0 0 10px;cursor:col-resize;display:flex;align-items:center;justify-content:center;position:relative;z-index:1;touch-action:none" aria-orientation="vertical"><span role="img" aria-label="handle" class="semi-icon semi-icon-default semi-icon-handle" style="font-size:10px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M9 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M9 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M11 19a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M17 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></svg></span></div><div class="split-pane__second" style="flex:0 0 auto;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="preview-wrap-un0XJO"><div class="preview-wrap-content-TYo6um"><div class="preview-header-zYAZlz"><div style="width:24px;flex-shrink:0"></div><div class="semi-radioGroup semi-radioGroup-wrapper semi-radioGroup-buttonRadio" style="display:flex;flex:1;min-width:0;justify-content:center"><div style="width:100%;height:32px"></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div><div class="preview-body-YE5PSF"><div class="preview-panel-amOf1r" style="z-index:1;visibility:visible;pointer-events:auto"><div style="min-height:0px;display:flex;width:100%;height:100%;align-items:center;justify-content:center"><video muted="" loop="" playsinline="" autoplay="" preload="auto" style="max-width:100%;max-height:100%;object-fit:contain"><source src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/lynx-ui/lynx-ui-cover-sheet.webm"/></video></div></div></div></div></div></div></div></div><div class="footer-KtlqMk"><div class="semi-space semi-space-align-center semi-space-horizontal" style="max-width:100%;overflow:hidden;white-space:nowrap;row-gap:2px;column-gap:2px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><span role="img" aria-label="list" class="semi-icon semi-icon-default semi-icon-list" style="color:var(--semi-color-text-2)"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><g opacity="0.99"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9.5 3a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM8 11.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 11.5Zm0 7c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 18.5Zm-2-7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-2 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></g></svg></span></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="overflow:hidden;row-gap:2px;column-gap:2px" x-semi-prop="children"><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>lynx-ui-sheet</span></span><span role="img" aria-label="chevron_right_stroked" class="semi-icon semi-icon-default semi-icon-chevron_right_stroked" style="color:var(--semi-color-text-2);font-size:12px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.9 20.17a1.25 1.25 0 0 1-.07-1.77l5.71-6.15-5.7-6.15a1.25 1.25 0 0 1 1.83-1.7l6.5 7c.44.48.44 1.22 0 1.7l-6.5 7c-.47.5-1.26.54-1.77.07Z" fill="currentColor"></path></svg></span><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>Basic/index.tsx</span></span></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:7px;column-gap:7px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">Code</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">预览</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div></div></div></div>
<div style="margin-top:12px;font-size:14px;text-align:center;color:var(--rp-c-text-3)"><p><code>Sheet</code> 底层使用 <code>@lynx-js/motion</code> <!-- -->
驱动弹簧拖拽和归位过渡</p></div>
<h2 class="rp-toc-include" id="立即体验"><a href="#立即体验" class="rp-header-anchor rp-link" aria-hidden="true">#</a>立即体验</h2>
<p>lynx-ui 目前已支持 iOS、Android 和 HarmonyOS，Web 和 Desktop 支持也在推进中。阅读<a href="/zh/lynx-ui/index.html" class="rp-link">简介</a>了解全貌，或直接跳到<a href="/zh/lynx-ui/introduction.html#%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B" class="rp-link">快速开始</a>安装 <a href="https://www.npmjs.com/package/@lynx-js/lynx-ui" target="_blank" rel="noopener noreferrer" class="rp-link"><code>@lynx-js/lynx-ui-*</code></a>。</p>
<p>下载 <a href="/zh/guide/start/quick-start.html#%E5%87%86%E5%A4%87-lynx-explorer" class="rp-link">Lynx Explorer</a>，扫描<a href="/zh/lynx-ui/components/button.html" class="rp-link">组件示例</a>中的二维码，即可在真机上查看实际效果。你也可以直接将组件集成到自己的 Lynx 应用中，在真实业务流中试用。</p>
<p>我们希望 lynx-ui 能在真实应用的实践中不断成长。如果它体验很好、阻碍了你、或者缺少了什么，请在 <a href="https://github.com/lynx-family/lynx-ui" target="_blank" rel="noopener noreferrer" class="rp-link">lynx-family/lynx-ui 仓库</a>中告诉我们。一起塑造它的未来。</p><!--/$-->]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lynx 3.7：桌面端、SVG、Skills 与 ReactLynx 更新]]></title>
            <link>https://lynxjs.org/zh/blog/lynx-3-7</link>
            <guid isPermaLink="false">/zh/blog/lynx-3-7</guid>
            <pubDate>Thu, 16 Apr 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Lynx 3.7 已经正式发布！本次版本正式支持 macOS 和 Windows 桌面端平台，引入了新的 SVG 元件，引入了新的 Agent Skills 以提升可观测性，并为 ReactLynx 带来了更简单的 External Bundle presets 和跨线程共享模块能力。]]></description>
            <content:encoded><![CDATA[<h1 class="rp-toc-include" id="lynx-37桌面端svgskills-与-reactlynx-更新"><span>Lynx 3.7：桌面端、SVG、Skills 与 ReactLynx 更新</span><a href="#lynx-37桌面端svgskills-与-reactlynx-更新" class="rp-header-anchor rp-link" aria-hidden="true">#</a> </h1><div class="rp-not-doc rp-llms-container"><button class="rp-not-doc rp-llms-button rp-llms-copy-button"><div class="rp-llms-copy-button__icon-wrapper"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg></div><span>复制 Markdown</span></button><button class="rp-llms-button rp-llms-view-options__trigger "><svg width="1em" height="1em" viewBox="0 0 32 32" class="rp-llms-view-options__arrow "><path fill="currentColor" d="M16 22 6 12l1.4-1.4 8.6 8.6 8.6-8.6L26 12z"></path></svg></button></div><!--$--><a href="/next/zh/blog/" class="backLink-lQPNH7">← <!-- -->所有文章</a><div class="blogHeader-ZKfIZ_"><span class="date-aB5gkw">2026年4月16日</span><div class="blog-avatar-frame-G1eJ1T avatars-aaQ1Kf"><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/icecreamx10.png" alt="icecreamx10"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">icecreamx10</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">多平台主管 @ Lynx</span></div></span><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/MoonfaceX.png" alt="夏梦非"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">夏梦非</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">组件主管 @ Lynx</span></div></span><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/upupming.png" alt="upupming"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">upupming</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">工程师 @ Lynx</span></div></span><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/lynx-family.png" alt="Lynx 团队"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">Lynx 团队</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="14" viewBox="0 0 300 271" class="icon-x-XK0uad"><path fill="currentColor" d="M236 0h46L181 115l118 156h-92.6l-72.5-94.8-83 94.8h-46l107-123L-1.1 0h94.9l65.5 86.6zm-16.1 244h25.5L80.4 26H53z"></path></svg></span><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">lynxjs.org</span></div></span></div><div class="rp-not-doc rp-llms-container"><button class="rp-not-doc rp-llms-button rp-llms-copy-button"><div class="rp-llms-copy-button__icon-wrapper"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg></div><span>复制 Markdown</span></button><button class="rp-llms-button rp-llms-view-options__trigger "><svg width="1em" height="1em" viewBox="0 0 32 32" class="rp-llms-view-options__arrow "><path fill="currentColor" d="M16 22 6 12l1.4-1.4 8.6 8.6 8.6-8.6L26 12z"></path></svg></button></div></div>
<p>Lynx 3.7 已经正式发布！</p>
<p>本次版本正式支持 <strong>macOS</strong> 和 <strong>Windows</strong> 桌面端平台，引入了新的 <strong>SVG</strong> 元件，引入了新的 <strong>Agent Skills</strong> 以提升可观测性，并为 <strong>ReactLynx</strong> 带来了更简单的 External Bundle presets 和跨线程共享模块能力。</p>
<video src="/static/media/bringing-lynx-to-desktop.0fde71958b.mp4" autoplay="" muted="" loop="" playsinline="" style="width:100%;border-radius:12px;margin:24px 0;pointer-events:none"></video>
<h2 class="rp-toc-include" id="桌面端支持macos-与-windows"><a href="#桌面端支持macos-与-windows" class="rp-header-anchor rp-link" aria-hidden="true">#</a>桌面端支持：macOS 与 Windows</h2>
<p>我们<a href="/next/zh/blog/lynx-open-source-roadmap-2025.html" class="rp-link">此前计划</a>在 Lynx 3.5 中开源桌面端支持，<a href="/next/zh/blog/lynx-3-5.html#%E6%A1%8C%E9%9D%A2%E7%AB%AF%E6%94%AF%E6%8C%81%E9%A2%84%E5%91%8A" class="rp-link">随后决定</a>进一步开源完整的桌面端技术栈。在 Lynx 3.7 中，这一愿景已成为现实。</p>
<p>Lynx 正式支持 <strong>macOS</strong> 和 <strong>Windows</strong> 作为一级平台。你现在可以在原生桌面应用中构建和渲染 Lynx 视图，使用与移动端和 Web 端完全相同的前端技术栈和工具链。
我们也计划在最近开源 Lynxtron，它是一个 Electron-like 的桌面应用框架，使用 Lynx 作为 UI 渲染层。敬请期待！</p>
<div class="box-LTvjqb   "><div class="container-qARFbv"><div class="content-Yzcw9o"><div class="split-pane" style="display:flex;flex-direction:row;width:100%;height:100%;min-height:0"><div class="split-pane__first" style="flex:1;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="code-wrap-jURSQJ"><div class="code-tab-container-5FhsBL"><div class="code-view-container-lgwabm "><div class="code-kbFEhm"><div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables" data-lang="tsx"><code style="padding:1rem 1.25rem"></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div><div role="separator" class="split-pane__divider" tabindex="0" style="flex:0 0 10px;cursor:col-resize;display:flex;align-items:center;justify-content:center;position:relative;z-index:1;touch-action:none" aria-orientation="vertical"><span role="img" aria-label="handle" class="semi-icon semi-icon-default semi-icon-handle" style="font-size:10px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M9 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M9 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M11 19a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M17 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></svg></span></div><div class="split-pane__second" style="flex:0 0 auto;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="preview-wrap-un0XJO"><div class="preview-wrap-content-TYo6um"><div class="preview-header-zYAZlz"><div style="width:24px;flex-shrink:0"></div><div class="semi-radioGroup semi-radioGroup-wrapper semi-radioGroup-buttonRadio" style="display:flex;flex:1;min-width:0;justify-content:center"><div style="width:100%;height:32px"></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div><div class="preview-body-YE5PSF"><div class="preview-panel-amOf1r" style="z-index:1;visibility:visible;pointer-events:auto"><div style="min-height:0px;display:flex;width:100%;height:100%;align-items:center;justify-content:center"><img src="/static/image/mouse-cursor.f148022b03.png" alt="" loading="eager" decoding="async" style="max-width:100%;max-height:100%;object-fit:contain"/></div></div></div></div></div></div></div></div><div class="footer-KtlqMk"><div class="semi-space semi-space-align-center semi-space-horizontal" style="max-width:100%;overflow:hidden;white-space:nowrap;row-gap:2px;column-gap:2px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><span role="img" aria-label="list" class="semi-icon semi-icon-default semi-icon-list" style="color:var(--semi-color-text-2)"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><g opacity="0.99"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9.5 3a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM8 11.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 11.5Zm0 7c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 18.5Zm-2-7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-2 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></g></svg></span></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="overflow:hidden;row-gap:2px;column-gap:2px" x-semi-prop="children"><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>desktop</span></span><span role="img" aria-label="chevron_right_stroked" class="semi-icon semi-icon-default semi-icon-chevron_right_stroked" style="color:var(--semi-color-text-2);font-size:12px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.9 20.17a1.25 1.25 0 0 1-.07-1.77l5.71-6.15-5.7-6.15a1.25 1.25 0 0 1 1.83-1.7l6.5 7c.44.48.44 1.22 0 1.7l-6.5 7c-.47.5-1.26.54-1.77.07Z" fill="currentColor"></path></svg></span><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>src/mouse-cursor/App.tsx</span></span></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:7px;column-gap:7px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">Code</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">预览</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div></div></div></div>
<h3 class="rp-toc-include" id="css-与元件支持"><a href="#css-与元件支持" class="rp-header-anchor rp-link" aria-hidden="true">#</a>CSS 与元件支持</h3>
<p>渲染核心在各平台间复用（包括 CSS 引擎），<strong>CSS 属性覆盖率</strong>自然接近完整，目前达 <strong>97%</strong>（319 项中的 311 项）。桌面端界面由 <a href="https://github.com/lynx-family/lynx/tree/develop/clay" target="_blank" rel="noopener noreferrer" class="rp-link"><strong>Lynx 自绘渲染</strong></a>，而不是通过系统原生控件拼装，原生元件需要基于自绘渲染器重新实现，<strong>元素属性覆盖率</strong>目前为 <strong>73%</strong>（246 项中的 179 项），macOS 与 Windows 的支持范围保持一致，并持续扩展中。已覆盖的 CSS 能力包括：</p>
<ul>
<li><strong>布局</strong>：Flexbox、Grid、Linear Layout、完整盒模型、定位与相对定位。</li>
<li><strong>样式</strong>：排版、边框、阴影、渐变、蒙版、滤镜，以及 <a href="/zh/api/css/properties/css-variable.html" class="rp-link">CSS 自定义属性</a>。</li>
<li><strong>动画</strong>：<code>animation</code>、<code>transition</code>、<code>@keyframes</code> 和完整的 transform 能力。</li>
</ul>
<p>这意味着大多数为移动端构建的 Lynx 页面已经可以在桌面端渲染，前端代码通常只需极少修改甚至无需修改。每个 API 页面上方均提供兼容性概览，下方附有详细的兼容性表格。也可在 <a href="https://lynxjs.org/api/status" target="_blank" rel="noopener noreferrer" class="rp-link">API 兼容状态看板</a> 上一览全局，现已包含 <strong>macOS</strong> 和 <strong>Windows</strong> 列。</p>
<h3 class="rp-toc-include" id="桌面端专属能力"><a href="#桌面端专属能力" class="rp-header-anchor rp-link" aria-hidden="true">#</a>桌面端专属能力</h3>
<h4 class="rp-toc-include" id="鼠标事件"><a href="#鼠标事件" class="rp-header-anchor rp-link" aria-hidden="true">#</a><a href="/zh/api/lynx-api/event/mouse-event.html" class="rp-link">鼠标事件</a></h4>
<div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables has-highlighted" style="background-color:var(--shiki-background);color:var(--shiki-foreground)" tabindex="0" data-lang="tsx"><code><span class="line"><span style="color:var(--shiki-foreground)">&lt;</span><span style="color:var(--shiki-token-string-expression)">view</span></span>
<span class="line"><span style="color:var(--shiki-token-function)">  onMouseDown</span><span style="color:var(--shiki-token-keyword)">=</span><span style="color:var(--shiki-foreground)">{(e) </span><span style="color:var(--shiki-token-keyword)">=&gt;</span></span>
<span class="line"><span style="color:var(--shiki-token-constant)">    console</span><span style="color:var(--shiki-token-function)">.log</span><span style="color:var(--shiki-foreground)">(</span><span style="color:var(--shiki-token-string-expression)">`按键 </span><span style="color:var(--shiki-token-keyword)">${</span><span style="color:var(--shiki-token-constant)">e</span><span style="color:var(--shiki-foreground)">.button</span><span style="color:var(--shiki-token-keyword)">}</span><span style="color:var(--shiki-token-string-expression)"> 位置 (</span><span style="color:var(--shiki-token-keyword)">${</span><span style="color:var(--shiki-token-constant)">e</span><span style="color:var(--shiki-foreground)">.clientX</span><span style="color:var(--shiki-token-keyword)">}</span><span style="color:var(--shiki-token-string-expression)">, </span><span style="color:var(--shiki-token-keyword)">${</span><span style="color:var(--shiki-token-constant)">e</span><span style="color:var(--shiki-foreground)">.clientY</span><span style="color:var(--shiki-token-keyword)">}</span><span style="color:var(--shiki-token-string-expression)">)`</span><span style="color:var(--shiki-foreground)">)</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">  }</span></span>
<span class="line"><span style="color:var(--shiki-token-function)">  onMouseMove</span><span style="color:var(--shiki-token-keyword)">=</span><span style="color:var(--shiki-foreground)">{(e) </span><span style="color:var(--shiki-token-keyword)">=&gt;</span><span style="color:var(--shiki-token-function)"> handleHover</span><span style="color:var(--shiki-foreground)">(e)}</span></span>
<span class="line"><span style="color:var(--shiki-token-function)">  onMouseLeave</span><span style="color:var(--shiki-token-keyword)">=</span><span style="color:var(--shiki-foreground)">{() </span><span style="color:var(--shiki-token-keyword)">=&gt;</span><span style="color:var(--shiki-token-function)"> resetState</span><span style="color:var(--shiki-foreground)">()}</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">/&gt;</span></span></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div>
<h4 class="rp-toc-include" id="键盘事件"><a href="#键盘事件" class="rp-header-anchor rp-link" aria-hidden="true">#</a><a href="/zh/api/lynx-api/event/key-event.html" class="rp-link">键盘事件</a></h4>
<div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables has-highlighted" style="background-color:var(--shiki-background);color:var(--shiki-foreground)" tabindex="0" data-lang="tsx"><code><span class="line"><span style="color:var(--shiki-foreground)">&lt;</span><span style="color:var(--shiki-token-string-expression)">input</span></span>
<span class="line"><span style="color:var(--shiki-token-function)">  onKeyDown</span><span style="color:var(--shiki-token-keyword)">=</span><span style="color:var(--shiki-foreground)">{(e) </span><span style="color:var(--shiki-token-keyword)">=&gt;</span><span style="color:var(--shiki-token-constant)"> console</span><span style="color:var(--shiki-token-function)">.log</span><span style="color:var(--shiki-foreground)">(</span><span style="color:var(--shiki-token-string-expression)">`按下按键: </span><span style="color:var(--shiki-token-keyword)">${</span><span style="color:var(--shiki-token-constant)">e</span><span style="color:var(--shiki-foreground)">.key</span><span style="color:var(--shiki-token-keyword)">}</span><span style="color:var(--shiki-token-string-expression)">`</span><span style="color:var(--shiki-foreground)">)}</span></span>
<span class="line"><span style="color:var(--shiki-token-function)">  onKeyUp</span><span style="color:var(--shiki-token-keyword)">=</span><span style="color:var(--shiki-foreground)">{(e) </span><span style="color:var(--shiki-token-keyword)">=&gt;</span><span style="color:var(--shiki-token-constant)"> console</span><span style="color:var(--shiki-token-function)">.log</span><span style="color:var(--shiki-foreground)">(</span><span style="color:var(--shiki-token-string-expression)">`释放按键: </span><span style="color:var(--shiki-token-keyword)">${</span><span style="color:var(--shiki-token-constant)">e</span><span style="color:var(--shiki-foreground)">.key</span><span style="color:var(--shiki-token-keyword)">}</span><span style="color:var(--shiki-token-string-expression)">`</span><span style="color:var(--shiki-foreground)">)}</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">/&gt;</span></span></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div>
<h4 class="rp-toc-include" id="滚轮事件"><a href="#滚轮事件" class="rp-header-anchor rp-link" aria-hidden="true">#</a><a href="/zh/api/lynx-api/event/wheel-event.html" class="rp-link">滚轮事件</a></h4>
<div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables has-highlighted" style="background-color:var(--shiki-background);color:var(--shiki-foreground)" tabindex="0" data-lang="tsx"><code><span class="line"><span style="color:var(--shiki-foreground)">&lt;</span><span style="color:var(--shiki-token-string-expression)">view</span><span style="color:var(--shiki-token-function)"> onWheel</span><span style="color:var(--shiki-token-keyword)">=</span><span style="color:var(--shiki-foreground)">{(e) </span><span style="color:var(--shiki-token-keyword)">=&gt;</span><span style="color:var(--shiki-token-constant)"> console</span><span style="color:var(--shiki-token-function)">.log</span><span style="color:var(--shiki-foreground)">(</span><span style="color:var(--shiki-token-string-expression)">`滚轮偏移: </span><span style="color:var(--shiki-token-keyword)">${</span><span style="color:var(--shiki-token-constant)">e</span><span style="color:var(--shiki-foreground)">.deltaX</span><span style="color:var(--shiki-token-keyword)">}</span><span style="color:var(--shiki-token-string-expression)">, </span><span style="color:var(--shiki-token-keyword)">${</span><span style="color:var(--shiki-token-constant)">e</span><span style="color:var(--shiki-foreground)">.deltaY</span><span style="color:var(--shiki-token-keyword)">}</span><span style="color:var(--shiki-token-string-expression)">`</span><span style="color:var(--shiki-foreground)">)} /&gt;</span></span></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div>
<h4 class="rp-toc-include" id="css-cursor"><a href="#css-cursor" class="rp-header-anchor rp-link" aria-hidden="true">#</a><a href="/zh/api/css/properties/cursor.html" class="rp-link">CSS <code>cursor</code></a></h4>
<div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables has-highlighted" style="background-color:var(--shiki-background);color:var(--shiki-foreground)" tabindex="0" data-lang="tsx"><code><span class="line"><span style="color:var(--shiki-foreground)">&lt;</span><span style="color:var(--shiki-token-string-expression)">view</span><span style="color:var(--shiki-token-function)"> style</span><span style="color:var(--shiki-token-keyword)">=</span><span style="color:var(--shiki-foreground)">{{ cursor</span><span style="color:var(--shiki-token-keyword)">:</span><span style="color:var(--shiki-token-string-expression)"> &#x27;pointer&#x27;</span><span style="color:var(--shiki-foreground)"> }}&gt;</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">  &lt;</span><span style="color:var(--shiki-token-string-expression)">text</span><span style="color:var(--shiki-foreground)">&gt;Hover me&lt;/</span><span style="color:var(--shiki-token-string-expression)">text</span><span style="color:var(--shiki-foreground)">&gt;</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">&lt;/</span><span style="color:var(--shiki-token-string-expression)">view</span><span style="color:var(--shiki-foreground)">&gt;</span></span></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div>
<h3 class="rp-toc-include" id="快速上手"><a href="#快速上手" class="rp-header-anchor rp-link" aria-hidden="true">#</a>快速上手</h3>
<p>桌面端的接入细节可直接查看<a href="/zh/guide/start/integrate-with-existing-apps.html" class="rp-link">将 Lynx 集成到现有应用</a>。该页面现已包含与 Android、iOS、HarmonyOS、Web 并列的桌面端指南。
后续也会有一个由 Lynxtron 构建的 playground 应用，在桌面端更直接地获取并运行 Lynx 示例。</p>
<h2 class="rp-toc-include" id="svg可缩放矢量图形"><a href="#svg可缩放矢量图形" class="rp-header-anchor rp-link" aria-hidden="true">#</a><code>&lt;svg&gt;</code>：可缩放矢量图形</h2>
<p><a href="/zh/api/elements/built-in/svg.html" class="rp-link"><code>&lt;svg&gt;</code></a> 作为独立元件在 Lynx 3.7 中新增，为图标、图表和其他分辨率无关的图形场景提供跨平台的原生矢量渲染能力。</p>
<p><code>&lt;svg&gt;</code> 支持内联矢量内容：</p>
<div class="box-LTvjqb   "><div class="container-qARFbv"><div class="content-Yzcw9o"><div class="split-pane" style="display:flex;flex-direction:row;width:100%;height:100%;min-height:0"><div class="split-pane__first" style="flex:1;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="code-wrap-jURSQJ"><div class="code-tab-container-5FhsBL"><div class="code-view-container-lgwabm "><div class="code-kbFEhm"><div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables" data-lang="tsx"><code style="padding:1rem 1.25rem"></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div><div role="separator" class="split-pane__divider" tabindex="0" style="flex:0 0 10px;cursor:col-resize;display:flex;align-items:center;justify-content:center;position:relative;z-index:1;touch-action:none" aria-orientation="vertical"><span role="img" aria-label="handle" class="semi-icon semi-icon-default semi-icon-handle" style="font-size:10px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M9 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M9 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M11 19a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M17 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></svg></span></div><div class="split-pane__second" style="flex:0 0 auto;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="preview-wrap-un0XJO"><div class="preview-wrap-content-TYo6um"><div class="preview-header-zYAZlz"><div style="width:24px;flex-shrink:0"></div><div class="semi-radioGroup semi-radioGroup-wrapper semi-radioGroup-buttonRadio" style="display:flex;flex:1;min-width:0;justify-content:center"><div style="width:100%;height:32px"></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div><div class="preview-body-YE5PSF"><div class="preview-panel-amOf1r" style="z-index:1;visibility:visible;pointer-events:auto"><div style="min-height:0px;display:flex;width:100%;height:100%;align-items:center;justify-content:center"><img src="/static/image/svg-example.266b0cc2ca.png" alt="" loading="eager" decoding="async" style="max-width:100%;max-height:100%;object-fit:contain"/></div></div></div></div></div></div></div></div><div class="footer-KtlqMk"><div class="semi-space semi-space-align-center semi-space-horizontal" style="max-width:100%;overflow:hidden;white-space:nowrap;row-gap:2px;column-gap:2px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><span role="img" aria-label="list" class="semi-icon semi-icon-default semi-icon-list" style="color:var(--semi-color-text-2)"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><g opacity="0.99"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9.5 3a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM8 11.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 11.5Zm0 7c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 18.5Zm-2-7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-2 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></g></svg></span></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="overflow:hidden;row-gap:2px;column-gap:2px" x-semi-prop="children"><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>svg</span></span><span role="img" aria-label="chevron_right_stroked" class="semi-icon semi-icon-default semi-icon-chevron_right_stroked" style="color:var(--semi-color-text-2);font-size:12px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.9 20.17a1.25 1.25 0 0 1-.07-1.77l5.71-6.15-5.7-6.15a1.25 1.25 0 0 1 1.83-1.7l6.5 7c.44.48.44 1.22 0 1.7l-6.5 7c-.47.5-1.26.54-1.77.07Z" fill="currentColor"></path></svg></span><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>src/base/index.tsx</span></span></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:7px;column-gap:7px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">Code</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">预览</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div></div></div></div>
<p>也可以直接加载外部 SVG 资源：</p>
<div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables has-highlighted" style="background-color:var(--shiki-background);color:var(--shiki-foreground)" tabindex="0" data-lang="tsx"><code><span class="line"><span style="color:var(--shiki-foreground)">&lt;</span><span style="color:var(--shiki-token-string-expression)">svg</span></span>
<span class="line"><span style="color:var(--shiki-token-function)">  style</span><span style="color:var(--shiki-token-keyword)">=</span><span style="color:var(--shiki-foreground)">{{ width</span><span style="color:var(--shiki-token-keyword)">:</span><span style="color:var(--shiki-token-string-expression)"> &#x27;100px&#x27;</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-foreground)"> height</span><span style="color:var(--shiki-token-keyword)">:</span><span style="color:var(--shiki-token-string-expression)"> &#x27;100px&#x27;</span><span style="color:var(--shiki-foreground)"> }}</span></span>
<span class="line"><span style="color:var(--shiki-token-function)">  src</span><span style="color:var(--shiki-token-keyword)">=</span><span style="color:var(--shiki-token-string-expression)">&quot;https://example.com/icon.svg&quot;</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">/&gt;</span></span></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div>
<p>为了最大化性能，<code>&lt;svg&gt;</code> 将解析工作交由后台独立线程处理，并将整个图形作为一个原生视图进行渲染，而非为每个节点创建独立的元素。这使得主线程在解析耗时和节点数量上都保持轻量，非常适合图标、插画和图表等静态展示场景。它支持 <a href="/zh/api/elements/built-in/svg.html" class="rp-link">17 个常用 SVG 标签和超过 40 个属性</a>，并在 Android、iOS、HarmonyOS、macOS、Windows 和 Web 之间保持一致的渲染表现。</p>
<h2 class="rp-toc-include" id="agent-skills"><a href="#agent-skills" class="rp-header-anchor rp-link" aria-hidden="true">#</a>Agent Skills</h2>
<p>作为 <a href="/zh/ai/index.html" class="rp-link">Lynx for AI</a> 的一部分，六个 <a href="https://github.com/lynx-community/skills" target="_blank" rel="noopener noreferrer" class="rp-link">Agent Skills</a> 现已开源。安装任意技能：</p>
<div class="rp-codeblock language-bash"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables has-highlighted" style="background-color:var(--shiki-background);color:var(--shiki-foreground)" tabindex="0" data-lang="bash"><code><span class="line"><span style="color:var(--shiki-token-function)">npx</span><span style="color:var(--shiki-token-string)"> skills</span><span style="color:var(--shiki-token-string)"> add</span><span style="color:var(--shiki-token-string)"> lynx-community/skills</span><span style="color:var(--shiki-token-string)"> -s</span><span style="color:var(--shiki-token-keyword)"> &lt;</span><span style="color:var(--shiki-token-string)">skill-nam</span><span style="color:var(--shiki-foreground)">e</span><span style="color:var(--shiki-token-keyword)">&gt;</span></span></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div>
<div class="rp-table-scroll-container rp-scrollbar"><table><thead><tr><th>技能</th><th>功能</th></tr></thead><tbody><tr><td><strong>reactlynx-best-practices</strong></td><td>静态分析、自动修复，以及编写双线程 ReactLynx 代码的最佳实践规则。</td></tr><tr><td><strong>lynx-devtool</strong></td><td>通过命令行检查运行中 Lynx 应用的 DOM、控制台输出和运行时状态。</td></tr><tr><td><strong>lynx-typescript</strong></td><td>Lynx 项目中 TypeScript 环境配置、类型与事件处理的指导。</td></tr><tr><td><strong>trace-analysis</strong></td><td>分析 <code>.ptrace</code> 文件，定位渲染瓶颈与性能回退。</td></tr><tr><td><strong>trace-record</strong></td><td>采集 Lynx 性能 trace，支持系统 trace 和 JS profiling。</td></tr><tr><td><strong>lynx-debug-info-remapping</strong></td><td>将主线程压缩后的错误位置映射回原始源码。</td></tr></tbody></table></div>
<p>配合 <a href="/zh/ai/lynx-devtool-mcp.html" class="rp-link">Lynx DevTool MCP</a>，coding agent 现在可以检查运行中的页面、验证交互并缩短自调试链路。</p>
<h2 class="rp-toc-include" id="reactlynx"><a href="#reactlynx" class="rp-header-anchor rp-link" aria-hidden="true">#</a>ReactLynx</h2>
<h3 class="rp-toc-include" id="external-bundle-presets"><a href="#external-bundle-presets" class="rp-header-anchor rp-link" aria-hidden="true">#</a>External Bundle Presets</h3>
<p><a href="/zh/rspeedy/external-bundle.html" class="rp-link">External Bundle</a> 允许你构建一次 Lynx bundle，然后在多个 Lynx 应用中运行时加载。当你需要跨应用共享 ReactLynx 组件或通用业务 bundle 时，可以使用它。与 <a href="/zh/api/rspeedy/rspeedy.performance.chunksplit.html" class="rp-link">Chunk Splitting</a> 用于拆分单个应用内代码不同，External Bundle 专为跨应用复用而设计。</p>
<p>Lynx 3.7 通过 <a href="/zh/api/rspeedy/lynx-bundle-rslib-config.html" class="rp-link"><code>defineExternalBundleRslibConfig</code></a> 新增了内置 presets 以简化配置：</p>
<div class="rp-codeblock language-ts"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables has-highlighted" style="background-color:var(--shiki-background);color:var(--shiki-foreground)" tabindex="0" data-lang="ts"><code><span class="line"><span style="color:var(--shiki-token-keyword)">import</span><span style="color:var(--shiki-foreground)"> { defineExternalBundleRslibConfig } </span><span style="color:var(--shiki-token-keyword)">from</span><span style="color:var(--shiki-token-string-expression)"> &#x27;@lynx-js/lynx-bundle-rslib-config&#x27;</span><span style="color:var(--shiki-foreground)">;</span></span>
<span class="line"><span style="color:var(--shiki-token-keyword)">import</span><span style="color:var(--shiki-foreground)"> { pluginReactLynx } </span><span style="color:var(--shiki-token-keyword)">from</span><span style="color:var(--shiki-token-string-expression)"> &#x27;@lynx-js/react-rsbuild-plugin&#x27;</span><span style="color:var(--shiki-foreground)">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:var(--shiki-token-keyword)">export</span><span style="color:var(--shiki-token-keyword)"> default</span><span style="color:var(--shiki-token-function)"> defineExternalBundleRslibConfig</span><span style="color:var(--shiki-foreground)">({</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">  id</span><span style="color:var(--shiki-token-keyword)">:</span><span style="color:var(--shiki-token-string-expression)"> &#x27;comp-lib&#x27;</span><span style="color:var(--shiki-token-punctuation)">,</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">  source</span><span style="color:var(--shiki-token-keyword)">:</span><span style="color:var(--shiki-foreground)"> {</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">    entry</span><span style="color:var(--shiki-token-keyword)">:</span><span style="color:var(--shiki-foreground)"> {</span></span>
<span class="line"><span style="color:var(--shiki-token-string-expression)">      &#x27;./App.js&#x27;</span><span style="color:var(--shiki-token-keyword)">:</span><span style="color:var(--shiki-token-string-expression)"> &#x27;./external-bundle/CompLib.tsx&#x27;</span><span style="color:var(--shiki-token-punctuation)">,</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">    }</span><span style="color:var(--shiki-token-punctuation)">,</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">  }</span><span style="color:var(--shiki-token-punctuation)">,</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">  plugins</span><span style="color:var(--shiki-token-keyword)">:</span><span style="color:var(--shiki-foreground)"> [</span><span style="color:var(--shiki-token-function)">pluginReactLynx</span><span style="color:var(--shiki-foreground)">()]</span><span style="color:var(--shiki-token-punctuation)">,</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">  output</span><span style="color:var(--shiki-token-keyword)">:</span><span style="color:var(--shiki-foreground)"> {</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">    externalsPresets</span><span style="color:var(--shiki-token-keyword)">:</span><span style="color:var(--shiki-foreground)"> {</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">      reactlynx</span><span style="color:var(--shiki-token-keyword)">:</span><span style="color:var(--shiki-token-constant)"> true</span><span style="color:var(--shiki-token-punctuation)">,</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">    }</span><span style="color:var(--shiki-token-punctuation)">,</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">  }</span><span style="color:var(--shiki-token-punctuation)">,</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">});</span></span></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div>
<p>然后在宿主应用里加载这份 bundle：</p>
<div class="box-LTvjqb   "><div class="container-qARFbv"><div class="content-Yzcw9o"><div class="code-wrap-jURSQJ"><div class="code-tab-container-5FhsBL"><div class="code-view-container-lgwabm "><div class="code-kbFEhm"><div class="rp-codeblock language-js"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables" data-lang="js"><code style="padding:1rem 1.25rem"></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div><div class="footer-KtlqMk"><div class="semi-space semi-space-align-center semi-space-horizontal" style="max-width:100%;overflow:hidden;white-space:nowrap;row-gap:2px;column-gap:2px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><span role="img" aria-label="list" class="semi-icon semi-icon-default semi-icon-list" style="color:var(--semi-color-text-2)"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><g opacity="0.99"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9.5 3a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM8 11.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 11.5Zm0 7c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 18.5Zm-2-7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-2 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></g></svg></span></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="overflow:hidden;row-gap:2px;column-gap:2px" x-semi-prop="children"><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>external-bundle</span></span><span role="img" aria-label="chevron_right_stroked" class="semi-icon semi-icon-default semi-icon-chevron_right_stroked" style="color:var(--semi-color-text-2);font-size:12px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.9 20.17a1.25 1.25 0 0 1-.07-1.77l5.71-6.15-5.7-6.15a1.25 1.25 0 0 1 1.83-1.7l6.5 7c.44.48.44 1.22 0 1.7l-6.5 7c-.47.5-1.26.54-1.77.07Z" fill="currentColor"></path></svg></span><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>lynx.config.mjs</span></span></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:7px;column-gap:7px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg></span></button><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div></div></div></div>
<h3 class="rp-toc-include" id="跨线程共享模块"><a href="#跨线程共享模块" class="rp-header-anchor rp-link" aria-hidden="true">#</a>跨线程共享模块</h3>
<p>默认情况下，主线程函数无法直接调用没有 <a href="/zh/react/main-thread-script.html" class="rp-link"><code>&#x27;main thread&#x27;</code> 指令</a>的普通函数，这使得代码复用变得困难。<a href="/zh/react/main-thread-script.html#%E8%B7%A8%E7%BA%BF%E7%A8%8B%E5%85%B1%E4%BA%AB%E6%A8%A1%E5%9D%97" class="rp-link">共享模块</a>机制解决了这一限制，允许你显式声明某些模块可在主线程和后台线程之间共享。</p>
<p>在 import 语句后添加 <code>with { runtime: &#x27;shared&#x27; }</code>，该模块导出的函数、类和对象即可在主线程函数中直接调用：</p>
<div class="box-LTvjqb   "><div class="container-qARFbv"><div class="content-Yzcw9o"><div class="code-wrap-jURSQJ"><div class="code-tab-container-5FhsBL"><div class="code-view-container-lgwabm "><div class="code-kbFEhm"><div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables" data-lang="tsx"><code style="padding:1rem 1.25rem"></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div><div class="footer-KtlqMk"><div class="semi-space semi-space-align-center semi-space-horizontal" style="max-width:100%;overflow:hidden;white-space:nowrap;row-gap:2px;column-gap:2px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><span role="img" aria-label="list" class="semi-icon semi-icon-default semi-icon-list" style="color:var(--semi-color-text-2)"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><g opacity="0.99"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9.5 3a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM8 11.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 11.5Zm0 7c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 18.5Zm-2-7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-2 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></g></svg></span></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="overflow:hidden;row-gap:2px;column-gap:2px" x-semi-prop="children"><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>main-thread</span></span><span role="img" aria-label="chevron_right_stroked" class="semi-icon semi-icon-default semi-icon-chevron_right_stroked" style="color:var(--semi-color-text-2);font-size:12px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.9 20.17a1.25 1.25 0 0 1-.07-1.77l5.71-6.15-5.7-6.15a1.25 1.25 0 0 1 1.83-1.7l6.5 7c.44.48.44 1.22 0 1.7l-6.5 7c-.47.5-1.26.54-1.77.07Z" fill="currentColor"></path></svg></span><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>src/shared-module/App.tsx</span></span></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:7px;column-gap:7px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg></span></button><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div></div></div></div>
<h2 class="rp-toc-include" id="升级指南"><a href="#升级指南" class="rp-header-anchor rp-link" aria-hidden="true">#</a>升级指南</h2>
<p>参照官网<a href="https://lynxjs.org/3.7/zh/guide/start/integrate-with-existing-apps.html" target="_blank" rel="noopener noreferrer" class="rp-link">接入 Lynx 到现有应用</a>，更新 Lynx 依赖版本，即可完成 Lynx 3.7 版本升级。</p><!--/$-->]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lynx 2026 年技术路线图]]></title>
            <link>https://lynxjs.org/zh/blog/lynx-open-source-roadmap-2026</link>
            <guid isPermaLink="false">/zh/blog/lynx-open-source-roadmap-2026</guid>
            <pubDate>Mon, 13 Apr 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[2026 年，Lynx 将加快发布节奏、投入 AI 原生文档与工具、提升桌面端生产可用性、强化基础设施，并深化开源社区协作。]]></description>
            <content:encoded><![CDATA[<h1 class="rp-toc-include" id="lynx-2026-年技术路线图"><span>Lynx 2026 年技术路线图</span><a href="#lynx-2026-年技术路线图" class="rp-header-anchor rp-link" aria-hidden="true">#</a> </h1><div class="rp-not-doc rp-llms-container"><button class="rp-not-doc rp-llms-button rp-llms-copy-button"><div class="rp-llms-copy-button__icon-wrapper"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg></div><span>复制 Markdown</span></button><button class="rp-llms-button rp-llms-view-options__trigger "><svg width="1em" height="1em" viewBox="0 0 32 32" class="rp-llms-view-options__arrow "><path fill="currentColor" d="M16 22 6 12l1.4-1.4 8.6 8.6 8.6-8.6L26 12z"></path></svg></button></div><!--$--><a href="/next/zh/blog/" class="backLink-lQPNH7">← <!-- -->所有文章</a><div class="blogHeader-ZKfIZ_"><span class="date-aB5gkw">2026年4月13日</span><div class="blog-avatar-frame-G1eJ1T avatars-aaQ1Kf"><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/lynx-family.png" alt="刘守群"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">刘守群</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="14" viewBox="0 0 300 271" class="icon-x-XK0uad"><path fill="currentColor" d="M236 0h46L181 115l118 156h-92.6l-72.5-94.8-83 94.8h-46l107-123L-1.1 0h94.9l65.5 86.6zm-16.1 244h25.5L80.4 26H53z"></path></svg></span><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">工程主管 @ Lynx</span></div></span></div><div class="rp-not-doc rp-llms-container"><button class="rp-not-doc rp-llms-button rp-llms-copy-button"><div class="rp-llms-copy-button__icon-wrapper"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg></div><span>复制 Markdown</span></button><button class="rp-llms-button rp-llms-view-options__trigger "><svg width="1em" height="1em" viewBox="0 0 32 32" class="rp-llms-view-options__arrow "><path fill="currentColor" d="M16 22 6 12l1.4-1.4 8.6 8.6 8.6-8.6L26 12z"></path></svg></button></div></div>
<p><a href="/next/zh/blog/lynx-unlock-native-for-more.html" class="rp-link">去年</a>，我们在 TikTok 的支持下将 Lynx 框架开源，此后收到了开发者和更广泛社区的宝贵反馈。我们还分享了 <a href="/next/zh/blog/lynx-open-source-roadmap-2025.html" class="rp-link">2025 年路线图</a>，聚焦于保持一致的发布节奏、扩展多平台支持并开放更多核心功能。</p>
<p>随着从 v3.2 到 v3.6 的持续发布，Lynx 已取得多项重要进展：</p>
<ul>
<li>全面支持 Web 和 <a href="/next/zh/blog/lynx-harmony.html" class="rp-link">OpenHarmony</a>。</li>
<li>扩展 <a href="https://github.com/lynx-family/lynx-ui" target="_blank" rel="noopener noreferrer" class="rp-link">lynx-ui</a> 覆盖范围，并提升原生 API 的稳定性。</li>
<li>社区中涌现出多个新项目，如 <a href="https://github.com/haskell-miso/miso-lynx" target="_blank" rel="noopener noreferrer" class="rp-link">miso-lynx</a>、<a href="https://vue.lynxjs.org/" target="_blank" rel="noopener noreferrer" class="rp-link">Vue Lynx</a> 等。</li>
</ul>
<p>与此同时，我们认识到构建一个优秀的开发者框架是一项长期的努力——尤其是在快速发展的 AI 时代。今天，我们很高兴分享 2026 年 Lynx 开源路线图。</p>
<hr/>
<h2 class="rp-toc-include" id="1-更快且更可预测的发布节奏"><a href="#1-更快且更可预测的发布节奏" class="rp-header-anchor rp-link" aria-hidden="true">#</a>1. 更快且更可预测的发布节奏</h2>
<p>在过去一年中，Lynx 采用了双月发布周期。随着即将发布的 v3.7 完成本轮周期，我们将从 2026 年年中开始过渡到每月发布一次。</p>
<div class="rp-table-scroll-container rp-scrollbar"><table><thead><tr><th>稳定版本</th><th>3.8</th><th>3.9</th><th>4.0</th><th>4.1</th><th>4.2</th><th>4.3</th><th>4.4</th><th>4.5</th></tr></thead><tbody><tr><td>发布时间</td><td>2026/05</td><td>2026/06</td><td>2026/07</td><td>2026/08</td><td>2026/09</td><td>2026/10</td><td>2026/11</td><td>2026/12</td></tr></tbody></table></div>
<p>在开发和发布过程中，我们将持续改进：</p>
<ul>
<li>发布说明与升级指南。</li>
<li>核心 API 的稳定性保障。</li>
<li>跨版本的长期可维护性。</li>
</ul>
<h2 class="rp-toc-include" id="2-拥抱-ai"><a href="#2-拥抱-ai" class="rp-header-anchor rp-link" aria-hidden="true">#</a>2. 拥抱 AI</h2>
<p>AI 正在从根本上重塑软件的构建方式。我们相信，在开放环境中构建框架，是跟上 AI 发展节奏并成为真正 AI 原生框架的关键。</p>
<p>今年，我们将重点投入更加稳定、结构化的 API 设计，以及高质量、对大模型友好的文档（<a href="https://github.com/lynx-family/lynx-website" target="_blank" rel="noopener noreferrer" class="rp-link">lynx-website</a>）、<a href="https://github.com/lynx-community/skills" target="_blank" rel="noopener noreferrer" class="rp-link">Agent Skills</a>、开发工具与示例。</p>
<p>同时，我们也将探索基于 Lynx 的生成式 UI，因为我们认为这是 AI 时代跨平台框架的重要方向。我们的目标是让 Lynx 成为最具 AI 原生能力的跨平台框架之一。</p>
<h2 class="rp-toc-include" id="3-持续投入多平台包括桌面端"><a href="#3-持续投入多平台包括桌面端" class="rp-header-anchor rp-link" aria-hidden="true">#</a>3. 持续投入多平台，包括桌面端</h2>
<p>多平台支持始终是我们的核心使命，不仅体现在渲染层，也体现在能力体系、API 设计以及整体开发者体验上。</p>
<p>目前我们已正式支持 Android、iOS、Web 和 <a href="/next/zh/blog/lynx-harmony.html" class="rp-link">OpenHarmony</a>，同时也开源了面向桌面平台（macOS / Windows）的渲染引擎 <a href="https://github.com/lynx-family/lynx/tree/develop/clay" target="_blank" rel="noopener noreferrer" class="rp-link">Clay</a>。</p>
<p>今年，我们将继续提升桌面平台的生产可用性，并加强与行业生态的融合，包括 Lynxtron（即将推出），它将 Lynx 与 Electron 结合用于桌面开发。</p>
<h2 class="rp-toc-include" id="4-生产就绪的基础设施"><a href="#4-生产就绪的基础设施" class="rp-header-anchor rp-link" aria-hidden="true">#</a>4. 生产就绪的基础设施</h2>
<p>开源后，我们收到了大量开发者反馈，希望获得开箱即用的解决方案以快速构建跨平台应用。为应对这些需求，TikTok 已开源 <a href="https://github.com/tiktok/Sparkling" target="_blank" rel="noopener noreferrer" class="rp-link">Sparkling</a>，提供应用脚手架与原生导航帮助开发者快速上手。我们将持续增加更多原生能力，包括设备 API 等。</p>
<p>在框架层，我们将通过 <a href="https://github.com/lynx-family/lynx-ui" target="_blank" rel="noopener noreferrer" class="rp-link">lynx-ui</a> 提供更多生产就绪的 UI 组件，扩展动画与 CSS 能力以打造更高质量的 UI 体验，同时持续投入主线程脚本等关键特性，并进一步提升各平台的运行时性能。</p>
<p>在工具链层，我们将开放更多性能分析与诊断工具，并持续增强 <a href="/zh/guide/start/integrate-lynx-devtool.html" class="rp-link">Lynx DevTool</a>，为开发者提供一站式的开发与调试体验。</p>
<h2 class="rp-toc-include" id="5-加强社区协作"><a href="#5-加强社区协作" class="rp-header-anchor rp-link" aria-hidden="true">#</a>5. 加强社区协作</h2>
<p>跨平台框架是一个由开源社区持续推动、长期演进的技术领域。Lynx 本身也深受这一生态的启发。</p>
<p>Lynx 工具链基于 <a href="https://rspack.rs/" target="_blank" rel="noopener noreferrer" class="rp-link">Rspack</a> 构建，我们已与 Rspack 社区保持紧密合作，共同打造高性能的 <a href="/zh/rspeedy/index.html" class="rp-link">Rspeedy</a> 工具链。这一与 Web 工具生态的伙伴关系，也为更广泛的社区协作奠定了基础。</p>
<p>展望未来，我们将进一步加强与更广泛的 Web 社区的协作，包括 React、Vue.js、Motion 等项目，并持续完善 MiniApps 能力，使其成为真正可用于生产环境的解决方案。</p>
<hr/>
<p>我们也有开放职位，欢迎加入我们，一起参与 Lynx 的成长之旅。点击<a href="https://jobs.bytedance.com/experienced/position?keywords=Cross%20Platform" target="_blank" rel="noopener noreferrer" class="rp-link">这里</a>查看机会。</p><!--/$-->]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lynx 3.6：面向 AI、reactlynx-use、为设计工程而生的 CSS]]></title>
            <link>https://lynxjs.org/zh/blog/lynx-3-6</link>
            <guid isPermaLink="false">/zh/blog/lynx-3-6</guid>
            <pubDate>Fri, 30 Jan 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Lynx 3.6 已经正式发布！本次版本推出面向 AI 的 Lynx 以增强 AI 原生开发能力，引入 reactlynx-use 以提升开发体验，并围绕设计表达能力增强了 CSS 能力。在原生侧，Lynx 3.6 进一步完善平台集成，在 HarmonyOS 上支持 Standalone BackgroundRuntime 与异步 TemplateBundle 创建，并在 iOS 上新增 LynxView 的 Auto Layout 支持。]]></description>
            <content:encoded><![CDATA[<h1 class="rp-toc-include" id="lynx-36面向-aireactlynx-use为设计工程而生的-css"><span>Lynx 3.6：面向 AI、reactlynx-use、为设计工程而生的 CSS</span><a href="#lynx-36面向-aireactlynx-use为设计工程而生的-css" class="rp-header-anchor rp-link" aria-hidden="true">#</a> </h1><div class="rp-not-doc rp-llms-container"><button class="rp-not-doc rp-llms-button rp-llms-copy-button"><div class="rp-llms-copy-button__icon-wrapper"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg></div><span>复制 Markdown</span></button><button class="rp-llms-button rp-llms-view-options__trigger "><svg width="1em" height="1em" viewBox="0 0 32 32" class="rp-llms-view-options__arrow "><path fill="currentColor" d="M16 22 6 12l1.4-1.4 8.6 8.6 8.6-8.6L26 12z"></path></svg></button></div><!--$--><a href="/next/zh/blog/" class="backLink-lQPNH7">← <!-- -->所有文章</a><div class="blogHeader-ZKfIZ_"><span class="date-aB5gkw">2026年1月30日</span><div class="blog-avatar-frame-G1eJ1T avatars-aaQ1Kf"><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/loongliu.png" alt="刘继龙"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">刘继龙</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">性能主管 @ Lynx</span></div></span><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/Dugyu.png" alt="杜光瑜"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">杜光瑜</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="14" viewBox="0 0 300 271" class="icon-x-XK0uad"><path fill="currentColor" d="M236 0h46L181 115l118 156h-92.6l-72.5-94.8-83 94.8h-46l107-123L-1.1 0h94.9l65.5 86.6zm-16.1 244h25.5L80.4 26H53z"></path></svg></span><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">设计工程 @ Lynx</span></div></span><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/lynx-family.png" alt="Lynx 团队"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">Lynx 团队</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="14" viewBox="0 0 300 271" class="icon-x-XK0uad"><path fill="currentColor" d="M236 0h46L181 115l118 156h-92.6l-72.5-94.8-83 94.8h-46l107-123L-1.1 0h94.9l65.5 86.6zm-16.1 244h25.5L80.4 26H53z"></path></svg></span><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">lynxjs.org</span></div></span></div><div class="rp-not-doc rp-llms-container"><button class="rp-not-doc rp-llms-button rp-llms-copy-button"><div class="rp-llms-copy-button__icon-wrapper"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg></div><span>复制 Markdown</span></button><button class="rp-llms-button rp-llms-view-options__trigger "><svg width="1em" height="1em" viewBox="0 0 32 32" class="rp-llms-view-options__arrow "><path fill="currentColor" d="M16 22 6 12l1.4-1.4 8.6 8.6 8.6-8.6L26 12z"></path></svg></button></div></div>
<p>Lynx 3.6 已经正式发布！</p>
<p>本次版本推出面向 AI 的 Lynx 以增强 AI 原生开发能力，引入 reactlynx-use 以提升开发体验，并围绕设计表达能力增强了 CSS 能力。</p>
<p>在原生侧，Lynx 3.6 进一步完善平台集成，在 HarmonyOS 上支持独立的 <code>BackgroundRuntime</code> 与异步创建 <code>TemplateBundle</code>，并在 iOS 上新增 LynxView 的 Auto Layout 支持。</p>
<p>下面我们一起来看看 Lynx 3.6 带来了哪些新变化。</p>
<h2 class="rp-toc-include" id="面向-ai-的-lynxagentsmd-与-mcp"><a href="#面向-ai-的-lynxagentsmd-与-mcp" class="rp-header-anchor rp-link" aria-hidden="true">#</a>面向 AI 的 Lynx：<code>AGENTS.md</code> 与 MCP</h2>
<p>AI 助手正在快速成为日常开发的一部分。Lynx 3.6 正式引入 <strong>Lynx for AI</strong>：我们在官网上线了 <a href="/zh/ai/index.html" class="rp-link">/ai</a> 专区，帮助 coding agent 更容易理解 Lynx、遵循最佳实践，并更高效协助你交付。</p>
<p>本次版本我们提供 <a href="/zh/ai/agentsmd.html" class="rp-link"><code>AGENTS.md</code></a> 以及两项 MCP Server，让项目更懂 Lynx（Skills 即将发布！）。</p>
<h3 class="rp-toc-include" id="lynx-docs-mcp"><a href="#lynx-docs-mcp" class="rp-header-anchor rp-link" aria-hidden="true">#</a>Lynx Docs MCP</h3>
<p><a href="/zh/ai/lynx-docs-mcp.html" class="rp-link">Lynx Docs MCP</a> 通过 MCP 将你的 coding agent（如 Gemini、Claude、Cursor 或 Copilot）接入 Lynx 文档，并结合 <a href="https://lynxjs.org/llms.txt" target="_blank" rel="noopener noreferrer" class="rp-link">llms.txt</a> 与精心设计的提示词，让 agent 能更快检索到正确资料并更好地完成开发任务。</p>
<h3 class="rp-toc-include" id="lynx-devtool-mcp"><a href="#lynx-devtool-mcp" class="rp-header-anchor rp-link" aria-hidden="true">#</a>Lynx DevTool MCP</h3>
<p><a href="/zh/ai/lynx-devtool-mcp.html" class="rp-link">Lynx DevTool MCP</a> 是一个 MCP 服务器，帮助编码代理连接设备并像 DevTools 一样检视与操控 Lynx 页面：读取元素/控制台/源码、执行点击拖拽等交互，并支持截图给多模态模型分析。</p>
<h2 class="rp-toc-include" id="reactlynx-use为-reactlynx-而生的-hooks"><a href="#reactlynx-use为-reactlynx-而生的-hooks" class="rp-header-anchor rp-link" aria-hidden="true">#</a><code>reactlynx-use</code>：为 ReactLynx 而生的 Hooks</h2>
<p><a href="https://lynx-community.github.io/reactlynx-use" target="_blank" rel="noopener noreferrer" class="rp-link"><code>reactlynx-use</code></a> 是一套面向 ReactLynx 项目的 Hooks 工具集。</p>
<p>它包含两类 Hooks：一类是开源社区长期验证、遵循“标准 React”范式的通用 Hooks（如 <code>useEffectOnce</code>、<code>useDebounce</code> 等），并受益于 <a href="https://github.com/streamich/react-use" target="_blank" rel="noopener noreferrer" class="rp-link">react-use</a> 提供的优秀基础；另一类则是面向 Lynx 能力与双线程模型的特制 Hooks，把主线程交互、运行时事件等能力以更 React 的方式暴露出来。</p>
<p>其中，面向 Lynx 的 Hooks 代表包括：</p>
<ul>
<li><strong>useVelocity</strong>：追踪主线程 Tap 事件的速度与方向。</li>
<li><strong>useTapLock</strong>：将主线程 Tap 事件限制在指定的方向与范围内。</li>
<li><strong>useMainThreadImperativeHandle</strong>：<code>useImperativeHandle</code> 的 Lynx 主线程版本。</li>
<li><strong>useEventListener</strong>：提供更灵活的事件监听能力，支持 <code>exposure</code>、<code>disexposure</code> 等。</li>
</ul>
<p>这使你可以用熟悉的 Hooks 来处理日常逻辑，并在需要时顺畅接入 Lynx 的主线程输入模型与运行时事件。</p>
<p><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/blog/reactlynx-use.jpeg" alt="reactlynx-use"/></p>
<h2 class="rp-toc-include" id="为设计工程而生的-css"><a href="#为设计工程而生的-css" class="rp-header-anchor rp-link" aria-hidden="true">#</a>为设计工程而生的 CSS</h2>
<p>从 Lynx 3.6 开始，CSS 在设计工程与设计系统中承担了更加明确的角色。作为一种表达设计意图的媒介，CSS 既描述设计决策如何在不同层级中被组合与生效，也直接参与界面中视觉结构与感知的形成。</p>
<p>本次版本围绕 <strong>CSS 变量、渐变与滤镜</strong>三个方面，增强了 CSS 的表达能力。</p>
<p>我们也为每一项能力准备了精彩的 Demo，它们都可以在 Web 端渲染并支持交互体验。</p>
<h3 class="rp-toc-include" id="内联-css-变量用于可计算样式"><a href="#内联-css-变量用于可计算样式" class="rp-header-anchor rp-link" aria-hidden="true">#</a>内联 CSS 变量：用于可计算样式</h3>
<p>自 Lynx 3.6 起，<a href="/zh/api/css/properties/css-variable.html" class="rp-link">CSS Variable</a>（CSS 变量）可以以内联方式定义和引用。这使它们能直接被应用在组件边界处（JS 参数进入 CSS 解析流程的地方），而无需依赖祖先节点的 class 切换（如 <code>theme-light</code> / <code>theme-dark</code>），也不需要命令式的 JS <code>setProperty</code> 调用。</p>
<p>当组件的样式由用户选择或在运行时计算得到时，这种能力尤为关键，因为此类连续值无法通过有限的预定义 class 集合来表达，否则就只能退回到命令式的样式更新方式。</p>
<div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables has-highlighted" style="background-color:var(--shiki-background);color:var(--shiki-foreground)" tabindex="0" data-lang="tsx"><code><span class="line"><span style="color:var(--shiki-foreground)">style</span><span style="color:var(--shiki-token-keyword)">=</span><span style="color:var(--shiki-foreground)">{{</span></span>
<span class="line"><span style="color:var(--shiki-token-string-expression)">  &#x27;--x&#x27;</span><span style="color:var(--shiki-foreground)">: </span><span style="color:var(--shiki-token-constant)">pointer</span><span style="color:var(--shiki-foreground)">.x</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-token-comment)">  // normalized parameter from JS</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">  backgroundColor</span><span style="color:var(--shiki-token-punctuation)">:</span><span style="color:var(--shiki-token-string-expression)"> &#x27;var(--dot-accent-color)&#x27;</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-token-comment)"> //defer resolution to component CSS</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">}}</span></span></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div>
<p>Inline CSS Variables（内联 CSS 变量）通过 JS 将设计参数交由 CSS 的继承与计算体系处理，使设计意图能够被动态解析与表达，并在不破坏组件作用域隔离的前提下，维持声明式的样式模型。</p>
<div class="box-LTvjqb   "><div class="container-qARFbv"><div class="content-Yzcw9o"><div class="split-pane" style="display:flex;flex-direction:row;width:100%;height:100%;min-height:0"><div class="split-pane__first" style="flex:1;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="code-wrap-jURSQJ"><div class="code-tab-container-5FhsBL"><div class="code-view-container-lgwabm "><div class="code-kbFEhm"><div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables" data-lang="tsx"><code style="padding:1rem 1.25rem"></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div><div role="separator" class="split-pane__divider" tabindex="0" style="flex:0 0 10px;cursor:col-resize;display:flex;align-items:center;justify-content:center;position:relative;z-index:1;touch-action:none" aria-orientation="vertical"><span role="img" aria-label="handle" class="semi-icon semi-icon-default semi-icon-handle" style="font-size:10px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M9 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M9 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M11 19a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M17 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></svg></span></div><div class="split-pane__second" style="flex:0 0 auto;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="preview-wrap-un0XJO"><div class="preview-wrap-content-TYo6um"><div class="preview-header-zYAZlz"><div style="width:24px;flex-shrink:0"></div><div class="semi-radioGroup semi-radioGroup-wrapper semi-radioGroup-buttonRadio" style="display:flex;flex:1;min-width:0;justify-content:center"><div style="width:100%;height:32px"></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div><div class="preview-body-YE5PSF"><div class="preview-panel-amOf1r" style="z-index:1;visibility:visible;pointer-events:auto"><div style="min-height:0px;display:flex;width:100%;height:100%;align-items:center;justify-content:center"><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/design-guide/design_force_field_10fps_go.webp" alt="" loading="eager" decoding="async" style="max-width:100%;max-height:100%;object-fit:contain"/></div></div></div></div></div></div></div></div><div class="footer-KtlqMk"><div class="semi-space semi-space-align-center semi-space-horizontal" style="max-width:100%;overflow:hidden;white-space:nowrap;row-gap:2px;column-gap:2px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><span role="img" aria-label="list" class="semi-icon semi-icon-default semi-icon-list" style="color:var(--semi-color-text-2)"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><g opacity="0.99"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9.5 3a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM8 11.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 11.5Zm0 7c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 18.5Zm-2-7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-2 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></g></svg></span></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="overflow:hidden;row-gap:2px;column-gap:2px" x-semi-prop="children"><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>design-guide</span></span><span role="img" aria-label="chevron_right_stroked" class="semi-icon semi-icon-default semi-icon-chevron_right_stroked" style="color:var(--semi-color-text-2);font-size:12px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.9 20.17a1.25 1.25 0 0 1-.07-1.77l5.71-6.15-5.7-6.15a1.25 1.25 0 0 1 1.83-1.7l6.5 7c.44.48.44 1.22 0 1.7l-6.5 7c-.47.5-1.26.54-1.77.07Z" fill="currentColor"></path></svg></span><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>src/force_field/field.tsx</span></span></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:7px;column-gap:7px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">Code</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">预览</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div></div></div></div>
<h3 class="rp-toc-include" id="嵌套-css-变量用于设计变量分层"><a href="#嵌套-css-变量用于设计变量分层" class="rp-header-anchor rp-link" aria-hidden="true">#</a>嵌套 CSS 变量：用于设计变量分层</h3>
<p>自 Lynx 3.6 起，<a href="/zh/api/css/properties/css-variable.html" class="rp-link">CSS Variable</a>（CSS 变量）可以基于其他变量进行定义，从而支持 <a href="https://m3.material.io/foundations/design-tokens/overview" target="_blank" rel="noopener noreferrer" class="rp-link">Design Token</a>（设计变量）的分层组合与逐步解析。</p>
<p>Design Token 用于承载高层级的设计决策，例如颜色、排版、间距、阴影与光影效果。通过 Nested CSS Variables（嵌套 CSS 变量），这些设计决策可以层层向下传递，落到组件级变量，并最终形成具体的视觉样式。</p>
<div class="rp-codeblock language-css"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables has-highlighted" style="background-color:var(--shiki-background);color:var(--shiki-foreground)" tabindex="0" data-lang="css"><code><span class="line"><span style="color:var(--shiki-token-comment)">/* Resolve and compose shadow tokens via nested CSS variables. */</span></span>
<span class="line"><span style="color:var(--shiki-token-function)">.card</span><span style="color:var(--shiki-foreground)"> {</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">  --blur</span><span style="color:var(--shiki-token-keyword)">:</span><span style="color:var(--shiki-token-constant)"> 12</span><span style="color:var(--shiki-token-keyword)">px</span><span style="color:var(--shiki-foreground)">;</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">  --ambient-shadow</span><span style="color:var(--shiki-token-keyword)">:</span><span style="color:var(--shiki-token-constant)"> 0 0 </span><span style="color:var(--shiki-token-function)">var</span><span style="color:var(--shiki-token-constant)">(--blur) </span><span style="color:var(--shiki-token-function)">var</span><span style="color:var(--shiki-token-constant)">(--color)</span><span style="color:var(--shiki-foreground)">;</span></span>
<span class="line"><span style="color:var(--shiki-token-constant)">  box-shadow</span><span style="color:var(--shiki-token-keyword)">:</span><span style="color:var(--shiki-token-function)"> var</span><span style="color:var(--shiki-token-constant)">(--ambient-shadow)</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-token-function)"> var</span><span style="color:var(--shiki-token-constant)">(--rim-shadow)</span><span style="color:var(--shiki-foreground)">;</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">}</span></span></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div>
<p>这一能力在处理 <code>box-shadow</code> 这类复合声明时尤为关键。一个 <code>box-shadow</code> 往往包含多个阴影层，每一层又由位移、模糊、扩散和颜色等多个相互关联的维度共同定义。
借助 Nested CSS Variables，阴影层现在可以由 Design Token 派生并进行组合，并在 CSS 中保持清晰、可追溯的结构关系。</p>
<div class="box-LTvjqb   "><div class="container-qARFbv"><div class="content-Yzcw9o"><div class="split-pane" style="display:flex;flex-direction:row;width:100%;height:100%;min-height:0"><div class="split-pane__first" style="flex:1;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="code-wrap-jURSQJ"><div class="code-tab-container-5FhsBL"><div class="code-view-container-lgwabm "><div class="code-kbFEhm"><div class="rp-codeblock language-css"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables" data-lang="css"><code style="padding:1rem 1.25rem"></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div><div role="separator" class="split-pane__divider" tabindex="0" style="flex:0 0 10px;cursor:col-resize;display:flex;align-items:center;justify-content:center;position:relative;z-index:1;touch-action:none" aria-orientation="vertical"><span role="img" aria-label="handle" class="semi-icon semi-icon-default semi-icon-handle" style="font-size:10px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M9 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M9 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M11 19a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M17 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></svg></span></div><div class="split-pane__second" style="flex:0 0 auto;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="preview-wrap-un0XJO"><div class="preview-wrap-content-TYo6um"><div class="preview-header-zYAZlz"><div style="width:24px;flex-shrink:0"></div><div class="semi-radioGroup semi-radioGroup-wrapper semi-radioGroup-buttonRadio" style="display:flex;flex:1;min-width:0;justify-content:center"><div style="width:100%;height:32px"></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div><div class="preview-body-YE5PSF"><div class="preview-panel-amOf1r" style="z-index:1;visibility:visible;pointer-events:auto"><div style="min-height:0px;display:flex;width:100%;height:100%;align-items:center;justify-content:center"><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/design-guide/design_soft_glow.jpg" alt="" loading="eager" decoding="async" style="max-width:100%;max-height:100%;object-fit:contain"/></div></div></div></div></div></div></div></div><div class="footer-KtlqMk"><div class="semi-space semi-space-align-center semi-space-horizontal" style="max-width:100%;overflow:hidden;white-space:nowrap;row-gap:2px;column-gap:2px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><span role="img" aria-label="list" class="semi-icon semi-icon-default semi-icon-list" style="color:var(--semi-color-text-2)"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><g opacity="0.99"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9.5 3a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM8 11.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 11.5Zm0 7c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 18.5Zm-2-7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-2 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></g></svg></span></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="overflow:hidden;row-gap:2px;column-gap:2px" x-semi-prop="children"><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>design-guide</span></span><span role="img" aria-label="chevron_right_stroked" class="semi-icon semi-icon-default semi-icon-chevron_right_stroked" style="color:var(--semi-color-text-2);font-size:12px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.9 20.17a1.25 1.25 0 0 1-.07-1.77l5.71-6.15-5.7-6.15a1.25 1.25 0 0 1 1.83-1.7l6.5 7c.44.48.44 1.22 0 1.7l-6.5 7c-.47.5-1.26.54-1.77.07Z" fill="currentColor"></path></svg></span><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>src/soft_glow/index.css</span></span></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:7px;column-gap:7px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">Code</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">预览</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div></div></div></div>
<h3 class="rp-toc-include" id="圆锥渐变作为设计原语"><a href="#圆锥渐变作为设计原语" class="rp-header-anchor rp-link" aria-hidden="true">#</a>圆锥渐变：作为设计原语</h3>
<p>Lynx 3.6 新增支持 <a href="/zh/api/css/data-type/gradient.html" class="rp-link"><code>conic-gradient()</code></a> 这一 CSS 图像函数。它可以用于支持 <code>&lt;image&gt;</code> 类型值的 CSS 属性中，例如 <code>background-image</code> 和 <code>mask-image</code>，用于在 CSS 中直接生成连续的角度型颜色过渡。</p>
<div class="rp-codeblock language-css"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables has-highlighted" style="background-color:var(--shiki-background);color:var(--shiki-foreground)" tabindex="0" data-lang="css"><code><span class="line"><span style="color:var(--shiki-token-function)">.bg</span><span style="color:var(--shiki-foreground)"> {</span></span>
<span class="line"><span style="color:var(--shiki-token-constant)">  background-image</span><span style="color:var(--shiki-token-keyword)">:</span><span style="color:var(--shiki-token-function)"> conic-gradient</span><span style="color:var(--shiki-token-constant)">(</span><span style="color:var(--shiki-token-keyword)">from</span><span style="color:var(--shiki-token-constant)"> 30</span><span style="color:var(--shiki-token-keyword)">deg</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-token-constant)"> #ff7385</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-token-constant)"> #fe69a1</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-token-constant)"> #00d0f1)</span><span style="color:var(--shiki-foreground)">;</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">}</span></span></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div>
<p>圆锥渐变（Conic Gradient）非常适合用于表达角度或周期性结构，例如颜色环、色相选择器等。在实际场景里，它更像一种轻量的设计原语，可以被组合进交互控件与可视化工具中。</p>
<div class="box-LTvjqb   "><div class="container-qARFbv"><div class="content-Yzcw9o"><div class="split-pane" style="display:flex;flex-direction:row;width:100%;height:100%;min-height:0"><div class="split-pane__first" style="flex:1;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="code-wrap-jURSQJ"><div class="code-tab-container-5FhsBL"><div class="code-view-container-lgwabm "><div class="code-kbFEhm"><div class="rp-codeblock language-css"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables" data-lang="css"><code style="padding:1rem 1.25rem"></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div><div role="separator" class="split-pane__divider" tabindex="0" style="flex:0 0 10px;cursor:col-resize;display:flex;align-items:center;justify-content:center;position:relative;z-index:1;touch-action:none" aria-orientation="vertical"><span role="img" aria-label="handle" class="semi-icon semi-icon-default semi-icon-handle" style="font-size:10px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M9 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M9 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M11 19a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M17 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></svg></span></div><div class="split-pane__second" style="flex:0 0 auto;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="preview-wrap-un0XJO"><div class="preview-wrap-content-TYo6um"><div class="preview-header-zYAZlz"><div style="width:24px;flex-shrink:0"></div><div class="semi-radioGroup semi-radioGroup-wrapper semi-radioGroup-buttonRadio" style="display:flex;flex:1;min-width:0;justify-content:center"><div style="width:100%;height:32px"></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div><div class="preview-body-YE5PSF"><div class="preview-panel-amOf1r" style="z-index:1;visibility:visible;pointer-events:auto"><div style="min-height:0px;display:flex;width:100%;height:100%;align-items:center;justify-content:center"><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/design-guide/design_color_wheels_go.jpg" alt="" loading="eager" decoding="async" style="max-width:100%;max-height:100%;object-fit:contain"/></div></div></div></div></div></div></div></div><div class="footer-KtlqMk"><div class="semi-space semi-space-align-center semi-space-horizontal" style="max-width:100%;overflow:hidden;white-space:nowrap;row-gap:2px;column-gap:2px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><span role="img" aria-label="list" class="semi-icon semi-icon-default semi-icon-list" style="color:var(--semi-color-text-2)"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><g opacity="0.99"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9.5 3a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM8 11.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 11.5Zm0 7c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 18.5Zm-2-7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-2 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></g></svg></span></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="overflow:hidden;row-gap:2px;column-gap:2px" x-semi-prop="children"><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>design-guide</span></span><span role="img" aria-label="chevron_right_stroked" class="semi-icon semi-icon-default semi-icon-chevron_right_stroked" style="color:var(--semi-color-text-2);font-size:12px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.9 20.17a1.25 1.25 0 0 1-.07-1.77l5.71-6.15-5.7-6.15a1.25 1.25 0 0 1 1.83-1.7l6.5 7c.44.48.44 1.22 0 1.7l-6.5 7c-.47.5-1.26.54-1.77.07Z" fill="currentColor"></path></svg></span><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>src/color_wheels/index.css</span></span></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:7px;column-gap:7px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">Code</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">预览</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div></div></div></div>
<h3 class="rp-toc-include" id="css-滤镜用于形态生成"><a href="#css-滤镜用于形态生成" class="rp-header-anchor rp-link" aria-hidden="true">#</a>CSS 滤镜：用于形态生成</h3>
<p>Lynx 3.6 扩展了 CSS Filter（CSS 滤镜）能力，新增支持 <code>brightness</code>、<code>contrast</code> 与 <code>saturate</code>。</p>
<p>随着这些能力的引入，CSS <a href="/zh/api/css/properties/filter.html" class="rp-link"><code>filter</code></a> 属性成为一种可组合的形态生成工具。将新增支持的 <code>contrast</code> 滤镜与既有的 <code>blur</code> 能力配合使用，可以放大重叠区域的视觉响应，使原本柔和、分散的形状逐渐融合为连贯的整体。
诸如形状融合、感知分组与流动边界等视觉结构，可以直接通过 CSS 构建，而无需依赖位图资源或额外的自定义渲染管线。</p>
<div class="box-LTvjqb   "><div class="container-qARFbv"><div class="content-Yzcw9o"><div class="split-pane" style="display:flex;flex-direction:row;width:100%;height:100%;min-height:0"><div class="split-pane__first" style="flex:1;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="code-wrap-jURSQJ"><div class="code-tab-container-5FhsBL"><div class="code-view-container-lgwabm "><div class="code-kbFEhm"><div class="rp-codeblock language-css"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables" data-lang="css"><code style="padding:1rem 1.25rem"></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div><div role="separator" class="split-pane__divider" tabindex="0" style="flex:0 0 10px;cursor:col-resize;display:flex;align-items:center;justify-content:center;position:relative;z-index:1;touch-action:none" aria-orientation="vertical"><span role="img" aria-label="handle" class="semi-icon semi-icon-default semi-icon-handle" style="font-size:10px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M9 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M9 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M11 19a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M17 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></svg></span></div><div class="split-pane__second" style="flex:0 0 auto;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="preview-wrap-un0XJO"><div class="preview-wrap-content-TYo6um"><div class="preview-header-zYAZlz"><div style="width:24px;flex-shrink:0"></div><div class="semi-radioGroup semi-radioGroup-wrapper semi-radioGroup-buttonRadio" style="display:flex;flex:1;min-width:0;justify-content:center"><div style="width:100%;height:32px"></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div><div class="preview-body-YE5PSF"><div class="preview-panel-amOf1r" style="z-index:1;visibility:visible;pointer-events:auto"><div style="min-height:0px;display:flex;width:100%;height:100%;align-items:center;justify-content:center"><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/design-guide/design_gooey_effect_20fps.webp" alt="" loading="eager" decoding="async" style="max-width:100%;max-height:100%;object-fit:contain"/></div></div></div></div></div></div></div></div><div class="footer-KtlqMk"><div class="semi-space semi-space-align-center semi-space-horizontal" style="max-width:100%;overflow:hidden;white-space:nowrap;row-gap:2px;column-gap:2px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><span role="img" aria-label="list" class="semi-icon semi-icon-default semi-icon-list" style="color:var(--semi-color-text-2)"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><g opacity="0.99"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9.5 3a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM8 11.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 11.5Zm0 7c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 18.5Zm-2-7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-2 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></g></svg></span></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="overflow:hidden;row-gap:2px;column-gap:2px" x-semi-prop="children"><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>design-guide</span></span><span role="img" aria-label="chevron_right_stroked" class="semi-icon semi-icon-default semi-icon-chevron_right_stroked" style="color:var(--semi-color-text-2);font-size:12px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.9 20.17a1.25 1.25 0 0 1-.07-1.77l5.71-6.15-5.7-6.15a1.25 1.25 0 0 1 1.83-1.7l6.5 7c.44.48.44 1.22 0 1.7l-6.5 7c-.47.5-1.26.54-1.77.07Z" fill="currentColor"></path></svg></span><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>src/gooey_effect/index.css</span></span></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:7px;column-gap:7px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">Code</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">预览</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div></div></div></div>
<h2 class="rp-toc-include" id="native-apis"><a href="#native-apis" class="rp-header-anchor rp-link" aria-hidden="true">#</a>Native APIs</h2>
<h3 class="rp-toc-include" id="harmonyos-支持独立的-backgroundruntime"><a href="#harmonyos-支持独立的-backgroundruntime" class="rp-header-anchor rp-link" aria-hidden="true">#</a>HarmonyOS 支持独立的 BackgroundRuntime</h3>
<p>HarmonyOS 新增支持独立的 <a href="/zh/api/lynx-native-api/lynx-background-runtime.html" class="rp-link">BackgroundRuntime</a>，与 Android 和 iOS 的现有能力进一步对齐。</p>
<p>借助独立的 BackgroundRuntime，开发者可以在不依赖渲染的情况下独立运行后台 JS 任务，或提前创建后台运行时，以降低 LynxView 初始化阶段的延迟。</p>
<h3 class="rp-toc-include" id="harmonyos-平台新增异步创建-templatebundle-的方法"><a href="#harmonyos-平台新增异步创建-templatebundle-的方法" class="rp-header-anchor rp-link" aria-hidden="true">#</a>HarmonyOS 平台新增异步创建 TemplateBundle 的方法</h3>
<p>在 Android 和 iOS 平台上，<a href="/zh/api/lynx-native-api/template-bundle/from-template.html" class="rp-link"><code>TemplateBundle.fromTemplate</code></a> 可以在任意线程执行；而在 HarmonyOS 上，ArkTS 逻辑必须运行在应用主线程。</p>
<p>为减少主线程 I/O 阻塞，Lynx 3.6 在 HarmonyOS 上引入了异步创建 <code>TemplateBundle</code> 的 API：</p>
<ul>
<li><a href="/zh/api/lynx-native-api/template-bundle/from-template-async.html" class="rp-link"><code>TemplateBundle.fromTemplateAsync</code></a></li>
<li><a href="/zh/api/lynx-native-api/template-bundle/from-template-async-with-option.html" class="rp-link"><code>TemplateBundle.fromTemplateAsyncWithOption</code></a></li>
</ul>
<h3 class="rp-toc-include" id="ios-平台-lynxview-新增-enableautolayout-能力"><a href="#ios-平台-lynxview-新增-enableautolayout-能力" class="rp-header-anchor rp-link" aria-hidden="true">#</a>iOS 平台 LynxView 新增 enableAutoLayout 能力</h3>
<p>iOS 平台新增方法 <a href="/zh/api/lynx-native-api/lynx-view/enable-auto-layout.html" class="rp-link"><code>[LynxView enableAutoLayout]</code></a>。</p>
<p>开启后，LynxView 可以直接从客户端的 Auto Layout 约束中解析排版参数，无需再手动设置 LynxView 的布局配置。</p>
<h2 class="rp-toc-include" id="升级指南"><a href="#升级指南" class="rp-header-anchor rp-link" aria-hidden="true">#</a>升级指南</h2>
<p>参照官网<a href="https://lynxjs.org/3.6/zh/guide/start/integrate-with-existing-apps.html" target="_blank" rel="noopener noreferrer" class="rp-link">接入 Lynx 到现有应用</a>，更新 Lynx 依赖版本，即可完成 Lynx 3.6 版本升级。</p><!--/$-->]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lynx 3.5: 主线程脚本，React 编译器，HarmonyOS 能力对齐]]></title>
            <link>https://lynxjs.org/zh/blog/lynx-3-5</link>
            <guid isPermaLink="false">/zh/blog/lynx-3-5</guid>
            <pubDate>Mon, 10 Nov 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[Lynx 3.5 已经正式发布! 延续稳定的双月发布节奏，Lynx 3.5 带来了多项重要更新：React 编译器的实验性支持；主线程脚本支持了 `stopPropagation` 事件冒泡拦截、首帧即可交互、跨线程通信等一系列增强；进一步对齐了 HarmonyOS 平台能力，并新增了 `<pointer-events>` CSS 属性等功能。]]></description>
            <content:encoded><![CDATA[<h1 class="rp-toc-include" id="lynx-35-主线程脚本react-编译器harmonyos-能力对齐"><span>Lynx 3.5: 主线程脚本，React 编译器，HarmonyOS 能力对齐</span><a href="#lynx-35-主线程脚本react-编译器harmonyos-能力对齐" class="rp-header-anchor rp-link" aria-hidden="true">#</a> </h1><div class="rp-not-doc rp-llms-container"><button class="rp-not-doc rp-llms-button rp-llms-copy-button"><div class="rp-llms-copy-button__icon-wrapper"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg></div><span>复制 Markdown</span></button><button class="rp-llms-button rp-llms-view-options__trigger "><svg width="1em" height="1em" viewBox="0 0 32 32" class="rp-llms-view-options__arrow "><path fill="currentColor" d="M16 22 6 12l1.4-1.4 8.6 8.6 8.6-8.6L26 12z"></path></svg></button></div><!--$--><a href="/next/zh/blog/" class="backLink-lQPNH7">← <!-- -->所有文章</a><div class="blogHeader-ZKfIZ_"><span class="date-aB5gkw">2025年11月10日</span><div class="blog-avatar-frame-G1eJ1T avatars-aaQ1Kf"><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/loongliu.png" alt="刘继龙"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">刘继龙</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">性能主管 @ Lynx</span></div></span><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/huxpro.png" alt="黄玄"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">黄玄</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="14" viewBox="0 0 300 271" class="icon-x-XK0uad"><path fill="currentColor" d="M236 0h46L181 115l118 156h-92.6l-72.5-94.8-83 94.8h-46l107-123L-1.1 0h94.9l65.5 86.6zm-16.1 244h25.5L80.4 26H53z"></path></svg></span><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">架构师 @ Lynx</span></div></span><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/lynx-family.png" alt="Lynx 团队"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">Lynx 团队</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="14" viewBox="0 0 300 271" class="icon-x-XK0uad"><path fill="currentColor" d="M236 0h46L181 115l118 156h-92.6l-72.5-94.8-83 94.8h-46l107-123L-1.1 0h94.9l65.5 86.6zm-16.1 244h25.5L80.4 26H53z"></path></svg></span><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">lynxjs.org</span></div></span></div><div class="rp-not-doc rp-llms-container"><button class="rp-not-doc rp-llms-button rp-llms-copy-button"><div class="rp-llms-copy-button__icon-wrapper"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg></div><span>复制 Markdown</span></button><button class="rp-llms-button rp-llms-view-options__trigger "><svg width="1em" height="1em" viewBox="0 0 32 32" class="rp-llms-view-options__arrow "><path fill="currentColor" d="M16 22 6 12l1.4-1.4 8.6 8.6 8.6-8.6L26 12z"></path></svg></button></div></div>
<p>Lynx 3.5 已经正式发布!</p>
<p>延续稳定的双月发布节奏，Lynx 3.5 带来了多项重要更新：React 编译器的实验性支持；主线程脚本支持了 <code>stopPropagation</code> 事件冒泡拦截、首帧即可交互、跨线程通信等一系列增强；进一步对齐了 HarmonyOS 平台能力，并新增了 <code>&lt;pointer-events&gt;</code> CSS 属性等功能。</p>
<p>让我们一起来看看有哪些新特性！</p>
<h2 class="rp-toc-include" id="react-编译器"><a href="#react-编译器" class="rp-header-anchor rp-link" aria-hidden="true">#</a>React 编译器 <span class="rp-badge rp-badge--warning"><svg width="1em" height="1em" stroke-linejoin="round" data-testid="geist-icon" style="color:currentcolor" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M9 7.674V2.5H7v5.174l-.503.447L4.383 10h7.234L9.503 8.121zM5.5 2.5H4V1h8v1.5h-1.5V7l3.573 3.177A2.76 2.76 0 0 1 12.24 15H3.76a2.76 2.76 0 0 1-1.834-4.823L5.5 7zm-3 9.74c0-.268.085-.527.24-.74h10.52a1.26 1.26 0 0 1-1.02 2H3.76a1.26 1.26 0 0 1-1.26-1.26" clip-rule="evenodd"></path></svg><span>experimental</span></span></h2>
<p><a href="https://react.dev/learn/react-compiler" target="_blank" rel="noopener noreferrer" class="rp-link">React Compiler</a> 可以在编译期对组件进行优化，从而无需手动使用 <code>useMemo</code>、<code>useCallback</code> 和 <code>memo</code>。你现在可以在 ReactLynx 中使用 React Compiler 来优化你的应用性能。</p>
<p><a href="/zh/react/react-compiler.html" class="rp-link">查看如何在 ReactLynx 中开启 React Compiler</a>。</p>
<h2 class="rp-toc-include" id="主线程脚本"><a href="#主线程脚本" class="rp-header-anchor rp-link" aria-hidden="true">#</a>主线程脚本</h2>
<h3 id="支持用-stoppropagation-阻止事件冒泡"><p>支持用 <code>stopPropagation</code> 阻止事件冒泡 <span class="rp-badge rp-badge--tip">Web 友好</span></p></h3>
<p>当一个事件被触发后，它会沿着响应链进行<a href="https://lynxjs.org/3.5/zh/guide/interaction/event-handling/event-propagation" target="_blank" rel="noopener noreferrer" class="rp-link">传播</a>。此前，虽然 Lynx 已经支持使用 <a href="https://lynxjs.org/3.5/zh/guide/interaction/event-handling/event-propagation#%E4%BA%8B%E4%BB%B6%E6%8B%A6%E6%88%AA" target="_blank" rel="noopener noreferrer" class="rp-link"><code>catch</code> 类型的事件处理器属性静态拦截事件冒泡</a>，但这种方式仍缺乏 Web 一样的表达力。得益于主线程编程能力，Lynx 3.5 在主线程脚本中支持了和 Web 一致的 <a href="https://lynxjs.org/3.5/zh/api/lynx-api/event/event.html#stoppropagation" target="_blank" rel="noopener noreferrer" class="rp-link"><code>event.stopPropagation()</code></a>，实现运行时的事件冒泡拦截。</p>
<div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables has-highlighted" style="background-color:var(--shiki-background);color:var(--shiki-foreground)" tabindex="0" data-lang="tsx"><code><span class="line"><span style="color:var(--shiki-token-keyword)">function</span><span style="color:var(--shiki-token-function)"> handleInnerTap</span><span style="color:var(--shiki-foreground)">(e</span><span style="color:var(--shiki-token-keyword)">:</span><span style="color:var(--shiki-token-function)"> MainThread</span><span style="color:var(--shiki-foreground)">.</span><span style="color:var(--shiki-token-function)">TouchEvent</span><span style="color:var(--shiki-foreground)">) {</span></span>
<span class="line"><span style="color:var(--shiki-token-string-expression)">  &#x27;main thread&#x27;</span><span style="color:var(--shiki-foreground)">;</span></span>
<span class="line highlighted"><span style="color:var(--shiki-token-constant)">  e</span><span style="color:var(--shiki-token-function)">.stopPropagation</span><span style="color:var(--shiki-foreground)">(); </span><span style="color:var(--shiki-token-comment)">// ✋ stop event bubbling</span></span>
<span class="line"><span style="color:var(--shiki-token-function)">  flash</span><span style="color:var(--shiki-foreground)">(</span><span style="color:var(--shiki-token-string-expression)">&#x27;inner&#x27;</span><span style="color:var(--shiki-foreground)">);</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">}</span></span></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div>
<div class="box-LTvjqb   "><div class="container-qARFbv"><div class="content-Yzcw9o"><div class="split-pane" style="display:flex;flex-direction:row;width:100%;height:100%;min-height:0"><div class="split-pane__first" style="flex:1;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="code-wrap-jURSQJ"><div class="code-tab-container-5FhsBL"><div class="code-view-container-lgwabm "><div class="code-kbFEhm"><div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables" data-lang="tsx"><code style="padding:1rem 1.25rem"></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div><div role="separator" class="split-pane__divider" tabindex="0" style="flex:0 0 10px;cursor:col-resize;display:flex;align-items:center;justify-content:center;position:relative;z-index:1;touch-action:none" aria-orientation="vertical"><span role="img" aria-label="handle" class="semi-icon semi-icon-default semi-icon-handle" style="font-size:10px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M9 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M9 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M11 19a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M17 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></svg></span></div><div class="split-pane__second" style="flex:0 0 auto;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="preview-wrap-un0XJO"><div class="preview-wrap-content-TYo6um"><div class="preview-header-zYAZlz"><div style="width:24px;flex-shrink:0"></div><div class="semi-radioGroup semi-radioGroup-wrapper semi-radioGroup-buttonRadio" style="display:flex;flex:1;min-width:0;justify-content:center"><div style="width:100%;height:32px"></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div><div class="preview-body-YE5PSF"><div class="preview-panel-amOf1r" style="z-index:1;visibility:visible;pointer-events:auto"><div style="min-height:0px;display:flex;width:100%;height:100%;align-items:center;justify-content:center"><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/plugin/static/event_stop.webp" alt="" loading="eager" decoding="async" style="max-width:100%;max-height:100%;object-fit:contain"/></div></div></div></div></div></div></div></div><div class="footer-KtlqMk"><div class="semi-space semi-space-align-center semi-space-horizontal" style="max-width:100%;overflow:hidden;white-space:nowrap;row-gap:2px;column-gap:2px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><span role="img" aria-label="list" class="semi-icon semi-icon-default semi-icon-list" style="color:var(--semi-color-text-2)"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><g opacity="0.99"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9.5 3a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM8 11.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 11.5Zm0 7c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 18.5Zm-2-7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-2 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></g></svg></span></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="overflow:hidden;row-gap:2px;column-gap:2px" x-semi-prop="children"><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>event</span></span><span role="img" aria-label="chevron_right_stroked" class="semi-icon semi-icon-default semi-icon-chevron_right_stroked" style="color:var(--semi-color-text-2);font-size:12px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.9 20.17a1.25 1.25 0 0 1-.07-1.77l5.71-6.15-5.7-6.15a1.25 1.25 0 0 1 1.83-1.7l6.5 7c.44.48.44 1.22 0 1.7l-6.5 7c-.47.5-1.26.54-1.77.07Z" fill="currentColor"></path></svg></span><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>src/event_stop_propagation/index.tsx</span></span></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:7px;column-gap:7px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">Code</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">预览</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div></div></div></div>
<h3 class="rp-toc-include" id="首帧即可进行主线程交互"><a href="#首帧即可进行主线程交互" class="rp-header-anchor rp-link" aria-hidden="true">#</a><a href="https://lynxjs.org/3.5/zh/guide/interaction/ifr.html" target="_blank" rel="noopener noreferrer" class="rp-link">首帧</a>即可进行主线程交互</h3>
<p>此前，主线程事件需要等待后台线程完成<a href="https://lynxjs.org/3.5/zh/react/lifecycle.html" target="_blank" rel="noopener noreferrer" class="rp-link">“激活”（Hydration）</a>后才能响应，导致页面在首帧可见后，仍存在一段不可交互的延迟，类似<a href="https://web.dev/articles/rendering-on-the-web#rehydration" target="_blank" rel="noopener noreferrer" class="rp-link">服务端渲染中的常见的恐怖谷效应</a>。</p>
<p>为了消除这段延迟，我们优化了激活流程，使得主线程事件可以在首帧渲染后立刻响应，并在后台线程激活后正确接管主线程中的状态并重放 <a href="https://lynxjs.org/3.5/zh/api/react/Function.runOnBackground.html" target="_blank" rel="noopener noreferrer" class="rp-link"><code>runOnBackground</code></a>，在保证线程间的正确同步的同时，实现首帧可见即可交互。</p>
<div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables has-highlighted" style="background-color:var(--shiki-background);color:var(--shiki-foreground)" tabindex="0" data-lang="tsx"><code><span class="line"><span style="color:var(--shiki-token-keyword)">function</span><span style="color:var(--shiki-token-function)"> App</span><span style="color:var(--shiki-foreground)">() {</span></span>
<span class="line"><span style="color:var(--shiki-token-keyword)">  const</span><span style="color:var(--shiki-token-function)"> gotoUser</span><span style="color:var(--shiki-token-keyword)"> =</span><span style="color:var(--shiki-foreground)"> () </span><span style="color:var(--shiki-token-keyword)">=&gt;</span><span style="color:var(--shiki-foreground)"> {</span></span>
<span class="line highlighted"><span style="color:var(--shiki-token-string-expression)">    &#x27;main thread&#x27;</span><span style="color:var(--shiki-foreground)">;</span></span>
<span class="line"><span style="color:var(--shiki-token-comment)">    // go to second page</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">  };</span></span>
<span class="line highlighted"><span style="color:var(--shiki-token-keyword)">  return</span><span style="color:var(--shiki-foreground)"> (</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">    &lt;</span><span style="color:var(--shiki-token-string-expression)">view</span><span style="color:var(--shiki-token-function)"> main-thread</span><span style="color:var(--shiki-token-punctuation)">:</span><span style="color:var(--shiki-token-function)">bindtap</span><span style="color:var(--shiki-token-keyword)">=</span><span style="color:var(--shiki-foreground)">{gotoUser}&gt;</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">      &lt;</span><span style="color:var(--shiki-token-string-expression)">text</span><span style="color:var(--shiki-foreground)">&gt;goto user&lt;/</span><span style="color:var(--shiki-token-string-expression)">text</span><span style="color:var(--shiki-foreground)">&gt;</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">    &lt;/</span><span style="color:var(--shiki-token-string-expression)">view</span><span style="color:var(--shiki-foreground)">&gt;</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">  );</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">}</span></span></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div>
<h3 class="rp-toc-include" id="跨线程函数调用支持返回数据"><a href="#跨线程函数调用支持返回数据" class="rp-header-anchor rp-link" aria-hidden="true">#</a>跨线程函数调用支持返回数据</h3>
<p>Lynx 提供了 <a href="https://lynxjs.org/3.5/zh/api/react/Function.runOnMainThread#function-runonmainthread" target="_blank" rel="noopener noreferrer" class="rp-link"><code>runOnMainThread</code></a> 和 <a href="https://lynxjs.org/3.5/zh/api/react/Function.runOnBackground.html" target="_blank" rel="noopener noreferrer" class="rp-link"><code>runOnBackground</code></a> 两个 API 用于跨线程函数调用。在 Lynx 3.5 中，这两个 API 现在支持异步返回值，让跨线程通信更加灵活和直观。</p>
<div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables has-highlighted" style="background-color:var(--shiki-background);color:var(--shiki-foreground)" tabindex="0" data-lang="tsx"><code><span class="line"><span style="color:var(--shiki-token-keyword)">import</span><span style="color:var(--shiki-foreground)"> { runOnMainThread</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-foreground)"> useMainThreadRef } </span><span style="color:var(--shiki-token-keyword)">from</span><span style="color:var(--shiki-token-string-expression)"> &#x27;@lynx-js/react&#x27;</span><span style="color:var(--shiki-foreground)">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:var(--shiki-token-keyword)">function</span><span style="color:var(--shiki-token-function)"> App</span><span style="color:var(--shiki-foreground)">() {</span></span>
<span class="line"><span style="color:var(--shiki-token-keyword)">  const</span><span style="color:var(--shiki-token-constant)"> countRef</span><span style="color:var(--shiki-token-keyword)"> =</span><span style="color:var(--shiki-token-function)"> useMainThreadRef</span><span style="color:var(--shiki-foreground)">(</span><span style="color:var(--shiki-token-constant)">0</span><span style="color:var(--shiki-foreground)">);</span></span>
<span class="line"></span>
<span class="line"><span style="color:var(--shiki-token-keyword)">  const</span><span style="color:var(--shiki-token-function)"> addCount</span><span style="color:var(--shiki-token-keyword)"> =</span><span style="color:var(--shiki-foreground)"> (value) </span><span style="color:var(--shiki-token-keyword)">=&gt;</span><span style="color:var(--shiki-foreground)"> {</span></span>
<span class="line"><span style="color:var(--shiki-token-string-expression)">    &#x27;main thread&#x27;</span><span style="color:var(--shiki-foreground)">;</span></span>
<span class="line"><span style="color:var(--shiki-token-constant)">    countRef</span><span style="color:var(--shiki-foreground)">.current </span><span style="color:var(--shiki-token-keyword)">+=</span><span style="color:var(--shiki-foreground)"> value;</span></span>
<span class="line"><span style="color:var(--shiki-token-keyword)">    return</span><span style="color:var(--shiki-token-constant)"> countRef</span><span style="color:var(--shiki-foreground)">.current;</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">  };</span></span>
<span class="line"></span>
<span class="line"><span style="color:var(--shiki-token-keyword)">  const</span><span style="color:var(--shiki-token-function)"> increaseMainThreadCount</span><span style="color:var(--shiki-token-keyword)"> =</span><span style="color:var(--shiki-token-keyword)"> async</span><span style="color:var(--shiki-foreground)"> () </span><span style="color:var(--shiki-token-keyword)">=&gt;</span><span style="color:var(--shiki-foreground)"> {</span></span>
<span class="line highlighted"><span style="color:var(--shiki-token-comment)">    // await for return value from main thread</span></span>
<span class="line highlighted"><span style="color:var(--shiki-token-keyword)">    const</span><span style="color:var(--shiki-token-constant)"> result</span><span style="color:var(--shiki-token-keyword)"> =</span><span style="color:var(--shiki-token-keyword)"> await</span><span style="color:var(--shiki-token-function)"> runOnMainThread</span><span style="color:var(--shiki-foreground)">(addCount)(</span><span style="color:var(--shiki-token-constant)">1</span><span style="color:var(--shiki-foreground)">);</span></span>
<span class="line"><span style="color:var(--shiki-token-constant)">    console</span><span style="color:var(--shiki-token-function)">.log</span><span style="color:var(--shiki-foreground)">(result);</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">  };</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">}</span></span></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div>
<h2 class="rp-toc-include" id="list-元件内置更新动画"><a href="#list-元件内置更新动画" class="rp-header-anchor rp-link" aria-hidden="true">#</a><code>&lt;list&gt;</code> 元件内置更新动画</h2>
<p>为了提供更生动、自然的列表交互体验，<code>&lt;list&gt;</code> 元件现已内置默认的<a href="https://lynxjs.org/3.5/zh/api/elements/built-in/list.html#update-animation" target="_blank" rel="noopener noreferrer" class="rp-link">更新动画</a>。当列表项被插入、删除或更新时，将自动触发平滑的过渡效果，无需开发者编写额外代码。</p>
<div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables has-highlighted" style="background-color:var(--shiki-background);color:var(--shiki-foreground)" tabindex="0" data-lang="tsx"><code><span class="line"><span style="color:var(--shiki-foreground)">&lt;</span><span style="color:var(--shiki-token-string-expression)">list</span><span style="color:var(--shiki-token-function)"> update-animation</span><span style="color:var(--shiki-token-keyword)">=</span><span style="color:var(--shiki-token-string-expression)">&quot;default&quot;</span><span style="color:var(--shiki-foreground)">&gt;&lt;/</span><span style="color:var(--shiki-token-string-expression)">list</span><span style="color:var(--shiki-foreground)">&gt;</span></span></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div>
<table border="0"><tr><td><p><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/plugin/static/5_delete.gif" alt=""/></p></td><td><p><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/plugin/static/5_update.gif" alt=""/></p></td><td><p><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/plugin/static/5_insert.gif" alt=""/></p></td></tr><tr><td>删除</td><td>更新</td><td>插入</td></tr></table>
<h2 class="rp-toc-include" id="css-属性-pointer-events"><a href="#css-属性-pointer-events" class="rp-header-anchor rp-link" aria-hidden="true">#</a>CSS 属性 <code>pointer-events</code> <span class="rp-badge rp-badge--tip">Web 友好</span></h2>
<p>Lynx 3.5 版本新增 CSS 属性 <a href="https://lynxjs.org/3.5/zh/api/css/properties/pointer-events.html" target="_blank" rel="noopener noreferrer" class="rp-link"><code>pointer-events</code></a> 来指定元件是否能够响应触摸事件。</p>
<div class="rp-codeblock language-css"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables has-highlighted" style="background-color:var(--shiki-background);color:var(--shiki-foreground)" tabindex="0" data-lang="css"><code><span class="line"><span style="color:var(--shiki-token-string-expression)">pointer-events</span><span style="color:var(--shiki-foreground)">: auto;  // 默认值，此时，节点可以响应触摸事件。</span></span>
<span class="line"><span style="color:var(--shiki-token-string-expression)">pointer-events</span><span style="color:var(--shiki-foreground)">: none;  // 节点不能响应触摸事件</span></span></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div>
<div class="box-LTvjqb   "><div class="container-qARFbv"><div class="content-Yzcw9o"><div class="split-pane" style="display:flex;flex-direction:row;width:100%;height:100%;min-height:0"><div class="split-pane__first" style="flex:1;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="code-wrap-jURSQJ"><div class="code-tab-container-5FhsBL"><div class="code-view-container-lgwabm "><div class="code-kbFEhm"><div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables" data-lang="tsx"><code style="padding:1rem 1.25rem"></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div><div role="separator" class="split-pane__divider" tabindex="0" style="flex:0 0 10px;cursor:col-resize;display:flex;align-items:center;justify-content:center;position:relative;z-index:1;touch-action:none" aria-orientation="vertical"><span role="img" aria-label="handle" class="semi-icon semi-icon-default semi-icon-handle" style="font-size:10px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M9 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M9 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M11 19a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M17 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></svg></span></div><div class="split-pane__second" style="flex:0 0 auto;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="preview-wrap-un0XJO"><div class="preview-wrap-content-TYo6um"><div class="preview-header-zYAZlz"><div style="width:24px;flex-shrink:0"></div><div class="semi-radioGroup semi-radioGroup-wrapper semi-radioGroup-buttonRadio" style="display:flex;flex:1;min-width:0;justify-content:center"><div style="width:100%;height:32px"></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div><div class="preview-body-YE5PSF"><div class="preview-panel-amOf1r" style="z-index:1;visibility:visible;pointer-events:auto"><div style="min-height:0px;display:flex;width:100%;height:100%;align-items:center;justify-content:center"><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/plugin/static/pointer-events.gif" alt="" loading="eager" decoding="async" style="max-width:100%;max-height:100%;object-fit:contain"/></div></div></div></div></div></div></div></div><div class="footer-KtlqMk"><div class="semi-space semi-space-align-center semi-space-horizontal" style="max-width:100%;overflow:hidden;white-space:nowrap;row-gap:2px;column-gap:2px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><span role="img" aria-label="list" class="semi-icon semi-icon-default semi-icon-list" style="color:var(--semi-color-text-2)"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><g opacity="0.99"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9.5 3a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM8 11.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 11.5Zm0 7c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 18.5Zm-2-7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-2 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></g></svg></span></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="overflow:hidden;row-gap:2px;column-gap:2px" x-semi-prop="children"><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>css-api</span></span><span role="img" aria-label="chevron_right_stroked" class="semi-icon semi-icon-default semi-icon-chevron_right_stroked" style="color:var(--semi-color-text-2);font-size:12px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.9 20.17a1.25 1.25 0 0 1-.07-1.77l5.71-6.15-5.7-6.15a1.25 1.25 0 0 1 1.83-1.7l6.5 7c.44.48.44 1.22 0 1.7l-6.5 7c-.47.5-1.26.54-1.77.07Z" fill="currentColor"></path></svg></span><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>src/pointer-events/App.tsx</span></span></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:7px;column-gap:7px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">Code</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">预览</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div></div></div></div>
<h2 class="rp-toc-include" id="harmonyos-功能补齐"><a href="#harmonyos-功能补齐" class="rp-header-anchor rp-link" aria-hidden="true">#</a>HarmonyOS 功能补齐</h2>
<h3 class="rp-toc-include" id="fetch-api"><a href="#fetch-api" class="rp-header-anchor rp-link" aria-hidden="true">#</a>Fetch API</h3>
<p>Lynx 提供了与 Web 标准兼容的 <a href="https://lynxjs.org/3.5/zh/api/lynx-api/global/fetch" target="_blank" rel="noopener noreferrer" class="rp-link">Fetch API</a>，用法与 Web 平台保持一致。Lynx 3.5 将 Fetch API 的支持扩展到了 HarmonyOS 平台，让跨平台开发更加便捷。</p>
<h3 class="rp-toc-include" id="accessibilityannounce"><a href="#accessibilityannounce" class="rp-header-anchor rp-link" aria-hidden="true">#</a>accessibilityAnnounce</h3>
<p>Lynx 3.5 在 HarmonyOS 平台补齐了 <a href="https://lynxjs.org/3.5/zh/api/lynx-api/lynx/lynx-accessibility-announce.html" target="_blank" rel="noopener noreferrer" class="rp-link"><code>accessibilityAnnounce()</code></a> 方法，与 Android 和 iOS 平台保持一致。该方法可调用屏幕阅读器朗读指定文本，帮助视觉障碍用户感知界面状态变化或操作结果。</p>
<div class="rp-codeblock language-jsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables has-highlighted" style="background-color:var(--shiki-background);color:var(--shiki-foreground)" tabindex="0" data-lang="jsx"><code><span class="line"><span style="color:var(--shiki-token-constant)">lynx</span><span style="color:var(--shiki-token-function)">.accessibilityAnnounce</span><span style="color:var(--shiki-foreground)">(</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">  {</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">    content</span><span style="color:var(--shiki-token-keyword)">:</span><span style="color:var(--shiki-token-string-expression)"> &#x27;hello lynx&#x27;</span><span style="color:var(--shiki-token-punctuation)">,</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">  }</span><span style="color:var(--shiki-token-punctuation)">,</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">  (res) </span><span style="color:var(--shiki-token-keyword)">=&gt;</span><span style="color:var(--shiki-foreground)"> {</span></span>
<span class="line"><span style="color:var(--shiki-token-constant)">    console</span><span style="color:var(--shiki-token-function)">.log</span><span style="color:var(--shiki-foreground)">(</span><span style="color:var(--shiki-token-string-expression)">&#x27;result: &#x27;</span><span style="color:var(--shiki-token-keyword)"> +</span><span style="color:var(--shiki-token-constant)"> JSON</span><span style="color:var(--shiki-token-function)">.stringify</span><span style="color:var(--shiki-foreground)">(res));</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">  }</span><span style="color:var(--shiki-token-punctuation)">,</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">);</span></span></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div>
<h3 class="rp-toc-include" id="requestresourceprefetch"><a href="#requestresourceprefetch" class="rp-header-anchor rp-link" aria-hidden="true">#</a>requestResourcePrefetch</h3>
<p><a href="https://lynxjs.org/3.5/zh/api/lynx-api/lynx/lynx-request-resource-prefetch.html" target="_blank" rel="noopener noreferrer" class="rp-link"><code>requestResourcePrefetch</code></a> API 现已支持 HarmonyOS 平台，与 Android 和 iOS 保持一致。该 API 允许开发者主动预加载 CDN 资源（目前支持 <code>image</code>、<code>video</code> 和 <code>audio</code>），以提升资源加载性能。</p>
<div class="rp-codeblock language-js"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables has-highlighted" style="background-color:var(--shiki-background);color:var(--shiki-foreground)" tabindex="0" data-lang="js"><code><span class="line"><span style="color:var(--shiki-token-constant)">lynx</span><span style="color:var(--shiki-token-function)">.requestResourcePrefetch?.</span><span style="color:var(--shiki-foreground)">(</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">  {</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">    data</span><span style="color:var(--shiki-token-keyword)">:</span><span style="color:var(--shiki-foreground)"> [</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">      {</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">        uri</span><span style="color:var(--shiki-token-keyword)">:</span><span style="color:var(--shiki-token-string-expression)"> &#x27;https://demo.org/test.jpg&#x27;</span><span style="color:var(--shiki-token-punctuation)">,</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">        type</span><span style="color:var(--shiki-token-keyword)">:</span><span style="color:var(--shiki-token-string-expression)"> &#x27;image&#x27;</span><span style="color:var(--shiki-token-punctuation)">,</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">        params</span><span style="color:var(--shiki-token-keyword)">:</span><span style="color:var(--shiki-foreground)"> { priority</span><span style="color:var(--shiki-token-keyword)">:</span><span style="color:var(--shiki-token-string-expression)"> &#x27;high&#x27;</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-foreground)"> cacheTarget</span><span style="color:var(--shiki-token-keyword)">:</span><span style="color:var(--shiki-token-string-expression)"> &#x27;disk&#x27;</span><span style="color:var(--shiki-foreground)"> }</span><span style="color:var(--shiki-token-punctuation)">,</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">      }</span><span style="color:var(--shiki-token-punctuation)">,</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">    ]</span><span style="color:var(--shiki-token-punctuation)">,</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">  }</span><span style="color:var(--shiki-token-punctuation)">,</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">  (res) </span><span style="color:var(--shiki-token-keyword)">=&gt;</span><span style="color:var(--shiki-foreground)"> {</span></span>
<span class="line"><span style="color:var(--shiki-token-constant)">    console</span><span style="color:var(--shiki-token-function)">.log</span><span style="color:var(--shiki-foreground)">(</span></span>
<span class="line"><span style="color:var(--shiki-token-string-expression)">      &#x27;prefetch status of each resource:&#x27;</span><span style="color:var(--shiki-token-punctuation)">,</span></span>
<span class="line"><span style="color:var(--shiki-token-constant)">      JSON</span><span style="color:var(--shiki-token-function)">.stringify</span><span style="color:var(--shiki-foreground)">(</span><span style="color:var(--shiki-token-constant)">res</span><span style="color:var(--shiki-foreground)">.details)</span><span style="color:var(--shiki-token-punctuation)">,</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">    );</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">  }</span><span style="color:var(--shiki-token-punctuation)">,</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">);</span></span></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div>
<h2 class="rp-toc-include" id="升级指南"><a href="#升级指南" class="rp-header-anchor rp-link" aria-hidden="true">#</a>升级指南</h2>
<p>参照官网<a href="https://lynxjs.org/3.5/zh/guide/start/integrate-with-existing-apps.html" target="_blank" rel="noopener noreferrer" class="rp-link">接入 Lynx 到现有应用</a>更新 Lynx 依赖版本，完成 Lynx 3.5 版本升级。</p>
<h2 class="rp-toc-include" id="桌面端支持预告"><a href="#桌面端支持预告" class="rp-header-anchor rp-link" aria-hidden="true">#</a>桌面端支持预告</h2>
<p>我们<a href="/next/zh/blog/lynx-open-source-roadmap-2025.html" class="rp-link">原本计划</a>在 Lynx 3.5 版本正式引入桌面端支持，最初只是打算开放自渲染管线和底层集成 API。经过讨论，我们决定更进一步，开源整套桌面端技术体系。因此发布时间将顺延至 2026 年初，敬请期待。</p>
<p>如果你想抢先了解 Lynx 桌面端的整体设计思路，以及我们与 <a href="https://www.electronjs.org/" target="_blank" rel="noopener noreferrer" class="rp-link">Electron</a> 和 <a href="https://www.qt.io/" target="_blank" rel="noopener noreferrer" class="rp-link">Qt</a> 等主流方案有哪些异同，欢迎观看我们多平台负责人 <a href="https://x.com/adservc1" target="_blank" rel="noopener noreferrer" class="rp-link">王之轩</a> 在 <a href="https://ubuntu.com/summit" target="_blank" rel="noopener noreferrer" class="rp-link">Ubuntu Summit 2025</a> 的主题演讲 <strong>《Bringing Lynx to Desktop and Beyond》</strong>：</p>
<div class="relative h-0 overflow-hidden pt-[56.25%]"><iframe class="absolute inset-0 w-full h-full" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="" title="YouTube video player" src="https://www.youtube.com/embed/n0jDZSI4tXg"></iframe></div><!--/$-->]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lynx 适配 HarmonyOS 正式开源]]></title>
            <link>https://lynxjs.org/zh/blog/lynx-harmony</link>
            <guid isPermaLink="false">/zh/blog/lynx-harmony</guid>
            <pubDate>Thu, 25 Sep 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[今天，我们很高兴地宣布：Lynx 现已提供 HarmonyOS 的公开测试版支持，在 CSS、UI 元件、API 上实现了功能对等，并带来同等级别的性能表现与原生体验。]]></description>
            <content:encoded><![CDATA[<h1 class="rp-toc-include" id="lynx-适配-harmonyos-正式开源"><span>Lynx 适配 HarmonyOS 正式开源</span><a href="#lynx-适配-harmonyos-正式开源" class="rp-header-anchor rp-link" aria-hidden="true">#</a> </h1><div class="rp-not-doc rp-llms-container"><button class="rp-not-doc rp-llms-button rp-llms-copy-button"><div class="rp-llms-copy-button__icon-wrapper"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg></div><span>复制 Markdown</span></button><button class="rp-llms-button rp-llms-view-options__trigger "><svg width="1em" height="1em" viewBox="0 0 32 32" class="rp-llms-view-options__arrow "><path fill="currentColor" d="M16 22 6 12l1.4-1.4 8.6 8.6 8.6-8.6L26 12z"></path></svg></button></div><!--$--><a href="/next/zh/blog/" class="backLink-lQPNH7">← <!-- -->所有文章</a><div class="blogHeader-ZKfIZ_"><span class="date-aB5gkw">2025年9月25日</span><div class="blog-avatar-frame-G1eJ1T avatars-aaQ1Kf"><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/rel-q.png" alt="白强"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">白强</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">软件工程师</span></div></span><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/toretto-wt.png" alt="石文涛"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">石文涛</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="14" viewBox="0 0 300 271" class="icon-x-XK0uad"><path fill="currentColor" d="M236 0h46L181 115l118 156h-92.6l-72.5-94.8-83 94.8h-46l107-123L-1.1 0h94.9l65.5 86.6zm-16.1 244h25.5L80.4 26H53z"></path></svg></span><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">渲染主管 @ Lynx</span></div></span><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/lynx-family.png" alt="Lynx 团队"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">Lynx 团队</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="14" viewBox="0 0 300 271" class="icon-x-XK0uad"><path fill="currentColor" d="M236 0h46L181 115l118 156h-92.6l-72.5-94.8-83 94.8h-46l107-123L-1.1 0h94.9l65.5 86.6zm-16.1 244h25.5L80.4 26H53z"></path></svg></span><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">lynxjs.org</span></div></span></div><div class="rp-not-doc rp-llms-container"><button class="rp-not-doc rp-llms-button rp-llms-copy-button"><div class="rp-llms-copy-button__icon-wrapper"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg></div><span>复制 Markdown</span></button><button class="rp-llms-button rp-llms-view-options__trigger "><svg width="1em" height="1em" viewBox="0 0 32 32" class="rp-llms-view-options__arrow "><path fill="currentColor" d="M16 22 6 12l1.4-1.4 8.6 8.6 8.6-8.6L26 12z"></path></svg></button></div></div>
<p><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/blog/lynx-harmony/lynx-harmony-background1.png" alt="lynx-harmony-background"/></p>
<p>如 <a href="/next/zh/blog/lynx-unlock-native-for-more.html" class="rp-link">Lynx 开源博客</a>所介绍，我们的愿景始终是为 <strong>更多平台与更多用户</strong> 解锁原生能力。随着 <a href="https://consumer.huawei.com/cn/harmonyos-next/" target="_blank" rel="noopener noreferrer" class="rp-link"><strong>HarmonyOS NEXT</strong></a> 的发布为市场带来新的平台和设备多样性，我们希望 Lynx 开发者也能够像在 Android、iOS 和 Web 上一样，轻松地触达这些用户。</p>
<p>今天，我们很高兴地宣布，<strong>Lynx 现已提供 HarmonyOS 的公开测试版支持</strong>，在 <a href="/zh/guide/ui/styling.html" class="rp-link">CSS</a>、<a href="/zh/api/elements/built-in/view.html" class="rp-link">UI 元件</a>、<a href="/zh/api/index.html" class="rp-link">API</a> 上实现了功能对等，并带来同等级别的性能表现与原生体验。</p>
<h2 class="rp-toc-include" id="功能对齐的-lynx-for-harmonyos"><a href="#功能对齐的-lynx-for-harmonyos" class="rp-header-anchor rp-link" aria-hidden="true">#</a>功能对齐的 Lynx for HarmonyOS</h2>
<p>在之前 <a href="/zh/learn/gallery.html" class="rp-link">教程：产品双列</a> 中，我们使用 Lynx 实现了一个复杂的页面，我们来看一下 Lynx 分别运行 Android 与 HarmonyOS 上的表现；如下图所示，整体能实现像素级对齐。基于此， Lynx 开发者可以做到<strong>一次编写，多端运行</strong>，使用同一份代码库同时构建 Android、iOS、Web 和 HarmonyOS 应用，提高开发效率和代码可维护性。</p>
<div style="display:table;margin:36px 0;width:100%;table-layout:fixed"><div style="display:table-row"><div style="display:table-cell;vertical-align:top;text-align:center"><div style="border-radius:8px;overflow:hidden;max-width:40vw;margin:0 auto"><video src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/blog/lynx-harmony/ifr-harmony.mp4" style="width:100%;height:auto;max-height:50vh;object-fit:contain;display:block" autoplay="" muted="" controls="" loop="" playsinline=""></video></div><div style="margin-top:0.5rem;text-align:center">Running Lynx on HarmonyOS</div></div><div style="display:table-cell;vertical-align:top;text-align:center"><div style="border-radius:8px;overflow:hidden;max-width:40vw;margin:0 auto"><video src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/blog/lynx-harmony/ifr-android1.mp4" style="width:100%;height:auto;max-height:50vh;object-fit:contain;display:block" autoplay="" muted="" controls="" loop="" playsinline=""></video></div><div style="margin-top:0.5rem;text-align:center">Running Lynx on Android</div></div></div></div>
<p>Lynx 在 Android、iOS、HarmonyOS 上 CSS、原生组件等功能高度一致得益于 Lynx 的架构实现：<strong>在多平台上 Lynx 的渲染流水线是共用、一致的</strong>。在 HarmonyOS 上，Lynx 渲染指令与 HarmonyOS 的 <a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/arkui-overview" target="_blank" rel="noopener noreferrer" class="rp-link">ArkUI</a> 渲染组件对接，进而实现 CSS 属性绘制、动画、自定义组件等。</p>
<p><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/blog/lynx-harmony/lynx-harmony-imp.png" alt="lynx-harmony-background"/></p>
<h2 class="rp-toc-include" id="原生的-lynx-for-harmonyos"><a href="#原生的-lynx-for-harmonyos" class="rp-header-anchor rp-link" aria-hidden="true">#</a>原生的 Lynx for HarmonyOS</h2>
<h3 class="rp-toc-include" id="渲染指令直驱-arkui"><a href="#渲染指令直驱-arkui" class="rp-header-anchor rp-link" aria-hidden="true">#</a>渲染指令直驱 ArkUI</h3>
<p>Lynx 渲染指令直接对接 ArkUI 组件，Lynx 与 OpenHarmony 一起探索了两种对接方式：<a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/arkts-ui-development-overview" target="_blank" rel="noopener noreferrer" class="rp-link">ArkTS</a> 与 <a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/ndk-build-ui-overview" target="_blank" rel="noopener noreferrer" class="rp-link">C API</a>。</p>
<p><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/blog/lynx-harmony/lynx-harmony-ui.png" alt="lynx-harmony-ui"/></p>
<p>Lynx for HarmonyOS 最终选择 C API 方式将 Lynx <a href="https://lynxjs.org/guide/spec.html#platform-ui-tree" target="_blank" rel="noopener noreferrer" class="rp-link">platform-ui-tree</a> 直接映射为 HarmonyOS 的原生组件。既能保证 Lynx 的性能优势，同时也能结合 ArkTS 的丰富生态与能力。</p>
<ul>
<li>
<p><strong>原生组件渲染</strong>：利用了 <a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/arkui-overview" target="_blank" rel="noopener noreferrer" class="rp-link">ArkUI</a> 的 <a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/ndk-build-ui-overview" target="_blank" rel="noopener noreferrer" class="rp-link">C API</a> 将 <a href="https://lynxjs.org/guide/spec.html#element-tree" target="_blank" rel="noopener noreferrer" class="rp-link">element-tree</a> 操作直接转换为对原生 UI 节点的调用，其渲染指令可以绕开 <a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/arkts-overview" target="_blank" rel="noopener noreferrer" class="rp-link">ArkTS</a> 虚拟机的执行开销，不存在语言间数据传递的转换，在 HarmonyOS 上实现接近甚至超越原生 ArkTS 的渲染性能。</p>
</li>
<li>
<p><strong>自定义元件</strong>：通过 HarmonyOS 提供的 <a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/arkts-user-defined-arktsnode-buildernode" target="_blank" rel="noopener noreferrer" class="rp-link"><code>BuilderNode</code></a> 和 <a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/arkts-builder" target="_blank" rel="noopener noreferrer" class="rp-link"><code>Builder</code></a> 可动态构建 ArkTS 子树，直接嵌入到 Lynx 创建的 ArkUI 节点树，以实现高度定制自定义元件。</p>
</li>
</ul>
<h3 class="rp-toc-include" id="复杂交互处理"><a href="#复杂交互处理" class="rp-header-anchor rp-link" aria-hidden="true">#</a>复杂交互处理</h3>
<p>Lynx 在 HarmonyOS 构建了一套完整的事件处理机制，能在复杂交互场景下捕获和响应手势与事件。</p>
<table rules="none" align="center" width="100%" style="table-layout:fixed"><thead align="center"><th colSpan="1"><span style="font-weight:bold"><p>手势识别</p></span></th><th colSpan="1"><span style="font-weight:bold"><p>混合场景自定义手势控制</p></span></th></thead><tr><td style="padding:15px 0 15px 15px"><center><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/blog/lynx-harmony/base-event.gif" style="width:200px;height:380px;aspect-ratio:1/1"/></center></td><td style="padding:15px 0 15px 15px"><center><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/blog/lynx-harmony/complex-event.gif" style="width:200px;height:380px;aspect-ratio:1/1"/></center></td></tr></table>
<ul>
<li><strong>自定义 HitTest</strong>：在 Lynx platform-ui-tree 上准确查找响应事件的节点，保障基础交互的准确性。</li>
<li><strong>手势识别</strong>：集成了 HarmonyOS 的手势识别能力如 <a href="https://lynxjs.org/api/lynx-api/event/touch-event#tap" target="_blank" rel="noopener noreferrer" class="rp-link"><code>tap</code></a>、<a href="https://lynxjs.org/api/lynx-api/event/touch-event#longpress" target="_blank" rel="noopener noreferrer" class="rp-link"><code>longpress</code></a> 等，保障在使用 Lynx for HarmonyOS 时拥有与原生一致的手势体验。</li>
<li><strong>混合场景自定义控制</strong>：提供一系列事件 API，如 <a href="https://lynxjs.org/api/elements/built-in/view.html#user-interaction-enabled" target="_blank" rel="noopener noreferrer" class="rp-link"><code>user-interaction-enabled</code></a> 和 <a href="https://lynxjs.org/api/elements/built-in/view.html#block-native-event" target="_blank" rel="noopener noreferrer" class="rp-link"><code>block-native-event</code></a>，允许开发者可控制事件的穿透和消费逻辑，可高效处理与原生页面的混合滚动等复杂场景。</li>
</ul>
<h3 class="rp-toc-include" id="原生能力拓展"><a href="#原生能力拓展" class="rp-header-anchor rp-link" aria-hidden="true">#</a>原生能力拓展</h3>
<ul>
<li><strong>元件定制能力</strong>：Lynx 不仅提供了丰富的内置元件，还允许开发者将自己开发的 HarmonyOS 原生组件（通过 ArkTS 实现）封装并注册到 Lynx 运行时中。这意味着开发者可以根据业务需求扩展应用的 UI 能力，实现高度定制化的界面和交互，保持原生体验。更多内容参考：<a href="/zh/guide/custom-native-component.html?platform=harmony" class="rp-link">自定义元件的使用指南</a>。</li>
<li><strong>原生模块定制能力</strong>：通过 Lynx 的原生模块扩展能力，开发者可以在 JavaScript 中调用 HarmonyOS 的原生 API，无论是系统级的服务还是自定义的原生模块。更多内容参考：<a href="/zh/guide/use-native-modules.html?platform=harmony" class="rp-link">原生模块的使用指南</a>。</li>
</ul>
<h2 class="rp-toc-include" id="在-harmonyos-创建第一个-lynx-应用"><a href="#在-harmonyos-创建第一个-lynx-应用" class="rp-header-anchor rp-link" aria-hidden="true">#</a>在 HarmonyOS 创建第一个 Lynx 应用</h2>
<p>在 Lynx 官网中已经准备好了详细的<a href="/zh/guide/start/integrate-with-existing-apps.html" class="rp-link">开发文档</a>和<a href="https://github.com/lynx-family/integrating-lynx-demo-projects/tree/main/harmony/HarmonyEmptyProject" target="_blank" rel="noopener noreferrer" class="rp-link">示例代码</a>，帮助开发者快速上手。</p>
<ol>
<li>
<p><strong>使用预构建的 Lynx Explorer</strong>：若希望以最便捷的方式开启开发，可以按照<a href="/zh/guide/start/quick-start.html" class="rp-link">快速上手</a>描述的步骤操作安装 Lynx Explorer hap 包上手 Lynx 开发。</p>
</li>
<li>
<p><strong>本地构建 Lynx Explorer</strong>：若开发者想对 Lynx for HarmonyOS 的源码有更多的探索，可尝试本地构建，参考<a href="https://github.com/lynx-family/lynx/tree/develop/explorer/harmony" target="_blank" rel="noopener noreferrer" class="rp-link">为 Harmony 构建 Lynx Explorer</a>。</p>
</li>
<li>
<p><strong>集成 Lynx 到已有的应用工程中</strong>：若开发者已经有自己的 HarmonyOS 应用工程，并希望将 Lynx 集成其中，官网也提供了<a href="/zh/guide/start/integrate-with-existing-apps.html?platform=harmony" class="rp-link">集成参考</a>。</p>
</li>
</ol>
<p>我们邀请你一同加入 Lynx 社区，一起在 HarmonyOS 上，用 Lynx 构建卓越的原生体验！</p><!--/$-->]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lynx 3.4: HarmonyOS 支持，Trace 和 Recorder，文本输入元件]]></title>
            <link>https://lynxjs.org/zh/blog/lynx-3-4</link>
            <guid isPermaLink="false">/zh/blog/lynx-3-4</guid>
            <pubDate>Wed, 03 Sep 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[Lynx 3.4 已经正式发布! 新版本新增对 HarmonyOS 的适配支持、支持 Windows 作为 Lynx 开发环境、推出 *Trace* 与 *Recorder* 开发者工具、开源备受期待的原生组件 `<input>` 和 `<textarea>`，还带来了更灵活的动画效果、可变字体等功能。]]></description>
            <content:encoded><![CDATA[<h1 class="rp-toc-include" id="lynx-34-harmonyos-支持trace-和-recorder文本输入元件"><span>Lynx 3.4: HarmonyOS 支持，Trace 和 Recorder，文本输入元件</span><a href="#lynx-34-harmonyos-支持trace-和-recorder文本输入元件" class="rp-header-anchor rp-link" aria-hidden="true">#</a> </h1><div class="rp-not-doc rp-llms-container"><button class="rp-not-doc rp-llms-button rp-llms-copy-button"><div class="rp-llms-copy-button__icon-wrapper"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg></div><span>复制 Markdown</span></button><button class="rp-llms-button rp-llms-view-options__trigger "><svg width="1em" height="1em" viewBox="0 0 32 32" class="rp-llms-view-options__arrow "><path fill="currentColor" d="M16 22 6 12l1.4-1.4 8.6 8.6 8.6-8.6L26 12z"></path></svg></button></div><!--$--><a href="/next/zh/blog/" class="backLink-lQPNH7">← <!-- -->所有文章</a><div class="blogHeader-ZKfIZ_"><span class="date-aB5gkw">2025年9月3日</span><div class="blog-avatar-frame-G1eJ1T avatars-aaQ1Kf"><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/loongliu.png" alt="刘继龙"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">刘继龙</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">性能主管 @ Lynx</span></div></span><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/lynx-family.png" alt="Lynx 团队"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">Lynx 团队</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="14" viewBox="0 0 300 271" class="icon-x-XK0uad"><path fill="currentColor" d="M236 0h46L181 115l118 156h-92.6l-72.5-94.8-83 94.8h-46l107-123L-1.1 0h94.9l65.5 86.6zm-16.1 244h25.5L80.4 26H53z"></path></svg></span><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">lynxjs.org</span></div></span></div><div class="rp-not-doc rp-llms-container"><button class="rp-not-doc rp-llms-button rp-llms-copy-button"><div class="rp-llms-copy-button__icon-wrapper"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg></div><span>复制 Markdown</span></button><button class="rp-llms-button rp-llms-view-options__trigger "><svg width="1em" height="1em" viewBox="0 0 32 32" class="rp-llms-view-options__arrow "><path fill="currentColor" d="M16 22 6 12l1.4-1.4 8.6 8.6 8.6-8.6L26 12z"></path></svg></button></div></div>
<p>Lynx 3.4 已经正式发布!</p>
<p>延续今年初公布的<a href="/next/zh/blog/lynx-open-source-roadmap-2025.html" class="rp-link">技术路线图</a>，我们一直保持着稳定的双月发布节奏。Lynx 3.3 版本因用户侧新功能较少而未单独发布博客，但该版本为 3.4 版本奠定了坚实基础。
Lynx 3.4 新增对 HarmonyOS 的适配支持、支持 Windows 作为 Lynx 开发环境、推出 <em>Trace</em> 与 <em>Recorder</em> 开发者工具、开源备受期待的原生组件 <code>&lt;input&gt;</code> 和 <code>&lt;textarea&gt;</code>，还带来了更灵活的动画效果、可变字体等功能。</p>
<h2 class="rp-toc-include" id="新系统支持"><a href="#新系统支持" class="rp-header-anchor rp-link" aria-hidden="true">#</a>新系统支持</h2>
<h3 class="rp-toc-include" id="harmonyos-支持"><a href="#harmonyos-支持" class="rp-header-anchor rp-link" aria-hidden="true">#</a>HarmonyOS 支持</h3>
<p>Lynx 现已正式支持 <a href="https://www.harmonyos.com/" target="_blank" rel="noopener noreferrer" class="rp-link">HarmonyOS</a> 平台。开发者可参考 <a href="/zh/guide/start/integrate-with-existing-apps.html?platform=harmony" class="rp-link">接入现有应用</a>，将 Lynx 集成进 HarmonyOS 应用中。我们也将很快发布技术博客，深入介绍 Lynx 在 HarmonyOS 上的实现与优化，敬请期待。</p>
<p><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/blog/lynx-harmony/background.png" alt=""/></p>
<h3 class="rp-toc-include" id="windows-开发环境支持"><a href="#windows-开发环境支持" class="rp-header-anchor rp-link" aria-hidden="true">#</a>Windows 开发环境支持</h3>
<ul>
<li>
<p>构建工具 <a href="/zh/rspeedy/index.html" class="rp-link">Rspeedy</a> 现已支持 Windows 平台，开发者可在 Windows PC 上完成 Lynx 项目的开发与构建；</p>
</li>
<li>
<p>开发者可在 Windows 环境下成功编译安卓端的 Lynx Engine 及 <a href="/zh/guide/start/quick-start.html#%E5%87%86%E5%A4%87-lynx-explorer" class="rp-link">LynxExplorer</a> 应用；</p>
</li>
</ul>
<p>Devtool 桌面版对 Windows 的支持也在积极开发中，即将与大家见面。</p>
<h2 class="rp-toc-include" id="新开发者工具"><a href="#新开发者工具" class="rp-header-anchor rp-link" aria-hidden="true">#</a>新开发者工具</h2>
<p>Lynx 3.4 引入了两款开发者工具，致力于提升开发者体验与调试效率。</p>
<h3 class="rp-toc-include" id="trace"><a href="#trace" class="rp-header-anchor rp-link" aria-hidden="true">#</a>Trace</h3>
<p><a href="/zh/guide/devtool/trace.html" class="rp-link">Trace</a> 提供了全链路的渲染追踪与可视化能力，能够完整记录并展示 Lynx 页面从解析、构建、布局到渲染的全过程，同时深入监控引擎内部的执行逻辑。它将系统内部的工作状态由“黑盒”转变为清晰的可视化数据，有效帮助开发者理解底层运行机制，并显著提升定位与优化性能瓶颈的效率。</p>
<p><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/plugin/static/trace-tool-overview-latest2.png" alt=""/></p>
<h3 class="rp-toc-include" id="recorder"><a href="#recorder" class="rp-header-anchor rp-link" aria-hidden="true">#</a>Recorder</h3>
<p><a href="/zh/guide/devtool/recorder.html" class="rp-link">Recorder</a> 录制了 Lynx 应用运行时的一切外部依赖操作，包括资源加载、原生模块调用返回结果及用户交互事件流。录制内容可导出为文件，并可在 LynxExplorer 中精准回放，从而实现了复杂场景的“录屏式”调试，极大提升了难以复现的交互或异步问题的排查效率。</p>
<p><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/plugin/static/recorder-concept.png" alt=""/></p>
<h2 class="rp-toc-include" id="文本输入元件"><a href="#文本输入元件" class="rp-header-anchor rp-link" aria-hidden="true">#</a>文本输入元件</h2>
<p>在 Lynx 社区发起的 UI 能力<a href="https://github.com/lynx-family/lynx/discussions/673" target="_blank" rel="noopener noreferrer" class="rp-link">调研</a>中，<code>&lt;input&gt;</code>/<code>&lt;textarea&gt;</code> 以超过 50% 的得票率，成为开发者们最迫切期待的核心功能。
Lynx 3.4 交付了两个核心文本输入组件。我们将继续完善核心元件，欢迎开发者们在 <a href="https://github.com/lynx-family/lynx/discussions/673" target="_blank" rel="noopener noreferrer" class="rp-link">discussion</a> 中投票，共同定义 Lynx 的未来。</p>
<h3 class="rp-toc-include" id="单行文本输入元件-input"><a href="#单行文本输入元件-input" class="rp-header-anchor rp-link" aria-hidden="true">#</a>单行文本输入元件 <a href="/zh/api/elements/built-in/input.html" class="rp-link"><code>&lt;input&gt;</code></a></h3>
<div class="box-LTvjqb   "><div class="container-qARFbv"><div class="content-Yzcw9o"><div class="split-pane" style="display:flex;flex-direction:row;width:100%;height:100%;min-height:0"><div class="split-pane__first" style="flex:1;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="code-wrap-jURSQJ"><div class="code-tab-container-5FhsBL"><div class="code-view-container-lgwabm "><div class="code-kbFEhm"><div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables" data-lang="tsx"><code style="padding:1rem 1.25rem"></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div><div role="separator" class="split-pane__divider" tabindex="0" style="flex:0 0 10px;cursor:col-resize;display:flex;align-items:center;justify-content:center;position:relative;z-index:1;touch-action:none" aria-orientation="vertical"><span role="img" aria-label="handle" class="semi-icon semi-icon-default semi-icon-handle" style="font-size:10px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M9 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M9 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M11 19a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M17 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></svg></span></div><div class="split-pane__second" style="flex:0 0 auto;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="preview-wrap-un0XJO"><div class="preview-wrap-content-TYo6um"><div class="preview-header-zYAZlz"><div style="width:24px;flex-shrink:0"></div><div class="semi-radioGroup semi-radioGroup-wrapper semi-radioGroup-buttonRadio" style="display:flex;flex:1;min-width:0;justify-content:center"><div style="width:100%;height:32px"></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div><div class="preview-body-YE5PSF"><div class="preview-panel-amOf1r" style="z-index:1;visibility:visible;pointer-events:auto"><div style="min-height:0px;display:flex;width:100%;height:100%;align-items:center;justify-content:center"><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/plugin/static/input_basic.PNG" alt="" loading="eager" decoding="async" style="max-width:100%;max-height:100%;object-fit:contain"/></div></div></div></div></div></div></div></div><div class="footer-KtlqMk"><div class="semi-space semi-space-align-center semi-space-horizontal" style="max-width:100%;overflow:hidden;white-space:nowrap;row-gap:2px;column-gap:2px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><span role="img" aria-label="list" class="semi-icon semi-icon-default semi-icon-list" style="color:var(--semi-color-text-2)"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><g opacity="0.99"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9.5 3a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM8 11.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 11.5Zm0 7c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 18.5Zm-2-7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-2 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></g></svg></span></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="overflow:hidden;row-gap:2px;column-gap:2px" x-semi-prop="children"><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>input</span></span><span role="img" aria-label="chevron_right_stroked" class="semi-icon semi-icon-default semi-icon-chevron_right_stroked" style="color:var(--semi-color-text-2);font-size:12px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.9 20.17a1.25 1.25 0 0 1-.07-1.77l5.71-6.15-5.7-6.15a1.25 1.25 0 0 1 1.83-1.7l6.5 7c.44.48.44 1.22 0 1.7l-6.5 7c-.47.5-1.26.54-1.77.07Z" fill="currentColor"></path></svg></span><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>src/base/index.tsx</span></span></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:7px;column-gap:7px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">Code</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">预览</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div></div></div></div>
<h3 class="rp-toc-include" id="多行文本输入元件-textarea"><a href="#多行文本输入元件-textarea" class="rp-header-anchor rp-link" aria-hidden="true">#</a>多行文本输入元件 <a href="/zh/api/elements/built-in/textarea.html" class="rp-link"><code>&lt;textarea&gt;</code></a></h3>
<div class="box-LTvjqb   "><div class="container-qARFbv"><div class="content-Yzcw9o"><div class="split-pane" style="display:flex;flex-direction:row;width:100%;height:100%;min-height:0"><div class="split-pane__first" style="flex:1;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="code-wrap-jURSQJ"><div class="code-tab-container-5FhsBL"><div class="code-view-container-lgwabm "><div class="code-kbFEhm"><div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables" data-lang="tsx"><code style="padding:1rem 1.25rem"></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div><div role="separator" class="split-pane__divider" tabindex="0" style="flex:0 0 10px;cursor:col-resize;display:flex;align-items:center;justify-content:center;position:relative;z-index:1;touch-action:none" aria-orientation="vertical"><span role="img" aria-label="handle" class="semi-icon semi-icon-default semi-icon-handle" style="font-size:10px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M9 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M9 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M11 19a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M17 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></svg></span></div><div class="split-pane__second" style="flex:0 0 auto;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="preview-wrap-un0XJO"><div class="preview-wrap-content-TYo6um"><div class="preview-header-zYAZlz"><div style="width:24px;flex-shrink:0"></div><div class="semi-radioGroup semi-radioGroup-wrapper semi-radioGroup-buttonRadio" style="display:flex;flex:1;min-width:0;justify-content:center"><div style="width:100%;height:32px"></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div><div class="preview-body-YE5PSF"><div class="preview-panel-amOf1r" style="z-index:1;visibility:visible;pointer-events:auto"><div style="min-height:0px;display:flex;width:100%;height:100%;align-items:center;justify-content:center"><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/plugin/static/textarea_basic.PNG" alt="" loading="eager" decoding="async" style="max-width:100%;max-height:100%;object-fit:contain"/></div></div></div></div></div></div></div></div><div class="footer-KtlqMk"><div class="semi-space semi-space-align-center semi-space-horizontal" style="max-width:100%;overflow:hidden;white-space:nowrap;row-gap:2px;column-gap:2px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><span role="img" aria-label="list" class="semi-icon semi-icon-default semi-icon-list" style="color:var(--semi-color-text-2)"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><g opacity="0.99"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9.5 3a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM8 11.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 11.5Zm0 7c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 18.5Zm-2-7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-2 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></g></svg></span></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="overflow:hidden;row-gap:2px;column-gap:2px" x-semi-prop="children"><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>textarea</span></span><span role="img" aria-label="chevron_right_stroked" class="semi-icon semi-icon-default semi-icon-chevron_right_stroked" style="color:var(--semi-color-text-2);font-size:12px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.9 20.17a1.25 1.25 0 0 1-.07-1.77l5.71-6.15-5.7-6.15a1.25 1.25 0 0 1 1.83-1.7l6.5 7c.44.48.44 1.22 0 1.7l-6.5 7c-.47.5-1.26.54-1.77.07Z" fill="currentColor"></path></svg></span><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>src/base/index.tsx</span></span></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:7px;column-gap:7px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">Code</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">预览</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div></div></div></div>
<h2 class="rp-toc-include" id="更高自由度的list回收策略"><a href="#更高自由度的list回收策略" class="rp-header-anchor rp-link" aria-hidden="true">#</a>更高自由度的<code>&lt;list&gt;</code>回收策略</h2>
<h3 class="rp-toc-include" id="回收-sticky-节点"><a href="#回收-sticky-节点" class="rp-header-anchor rp-link" aria-hidden="true">#</a>回收 sticky 节点</h3>
<p>当 <code>&lt;list-item&gt;</code> 被滚动出 <code>&lt;list&gt;</code> 视口时，原有回收机制会缓存该条目以供复用。在 Lynx 3.4 之前，具有 sticky 属性的 <code>&lt;list-item&gt;</code> 并不会被回收。在大量使用 sticky 特性的长列表中，这可能导致内存占用过高。Lynx 3.4 优化了这一策略，sticky 项在滚出视口后同样会被回收。
若该改动对你现有场景造成影响，可通过设置 <a href="/zh/api/elements/built-in/list.html#experimental-recycle-sticky-item" class="rp-link"><code>experimental-recycle-sticky-item={false}</code></a> 暂时禁用此优化。如遇到任何问题，欢迎通过 issue 反馈。</p>
<table border="0"><tr><td><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/plugin/static/not-recycle-sticky-1.gif" alt=""/></td><td><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/plugin/static/recycle-sticky-1.gif" alt=""/></td></tr><tr><td>sticky <code>&lt;list-item&gt;</code> in Lynx 3.3</td><td>sticky <code>&lt;list-item&gt;</code> in Lynx 3.4</td></tr></table>
<h3 class="rp-toc-include" id="不回收-list-item"><a href="#不回收-list-item" class="rp-header-anchor rp-link" aria-hidden="true">#</a>不回收 <code>&lt;list-item&gt;</code></h3>
<p>当 <code>&lt;list-item&gt;</code> 内含复杂元件时，回收并重新更新节点带来较高的 CPU 开销。开发者现可设置 <code>recyclable={false}</code> 来实现<a href="/zh/api/elements/built-in/list.html#%E5%AE%9E%E7%8E%B0-list-item-%E4%B8%8D%E5%9B%9E%E6%94%B6" class="rp-link">特定 <code>&lt;list-item&gt;</code> 不回收</a>。禁用后，该条目滑出视窗后不会被回收，再次出现时也无需重新渲染，适用于对渲染性能有极致要求的场景。</p>
<div class="box-LTvjqb   "><div class="container-qARFbv"><div class="content-Yzcw9o"><div class="split-pane" style="display:flex;flex-direction:row;width:100%;height:100%;min-height:0"><div class="split-pane__first" style="flex:1;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="code-wrap-jURSQJ"><div class="code-tab-container-5FhsBL"><div class="code-view-container-lgwabm "><div class="code-kbFEhm"><div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables" data-lang="tsx"><code style="padding:1rem 1.25rem"></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div><div role="separator" class="split-pane__divider" tabindex="0" style="flex:0 0 10px;cursor:col-resize;display:flex;align-items:center;justify-content:center;position:relative;z-index:1;touch-action:none" aria-orientation="vertical"><span role="img" aria-label="handle" class="semi-icon semi-icon-default semi-icon-handle" style="font-size:10px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M9 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M9 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M11 19a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M17 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></svg></span></div><div class="split-pane__second" style="flex:0 0 auto;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="preview-wrap-un0XJO"><div class="preview-wrap-content-TYo6um"><div class="preview-header-zYAZlz"><div style="width:24px;flex-shrink:0"></div><div class="semi-radioGroup semi-radioGroup-wrapper semi-radioGroup-buttonRadio" style="display:flex;flex:1;min-width:0;justify-content:center"><div style="width:100%;height:32px"></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div><div class="preview-body-YE5PSF"><div class="preview-panel-amOf1r" style="z-index:1;visibility:visible;pointer-events:auto"><div style="min-height:0px;display:flex;width:100%;height:100%;align-items:center;justify-content:center"><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/plugin/static/20250828-213840.gif" alt="" loading="eager" decoding="async" style="max-width:100%;max-height:100%;object-fit:contain"/></div></div></div></div></div></div></div></div><div class="footer-KtlqMk"><div class="semi-space semi-space-align-center semi-space-horizontal" style="max-width:100%;overflow:hidden;white-space:nowrap;row-gap:2px;column-gap:2px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><span role="img" aria-label="list" class="semi-icon semi-icon-default semi-icon-list" style="color:var(--semi-color-text-2)"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><g opacity="0.99"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9.5 3a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM8 11.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 11.5Zm0 7c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 18.5Zm-2-7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-2 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></g></svg></span></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="overflow:hidden;row-gap:2px;column-gap:2px" x-semi-prop="children"><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>list</span></span><span role="img" aria-label="chevron_right_stroked" class="semi-icon semi-icon-default semi-icon-chevron_right_stroked" style="color:var(--semi-color-text-2);font-size:12px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.9 20.17a1.25 1.25 0 0 1-.07-1.77l5.71-6.15-5.7-6.15a1.25 1.25 0 0 1 1.83-1.7l6.5 7c.44.48.44 1.22 0 1.7l-6.5 7c-.47.5-1.26.54-1.77.07Z" fill="currentColor"></path></svg></span><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>src/recyclable/index.tsx</span></span></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:7px;column-gap:7px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">Code</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">预览</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div></div></div></div>
<h2 class="rp-toc-include" id="更灵活的动画"><a href="#更灵活的动画" class="rp-header-anchor rp-link" aria-hidden="true">#</a>更灵活的动画</h2>
<h3 class="rp-toc-include" id="elementanimate"><a href="#elementanimate" class="rp-header-anchor rp-link" aria-hidden="true">#</a><code>Element.animate()</code></h3>
<p><a href="/zh/api/lynx-api/main-thread/main-thread-element.html" class="rp-link"><code>MainThread.Element</code></a> 新增 <code>animate()</code>方法，用于在 MTS 精细控制 CSS 动画，包括播放、暂停、跳转等操作，让交互动画实现更加灵活。</p>
<div class="box-LTvjqb   "><div class="container-qARFbv"><div class="content-Yzcw9o"><div class="split-pane" style="display:flex;flex-direction:row;width:100%;height:100%;min-height:0"><div class="split-pane__first" style="flex:1;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="code-wrap-jURSQJ"><div class="code-tab-container-5FhsBL"><div class="code-view-container-lgwabm "><div class="code-kbFEhm"><div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables" data-lang="tsx"><code style="padding:1rem 1.25rem"></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div><div role="separator" class="split-pane__divider" tabindex="0" style="flex:0 0 10px;cursor:col-resize;display:flex;align-items:center;justify-content:center;position:relative;z-index:1;touch-action:none" aria-orientation="vertical"><span role="img" aria-label="handle" class="semi-icon semi-icon-default semi-icon-handle" style="font-size:10px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M9 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M9 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M11 19a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M17 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></svg></span></div><div class="split-pane__second" style="flex:0 0 auto;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="preview-wrap-un0XJO"><div class="preview-wrap-content-TYo6um"><div class="preview-header-zYAZlz"><div style="width:24px;flex-shrink:0"></div><div class="semi-radioGroup semi-radioGroup-wrapper semi-radioGroup-buttonRadio" style="display:flex;flex:1;min-width:0;justify-content:center"><div style="width:100%;height:32px"></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div><div class="preview-body-YE5PSF"><div class="preview-panel-amOf1r" style="z-index:1;visibility:visible;pointer-events:auto"><div style="min-height:0px;display:flex;width:100%;height:100%;align-items:center;justify-content:center"><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/plugin/static/mt_animation.webp" alt="" loading="eager" decoding="async" style="max-width:100%;max-height:100%;object-fit:contain"/></div></div></div></div></div></div></div></div><div class="footer-KtlqMk"><div class="semi-space semi-space-align-center semi-space-horizontal" style="max-width:100%;overflow:hidden;white-space:nowrap;row-gap:2px;column-gap:2px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><span role="img" aria-label="list" class="semi-icon semi-icon-default semi-icon-list" style="color:var(--semi-color-text-2)"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><g opacity="0.99"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9.5 3a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM8 11.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 11.5Zm0 7c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 18.5Zm-2-7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-2 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></g></svg></span></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="overflow:hidden;row-gap:2px;column-gap:2px" x-semi-prop="children"><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>animation</span></span><span role="img" aria-label="chevron_right_stroked" class="semi-icon semi-icon-default semi-icon-chevron_right_stroked" style="color:var(--semi-color-text-2);font-size:12px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.9 20.17a1.25 1.25 0 0 1-.07-1.77l5.71-6.15-5.7-6.15a1.25 1.25 0 0 1 1.83-1.7l6.5 7c.44.48.44 1.22 0 1.7l-6.5 7c-.47.5-1.26.54-1.77.07Z" fill="currentColor"></path></svg></span><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>src/animate_mt/index.tsx</span></span></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:7px;column-gap:7px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">Code</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">预览</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div></div></div></div>
<h3 class="rp-toc-include" id="css-变量触发-transition"><a href="#css-变量触发-transition" class="rp-header-anchor rp-link" aria-hidden="true">#</a>CSS 变量触发 transition</h3>
<p>现支持通过 CSS 变量的变化触发 transition 动画，提升了过渡动画的灵活性与可维护性。在多主题设计中，开发者可将动画参数与主题变量关联。切换主题时，只需修改变量值而无需改动选择器逻辑，即可完成主题切换。</p>
<div class="box-LTvjqb   "><div class="container-qARFbv"><div class="content-Yzcw9o"><div class="split-pane" style="display:flex;flex-direction:row;width:100%;height:100%;min-height:0"><div class="split-pane__first" style="flex:1;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="code-wrap-jURSQJ"><div class="code-tab-container-5FhsBL"><div class="code-view-container-lgwabm "><div class="code-kbFEhm"><div class="rp-codeblock language-scss"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables" data-lang="scss"><code style="padding:1rem 1.25rem"></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div><div role="separator" class="split-pane__divider" tabindex="0" style="flex:0 0 10px;cursor:col-resize;display:flex;align-items:center;justify-content:center;position:relative;z-index:1;touch-action:none" aria-orientation="vertical"><span role="img" aria-label="handle" class="semi-icon semi-icon-default semi-icon-handle" style="font-size:10px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M9 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M9 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M11 19a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M17 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></svg></span></div><div class="split-pane__second" style="flex:0 0 auto;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="preview-wrap-un0XJO"><div class="preview-wrap-content-TYo6um"><div class="preview-header-zYAZlz"><div style="width:24px;flex-shrink:0"></div><div class="semi-radioGroup semi-radioGroup-wrapper semi-radioGroup-buttonRadio" style="display:flex;flex:1;min-width:0;justify-content:center"><div style="width:100%;height:32px"></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div><div class="preview-body-YE5PSF"><div class="preview-panel-amOf1r" style="z-index:1;visibility:visible;pointer-events:auto"><div style="min-height:0px;display:flex;width:100%;height:100%;align-items:center;justify-content:center"><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/plugin/static/transition-variable.gif" alt="" loading="eager" decoding="async" style="max-width:100%;max-height:100%;object-fit:contain"/></div></div></div></div></div></div></div></div><div class="footer-KtlqMk"><div class="semi-space semi-space-align-center semi-space-horizontal" style="max-width:100%;overflow:hidden;white-space:nowrap;row-gap:2px;column-gap:2px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><span role="img" aria-label="list" class="semi-icon semi-icon-default semi-icon-list" style="color:var(--semi-color-text-2)"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><g opacity="0.99"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9.5 3a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM8 11.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 11.5Zm0 7c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 18.5Zm-2-7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-2 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></g></svg></span></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="overflow:hidden;row-gap:2px;column-gap:2px" x-semi-prop="children"><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>animation</span></span><span role="img" aria-label="chevron_right_stroked" class="semi-icon semi-icon-default semi-icon-chevron_right_stroked" style="color:var(--semi-color-text-2);font-size:12px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.9 20.17a1.25 1.25 0 0 1-.07-1.77l5.71-6.15-5.7-6.15a1.25 1.25 0 0 1 1.83-1.7l6.5 7c.44.48.44 1.22 0 1.7l-6.5 7c-.47.5-1.26.54-1.77.07Z" fill="currentColor"></path></svg></span><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>src/transition_variable/index.scss</span></span></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:7px;column-gap:7px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">Code</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">预览</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div></div></div></div>
<h2 class="rp-toc-include" id="可变字体"><a href="#可变字体" class="rp-header-anchor rp-link" aria-hidden="true">#</a>可变字体</h2>
<p>Lynx 3.4 新增了对可变字体的支持，开发者现在可以通过 <code>font-variation-settings</code> 和 <code>font-optical-sizing</code> 等底层 CSS 属性，对字体样式进行更精细的微调。
阅读<a href="https://developer.mozilla.org/zh-CN/docs/Web/CSS/CSS_fonts/Variable_fonts_guide" target="_blank" rel="noopener noreferrer" class="rp-link">MDN</a> 和 <a href="https://web.dev/articles/variable-fonts" target="_blank" rel="noopener noreferrer" class="rp-link">web.dev</a> 了解可变字体技术细节。</p>
<div class="box-LTvjqb   "><div class="container-qARFbv"><div class="content-Yzcw9o"><div class="split-pane" style="display:flex;flex-direction:row;width:100%;height:100%;min-height:0"><div class="split-pane__first" style="flex:1;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="code-wrap-jURSQJ"><div class="code-tab-container-5FhsBL"><div class="code-view-container-lgwabm "><div class="code-kbFEhm"><div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables" data-lang="tsx"><code style="padding:1rem 1.25rem"></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div><div role="separator" class="split-pane__divider" tabindex="0" style="flex:0 0 10px;cursor:col-resize;display:flex;align-items:center;justify-content:center;position:relative;z-index:1;touch-action:none" aria-orientation="vertical"><span role="img" aria-label="handle" class="semi-icon semi-icon-default semi-icon-handle" style="font-size:10px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M9 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M9 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M11 19a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M17 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></svg></span></div><div class="split-pane__second" style="flex:0 0 auto;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="preview-wrap-un0XJO"><div class="preview-wrap-content-TYo6um"><div class="preview-header-zYAZlz"><div style="width:24px;flex-shrink:0"></div><div class="semi-radioGroup semi-radioGroup-wrapper semi-radioGroup-buttonRadio" style="display:flex;flex:1;min-width:0;justify-content:center"><div style="width:100%;height:32px"></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div><div class="preview-body-YE5PSF"><div class="preview-panel-amOf1r" style="z-index:1;visibility:visible;pointer-events:auto"><div style="min-height:0px;display:flex;width:100%;height:100%;align-items:center;justify-content:center"><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/plugin/static/variable-font.jpeg" alt="" loading="eager" decoding="async" style="max-width:100%;max-height:100%;object-fit:contain"/></div></div></div></div></div></div></div></div><div class="footer-KtlqMk"><div class="semi-space semi-space-align-center semi-space-horizontal" style="max-width:100%;overflow:hidden;white-space:nowrap;row-gap:2px;column-gap:2px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><span role="img" aria-label="list" class="semi-icon semi-icon-default semi-icon-list" style="color:var(--semi-color-text-2)"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><g opacity="0.99"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9.5 3a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM8 11.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 11.5Zm0 7c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 18.5Zm-2-7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-2 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></g></svg></span></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="overflow:hidden;row-gap:2px;column-gap:2px" x-semi-prop="children"><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>text</span></span><span role="img" aria-label="chevron_right_stroked" class="semi-icon semi-icon-default semi-icon-chevron_right_stroked" style="color:var(--semi-color-text-2);font-size:12px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.9 20.17a1.25 1.25 0 0 1-.07-1.77l5.71-6.15-5.7-6.15a1.25 1.25 0 0 1 1.83-1.7l6.5 7c.44.48.44 1.22 0 1.7l-6.5 7c-.47.5-1.26.54-1.77.07Z" fill="currentColor"></path></svg></span><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>src/variable_font/index.tsx</span></span></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:7px;column-gap:7px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">Code</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">预览</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div></div></div></div>
<h2 class="rp-toc-include" id="升级指南"><a href="#升级指南" class="rp-header-anchor rp-link" aria-hidden="true">#</a>升级指南</h2>
<p>参照官网<a href="/zh/guide/start/integrate-with-existing-apps.html" class="rp-link">接入 Lynx 到现有应用</a>，更新 Lynx 以及 LynxService 依赖版本，完成 Lynx 3.4 版本升级。</p><!--/$-->]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lynx 3.2 发布公告]]></title>
            <link>https://lynxjs.org/zh/blog/lynx-3-2</link>
            <guid isPermaLink="false">/zh/blog/lynx-3-2</guid>
            <pubDate>Wed, 14 May 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[Lynx 3.2 对框架、引擎和工具进行了全面更新，包括 ReactLynx 测试工具、`llms.txt` 支持、Grid 布局新特性、对 `<list>` 和 `<text>` 的优化等。]]></description>
            <content:encoded><![CDATA[<h1 class="rp-toc-include" id="lynx-32-发布公告"><span>Lynx 3.2 发布公告</span><a href="#lynx-32-发布公告" class="rp-header-anchor rp-link" aria-hidden="true">#</a> </h1><div class="rp-not-doc rp-llms-container"><button class="rp-not-doc rp-llms-button rp-llms-copy-button"><div class="rp-llms-copy-button__icon-wrapper"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg></div><span>复制 Markdown</span></button><button class="rp-llms-button rp-llms-view-options__trigger "><svg width="1em" height="1em" viewBox="0 0 32 32" class="rp-llms-view-options__arrow "><path fill="currentColor" d="M16 22 6 12l1.4-1.4 8.6 8.6 8.6-8.6L26 12z"></path></svg></button></div><!--$--><a href="/next/zh/blog/" class="backLink-lQPNH7">← <!-- -->所有文章</a><div class="blogHeader-ZKfIZ_"><span class="date-aB5gkw">2025年5月14日</span><div class="blog-avatar-frame-G1eJ1T avatars-aaQ1Kf"><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/toretto-wt.png" alt="石文涛"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">石文涛</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="14" viewBox="0 0 300 271" class="icon-x-XK0uad"><path fill="currentColor" d="M236 0h46L181 115l118 156h-92.6l-72.5-94.8-83 94.8h-46l107-123L-1.1 0h94.9l65.5 86.6zm-16.1 244h25.5L80.4 26H53z"></path></svg></span><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">渲染主管 @ Lynx</span></div></span><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/lynx-family.png" alt="Lynx 团队"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">Lynx 团队</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="14" viewBox="0 0 300 271" class="icon-x-XK0uad"><path fill="currentColor" d="M236 0h46L181 115l118 156h-92.6l-72.5-94.8-83 94.8h-46l107-123L-1.1 0h94.9l65.5 86.6zm-16.1 244h25.5L80.4 26H53z"></path></svg></span><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">lynxjs.org</span></div></span></div><div class="rp-not-doc rp-llms-container"><button class="rp-not-doc rp-llms-button rp-llms-copy-button"><div class="rp-llms-copy-button__icon-wrapper"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg></div><span>复制 Markdown</span></button><button class="rp-llms-button rp-llms-view-options__trigger "><svg width="1em" height="1em" viewBox="0 0 32 32" class="rp-llms-view-options__arrow "><path fill="currentColor" d="M16 22 6 12l1.4-1.4 8.6 8.6 8.6-8.6L26 12z"></path></svg></button></div></div>
<p><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/blog/news-in-3.2/lynx-3-2.png" alt="lynx-in-3-2"/></p>
<p>今天，我很高兴地与大家分享我们自 2025 年 3 月<a href="/next/zh/blog/lynx-unlock-native-for-more.html" class="rp-link">开源</a>以来第一个稳定版本 Lynx 3.2，现已正式发布！</p>
<p>Lynx 3.2 对框架、引擎和工具进行了全面更新，包括 <a href="#reactlynx-testing-library" class="rp-link">ReactLynx 测试工具</a>、<a href="#%E7%BD%91%E7%AB%99-llmstxt-%E6%94%AF%E6%8C%81" class="rp-link"><code>llms.txt</code> 支持</a>、<a href="#css-%E7%BD%91%E6%A0%BC%E5%B8%83%E5%B1%80-minmax-max-content-fit-content" class="rp-link">Grid 布局新特性</a>、对 <a href="#list-%E5%85%83%E4%BB%B6%E4%BC%98%E5%8C%96" class="rp-link"><code>&lt;list&gt;</code></a> 和 <a href="#text-%E5%8F%AF%E8%A2%AB%E5%AE%9A%E5%88%B6%E4%B8%BA%E8%B7%A8%E8%8A%82%E7%82%B9%E9%80%89%E6%8B%A9" class="rp-link"><code>&lt;text&gt;</code></a> 的优化等等，旨在为开发者带来更熟悉的开发体验和更多的能力。该版本拥有来自 61 位贡献者（包括一些首次贡献者）的超过 <a href="https://github.com/lynx-family/lynx/releases/" target="_blank" rel="noopener noreferrer" class="rp-link">296 次提交</a>。让我们一起来看看有哪些新特性！</p>
<h2 class="rp-toc-include" id="reactlynx-testing-library"><a href="#reactlynx-testing-library" class="rp-header-anchor rp-link" aria-hidden="true">#</a>ReactLynx Testing Library</h2>
<p>我们将 JavaScript 社区广受欢迎的 UI 组件测试工具 <a href="https://testing-library.com/" target="_blank" rel="noopener noreferrer" class="rp-link">Testing Library</a> 引入到了 Lynx 中。新增的 <a href="/zh/api/reactlynx-testing-library/index.html" class="rp-link"><code>@lynx-js/react/testing-library/</code></a> 包提供了 <a href="/zh/api/reactlynx-testing-library/Function.render.html" class="rp-link"><code>render</code></a> 等测试工具函数。同时，它也可以与官方的 <a href="https://github.com/testing-library/jest-dom" target="_blank" rel="noopener noreferrer" class="rp-link"><code>@testing-library/jest-dom</code></a> 搭配使用，让你能够使用 <code>toBeInTheDocument</code> 等匹配器来验证元素是否存在及其行为表现。</p>
<div class="rp-codeblock language-js"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables has-highlighted" style="background-color:var(--shiki-background);color:var(--shiki-foreground)" tabindex="0" data-lang="js"><code><span class="line"><span style="color:var(--shiki-token-keyword)">import</span><span style="color:var(--shiki-token-string-expression)"> &#x27;@testing-library/jest-dom&#x27;</span><span style="color:var(--shiki-foreground)">;</span></span>
<span class="line"><span style="color:var(--shiki-token-keyword)">import</span><span style="color:var(--shiki-foreground)"> { expect</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-foreground)"> it } </span><span style="color:var(--shiki-token-keyword)">from</span><span style="color:var(--shiki-token-string-expression)"> &#x27;vitest&#x27;</span><span style="color:var(--shiki-foreground)">;</span></span>
<span class="line"><span style="color:var(--shiki-token-keyword)">import</span><span style="color:var(--shiki-foreground)"> { render } </span><span style="color:var(--shiki-token-keyword)">from</span><span style="color:var(--shiki-token-string-expression)"> &#x27;@lynx-js/react/testing-library&#x27;</span><span style="color:var(--shiki-foreground)">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:var(--shiki-token-function)">it</span><span style="color:var(--shiki-foreground)">(</span><span style="color:var(--shiki-token-string-expression)">&#x27;renders&#x27;</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-foreground)"> () </span><span style="color:var(--shiki-token-keyword)">=&gt;</span><span style="color:var(--shiki-foreground)"> {</span></span>
<span class="line"><span style="color:var(--shiki-token-keyword)">  const</span><span style="color:var(--shiki-token-function)"> Wrapper</span><span style="color:var(--shiki-token-keyword)"> =</span><span style="color:var(--shiki-foreground)"> ({ children }) </span><span style="color:var(--shiki-token-keyword)">=&gt;</span><span style="color:var(--shiki-foreground)"> (</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">    &lt;</span><span style="color:var(--shiki-token-string-expression)">view</span><span style="color:var(--shiki-token-function)"> data-testid</span><span style="color:var(--shiki-token-keyword)">=</span><span style="color:var(--shiki-token-string-expression)">&quot;wrapper&quot;</span><span style="color:var(--shiki-foreground)">&gt;{children}&lt;/</span><span style="color:var(--shiki-token-string-expression)">view</span><span style="color:var(--shiki-foreground)">&gt;</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">  );</span></span>
<span class="line"><span style="color:var(--shiki-token-keyword)">  const</span><span style="color:var(--shiki-token-function)"> Comp</span><span style="color:var(--shiki-token-keyword)"> =</span><span style="color:var(--shiki-foreground)"> () </span><span style="color:var(--shiki-token-keyword)">=&gt;</span><span style="color:var(--shiki-foreground)"> (</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">    &lt;</span><span style="color:var(--shiki-token-string-expression)">view</span><span style="color:var(--shiki-token-function)"> data-testid</span><span style="color:var(--shiki-token-keyword)">=</span><span style="color:var(--shiki-token-string-expression)">&quot;inner&quot;</span><span style="color:var(--shiki-token-function)"> style</span><span style="color:var(--shiki-token-keyword)">=</span><span style="color:var(--shiki-token-string-expression)">&quot;background-color: yellow;&quot;</span><span style="color:var(--shiki-foreground)"> /&gt;</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">  );</span></span>
<span class="line"><span style="color:var(--shiki-token-keyword)">  const</span><span style="color:var(--shiki-foreground)"> { </span><span style="color:var(--shiki-token-constant)">container</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-token-constant)"> getByTestId</span><span style="color:var(--shiki-foreground)"> } </span><span style="color:var(--shiki-token-keyword)">=</span><span style="color:var(--shiki-token-function)"> render</span><span style="color:var(--shiki-foreground)">(&lt;</span><span style="color:var(--shiki-token-constant)">Comp</span><span style="color:var(--shiki-foreground)"> /&gt;</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-foreground)"> { wrapper</span><span style="color:var(--shiki-token-keyword)">:</span><span style="color:var(--shiki-foreground)"> Wrapper });</span></span>
<span class="line"></span>
<span class="line"><span style="color:var(--shiki-token-function)">  expect</span><span style="color:var(--shiki-foreground)">(</span><span style="color:var(--shiki-token-function)">getByTestId</span><span style="color:var(--shiki-foreground)">(</span><span style="color:var(--shiki-token-string-expression)">&#x27;wrapper&#x27;</span><span style="color:var(--shiki-foreground)">))</span><span style="color:var(--shiki-token-function)">.toBeInTheDocument</span><span style="color:var(--shiki-foreground)">();</span></span>
<span class="line"><span style="color:var(--shiki-token-function)">  expect</span><span style="color:var(--shiki-foreground)">(</span><span style="color:var(--shiki-token-constant)">container</span><span style="color:var(--shiki-foreground)">.firstChild)</span><span style="color:var(--shiki-token-function)">.toMatchInlineSnapshot</span><span style="color:var(--shiki-foreground)">(</span><span style="color:var(--shiki-token-string-expression)">`</span></span>
<span class="line"><span style="color:var(--shiki-token-string-expression)">    &lt;view data-testid=&quot;wrapper&quot;&gt;</span></span>
<span class="line"><span style="color:var(--shiki-token-string-expression)">      &lt;view data-testid=&quot;inner&quot; style=&quot;background-color: yellow;&quot;/&gt;</span></span>
<span class="line"><span style="color:var(--shiki-token-string-expression)">    &lt;/view&gt;</span></span>
<span class="line"><span style="color:var(--shiki-token-string-expression)">  `</span><span style="color:var(--shiki-foreground)">);</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">});</span></span></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div>
<p><a href="/zh/react/reactlynx-testing-library.html" class="rp-link">了解更多关于 ReactLynx Testing Library 的使用指南</a>。</p>
<h2 class="rp-toc-include" id="网站-llmstxt-支持"><a href="#网站-llmstxt-支持" class="rp-header-anchor rp-link" aria-hidden="true">#</a>网站: <code>llms.txt</code> 支持</h2>
<p>通过升级到 <a href="https://v2.rspress.dev/" target="_blank" rel="noopener noreferrer" class="rp-link">Rspress v2</a> 并利用新的 <a href="https://x.com/rspack_dev/status/1917844832149725695" target="_blank" rel="noopener noreferrer" class="rp-link">LLM 插件</a>，Lynx 网站现已完全支持 <a href="https://lynxjs.org/llms.txt" target="_blank" rel="noopener noreferrer" class="rp-link">https://lynxjs.org/llms.txt</a> 和 <a href="https://lynxjs.org/llms-full.txt" target="_blank" rel="noopener noreferrer" class="rp-link">https://lynxjs.org/llms-full.txt</a>，以帮助 AI 更好地理解 Lynx，提升你使用 AI 辅助编程的体验。对于每个页面，你都可以通过将 <code>.html</code> 扩展名替换为 <code>.md</code> 来获取原始的 markdown 文件。</p>
<p><a href="https://llmstxt.org/" target="_blank" rel="noopener noreferrer" class="rp-link">了解更多关于 <code>llms.txt</code> 的信息</a>。</p>
<h2 class="rp-toc-include" id="css-网格布局-minmax-max-content-fit-content"><a href="#css-网格布局-minmax-max-content-fit-content" class="rp-header-anchor rp-link" aria-hidden="true">#</a>CSS 网格布局: <code>minmax()</code>, <code>max-content</code>, <code>fit-content</code> <span class="rp-badge rp-badge--tip">Web 友好</span></h2>
<p>Lynx 3.2 添加了三个 CSS 函数 <code>minmax()</code>、<code>max-content</code> 和 <code>fit-content</code>，以帮助你在 <a href="/zh/guide/ui/layout/grid-layout.html" class="rp-link">CSS 网格布局</a>中更好地控制网格大小。你可以在 <code>grid-template-columns</code>、<code>grid-template-rows</code>、<code>grid-auto-columns</code> 和 <code>grid-auto-rows</code> 中使用它们。</p>
<p>让我们来看一个三列布局的例子，使用 <code>grid-template-columns: 20% max-content minmax(50px, max-content)</code> 来实现：</p>
<ul>
<li>第一列固定为容器宽度的 20%</li>
<li>第二列宽度自动适应其内容的最大宽度</li>
<li>第三列的宽度在最小 50px 和最大内容宽度之间动态调整，同时受容器宽度约束</li>
</ul>
<div class="box-LTvjqb   "><div class="container-qARFbv"><div class="content-Yzcw9o"><div class="split-pane" style="display:flex;flex-direction:row;width:100%;height:100%;min-height:0"><div class="split-pane__first" style="flex:1;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="code-wrap-jURSQJ"><div class="code-tab-container-5FhsBL"><div class="code-view-container-lgwabm "><div class="code-kbFEhm"><div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables" data-lang="tsx"><code style="padding:1rem 1.25rem"></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div><div role="separator" class="split-pane__divider" tabindex="0" style="flex:0 0 10px;cursor:col-resize;display:flex;align-items:center;justify-content:center;position:relative;z-index:1;touch-action:none" aria-orientation="vertical"><span role="img" aria-label="handle" class="semi-icon semi-icon-default semi-icon-handle" style="font-size:10px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M9 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M9 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M11 19a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M17 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></svg></span></div><div class="split-pane__second" style="flex:0 0 auto;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="preview-wrap-un0XJO"><div class="preview-wrap-content-TYo6um"><div class="preview-header-zYAZlz"><div style="width:24px;flex-shrink:0"></div><div class="semi-radioGroup semi-radioGroup-wrapper semi-radioGroup-buttonRadio" style="display:flex;flex:1;min-width:0;justify-content:center"><div style="width:100%;height:32px"></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div><div class="preview-body-YE5PSF"><div class="preview-panel-amOf1r" style="z-index:1;visibility:visible;pointer-events:auto"><div style="min-height:0px;display:flex;width:100%;height:100%;align-items:center;justify-content:center"><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/blog/news-in-3.2/grid-minmax.png" alt="" loading="eager" decoding="async" style="max-width:100%;max-height:100%;object-fit:contain"/></div></div></div></div></div></div></div></div><div class="footer-KtlqMk"><div class="semi-space semi-space-align-center semi-space-horizontal" style="max-width:100%;overflow:hidden;white-space:nowrap;row-gap:2px;column-gap:2px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><span role="img" aria-label="list" class="semi-icon semi-icon-default semi-icon-list" style="color:var(--semi-color-text-2)"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><g opacity="0.99"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9.5 3a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM8 11.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 11.5Zm0 7c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 18.5Zm-2-7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-2 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></g></svg></span></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="overflow:hidden;row-gap:2px;column-gap:2px" x-semi-prop="children"><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>css</span></span><span role="img" aria-label="chevron_right_stroked" class="semi-icon semi-icon-default semi-icon-chevron_right_stroked" style="color:var(--semi-color-text-2);font-size:12px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.9 20.17a1.25 1.25 0 0 1-.07-1.77l5.71-6.15-5.7-6.15a1.25 1.25 0 0 1 1.83-1.7l6.5 7c.44.48.44 1.22 0 1.7l-6.5 7c-.47.5-1.26.54-1.77.07Z" fill="currentColor"></path></svg></span><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>src/grid_layout/index.tsx</span></span></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:7px;column-gap:7px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">Code</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">预览</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div></div></div></div>
<h2 class="rp-toc-include" id="list-元件优化"><a href="#list-元件优化" class="rp-header-anchor rp-link" aria-hidden="true">#</a><code>&lt;list&gt;</code> 元件优化</h2>
<h3 class="rp-toc-include" id="使用-item-snap-进行滚动吸附"><a href="#使用-item-snap-进行滚动吸附" class="rp-header-anchor rp-link" aria-hidden="true">#</a>使用 <code>item-snap</code> 进行滚动吸附</h3>
<p>使用 <a href="/zh/api/elements/built-in/list.html#item-snap" class="rp-link"><code>item-snap</code> 滚动吸附</a> 在 Lynx 3.2 中已经成为一个稳定特性。它可以在所有平台上提供了流畅且易用的分页功能，使开发者能够创建具有精确滚动交互的信息流或轮播图。</p>
<div class="box-LTvjqb   "><div class="container-qARFbv"><div class="content-Yzcw9o"><div class="split-pane" style="display:flex;flex-direction:row;width:100%;height:100%;min-height:0"><div class="split-pane__first" style="flex:1;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="code-wrap-jURSQJ"><div class="code-tab-container-5FhsBL"><div class="code-view-container-lgwabm "><div class="code-kbFEhm"><div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables" data-lang="tsx"><code style="padding:1rem 1.25rem"></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div><div role="separator" class="split-pane__divider" tabindex="0" style="flex:0 0 10px;cursor:col-resize;display:flex;align-items:center;justify-content:center;position:relative;z-index:1;touch-action:none" aria-orientation="vertical"><span role="img" aria-label="handle" class="semi-icon semi-icon-default semi-icon-handle" style="font-size:10px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M9 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M9 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M11 19a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M17 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></svg></span></div><div class="split-pane__second" style="flex:0 0 auto;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="preview-wrap-un0XJO"><div class="preview-wrap-content-TYo6um"><div class="preview-header-zYAZlz"><div style="width:24px;flex-shrink:0"></div><div class="semi-radioGroup semi-radioGroup-wrapper semi-radioGroup-buttonRadio" style="display:flex;flex:1;min-width:0;justify-content:center"><div style="width:100%;height:32px"></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div><div class="preview-body-YE5PSF"><div class="preview-panel-amOf1r" style="z-index:1;visibility:visible;pointer-events:auto"><div style="min-height:0px;display:flex;width:100%;height:100%;align-items:center;justify-content:center"><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/blog/news-in-3.2/list-snap.gif" alt="" loading="eager" decoding="async" style="max-width:100%;max-height:100%;object-fit:contain"/></div></div></div></div></div></div></div></div><div class="footer-KtlqMk"><div class="semi-space semi-space-align-center semi-space-horizontal" style="max-width:100%;overflow:hidden;white-space:nowrap;row-gap:2px;column-gap:2px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><span role="img" aria-label="list" class="semi-icon semi-icon-default semi-icon-list" style="color:var(--semi-color-text-2)"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><g opacity="0.99"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9.5 3a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM8 11.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 11.5Zm0 7c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 18.5Zm-2-7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-2 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></g></svg></span></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="overflow:hidden;row-gap:2px;column-gap:2px" x-semi-prop="children"><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>list</span></span><span role="img" aria-label="chevron_right_stroked" class="semi-icon semi-icon-default semi-icon-chevron_right_stroked" style="color:var(--semi-color-text-2);font-size:12px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.9 20.17a1.25 1.25 0 0 1-.07-1.77l5.71-6.15-5.7-6.15a1.25 1.25 0 0 1 1.83-1.7l6.5 7c.44.48.44 1.22 0 1.7l-6.5 7c-.47.5-1.26.54-1.77.07Z" fill="currentColor"></path></svg></span><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>src/horizontal-snap/index.tsx</span></span></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:7px;column-gap:7px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">Code</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">预览</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div></div></div></div>
<p><a href="/zh/api/elements/built-in/list.html#%E5%88%A9%E7%94%A8-item-snap-%E5%AE%9E%E7%8E%B0%E5%88%86%E9%A1%B5%E6%BB%9A%E5%8A%A8" class="rp-link">学习如何使用 <code>item-snap</code> 实现分页。</a></p>
<h3 class="rp-toc-include" id="新增-list-item-的-z-index-支持"><a href="#新增-list-item-的-z-index-支持" class="rp-header-anchor rp-link" aria-hidden="true">#</a>新增 <code>&lt;list-item&gt;</code> 的 <code>z-index</code> 支持</h3>
<p>增加对 <code>&lt;list-item&gt;</code> 上 <a href="/zh/api/css/properties/z-index.html" class="rp-link"><strong>z-index</strong></a> 的支持，能够更方便的调整列表项的视图层级。</p>
<div class="box-LTvjqb   "><div class="container-qARFbv"><div class="content-Yzcw9o"><div class="split-pane" style="display:flex;flex-direction:row;width:100%;height:100%;min-height:0"><div class="split-pane__first" style="flex:1;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="code-wrap-jURSQJ"><div class="code-tab-container-5FhsBL"><div class="code-view-container-lgwabm "><div class="code-kbFEhm"><div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables" data-lang="tsx"><code style="padding:1rem 1.25rem"></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div><div role="separator" class="split-pane__divider" tabindex="0" style="flex:0 0 10px;cursor:col-resize;display:flex;align-items:center;justify-content:center;position:relative;z-index:1;touch-action:none" aria-orientation="vertical"><span role="img" aria-label="handle" class="semi-icon semi-icon-default semi-icon-handle" style="font-size:10px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M9 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M9 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M11 19a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M17 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></svg></span></div><div class="split-pane__second" style="flex:0 0 auto;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="preview-wrap-un0XJO"><div class="preview-wrap-content-TYo6um"><div class="preview-header-zYAZlz"><div style="width:24px;flex-shrink:0"></div><div class="semi-radioGroup semi-radioGroup-wrapper semi-radioGroup-buttonRadio" style="display:flex;flex:1;min-width:0;justify-content:center"><div style="width:100%;height:32px"></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div><div class="preview-body-YE5PSF"><div class="preview-panel-amOf1r" style="z-index:1;visibility:visible;pointer-events:auto"><div style="min-height:0px;display:flex;width:100%;height:100%;align-items:center;justify-content:center"><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/blog/news-in-3.2/list-z-index.gif" alt="" loading="eager" decoding="async" style="max-width:100%;max-height:100%;object-fit:contain"/></div></div></div></div></div></div></div></div><div class="footer-KtlqMk"><div class="semi-space semi-space-align-center semi-space-horizontal" style="max-width:100%;overflow:hidden;white-space:nowrap;row-gap:2px;column-gap:2px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><span role="img" aria-label="list" class="semi-icon semi-icon-default semi-icon-list" style="color:var(--semi-color-text-2)"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><g opacity="0.99"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9.5 3a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM8 11.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 11.5Zm0 7c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 18.5Zm-2-7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-2 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></g></svg></span></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="overflow:hidden;row-gap:2px;column-gap:2px" x-semi-prop="children"><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>list</span></span><span role="img" aria-label="chevron_right_stroked" class="semi-icon semi-icon-default semi-icon-chevron_right_stroked" style="color:var(--semi-color-text-2);font-size:12px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.9 20.17a1.25 1.25 0 0 1-.07-1.77l5.71-6.15-5.7-6.15a1.25 1.25 0 0 1 1.83-1.7l6.5 7c.44.48.44 1.22 0 1.7l-6.5 7c-.47.5-1.26.54-1.77.07Z" fill="currentColor"></path></svg></span><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>src/zIndex/index.tsx</span></span></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:7px;column-gap:7px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">Code</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">预览</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div></div></div></div>
<h2 class="rp-toc-include" id="text-可被定制为跨节点选择"><a href="#text-可被定制为跨节点选择" class="rp-header-anchor rp-link" aria-hidden="true">#</a><code>&lt;text&gt;</code> 可被定制为跨节点选择 <span class="rp-badge rp-badge--tip">Web 友好</span></h2>
<p>在长文章场景下，通过新增的 <a href="/zh/api/elements/built-in/text.html#custom-text-selection" class="rp-link"><code>custom-text-selection</code></a> 特性，你可以 <a href="/zh/api/elements/built-in/text.html#crosstext-selection-and-copying" class="rp-link">自定义实现跨文本节点的选择和复制功能</a>，使文本选择体验更接近 Web。</p>
<div class="box-LTvjqb   "><div class="container-qARFbv"><div class="content-Yzcw9o"><div class="split-pane" style="display:flex;flex-direction:row;width:100%;height:100%;min-height:0"><div class="split-pane__first" style="flex:1;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="code-wrap-jURSQJ"><div class="code-tab-container-5FhsBL"><div class="code-view-container-lgwabm "><div class="code-kbFEhm"><div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables" data-lang="tsx"><code style="padding:1rem 1.25rem"></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div><div role="separator" class="split-pane__divider" tabindex="0" style="flex:0 0 10px;cursor:col-resize;display:flex;align-items:center;justify-content:center;position:relative;z-index:1;touch-action:none" aria-orientation="vertical"><span role="img" aria-label="handle" class="semi-icon semi-icon-default semi-icon-handle" style="font-size:10px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M9 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M9 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M11 19a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M17 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></svg></span></div><div class="split-pane__second" style="flex:0 0 auto;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="preview-wrap-un0XJO"><div class="preview-wrap-content-TYo6um"><div class="preview-header-zYAZlz"><div style="width:24px;flex-shrink:0"></div><div class="semi-radioGroup semi-radioGroup-wrapper semi-radioGroup-buttonRadio" style="display:flex;flex:1;min-width:0;justify-content:center"><div style="width:100%;height:32px"></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div><div class="preview-body-YE5PSF"><div class="preview-panel-amOf1r" style="z-index:1;visibility:visible;pointer-events:auto"><div style="min-height:0px;display:flex;width:100%;height:100%;align-items:center;justify-content:center"><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/blog/news-in-3.2/cross-text-select.gif" alt="" loading="eager" decoding="async" style="max-width:100%;max-height:100%;object-fit:contain"/></div></div></div></div></div></div></div></div><div class="footer-KtlqMk"><div class="semi-space semi-space-align-center semi-space-horizontal" style="max-width:100%;overflow:hidden;white-space:nowrap;row-gap:2px;column-gap:2px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><span role="img" aria-label="list" class="semi-icon semi-icon-default semi-icon-list" style="color:var(--semi-color-text-2)"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><g opacity="0.99"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9.5 3a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM8 11.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 11.5Zm0 7c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 18.5Zm-2-7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-2 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></g></svg></span></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="overflow:hidden;row-gap:2px;column-gap:2px" x-semi-prop="children"><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>text</span></span><span role="img" aria-label="chevron_right_stroked" class="semi-icon semi-icon-default semi-icon-chevron_right_stroked" style="color:var(--semi-color-text-2);font-size:12px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.9 20.17a1.25 1.25 0 0 1-.07-1.77l5.71-6.15-5.7-6.15a1.25 1.25 0 0 1 1.83-1.7l6.5 7c.44.48.44 1.22 0 1.7l-6.5 7c-.47.5-1.26.54-1.77.07Z" fill="currentColor"></path></svg></span><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>src/cross_text_selection/index.tsx</span></span></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:7px;column-gap:7px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">Code</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">预览</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div></div></div></div>
<h2 class="rp-toc-include" id="微任务"><a href="#微任务" class="rp-header-anchor rp-link" aria-hidden="true">#</a>微任务 <span class="rp-badge rp-badge--tip">Web 友好</span></h2>
<p>在 Lynx 3.2 之前，Lynx 并不支持微任务，以下代码的行为与Web 浏览器并不一致。Lynx 3.2 中支持了基于微任务的 <code>Promise</code>，并新增了 API <a href="/zh/api/lynx-api/lynx/lynx-queue-microtask.html" class="rp-link"><code>lynx.queueMicrotask</code></a>。</p>
<div class="rp-codeblock language-js"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables has-highlighted" style="background-color:var(--shiki-background);color:var(--shiki-foreground)" tabindex="0" data-lang="js"><code><span class="line"><span style="color:var(--shiki-token-function)">setTimeout</span><span style="color:var(--shiki-foreground)">(() </span><span style="color:var(--shiki-token-keyword)">=&gt;</span><span style="color:var(--shiki-foreground)"> {</span></span>
<span class="line"><span style="color:var(--shiki-token-constant)">  console</span><span style="color:var(--shiki-token-function)">.log</span><span style="color:var(--shiki-foreground)">(</span><span style="color:var(--shiki-token-string-expression)">&#x27;this is a timeout, will exec after&#x27;</span><span style="color:var(--shiki-foreground)">);</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">}</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-token-constant)"> 0</span><span style="color:var(--shiki-foreground)">);</span></span>
<span class="line"></span>
<span class="line"><span style="color:var(--shiki-token-constant)">Promise</span><span style="color:var(--shiki-token-function)">.resolve</span><span style="color:var(--shiki-foreground)">()</span><span style="color:var(--shiki-token-function)">.then</span><span style="color:var(--shiki-foreground)">((value) </span><span style="color:var(--shiki-token-keyword)">=&gt;</span><span style="color:var(--shiki-foreground)"> {</span></span>
<span class="line"><span style="color:var(--shiki-token-constant)">  console</span><span style="color:var(--shiki-token-function)">.log</span><span style="color:var(--shiki-foreground)">(</span><span style="color:var(--shiki-token-string-expression)">&#x27;this is a Promise, will exec before&#x27;</span><span style="color:var(--shiki-foreground)">);</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">});</span></span></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div>
<div class="rp-table-scroll-container rp-scrollbar"><table><thead><tr><th>3.2 之前 Lynx 运行结果</th><th>Chrome 运行结果</th></tr></thead><tbody><tr><td><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/blog/news-in-3.2/lynx-test-result.png" alt=""/></td><td><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/blog/news-in-3.2/chrome-test-result.png" alt=""/></td></tr></tbody></table></div>
<h2 class="rp-toc-include" id="console-api-完善"><a href="#console-api-完善" class="rp-header-anchor rp-link" aria-hidden="true">#</a><code>console</code> API 完善 <span class="rp-badge rp-badge--tip">Web 友好</span></h2>
<p>Lynx 3.2 进一步实现了大部分符合 <a href="https://developer.mozilla.org/en-US/docs/Web/API/console" target="_blank" rel="noopener noreferrer" class="rp-link">W3C 标准</a>的 <code>console</code> API，提供了更全面的调试体验。更多详情请参阅 <a href="/zh/api/lynx-api/global/console/assert.html" class="rp-link">API 参考</a>。</p>
<center><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/blog/news-in-3.2/lynx-console.gif" width="400" height="400" align="center"/></center>
<h2 class="rp-toc-include" id="rspeedy-rslib-与-rspack-13"><a href="#rspeedy-rslib-与-rspack-13" class="rp-header-anchor rp-link" aria-hidden="true">#</a>Rspeedy: Rslib 与 Rspack 1.3</h2>
<p>Rspeedy <a href="https://github.com/lynx-family/lynx-stack/discussions/482" target="_blank" rel="noopener noreferrer" class="rp-link">v0.9.0</a> 已发布，默认打包库使用 <a href="https://lib.rsbuild.dev/" target="_blank" rel="noopener noreferrer" class="rp-link">Rslib</a>，整体安装体积减少了超过 50%。同时该版本将 <a href="https://rspack.rs/" target="_blank" rel="noopener noreferrer" class="rp-link">Rspack</a> 升级至 <a href="https://rspack.rs/blog/announcing-1-3" target="_blank" rel="noopener noreferrer" class="rp-link">1.3</a> 带来了更多增强功能，例如更快的代码拆分、更小的打包体积、更低的内存消耗。此外，该版本还包含一些其他改进，如新增配置项等功能。有关这些更改的完整概述，请查看 <a href="https://github.com/lynx-family/lynx-stack/blob/main/packages/rspeedy/core/CHANGELOG.md#090" target="_blank" rel="noopener noreferrer" class="rp-link"><code>@lynx-js/rspeedy v0.9.0</code></a> 变更日志。</p>
<p>若要体验 Rspeedy v0.9.0 版本的新功能，您可以在 Rspeedy 项目中使用以下命令进行升级：</p>
<div class="rp-codeblock language-js"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables has-highlighted" style="background-color:var(--shiki-background);color:var(--shiki-foreground)" tabindex="0" data-lang="js"><code><span class="line"><span style="color:var(--shiki-foreground)">npx upgrade</span><span style="color:var(--shiki-token-keyword)">-</span><span style="color:var(--shiki-foreground)">rspeedy@latest</span></span></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div>
<h2 class="rp-toc-include" id="devtool-支持清晰度切换"><a href="#devtool-支持清晰度切换" class="rp-header-anchor rp-link" aria-hidden="true">#</a>DevTool 支持清晰度切换</h2>
<p>使用过 DevTool 的 Lynx 开发者会发现 DevTool 的左侧有一个投屏区域，用于镜像显示调试设备上的 Lynx 页面。在新的版本中新增了一个分辨率切换开关，可切换至高清 (HD) 或标清 (SD) 模式。当设备连接不稳定时，可使用标清模式减少数据传输带宽，使画面更流畅。</p>
<p>如要体验该功能，访问 <a href="https://github.com/lynx-family/lynx-devtool/releases" target="_blank" rel="noopener noreferrer" class="rp-link">DevTool Release 列表</a> 下载最新 Lynx DevTool 桌面应用程序。</p>
<center><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/blog/news-in-3.2/devtoolsopt.gif" width="800" height="800"/></center>
<h2 class="rp-toc-include" id="升级到-lynx-32"><a href="#升级到-lynx-32" class="rp-header-anchor rp-link" aria-hidden="true">#</a>升级到 Lynx 3.2</h2>
<h3 class="rp-toc-include" id="android"><a href="#android" class="rp-header-anchor rp-link" aria-hidden="true">#</a>Android</h3>
<p>参照官网<a href="/zh/guide/start/integrate-with-existing-apps.html?platform=ios" class="rp-link">接入 Lynx 到现有应用</a>，更新 Lynx 以及 LynxService 依赖版本，完成 Lynx 3.2 版本升级。</p>
<p>在工程的 <code>build.gradle</code> 或 <code>build.gradle.kts</code> 中，升级 Lynx 依赖至如下版本：</p>
<div class="rp-tabs"><div class="rp-tabs__label rp-tabs__label--no-scrollbar" style="justify-content:flex-start"><div class="rp-tabs__label__item rp-tabs__label__item--selected" data-index="0">build.gradle</div><div class="rp-tabs__label__item rp-tabs__label__item--not-selected" data-index="1">build.gradle.kts</div></div><div class="rp-tabs__content"><div class="rp-tabs__content__item rp-tabs__content__item--active" aria-hidden="false" data-index="0"><div class="rp-codeblock language-groovy"><div class="rp-codeblock__title">build.gradle</div><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables has-highlighted" style="background-color:var(--shiki-background);color:var(--shiki-foreground)" tabindex="0" data-lang="groovy" data-title="build.gradle"><code><span class="line"><span style="color:var(--shiki-foreground)">dependencies {</span></span>
<span class="line"><span style="color:var(--shiki-token-comment)">    // lynx dependencies</span></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">    implementation </span><span style="color:var(--shiki-token-string-expression)">&quot;org.lynxsdk.lynx:lynx:3.2.0&quot;</span></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">    implementation </span><span style="color:var(--shiki-token-string-expression)">&quot;org.lynxsdk.lynx:lynx-jssdk:3.2.0&quot;</span></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">    implementation </span><span style="color:var(--shiki-token-string-expression)">&quot;org.lynxsdk.lynx:lynx-trace:3.2.0&quot;</span></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">    implementation </span><span style="color:var(--shiki-token-string-expression)">&quot;org.lynxsdk.lynx:primjs:2.12.0&quot;</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">}</span></span></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div><div class="rp-tabs__content__item rp-tabs__content__item--hidden" aria-hidden="true" data-index="1"><div class="rp-codeblock language-groovy"><div class="rp-codeblock__title">build.gradle.kts</div><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables has-highlighted" style="background-color:var(--shiki-background);color:var(--shiki-foreground)" tabindex="0" data-lang="groovy" data-title="build.gradle.kts"><code><span class="line"><span style="color:var(--shiki-foreground)">dependencies {</span></span>
<span class="line"><span style="color:var(--shiki-token-comment)">    // lynx dependencies</span></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">    implementation(</span><span style="color:var(--shiki-token-string-expression)">&quot;org.lynxsdk.lynx:lynx:3.2.0&quot;</span><span style="color:var(--shiki-foreground)">)</span></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">    implementation(</span><span style="color:var(--shiki-token-string-expression)">&quot;org.lynxsdk.lynx:lynx-jssdk:3.2.0&quot;</span><span style="color:var(--shiki-foreground)">)</span></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">    implementation(</span><span style="color:var(--shiki-token-string-expression)">&quot;org.lynxsdk.lynx:lynx-trace:3.2.0&quot;</span><span style="color:var(--shiki-foreground)">)</span></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">    implementation(</span><span style="color:var(--shiki-token-string-expression)">&quot;org.lynxsdk.lynx:primjs:2.12.0&quot;</span><span style="color:var(--shiki-foreground)">)</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">}</span></span></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div>
<p>在工程的 <code>build.gradle</code> 或 <code>build.gradle.kts</code> 中，升级 LynxService 依赖至如下版本：</p>
<div class="rp-tabs"><div class="rp-tabs__label rp-tabs__label--no-scrollbar" style="justify-content:flex-start"><div class="rp-tabs__label__item rp-tabs__label__item--selected" data-index="0">build.gradle</div><div class="rp-tabs__label__item rp-tabs__label__item--not-selected" data-index="1">build.gradle.kts</div></div><div class="rp-tabs__content"><div class="rp-tabs__content__item rp-tabs__content__item--active" aria-hidden="false" data-index="0"><div class="code-fold-wrapper semi-always-light"><div dir="ltr" data-orientation="horizontal" class="w-full"><div data-state="active" data-orientation="horizontal" role="tabpanel" aria-labelledby="radix-:R6obaed:-trigger-example" id="radix-:R6obaed:-content-example" tabindex="0" class="ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 w-full overflow-hidden" style="animation-duration:0s"><div class="flex h-full w-full data-[panel-group-direction=vertical]:flex-col" style="display:flex;flex-direction:row;height:100%;overflow:hidden;width:100%" data-panel-group="" data-panel-group-direction="horizontal" data-panel-group-id=":Rmobaed:"><div class="" id=":R3mobaed:" style="flex-basis:0;flex-grow:75.0;flex-shrink:1;overflow:hidden;position:relative;aspect-ratio:7.111111111111111;height:360px" data-panel-group-id=":Rmobaed:" data-panel="" data-panel-id=":R3mobaed:" data-panel-size="75.0"><div class="codefold-scroll-area"><div class="code-in-tab"><div class="rp-codeblock language-groovy"><div class="rp-codeblock__title">build.gradle</div><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables has-highlighted" style="background-color:var(--shiki-background);color:var(--shiki-foreground)" tabindex="0" data-lang="groovy" data-title="build.gradle"><code><span class="line"><span style="color:var(--shiki-foreground)">dependencies {</span></span>
<span class="line"><span style="color:var(--shiki-token-comment)">    // lynx dependencies</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">    implementation </span><span style="color:var(--shiki-token-string-expression)">&quot;org.lynxsdk.lynx:lynx:3.2.0&quot;</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">    implementation </span><span style="color:var(--shiki-token-string-expression)">&quot;org.lynxsdk.lynx:lynx-jssdk:3.2.0&quot;</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">    implementation </span><span style="color:var(--shiki-token-string-expression)">&quot;org.lynxsdk.lynx:lynx-trace:3.2.0&quot;</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">    implementation </span><span style="color:var(--shiki-token-string-expression)">&quot;org.lynxsdk.lynx:primjs:2.12.0&quot;</span></span>
<span class="line"></span>
<span class="line highlighted"><span style="color:var(--shiki-token-comment)">    // integrating image-service</span></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">    implementation </span><span style="color:var(--shiki-token-string-expression)">&quot;org.lynxsdk.lynx:lynx-service-image:3.2.0&quot;</span></span>
<span class="line highlighted"></span>
<span class="line highlighted"><span style="color:var(--shiki-token-comment)">    // image-service dependencies, if not added, images cannot be loaded; if the host APP needs to use other image libraries, you can customize the image-service and remove this dependency</span></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">    implementation </span><span style="color:var(--shiki-token-string-expression)">&quot;com.facebook.fresco:fresco:2.3.0&quot;</span></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">    implementation </span><span style="color:var(--shiki-token-string-expression)">&quot;com.facebook.fresco:animated-gif:2.3.0&quot;</span></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">    implementation </span><span style="color:var(--shiki-token-string-expression)">&quot;com.facebook.fresco:animated-webp:2.3.0&quot;</span></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">    implementation </span><span style="color:var(--shiki-token-string-expression)">&quot;com.facebook.fresco:webpsupport:2.3.0&quot;</span></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">    implementation </span><span style="color:var(--shiki-token-string-expression)">&quot;com.facebook.fresco:animated-base:2.3.0&quot;</span></span>
<span class="line highlighted"></span>
<span class="line highlighted"><span style="color:var(--shiki-token-comment)">    // integrating log-service</span></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">    implementation </span><span style="color:var(--shiki-token-string-expression)">&quot;org.lynxsdk.lynx:lynx-service-log:3.2.0&quot;</span></span>
<span class="line highlighted"></span>
<span class="line highlighted"><span style="color:var(--shiki-token-comment)">    // integrating http-service</span></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">    implementation </span><span style="color:var(--shiki-token-string-expression)">&quot;org.lynxsdk.lynx:lynx-service-http:3.2.0&quot;</span></span>
<span class="line highlighted"></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">    implementation </span><span style="color:var(--shiki-token-string-expression)">&quot;com.squareup.okhttp3:okhttp:4.9.0&quot;</span></span>
<span class="line"></span>
<span class="line"><span style="color:var(--shiki-foreground)">}</span></span></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div></div></div></div><div class="rp-tabs__content__item rp-tabs__content__item--hidden" aria-hidden="true" data-index="1"><div class="code-fold-wrapper semi-always-light"><div dir="ltr" data-orientation="horizontal" class="w-full"><div data-state="active" data-orientation="horizontal" role="tabpanel" aria-labelledby="radix-:Raobaed:-trigger-example" id="radix-:Raobaed:-content-example" tabindex="0" class="ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 w-full overflow-hidden" style="animation-duration:0s"><div class="flex h-full w-full data-[panel-group-direction=vertical]:flex-col" style="display:flex;flex-direction:row;height:100%;overflow:hidden;width:100%" data-panel-group="" data-panel-group-direction="horizontal" data-panel-group-id=":Rqobaed:"><div class="" id=":R3qobaed:" style="flex-basis:0;flex-grow:75.0;flex-shrink:1;overflow:hidden;position:relative;aspect-ratio:7.111111111111111;height:360px" data-panel-group-id=":Rqobaed:" data-panel="" data-panel-id=":R3qobaed:" data-panel-size="75.0"><div class="codefold-scroll-area"><div class="code-in-tab"><div class="rp-codeblock language-groovy"><div class="rp-codeblock__title">build.gradle.kts</div><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables has-highlighted" style="background-color:var(--shiki-background);color:var(--shiki-foreground)" tabindex="0" data-lang="groovy" data-title="build.gradle.kts"><code><span class="line"><span style="color:var(--shiki-foreground)">dependencies {</span></span>
<span class="line"><span style="color:var(--shiki-token-comment)">    // lynx dependencies</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">    implementation(</span><span style="color:var(--shiki-token-string-expression)">&quot;org.lynxsdk.lynx:lynx:3.2.0&quot;</span><span style="color:var(--shiki-foreground)">)</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">    implementation(</span><span style="color:var(--shiki-token-string-expression)">&quot;org.lynxsdk.lynx:lynx-jssdk:3.2.0&quot;</span><span style="color:var(--shiki-foreground)">)</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">    implementation(</span><span style="color:var(--shiki-token-string-expression)">&quot;org.lynxsdk.lynx:lynx-trace:3.2.0&quot;</span><span style="color:var(--shiki-foreground)">)</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">    implementation(</span><span style="color:var(--shiki-token-string-expression)">&quot;org.lynxsdk.lynx:primjs:2.12.0&quot;</span><span style="color:var(--shiki-foreground)">)</span></span>
<span class="line"></span>
<span class="line highlighted"><span style="color:var(--shiki-token-comment)">    // integrating image-service</span></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">    implementation(</span><span style="color:var(--shiki-token-string-expression)">&quot;org.lynxsdk.lynx:lynx-service-image:3.2.0-&quot;</span><span style="color:var(--shiki-foreground)">)</span></span>
<span class="line highlighted"></span>
<span class="line highlighted"><span style="color:var(--shiki-token-comment)">    // image-service dependencies, if not added, images cannot be loaded; if the host APP needs to use other image libraries, you can customize the image-service and remove this dependency</span></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">    implementation(</span><span style="color:var(--shiki-token-string-expression)">&quot;com.facebook.fresco:fresco:2.3.0&quot;</span><span style="color:var(--shiki-foreground)">)</span></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">    implementation(</span><span style="color:var(--shiki-token-string-expression)">&quot;com.facebook.fresco:animated-gif:2.3.0&quot;</span><span style="color:var(--shiki-foreground)">)</span></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">    implementation(</span><span style="color:var(--shiki-token-string-expression)">&quot;com.facebook.fresco:animated-webp:2.3.0&quot;</span><span style="color:var(--shiki-foreground)">)</span></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">    implementation(</span><span style="color:var(--shiki-token-string-expression)">&quot;com.facebook.fresco:webpsupport:2.3.0&quot;</span><span style="color:var(--shiki-foreground)">)</span></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">    implementation(</span><span style="color:var(--shiki-token-string-expression)">&quot;com.facebook.fresco:animated-base:2.3.0&quot;</span><span style="color:var(--shiki-foreground)">)</span></span>
<span class="line highlighted"></span>
<span class="line highlighted"><span style="color:var(--shiki-token-comment)">    // integrating log-service</span></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">    implementation(</span><span style="color:var(--shiki-token-string-expression)">&quot;org.lynxsdk.lynx:lynx-service-log:3.2.0&quot;</span><span style="color:var(--shiki-foreground)">)</span></span>
<span class="line highlighted"></span>
<span class="line highlighted"><span style="color:var(--shiki-token-comment)">    // integrating http-service</span></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">    implementation(</span><span style="color:var(--shiki-token-string-expression)">&quot;org.lynxsdk.lynx:lynx-service-http:3.2.0&quot;</span><span style="color:var(--shiki-foreground)">)</span></span>
<span class="line highlighted"></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">    implementation(</span><span style="color:var(--shiki-token-string-expression)">&quot;com.squareup.okhttp3:okhttp:4.9.0&quot;</span><span style="color:var(--shiki-foreground)">)</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">}</span></span></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div></div></div></div></div></div>
<h3 class="rp-toc-include" id="ios"><a href="#ios" class="rp-header-anchor rp-link" aria-hidden="true">#</a>iOS</h3>
<p>在项目的 <code>Podfile</code> 中，更新 Lynx 依赖至如下版本：</p>
<div class="code-fold-wrapper semi-always-light"><div dir="ltr" data-orientation="horizontal" class="w-full"><div data-state="active" data-orientation="horizontal" role="tabpanel" aria-labelledby="radix-:Rpraed:-trigger-example" id="radix-:Rpraed:-content-example" tabindex="0" class="ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 w-full overflow-hidden" style="animation-duration:0s"><div class="flex h-full w-full data-[panel-group-direction=vertical]:flex-col" style="display:flex;flex-direction:row;height:100%;overflow:hidden;width:100%" data-panel-group="" data-panel-group-direction="horizontal" data-panel-group-id=":R1praed:"><div class="" id=":R7praed:" style="flex-basis:0;flex-grow:75.0;flex-shrink:1;overflow:hidden;position:relative;aspect-ratio:7.111111111111111;height:360px" data-panel-group-id=":R1praed:" data-panel="" data-panel-id=":R7praed:" data-panel-size="75.0"><div class="codefold-scroll-area"><div class="code-in-tab"><div class="rp-codeblock language-ruby"><div class="rp-codeblock__title">Podfile</div><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables has-highlighted" style="background-color:var(--shiki-background);color:var(--shiki-foreground)" tabindex="0" data-lang="ruby" data-title="Podfile"><code><span class="line highlighted"><span style="color:var(--shiki-foreground)">source </span><span style="color:var(--shiki-token-string-expression)">&#x27;https://cdn.cocoapods.org/&#x27;</span></span>
<span class="line"></span>
<span class="line"><span style="color:var(--shiki-foreground)">platform </span><span style="color:var(--shiki-token-constant)">:ios</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-token-string-expression)"> &#x27;10.0&#x27;</span></span>
<span class="line"></span>
<span class="line"><span style="color:var(--shiki-foreground)">target </span><span style="color:var(--shiki-token-string-expression)">&#x27;YourTarget&#x27;</span><span style="color:var(--shiki-token-keyword)"> do</span></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">pod </span><span style="color:var(--shiki-token-string-expression)">&#x27;Lynx&#x27;</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-token-string-expression)"> &#x27;3.2.0&#x27;</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-token-constant)"> :subspecs</span><span style="color:var(--shiki-token-keyword)"> =&gt;</span><span style="color:var(--shiki-foreground)"> [</span></span>
<span class="line highlighted"><span style="color:var(--shiki-token-string-expression)">&#x27;Framework&#x27;</span><span style="color:var(--shiki-token-punctuation)">,</span></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">]</span></span>
<span class="line"></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">pod </span><span style="color:var(--shiki-token-string-expression)">&#x27;PrimJS&#x27;</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-token-string-expression)"> &#x27;2.12.0&#x27;</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-token-constant)"> :subspecs</span><span style="color:var(--shiki-token-keyword)"> =&gt;</span><span style="color:var(--shiki-foreground)"> [</span><span style="color:var(--shiki-token-string-expression)">&#x27;quickjs&#x27;</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-token-string-expression)"> &#x27;napi&#x27;</span><span style="color:var(--shiki-foreground)">]</span></span>
<span class="line"><span style="color:var(--shiki-token-keyword)">end</span></span>
<span class="line"></span></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div></div></div>
<p>在项目的 <code>Podfile</code> 中，更新 LynxService 依赖至如下版本：</p>
<div class="code-fold-wrapper semi-always-light"><div dir="ltr" data-orientation="horizontal" class="w-full"><div data-state="active" data-orientation="horizontal" role="tabpanel" aria-labelledby="radix-:Rqraed:-trigger-example" id="radix-:Rqraed:-content-example" tabindex="0" class="ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 w-full overflow-hidden" style="animation-duration:0s"><div class="flex h-full w-full data-[panel-group-direction=vertical]:flex-col" style="display:flex;flex-direction:row;height:100%;overflow:hidden;width:100%" data-panel-group="" data-panel-group-direction="horizontal" data-panel-group-id=":R1qraed:"><div class="" id=":R7qraed:" style="flex-basis:0;flex-grow:75.0;flex-shrink:1;overflow:hidden;position:relative;aspect-ratio:7.111111111111111;height:360px" data-panel-group-id=":R1qraed:" data-panel="" data-panel-id=":R7qraed:" data-panel-size="75.0"><div class="codefold-scroll-area"><div class="code-in-tab"><div class="rp-codeblock language-ruby"><div class="rp-codeblock__title">Podfile</div><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables has-highlighted" style="background-color:var(--shiki-background);color:var(--shiki-foreground)" tabindex="0" data-lang="ruby" data-title="Podfile"><code><span class="line"><span style="color:var(--shiki-foreground)">source </span><span style="color:var(--shiki-token-string-expression)">&#x27;https://cdn.cocoapods.org/&#x27;</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">platform </span><span style="color:var(--shiki-token-constant)">:ios</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-token-string-expression)"> &#x27;10.0&#x27;</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">target </span><span style="color:var(--shiki-token-string-expression)">&#x27;YourTarget&#x27;</span><span style="color:var(--shiki-token-keyword)"> do</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">  pod </span><span style="color:var(--shiki-token-string-expression)">&#x27;Lynx&#x27;</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-token-string-expression)"> &#x27;3.2.0&#x27;</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-token-constant)"> :subspecs</span><span style="color:var(--shiki-token-keyword)"> =&gt;</span><span style="color:var(--shiki-foreground)"> [</span></span>
<span class="line"><span style="color:var(--shiki-token-string-expression)">    &#x27;Framework&#x27;</span><span style="color:var(--shiki-token-punctuation)">,</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">  ]</span></span>
<span class="line"><span style="color:var(--shiki-foreground)">  pod </span><span style="color:var(--shiki-token-string-expression)">&#x27;PrimJS&#x27;</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-token-string-expression)"> &#x27;2.12.0&#x27;</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-token-constant)"> :subspecs</span><span style="color:var(--shiki-token-keyword)"> =&gt;</span><span style="color:var(--shiki-foreground)"> [</span><span style="color:var(--shiki-token-string-expression)">&#x27;quickjs&#x27;</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-token-string-expression)"> &#x27;napi&#x27;</span><span style="color:var(--shiki-foreground)">]</span></span>
<span class="line highlighted"><span style="color:var(--shiki-token-comment)">  # integrate image-service, log-service, and http-service</span></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">  pod </span><span style="color:var(--shiki-token-string-expression)">&#x27;LynxService&#x27;</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-token-string-expression)"> &#x27;3.2.0&#x27;</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-token-constant)"> :subspecs</span><span style="color:var(--shiki-token-keyword)"> =&gt;</span><span style="color:var(--shiki-foreground)"> [</span></span>
<span class="line highlighted"><span style="color:var(--shiki-token-string-expression)">      &#x27;Image&#x27;</span><span style="color:var(--shiki-token-punctuation)">,</span></span>
<span class="line highlighted"><span style="color:var(--shiki-token-string-expression)">      &#x27;Log&#x27;</span><span style="color:var(--shiki-token-punctuation)">,</span></span>
<span class="line highlighted"><span style="color:var(--shiki-token-string-expression)">      &#x27;Http&#x27;</span><span style="color:var(--shiki-token-punctuation)">,</span></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">  ]</span></span>
<span class="line"></span>
<span class="line highlighted"><span style="color:var(--shiki-token-comment)">  # ImageService</span></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">  pod </span><span style="color:var(--shiki-token-string-expression)">&#x27;SDWebImage&#x27;</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-token-string-expression)">&#x27;5.15.5&#x27;</span></span>
<span class="line highlighted"><span style="color:var(--shiki-foreground)">  pod </span><span style="color:var(--shiki-token-string-expression)">&#x27;SDWebImageWebPCoder&#x27;</span><span style="color:var(--shiki-token-punctuation)">,</span><span style="color:var(--shiki-token-string-expression)"> &#x27;0.11.0&#x27;</span></span>
<span class="line"></span>
<span class="line"><span style="color:var(--shiki-token-keyword)">end</span></span></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div></div></div>
<h2 class="rp-toc-include" id="写在最后"><a href="#写在最后" class="rp-header-anchor rp-link" aria-hidden="true">#</a>写在最后</h2>
<p>感谢 Lynx 社区全体成员对 Lynx 3.2 版本发布的支持！Lynx 作为一个开源项目的新成员，我们对其未来满怀憧憬，也迫切地期待社区成员基于 Lynx 开发的应用程序早日亮相。</p>
<p>未来，我们将与社区携手共进，按<a href="/next/zh/blog/lynx-open-source-roadmap-2025.html" class="rp-link">规划</a>陆续推出更多功能支持，例如新增 Input 等组件、适配鸿蒙与 PC 等更多平台。</p>
<p>请查阅<a href="https://github.com/lynx-family/lynx/releases/tag/3.2.0" target="_blank" rel="noopener noreferrer" class="rp-link">版本说明和更新</a>，开启您全新的 Lynx 开发构建之旅！</p>
<hr/>
<p><em>感谢<a href="https://x.com/huxpro" target="_blank" rel="noopener noreferrer" class="rp-link">黄玄</a>、<a href="https://x.com/zoolsher" target="_blank" rel="noopener noreferrer" class="rp-link">张磊</a>和<a href="https://x.com/liushouqun" target="_blank" rel="noopener noreferrer" class="rp-link">刘守群</a>在撰写此博客时提供的帮助。</em></p><!--/$-->]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lynx 2025 年技术路线图]]></title>
            <link>https://lynxjs.org/zh/blog/lynx-open-source-roadmap-2025</link>
            <guid isPermaLink="false">/zh/blog/lynx-open-source-roadmap-2025</guid>
            <pubDate>Wed, 19 Mar 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[两周前，我们将 Lynx 正式开源，并收集到了许多宝贵的反馈和建议，感谢大家对 Lynx 的关注与支持。今天，我很高兴与大家分享 Lynx 的 2025 年技术路线图。]]></description>
            <content:encoded><![CDATA[<h1 class="rp-toc-include" id="lynx-2025-年技术路线图"><span>Lynx 2025 年技术路线图</span><a href="#lynx-2025-年技术路线图" class="rp-header-anchor rp-link" aria-hidden="true">#</a> </h1><div class="rp-not-doc rp-llms-container"><button class="rp-not-doc rp-llms-button rp-llms-copy-button"><div class="rp-llms-copy-button__icon-wrapper"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg></div><span>复制 Markdown</span></button><button class="rp-llms-button rp-llms-view-options__trigger "><svg width="1em" height="1em" viewBox="0 0 32 32" class="rp-llms-view-options__arrow "><path fill="currentColor" d="M16 22 6 12l1.4-1.4 8.6 8.6 8.6-8.6L26 12z"></path></svg></button></div><!--$--><a href="/next/zh/blog/" class="backLink-lQPNH7">← <!-- -->所有文章</a><div class="blogHeader-ZKfIZ_"><span class="date-aB5gkw">2025年3月19日</span><div class="blog-avatar-frame-G1eJ1T avatars-aaQ1Kf"><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/lynx-family.png" alt="刘守群"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">刘守群</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="14" viewBox="0 0 300 271" class="icon-x-XK0uad"><path fill="currentColor" d="M236 0h46L181 115l118 156h-92.6l-72.5-94.8-83 94.8h-46l107-123L-1.1 0h94.9l65.5 86.6zm-16.1 244h25.5L80.4 26H53z"></path></svg></span><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">工程主管 @ Lynx</span></div></span></div><div class="rp-not-doc rp-llms-container"><button class="rp-not-doc rp-llms-button rp-llms-copy-button"><div class="rp-llms-copy-button__icon-wrapper"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg></div><span>复制 Markdown</span></button><button class="rp-llms-button rp-llms-view-options__trigger "><svg width="1em" height="1em" viewBox="0 0 32 32" class="rp-llms-view-options__arrow "><path fill="currentColor" d="M16 22 6 12l1.4-1.4 8.6 8.6 8.6-8.6L26 12z"></path></svg></button></div></div>
<p><a href="/next/zh/blog/lynx-unlock-native-for-more.html" class="rp-link">两周前</a>，我们将 Lynx 正式开源，并收集到了许多宝贵的反馈和建议，感谢大家对 Lynx 的关注与支持。今天，我很高兴与大家分享 Lynx 的 2025 年技术路线图。
Lynx 技术体系的发展核心原则：</p>
<ul>
<li><strong>快速稳定的发布</strong> – 确保快速版本更新的同时，通过清晰的弃用策略保持稳定的 API 并尽量减少 Breaking Change。</li>
<li><strong>多平台适配</strong> – 为开发者提供高效、高性能的跨平台解决方案。</li>
<li><strong>积极的社区支持</strong> – 通过 <a href="https://github.com/orgs/lynx-family" target="_blank" rel="noopener noreferrer" class="rp-link">GitHub</a>、<a href="https://discord.com/invite/mXk7jqdDXk" target="_blank" rel="noopener noreferrer" class="rp-link">Discord</a>、StackOverflow 等渠道与开发者积极互动。</li>
</ul>
<h2 class="rp-toc-include" id="发布计划"><a href="#发布计划" class="rp-header-anchor rp-link" aria-hidden="true">#</a>发布计划</h2>
<p>我们认为，持续稳定的版本更新对于开发框架至关重要，能够确保新功能和优化及时触达用户。因此，在 2025 年，我们计划发布 5 个稳定版本。</p>
<div class="rp-table-scroll-container rp-scrollbar"><table><thead><tr><th><strong>稳定版本</strong></th><th>3.2</th><th>3.3</th><th>3.4</th><th>3.5</th><th>3.6</th></tr></thead><tbody><tr><td><strong>计划发布时间</strong></td><td>2025/04</td><td>2025/06</td><td>2025/08</td><td>2025/10</td><td>2025/12</td></tr></tbody></table></div>
<h2 class="rp-toc-include" id="文档支持"><a href="#文档支持" class="rp-header-anchor rp-link" aria-hidden="true">#</a>文档支持</h2>
<p>高质量的文档和示例对于开发者体验至关重要。我们的团队将致力于在官方网站 (<a href="https://lynxjs.org" target="_blank" rel="noopener noreferrer" class="rp-link">https://lynxjs.org</a>) 上发布和维护准确、最新的文档。此外，我们的网站仓库 (<a href="https://github.com/lynx-family/lynx-website" target="_blank" rel="noopener noreferrer" class="rp-link">https://github.com/lynx-family/lynx-website</a>) 也是开源的，并将在透明的环境下持续维护。我们非常欢迎社区对文档提供反馈或贡献。</p>
<h2 class="rp-toc-include" id="多平台支持"><a href="#多平台支持" class="rp-header-anchor rp-link" aria-hidden="true">#</a>多平台支持</h2>
<p>Lynx 旨在提供一个支持广泛平台的跨平台开发框架。目前，我们已经开源了 Android、iOS 和 Web 端的支持。此外，Lynx 还支持桌面平台（Windows 和 macOS）以及新兴平台（OpenHarmony）。在 2025 年，我们将继续推动框架的开源进程，具体计划如下：</p>
<ul>
<li>Android、iOS 和 Web：已经开源，我们将持续优化跨平台一致性和性能，为开发者提供更优的移动端开发解决方案。</li>
<li>OpenHarmony：计划在 3.4 版本开源 Lynx 对 OpenHarmony 的支持。</li>
<li>macOS 和 Windows：计划在 3.5 版本开源 Lynx 对 macOS 和 Windows 的支持。</li>
</ul>
<h2 class="rp-toc-include" id="更多功能与-ui-组件"><a href="#更多功能与-ui-组件" class="rp-header-anchor rp-link" aria-hidden="true">#</a>更多功能与 UI 组件</h2>
<p>我们收到了许多关于新增 API 和组件的需求，以及关于 Lynx 在不同产品中的集成反馈。为了帮助开发者构建功能完善的应用，我们计划在今年进一步开源更多功能，具体包括：</p>
<ul>
<li>新增 UI 组件，如 input、 viewpagers、swiper、SVG 等。</li>
<li>开源 <a href="https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API" target="_blank" rel="noopener noreferrer" class="rp-link">Canvas</a> 、 <a href="https://airbnb.io/lottie" target="_blank" rel="noopener noreferrer" class="rp-link">Lottie 动画</a>支持。</li>
<li>应用级能力，如原生导航、通知、定位等 API 支持。</li>
</ul>
<h2 class="rp-toc-include" id="开发工具链"><a href="#开发工具链" class="rp-header-anchor rp-link" aria-hidden="true">#</a>开发工具链</h2>
<p>我们也收到关于 Windows 和 Linux 平台工具链兼容性的大量反馈。未来，我们将确保工具链在 macOS、Windows 和 Linux 开发平台上的兼容性。</p>
<p>此外，我们还将持续提升 DevTools 的功能和稳定性，并计划在今年晚些时候引入性能分析工具，帮助开发者更高效地诊断和优化性能问题。</p>
<h2 class="rp-toc-include" id="社区发展"><a href="#社区发展" class="rp-header-anchor rp-link" aria-hidden="true">#</a>社区发展</h2>
<p>Lynx 是一个致力于赋能开发者的技术生态，我们深知丰富的社区对于其成功至关重要。因此，我们将继续推动技术开源，并不断建设和完善社区：</p>
<ul>
<li>推动 <a href="/zh/guide/spec.html#element-papi" class="rp-link">Element PAPI</a> 的发展, 使其更加独立于具体框架，从而支持更多基于 Lynx 引擎的框架。</li>
<li>积极与开发者互动，在 Discord、GitHub、StackOverflow 等社区平台上，持续收集反馈、解答问题，并优化框架。</li>
</ul>
<p>Lynx 开源以来，社区的热情让我们深受鼓舞，也收到了大量宝贵的反馈，这些意见帮助我们更清晰地认识到框架的改进方向。未来，我们期待与社区携手共进，持续发布更新，为开发者提供更强大的支持！</p><!--/$-->]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lynx：迈向原生体验]]></title>
            <link>https://lynxjs.org/zh/blog/lynx-unlock-native-for-more</link>
            <guid isPermaLink="false">/zh/blog/lynx-unlock-native-for-more</guid>
            <pubDate>Wed, 05 Mar 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[今天，我们很高兴向大家介绍 Lynx 全家桶，它们是一系列希望帮助 Web 开发者复用现有经验，通过一套代码同时创建移动端原生界面与 Web 端界面的技术……]]></description>
            <content:encoded><![CDATA[<h1 class="rp-toc-include" id="lynx迈向原生体验"><span>Lynx：迈向原生体验</span><a href="#lynx迈向原生体验" class="rp-header-anchor rp-link" aria-hidden="true">#</a> </h1><div class="rp-not-doc rp-llms-container"><button class="rp-not-doc rp-llms-button rp-llms-copy-button"><div class="rp-llms-copy-button__icon-wrapper"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg></div><span>复制 Markdown</span></button><button class="rp-llms-button rp-llms-view-options__trigger "><svg width="1em" height="1em" viewBox="0 0 32 32" class="rp-llms-view-options__arrow "><path fill="currentColor" d="M16 22 6 12l1.4-1.4 8.6 8.6 8.6-8.6L26 12z"></path></svg></button></div><!--$--><a href="/next/zh/blog/" class="backLink-lQPNH7">← <!-- -->所有文章</a><div class="blogHeader-ZKfIZ_"><span class="date-aB5gkw">2025年3月5日</span><div class="blog-avatar-frame-G1eJ1T avatars-aaQ1Kf"><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/huxpro.png" alt="黄玄"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">黄玄</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="14" viewBox="0 0 300 271" class="icon-x-XK0uad"><path fill="currentColor" d="M236 0h46L181 115l118 156h-92.6l-72.5-94.8-83 94.8h-46l107-123L-1.1 0h94.9l65.5 86.6zm-16.1 244h25.5L80.4 26H53z"></path></svg></span><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">架构师 @ Lynx</span></div></span><span class="avatar-item-V9KvYV"><img class="avatar-img-lOP8r0" src="https://github.com/lynx-family.png" alt="Lynx 团队"/><div class="avatar-text-bV6Thm"><span class="avatar-name-row-Jwi5ym"><span class="avatar-name-LEqtpc">Lynx 团队</span><span class="avatar-socials-TncjhQ"><span class="avatar-social-link-PObcBr" role="link"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="14" viewBox="0 0 300 271" class="icon-x-XK0uad"><path fill="currentColor" d="M236 0h46L181 115l118 156h-92.6l-72.5-94.8-83 94.8h-46l107-123L-1.1 0h94.9l65.5 86.6zm-16.1 244h25.5L80.4 26H53z"></path></svg></span><span class="avatar-social-link-PObcBr" role="link"><span role="img" aria-label="github_logo" class="semi-icon semi-icon-default semi-icon-github_logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M12.01 1a11 11 0 0 0-3.48 21.45c.55.11.75-.23.75-.52l-.02-2.05c-3.06.66-3.7-1.3-3.7-1.3-.5-1.28-1.22-1.61-1.22-1.61-1-.68.07-.68.07-.68 1.11.08 1.7 1.13 1.7 1.13.98 1.68 2.56 1.2 3.2.92.1-.72.39-1.2.7-1.48-2.45-.26-5.02-1.2-5.02-5.43 0-1.2.44-2.2 1.13-2.96-.1-.27-.49-1.4.11-2.91 0 0 .93-.3 3.03 1.13a10.66 10.66 0 0 1 5.5 0c2.1-1.42 3.03-1.13 3.03-1.13.6 1.51.22 2.64.1 2.91a4.21 4.21 0 0 1 1.14 2.96c0 4.23-2.57 5.16-5.03 5.43.4.35.74 1 .74 2.04l-.01 3.03c0 .29.2.63.74.52A11 11 0 0 0 12.01 1Z" fill="currentColor"></path><path d="M5.17 16.8c-.01.06-.1.08-.18.04-.07-.04-.13-.1-.09-.16.02-.06.11-.08.18-.04.08.04.11.11.1.16Zm.44.5c-.05.05-.16.01-.22-.06-.07-.07-.09-.18-.03-.24.05-.05.14-.01.22.06.07.1.09.2.03.24Zm.44.63c-.07.06-.18 0-.24-.09-.07-.09-.07-.22 0-.25.08-.06.18 0 .24.09.07.09.07.2 0 .25Zm.6.62c-.05.08-.18.06-.3-.03-.08-.1-.12-.22-.05-.28.06-.07.19-.05.3.04.09.07.1.2.05.27Zm.82.35c-.02.1-.14.13-.27.1-.13-.04-.2-.15-.18-.23.01-.09.14-.12.27-.09.13.04.2.13.18.22Zm.9.07c0 .1-.12.17-.24.17-.13 0-.24-.08-.24-.17 0-.09.11-.16.24-.16.12 0 .23.07.23.16Zm.83-.14c.02.09-.07.18-.2.2-.13.02-.23-.04-.25-.13-.02-.1.07-.18.2-.2.13-.02.23.04.25.13Z" fill="currentColor"></path></svg></span></span></span></span><span class="avatar-role-iEvaiB">lynxjs.org</span></div></span></div><div class="rp-not-doc rp-llms-container"><button class="rp-not-doc rp-llms-button rp-llms-copy-button"><div class="rp-llms-copy-button__icon-wrapper"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-llms-copy-button__icon-copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg></div><span>复制 Markdown</span></button><button class="rp-llms-button rp-llms-view-options__trigger "><svg width="1em" height="1em" viewBox="0 0 32 32" class="rp-llms-view-options__arrow "><path fill="currentColor" d="M16 22 6 12l1.4-1.4 8.6 8.6 8.6-8.6L26 12z"></path></svg></button></div></div>
<p>今天，我们很高兴向大家介绍 <strong>Lynx</strong> <em>全家桶</em>——一套帮助 Web 开发者复用现有经验，通过一份代码同时构建移动端原生界面与 Web 端界面的技术方案。Lynx 专为多样化、富交互的场景打造，得以在 TikTok 这样量级的应用中支撑那些生动且吸引人的界面。它有着高性能、多功能的渲染引擎、性能优先的双线程 UI 编程范式、以及基于 Rust 的现代工具链等诸多特性。</p>
<p>我们非常感谢跨平台开发领域先驱们的探索与积累，并希望通过<strong>开源</strong> Lynx 进一步推动这个领域的发展，让更多的开发者能够以更高效、更自由的方式开发应用。</p>
<h2 class="rp-toc-include" id="规模化高效地交付原生体验"><a href="#规模化高效地交付原生体验" class="rp-header-anchor rp-link" aria-hidden="true">#</a>规模化、高效地交付原生体验</h2>
<p>对于这一代数字原住民而言，手机及其上的应用构成了他们人生中的第一次数字体验。对于这些习惯了以应用为中心的用户来说，非原生体验不仅仅是不便，更是一种警示。一个空白屏幕、点赞动画的 0.1 秒的延迟、一个不熟悉的交互方式，都可能让用户对界面的感受大打折扣，产生不信任感。我们相信，原生的界面体验和性能不仅仅是锦上添花而已——<strong><em>原生体验是必需品</em></strong>。</p>
<p>尽管移动应用市场仍在高速增长，但如何应对<em>规模</em>和<em>效率</em>仍然是一个挑战。设备形态和平台的日益多样化，迫使开发者重复重写同样的界面，不仅浪费精力、还导致割裂的团队，更晚的产品上线时间。我们相信，如果能让开发者做到“一次编写，多端运行”，<em>我们就可以<strong>更快地让体验触达更多用户</strong></em>。</p>
<p>TikTok，作为一个移动优先的平台，凭借持续创新且富有吸引力的体验，备受全球多元化用户的喜爱。为了满足不断变化的需求，TikTok 逐步引入了 Lynx，并对其愈发寄予厚望。如今，Lynx 已广泛支撑其众多场景——从轻量化、超高频使用的<strong>搜索</strong>，到功能完整的独立应用 <a href="https://support.tiktok.com/en/using-tiktok/creating-videos/tiktok-studio" target="_blank" rel="noopener noreferrer" class="rp-link">TikTok Studio</a>；从强调可靠性和信任感的<strong>电商</strong>场景，到高度互动的<strong>直播</strong>体验，甚至助力了诸如<a href="https://newsroom.tiktok.com/disney-100?lang=en" target="_blank" rel="noopener noreferrer" class="rp-link">迪士尼 100 周年</a>和 <a href="https://newsroom.tiktok.com/tiktok-goes-to-the-met-gala?lang=en" target="_blank" rel="noopener noreferrer" class="rp-link">Met Gala</a> 这样高知名度的活动与文化盛事。</p>
<p><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/blog/lynx-in-tiktok.jpg" alt="lynx-in-tiktok"/></p>
<center><span><small>TikTok 对 Lynx 的广泛使用</small></span></center>
<p>我们认为，<em>规模</em>和<em>效率</em>不仅仅意味着一个功能、一个 Bug 修复、或一次性能优化能应用到所有平台上提升成本效率，它还意味着<em>多功能性</em>——能够在同一套技术基建上适配于广泛的应用场景，而无需为每个独特的需求另起炉灶、重新组建团队或重复造轮子。</p>
<h2 class="rp-toc-include" id="激励并丰富-web-社区"><a href="#激励并丰富-web-社区" class="rp-header-anchor rp-link" aria-hidden="true">#</a>激励并丰富 Web 社区</h2>
<p>Web 平台最初为<a href="https://www.w3.org/People/Berners-Lee/WorldWideWeb.html" target="_blank" rel="noopener noreferrer" class="rp-link">文档</a>而建，<a href="https://extensiblewebmanifesto.org/#signatories" target="_blank" rel="noopener noreferrer" class="rp-link">一点一点</a><a href="https://infrequently.org/2015/06/progressive-apps-escaping-tabs-without-losing-our-soul/" target="_blank" rel="noopener noreferrer" class="rp-link">演变</a>成了今天大家认知里的一个开发平台。然而，它依然<a href="https://infrequently.org/2020/06/platform-adjacency-theory/" target="_blank" rel="noopener noreferrer" class="rp-link">面临很多挑战</a>，限制了其快速适应和创新的能力。因此，将 Web 技术重塑成跨平台开发技术，便成为了行业的一个主流趋势。自 2008 年以来，PhoneGap（后来的 <a href="https://cordova.apache.org/" target="_blank" rel="noopener noreferrer" class="rp-link">Cordova</a>）就致力于通过增强 Webview 的原生能力<a href="https://web.archive.org/web/20161210233245/http://phonegap.com/blog/2012/05/09/phonegap-beliefs-goals-and-philosophy/" target="_blank" rel="noopener noreferrer" class="rp-link">让 Web 能继续作为跨平台开发的解决方案</a>。2015 年，<a href="https://reactnative.dev/blog/2015/03/26/react-native-bringing-modern-web-techniques-to-mobile" target="_blank" rel="noopener noreferrer" class="rp-link">React Native 率先将原生 UI 与 Web 技术桥接</a>，使得在移动端使用 React.js 实现声明式 UI 成为可能。同年，<a href="https://developers.googleblog.com/en/flutter-10-googles-portable-ui-toolkit/" target="_blank" rel="noopener noreferrer" class="rp-link">Flutter</a> 带着 Web 的技术背景，采用了类似的声明式 UI 模型，并带来了一种全新的基于自定义渲染引擎的跨端思路。</p>
<p>Lynx 继承了相似的理念——你甚至可以将它视作“<strong>专为应用开发定制的另一种 Web</strong>”。它旨在尊重 Web 技术的优势和资产，但同时有自己的主见：一方面支持类 Web 的 API，一方面有意图地添加约束和扩展。</p>
<p>为了说明这种平衡，我们来看两个例子：一个是我们选择遵循 Web 标准的场景，另一个则是我们有意做出的不同设计。</p>
<h3 class="rp-toc-include" id="像往常一样使用标签和-css-描绘界面"><a href="#像往常一样使用标签和-css-描绘界面" class="rp-header-anchor rp-link" aria-hidden="true">#</a>像往常一样使用标签和 CSS 描绘界面</h3>
<p>从本质上讲，UI 技术的使命是能够出色地实现产品设计。Lynx 拥抱了大家熟悉的 Web 开发范式，使开发者能够像在 Web 上一样继续使用标记语言和 CSS。Lynx 原生支持了 <a href="/zh/guide/styling/animation.html" class="rp-link">CSS 动画和过渡</a>、<a href="/zh/guide/styling/custom-theming.html" class="rp-link">CSS 选择器和变量用于主题化定制</a>，以及<a href="/zh/guide/styling/appearance.html#%E6%B8%90%E5%8F%98" class="rp-link">渐变</a>、<a href="/zh/guide/styling/appearance.html#%E8%A3%81%E5%88%87%E4%B8%8E%E8%92%99%E7%89%88" class="rp-link">裁剪和遮罩</a>这样的现代 CSS 视效能力——所有的这一切，都是为了能够继续释放 Web 社区的创造力，以实现最前沿的设计。</p>
<div class="box-LTvjqb   "><div class="container-qARFbv"><div class="content-Yzcw9o"><div class="split-pane" style="display:flex;flex-direction:row;width:100%;height:100%;min-height:0"><div class="split-pane__first" style="flex:1;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="code-wrap-jURSQJ"><div class="code-tab-container-5FhsBL"><div class="code-view-container-lgwabm "><div class="code-kbFEhm"><div class="rp-codeblock language-tsx"><div class="rp-codeblock__content"><div class="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"><pre class="shiki css-variables" data-lang="tsx"><code style="padding:1rem 1.25rem"></code></pre></div><div class="rp-code-button-group"><button class="rp-code-button-group__button rp-code-wrap-button" title="切换代码换行" aria-label="切换代码换行"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrapped"><path fill="currentColor" d="M21 5H3v2h18zM3 19h7v-2H3zm0-6h15c1 0 2 .43 2 2s-1 2-2 2h-2v-2l-4 3 4 3v-2h2c2.95 0 4-1.27 4-4 0-2.72-1-4-4-4H3z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-button-group__icon--wrap"><path fill="currentColor" d="M16 7H3V5h13zM3 19h13v-2H3zm19-7-4-3v2H3v2h15v2z"></path></svg></button><button class="rp-code-button-group__button rp-code-copy-button" title="复制代码"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--copy"><path fill="currentColor" d="M20 8v12H8V8zm0-2H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2"></path><path fill="currentColor" d="M4 16H2V4a2 2 0 0 1 2-2h12v2H4Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" class="rp-code-button-group__icon rp-code-copy-button__icon rp-code-copy-button__icon--success"><path fill="currentColor" d="m9.55 18-5.7-5.7 1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"></path></svg></button></div></div></div></div></div></div></div></div><div role="separator" class="split-pane__divider" tabindex="0" style="flex:0 0 10px;cursor:col-resize;display:flex;align-items:center;justify-content:center;position:relative;z-index:1;touch-action:none" aria-orientation="vertical"><span role="img" aria-label="handle" class="semi-icon semi-icon-default semi-icon-handle" style="font-size:10px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path d="M9 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M9 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M11 19a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path><path d="M17 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" fill="currentColor"></path><path d="M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></svg></span></div><div class="split-pane__second" style="flex:0 0 auto;min-width:0;min-height:0;overflow:hidden;transition:opacity 0.15s ease"><div class="preview-wrap-un0XJO"><div class="preview-wrap-content-TYo6um"><div class="preview-header-zYAZlz"><div style="width:24px;flex-shrink:0"></div><div class="semi-radioGroup semi-radioGroup-wrapper semi-radioGroup-buttonRadio" style="display:flex;flex:1;min-width:0;justify-content:center"><div style="width:100%;height:32px"></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div><div class="preview-body-YE5PSF"><div class="preview-panel-amOf1r" style="z-index:1;visibility:visible;pointer-events:auto"><div style="min-height:0px;display:flex;width:100%;height:100%;align-items:center;justify-content:center"><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/doc/guide-mask-image-circle.png" alt="" loading="eager" decoding="async" style="max-width:100%;max-height:100%;object-fit:contain"/></div></div></div></div></div></div></div></div><div class="footer-KtlqMk"><div class="semi-space semi-space-align-center semi-space-horizontal" style="max-width:100%;overflow:hidden;white-space:nowrap;row-gap:2px;column-gap:2px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><span role="img" aria-label="list" class="semi-icon semi-icon-default semi-icon-list" style="color:var(--semi-color-text-2)"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><g opacity="0.99"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9.5 3a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM8 11.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 11.5Zm0 7c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 18.5Zm-2-7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-2 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"></path></g></svg></span></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="overflow:hidden;row-gap:2px;column-gap:2px" x-semi-prop="children"><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>css</span></span><span role="img" aria-label="chevron_right_stroked" class="semi-icon semi-icon-default semi-icon-chevron_right_stroked" style="color:var(--semi-color-text-2);font-size:12px"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" focusable="false" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.9 20.17a1.25 1.25 0 0 1-.07-1.77l5.71-6.15-5.7-6.15a1.25 1.25 0 0 1 1.83-1.7l6.5 7c.44.48.44 1.22 0 1.7l-6.5 7c-.47.5-1.26.54-1.77.07Z" fill="currentColor"></path></svg></span><span class="semi-typography semi-typography-ellipsis semi-typography-ellipsis-single-line semi-typography-ellipsis-overflow-ellipsis semi-typography-ellipsis-overflow-ellipsis-text semi-typography-tertiary semi-typography-small semi-typography-normal"><span>src/mask_image_circle_gradient/index.tsx</span></span></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:7px;column-gap:7px" x-semi-prop="children"><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg></span></button><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">Code</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><div class="semi-space semi-space-align-center semi-space-horizontal" style="row-gap:6px;column-gap:6px" x-semi-prop="children"><span class="semi-typography toggle-label-SuO63S semi-typography-tertiary semi-typography-small semi-typography-normal">预览</span><div class="semi-switch semi-switch-checked semi-switch-small" style="background-color:var(--semi-color-info);cursor:pointer"><div class="semi-switch-knob" aria-hidden="true"></div><input type="checkbox" class="semi-switch-native-control" role="switch" aria-checked="true" aria-disabled="false" checked=""/></div></div><button class="semi-button semi-button-tertiary semi-button-size-small semi-button-borderless semi-button-with-icon semi-button-with-icon-only" type="button" aria-disabled="false"><span class="semi-button-content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" style="color:var(--semi-color-text-2)"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"></path></svg></span></button></div></div></div></div>
<center><span><small><p>使用<code>mask-image</code>实现边缘淡出</p></small></span></center>
<h3 class="rp-toc-include" id="让主线程专责服务于交互体验"><a href="#让主线程专责服务于交互体验" class="rp-header-anchor rp-link" aria-hidden="true">#</a>让主线程专责服务于交互体验</h3>
<p>Lynx 最具代表性的架构决策之一是<strong>静态强制划分</strong>用户脚本的运行环境，将用户脚本拆分跑在了两个独立的运行时上：一个<a href="/zh/guide/spec.html#main-thread-or-lynx-main-thread" class="rp-link">主线程</a>运行时，它由 <a href="https://github.com/lynx-family/primjs" target="_blank" rel="noopener noreferrer" class="rp-link"><strong>PrimJS</strong></a> 这个专为 Lynx 优化的 JavaScript 引擎驱动，有着独享的同步 UI 操作权限，用于处理初始启动和高优事件处理等任务；另一个则是<a href="/zh/guide/spec.html#background-thread-aka-off-main-thread" class="rp-link">后台</a>运行时，作为用户代码的默认执行环境，以确保主线程的低负载和<em>非阻塞</em>。这一架构带来了 Lynx 的两大杀手锏：</p>
<ol>
<li>
<p><a href="/zh/guide/interaction/ifr.html" class="rp-link"><em>首帧直出 (Instant First-Frame Rendering，IFR)</em></a>：<a href="https://www.nngroup.com/articles/response-times-3-important-limits/" target="_blank" rel="noopener noreferrer" class="rp-link">用研表明</a>：如果渲染足够快（而 Lynx 正是如此），那么在界面过渡时就无需多余的反馈。Lynx 通过短暂阻塞主线程，确保首帧一次性完整呈现，因为用户不会看到空白，可以给用户带来一种即刻响应的感知体验。</p>
</li>
<li>
<p><a href="/zh/react/main-thread-script.html" class="rp-link"><em>主线程脚本 (Main Thread Script，MTS)</em></a>：它是一小段静态调度的代码，被授予在主线程运行的权力，用于处理高优的事件和手势行为，非常适合那些要求极致跟手、快速响应的场景，以实现原生交互触感。</p>
</li>
</ol>
<div style="display:table;margin:36px 0;width:100%;table-layout:fixed"><div style="display:table-row"><div style="display:table-cell;vertical-align:top;text-align:center"><div style="border-radius:8px;overflow:hidden;max-width:40vw;margin:0 auto"><video src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/killers/ifr.mp4" style="width:100%;height:auto;max-height:50vh;object-fit:contain;display:block" autoplay="" muted="" controls="" loop="" playsinline=""></video></div><div style="margin-top:0.5rem;text-align:center">IFR</div></div><div style="display:table-cell;vertical-align:top;text-align:center"><div style="border-radius:8px;overflow:hidden;max-width:40vw;margin:0 auto"><video src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/killers/mts.mp4" style="width:100%;height:auto;max-height:50vh;object-fit:contain;display:block" autoplay="" muted="" controls="" loop="" playsinline=""></video></div><div style="margin-top:0.5rem;text-align:center">MTS</div></div></div></div>
<p>如果在上图中没能看清 <em>IFR</em> 的首帧有多快，或是 <em>MTS</em> 的跟手有多丝滑的话，就让我们
<strong><em>放慢 4 倍</em></strong>
，再看一遍：</p>
<div style="display:table;margin:36px 0;width:100%;table-layout:fixed"><div style="display:table-row"><div style="display:table-cell;vertical-align:top;text-align:center"><div style="border-radius:8px;overflow:hidden;max-width:40vw;margin:0 auto"><video src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/killers/ifr.mp4" style="width:100%;height:auto;max-height:50vh;object-fit:contain;display:block" autoplay="" muted="" controls="" loop="" playsinline=""></video></div><div style="margin-top:0.5rem;text-align:center">IFR (0.25x)</div></div><div style="display:table-cell;vertical-align:top;text-align:center"><div style="border-radius:8px;overflow:hidden;max-width:40vw;margin:0 auto"><video src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/killers/mts.mp4" style="width:100%;height:auto;max-height:50vh;object-fit:contain;display:block" autoplay="" muted="" controls="" loop="" playsinline=""></video></div><div style="margin-top:0.5rem;text-align:center">MTS (0.25x)</div></div></div></div>
<p>在内部实践中，我们观察到许多从 Web 迁移到 Lynx 的界面，普遍能缩短 <strong>2–4 倍的启动时间</strong>。我们的内部性能测试同时表明，相比同类技术，Lynx 在 iOS 上不相上下，在安卓上则持续领先。</p>
<h2 class="rp-toc-include" id="开源-lynx"><a href="#开源-lynx" class="rp-header-anchor rp-link" aria-hidden="true">#</a>开源 Lynx</h2>
<p>Lynx 最初由字节跳动的工程团队开发，并将由该团队继续推进其演进。作为在一系列应用中广泛使用 Lynx 的重要用户，TikTok 认可 Lynx 的创新与潜力，促进 Lynx 的开源发布，在资金、技术优化、社区推广和生态建设等方面提供支持。</p>
<h3 class="rp-toc-include" id="让跨平台技术真正普惠"><a href="#让跨平台技术真正普惠" class="rp-header-anchor rp-link" aria-hidden="true">#</a>让跨平台技术真正普惠</h3>
<p>多年来，Web 开发者可以使用的跨平台开发技术，一直被少数几家主导者的方案定义。尽管我们对他们的卓越贡献表示敬意，但市场对更多样化的方法的需求也日益增长。Lynx 希望改变这一现状——我们开源的并非某个固定的单一方案，而是一个<strong>元基础设施（meta-infrastructure）</strong>，让面临类似规模和速度挑战的团队和企业，都能够构建自己的跨平台解决方案。</p>
<p>我们开源了 <a href="/zh/react/index.html" class="rp-link"><strong>ReactLynx</strong></a>（“Lynx 上的 React”），作为 Lynx 的首个前端框架，带来 Lynx 上的组件化、声明式 UI 能力。<em>然而，Lynx 并不局限于 React</em>。事实上，其他框架也占据了 Lynx 整体使用量的一半，充分证明了其对不同技术栈的兼容性和中立性。随着现代应用的复杂度不断提升，单个应用往往需要数十甚至上百名开发者协同开发，Lynx 为此配备了 <a href="/zh/rspeedy/index.html" class="rp-link"><strong>Rspeedy</strong></a>，一个基于高性能打包工具 <a href="https://rspack.rs/" target="_blank" rel="noopener noreferrer" class="rp-link">Rspack</a> 的构建工具链，支持 Lynx 的快速构建，为后续基于<a href="https://module-federation.io/" target="_blank" rel="noopener noreferrer" class="rp-link">模块联邦</a>的多框架<a href="https://en.wikipedia.org/wiki/Micro_frontend" target="_blank" rel="noopener noreferrer" class="rp-link">微前端</a>未来铺平道路。我们非常期待，能与开源 JavaScript 框架社区携手合作，为跨平台开发带来更丰富的选择。</p>
<p>不仅 Lynx 的<a href="https://github.com/lynx-family/lynx" target="_blank" rel="noopener noreferrer" class="rp-link">核心引擎</a>不绑定任何特定前端框架，它对宿主平台和渲染后端也保持开放性。Lynx 从 <a href="https://www.chromium.org/chromium-projects/" target="_blank" rel="noopener noreferrer" class="rp-link">Chromium</a>、<a href="https://github.com/flutter" target="_blank" rel="noopener noreferrer" class="rp-link">Flutter</a> 和 <a href="https://github.com/facebook/react-native" target="_blank" rel="noopener noreferrer" class="rp-link">React Native</a> 等一系列项目中汲取灵感，具备快速适配一个新平台的灵活性，并且灵活到可以切换至<em>自渲染</em>，从而在任何具有图形接口的平台上实现像素级一致的渲染效果。这还没完，通过 <a href="https://github.com/lynx-family/lynx-stack/tree/main/packages/web-platform" target="_blank" rel="noopener noreferrer" class="rp-link"><strong>Lynx for Web</strong></a>，Lynx 还可以原生运行在 Web 浏览器中。这些特性共同赋予了 Lynx 在扩展到更多平台（如桌面、电视或物联网设备）时的极强适应性。</p>
<h3 class="rp-toc-include" id="这不是终点而是新的起点"><a href="#这不是终点而是新的起点" class="rp-header-anchor rp-link" aria-hidden="true">#</a>这不是终点，而是新的起点</h3>
<p>肩负着大量业务的 Lynx 必须得是<strong>生产就绪</strong>的，我们今天开源的正是我们在生产环境中实际使用的版本，这也是为什么它直接从 3.x 版本起步的原因。它甚至包含了一些我们计划废弃的遗留代码和 API，但我们相信，真正的开源就是应该开源我们实际依赖的代码。<strong>我们会将所有开发迁移到 GitHub</strong>，使其对社区完全开放和透明。</p>
<p>这次发布仅仅是一个开始。今天开源的内容也<em>并非</em> Lynx 的全部。许多我们引以为豪的功能——包括更丰富的 UI 组件、先进的内置图形能力、自定义渲染器和其他框架等——还都在路上。</p>
<p>更重要的是，这是我们一段新旅程的开始。作为一个在开源领域相对年轻的团队，我们深知在开放协作、社区共建和生态成长方面将会有许多需要学习的地方。但我们依然很坚定地迈出了这一步，因为我们相信，开源是正确的道路——<strong>它将促进协作，为跨平台技术带来新的可能性，并对给予了我们如此之多的开源社区进行回馈</strong>。我们邀请你一同加入这段旅程，期待你的反馈和贡献。</p>
<p><em>你会用 Lynx 创造些什么呢？</em></p>
<p><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/blog/lynx-unlock-native-for-more.png" alt="lynx-unlock-native-for-more"/></p><!--/$-->]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lynx 博客]]></title>
            <link>https://lynxjs.org/zh/blog/</link>
            <guid isPermaLink="false">/zh/blog/</guid>
        </item>
    </channel>
</rss>