-
-
Notifications
You must be signed in to change notification settings - Fork 365
[Cookbook] - fix component_architecture #2025
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
[Cookbook] - fix component_architecture #2025
Conversation
WebMamba
commented
Aug 3, 2024
Q | A |
---|---|
Bug fix? | no |
New feature? | no |
Issues | Fix |
License | MIT |
Some things i noticed while coding the render: The last code block will not work (wrong data attribute). Some name with incorrect case (Symfony, UX, JS) Some these/those i think. The example with Header/Body to change, as they are slots/blocks and no isolated component (maybe use a button with an Icon inside?) I'll make another review before monday :) |
Those two packages allow you to create reusable components in your Symfony application. | ||
But the component architecture is not exclusive to Symfony, it is a design pattern that can be applied to any programming language or framework. | ||
But the component architecture is not exclusive to Symfony, it's a design pattern that can be applied to any programming language or framework. | ||
And the js world already implement this architecture for long time, on many different frameworks like React, Vue, or Svelte. |
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.
And the js world already implement this architecture for long time, on many different frameworks like React, Vue, or Svelte. | |
And the JavaScript world already implements this architecture for long time, on many different frameworks like React, Vue, or Svelte. |
@@ -50,18 +50,18 @@ Or you can make composition with the following syntax: | |||
</twig:Card> | |||
``` | |||
|
|||
So here we Card component, and we give to the content of this component mutliple other components. | |||
So here we Card component, and we give to the content of this component two others components. |
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 here we Card component, and we give to the content of this component two others components. | |
So here we have a Card component, and we give to the content of this component two others components. |
Not sure about the 1st sentence tho
|
||
### Independence | ||
|
||
This is a really important rule, and not obvious. But your component should leave on his own context, | ||
he should not be aware of the rest of the page. You should to talk one component into a page, to another and it should work exactly the same. | ||
This rule make your component trully reusable. | ||
he should not be aware of the rest of the page. You should be able to take one component into a page, to another and it should work exactly the same. |
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.
he should not be aware of the rest of the page. You should be able to take one component into a page, to another and it should work exactly the same. | |
it should not be aware of the rest of the page. You should be able to take one component into a page, to another and it should works exactly the same. |
|
||
***How does it work into Symfony?*** | ||
|
||
Symfony keep the context of the page into the context of your component. So this your own responsability to follow this rules. | ||
But notice that if there are conflic between a variable from the context page and your component, your component context override the page context. | ||
Symfony keep the context of the page into the context of your component. So this your own responsibility to follow this rules. |
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.
Symfony keep the context of the page into the context of your component. So this your own responsibility to follow this rules. | |
Symfony keeps the context of the page into the context of your component. So this your own responsibility to follow those rules. |
(or "this rule")
Symfony keep the context of the page into the context of your component. So this your own responsability to follow this rules. | ||
But notice that if there are conflic between a variable from the context page and your component, your component context override the page context. | ||
Symfony keep the context of the page into the context of your component. So this your own responsibility to follow this rules. | ||
But notice that if there are conflict between a variable from the context page and your component, your component context override the page 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.
But notice that if there are conflict between a variable from the context page and your component, your component context override the page context. | |
But notice that if there are conflicts between a variable from the context page and your component, your component context override the page context. |
@@ -117,7 +117,7 @@ And when the loading is done, the state `loading` can be set to `false` and the | |||
|
|||
***How does it work into Symfony?*** | |||
|
|||
In symfony you 2 different approach to handle state. The first one is to use stimulus directly | |||
In Symfony you 2 different approach to handle state. The first one is to use stimulus directly |
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.
In Symfony you 2 different approach to handle state. The first one is to use stimulus directly | |
In Symfony you have two different approaches to handle state. The first one is to use stimulus directly |
I believe my comments can be replaced by an automatic tool, do you think we can use https://github.com/get-alex/alex or https://github.com/textlint/textlint or https://github.com/huacnlee/autocorrect or anything better? |
Thanks a lot, @Kocal! I am so bad at spelling 😭 |
Thanks a lot @smnandre! All fixed! |
Thanks you !! Let's merge this and we can iterate next to add features, tags, etc etc !! 👏 |
24f0d6b
to
1609a0e
Compare
1609a0e
to
686ab07
Compare
Thanks Matheo. |