@mintjamsinc/ichigojs 0.1.9 → 0.1.11

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
@@ -16,9 +16,10 @@ A simple and intuitive reactive framework. Lightweight, fast, and user-friendly
16
16
  - 📦 **Lightweight** - Minimal bundle size
17
17
  - 🚀 **High Performance** - Efficient batched updates via microtask queue
18
18
  - 💪 **TypeScript** - Written in TypeScript with full type support
19
- - 🎨 **Directives** - `v-if`, `v-for`, `v-show`, `v-bind`, `v-on`, `v-model`, `v-resize`, `v-intersection`
19
+ - 🎨 **Directives** - `v-if`, `v-for`, `v-show`, `v-bind`, `v-on`, `v-model`, `v-resize`, `v-intersection`, `v-performance`
20
20
  - 📐 **Resize Observer** - Monitor element size changes with `v-resize` directive
21
21
  - 👁️ **Intersection Observer** - Detect element visibility with `v-intersection` directive
22
+ - ⚡ **Performance Observer** - Monitor performance metrics with `v-performance` directive
22
23
 
23
24
  ## Installation
24
25
 
@@ -272,6 +273,56 @@ You can also use `:options` for generic options:
272
273
  - Perfect for lazy loading, infinite scroll, and animation triggers
273
274
  - Access to element, VNode, and userData via `$ctx`
274
275
 
276
+ #### v-performance
277
+
278
+ Monitor performance metrics using PerformanceObserver:
279
+
280
+ ```html
281
+ <div v-performance="onPerformance">
282
+ Performance monitoring
283
+ </div>
284
+ ```
285
+
286
+ ```javascript
287
+ methods: {
288
+ onPerformance(entries, observer, options, $ctx) {
289
+ entries.getEntries().forEach(entry => {
290
+ console.log(`${entry.name}: ${entry.duration}ms`);
291
+ });
292
+
293
+ // Access dropped entries count if available
294
+ if (options?.droppedEntriesCount) {
295
+ console.log(`Dropped: ${options.droppedEntriesCount}`);
296
+ }
297
+ }
298
+ }
299
+ ```
300
+
301
+ **With custom options:**
302
+
303
+ ```html
304
+ <div v-performance="onPerformance"
305
+ :options.performance="{entryTypes: ['measure', 'mark']}">
306
+ Observe only measures and marks
307
+ </div>
308
+ ```
309
+
310
+ You can also use `:options` for generic options:
311
+
312
+ ```html
313
+ <div v-performance="onPerformance"
314
+ :options="{type: 'navigation', buffered: true}">
315
+ Performance monitoring
316
+ </div>
317
+ ```
318
+
319
+ **Features:**
320
+ - Native PerformanceObserver API for monitoring performance metrics
321
+ - Custom entry types and options via `:options.performance` or `:options`
322
+ - Automatic cleanup in destroy phase
323
+ - Monitor marks, measures, navigation, resource timing, and more
324
+ - Access to element, VNode, and userData via `$ctx`
325
+
275
326
  #### Lifecycle Hooks
276
327
 
277
328
  Lifecycle hooks allow you to run code at specific stages of an element's lifecycle. Each hook receives a **lifecycle context** (`$ctx`) with access to the element, VNode, and userData storage.