hackftz

hackftz

an font-end engineer work in china, have the real love for coding, like running, love basketball!!!🏀

Member Since 4 years ago

ximalaya, shanghai

Experience Points
8
follower
Lessons Completed
16
follow
Lessons Completed
118
stars
Best Reply Awards
94
repos

147 contributions in the last year

Pinned
⚡ 个人博客 personal blogs
⚡ it is my common css bag, let's get it !
⚡ 虚拟列表优化
⚡ implement for sku demo
Activity
Jan
20
4 days ago
started
started time in 3 days ago
Jan
18
6 days ago
Activity icon
fork

hackftz forked zhuifengshaonianhanlu/pikachu

⚡ 一个好玩的Web安全-漏洞测试平台
hackftz Apache License 2.0 Updated
fork time in 6 days ago
Dec
23
1 month ago
Activity icon
issue

hackftz issue antvis/G6

hackftz
hackftz

'compactBox' does not exist! Please specify it first.

问题描述

https://g6.antv.vision/zh/examples/tree/customItemTree#customEdgeTree

the demo i used in react frame, but got this error info, please check it and repair it, ok?

重现链接

https://g6.antv.vision/zh/examples/tree/customItemTree#customEdgeTree

重现步骤

just copy the code in the demo in ant react frame project

预期行为

repair it

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]
  • G6 版本: [4.5.1 ... ] mac

屏幕截图或视频(可选)

No response

补充说明(可选)

No response

Dec
13
1 month ago
started
started time in 1 month ago
Nov
29
1 month ago
Activity icon
issue

hackftz issue comment alibaba/hooks

hackftz
hackftz

feat: use getBoundingClientRect to get high precision size

🤔 这个变动的性质是?

  • 功能增强

🔗 相关 Issue

#1302:useSize 返回结果为整数,但实际元素尺寸可能为小数

💡 需求背景和解决方案

背景:useSize 返回结果为整数,但实际元素尺寸可能为小数 解决方案:将 clientWidth、clientHeight 替换为 getBoundingClientRect(),使用上无变动

📝 更新日志

语言 更新描述
🇺🇸 英文 useSize will get floating number
🇨🇳 中文 useSize 将获得浮点数值

⚠️ 风险

可能造成数值计算上的精度丢失问题,需要使用者自查

☑️ 请求合并前的自查清单

  • 文档无须补充
  • 代码演示无须提供
  • TypeScript 定义无须补充
  • Changelog 已提供
hackftz
hackftz

整数、小数可以兼得的

Activity icon
fork

hackftz forked alibaba/hooks

⚡ React Hooks Library
hackftz MIT License Updated
fork time in 1 month ago
Nov
24
2 months ago
Activity icon
issue

hackftz issue nekocode/antd-dayjs-vite-plugin

hackftz
hackftz

sorry, is that right?

see App.tsx

// in the test project it can not get the registry
import moment from 'moment';
Activity icon
fork

hackftz forked nekocode/antd-dayjs-vite-plugin

⚡ A Vite port of antd-dayjs-webpack-plugin. Day.js vite plugin for Ant Design (antd).
hackftz MIT License Updated
fork time in 2 months ago
Nov
22
2 months ago
Activity icon
issue

hackftz issue comment vitejs/vite

hackftz
hackftz

Incorrect preload URLs for external resources

Describe the bug

I'm using Vite with both, independent React and Svelte project, and the default HTML template (index.html) as an entry-point. The project import web-components from an URL through a script tag in the template.

<script type="module" src="<%= VITE_HEADER_WEB_COMPONENT %>"></script> 

The web component is served from a different origin than the actual project. The preload tags inserted in the build-process are relative to the project's base and don't respect external origins.

