@featherk/composables 0.5.4 → 0.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -52,6 +52,38 @@ import {
|
|
|
52
52
|
} from '@featherk/composables';
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
+
> I am getting build failures requesting libraries @vueuse/core @vueuse/integrations and focus-trap, when using only useGridA11y composable.
|
|
56
|
+
> useGridA11y currently does not use useFocusTrap composable, but has its own internal method for maintaining focus trap. useGridA11y does not require the @vueuse or focus-trap libraries.
|
|
57
|
+
|
|
58
|
+
**Why this happens:**
|
|
59
|
+
|
|
60
|
+
- If a dependency is imported or required anywhere in the package entry points (even if not used by your code), your bundler or Node will try to resolve it.
|
|
61
|
+
- In index.ts, all composables are exported from a single file, so importing from `@featherk/composables` pulls in all submodules, including those that import `@vueuse/core`, `@vueuse/integrations`, and `focus-trap`.
|
|
62
|
+
|
|
63
|
+
**Workarounds:**
|
|
64
|
+
|
|
65
|
+
1. **Use subpath imports**
|
|
66
|
+
|
|
67
|
+
Import only what you need, e.g.:
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
import { useGridA11y } from '@featherk/composables/grid';
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
This avoids loading the popup/focus-trap code.
|
|
74
|
+
|
|
75
|
+
2. **Install the dependencies**
|
|
76
|
+
If you must use the root import, you need to install all peer dependencies:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
npm install @vueuse/core @vueuse/integrations focus-trap
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Recommendation:**
|
|
83
|
+
Prefer subpath imports for tree-shaking and to avoid unnecessary dependencies, as described in the README.
|
|
84
|
+
|
|
85
|
+
If you think this should be improved, consider opening an issue or PR to make `focus-trap` and VueUse truly optional by moving their imports inside the `usePopupTrap` function or using dynamic imports.
|
|
86
|
+
|
|
55
87
|
## Peer Dependencies
|
|
56
88
|
|
|
57
89
|
- Required: `vue`
|
|
@@ -59,7 +91,7 @@ import {
|
|
|
59
91
|
|
|
60
92
|
```bash
|
|
61
93
|
npm install vue
|
|
62
|
-
# If you use usePopupTrap
|
|
94
|
+
# If you use usePopupTrap, or any of the date/time based composables
|
|
63
95
|
npm install @vueuse/core @vueuse/integrations focus-trap
|
|
64
96
|
```
|
|
65
97
|
|