问题:随着项目变大,开发可能变得越来越复杂,例如运行或打包速度,有什么好的优化经历过好的方法?
未来一定是可视化编程的方向,前端变得无论多复杂,理应都应该是属于前端,意思就是仅仅只是展示页面的功能。
那么变大的过程,就属于开发的代码足够多,自然会有运行和打包速度的问题,那么直接解决方法就是分组件,分模块。
无论是开发代码还是运行代码,都应该是按需加载,缓存加载,空闲时间加载。
{"lastUpload":"2020-04-02T01:43:45.269Z","extensionVersion":"v3.4.3"} |
var inProgress = {}; | |
var dataWebpackPrefix = "kevisual:"; | |
// loadScript function to load a script via script tag | |
__webpack_require__.l = (url, done, key, chunkId) => { | |
if(inProgress[url]) { inProgress[url].push(done); return; } | |
var script, needAttach; | |
if(key !== undefined) { | |
var scripts = document.getElementsByTagName("script"); | |
for(var i = 0; i < scripts.length; i++) { | |
var s = scripts[i]; |
孔曰成仁,孟曰取义。惟其义尽,所以仁至。 | |
读圣贤书,所学何事?而今而后,庶几无愧。 |
import os | |
import shutil | |
# path可以根据具体情况设置 | |
path = '/Users/xion/归档/km/web' | |
delete_list = [] | |
def get_py(path): |
// ==UserScript== | |
// @name print juejin | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author abearxiong | |
// @match *://juejin.cn/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=juejin.cn | |
// @grant none | |
// ==/UserScript== |
copy from https://github.com/arry-lee/wereader
// test Array.from | |
// 第一个参数为来源的值 | |
// 第二个参数为映射转化函数(可选) | |
// 第三个为第二个参数提供this(可选) | |
let helper = { | |
diff: 1, | |
add(value) { | |
return value + this.diff; | |
} |
const main = async () => { | |
const cssUrl = 'https://cdn.bootcdn.net/ajax/libs/tailwindcss/2.2.19/tailwind.min.css'; | |
const lib = await System.import(cssUrl) | |
if(lib && lib.default) { | |
root.adoptedStyleSheets = [...root.adoptedStyleSheets, lib.default] | |
} | |
} | |
main(); |
const main = async () => { | |
const libUrl = 'https://cdn.jsdelivr.net/npm/marked/marked.min.js'; | |
const lib = await System.import(libUrl); | |
if(lib) { | |
const marked = lib.default; | |
const markdown = `# markddown` | |
app.innerHTML = marked.parse(markdown); | |
} | |
}; | |
main(); |