While this is clearly a bug, I want to repeat concerns expressed in other issues (#3133, #5120). I think that automatic insertion of preload can work for smaller projects. However, for bigger projects finding the optimal caching strategy is far more complex and preloading all resources can have a negative impact on performance. In my particular case, I wasn't able to prevent the preloading using optimizeDeps.exclude. Using library mode to prevent preloading is no viable option. It would really help to have an independent setting to disable preloading altogether.

Reproduction

Config:

VITE_HEADER_WEB_COMPONENT=http://mycdn.com/component/header.mjs

HTML Output:

<!-- single header chunks omitted for brevity -->
<link rel="modulepreload" as="script" crossorigin="" href="assets/header.mjs">

Note: Not only does it use a relative path, it also uses the incorrect path!

Console Output:

header.mjs:1 Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.

The expected preload tag would be

<link rel="modulepreload" as="script" crossorigin="" href="http://mycdn.com/component/header.mjs">

System Info

System:
    OS: Windows 10 10.0.19041
    CPU: (8) x64 Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
    Memory: 3.82 GB / 15.95 GB
  Binaries:
    Node: 16.10.0 - ~\AppData\Local\Volta\tools\image\node\16.10.0\node.EXE
    Yarn: 1.22.10 - ~\AppData\Local\Volta\tools\image\yarn\1.22.10\bin\yarn.CMD
    npm: 7.20.3 - ~\AppData\Local\Volta\tools\image\npm\7.20.3\bin\npm.CMD
  Browsers:
    Chrome: 94.0.4606.71
    Edge: Spartan (44.19041.1023.0), Chromium (94.0.992.37)
    Internet Explorer: 11.0.19041.1202

Used Package Manager

npm

Logs

No response

Validations

hackftz
hackftz

i got same porblem like you, have you fix it?

Oct
29
2 months ago
Activity icon
issue

hackftz issue fi3ework/vite-plugin-checker

hackftz
hackftz

eslint warning or error information not clear when save the file and trigger recompile

hello, I got a minor question and I think it is not the problem from vite, so I wanna to talk about this.

I write some code that can cause several error message, if I fix part of it and save file, the project reload and the remain error message and overlay the old thing. Up to now it seems ok, but when I fix all of it, I expected all eslint error message can get clear but it still show the previous error message in terminal screen. It looks a bit of weired.

phenomenon

image

image

vite config

import checker from 'vite-plugin-checker';

// ...

return defineConfig({
    plugins: [
      reactRefresh(),
      checker({
        typescript: true,
        eslint: {
          files: ['./src', './config'],
          extensions: ['.ts', '.tsx', '.js', '.jsx'],
        },
      }),
    ],
  });
Oct
28
2 months ago
Activity icon
issue

hackftz issue comment facebook/react

hackftz
hackftz

Bug: Rules with suggestions must set the `meta.hasSuggestions` property to `true`

I'm basically running into an issue where eslint is asking me to set meta.hasSuggestions to true. When I use "react-hooks/exhaustive-deps": "error". Is there something I'm doing wrong or is this a dep version thing?

React version:

Steps To Reproduce

  1. Have my eslint config:
{
  "env": {
    "browser": true,
    "es2021": true
  },
  "extends": [
    "eslint:recommended",
    "plugin:react/recommended",
    "plugin:react-hooks/recommended",
    "plugin:@typescript-eslint/recommended",
    "prettier"
  ],
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "ecmaFeatures": {
      "jsx": true
    },
    "ecmaVersion": 13,
    "sourceType": "module"
  },
  "plugins": ["react", "react-hooks", "@typescript-eslint"],
  "rules": {
    "react-hooks/exhaustive-deps": "error",
  },
  "settings": {
    "react": {
      "version": "detect"
    }
  }
}

Here's my deps from package.json

{
"dependecies": {
    "eslint": "^8.0.0",
    "eslint-config-prettier": "^8.3.0",
    "eslint-plugin-react": "^7.26.1",
    "eslint-plugin-react-hooks": "^4.2.0",
}

If I try to remove the react-hook plugin and extension this happens: Definition for rule 'react-hooks/exhaustive-deps' was not found

Link to code example:

The current behavior

The expected behavior

hackftz
hackftz

try to install "[email protected]" can resolve the question.