Skip to content

Comments

fix(integrations): use relative import in component.ts#5025

Merged
antfu merged 2 commits intovueuse:mainfrom
9romise:fix/import
Sep 12, 2025
Merged

fix(integrations): use relative import in component.ts#5025
antfu merged 2 commits intovueuse:mainfrom
9romise:fix/import

Conversation

@9romise
Copy link
Member

@9romise 9romise commented Sep 10, 2025

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.
⚠️ Slowing down new functions

Warning: Slowing down new functions

As the VueUse audience continues to grow, we have been inundated with an overwhelming number of feature requests and pull requests. As a result, maintaining the project has become increasingly challenging and has stretched our capacity to its limits. As such, in the near future, we may need to slow down our acceptance of new features and prioritize the stability and quality of existing functions. Please note that new features for VueUse may not be accepted at this time. If you have any new ideas, we suggest that you first incorporate them into your own codebase, iterate on them to suit your needs, and assess their generalizability. If you strongly believe that your ideas are beneficial to the community, you may submit a pull request along with your use cases, and we would be happy to review and discuss them. Thank you for your understanding.


Description

#5021 (comment)

Additional context

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Sep 10, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 10, 2025

Open in StackBlitz

@vueuse/components

npm i https://pkg.pr.new/@vueuse/components@5025

@vueuse/core

npm i https://pkg.pr.new/@vueuse/core@5025

@vueuse/electron

npm i https://pkg.pr.new/@vueuse/electron@5025

@vueuse/firebase

npm i https://pkg.pr.new/@vueuse/firebase@5025

@vueuse/integrations

npm i https://pkg.pr.new/@vueuse/integrations@5025

@vueuse/math

npm i https://pkg.pr.new/@vueuse/math@5025

@vueuse/metadata

npm i https://pkg.pr.new/@vueuse/metadata@5025

@vueuse/nuxt

npm i https://pkg.pr.new/@vueuse/nuxt@5025

@vueuse/router

npm i https://pkg.pr.new/@vueuse/router@5025

@vueuse/rxjs

npm i https://pkg.pr.new/@vueuse/rxjs@5025

@vueuse/shared

npm i https://pkg.pr.new/@vueuse/shared@5025

commit: ca11ff6

@9romise 9romise changed the title fix(integrations): use relative import in components fix(integrations): use relative import in components Sep 10, 2025
@9romise 9romise changed the title fix(integrations): use relative import in components fix(integrations): use relative import in component.ts Sep 10, 2025
import { useFocusTrap } from '@vueuse/integrations/useFocusTrap'
import type { UseFocusTrapOptions, UseFocusTrapReturn } from './index'
import { defineComponent, h, reactive, shallowRef } from 'vue'
import { useFocusTrap } from './index'
Copy link
Member

Choose a reason for hiding this comment

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

I think this was on purpose, otherwise the functions would be duplicated in the /components bundle. Instead, we should limit to not use ./index in component.ts

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, it won’t be bundled repeatedly — it imports a hashed file where duplicate logic has been extracted. See #5021 (comment).
Since @vueuse/integrations isn’t part of @vueuse/components and only references content within its own package, I think it doesn’t need to import using a full package name.

Copy link
Member

Choose a reason for hiding this comment

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

Ah I see.

@antfu antfu merged commit d5bcd50 into vueuse:main Sep 12, 2025
10 checks passed
@9romise 9romise deleted the fix/import branch September 12, 2025 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants