姜鑫

Results issues of 姜鑫

在源码的实现中,删除一个fiber节点的副作用处理,是通过循环模拟递归过程,使用 `rootChildrenToDelete`这个全局状态维护需要删除的host节点列表,同时使用`recordHostChildrenToDelete`做了同层sibling才添加到`rootChildrenToDelete`的限制,这在host节点都处在同一层时有效,但是场景扩展到在一棵将被删除的子树中,首层host节点分布在不同深度时,这个逻辑就不适用了。建议还是采用react源码实现中函数递归的形式处理删除副作用,这样可以在方便做host节点查找的截断的同时,不影响到host节点下子孙节点的卸载副作用处理 ```jsx // to delete first second ``` ```typescript function recordHostChildrenToDelete( childrenToDelete: FiberNode[], unmountFiber: FiberNode ) { // 1. 找到第一个root host节点 const lastOne = childrenToDelete[childrenToDelete.length - 1]; if (!lastOne)...

```js //@vitejs/[email protected] 内部实现 const dependencies = [ 'react', 'react-dom', jsxImportDevRuntime, jsxImportRuntime, ] config: (userConfig) => ({ build: silenceUseClientWarning(userConfig), optimizeDeps: { include: dependencies, }, }), ``` 建议在最新版本环境下不使用@vitejs/plugin-react这个插件来调试

Hello, I'm a newcomer using PlateJS. Following the "contributing guide," I pulled the source code using Git, and after running `yarn install` to complete the dependency installation, I encountered an...