今日读书笔记
React Hooks的体系设计之一 - 分层
- 最底层的内置hook,不需要自己实现,官方直接提供
- 简化状态更新方式的hook,比较经典的是引入immer来达到更方便地进行不可变更新的目的
- 引入“状态 + 行为”的概念,通过声明状态结构与相应行为快速创建一个完整上下文
- 对常见数据结构的操作进行封装,如数组的操作
- 针对通用业务场景进行封装,如分页的列表、滚动加载的列表、多选等
- 实际面向业务的实现
Developers: Get Ready for New SameSite=None; Secure Cookie Settings
- 跨域相较于
SameSite
更严格 zhimg.com 引起的知识点总结 First-party cookies
(same-site
)和Third-party cookies
(cross-site
)
SameSite cookies explained
The site is the combination of the domain suffix and the part of the domain just before it. For example, the
www.web.dev
domain is part of theweb.dev
site.
The public suffix list defines this, so it’s not just top-level domains like
.com
but also includes services likegithub.io
. That enablesyour-project.github.io
andmy-project.github
.io to count as separate sites.
site
就是 suffix
前面那一部分:www.web.dev
就是 web
;your-project.github.io
就是 your-project
。
所以:
- If the user is on
www.web.dev
and requests an image fromstatic.web.dev
then that is a same-site request. - If the user is on
your-project.github.io
and requests an image frommy-project.github.io
that’s a cross-site request.
怎么读 ECMAScript 规范
- https://v8.dev/blog/understanding-ecmascript-part-1
- https://timothygu.me/es-howto/
具体规范中语法的表达是容易看懂的,但是规范会自定义些标识符或者操作符,这个是需要理解的。
以上。