Repository navigation
Refactoring: From Config Classes to Objects - #279
Merged
Merged
Conversation
reb-dev
reviewed
Sep 29, 2023
Contributor
There was a problem hiding this comment.
@rokotyan The change makes sense, I'm on board with it.
Besides the other comments I posted,
- Any reason we should keep all of the
undefinedvalues in the default configs? It seems like a good chance to clean up the code a little. - Stylistically - why not use camel case for the configs. i.e.
areaDefaultConfiginstead ofAreaDefaultConfig? Since they are constants now not classes
rokotyan
force-pushed
the
refactor/config-objects
branch
3 times, most recently
from
October 2, 2023 20:24
99a5ce9 to
856f146
Compare
rokotyan
force-pushed
the
refactor/config-objects
branch
3 times, most recently
from
October 17, 2023 01:18
8e76fdb to
a939213
Compare
reb-dev
previously approved these changes
Oct 18, 2023
rokotyan
force-pushed
the
refactor/config-objects
branch
from
October 18, 2023 20:21
a939213 to
42c83da
Compare
reb-dev
approved these changes
Oct 18, 2023
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.
Currently Unovis initializes config classes based on the corresponding TypeScript interfaces. There's a big problem with this approach: the default parameters in the class don't automatically inherit types from the interface, making our code more error-prone.
This PR moves away from using classes to using simple objects for component and container configuration. It solves the problem with the types, and it has already pointed out some of the existing bugs in the code.
The main downside of this approach is that it may be a breaking change on the TypeScript side of things, causing TypeScript errors in our users' code.