Time Slicing 和Suspense实现

time slice时间分片,render不会阻塞线程,整段渲染 Suspense主要解决网络io问题,避免redux、soga库的副作用,以同步方式写异步组件。 最应用的例子就是:一张图片加载,抖动内容区域。用Suspense就可以完美解决,在图片加载完后,render整个区域。 具体实现可以看这里createFeatcher 12345678910111213141516const getBulbasaur = () =>

Read More...

vdom解析

前言谈到vdom,vue借鉴snabbdom、react的vdom拿司徒的介绍来说: 最开始经典的深度优先遍历DFS算法,其复杂度为O(n^3),存在高昂的diff成本,然后是cito.js的横空出世,它对今后所有虚拟DOM的算法都有重大影响。它采用两端同时进行比较的算法,将diff速度拉高到几个层次。紧随其后的是kivi.js,在cito.js的基出提出两项优化方案,使用key实现移动追踪及基于key的编辑长度距离算法应用(算法复杂

Read More...

why use hook?

Not magic,just array 组件化组织 hoc 定义:已component为参数,包装成一个新组建 缺点:hoc当组合多个的时候,代码维护及阅读成本指数上升。 高阶组件对于使用者来说里面是黑盒的,数据公用逻辑处理怎么。这种就不适用hoc render-props 定义:通过一个函数将class组件的state作为props传递给纯函数组件 缺点:嵌套较多,地狱回调。如何性能优化 生命周期就是个错误?举个

Read More...

svelte前生今世

introduction catalogue Feature Source code Application Optimize feature component lifectyle scoped styles custom-elements hello world12345{#if isVisible} <div class="todo {todo.done ? 'do

Read More...

LeetCode-1-TwoSum

ProblemGiven an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the same element twice.

Read More...

hexo升级https

ssl申请 申请免费的SSL,注册clouldflare服务商的服务. 登陆后将nameserver设置成clouldflare提供的地址 ssl设置 cname转向bluetomlee.github.io 后台顶部的Crypto中,进入Crypto,将SSL选项设置为“Flexible”,这个的意思是访客到cf的过程是加密的,而cf到github pages不是加密的 将hexo根目录配置文件_c

Read More...

casper爬虫用例

模拟登陆百姓网1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374var casper = require('casper').create();var conf = { 'baixing' : &

Read More...

某次淘宝数据的爬虫

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051/** @Author: bluetom* @Date: 2015-08-13 17:22:39* @Last Modified by: bluetom*/'use strict';var request = require('request')

Read More...

node批处理文本

接到个需求,其中涉及到对txt的批处理,node的readline也可方便处理此类文本 sample:1230 植物-根1 植物-22 植物-3 代码如下: 12345678910111213141516171819var line = require('readline');var fs = require('fs');var path = require('path');var logFile = path.join(__dirna

Read More...

FE头脑风暴

1,什么是传说中牛逼闪闪的团队?他们有什么特点? 专业 开放 对内:1.每个人可以cover对应的业务线2.对外流行及最新的技术解决方案、前端工程化道路(对于fis、gulp、webpack,淘宝)合适的选型,为什么no3. 不技术设限不个人设限(安卓、产品、运维、前端、node、后端)http、http2.0、webp有深度的广度,大家各有千秋 2,我们的优势是什么?我们的劣势是什么? 优势: 多种技术方案: r

Read More...