directix 1.10.0 → 2.0.0

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 CHANGED
@@ -8,12 +8,13 @@
8
8
 
9
9
  **English** | **[中文文档](README_CN.md)**
10
10
 
11
- A comprehensive, easy-to-use, and high-performance Vue custom directives library supporting both Vue 2 and Vue 3.
11
+ A comprehensive, easy-to-use, and high-performance Vue custom directives library supporting both Vue 2 and Vue 3, with Web Components support.
12
12
 
13
13
  ## Features
14
14
 
15
15
  - 🎯 **Comprehensive** - 57 commonly used directives and 57 composables
16
- - 🔄 **Vue 2/3 Compatible** - Single codebase supports both Vue 2 and Vue 3
16
+ - 🔄 **Vue 2/3 Compatible** - Single codebase supporting both Vue 2.6+ and Vue 3.0+
17
+ - 🧩 **Web Components** - Use directives with Custom Elements / Web Components
17
18
  - 📦 **Tree-shakable** - Import only what you need
18
19
  - 🔒 **TypeScript** - Full TypeScript support with type definitions
19
20
  - 🚀 **SSR Friendly** - Multiple directives support SSR out of the box
@@ -24,16 +25,39 @@ A comprehensive, easy-to-use, and high-performance Vue custom directives library
24
25
  - 🌐 **i18n Support** - Built-in internationalization with Chinese, English, and Japanese translations
25
26
  - 🔌 **Plugin System** - Extensible plugin architecture for community contributions
26
27
 
27
- ## What's New in v1.10.0
28
+ ## What's Coming in v2.0.0 (Planned)
28
29
 
29
- ### Vue 3 Optimization Preview
30
+ > **Note**: v2.0.0 is currently in development. The features below are planned and will be released soon.
30
31
 
31
- Vue 3-specific optimizations leveraging the reactive system for better performance.
32
+ ### Web Components Support
33
+
34
+ Use Directix directives with Custom Elements / Web Components:
35
+
36
+ ```typescript
37
+ import { vLazy, defineCustomElementDirective, registerDirectiveElements } from 'directix'
38
+
39
+ // Define a single custom element from directive
40
+ defineCustomElementDirective({
41
+ name: 'lazy-img',
42
+ directive: vLazy,
43
+ shadow: true
44
+ })
45
+
46
+ // Register multiple directives as custom elements
47
+ registerDirectiveElements({
48
+ 'lazy-img': vLazy,
49
+ 'click-outside': vClickOutside
50
+ })
51
+ ```
52
+
53
+ ### Vue 3 Conditional Optimizations
54
+
55
+ When using Vue 3, Directix automatically applies performance optimizations:
32
56
 
33
57
  ```typescript
34
58
  import { useLazyOptimized, useSuspenseDirective, teleportContent } from 'directix'
35
59
 
36
- // Optimized lazy loading with shallowRef
60
+ // Optimized lazy loading with shallowRef (Vue 3 only)
37
61
  const { state, observe } = useLazyOptimized({
38
62
  onLoad: (entry) => console.log('Visible!')
39
63
  })
@@ -47,6 +71,10 @@ const { state, load } = useSuspenseDirective({
47
71
  teleportContent(element, { to: '#modal-container' })
48
72
  ```
49
73
 
74
+ ### Vue 2 Support Maintained
75
+
76
+ **v2.0.0 will maintain full Vue 2 compatibility** - all v1.x code continues to work without modifications. We are committed to supporting both Vue 2 and Vue 3.
77
+
50
78
  ### Mobile Optimization
51
79
 
52
80
  Enhanced touch gestures with haptic feedback and PWA support.