profile
viewpoint
Jiaxun Wei LeuisKen Baidu EFE Beijing, China. http://leuisken.github.io/ Keep going!

benjycui/bisheng 2412

Transform Markdown(and other static files with transformers) into a SPA website using React.

LeuisKen/leuisken.github.io 233

LeuisKen的个人博客

kekee000/fonteditor-core 177

fonteditor core functions

LeuisKen/algorithm 38

Practice algorithm everyday

LeuisKen/eocky 10

Transform Markdown(and other static files with transformers) into a SPA website using San.

LeuisKen/md2json2html 9

A npm package that transform markdown data to json and html.

LeuisKen/css-linear-gradient-parser 2

一个将CSS线性渐变解析成对象的词法分析示例

LeuisKen/atom-fecs 0

百度前端代码检查atom编辑插件

LeuisKen/atool-build 0

:hammer: Build tool based on webpack.

LeuisKen/b3b 0

buffer convert util

issue openedmicrosoft/vscode

Remove some deprecated code in ./src/vs/base

<!-- ⚠️⚠️ Do Not Delete This! feature_request_template ⚠️⚠️ --> <!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ --> <!-- Please search existing issues to avoid creating duplicates. -->

<!-- Describe the feature you'd like. -->

I find that following methods are deprecated:

src/vs/base/browser/dom.ts:
  83: /** @deprecated ES6 - use classList*/
  85: /** @deprecated ES6 - use classList*/
  87: /** @deprecated ES6 - use classList*/
  89: /** @deprecated ES6 - use classList*/
  91: /** @deprecated ES6 - use classList*/
  93: /** @deprecated ES6 - use classList*/

src/vs/base/common/arrays.ts:
  403:  * @deprecated ES6: use `Array.findIndex`
  419:  * @deprecated ES6: use `Array.find`
  571:  * @deprecated ES6: use `Array.find`

src/vs/base/common/map.ts:
  13:  * @deprecated ES6: use `[...SetOrMap.values()]`
  24:  * @deprecated ES6: use `[...map.keys()]`

src/vs/base/common/objects.ts:
  117:  * @deprecated ES6

src/vs/base/common/strings.ts:
   17:  * @deprecated ES6: use `String.padStart`
  148:  * @deprecated ES6: use `String.startsWith`
  169:  * @deprecated ES6: use `String.endsWith`
  863:  * @deprecated ES6

I'd like to send a pull request to remove these deprecated methods and refactor all usages if you want.

created time in 11 days

push eventLeuisKen/vscode-latency

dependabot[bot]

commit sha 30102ef6152bc5a8160b7afe42a5cbf726244e11

build(deps): bump lodash from 4.17.15 to 4.17.19 Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19) Signed-off-by: dependabot[bot] <support@github.com>

view details

Jiaxun Wei

commit sha a4b72baf9418ff60467d416ca6f4661589742b30

Merge pull request #1 from LeuisKen/dependabot/npm_and_yarn/lodash-4.17.19 build(deps): bump lodash from 4.17.15 to 4.17.19

view details

push time in 18 days

PR merged LeuisKen/vscode-latency

build(deps): bump lodash from 4.17.15 to 4.17.19 dependencies

