Releases: iamgerwin/nova-dependency-container
v1.0.16
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
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
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
What's Changed
Fixed
- Fixed dependent field values not being saved on form submission
- Added missing
refattribute 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
refattributes, sothis.$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:clearFull Changelog: v1.0.12...v1.0.13
v1.0.12 - DOM-Based Watching for Flexible Fields
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 elementsloadInitialValuesFromDOM(): Get field values directly from DOM elements at mount timefindFlexibleContainer(): Locate the Flexible layout wrapper elementhandleDOMChange(): Process native DOM change eventsMutationObserver: 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:clearFull Changelog: v1.0.11...v1.0.12
v1.0.11 - Support Random Key Attribute Format
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 likecSkn6uKpVHMkMLmI__
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:clearFull Changelog: v1.0.10...v1.0.11
v1.0.10 - Fix Asset Registration with Nova
What's Changed
Fixed
- Fixed FieldServiceProvider not correctly registering JavaScript assets with Nova
- The previous
$app->resolving()pattern was not working; switched to standardNova::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\ServingNovaandLaravel\Nova\Nova
Installation
composer require iamgerwin/nova-dependency-container:^1.0.10
php artisan cache:clear
php artisan view:clearVerification
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
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:
- Open browser Developer Tools (F12)
- Go to Console tab
- Filter by
NovaDependencyContainer - Change the Type field to "Contact Us"
- 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:clearFull Changelog: v1.0.8...v1.0.9
v1.0.8 - Include Compiled Assets
What's Changed
Fixed
- Fixed missing compiled assets in package distribution
- The
/distfolder was incorrectly gitignored, preventing built Vue components from being included
Changed
- Removed
/distfrom .gitignore to include compiled assets in package - Added
PR.mdto .gitignore
Technical
- Built production assets with
npm run prod - Compiled
dist/js/field.js(21.5 KiB) anddist/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.8After updating, clear your cache:
php artisan cache:clear
php artisan view:clearFull Changelog: v1.0.7...v1.0.8
v1.0.7 - Multi-Group Flexible Field Fix
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
contextDetectedflag 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.7Full Changelog: v1.0.6...v1.0.7