我的旧主题是基于初学前端时写的 Fuji 主题构建的大改版,而在历经多次小修小补之后终于进入了维护不动的的状态。无论是 Hugo 模板本身,还是相配的 JS 和 CSS 都进入了完全的混乱状态。趁着近期有一点时间,是时候来一次重构了。
可以明显的看出来,vue-cli2.0与3.0在目录结构方面,有明显的不同(vue3.0我是安装了css预处理器,所以看上去内容更丰富哈)
Node.js 所有的异步 I/O 操作在完成时都会发送一个事件到事件队列,Node.js 里面的许多对象都会触发分发事件:一个 net.Server 对象会在每次有新连接时触发一个事件, 一个 fs.readStream 对象会在文件被打开的时候触发一个事件。 所有这些产生事件的对象都是 events.EventEmitter 的实例。
在 v5 中,官方改造了所有的 Token,使其基于 Seed + Algorithm 可以派生出所有的 Design Token。全新的 Design Token 模型支持多算法 Pipeline,从而大大降低开发者拓展成本。
且定位不到弹窗(通过查资料可知道,直接给时间控件input属性赋值是最快捷的方法)
基于Vuecli搭建的vue项目简单快捷,易于开发。在node.js的加持下你可以更快的引入万千JavaScript开发库,仅仅依靠前端就可以实现以前使用后端才能实现的功能,如通过axios便可以快捷的与后端进行数据交互等。
Node.js 19 在19日正式发布了,此次更新包括将 V8 JavaScript 引擎更新到 10.7,以及默认启用 HTTP (s)/1.1 KeepAlive。
在做React Native开发时,少不了的需要对React Native程序进行调试。调试程序是每一位开发者的基本功,高效的调试不仅能提高开发效率,也能降低Bug率。 Developer Menu Android模拟器: 可以通过Command⌘ + M 快捷键来快速打开Developer Menu。也可以通过模拟器上的菜单键来打开。 iOS模拟器: 可以通过Command⌘ + D快捷键来快速打开Developer Menu。 在真机上开启Developer Menu: 在真机上你可以通过摇动手机来开启
ng-if 指令可以根据表示的结果 在DOM中生成或者移除一个元素 而且是完全移除 不是隐藏或者显示
Node.js 里面的许多对象都会分发事件:一个 net.Server 对象会在每次有新连接时触发一个事件, 一个 fs.readStream 对象会在文件被打开的时候触发一个事件。 所有这些产生事件的对象都是 events.EventEmitter 的实例。
可以明显的看出来,vue-cli2.0与3.0在目录结构方面有明显的不同: 1. vue-cli3移除了配置文件目录:config 和 build 文件夹,增加了vue.config.js文件 2. vue-cli3移除了 static 静态文件夹 3. vue-cli3新增了 public 文件夹 4. vue-cli3将index.html 移动到 public 中
早期,webpack 的目的是允许在浏览器中运行大多数 node.js 模块,但是模块整体格局发生了变化,现在许多模块的主要用途是以编写前端为目的。webpack <= 4 附带了许多 Node.js 核心模块的 polyfil,一旦模块中使用了任何核心模块(即 ”crypto“ 模块),这些模块就会被自动启用。
在plugins节点下的htmlWebpackPlugin插件中,添加minify子节点:
Yarn 是一个 JavaScript 包管理器,它兼容于 npm,可以帮助你自动处理安装,升级,配置,和移除 npm 包。
Bun 1.0 已经发布;它被设计成 Node.js 的替代品。Bun 速度很,但速度是唯一重要的因素吗?
整体分成三块进行开发,使用面向对象式编程进行开发(其实我更喜欢用函数式编程,但苦于游戏的一些状态用对象来存储会更直观一些):
在前天的公众号文章《别去送死了。Selenium 与 Puppeteer 能被网站探测的几十个特征》中,我们提到目前网上的反检测方法几乎都是掩耳盗铃,因为模拟浏览器有几十个特征可以被检测,仅仅隐藏 webdriver 这一个值是没有任何意义的。
和 CSS 框架一样,Laravel 不强制你使用什么 JavaScript 客户端框架,但是开箱对 Vue.js 提供了良好的支持,如果你更熟悉 React 的话,也可以将默认的脚手架代码替换成 React,实现细节参考官方文档。
使用JavaScript实现一个俄罗斯方块 清明假期期间,闲的无聊,就做了一个小游戏玩玩,目前游戏逻辑上暂未发现bug,只不过样子稍微丑了一些-.- 项目地址:https:
打包压缩js与css 由于webpack本身集成了UglifyJS插件(webpack.optimize.UglifyJsPlugin)来完成对JS与CSS的压缩混淆,无需引用额外的插件, 其命令webpack -p即表示调用UglifyJS来压缩代码,还有不少webpack插件如html-webpack-plugin也会默认使用UglifyJS。 uglify-js的发行版本只支持ES5,如果你要压缩ES6+代码请使用兼容开发分支。 UglifyJS可用的选项有: parse 解释 compr
在做React Native开发时,少不了的需要对React Native程序进行调试。调试程序是每一位开发者的基本功,高效的调试不仅能提高开发效率,也能降低Bug率。本文将向大家分享React Native程序调试的一些技巧和心得。 Developer Menu Developer Menu是React Native给开发者定制的一个开发者菜单,来帮助开发者调试React Native应用。 提示:生产环境release (production) 下Developer Menu是不可用的。 如何开启Dev
首先打开yarm的官网。https://www.yarnpkg.com/zh-Hant/
本文最先发布在: https://www.itcoder.tech/posts/how-to-install-yarn-on-ubuntu-20-04/
本文出自《React Native学习笔记》系列文章。 在做React Native开发时,少不了的需要对React Native程序进行调试。调试程序是每一位开发者的基本功,高效的调试不仅能提高开发效率,也能降低Bug率。本文将向大家分享React Native程序调试的一些技巧和心得。 Developer Menu Developer Menu是React Native给开发者定制的一个开发者菜单,来帮助开发者调试React Native应用。 提示:生产环境release (production)
据了解,IE11只能在win7系统上运行,我们的电脑都是win10的不能远行,后来发现360兼容模式可以模拟IE11,并复现问题.
index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <link rel="stylesheet" href="style.css"> </head> <body> 03AngularDart4.0 高级-部署 顶 部署AngularDart web应用程序与部署其它web应用程序类似 , 除了你需要先将应用程序编译成JavaScript. 本页描述如何编译你的应用程序—使其更快更小的技巧—和引导你使用服务应用程序的一些资源.01vue/cle3项目运行报错sockjs-node/info解决方案继上次将vue项目脚手架工具从vue-cli2.x升级到vue-cli3.x后,除了环境、配置问题外,在运行时出现了一些个新的问题。 启动项目后,在内网非本机运行项目时,控制台报错如下:05《Docker极简教程》--Docker的高级特性--Docker Compose的使用Docker Compose是一个用于定义和运行多容器Docker应用程序的工具。它允许开发人员通过简单的YAML文件来定义应用程序的服务、网络和卷等资源,并使用单个命令来启动、停止和管理整个应用程序的容器。以下是关于Docker Compose的一些关键信息和优势:01开源库架构实战——从0到1搭建属于你自己的开源库最近在 H5 开发与 APP 客户端工程师的联调过程中, 经常需要实现一些常用的移动端事件封装成接口提供给客户端,例如用户的单击 tap 事件、双击事件、长按事件以及拖动事件。但由于浏览器默认只提供了 touchstart、touchmove、touchend 三个原生事件,在实际的开发过程中,我们常用的解决方案便是通过监听touchstart 和 touchend 事件配合定时器来实现我们的自定义移动端事件,为了实现常用自定义事件的复用,我们对其进行了封装,并提供方便用户使用的工具函数,这也是我们实现 mt-events 的初衷。02抛弃 NPM ? Node.js 社区正为启用新的包管理方式争论不休!在 Node.js 社区中,关于默认开启 Corepack 的提议引发了激烈的争论,我在文末也发了个投票想看看大家的想法。01「译」JavaScript 究竟是如何工作的?(第二部分)我们通常会使用这种简单有效的算法来判定可以从内存堆中安全清除的对象。算法的工作方式正如其名:将对象标记为可获得/不可获得,并将不可获得的对象清除。 垃圾回收器周期性地从根部或者全局对象开始,移向被它们引用的对象,接着再移向被这些对象引用的对象,以此类推。所有不可获得的对象会在之后被清除。01NodeJS教程Node.js 是一个基于Chrome JavaScript 运行时建立的一个平台。04electron 配置使用NodeJS API在Electron中,主进程和渲染进程是两个不同的执行上下文。主进程运行在Node.js环境中,可以访问Node.js的API和原生操作系统功能。渲染进程则运行在浏览器环境中,具有访问DOM和Web API的能力,但默认情况下无法直接访问Node.js的API。如果一定要使用,需要修改配置。01JS 静态类型检查工具 Flow本文主要介绍了解决JS作为弱类型语言没有类型检查痛点的静态类型检查工具 Flow ,并且介绍了在WebStorm中使用Flow的方法,最后介绍了一些常用的Flow语法。05在Creator3D中使用protobuf的快速解决方法!在这里分享一下在 Creator 3D 中集成 protobufjs 遇到的问题,如果你在 Creator 3D 中使用其它JS三方库,也会有一定的帮助。02为生产环境编译 Angular 2 应用Angular 2 已经发布了 2.1.2 版本, 相信很多人已经在使用(试用)了, 相比 AngularJS 1.x , Angular 2 在性能上有了长足的进步, 同时 Angular 2 也变得非常的庞大, 动辄几兆的脚本, 如何部署到生产环境? 接下来就介绍如何为生产环境编译 Angular 2 应用, 在本文中, 我们将 Angular 2 官方文档中的 Hello Angular 应用编译到 50K 以下, 以用于生产环境。03JS中的垃圾回收与内存泄漏Javascript具有自动垃圾回收机制(GC:Garbage Collecation),也就是说,执行环境会负责管理代码执行过程中使用的内存。其原理是:垃圾收集器会定期(周期性)找出那些不在继续使用的变量,然后释放其内存。但是这个过程不是实时的,因为其开销比较大并且GC时停止响应其他操作,所以垃圾回收器会按照固定的时间间隔周期性的执行。03你不知道的 MutationObserver在某些场景下,我们希望能监视 DOM 树的变动,然后做一些相关的操作。比如监听元素被插入 DOM 或从 DOM 树中移除,然后添加相应的动画效果。或者在富文本编辑器中输入特殊的符号,如 # 或 @ 符号时自动高亮后面的内容等。要实现这些功能,我们就可以考虑使用 MutationObserver API,接下来阿宝哥将带大家一起来探索 MutationObserver API 所提供的强大能力。02如何解决内存泄漏引发的血案之前做了一个谷歌浏览器的插件开发,它会打开一个链接,然后收集数据并上传。依次循环,但是跑的时间久了,内存就变得很高,然后浏览器就会变卡,慢慢的影响这个插件的运行,最后浏览器也会崩溃。01yarn的安装和使用:Yarn 快速上手指南本文深入浅出地讲述了Yarn这一重要的包管理器的安装和使用,针对初学者和高级开发者都提供了宝贵的信息。通过本文,您将了解到Yarn的基本概念、安装步骤、常用命令及其优势。本文囊括了大量与Node.js、npm、包管理、项目依赖等词。01EJS 中文文档你也可以使用快捷方式 ejs.render(dataAndOptions); ,其中你可以通过一个对象来传递任何东西。在这种情况下,你需要以一个装有所有需要传递对象的本地变量结束。02如何快速开发 CLI,Oclif 了解一下CLI(Command Line Interface)命令行界面是在图形用户界面得到普及之前使用最为广泛的用户界面,它通常不支持鼠标,用户通过键盘输入指令,计算机接收到指令后,予以执行。也有人称之为字符用户界面(character user interface,CUI)。01精读JavaScript错误堆栈处理错误处理无论对那种语言来说,都至关重要。在 JavaScript 中主要是通过 Error 对象和 Stack Traces 提供有价值的错误堆栈,帮助开发者调试。在服务端开发中,开发者可以将有价值错误信息打印到服务器日志中,而对于客户端而言就很难重现用户环境下的报错,我们团队一直在做一个错误监控的应用,在这里也和大家一起讨论下 js 异常监控的常规方式。03Node.js组成及Events模块Node.js本身提供许多模块,每个模块实现一种功能,如文件操作模块fs,构建HTTP服务的http模块等,每个模块都是一个javascript文件,可以自己编写模块。03构建工具tsup入门第二部分在这一节中你将了解到 tsup 如何压缩代码、如何代码拆分、如何做 tree shaking、捆绑的格式有哪些以及配置目标环境,内容较多,请各位小伙伴准备好,马上要开始了~02React——Flow代码静态检查 转Flow是Facebook开源的静态代码检查工具,他的作用是在运行代码之前对React组件以及Jsx语法进行静态代码的检查以发现一些可能存在的问题。Flow可以用于所有前端开发的项目而不仅仅局限于React,码友们可以到官网仔细了解(友情提示:可能需要VPN,非常不稳定),本文只介绍如何配合React开发使用。01扫码添加站长 进交流群领取专属 10元无门槛券手把手带您无忧上云相关资讯借助Wasmer-JS在浏览器和Node.js上运行WASITensorFlow.js发布:使用JS进行机器学习并在浏览器中运行Node.js 10.7.0 发布,基于 V8 的 JavaScript 运行时结合源码分析 Node.js 模块加载与运行原理Scala.js 0.6.23 发布,在浏览器上运行 Scala热门标签更多标签云服务器ICP备案实时音视频对象存储云直播活动推荐运营活动广告关闭领券
部署AngularDart web应用程序与部署其它web应用程序类似 , 除了你需要先将应用程序编译成JavaScript. 本页描述如何编译你的应用程序—使其更快更小的技巧—和引导你使用服务应用程序的一些资源.
继上次将vue项目脚手架工具从vue-cli2.x升级到vue-cli3.x后,除了环境、配置问题外,在运行时出现了一些个新的问题。 启动项目后,在内网非本机运行项目时,控制台报错如下:
Docker Compose是一个用于定义和运行多容器Docker应用程序的工具。它允许开发人员通过简单的YAML文件来定义应用程序的服务、网络和卷等资源,并使用单个命令来启动、停止和管理整个应用程序的容器。以下是关于Docker Compose的一些关键信息和优势:
最近在 H5 开发与 APP 客户端工程师的联调过程中, 经常需要实现一些常用的移动端事件封装成接口提供给客户端,例如用户的单击 tap 事件、双击事件、长按事件以及拖动事件。但由于浏览器默认只提供了 touchstart、touchmove、touchend 三个原生事件,在实际的开发过程中,我们常用的解决方案便是通过监听touchstart 和 touchend 事件配合定时器来实现我们的自定义移动端事件,为了实现常用自定义事件的复用,我们对其进行了封装,并提供方便用户使用的工具函数,这也是我们实现 mt-events 的初衷。
在 Node.js 社区中,关于默认开启 Corepack 的提议引发了激烈的争论,我在文末也发了个投票想看看大家的想法。
我们通常会使用这种简单有效的算法来判定可以从内存堆中安全清除的对象。算法的工作方式正如其名:将对象标记为可获得/不可获得,并将不可获得的对象清除。 垃圾回收器周期性地从根部或者全局对象开始,移向被它们引用的对象,接着再移向被这些对象引用的对象,以此类推。所有不可获得的对象会在之后被清除。
Node.js 是一个基于Chrome JavaScript 运行时建立的一个平台。
在Electron中,主进程和渲染进程是两个不同的执行上下文。主进程运行在Node.js环境中,可以访问Node.js的API和原生操作系统功能。渲染进程则运行在浏览器环境中,具有访问DOM和Web API的能力,但默认情况下无法直接访问Node.js的API。如果一定要使用,需要修改配置。
本文主要介绍了解决JS作为弱类型语言没有类型检查痛点的静态类型检查工具 Flow ,并且介绍了在WebStorm中使用Flow的方法,最后介绍了一些常用的Flow语法。
在这里分享一下在 Creator 3D 中集成 protobufjs 遇到的问题,如果你在 Creator 3D 中使用其它JS三方库,也会有一定的帮助。
Angular 2 已经发布了 2.1.2 版本, 相信很多人已经在使用(试用)了, 相比 AngularJS 1.x , Angular 2 在性能上有了长足的进步, 同时 Angular 2 也变得非常的庞大, 动辄几兆的脚本, 如何部署到生产环境? 接下来就介绍如何为生产环境编译 Angular 2 应用, 在本文中, 我们将 Angular 2 官方文档中的 Hello Angular 应用编译到 50K 以下, 以用于生产环境。
Javascript具有自动垃圾回收机制(GC:Garbage Collecation),也就是说,执行环境会负责管理代码执行过程中使用的内存。其原理是:垃圾收集器会定期(周期性)找出那些不在继续使用的变量,然后释放其内存。但是这个过程不是实时的,因为其开销比较大并且GC时停止响应其他操作,所以垃圾回收器会按照固定的时间间隔周期性的执行。
在某些场景下,我们希望能监视 DOM 树的变动,然后做一些相关的操作。比如监听元素被插入 DOM 或从 DOM 树中移除,然后添加相应的动画效果。或者在富文本编辑器中输入特殊的符号,如 # 或 @ 符号时自动高亮后面的内容等。要实现这些功能,我们就可以考虑使用 MutationObserver API,接下来阿宝哥将带大家一起来探索 MutationObserver API 所提供的强大能力。
之前做了一个谷歌浏览器的插件开发,它会打开一个链接,然后收集数据并上传。依次循环,但是跑的时间久了,内存就变得很高,然后浏览器就会变卡,慢慢的影响这个插件的运行,最后浏览器也会崩溃。
本文深入浅出地讲述了Yarn这一重要的包管理器的安装和使用,针对初学者和高级开发者都提供了宝贵的信息。通过本文,您将了解到Yarn的基本概念、安装步骤、常用命令及其优势。本文囊括了大量与Node.js、npm、包管理、项目依赖等词。
你也可以使用快捷方式 ejs.render(dataAndOptions); ,其中你可以通过一个对象来传递任何东西。在这种情况下,你需要以一个装有所有需要传递对象的本地变量结束。
CLI(Command Line Interface)命令行界面是在图形用户界面得到普及之前使用最为广泛的用户界面,它通常不支持鼠标,用户通过键盘输入指令,计算机接收到指令后,予以执行。也有人称之为字符用户界面(character user interface,CUI)。
错误处理无论对那种语言来说,都至关重要。在 JavaScript 中主要是通过 Error 对象和 Stack Traces 提供有价值的错误堆栈,帮助开发者调试。在服务端开发中,开发者可以将有价值错误信息打印到服务器日志中,而对于客户端而言就很难重现用户环境下的报错,我们团队一直在做一个错误监控的应用,在这里也和大家一起讨论下 js 异常监控的常规方式。
Node.js本身提供许多模块,每个模块实现一种功能,如文件操作模块fs,构建HTTP服务的http模块等,每个模块都是一个javascript文件,可以自己编写模块。
在这一节中你将了解到 tsup 如何压缩代码、如何代码拆分、如何做 tree shaking、捆绑的格式有哪些以及配置目标环境,内容较多,请各位小伙伴准备好,马上要开始了~
Flow是Facebook开源的静态代码检查工具,他的作用是在运行代码之前对React组件以及Jsx语法进行静态代码的检查以发现一些可能存在的问题。Flow可以用于所有前端开发的项目而不仅仅局限于React,码友们可以到官网仔细了解(友情提示:可能需要VPN,非常不稳定),本文只介绍如何配合React开发使用。
领取专属 10元无门槛券
手把手带您无忧上云