Closed newraina closed 2 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
rooch-portal | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Sep 9, 2024 2:53am |
rooch-portal-v2.1 | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Sep 9, 2024 2:53am |
@jojoo-eth it will cause all pages to be SSR, whether it is affected
@newraina 全部ssr,可能会对浏览器钱包相关功能产生影响。目前ui 没有完整的自动测试,需要你验证一下功能
@newraina 全部ssr,可能会对浏览器钱包相关功能产生影响。目前ui 没有完整的自动测试,需要你验证一下功能
@newraina yes, this could potentially lead to compatibility issues with certain wallet kits or wallets, particularly regarding behaviors such as operations involving local storage.
and thanks this pr, will have a detail check in the coming days
@newraina 全部ssr,可能会对浏览器钱包相关功能产生影响。目前ui 没有完整的自动测试,需要你验证一下功能
@wow-sven @jojoo-eth
对钱包功能没有影响,所有 use client
的组件都还是浏览器端渲染的。我在本地也用 next build + next start 测试过几个钱包功能,没发现啥问题。
之前可能没说清楚,全部页面 SSR 的意思是原本有些页面在 build 阶段就可以确定内容了(比如 not-found 页面),但现在因为每次请求页面 html 的时候需要一个新的随机字符串,所以每一个页面都会在请求的时候在 server 端重新 render 一次来确定内容。但这并不意味着所有的组件也都会在 server 端 render,原来是 client 组件现在还是。
下面这张图就是这个 PR 导致的 build 结果的前后变化,原本有些显示 ○ (static) 的路由现在也是 ƒ (dynamic)了,除了对页面的请求速度可能有些微不足道的影响外,可以说没有其他任何变化
The wallet feature works just fine, and any component that relies on the client side for rendering hasn't changed a bit.
Might've not made it clear before, but when I said all pages are going through SSR, it meant that certain pages had their content locked in at the build stage (take the not-found page, for example). But now, since every page load demands a fresh random string, each page gets a server-side make to figure out what it should show. This doesn't mean we're moving all components to server-side rendering, though. If it was a client-side component before, it still is.
The pic above lays out the before and after of the build results because of this PR. Routes that used to be marked with a ○ (meaning static) are now tagged with a ƒ (indicating dynamic). Other than a possible slight delay in how fast pages load, there's really nothing else worth mentioning.
Summary
Related with #1958
Add strict CSP rules to the Rooch Portal to prevent potential XSS attacks.
Disadvantage: it will cause all pages to be SSR. But this should be acceptable.
Test Result
Attempting to load script from a third-party domain
Example:
The application will refuse the connection:
Attempting to use inline script
Example:
The application will refuse to exec:
Attempting to use
eval
to execute concatenated codeExample:
The application will refuse to exec: