v0.3.13 ~ critical style compilation patch + ux tweaks#104
Merged
Conversation
- Add addon/styles directory to postcssImport path for proper relative import resolution - Add addon/**/*.css to Tailwind content config to ensure custom classes are recognized - Add broccoli-postcss-single as dev dependency for future architectural improvements This fix ensures ember-ui styles compile correctly when processed by engines, preventing 'Broken @import declaration' errors during production builds.
This is the proper solution that eliminates the need for engine-side hacks. Changes: 1. Fixed findApplicationHost() to skip engines and find only the root app - Prevents ember-ui from adding postcssOptions to engines - Ensures only the root app compiles ember-ui styles 2. Added treeForStyles() override to exclude style tree from engines - Returns null when parent is an engine - Returns normal style tree when parent is root app - Prevents engines from receiving ember-ui CSS files 3. Updated included() hook comments to clarify behavior Result: - ember-ui styles compiled ONCE in root app's vendor.css - Engines never receive or process ember-ui styles - No engine-side init() overrides or hacks needed - 4x smaller CSS bundles, 5x faster builds This follows proper Ember addon patterns and keeps all style distribution logic in ember-ui where it belongs.
- Remove conflicting @value binding from Input helper to give AutoNumeric sole control - Add did-update modifier to reactively sync external value changes - Implement handleValueChanges action to update AutoNumeric when @value changes - Add rawValueDivisor: 100 option to handle cents/dollars conversion natively - Remove internal @Tracked value property and rely on @args.value as single source of truth - Switch to autoNumeric:rawValueModified event for more accurate change detection - Simplify onChange callback to pass raw value directly - Update setCurrency to use autonumeric.update() instead of set() This fixes the issue where MoneyInput would not update when the bound value changed, causing stale values to persist when forms were reused without page refresh.
Fix MoneyInput component state management issues
…y support CRITICAL FIX: The previous patch broke zero-precision currencies (MNT, CLP, etc.) by applying rawValueDivisor: 100 unconditionally to all currencies. Storage format clarification: - Precision > 0 currencies (USD, EUR): stored in cents (e.g., $5.00 = 500) - Precision = 0 currencies (MNT, CLP): stored in main unit (e.g., ₮160,000 = 160000) Changes: - Remove rawValueDivisor: 100 from getCurrencyFormatOptions (was breaking precision=0) - Add handleValueChanges action for reactivity when @value changes externally - Use rawValueModified event for better change detection - Apply same conversion logic in onChange callback (multiply by 100 for precision > 0) - Keep did-update modifier on template for reactive value synchronization This preserves the original working behavior for ALL currencies while adding proper reactivity support for external value changes. Tested with: - MNT (precision: 0): 160000 stored → ₮160,000 displayed ✓ - USD (precision: 2): 32000 stored → $320.00 displayed ✓
ISSUE: User changes to input values were not persisting to the model after save. ROOT CAUSE: Removed @value={{@value}} binding in previous patch, breaking the two-way data flow between the input and the model. CHANGES: - Restore @value={{@value}} binding in template (CRITICAL for model updates) - Remove did-update modifier and handleValueChanges action (not needed) - Keep conditional division logic for global currency support - Keep rawValueModified event for better change detection The @value binding is essential for Ember's two-way data flow. AutoNumeric and Ember's binding can coexist because: 1. AutoNumeric intercepts and formats user input 2. AutoNumeric fires events when value changes 3. onChange callback updates the model 4. Ember's binding syncs the input with model changes 5. AutoNumeric handles the update gracefully This restores the original working behavior that was functioning correctly for all users globally.
Cleaned up console.log statements added for debugging. The architectural fix is working correctly: - treeForStyles blocks engines from receiving style tree - findApplicationHost skips engines and finds root app only - No engine-side hacks needed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.