Export all Dash properties with their defaults, even when not set internally #535
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.
In #437, we added the ability to have nilable codependent attributes. However, this change introduced a regression where those codependent attributes are no longer exported because they are not stored internally.
This change adds exporting for all Dash properties, whether they are set or not. The behavior uses the default value as the export for a key that was missing during initialization. If you set the value to
nil
later, it will benil
in the export.Note that there is behavior in here that is related to an implementation detail of MRI (and currently JRuby) as noted in the last commit and in the comment above two example groups in the specs. I wanted to explicitly document it because it's not commonly known behavior.
Lastly, this includes a small refactor of how
IndifferentAccess
converts keys. This made it cleaner to be consistent withDash::IndifferentAccess
and gives us a singular place for us to handle converting things for indifferent access.Closes #469