Skip to content

Releases: iamgerwin/nova-dependency-container

v1.0.16

25 Nov 05:15
5099b91

Choose a tag to compare

Summary

Cleanup release for production readiness - removing debug logs and improving compatibility.

Changed

  • Removed all console.log debug statements from Vue components for production readiness
  • Improved FieldServiceProvider to gracefully handle environments where Nova is not available
  • Updated PHP version requirement to support PHP 8.3, 8.4, and 8.5
  • Updated dependency versions for better compatibility (collision ^8.6, pest ^3.7.4)

Fixed

  • Fixed PHPStan analysis errors by adding Nova availability check in FieldServiceProvider
  • Fixed test failures when Nova package is not installed in dev environment

Technical

  • Reduced JavaScript bundle size by removing debug logging (~2.5KB reduction: 27.2KB -> 24.7KB)
  • Added class_exists check before registering Nova assets to prevent errors in non-Nova environments
  • All tests passing, PHPStan analysis clean

Full Changelog: v1.0.15...v1.0.16

v1.0.15

25 Nov 04:56
ac6b442

Choose a tag to compare

Summary

Fixed child field values not being saved when NovaDependencyContainer is used inside nova-flexible-content layouts.

Fixed

  • Child field values not being saved in nova-flexible-content Flexible layouts
  • Child fields now correctly receive the Flexible prefix (e.g., cDsaj6Ub0m9hChBj__recipient_email) for proper form data submission

Added

  • applyFlexiblePrefixToChildFields() method to automatically prefix child field attributes when inside a Flexible context
  • Child field attributes are now prefixed at mount time if a Flexible context is detected

Technical

  • nova-flexible-content generates cryptic prefixes (e.g., cDsaj6Ub0m9hChBj__) for field attributes
  • NovaDependencyContainer's child fields were using unprefixed attributes, causing form data to be ignored by Flexible
  • The fix applies the detected Flexible prefix to all child field attributes before they render

Related

Full Changelog: v1.0.14...v1.0.15

v1.0.14

25 Nov 04:44
4cc4adc

Choose a tag to compare

Summary

Fixed dependent field values not being saved when the form is submitted.

Fixed

  • Dependent field values not being saved on form submission (Vue 3 ref pattern)
  • The previous fix in v1.0.13 used dynamic string refs which don't work reliably in Vue 3 v-for loops

Changed

  • Switched from dynamic string refs to Vue 3 function refs
  • Added fieldRefs data property to store child field component references
  • Added setFieldRef() method to properly collect and manage child component refs
  • Updated fill() method to use the new fieldRefs object for accessing child components
  • Added cleanup for fieldRefs in beforeUnmount lifecycle hook

Technical

  • Vue 3 requires function refs when using dynamic ref names in v-for loops
  • Dynamic string refs create arrays but are unreliable to access via $refs[key]
  • Function refs provide direct access to component instances

Full Changelog: v1.0.13...v1.0.14

v1.0.13 - Fix Form Submission for Dependent Fields

25 Nov 04:32
91a4b6e

Choose a tag to compare

What's Changed

Fixed

  • Fixed dependent field values not being saved on form submission
  • Added missing ref attribute to child components in template for proper Vue component referencing
  • Fixed fill() method to handle Vue 3's array-based refs in v-for loops

Technical

  • The template was missing ref attributes, so this.$refs['field-...'] returned undefined
  • In Vue 3, refs created in v-for loops are stored as arrays, not single elements
  • The fill method now correctly accesses $refs[refKey][0] when the ref is an array

Installation

composer require iamgerwin/nova-dependency-container:^1.0.13
php artisan cache:clear
php artisan view:clear

Full Changelog: v1.0.12...v1.0.13

v1.0.12 - DOM-Based Watching for Flexible Fields

25 Nov 04:00
7b151cc

Choose a tag to compare

What's Changed

Fixed

  • Fixed field change detection inside Flexible layouts where Nova events are not emitted
  • Added DOM-based watching as fallback when Nova's global field-changed events don't fire

Added

  • setupDOMWatching(): Listen for native DOM change/input events on form elements
  • loadInitialValuesFromDOM(): Get field values directly from DOM elements at mount time
  • findFlexibleContainer(): Locate the Flexible layout wrapper element
  • handleDOMChange(): Process native DOM change events
  • MutationObserver: Detect dynamically added elements

Technical

  • Fields inside nova-flexible-content don't emit to Nova's global event bus
  • Now watches select/input/textarea elements directly via addEventListener
  • Properly cleans up event listeners and MutationObserver on unmount

Installation

composer require iamgerwin/nova-dependency-container:^1.0.12
php artisan cache:clear
php artisan view:clear

Full Changelog: v1.0.11...v1.0.12

v1.0.11 - Support Random Key Attribute Format

25 Nov 03:53
b6f73b6