Bumps lodash from 4.17.15 to 4.17.19. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/lodash/lodash/releases">lodash's releases</a>.</em></p> <blockquote> <h2>4.17.16</h2> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/lodash/lodash/commit/d7fbc52ee0466a6d248f047b5d5c3e6d1e099056"><code>d7fbc52</code></a> Bump to v4.17.19</li> <li><a href="https://github.com/lodash/lodash/commit/2e1c0f22f425e9c013815b2cd7c2ebd51f49a8d6"><code>2e1c0f2</code></a> Add npm-package</li> <li><a href="https://github.com/lodash/lodash/commit/1b6c282299f4e0271f932b466c67f0f822aa308e"><code>1b6c282</code></a> Bump to v4.17.18</li> <li><a href="https://github.com/lodash/lodash/commit/a370ac81408de2da77a82b3c4b61a01a3b9c2fac"><code>a370ac8</code></a> Bump to v4.17.17</li> <li><a href="https://github.com/lodash/lodash/commit/1144918f3578a84fcc4986da9b806e63a6175cbb"><code>1144918</code></a> Rebuild lodash and docs</li> <li><a href="https://github.com/lodash/lodash/commit/3a3b0fd339c2109563f7e8167dc95265ed82ef3e"><code>3a3b0fd</code></a> Bump to v4.17.16</li> <li><a href="https://github.com/lodash/lodash/commit/c84fe82760fb2d3e03a63379b297a1cc1a2fce12"><code>c84fe82</code></a> fix(zipObjectDeep): prototype pollution (<a href="https://github-redirect.dependabot.com/lodash/lodash/issues/4759">#4759</a>)</li> <li><a href="https://github.com/lodash/lodash/commit/e7b28ea6cb17b4ca021e7c9d66218c8c89782f32"><code>e7b28ea</code></a> Sanitize sourceURL so it cannot affect evaled code (<a href="https://github-redirect.dependabot.com/lodash/lodash/issues/4518">#4518</a>)</li> <li><a href="https://github.com/lodash/lodash/commit/0cec225778d4ac26c2bac95031ecc92a94f08bbb"><code>0cec225</code></a> Fix lodash.isEqual for circular references (<a href="https://github-redirect.dependabot.com/lodash/lodash/issues/4320">#4320</a>) (<a href="https://github-redirect.dependabot.com/lodash/lodash/issues/4515">#4515</a>)</li> <li><a href="https://github.com/lodash/lodash/commit/94c3a8133cb4fcdb50db72b4fd14dd884b195cd5"><code>94c3a81</code></a> Document matches* shorthands for over* methods (<a href="https://github-redirect.dependabot.com/lodash/lodash/issues/4510">#4510</a>) (<a href="https://github-redirect.dependabot.com/lodash/lodash/issues/4514">#4514</a>)</li> <li>Additional commits viewable in <a href="https://github.com/lodash/lodash/compare/4.17.15...4.17.19">compare view</a></li> </ul> </details> <details> <summary>Maintainer changes</summary> <p>This version was pushed to npm by <a href="https://www.npmjs.com/~mathias">mathias</a>, a new releaser for lodash since your current version.</p> </details> <br />

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


<details> <summary>Dependabot commands and options</summary> <br />

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the Security Alerts page.

</details>

+3 -3

0 comment

1 changed file

dependabot[bot]

pr closed time in 18 days

issue commentLeuisKen/leuisken.github.io

为什么我认为数据结构与算法对前端开发很重要?

@RexSkz 确实是np-hard问题,不是dp能解决的 https://en.wikipedia.org/wiki/Partition_problem 没想到误打误撞用到了 Approximation algorithm approaches - The greedy algorithm。 anyway,谢谢博主分享。

时隔开帖这么多年,我也终于在一个偶然课程上面看到了这个问题的一种表现,负载平衡问题,并且理解了这个问题确实是 NP 问题,存在贪心的近似算法。也不知道面试官当时是想考啥,也许是漏掉了仅有两列这个条件?我发现手淘上是存在着两列的瀑布流的。

LeuisKen

comment created time in 24 days

issue closedmicrosoft/vscode-generator-code

[feature request] add webpack bundled extension templates.

When I start an extension project, I use yo code typescript template, but when I using vsce package to build .vsix, the following notice:

image

So I have to migrate my existing extension since there is no webpack bundled extension templates I can use.

Would your like to add this template ? I think it could help the extension developers a lot.

Thanks a lot. : )

closed time in a month

LeuisKen

push eventLeuisKen/react-vsc-treeview

Jiaxun Wei

commit sha f006bd5645a3bce9e9d05209c004dca65d50052b

deps update, bump version

view details

push time in 2 months

PR opened ecomfe/react-suspense-boundary

fix: error throwed when query.data === null

Case like following will cause error.

'Unexpected suspense state without data, pending and error';

const getLocalNote: () => Promise<string | null> = () => AsyncStorage.getItem('localNote');
const [result] = useResource(getLocalNote, undefined);
+1 -1

