http://2ality.com/ JavaScript and more http://exploringjs.com/es6/index.html#toc_ch_about-es6 Exploring ES6
Service Worker
https://developers.google.com/web/fundamentals/primers/service-worker/
ajax
var xhr = new XMLHttpRequest(); xhr.open('POST', '/api/fruits/create'); xhr.send(JSON.stringify({ someKey: someValue })); xhr.onreadystatechange = function() { if (xhr.readyState == 4) { if (xhr.status === 200) { // do something } else { // handle error } } }
common webpack questions
https://github.com/webpack/webpack-dev-server/issues/377 ``` you should not use [chunkhash] or [hash] for development. This will cause many other issues, like a memory leak, because the dev server does not know when to clean up the old files. ```
webpack
https://github.com/webpack/webpack/issues/1151
Just use webpack-dev-server --hot --inline
and don't anything special about webpack-dev-server or HMR to your webpack.config.js.
promise promise rejection: http://2ality.com/2016/03/promise-rejections-vs-exceptions.html
jasmine global.process.listeners
使用 jasmine 2.6.0 会报 global.process.listeners is not a function
错误
我搭建了一个环境试图在浏览器重现这个问题但是失败了:https://jsbin.com/fukeguq
查看源代码发现问题应该在这里:https://github.com/jasmine/jasmine/blob/v2.6.0/lib/jasmine-core/jasmine.js#L2179-L2180
在浏览器环境下 global.process.listeners 对象是 undefined
eslint
useful trick.
- eslint --print-config <path> Print the configuration for the given file