Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(useInViewport): add 'callback' options and 'target' support array #2061

Merged
merged 20 commits into from Jul 12, 2023

Conversation

coderluojz
Copy link
Contributor

@coderluojz coderluojz commented Feb 14, 2023

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

close: #2060

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English feat(useInViewport): add 'callback' options and 'target' support array
🇨🇳 Chinese feat(useInViewport): 新增 callback 配置项,并且 target 支持传数组

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

@CLAassistant
Copy link

CLAassistant commented Feb 14, 2023

CLA assistant check
All committers have signed the CLA.

@coderluojz
Copy link
Contributor Author

@li-jia-nan test ci 跑挂了,怎么解决呢

packages/hooks build: node:internal/crypto/hash:71
packages/hooks build:   this[kHandle] = new _Hash(algorithm, xofLen);
packages/hooks build:                   ^
packages/hooks build: Error: error:0308010C:digital envelope routines::unsupported
packages/hooks build:     at new Hash (node:internal/crypto/hash:71:19)
packages/hooks build:     at Object.createHash (node:crypto:133:10)
packages/hooks build:     at module.exports (/home/runner/work/hooks/hooks/node_modules/.pnpm/webpack@4.46.0_webpack-cli@3.3.12/node_modules/webpack/lib/util/createHash.js:135:53)
packages/hooks build:     at NormalModule._initBuildHash (/home/runner/work/hooks/hooks/node_modules/.pnpm/webpack@4.46.0_webpack-cli@3.3.12/node_modules/webpack/lib/NormalModule.js:417:16)
packages/hooks build:     at handleParseError (/home/runner/work/hooks/hooks/node_modules/.pnpm/webpack@4.46.0_webpack-cli@3.3.12/node_modules/webpack/lib/NormalModule.js:471:10)
packages/hooks build:     at /home/runner/work/hooks/hooks/node_modules/.pnpm/webpack@4.46.0_webpack-cli@3.3.12/node_modules/webpack/lib/NormalModule.js:503:5
packages/hooks build:     at /home/runner/work/hooks/hooks/node_modules/.pnpm/webpack@4.46.0_webpack-cli@3.3.12/node_modules/webpack/lib/NormalModule.js:358:12
packages/hooks build:     at /home/runner/work/hooks/hooks/node_modules/.pnpm/loader-runner@2.4.0/node_modules/loader-runner/lib/LoaderRunner.js:373:3
packages/hooks build:     at iterateNormalLoaders (/home/runner/work/hooks/hooks/node_modules/.pnpm/loader-runner@2.4.0/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
packages/hooks build:     at Array.<anonymous> (/home/runner/work/hooks/hooks/node_modules/.pnpm/loader-runner@2.4.0/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
packages/hooks build:     at Storage.finished (/home/runner/work/hooks/hooks/node_modules/.pnpm/enhanced-resolve@4.5.0/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
packages/hooks build:     at /home/runner/work/hooks/hooks/node_modules/.pnpm/enhanced-resolve@4.5.0/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
packages/hooks build:     at /home/runner/work/hooks/hooks/node_modules/.pnpm/graceful-fs@4.2.10/node_modules/graceful-fs/graceful-fs.js:123:16
packages/hooks build:     at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) {
packages/hooks build:   opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
packages/hooks build:   library: 'digital envelope routines',
packages/hooks build:   reason: 'unsupported',
packages/hooks build:   code: 'ERR_OSSL_EVP_UNSUPPORTED'
packages/hooks build: }
packages/hooks build: Node.js v18.14.1
packages/hooks build: Failed
undefined
/home/runner/work/hooks/hooks/packages/hooks:
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  ahooks@3.7.4 build: `gulp && webpack-cli`
Exit status 1
 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed with exit code 1.
Error: Process completed with exit code 1.

@li-jia-nan
Copy link
Collaborator

li-jia-nan commented Feb 20, 2023

ci 问题需要 @crazylxr @miracles1919 大佬看看

@coderluojz
Copy link
Contributor Author

@li-jia-nan 大佬能重新跑一下吗

@li-jia-nan
Copy link
Collaborator

ci 有点问题,不是这条 pr 的问题,重跑应该也是不行的

@coderluojz
Copy link
Contributor Author

@li-jia-nan @crazylxr review please

@coderluojz
Copy link
Contributor Author

@li-jia-nan @crazylxr 辛苦大佬们跟进下 pr 流程

@crazylxr
Copy link
Collaborator

@li-jia-nan @crazylxr 辛苦大佬们跟进下 pr 流程

feature 优先级会低一点哈,我们会优先处理 bug,不着急哈

@coderluojz
Copy link
Contributor Author

@li-jia-nan @crazylxr 大佬辛苦康康review

@luo3house
Copy link
Contributor

rec

滚动较慢时没有聚焦回 menu1

@coderluojz
Copy link
Contributor Author

coderluojz commented Feb 28, 2023

我已经更改了 辛苦查看

@coderluojz coderluojz closed this Feb 28, 2023
@coderluojz coderluojz reopened this Feb 28, 2023
@liuyib liuyib self-requested a review March 23, 2023 13:20
@liuyib liuyib changed the title feat: useInViewport (#2060) feat(useInViewport): add 'callback' options Apr 2, 2023
liuyib
liuyib previously approved these changes Apr 2, 2023
@liuyib liuyib dismissed their stale review April 7, 2023 02:25

docs needs to be updated

@liuyib liuyib changed the title feat(useInViewport): add 'callback' options feat(useInViewport): add 'callback' options and 'target' support array Apr 7, 2023
@li-jia-nan
Copy link
Collaborator

另外这个 callback 是不是可以用 useMemoizedFn 缓存一下

@coderluojz
Copy link
Contributor Author

另外这个 callback 是不是可以用 缓存一下useMemoizedFn

OK

docs(useInViewport): update docs target type support array
@li-jia-nan
Copy link
Collaborator

如果不用 useMemoizedFn 包的话,是不是应该把 callback 放进依赖数组监听一下?否则引用变了 hook 不会重新执行

@coderluojz
Copy link
Contributor Author

如果不用 useMemoizedFn 包的话,是不是应该把 callback 放进依赖数组监听一下?否则引用变了 hook 不会重新执行

ok的

Copy link
Collaborator

@liuyib liuyib left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

辛苦再完善下测试用例,callback 和 数组形式的 target 都要测到 @coderluojz

@coderluojz
Copy link
Contributor Author

coderluojz commented Apr 18, 2023

辛苦再完善下测试用例,callback 和 数组形式的 target 都要测到 @coderluojz

已添加测试用例 辛苦review @liuyib

@liuyib
Copy link
Collaborator

liuyib commented May 8, 2023

@coderluojz 不用一直重复 Merge branch 'master' into master 哈,merge 之前会有人更新的 ~

@coderluojz
Copy link
Contributor Author

@coderluojz 不用一直重复 Merge branch 'master' into master 哈,merge 之前会有人更新的 ~

好慢~

@liuyib
Copy link
Collaborator

liuyib commented Jun 6, 2023

@coderluojz 不用一直重复 Merge branch 'master' into master 哈,merge 之前会有人更新的 ~

好慢~

不着急哈,有 merge 权限的成员最近工作比较忙呢

@crazylxr crazylxr merged commit 9d60990 into alibaba:master Jul 12, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC] useInViewport
6 participants