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.
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
Feature/table #2593
base: main
Are you sure you want to change the base?
Feature/table #2593
Changes from all commits
8101e4d
5b43cbc
4bc3a0d
be190fc
8d32b21
0b5de14
a7ed412
7258547
60f5207
a773367
1916114
b1db8ad
5fbb6cb
49ea97a
9cb7e12
6fadfc3
7d09df1
3236593
384a75b
1f30861
5b724cd
e66ab7a
3bc7897
604f811
37c6900
7ba8796
401f770
36905da
76d4cef
d71d2d0
2d51bc5
75b931f
b698b60
7be3f07
8b17217
0c6e825
558db33
6381270
7149f01
1b57b25
2b11772
70b95aa
e68c20a
b510f56
d1d9532
50b2ca4
b02740c
c658190
066bd16
3fed2fa
514a638
82d5d6b
3906055
3219de1
0738028
5a97704
3d566f4
047fa3f
7d2aa58
a8766e9
69d83b2
1294d9d
4828bf3
1db187d
39219a5
d6f1a27
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
A relevant case to study here would be the bugfix in #2612. That fix is straight-forward, simple and easy to understand. With the suggested approach of only passing props for what to display, we'd instead have to:
undefined
everywhereThere 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.
Personally i'm not sold on this one. I find it confusing when, for example, the table component here is mostly located 'elsewhere' and not in the folder where the layout component is. We've been working on doing the opposite for a while; moving code related to each component or feature to the folder named after that component or feature.
The counter-point is that these pure components are meant for sharing, but when does actually sharing work? I haven't seen any larger drives to integrate these things (docs, Studio, storybook) with our components, and without having that discussion this shareability might just be a shot in the dark, and one more layer of indirection that might just make development harder.
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.
This is like saying its confusing to use designsystemet as a view library.
The benefits of separating view components from the app logic includes but is not limited to:
1. Code Reusability: Pure view components are reusable across different parts of the app, as they are only concerned with how the UI looks, not how it behaves. This makes it easy to use the same component in multiple places without duplicating logic.
This is a more important point than reusing components with Studio or Storybook, but it also gives us that possibility.
2. Simplified Testing: With view components separated, you can test them independently without worrying about application logic. This isolation makes unit tests more focused and reliable, as you only need to check if a component renders correctly for given inputs (props) and not the entire app flow.
This is a huge issue in our app currently. This will ensure we can both move more testing to components which will be faster now and scale better in the future.
3. Easier Maintenance: Separation makes it easier to locate and fix bugs since you know exactly where the UI ends and the logic begins. This modularity also makes refactoring or redesigning the UI simpler, as you’re only changing visual components without touching business logic.
As we are reusing things like lists, tables, inputs etc, we only update in one spot as well.
4. Improved Readability: Clean separation between views and logic helps other developers (or your future self) understand the structure of the app more quickly.
They can identify what each part does at a glance, as there is a clear boundary between the UI layer and the functionality layer.
5. Scalability: As applications grow, so does their complexity. A separation between UI and logic allows for better scalability by organizing code into distinct concerns. This allows teams to work on specific parts of the application more independently, making collaboration smoother.
In the future it could make sense to have one team focused on input components, and another focused on the app logic.
Easier State Management: When the view components are separate, managing state becomes clearer. Logic components handle state, business rules, and data fetching, while view components remain “dumb” and only render the provided data. This results in a more predictable data flow.
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.
Should this be part of the ADR when we also have stated that
adding yarn workspaces or similar requires more research and testing
? This should probably be pulled out and made into another ADR. I'm not entirely sure about the background for this to be a decision driver either - is it to enable sharing these pure components with other packages? In that case, I think a dedicated ADR is in order that also describes why that is needed, and why we couldn't go with other alternatives (why can't these other packages just use the design system as well -- why did this package have become a defacto design system?).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.
Ah, maybe it's my misunderstanding of ADRs. This is just documenting everything you talked about, even though the final solution fell short of supporting B3? Still, I didn't immediately see the connection to the problem context.
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.
So, the ADR conculdes that we should not introduce yarn workspaces or NX at this point, that would be separate ADR if we decied to investigate further. So that would as you say be pulled into a separate ADR.
But youre right, it could make sense that this ADR asked "should we introduce a component library?". However this was really already agreed upon in frontend architecture forum, so this ADR basically formulates how what was already agreed upon should be implemented.
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.
Not sure that's how it's meant to be used, but might as well link to the ADR from here as well. 🙏
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.
This is more a general guideline for the components in the folder. My preference would be to have this lib completely separate from the src folder so that importing the wrong way is not possible, but as we have not decided to do this yet, this readme serves as a litt reminder :)