忽如寄 huruji 撩我 Shenzhen http://tink.greywind.xyz 忽如寄也叫灰风GreyWind。 want to be a hero one day

startedmax-team/ts2php

started time in 3 minutes

starteddenysdovhan/bash-handbook

started time in a day

created taghuruji/saso

tagsaso@3.0.0

Zero config bundler to help you to build fantastic APP

created time in a day

push eventhuruji/saso

huruji

commit sha 63b57fa63421545badaea87867ec7c0cb515d666

chore: publish

view details

huruji

commit sha 4c6b09141bdecd58d0d1a468150f525523abfa0b

chore(release): publish - saso@2.0.0

view details

huruji

commit sha c8fe15fa25dfd80a14c4e59eea6172c654f60233

chore(release): publish - saso@3.0.0

view details

push time in a day

push eventhuruji/saso

huruji

commit sha 346b913782ed1b7a0257625194a568110f2d02cb

chore: :wrench: add recover lerna publish failed

view details

huruji

commit sha 84e1d8d43a2a13f21c6a125f1720b513176f5867

Merge branch 'master' of https://github.com/huruji/saso

view details

push time in a day

push eventhuruji/saso

huruji

commit sha 260f9bf466fdd151c4244f893b0800adc55c336d

chore(release): publish - saso@2.0.0

view details

push time in a day

created taghuruji/saso

tagsaso@2.0.0

Zero config bundler to help you to build fantastic APP

created time in a day

push eventhuruji/saso

huruji

commit sha caba44e4bc8ac44e9c571fca92279225dd90d22f

feat: :sparkles: add htmlminify opt

view details

huruji

commit sha 6613bad801eb8cb61428701eb61a21f46319424b

docs: :memo: htmlMinify doc

view details

push time in 2 days

push eventhuruji/saso

huruji

commit sha 58d5e0b90ca8130508f79769a3c1aa5ae24ff296

feat: :package: use url-replace-plugin

view details

push time in 2 days

startedmarko-js/marko

started time in 2 days

startedMSWorkers/support.996.ICU

started time in 2 days

startedBTOdell/replace-url-html-webpack-plugin

started time in 2 days

startedAlikhll/golang-developer-roadmap

started time in 2 days

startedFlipkart/recyclerlistview

started time in 3 days

push eventhuruji/saso

huruji

commit sha 88d445df75d0257df814904ce576c28ba89c9013

fix: :bug: :fire: remove unused package

view details

huruji

commit sha 81df36f0e639aeef81e43e1d67c289506f2454e6

chore(release): publish - saso@1.8.1

view details

push time in 4 days

created taghuruji/saso

tagsaso@1.8.1

Zero config bundler to help you to build fantastic APP

created time in 4 days

created taghuruji/saso

tagsaso@1.8.0

Zero config bundler to help you to build fantastic APP

created time in 4 days

push eventhuruji/saso

huruji

commit sha b061d3e1d46a546b2547c766167a601bf8d429ef

chore(release): publish - saso@1.8.0

view details

push time in 4 days

push eventhuruji/saso

huruji

commit sha 97325564d5f5e876f23ba54400d78fef1c49ae9a

feat: :sparkles: add script attribute

view details

push time in 4 days

created taghuruji/saso

tagsaso@1.7.2

Zero config bundler to help you to build fantastic APP

created time in 4 days

push eventhuruji/saso

huruji

commit sha 95f76d7aa54fc4ff59e0a9182cc9877d121810de

fix: :bug: react-example & clean dist

view details

huruji

commit sha 7b9cb6c00ca421057739318faa16177a94c3e305

chore(release): publish - saso@1.7.2

view details

push time in 4 days

startedhuruji/mini-web-monitor

started time in 4 days

PublicEvent

startedwannaxiao/crossorigin-webpack-plugin

started time in 5 days

startedstacktracejs/stacktrace.js

started time in 5 days

startedfacebook/flow

started time in 5 days

startedkaran/Projects

started time in 6 days

startedadamkdean/koa-serve

started time in 6 days

startedcburgmer/rasterizeHTML.js

started time in 6 days

startedliriliri/eustia

started time in 6 days

issue openedhuruji/blog

关于前端脚本异常监控的思考

最简单的上报