0 comment

1 changed file

pr created time in 2 months

push eventLeuisKen/react-suspense-boundary

LeuisKen

commit sha 4a227ed3d66dea80cfadcacf4c9cc8c1a4f6bb4f

fix: error throwed when query.data === null

view details

push time in 2 months

fork LeuisKen/react-suspense-boundary

A boundary component working with suspense and error

fork in 2 months

pull request commentcdr/code-server

fix #1017

Thanks for contributing @LeuisKen!

Can you please rebase on latest master?

done

LeuisKen

comment created time in 3 months

push eventLeuisKen/code-server

Anmol Sethi

commit sha 41d625abb6cd77e7e8b6cb955c328ffa310ca586

Revamp README.md with new installation options

view details

Anmol Sethi

commit sha 4aae5eaeca524cb952f1a63980e48af5e4846f0a

CI fixes - Splits up test into fmt, lint and test - Fixes bug in build-packages.sh - Minor README.md fixes

view details

Anmol Sethi

commit sha 502c262c82bf802ffe5eef0eabc9d1c8d90d38d7

Mention update of versions in README install examples

view details

Anmol Sethi

commit sha a346c6d565e77a83b6a874802b0163ee57e1e4dd

Document npm module install dependencies

view details

Anmol Sethi

commit sha 1739b21600dd826ad88840f7aa3ed9a6cc625de8

Bundle VS Code node_modules to avoid yarn dependency Many random bizarre issues otherwise. Also includes misc improvements to docs and scripts.

view details

Anmol Sethi

commit sha d30f3dbdf7c2b0f0501a85b466eda8ac588483a7

Update to rc.10

view details

Anmol Sethi

commit sha b3ae4d67d3bd3ed7b22b102b16ecd440391ddcb5

Hide bundled node_modules to prevent them from being ignored

view details

Anmol Sethi

commit sha f4a78587b066d82b99491b6d7800fee5904e0fef

Make npm-postinstall.sh more robust

view details

Anmol Sethi

commit sha a0a77e379ecd7b929850d28ec445cd5778f8d228

Add doc/guide.md

view details

Anmol Sethi

commit sha f475767c2bedf4c2adf6e5f71c84cbccbe3f68e8

Rename darwin releases to macos

view details

Anmol Sethi

commit sha 5651201643633c42d7c3bb75abfe5c027de65e24

Copy old macOS data directory if applicable

view details

Anmol Sethi

commit sha c69346a9a73995f50dd0c0cdf25d61dd93451670

Add FAQ entry on the config file

view details

Anmol Sethi

commit sha 0bd2602774a69b28059bd923f63aa28502d1605d

3.3.0

view details

Anmol Sethi

commit sha 10b06cae1026b502fc0c342317012013000ede13

Minor typo fixes

view details

Anmol Sethi

commit sha d7234029e672496b9b01d7c19a8396359e8a3f5e

Use /usr/local instead of /opt in self contained release example

view details

Anmol Sethi

commit sha 40778b15ca19178c63ea97c5ae1f93bfb08d466d

Add code-server version into VS Code about Closes #1506

view details

Anmol Sethi

commit sha d4b3d21dceb3cacd9a13d2cc8f89f55fa36d31e7

Require minimum node 12

view details

Anmol Sethi

commit sha 89c5a4dfeab6d87a3454dc2e0ee40fefc64ebc5a

Set --frozen-lockfile with yarn when necessary

view details

Anmol Sethi

commit sha 73b2ff09458bf43419983aeab8196f3723ebaba0

$PORT should always override port in --bind-addr

view details

Anmol Sethi

commit sha 181bad95630cb521bbf0196210f314da58b5ceb7

Improve docker install formatting

view details

push time in 3 months

issue commentcdr/code-server

support other encodings than UTF-8

https://github.com/cdr/code-server/pull/1650

LeuisKen

comment created time in 3 months

PR opened cdr/code-server

Reviewers
fix #1017

<!-- Please link to the issue this PR solves. If there is no existing issue, please first create one unless the fix is minor. -->

+210 -2

0 comment

2 changed files

