profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/suyanhanx/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Suyan suyanhanx Shanghai,China suyan.moe 跳坑ing...

FEGuideTeam/FEGuide 1091

【前端面试题+前端学习+面试指南】 一份涵盖大部分前端工程师所需要掌握的核心知识。这个项目就是为了帮助那些找工作的前端开发工程师去回顾前端的基础知识,如果你不想找工作,也可以通过查看这些面试问题去巩固你的前端技能。

suyanhanx/33-js-concepts 0

:scroll: 每个 JavaScript 工程师都应懂的33个概念 @leonardomso

suyanhanx/anet 0

A .NET Core Common Library , Framework and Boilerplate.

suyanhanx/ant-design-vue 0

An enterprise-class UI components based on Ant Design and Vue. 🐜

suyanhanx/api.xiaoduyu.com 0

小度鱼,是基于 React + NodeJS + Express + MongoDB 开发的一个社区系统

suyanhanx/async-validator 0

validate form asynchronous

suyanhanx/awesome-adb 0

:lollipop: ADB Usage Complete / ADB 用法大全

suyanhanx/bue 0

模仿vue写一个MVVM框架

suyanhanx/clean-code-dotnet 0

:star: Clean Code concepts adapted for .NET / .NET Core #makedotnetgreatagain

startedantfu/vscode-theme-vitesse

started time in 13 minutes

issue openedswc-project/swc

bug: "this" context are not passed properly if the function is async

<!-- If you are using swc at work, please considering adding your company to https://swc.rs/users/ If then, your issue will be fixed more quickly. -->

Describe the bug

this context are not passed properly to statics while using ts-mongoose. ts-mongoose passed the Model (as this) object to the statics arguments/parameters, but the compiled code doesn't pass the Model object making it undefined.

This only happens if the function is asynchronous.

Input code

const SampleData = typedModel("SampleVideo", VideosSchema, undefined, undefined, {
    byPlatform: async function (platform: string) {
        const result = await this.find({ platform: { $eq: platform } });
        return result;
    },
});

SampleData.byPlatform("youtube").then((res) => {
    console.info(res);
});

Config

{
    "exclude": [".*.js$", ".*.map$", ".*.test.ts$"],
    "jsc": {
        "target": "es2016",
        "parser": {
            "syntax": "typescript",
            "tsx": false,
            "decorators": true
        }
    },
    "minify": false,
    "module": {
        "type": "commonjs"
    }
}

Expected behavior this is passed properly and not undefined.

Version The version of @swc/core: 1.2.50 Node version: v14.15.1 (deployment server) and v12.13.0 (personal)

created time in an hour

issue commentvuejs/vue-next

Regression: union typed prop has wrong type in setup

Workaround

prop: xxx

=>

prop: {
  type: xxx,
  default: undefined
}
07akioni

comment created time in 2 hours

pull request commentvuejs/vue-next

fix(types): union function prop

@HcySunYang Code is reviewed

07akioni

comment created time in 2 hours

issue closedvuejs/vue-next

Consider v-model.number to return null instead of empty string when no value provided

What problem does this feature solve?

It has been clearly described in this issue a few years ago: https://github.com/vuejs/vue/issues/4742

When an input having v-model.number modifier gets erased, it shouldn't turn into an empty string, but rather become null. It feels much more sensible and would avoid writing boilerplate code to achieve this. I'd be grateful if you guys could consider it in Vue 3, which is a great moment for this breaking change to be implemented.

What does the proposed API look like?

n/a

<!-- generated by vue-issues. DO NOT REMOVE -->

closed time in 2 hours

DamianGlowala

issue commentvuejs/vue-next

Consider v-model.number to return null instead of empty string when no value provided

The only difference would be being able to use the ?? operator if the value was null instead of an empty string, but you still have a way to verify if an input is empty by just comparing it to the empty string. Unfortunately, this would be a breaking change now. It's still fairly subjective and would need to go through an RFC as the empty string is still what the browser provides and there is a way to differentiate empty from non-empty

DamianGlowala

comment created time in 2 hours

issue commentvuejs/vue-next

watchEffect runs before render, but it triggerred another render

Using flush: 'sync' could avoid multiple renders

HarryOneTwoFour

comment created time in 2 hours

push eventTencent/APIJSON

TommyLemon

commit sha bf1fd02fa95771e8cc0980528381badc1ad635a6

贡献者 新增多个生态项目及作者

view details

push time in 2 hours

push eventTencent/APIJSON

TommyLemon

commit sha b8c6ba1bbb067eab117da7048277a1a165d8eaac

贡献者新增生态项目及作者

view details

push time in 2 hours

issue commentmqyqingfeng/Blog

JavaScript深入之bind的模拟实现

我把最后的实现代码跑了一下构造函数的例子 发现this依然失效了啊 是什么问题呢

当作为构造函数的时候,this指向的是实例的obj,所以this就是失效的。

mqyqingfeng

comment created time in 2 hours

push eventchokcoco/iCSS

Coco

commit sha 05b84c4771a77e7a870cbecb03e8013a3b9e68ba

feat: update <奇思妙想 CSS 文字动画>

view details

push time in 3 hours

push eventchokcoco/iCSS

Coco

commit sha 2179ddc94fed0ffe0938db445deb594ebf337050

Update readme.md

view details

push time in 3 hours

issue openedvuejs/vue-next

watchEffect runs before render, but it triggerred another render

Version

3.0.7

Reproduction link

https://codesandbox.io/s/inspiring-almeida-rlncv?file=/src/main.js

Steps to reproduce

