原则每半个月更新拉取最新的源码进行分析,如果我在搞其他包,那么可能会延迟,但不会超过一个月。
包更新内容主要涉及当前已完善的部分,像 dev-tools 这种尚未写源码的不会跟踪其变化。
快速比对两次分支之间提交的次数,居然不是数数:
git rev-list --count temp..main
2026/04/10
本次更新记录 git 提交版本为 705268dcd16779b1f51f234cebaa588d761202ce ,提交日期为 2026 年 4 月 11 日 00:14
距离上一个提交期间共 25 次提交。
不知为啥,命名距离上一次提交过去一个月了,但是这一个月仅增加了 25 次提交,且大多提交是注释的维护
更新的 packages/ 下内容但目前不在完成的包:
- eslint-plugin-react-hooks
- internal-test-utils
- react-devtools-shared
- react-devtools-shell
- react-native-renderer
- react-noop-renderer
- react-server
- react-server-dom-webpack
react
- 修改了 ReactAct 中一段 eslint 注释。
react-dom-bindings
CSSShorthandProperty
- 添加了
borderBlock、borderBlockColor、borderBlockStyle、borderBlockWidth、borderInline、borderInlineColor、borderInlineStyle、borderInlineWidth、borderInlineStyle、borderInlineWidth、colorAdjust、containIntrinsicSize、container、fontSynthesis、inset、insetBlock、insetInline、marginBlock、marginInline、offset、overscrollBehavior、paddingBlock、paddingInline、pageBreakAfter、pageBreakBefore、pageBreakInside、scrollMargin、scrollMarginBlock、scrollMarginInline、scrollPadding、scrollPaddingBlock、scrollPaddingInline、textWrap、verticalAlign、whiteSpace textDecoration添加了textDecorationThicknesstransition添加了transitionBehavior
ReactFiberConfigDOM
- 把 ReactFiberConfigDOM 中注释
teh改成the
ReactFizzConfigDOM
- 把 writeHoistablesForBoundary 中的
becuase改成because
react-reconciler
ReactFiberCommitViewTransitions
- 强化 applyViewTransitionToHostInstancesRecursive 判定
supportsMutation为false时逻辑 - 强化 measureViewTransitionHostInstancesRecursive 判定
supportsMutation为false时逻辑
ReactFiberCompleteWork
- 修改 complete 注释
becuase为because
ReactFiberConfigWithNoMutation
移除了
export const applyViewTransitionName = shim;
export const restoreViewTransitionName = shim;
export const cancelViewTransitionName = shim;
export const cancelRootViewTransitionName = shim;
export const restoreRootViewTransitionName = shim;
export const cloneRootViewTransitionContainer = shim;
export const removeRootViewTransitionClone = shim;
export type InstanceMeasurement = null;
export const measureInstance = shim;
export const measureClonedInstance = shim;
export const wasInstanceInViewport = shim;
export const hasInstanceChanged = shim;
export const hasInstanceAffectedParent = shim;
export const startViewTransition = shim;
export type RunningViewTransition = null;
export const startGestureTransition = shim;
export const stopViewTransition = shim;
export const addViewTransitionFinishedListener = shim;
export type ViewTransitionInstance = null | {name: string, ...};
export const createViewTransitionInstance = shim;
ReactFiberConfigWithNoViewTransition
- 添加了该文件
ReactFiberNewContext
- 维护 propagateContextChanges 在子元素上的判定
ReactFiberWorkLoop
- 添加了常量
NO_NESTED_UPDATE、NESTED_UPDATE_SYNC_LANE、NESTED_UPDATE_PHASE_SPAWN - 添加了变量
nestedUpdateKind - 更正函数 workLoopConcurrent 中注释
occuring为occurring - 加强了 flushSpawnedWork 中古关于水合任务是否安排同步更新的判定
- 完善了 pingSuspendedRoot 中关于渲染阶段发生的更新循环
- 加强了 throwIfInfiniteUpdateLoopDetected 中启用无限渲染循环检测的逻辑
shared
ReactFeatureFlags
- 添加了
enableViewTransitionForPersistenceMode、eprh_enableUseKeyedStateCompilerLint、eprh_enableVerboseNoSetStateInEffectCompilerLint、eprh_enableExhaustiveEffectDependenciesCompilerLint可导出常量
ReactTypes
- 为
ReactErrorInfoDev添加了可选属性errors,该值类型为JSONValue
2026/03/12
本次更新记录 git 提交版本为 c80a07509582daadf275f36ffe7a88c3b12e9db4 ,提交日期为 2026 年 3 月 13 日 05:36
距离上一个提交期间共 71 次提交。
更新的 packages/ 下内容但目前不在完成的包:
- eslint-plugin-react-hooks
- react-client
- react-devtools
- react-devtools-core
- react-devtools-extensions
- react-devtools-fusebox
- react-devtools-inline
- react-devtools-shared
- react-markup
- react-native-renderer
- react-noop-renderer
- react-server
- react-server-dom-webpack
react-dom
更新了部分测试文件。
react-dom-bindings
ReactFiberConfigDOM
- 类型 Props 添加了
type?: string字段 - 类型 InstanceWithFragmentHandles 字段
unstable_reactFragments更新为reactFragments - 在 472 行插入了函数 isScriptDataBlock
- 调整了 FragmentInstance.prototype.blur 实现逻辑和其他部分逻辑(比如说
element命名改node) - 调整了 addFragmentHandleToInstance 中第一参数
instance的字段(与上面InstanceWithFragmentHandles部分保持一致)由unstable_reactFragments更新为reactFragments - 调整了 commitNewChildToFragmentInstance 第一参数的类型及涉及的逻辑
- 调整了 deleteChildFromFragmentInstance 第一参数的类型及涉及的逻辑
- 调整了 setFocusIfFocusable 实现逻辑
DOMEventNames
- 类型
DOMEventName添加了 'fullscreenerror'
DOMEventProperties
- 常量数组 simpleEventPluginEvents 添加了
fullscreenChange、fullscreenError子项
ReactDOMEventListener
- 函数 getEventPriority 内部实现
switch分支添加了fullscreenerror以与上面添加关于全屏的情况进行协调
ReactFizzConfigDOM
- 函数 hasSuspenseyContent 添加了第二参数
flushingInShell
ReactFizzConfigDOMLegacy
- 函数 hasSuspenseyContent 添加了第二参数
flushingInShell
getAttributeAlias
- 常数 Map aliases 添加了
maskType: 'mask-type'项
possibleStandardNames
- 常量对象 possibleStandardNames 添加了键值对
masktype: 'maskType'
react-reconciler
index.js
- 根文件更新了类型
getComponentNameFromFiber
- 函数 getComponentNameFromFiber 的
switch<OffscreenComponent>更新了逻辑,由原来的Offscreen返回更新为判断返回null或getComponentNameFromFiber(fiber.return)(递归调用了自身)
ReactFiberBeginWork
-
在函数 updateClassComponent 内部添加了注释
-
在函数 attemptEarlyBailoutIfNoScheduledUpdate 添加了内容更新的逻辑用于加强挂起组件在父级上下文个发生更改时逻辑
ReactFiberCommitHostEffects
- 函数 enableFragmentRefsTextNodes 添加了判定要求组件不能是 text 节点的 fiber
ReactFiberCommitWork
- 函数 commitDeletionEffectsOnFiber 更新了宿主组件(
HostComponent)switch分支的判定逻辑及简单缓存组件(SimpleMemoComponent)switch分支逻辑强化(移除了记录组件卸载时间的判定条件) - 函数 disappearLayoutEffects 更新了宿主组件(
HostComponent)switch分支的内部判定逻辑
ReactFiberHooks
- 函数 dispatchActionState 修改了抛出错误的文本描述
ReactFiberNewContext
- 函数 propagateContextChanges 添加了挂起且非缓存状态组件逻辑
- 函数 lazilyPropagateParentContextChanges 添加了返回值
- 函数 propagateParentContextChanges 添加了返回值
shared
ReactFeatureFlags
- 直接更改了常量 enableFragmentRefsInstanceHandles 的值
- 移除了常量 enableHiddenSubtreeInsertionEffectCleanup
- 直接更改了常量 enableTrustedTypesIntegration 的值
ReactTypes
- 添加了导出类型 JSONValue
- 为类型 ReactErrorInfoDev 添加了
cause?: JSONValue可选字段
2026/02/10
本次更新记录 git 提交版本为 6a939d0b54a0e1aded58652a307cfc083b691d67 ,提交日期为 2026 年 2 月 10 日 06:14
距离上一个提交期间共 27 次提交。
但是这两个月已纪录的代码没有新的维护,貌似这两个月主要维护的重心放在 eslint 的适配、ssr 、react-devtools 上。
当然,也维护了 react-dom-bindings 部分内容,但本部分内容本站记录未完善,按最新的进行记录。
react-dom 部分只维护了测试相关的代码。
2025/12/14
本次更新记录 git 提交版本为 b061b597f77c979531a3f2c9c04ba435342b0043 ,提交日期为 2025年12月12日 22:06
距离上一个提交期间共 18 次提交。
但本周更新内容未涉及目前已有内容。
但是写本片日志的原因是完成了 react 的基本源码信息。
2025/12/07
本次更新记录 git 提交版本为 41745339cd258065e47a692bb29d925561b70f08 ,提交日期为 2025 年 12 月 7 日 18:46
本次更新内容:
- React 使用
ReactKey代替了string | null的类型 - 多处增加了对乐观键的支持