pr created time in 3 months

push eventLeuisKen/code-server

LeuisKen

commit sha 0eb5116664f95e96925dd7106087e01b32ce622d

fix #1017

view details

push time in 3 months

push eventLeuisKen/code-server

weijiaxun

commit sha b80c37e0480ee0599a73f2ca494fecd38feeb759

fix #1017

view details

push time in 3 months

push eventLeuisKen/code-server

weijiaxun

commit sha e5a9b8401a789d9b60c8ae3be2689a1674eef0eb

fix #1017

view details

push time in 3 months

push eventLeuisKen/code-server

weijiaxun

commit sha 23a7953afb1ddde5441e0530a24b5d4cefd51b72

fix #1017

view details

push time in 3 months

push eventLeuisKen/code-server

Asher

commit sha 310bfe509e61c4c3c9cb67203b19017daae6e923

Delete all the things

view details

Asher

commit sha 4861405683ef10599350df5e6f320bd2e5659296

Initial connection handling

view details

Asher

commit sha 68fe085aa3c1a09081b24c2b654add24f2749171

Add channels

view details

Asher

commit sha 98f001395cf71ff95c5536d2379cb4be94889237

Add content types

view details

Asher

commit sha a0121f2f0c77b4846a7c7736ef3a03239d81b452

Implement file provider Reading, watching, saving, etc all seem to work now.

view details

Asher

commit sha 0d618bb1ef8d97dbc282c9d50e05910a2032ecdc

Use spdlog for log service

view details

Asher

commit sha 4e0a6d29411e87e3a64d33b358b4b3c35de5918c

Partial extension host, some restructuring I didn't like how the inner objects accessed parent objects, so I restructured all that.

view details

Asher

commit sha 7072bf1e83748b0abb7a23e0f2c91103964bc987

Use new URI transformer everywhere

view details

Asher

commit sha d808bfaec68015a55b7056fce12e64a447c8d726

Set workspace and folder URIs This makes the file tree work.

view details

Asher

commit sha 57a8186e88eebc963ce8fdb12d36732161c8a16e

Add development steps

view details

Asher

commit sha a6703ecb9839a3555bda9bb4b0b29d2b07a55e25

Prevent sending disconnect if disposed

view details

Asher

commit sha 2e77c9d44961ebf6cb1e27c3b4ec5faffe3fd928

Scan extensions

view details

Asher

commit sha 4685f6793d07c3cb0eac7884936cbaef72b4aa3f

Pass product configuration

view details

Asher

commit sha 3a78c0964f8829721096e5897b4ca9fc2e443863

Run log cleaner

view details

Asher

commit sha 6a35ab1dc0284556e924ed5330cf5874815b0af1

Add (unimplemented) webview server

view details

Asher

commit sha 770e0db7b882ba1df2cf379bf1fc771b63e05032

Add cli arguments

view details

Asher

commit sha 61c281ec6bd99bb2f32671fdbb453a0e8192d404

Add arguments for ports

view details

Asher

commit sha 5677ff2edfdfa3264cf4e59e964e28e02f4c808c

Add build scripts

view details

Asher

commit sha f8f4bfd76f11f84f679369f7fb7a4a16711f3672

Customize JSON files with code-server name

view details

Asher

commit sha 6156eb9ff4be2a10a6076ab391ef6ea4c2d5c0aa

Don't wait to start main server

view details

push time in 3 months

issue commentcdr/code-server

support other encodings than UTF-8

I understand and I'll try to help with your case.

LeuisKen

comment created time in 3 months

issue commentcdr/code-server

support other encodings than UTF-8

Maybe you can even make a PR to this repo with your patch?

I may not have time to do this until weekend, and other features like guess encoding I didn't fix. I'll send a pull request to code-server this weekend if you really need it.

LeuisKen

comment created time in 3 months

PR opened ecomfe/react-hooks

fix(useInfiniteScroll): fetch unexpected called twice.

When initialLoad is true, and loadMore was called when initialLoad is pending, the fetch function will be called twice with the same offset, and the result data will be duplicated.

This commit fix this issue to ensure fetch fucntion only called once and the result data are all unique.