export const App = defineComponent({
  setup() {
    const a = ref(0);
    const b = ref(1);
    watchEffect(() => {
      console.log('watched');
      b.value = a.value   1;
    });
    return () => {
      console.log('start render');
      return <button onClick={() => a.value  }> {a.value   b.value}</button>;
    }
  }
})```
1. Click the button in the page.
2. check browser console

### What is expected?
After click, the component only render for one time.

### What is actually happening?
After click, the component rendered twice. That is:
the console say: 
watched
start render
start render

---
I know using `computed` will resolve the problem. However I think this is a bug for `watchEffect`, the watched resource actually runs before the render triggered by `a.value`, it should not trigger another render again.

<!-- generated by vue-issues. DO NOT REMOVE -->

created time in 3 hours

issue closedvuejs/vue-next

Property "$t" was accessed during render but is not defined on instance.

Version

3.0.7

Reproduction link

https://github.com/osahene/langtest

Steps to reproduce

I am relatively new to vue. I use vue 3 and javascript, and so I installed vue-i18n with 'vue add i18n' command. I then entered '{{ $t('message) }} into the 'about.vue' file. I had an error in the browser console the 'Property "$t" was accessed during render but is not defined on instance.'

What is expected?

The locale translation message should appear (output) in the browser.

What is actually happening?

Nothing showed. The page is rather blank.

<!-- generated by vue-issues. DO NOT REMOVE -->

closed time in 3 hours

osahene

issue commentvuejs/vue-next

Property "$t" was accessed during render but is not defined on instance.

Hi, thanks for your interest but Github issues are for bug reports and feature requests only. You can ask questions on the forum, the Discord server or StackOverflow. This questions seems to be related to vue-18n and not Vue

osahene

comment created time in 3 hours

Pull request review commentvuejs/vue-next

fix(runtime-core): avoid infinite loop rendering caused by setting props multiple times

 function setFullProps(   attrs: Data ) {   const [options, needCastKeys] = instance.propsOptions+  const rawCurrentProps = extend({}, toRaw(props))   if (rawProps) {     for (const key in rawProps) {       const value = rawProps[key]

I think this will be better

// key, ref are reserved and never passed down
if (isReservedProp(key)) {
   continue
}
const value = rawProps[key]
HcySunYang

comment created time in 4 hours

push eventhalfrost/Halfrost-Field

halfrost

commit sha 741b7973859cfb49146086a51e60fa3e6723c15b

Update go_reflection.md

view details

push time in 4 hours

push eventhalfrost/Halfrost-Field

halfrost

commit sha 7aecfdde5c2cc13f85e5a6b71764301b6faf107d

Update go_reflection.md

view details

push time in 4 hours

created repositoryantfu/vscode-theme-vitesse

created time in 5 hours

issue commentk3s-io/k3s

The two POD networks are disconnected

I adjusted the version to the same version.The problem is solved.Thanks

LinXiaoJian

comment created time in 5 hours

issue closedk3s-io/k3s

The two POD networks are disconnected

Recently, I encountered a particularly strange problem. I have a K3S cluster and recently added a new machine to the K3S cluster, but found that the POD network on two different machines could not connect. I use the ping command on machine a to Ping the IP address of pod on machine B.Use the tcpdump tool to grab the packet

image

As shown, there is no Reply data At the same time, I used the route -n to check, and found no exception

image

The K3s version of the machine in question is V1.20.2 + K3S1, and the K3s version of the other machines is V1.19.4 + K3S1 Is this problem caused by version inconsistency.How can I solve this problem.Looking forward to your reply. Thank you very much.

closed time in 5 hours

LinXiaoJian

PR opened vuejs/vue-next

fix(runtime-core): avoid infinite loop rendering caused by setting props multiple times

Fix: #3371

I made a minimal reproduction https://codesandbox.io/s/vigilant-euler-7q6j0?file=/src/index.ts. Open the link and check the comments in the code

  1. The Parent component accesses the props of the Child component and is tracked by the Child component's props.
  2. When rendering the Child component, the Child component modifies the reactivity data of the Parent component.
  3. The Parent component re-rendering and checks whether the Child component needs to be updated.
  4. Child component needs to be updated, and set the full props
  5. For the props.foo, it needs to be cast to a boolean value
  6. So the props.foo been modified twice, once is set to the empty string, and another is set to a boolean value. here and here
+55 -2

0 comment

2 changed files

pr created time in 5 hours

issue commentmqyqingfeng/Blog

JavaScript深入之call和apply的模拟实现

 Function.prototype.apply_ = function (context, args) {
        context = Object(context) || window
        var fn = this;
        let result = context.fn(...(args || []));
        return result;
    }
    var foo = function (name) {
        console.log(name)
    }
    var obj = {}
    foo.apply_(obj, ['张三'])

或是直接这样,效果应该一样吧?

mqyqingfeng

comment created time in 5 hours

startedapachecn/apachecn-ml-zh

started time in 7 hours

created repositoryapachecn/apachecn-ml-zh

created time in 7 hours

issue commentmqyqingfeng/Blog

JavaScript深入之call和apply的模拟实现

 Function.prototype.apply_ = function (context, args) {
        context = Object(context) || window
        context.fn = this;
        let result = context.fn(...(args || []));
        delete context.fn;
        return result;
    }
    var foo = function (name) {
        console.log(name)
    }
    var obj = {}
    foo.apply_(obj, ['张三'])

这样写行不行?

mqyqingfeng

comment created time in 7 hours

push eventhalfrost/Halfrost-Field

halfrost

commit sha 8504c995d818500f0fbc4431e9fb1a50e359cd6a

Update go_reflection.md

view details

push time in 7 hours

startedjhu-ep-coursera/fullstack-course4

started time in 7 hours