这里讲的是如何高效合理的捕捉与定位问题,不涉及 pv、uv、埋点之类的业务监控

首先我们要明白一点,前端如何捕获错误,在代码中我们可以经常使用 try...catch 来捕获错误,但是 try...catch 无法捕获语法错误和异步错误,如下

所以 try...catch 不适合做全局的异常监听,当然对于已知的可能会发生的错误,这个时候主动上报还是有用的

这个时候我们要想到在 window 上监听 error 事件,监听 error 事件可以返回相应的错误信息、脚本的url、行号、列号、error对象,如下(具体可参考https://developer.mozilla.org/zh-CN/docs/Web/API/GlobalEventHandlers/onerror):

window.onerror = (message, source, line, column, error) => {
     console.log(message)
     console.log(source)
     console.log(line)
     console.log(column)
     console.log(error)
}

const a = { b: 2 }

console.log(a.c.length + 1)

接下来就是上报异常信息了,这里当然可以通过 ajax 上报,这是肯定不会错的,不过如果你细心点看下自己公司的上报页面数据,包括监控我觉得大部分都会使用动态创建 img 标签来上报的,这样的好处在于不用处理跨域的问题,如下

const img = new Image()
img.url = `http://minitor.example.com?message=${msg}`

关于 sourcemap

现在的前端基本上都会使用 webpack 打包js,按照上方的这种简单的上报,上报的都是压缩后的代码,那么即使线上有错误看到这样的消息基本上也很难快速定位到问题,

生成 sourcemap 后的文件会在底部显示 sourcemap 的链接,如下: 浏览器就会根据这个链接去拉取代码的sourcemap,这样就是可以使用sourcemap了,如果你的浏览器可以生成拉取到 sourcemap 那么error 事件的 error 对象中就可以看到相应的源码的行数,这样也能快速定位问题,如下:

如何我们修改 sourcemap 的 url 地址,这样导致浏览器拉取不到sourcemap,报错信息就会像下面这样:

那么这样不就可以了吗,我们只要把 sourcemap 也暴露出去就行了呀,这里得区分下开发人员和用户了,对于开发人员来说,当监控告诉我线上有问题的时候,我当然希望自己能够浮现这个问题,这个时候暴露sourcemap给开发人员那当然是有助于及时定位问题的,但是对于普通用户来说,首先没法确认普通用户的浏览器是否支持sourcemap并且开启了sourcemap,还有一个问题就是有了sourcemap,就等于是把你的源代码给了别人看,这是否合适是值得商榷的。

综合以上两点,得出结论,sourcemap 希望开发人员能够得到,但是不希望普通用户看到源码。

created time in 6 days

push eventhuruji/saso

huruji

commit sha 34e5ecf61dede078d3b3be7f5c039ff6624c2486

chore(release): publish - saso@1.7.1

view details

push time in 6 days

created taghuruji/saso

tagsaso@1.7.1

Zero config bundler to help you to build fantastic APP

created time in 6 days

push eventhuruji/saso

huruji

commit sha 58c2cbc5e0b47a6261e1ef1f28c5240f9355eff4

fix: :bug: author info bug

view details

huruji

commit sha bf812e94debac9f6be0df8ccc22dd402c5408255

fix: :bug: prod mode sourcemap

view details

push time in 6 days

startedjoeyguo/blog

started time in 7 days

startedCodeTips/BaiduNetdiskPlugin-macOS

started time in 7 days

pull request commentfdgio/cube-react

多个 demo title 的bug

不清楚呀,我都从upstream上pull了代码

huruji

comment created time in 7 days

startedaxetroy/vscode-comment-autocomplete

started time in 7 days

starteddracula/dracula-theme

started time in 7 days

push eventhuruji/saso

huruji

commit sha f61a71bdd1d340c1cef2820d624c8c55a47915b5

chore: bootsrap

view details

huruji

commit sha 692c8864b86db1202574a0039c59b89141a49266

refactor: :memo: getport => portfinder

view details

huruji

commit sha 00cb3a922f16595ee2423949d34d3f2c637f928b

chore(release): publish - saso@1.7.0 - saso-log@1.5.0

view details

push time in 7 days

created taghuruji/saso

tagsaso-log@1.5.0

Zero config bundler to help you to build fantastic APP

created time in 7 days

created taghuruji/saso

tagsaso@1.7.0

Zero config bundler to help you to build fantastic APP

created time in 7 days

PR opened fdgio/cube-react

多个 demo title 的bug
+55 -15

0 comment

2 changed files

pr created time in 7 days

PR closed fdgio/cube-react

Reviewers
多个 demo title 的bug
+55 -15

0 comment

2 changed files

huruji

pr closed time in 7 days

push eventhuruji/cube-react

忽如寄

commit sha 2cc7d0c9600d74a57f289586575540f130e530fb

feat: :sparkles: :lipstick: highlight & title (#6) * feat: :sparkles: :lipstick: highlight & title * refactor: doc loader: title => demo

view details

huruji

commit sha 0d537b0d19732ad755466a94d918d4d3a0cf8d4a

Merge remote-tracking branch 'upstream/master' # Conflicts: # scripts/loaders/example/core.js

view details

push time in 7 days

PR opened fdgio/cube-react

多个 demo title 的bug
+268 -19

0 comment

11 changed files

pr created time in 7 days

push eventhuruji/cube-react

huruji

commit sha 7d0d0d1af7de9e9f053d65e5b299e539b2723516

fix: :bug: :memo: bug when multi titles

view details

push time in 7 days

fork huruji/cube-ui

:large_orange_diamond: A fantastic mobile ui lib implement by Vue

https://didi.github.io/cube-ui/

fork in 7 days

issue openedtarol/lerna-clear

请问这个能够使用吗?

created time in 8 days

push eventhuruji/saso

huruji

commit sha f270e1da828914903ca37e1a607b773b7ced99c0

chore(release): publish - saso@1.6.2

view details

push time in 8 days

created taghuruji/saso

tagsaso@1.6.2

Zero config bundler to help you to build fantastic APP

created time in 8 days

push eventhuruji/saso

huruji

commit sha f02ba1ea14add0d88fc5385dc0284750952fc692

fix: :bug: error message

view details

push time in 8 days

startedaxetroy/crawler

started time in 8 days

startedgetgridea/gridea

started time in 8 days

startedzkat/pacote

started time in 8 days

created taghuruji/saso

tagsaso@1.6.1

Zero config bundler to help you to build fantastic APP

created time in 8 days

created taghuruji/saso

tagsaso-template-typescript@1.0.0

Zero config bundler to help you to build fantastic APP

created time in 8 days

push eventhuruji/saso

huruji

commit sha 5f948f97a2391526dd11308236ca27958c6d300c

chore(release): publish - saso@1.6.1 - saso-template-typescript@1.0.0

view details

push time in 8 days

push eventhuruji/saso

huruji

commit sha ee38afa94f50f9b40d61c2b1e26c27d7dc8d1f5f

fix: :bug: entrypoint not found

view details

push time in 9 days

push eventhuruji/saso

huruji

commit sha 36eb489b84e5a44e99d340b2b93dbd1d34c681d5

feat: :sparkles: add ts template

view details

push time in 9 days

startedkesla/download-npm-package

started time in 9 days

push eventhuruji/DYPlayer

huruji

commit sha 70b3ad78bc31b5abdf30239565d9e41660294fad

feat: example use ts

view details

push time in 9 days

push eventhuruji/saso

huruji

commit sha 37d3d9f579e43e2cf940e4ac08406ce283675506

chore(release): publish - saso@1.6.0

view details

push time in 9 days

created taghuruji/saso

tagsaso@1.6.0

Zero config bundler to help you to build fantastic APP

created time in 9 days

push eventhuruji/saso

huruji

commit sha 964312c7bff6587253bad8bdfbb1e28c3dacb46a

fix: :bug: ts extion bug ts => ts

view details

push time in 9 days

push eventhuruji/saso

huruji

commit sha 3e90793ea9527daabf27832cd4995b2252401978

feat: :sparkles: add ts support

view details

push time in 9 days

push eventhuruji/DYPlayer

huruji

commit sha 221e8e478177c50f38c15cb0e3707270cca790b4

chore: lint && prettier

view details

push time in 9 days

issue openedhuruji/JDS_weekly

2019第二周

https://github.com/typescript-eslint/typescript-eslint/issues/379

eslint ts no-unused-vars 和 no-undefined bug

created time in 9 days

startedprettier/prettier-vscode

started time in 10 days

push eventhuruji/DYPlayer

huruji

commit sha dc2140b363d41c5dc6fe877422271623794a4b3c

chore: :wrench: eslint typescript

view details

push time in 10 days

push eventhuruji/moedan

huruji

commit sha 2d02dfc8162cb4a15f3e393337295aee0272bd1f

chore: :fire: remove deps

view details

push time in 10 days

push eventhuruji/moedan

huruji

commit sha 4419e9d1259ec1ca8bc5da5a4de8a17b9675c721

chore: :wrench: modify eslint config

view details

push time in 10 days

startedkentcdodds/eslint-config-kentcdodds

started time in 10 days

issue commenthuruji/DYPlayer

如何解决视频在移动端上下滑动切换视频?

主要是什么问题呢? @chwang98

chwang98

comment created time in 10 days

startedADengrc/youtube-captions

started time in 11 days

startedmuzuiget/dualsub-supports

started time in 11 days

startedsampotts/plyr

started time in 11 days

startedsindresorhus/ama

started time in 11 days

push eventhuruji/cube-react

huruji

commit sha d799e29d485613c961fc3dd3ed908da4d16ea21f

refactor: doc loader: title => demo

view details

push time in 11 days

pull request commentfdgio/cube-react

feat: :sparkles: :lipstick: highlight & title

fix highlight and add title in example image

huruji

comment created time in 13 days

PR opened fdgio/cube-react

feat: :sparkles: :lipstick: highlight & title
+223 -5

0 comment

11 changed files

pr created time in 13 days

push eventhuruji/cube-react

huruji

commit sha fb147b4fbccb2ccf85fbd48f275ebb56673e6d26

feat: :sparkles: :lipstick: highlight & title

view details

push time in 13 days

startedgnipbao/iblog

started time in 13 days

fork huruji/cube-react

React version of cube-ui

fork in 14 days

startedjaywcjlove/linux-command

started time in 14 days

startedQingWei-Li/vue-markdown-loader

started time in 15 days

startedwebpack/loader-runner

started time in 15 days

startedhuruji/moedan

started time in 16 days

startedalitajs/alita

started time in 16 days

startedyiminghe/async-validator

started time in 16 days

startedModernizr/Modernizr

started time in 16 days

push eventfdgio/cube-react

zhouquan

commit sha 68effa9bcb2e6b94c107d8a575afdafa0712c16b

chore: 🔥 remove old version example

view details

忽如寄

commit sha e2cf584c2d9774b9543ab5ca2d597f56703e8f2a

Merge pull request #5 from Quilljou/master chore: 🔥 remove old version example

view details

push time in 17 days

PR merged fdgio/cube-react

chore: 🔥 remove old version example
+0 -258

0 comment

13 changed files

Quilljou

pr closed time in 17 days

fork huruji/griffith

A React-based web video player

https://codesandbox.io/embed/p03wm0o80

fork in 17 days

startedconventional-commits/conventionalcommits.org

started time in 17 days

startedjabbany/CommentCoreLibrary

started time in 17 days

push eventfdgio/cube-react

zhouquan

commit sha e5f119f6d4db64e237d7ca1850e4a97e464b7a25

feat: ✨ button docs demo

view details

忽如寄

commit sha 2d0726913202961fee4cb77fc8a2e5055dcda460

Merge pull request #4 from Quilljou/master feat: ✨ button docs demo

view details

push time in 17 days

PR merged fdgio/cube-react

feat: ✨ button docs demo

I still have some confusion about using react/react-router-dom with Typescript. some type check of ts is failed. So I skipped the eslint verify. There are two main parts of our docs site. /docs/xxx and /examples/xxx. the former one is a Route to contain our markdown rendered HTML document and example iPhone X display. and the next one is a Route to the contain the example content extracted from markdown. which is rendered by the handwriting webpack loader. distinguish the two kinds of loaders is by using the Rule.oneof of webpack Module.

Now the demo is available in http://localhost:10000/docs/button

+459 -258

0 comment

29 changed files

Quilljou

pr closed time in 17 days

push eventhuruji/saso

huruji

commit sha 924a89a19d87e9c74d0a3c71a1803ad4de92e91a

chore(release): publish - saso@1.5.0

view details

push time in 17 days

more