Close #31

+18 -3

0 comment

2 changed files

pr created time in 3 months

issue commentcdr/code-server

support other encodings than UTF-8

@LeuisKen thank you! Does it also allow to switch file encoding?

I find some way to do this, but this patch need to import another third party lib called text-encoding, and I didn't publish this internal patch. Hope vscode will fix this issue soon.

LeuisKen

comment created time in 3 months

push eventLeuisKen/react-hooks

LeuisKen

commit sha aee5bb66f0acc0ee23e98d95395acae1454e9f8e

fix(useInfiniteScroll): fetch unexpected called twice. When initialLoad is true, and loadMore was called when initialLoad is pending, the fetch function will be called twice with the same offset, and the result data will be duplicated. This commit fix this issue to ensure fetch fucntion only called once and the result data are all unique.

view details

push time in 3 months

issue openedecomfe/react-hooks

useInfiniteScroll call loadMore twice in some case.

In my case, there is a InfiniteScroll component using useInfiniteScroll hook with {initialLoad: true} option. When entering this page with no scrollTop in last page, everything is ok, but if the scrollTop was not zero in last page, onscroll event will trigger, and with {initialLoad: true} option, the loadMore function will be called twice.

I create this patch in my local environment, and if this patch is approve, I'll then create a pull request.

diff --git a/packages/infinite-scroll/src/index.ts b/packages/infinite-scroll/src/index.ts
index cce41e8..bf58e50 100644
--- a/packages/infinite-scroll/src/index.ts
+++ b/packages/infinite-scroll/src/index.ts
@@ -55,15 +55,19 @@ export function useInfiniteScroll<T>(
         createContextReducers<T>(),
         {pendingCount: 0, dataSource: initialItems, hasMore: true}
     );
+    const loading = !!pendingCount;
     const loadMore = useCallback(
         async () => {
+            if (loading) {
+                return;
+            }
             initialLoadStarted.current = true;
             requestStart();
             const response = await fetch({offset: dataSource.length});
             initialLoadEnded.current = true;
             requestEnd(response);
         },
-        [requestStart, fetch, dataSource.length, requestEnd]
+        [loading, requestStart, fetch, dataSource.length, requestEnd]
     );
     useEffect(
         () => {
@@ -78,7 +82,7 @@ export function useInfiniteScroll<T>(
         dataSource,
         loadMore,
         hasMore,
-        loading: !!pendingCount,
-        initialLoading: initialLoad && !initialLoadEnded.current && !!pendingCount,
+        loading,
+        initialLoading: initialLoad && !initialLoadEnded.current && loading,
     };
 }

created time in 3 months

issue commentcdr/code-server

support other encodings than UTF-8

@LeuisKen how did you fix it locally?

https://github.com/LeuisKen/vscode/pull/1/files

LeuisKen

comment created time in 3 months

fork LeuisKen/react-hooks

Collection of react hooks

fork in 3 months

issue commentmicrosoft/vscode

Make measuring extension host latency easier

I found my problem is not as complex as I imagined. By using some tricks, I wrote a simple extension that could do this work. And I just publish it to the marketplace. https://marketplace.visualstudio.com/items?itemName=LeuisKen.latency

tamuratak

comment created time in 3 months

push eventLeuisKen/vscode-latency

Jiaxun Wei

commit sha c0cdf05be3a08e43456df4a112f8644663ea6cc9

feat: first release

view details

push time in 3 months

create barnchLeuisKen/vscode-latency

branch : master

created branch time in 3 months

created repositoryLeuisKen/vscode-latency

Measure VS Code Extension Host Latency

created time in 3 months

issue commentmicrosoft/vscode

Make measuring extension host latency easier

I prefer to show latency outputs on status bar, like this product. image “网络延迟 高” means "High network latency". This feature will be really helpful when I'm using Visual Studio Codespace and VS Code Remote. It can remind me of the current network quality, and warns me to try to improve the network quality when the quality is poor. And in this case, this feature will not for developers but for users. The display of this status could be controlled by settings.json.

tamuratak

comment created time in 3 months

more