Choose a tag to compare

What's Changed

Fixed

  • Fixed regex patterns to support nova-flexible-content's random key attribute format
  • The package was only matching numeric index patterns like overlay_items__0__ but not random keys like cSkn6uKpVHMkMLmI__

Technical

  • Updated extractPrefixFromAttribute() to support random key format: ^([a-zA-Z0-9]+__)
  • Updated extractBaseAttribute() to extract field names from random key prefixed attributes
  • nova-flexible-content uses random alphanumeric keys instead of numeric indices

Installation

composer require iamgerwin/nova-dependency-container:^1.0.11
php artisan cache:clear
php artisan view:clear

Full Changelog: v1.0.10...v1.0.11

v1.0.10 - Fix Asset Registration with Nova

25 Nov 03:45
c83d55d

Choose a tag to compare

What's Changed

Fixed

  • Fixed FieldServiceProvider not correctly registering JavaScript assets with Nova
  • The previous $app->resolving() pattern was not working; switched to standard Nova::serving() pattern

Root Cause

The Vue components were never being loaded because the service provider wasn't correctly registering the JavaScript file with Nova. This was the actual root cause of the Flexible field issue.

Technical

  • Refactored FieldServiceProvider to use the standard Nova asset registration pattern
  • Now properly imports Laravel\Nova\Events\ServingNova and Laravel\Nova\Nova

Installation

composer require iamgerwin/nova-dependency-container:^1.0.10
php artisan cache:clear
php artisan view:clear

Verification

After updating, open browser Developer Tools (F12) and check the Console. You should now see [NovaDependencyContainer] logs when interacting with the form.

Full Changelog: v1.0.9...v1.0.10

v1.0.9 - Debug Logging for Flexible Field Diagnosis

25 Nov 03:39
9029da0

Choose a tag to compare

What's Changed

Added

  • Added comprehensive debug logging to diagnose Flexible field issues
  • Console logs for: mount, context detection, event handling, dependency checking

How to Use

After updating to v1.0.9:

  1. Open browser Developer Tools (F12)
  2. Go to Console tab
  3. Filter by NovaDependencyContainer
  4. Change the Type field to "Contact Us"
  5. Share the console output with us

Expected Console Output

When working correctly, you should see:

[NovaDependencyContainer] Mounted with field: {...}
[NovaDependencyContainer] Dependencies: [{field: 'type', value: 'Contact Us'}]
[NovaDependencyContainer] Watching for field-changed events
[NovaDependencyContainer] field-changed event received: {...}
[NovaDependencyContainer] Setting isVisible to: true

If the last line shows isVisible: false or if you don't see field-changed event received, please share the full console output so we can diagnose the issue.

Installation

composer require iamgerwin/nova-dependency-container:^1.0.9
php artisan cache:clear
php artisan view:clear

Full Changelog: v1.0.8...v1.0.9

v1.0.8 - Include Compiled Assets

25 Nov 03:30
fd40a5a

Choose a tag to compare

What's Changed

Fixed

  • Fixed missing compiled assets in package distribution
  • The /dist folder was incorrectly gitignored, preventing built Vue components from being included

Changed

  • Removed /dist from .gitignore to include compiled assets in package
  • Added PR.md to .gitignore

Technical

  • Built production assets with npm run prod
  • Compiled dist/js/field.js (21.5 KiB) and dist/css/field.css

Important Note

This release includes the compiled Vue components that were missing in previous releases. If you were experiencing issues where the dependency container wasn't working inside Flexible fields (or anywhere), this release should fix it.

Installation

composer require iamgerwin/nova-dependency-container:^1.0.8

After updating, clear your cache:

php artisan cache:clear
php artisan view:clear

Full Changelog: v1.0.7...v1.0.8

v1.0.7 - Multi-Group Flexible Field Fix

25 Nov 03:22

Choose a tag to compare

What's Changed

Fixed

  • Fixed cross-group contamination in multi-group Flexible layouts (#4)
  • Fixed context detection failing when container and child field attributes are empty

Added

  • Added detectFlexibleContextOnMount() for early context detection at component mount
  • Added contextDetected flag for better context state management
  • Added DOM-based context detection as fallback method
  • Added Vue component tree traversal for Flexible layout parent detection

Changed

  • Enhanced context detection to use 4 methods: container attribute, child fields, parent components, and DOM
  • Improved event handling to only cache base attribute when context matches
  • Events from other Flexible groups are now strictly filtered once context is detected
  • Context is now claimed only from events matching dependency fields

Technical Details

  • Implemented 4-method context detection approach in FormField.vue
  • Implemented same detection approach in DetailField.vue for consistency
  • Each container now maintains its own isolated context

Installation

composer require iamgerwin/nova-dependency-container:^1.0.7

Full Changelog: v1.0.6...v1.0.7