-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring layout/node type mapping #1202
Merged
Merged
Conversation
This file contains 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
… the mapped types used everywhere to look up component properties before/after hierarchy-processing
…tomatically generate it when building the app instead. This way a developer can add their own layout components without ever getting any merge conflicts, getting us one step closer to a solution to #200
…part from in lots of tests!)
…tensions. I feared this change would be a lot more difficult, so the fact that this went so smoothly shows that we have come a long way in not relying on the older layout types!
olemartinorg
added
the
kind/other
Pull requests containing chores/repo structure/other changes
label
May 26, 2023
olemartinorg
requested review from
Magnusrm,
framitdavid,
bjosttveit and
lassopicasso
May 26, 2023 12:24
…n objects. This might come in handy if some components need to override their LayoutNode class.
… we can avoid casting.
bjosttveit
approved these changes
May 30, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool! I like that you split the config and type config, much cleaner this way!
SonarCloud Quality Gate failed. |
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.
Description
Fixing a few issues:
src/layout/components.ts
, which is generated by runningyarn gen
, which should also happen automatically for all relevant operations). This should make a solution as described in Analysis: Template for app frontend #200 more feasible.ExprResolved<YourType>
, and if you had special needs (such as adopting children and including other LayoutNode objects in your post-hierarchy type), you had to manually override that inhierarchy.types.d.ts
. This should now just be set in the component config to take effect.Iframe
folder to match its component type name (IFrame
)HComponent<T>
andAnyItem<T>
is practically the same (although the first one does not support groups).. 🤷disabled
property that could be optionally set on all layout components, but was never read by any code.NotInLayout
type. It was now very easy to move these property extensions (such asbaseComponentId
) to indicate that they are only present on nodes in the hiearchy (as that's what add these properties), not some magic extensions to the layout definitions.LayoutNode
class and construct the extended class in the hierarchy. This will make it possible for components to add functionality here, such as having aLayoutNodeRepGroup
type.Related Issue(s)
Verification/QA
src/layout/layout.d.ts
andlayout.schema.v1.json
, and these are all backwards-compatiblekind/*
label to this PR for proper release notes grouping