Following #6115, I think that we should migrate all our demos to use the Box component or styled-component. ïŒ6115ã«ç¶ããŠãBoxã³ã³ããŒãã³ããŸãã¯styled-componentã䜿çšããããã«ãã¹ãŠã®ãã¢ã移è¡ããå¿
èŠããããšæããŸãã The goal is to hide @material-ui/styles
as much as possible.ç®æšã¯ã @material-ui/styles
ãã§ããã ãé ãããšã§ãã styled-components keeps growing , a consolidation of this styling solution will be better, overall, for the React community. styled-componentsã¯æé·ãç¶ããŠããããã®ã¹ã¿ã€ãªã³ã°ãœãªã¥ãŒã·ã§ã³ã®çµ±åã¯ãReactã³ãã¥ããã£å
šäœãšããŠããåªããŠããŸãã
Regarding the timing, I think that we can start to use the Box component now.ã¿ã€ãã³ã°ã«ã€ããŠã¯ãBoxã³ã³ããŒãã³ãã䜿ãå§ããããšãã§ãããšæããŸãã For the demos that we can't migrate, we probably want to wait for the first proof of concept with #6115.移è¡ã§ããªããã¢ã«ã€ããŠã¯ãïŒ6115ã®æåã®æŠå¿µå®èšŒãåŸ ã¡ãããšæãã§ãããã
en@oliviertassinari what is the exactly the tasks in hand? @oliviertassinariæå ã«ããã¿ã¹ã¯ã¯æ£ç¢ºã«ã¯äœã§ããïŒ
Here is what I understand,ãããç§ãç解ããŠããããšã§ãã
material-ui/styles
material-ui/styles
ã䜿çšãããã¹ãŠã®ãµã³ãã«ãœãŒã¹ã³ãŒããæ€çŽ¢ããŸãstyled-components
ããããstyled-components
ã«çœ®ãæããŸãIs this correct?ããã¯æ£ããã§ãïŒ
en@yordis I think that the timing is going to be key in this transition. @yordisãã®ç§»è¡ã§ã¯ã¿ã€ãã³ã°ãéèŠã«ãªããšæããŸãã I would imagine the following steps:ç§ã¯æ¬¡ã®ã¹ããããæ³åããŸãïŒ
@oliviertassinarièå³ããããŸãããããç¹°ãè¿ãããå Žåã¯ããè©«ã³ç³ãäžããŸã@material-ui/styles
ãã©ãããŒãŸãã¯styled-components
ã®æœè±¡åãšããŠä¿æããŠã¿ãŸãããïŒ
@ConAntonakos it's an option. @ConAntonakosããã¯ãªãã·ã§ã³ã§ãã It could help if we need to extend/normalize some of the features of styled-components.ã¹ã¿ã€ã«ä»ãã³ã³ããŒãã³ãã®æ©èœã®äžéšãæ¡åŒµ/æ£èŠåããå¿ èŠãããå Žåã«åœ¹ç«ã¡ãŸãã
en@oliviertassinariæ®ã£ãŠãããã®ã®ãªã¹ãã¯ãããŸããïŒ
en@yordis We haven't done many efforts in this direction yet. @yordisç§ãã¡ã¯ãŸã ãã®æ¹åã«å€ãã®åªåãããŠããŸããã However, there is a probability that it will require breaking changes, v5 is planned for around Q4 2020. I think that we should explore a partial deployment strategy for developers that want to leverage it sooner.ãã ããé倧ãªå€æŽãå¿ èŠã«ãªãå¯èœæ§ããããŸããv5ã¯2020幎第4ååæé ã«èšç»ãããŠããŸãããããããæ©ã掻çšãããéçºè åãã«ãéšåçãªå±éæŠç¥ãæ€èšããå¿ èŠããããšæããŸãã Now, this effort has to be balanced with the other priorities, like the support of new advanced components (free and paid) or the release of an unstyled version of the library to increase our audience reach (with different themes, eg iOS style).çŸåšããã®åãçµã¿ã¯ãæ°ããé«åºŠãªã³ã³ããŒãã³ãïŒç¡æããã³ææïŒã®ãµããŒããããªãŒãã£ãšã³ã¹ã®ãªãŒããæ¡å€§ããããã®ã¹ã¿ã€ã«ãªãããŒãžã§ã³ã®ã©ã€ãã©ãªã®ãªãªãŒã¹ïŒiOSã¹ã¿ã€ã«ãªã©ã®ããŸããŸãªããŒãïŒãªã©ãä»ã®åªå äºé ãšãã©ã³ã¹ãåãå¿ èŠããããŸãã The good news is that we will likely grow the team in the coming months, enabling us to move faster.幞ããªããšã«ãä»åŸæ°ãæ以å ã«ããŒã ãæé·ãããããéãè¡åã§ããããã«ãªãã§ãããã
I imagine you are already using styled-components on top of Material-UI today as many other developers do (and not @material-ui/styles
).ä»ã®å€ãã®éçºè
ã䜿çšããŠããããã«ïŒ @material-ui/styles
ã§ã¯ãªãïŒãä»æ¥ããã§ã«Material-UIã®äžã«ã¹ã¿ã€ã«ä»ãã³ã³ããŒãã³ãã䜿çšããŠãããšæããŸãã What are the top pain points you hope to address with this migration?ãã®ç§»è¡ã§å¯ŸåŠããããšèããŠããæ倧ã®åé¡ç¹ã¯äœã§ããïŒ
From a product perspective, our incentive is about: smaller bundle size, better performance, steaming support, fewer bugs, CSS template strings support, larger community, enables to use the system props in the core components, allow true dynamic themes and props support, better docs.補åã®èŠ³ç¹ãããç§ãã¡ã®ã€ã³ã»ã³ãã£ãã¯æ¬¡ã®ãšããã§ãããã³ãã«ãµã€ãºã®çž®å°ãããã©ãŒãã³ã¹ã®åäžãã¹ããŒã ãµããŒãããã°ã®æžå°ãCSSãã³ãã¬ãŒãæååã®ãµããŒããã³ãã¥ããã£ã®æ¡å€§ãã³ã¢ã³ã³ããŒãã³ãã§ã®ã·ã¹ãã å°éå ·ã®äœ¿çšãçã®åçããŒããšå°éå ·ã®ãµããŒããããè¯ãããã¥ã¡ã³ãã
enHowever, there is a high probability that it will require breaking changes,ãã ããé倧ãªå€æŽãå¿ èŠã«ãªãå¯èœæ§ãé«ãã§ããã
Yeah, I tried to change some examples, but they require some integration with the theme provider, so we may need to inject material/style
theme provider and styled-component
theme provider I am assuming.ãããç§ã¯ããã€ãã®äŸãå€æŽããããšããŸãããããããã¯ããŒããããã€ããŒãšã®çµ±åãå¿
èŠãšãããããç§ãæ³å®ããŠããmaterial/style
ããŒããããã€ããŒãšstyled-component
ããŒããããã€ããŒã泚å
¥ããå¿
èŠããããããããŸããã
v5 is planned for around Q4 2020. v5ã¯2020幎第4ååæé ã«èšç»ãããŠããŸãã
That is far enough, would it be better to pin different issues for visibility on what is a priority at the moment?ããã§ååã§ãããçŸæç¹ã§äœãåªå ãããŠããããå¯èŠåããããã«ãããŸããŸãªåé¡ãç¹å®ããæ¹ãããã§ããããã
I imagine you are already using styled-components on top of Material-UI today as many other developers do (and not @material-ui/styles).ä»ã®å€ãã®éçºè ãšåãããã«ãä»æ¥ãMaterial-UIã®äžã§ãã§ã«styled-componentsã䜿çšããŠãããšæããŸãïŒ@material-ui / stylesã§ã¯ãããŸããïŒã
Actually, I am quite happy with @material-ui/styles
and I am not using styled-components
when I use Material UI (I would remove withStyles
since I don't want to rely on programmer discipline ð , but I understand legacy software may no have hooks still )ð€·ââïžå®éãç§ã¯@material-ui/styles
ã«éåžžã«æºè¶³ããŠãããMaterial UIã䜿çšãããšãã«styled-components
ã䜿çšããŠããŸããïŒããã°ã©ããŒã®èŠåŸã«äŸåããããªãã®ã§ã withStyles
ãåé€ããŸãïŒ ðããããç§ã¯ã¬ã¬ã·ãŒãœãããŠã§ã¢ããŸã ããã¯ãæã£ãŠããªããããããªãããšãç解ããŠããŸãïŒð€·ââïž
What are the top pain points you hope to address with this migration?ãã®ç§»è¡ã§å¯ŸåŠããããšèããŠããæ倧ã®åé¡ç¹ã¯äœã§ããïŒ
I am trying to help with the migration, personally, no pain points.ç§ã¯å人çã«ãåé¡ç¹ãªãã§ç§»è¡ãæ¯æŽããããšããŠããŸãã Unless you take into consideration that as an ecosystem, I have to maintain two ways to develop something, but meh, personally, it is okay for me.çæ ç³»ãšããŠãããèæ ®ããªãéããç§ã¯äœããéçºããããã«2ã€ã®æ¹æ³ãç¶æããå¿ èŠããããŸãããå人çã«ã¯ãããã¯ç§ã«ãšã£ãŠã¯åé¡ãããŸããã
Maybe styled-components
fixes some interoperability with NextJS and Gatsby since the last time I tried was hard to make Mui work with those tools because of the SSR and styles (I am not sure if still painful) and most libraries using styled-components
work out of the box.ãã¶ãstyled-components
ã¯ãNextJSãšGatsbyãšã®çžäºéçšæ§ãä¿®æ£ããŸããããã¯ãååè©Šãããšãã«ãSSRãšã¹ã¿ã€ã«ïŒãŸã èŠçãã©ããã¯ããããŸããïŒãšã»ãšãã©ã®ã©ã€ãã©ãªãstyled-components
ã䜿çšããŠãããããMuiããããã®ããŒã«ã§åäœãããã®ãå°é£ã ã£ãããã§ãã
Let me know how I could help, like I said, I was using the pinned issues to find the prioritization of the Orgç§ãèšã£ãããã«ãç§ãã©ã®ããã«å©ããããšãã§ãããæããŠãã ããç§ã¯çµç¹ã®åªå é äœãèŠã€ããããã«ãã³çããããåé¡ã䜿çšããŠããŸãã
enThat is far enough, would it be better to pin different issues for visibility on what is a priority at the moment?ããã§ååã§ãããçŸæç¹ã§äœãåªå ãããŠããããå¯èŠåããããã«ãããŸããŸãªåé¡ãç¹å®ããæ¹ãããã§ããããã
It depends on the time horizon you are interested in. You can follow the issue with the label important
, the roadmap page on the documentation and the monthly blog product updates.é¢å¿ã®ããæéã«ãã£ãŠç°ãªããŸãã important
ãšããã©ãã«ãããã¥ã¡ã³ãã®ããŒããããããŒãžãããã³æ¯æã®ããã°è£œåã®æŽæ°ã䜿çšããŠãåé¡ã远跡ã§ããŸãã
I don't fully understand this point.ç§ã¯ãã®ç¹ãå®å šã«ã¯ç解ããŠããŸããã Why not using styled-components when using Material-UI (today)? Material-UIïŒä»æ¥ïŒã䜿çšãããšãã«styled-componentsã䜿çšããªãã®ã¯ãªãã§ããïŒ We had 1/3 of our users going down this path when we did our last survey, 6 months ago. 6ãæåã®ååã®èª¿æ»ã§ã¯ããŠãŒã¶ãŒã®3åã®1ããã®éãé²ãã§ããŸããã
enI don't fully understand this point.ç§ã¯ãã®ç¹ãå®å šã«ã¯ç解ããŠããŸããã Why not using styled-components when using Material-UI (today)? Material-UIïŒä»æ¥ïŒã䜿çšãããšãã«styled-componentsã䜿çšããªãã®ã¯ãªãã§ããïŒ
@material-ui/styles
works like a champ so far, no reason to migrate everything ð so I am one of those out of 3 that don't use it together today. @material-ui/styles
ã¯ãããŸã§ã®ãšãããã£ã³ããªã³ã®ããã«æ©èœãããã¹ãŠã移è¡ããçç±ã¯ãããŸããðç§ã¯3人ã®ãã¡ã®1人ã§ãä»æ¥ã¯äžç·ã«äœ¿çšããŠããŸããã
Thank you for the info about prioritization.åªå é äœä»ãã«é¢ããæ å ±ãããããšãããããŸãã
en@yordis btw, my answer was made under the assumption you were following up on the main styled-components issue. @yordisãšããã§ãç§ã®çãã¯ãããªããäž»ãªã¹ã¿ã€ã«ä»ãã³ã³ããŒãã³ãã®åé¡ããã©ããŒã¢ããããŠãããšããä»®å®ã®äžã§è¡ãããŸããã I haven't realized we were on the documentation one.ç§ãã¡ãããã¥ã¡ã³ããŒã·ã§ã³ã®1ã€ã«ããããšã«æ°ã¥ããŠããŸããã
en@oliviertassinari do you have any suggestions about the issue with theme context? @oliviertassinariããŒãã³ã³ããã¹ãã®åé¡ã«ã€ããŠäœãææ¡ã¯ãããŸããïŒ
I tried to use props.theme
inside an styled-components
but didn't work, I am not sure if you have a suggestion for it, but I think we will require to add styled-components
theme provider as well. $ styled-components
props.theme
ã䜿çšããããšããŸããããæ©èœããŸããã§ãããææ¡ããããã©ããã¯ããããŸãããã styled-components
ãè¿œå ããå¿
èŠããããšæããŸããããŒããããã€ããŒãã
Hey @oliviertassinari!ãã@oliviertassinariïŒ Are you looking for PR's that convert the existing customization demos to use styled-components as part of this issue?ãã®åé¡ã®äžéšãšããŠãæ¢åã®ã«ã¹ã¿ãã€ãºãã¢ãã¹ã¿ã€ã«ä»ãã³ã³ããŒãã³ãã䜿çšããããã«å€æããPRããæ¢ãã§ããïŒ
enI dont think styled-components
is a good styling solution. styled-components
ãè¯ãã¹ã¿ã€ãªã³ã°ãœãªã¥ãŒã·ã§ã³ã ãšã¯æããŸããã current solution looks much much more readable, appealing, accessible and cleaner than styled.çŸåšã®ãœãªã¥ãŒã·ã§ã³ã¯ãã¹ã¿ã€ã«èšå®ãããã¯ããã«èªã¿ããããé
åçã§ãã¢ã¯ã»ã¹ãããããã¯ãªãŒã³ã«èŠããŸãã i dont see any good reason to migrate.移è¡ããæ£åœãªçç±ãããããŸããã
I dont think
styled-components
is a good styling solution.styled-components
ãè¯ãã¹ã¿ã€ãªã³ã°ãœãªã¥ãŒã·ã§ã³ã ãšã¯æããŸããã current solution looks much much more readable, appealing, accessible and cleaner than styled.çŸåšã®ãœãªã¥ãŒã·ã§ã³ã¯ãã¹ã¿ã€ã«èšå®ãããã¯ããã«èªã¿ããããé åçã§ãã¢ã¯ã»ã¹ãããããã¯ãªãŒã³ã«èŠããŸãã i dont see any good reason to migrate.移è¡ããæ£åœãªçç±ãããããŸããã
And get almost fully typed.ãããŠãã»ãŒå®å šã«å ¥åããŸãã Don't see any reason to migrate +1 +1ã移è¡ããçç±ã¯ãããŸãã
enThe link you've posted, that should show growing interest to styled-components, recently started showing a downward trend:ããªããæçš¿ãããªã³ã¯ã¯ãã¹ã¿ã€ã«ä»ãã³ã³ããŒãã³ããžã®é¢å¿ãé«ãŸã£ãŠããããšã瀺ããŠããã¯ãã§ãããæè¿ãäžéåŸåã瀺ãå§ããŠããŸãã
I feel that narrowing down a styling solution to a single library is going to give us the exact same problem as we have today.ã¹ã¿ã€ãªã³ã°ãœãªã¥ãŒã·ã§ã³ãåäžã®ã©ã€ãã©ãªã«çµã蟌ããšãçŸåšãšãŸã£ããåãåé¡ãçºçãããšæããŸãã
What about integration with zero-runtime libraries such as linaria ? linariaãªã©ã®ãŒãã©ã³ã¿ã€ã ã©ã€ãã©ãªãšã®çµ±åã¯ã©ãã§ããïŒ This was suggested as being looked at in May 2019 Update .ããã¯ã 2019幎5æã®æŽæ°ã§æ€èšãããŠããããšã瀺åãããŸããã
enSo far it only recovered to pre-v5-hype.ãããŸã§ã®ãšãããv5以åã®èªå€§å®£äŒã«ããå埩ããŠããŸããã Let's see how the updated data point for January till now looks.ãããŸã§ã®1æã®æŽæ°ãããããŒã¿ãã€ã³ããã©ã®ããã«èŠããããèŠãŠã¿ãŸãããã
en@TheHolyWaffle Don't trust rank2traffic.com too much, data hasn't been very reliable nor up-to-date, its main advantage was the overall trend over 10 years (before it was made paid). @TheHolyWafflerank2traffic.comãããŸãä¿¡çšããªãã§ãã ãããããŒã¿ã®ä¿¡é Œæ§ãææ°æ§ãé«ããããŸããããã®äž»ãªå©ç¹ã¯ã10幎éïŒæ¯æããè¡ãããåïŒã®å
šäœçãªåŸåã§ããã For a shorter time window, so 6 months, prefer https://www.similarweb.com/ as more reliable. 6ãæãšããçãæéã®å Žåã¯ãä¿¡é Œæ§ãé«ããšããŠhttps://www.similarweb.com/ããå§ãããŸãã
Also take into account that once people know the API, they come back much frequently to the documentation.ãŸããAPIãç¥ã£ãããããã¥ã¡ã³ãã«é »ç¹ã«æ»ã£ãŠããããšãèæ
®ã«å
¥ããŠãã ããã
I dont think
styled-components
is a good styling solution.styled-components
ãè¯ãã¹ã¿ã€ãªã³ã°ãœãªã¥ãŒã·ã§ã³ã ãšã¯æããŸããã current solution looks much much more readable, appealing, accessible and cleaner than styled.çŸåšã®ãœãªã¥ãŒã·ã§ã³ã¯ãã¹ã¿ã€ã«èšå®ãããã¯ããã«èªã¿ããããé åçã§ãã¢ã¯ã»ã¹ãããããã¯ãªãŒã³ã«èŠããŸãã i dont see any good reason to migrate.移è¡ããæ£åœãªçç±ãããããŸãããAnd get almost fully typed.ãããŠãã»ãŒå®å šã«å ¥åããŸãã Don't see any reason to migrate +1 +1ã移è¡ããçç±ã¯ãããŸãã
+1 styles
is the main reason we're migrating to Material UI and moving away from styled components. +1 styles
ãããããªã¢ã«UIã«ç§»è¡ããã¹ã¿ã€ã«ä»ãã³ã³ããŒãã³ããã移è¡ããäž»ãªçç±ã§ãã It's too much CSS and refactoring it has proven to be a huge burden for us. CSSãå€ãããŠããªãã¡ã¯ã¿ãªã³ã°ã¯ç§ãã¡ã«ãšã£ãŠå€§ããªè² æ
ã§ããããšã蚌æãããŠããŸãã
Hi!ããïŒ First of all, thank you for providing a great component library, best one I've used so far.ãŸãããããŸã§äœ¿çšããäžã§æé«ã®ã³ã³ããŒãã³ãã©ã€ãã©ãªãæäŸããŠããã ãããããšãããããŸãã Our teams have written hundreds of thousands of lines of code using the components and methodology you created and once developers learn the basics of using classes
, how to write the styles etc., it's a breeze to work with even on a massive enterprise scale type of codebase.ç§ãã¡ã®ããŒã ã¯ãäœæããã³ã³ããŒãã³ããšæ¹æ³è«ã䜿çšããŠæ°åäžè¡ã®ã³ãŒããèšè¿°ããŸãããéçºè
ãclasses
ã®äœ¿çšã®åºæ¬ãã¹ã¿ã€ã«ã®èšè¿°æ¹æ³ãªã©ãåŠãã ãã倧èŠæš¡ãªãšã³ã¿ãŒãã©ã€ãºèŠæš¡ã®ã³ãŒãããŒã¹ã
I'm not sure if that's the most common use of your library, but I suppose you are aware that many teams build their component libraries on top of Material UI, and so any components and decision you make also trickle down to those libraries.ãããã©ã€ãã©ãªã®æãäžè¬çãªäœ¿çšæ³ã§ãããã©ããã¯ããããŸããããå€ãã®ããŒã ããããªã¢ã«UIã®äžã«ã³ã³ããŒãã³ãã©ã€ãã©ãªãæ§ç¯ããŠããããšããåç¥ã ãšæããŸãããã®ãããã³ã³ããŒãã³ãã決å®ã¯ãã¹ãŠãããã®ã©ã€ãã©ãªã«åæ ãããŸãã On our end we've been very happy with both performance and APIs so far.ç§ãã¡ã®åŽã§ã¯ããããŸã§ã®ãšããããã©ãŒãã³ã¹ãšAPIã®äž¡æ¹ã«éåžžã«æºè¶³ããŠããŸãã
I've been following recent development in the library and to be honest, I'm having trouble understanding some of the decisions and worried how that will affect our teams, and what's overall the benefit of this move would be, as opposed to for example forking MUI.ç§ã¯å³æžé€šã§ã®æè¿ã®éçºããã©ããŒããŠããŸããããæ£çŽãªãšãããããã€ãã®æ±ºå®ãç解ããã®ã«èŠåŽããŠããããããããŒã ã«ã©ã®ããã«åœ±é¿ãããããããŠãã®åãã®å šäœçãªã¡ãªããã¯ãããšãã°ã MUIããã©ãŒã¯ããŸãã Others have voiced their concern about move to styled components so I'll focus on the other one for me - the Box component.ä»ã®äººã¯ãã¹ã¿ã€ã«ä»ãã³ã³ããŒãã³ããžã®ç§»è¡ã«ã€ããŠæžå¿µãè¡šæããŠããã®ã§ããã1ã€ã§ããBoxã³ã³ããŒãã³ãã«çŠç¹ãåœãŠãŸãã
I understand the utility of a Box component - to make it possible to use theme variables etc. in prop values, however the API and the consequences of using this component disqualify it from something I could recommend to our teams. Boxã³ã³ããŒãã³ãã®æçšæ§ãç解ããŠããŸã-propå€ã§ããŒãå€æ°ãªã©ã䜿çšã§ããããã«ããããã§ãããAPIãšãã®ã³ã³ããŒãã³ãã䜿çšããçµæã¯ãç§ãããŒã ã«æšå¥šã§ãããã®ãããããå€±æ Œã«ããŸãã
First , it has a cryptic API for no reason I can discern (unless saving a few bytes is that reason): Instead of writing <Box margin={3} />
, it would be <Box m={3} />
.ãŸããããã¯ç§ãèå¥ã§ããçç±ããªãããã«äžå¯è§£ãªAPIãæã£ãŠããŸãïŒæ°ãã€ããç¯çŽããããšããã®çç±ã§ãªãéãïŒïŒ <Box margin={3} />
ãæžã代ããã«ãããã¯<Box m={3} />
ã«ãªããŸãã
Abbreviations like that seem needless, make things potentially ambigious, and introdue a new learning curve to developers, a mapping of abbreviations to actual properties they now need to memorize: "Is applying color
done using c
or color
?", "Is background
a b
, or bg
, or background
, or was b
a border
?"ãã®ãããªç¥èªã¯äžå¿
èŠã«æããç©äºãæœåšçã«ææ§ã«ããéçºè
ã«æ°ããåŠç¿æ²ç·ãå°å
¥ãcolor
ãããã¯ãéçºè
ãä»èŠããŠããå¿
èŠã®ããå®éã®ããããã£ãžã®ç¥èªã®ãããã³ã°ã§ãc
ãŸãã¯color
ïŒ "ã" background
ã¯b
ããŸãã¯bg
ããŸãã¯background
ããŸãã¯b
border
ïŒã "Is background-size
abbreviated as bs
?" ã background-size
ã¯bs
$ãšçç¥ãããŸããïŒã
Second , components abstract most commonly recurring UI patterns, and create APIs that provide means of customizing those patterns to the extent that the design system permits.次ã«ãã³ã³ããŒãã³ãã¯æãäžè¬çã«ç¹°ãè¿ãããUIãã¿ãŒã³ãæœè±¡åããèšèšã·ã¹ãã ãèš±å¯ããç¯å²ã§ãããã®ãã¿ãŒã³ãã«ã¹ã¿ãã€ãºããæ段ãæäŸããAPIãäœæããŸãã This manifests in creating props like gutterBottom
on Typography
, or dense
on ListItem
- as opposed to accepting just about any padding or margin.ããã¯ãã»ãŒãã¹ãŠã®ããã£ã³ã°ãããŒãžã³ãåãå
¥ããã®ã§ã¯ãªãã Typography
ã®gutterBottom
ã$ ListItem
ã®dense
ã®ãããªå°éå
·ãäœæããããšã§æããã«ãªããŸãã I feel like introducing Box
to large extent undermines this effort and introduces a tool that will make a mess out of any attempt to follow a design system unless we define some very nitpicky ways that Box component can be used for and spend effort in code reviews to make sure the all the values in used Box props aren't beyond the accepted list. Box
ãå°å
¥ãããšããã®åãçµã¿ã倧å¹
ã«æãªãããBoxã³ã³ããŒãã³ãã䜿çšããŠäœ¿çšã§ããéåžžã«åä»ãªæ¹æ³ãå®çŸ©ããªãéããèšèšã·ã¹ãã ã«åŸãè©Šã¿ãå°ç¡ãã«ããããŒã«ãå°å
¥ãããããã«æããŸãã䜿çšãããŠããBoxå°éå
·ã®ãã¹ãŠã®å€ãåãå
¥ãããããªã¹ããè¶
ããŠããªãããšã確èªããããã®ã³ãŒãã¬ãã¥ãŒã®åªåã And at that point, the way to "automate" this would be to create a component that restricts the options, and we're backt to square one.ãããŠããã®æç¹ã§ãããããèªååãããæ¹æ³ã¯ããªãã·ã§ã³ãå¶éããã³ã³ããŒãã³ããäœæããããšã§ãããç§ãã¡ã¯æ£æ¹åœ¢ã«æ»ããŸãã To give an example, why would using Box mb={2}
to achieve margin under Typography be okay, but Box mb={6}
not?äŸãæãããšãã¿ã€ãã°ã©ãã£ã§ããŒãžã³ãéæããããã«Box mb={2}
ã䜿çšããã®ã¯ãªãåé¡ãªãã®ã«ã Box mb={6}
ã¯åé¡ãªãã®ã§ããããã This concern doesn't exist when we can rely on props to limit the options.ãªãã·ã§ã³ãå¶éããããã«å°éå
·ã«é Œãããšãã§ããå Žåããã®æžå¿µã¯ååšããŸããã
Third concern, or rather a question I have. 3çªç®ã®æžå¿µããŸãã¯ãããç§ãæã£ãŠãã質åã Since the Box component is potentially a quick way to build certain functionality, it would be also used by libraries built on top of MUI. Boxã³ã³ããŒãã³ãã¯ãç¹å®ã®æ©èœããã°ããæ§ç¯ããæ¹æ³ã§ããå¯èœæ§ããããããMUIäžã«æ§ç¯ãããã©ã€ãã©ãªã§ã䜿çšãããŸãã How would one override the styles of Box
components used within another component?å¥ã®ã³ã³ããŒãã³ãå
ã§äœ¿çšãããBox
ã³ã³ããŒãã³ãã®ã¹ã¿ã€ã«ãã©ã®ããã«ãªãŒããŒã©ã€ãããŸããïŒ As an example.äŸãšããŠã If we built ListItem using Box under the hood, would we need to introduce BoxProps={{ padding: 2 }}
, or accept also dense
prop based on which we write logic to apply a padding
prop to a particular Box, or still something else?å
éšã§Boxã䜿çšããŠListItemãæ§ç¯ããå Žåã BoxProps={{ padding: 2 }}
ãå°å
¥ããå¿
èŠããããŸããããããšãdense
ãããããåãå
¥ããå¿
èŠããããŸããããã«åºã¥ããŠã padding
ãããããã«é©çšããããžãã¯ãèšè¿°ããŸããç¹å®ã®ããã¯ã¹ããŸãã¯ããã§ãäœãä»ã®ãã®ïŒ
I'm not sure if that's the most common use of your library, but I suppose you are aware that many teams build their component libraries on top of Material UI , and so any components and decision you make also trickle down to those libraries.ãããã©ã€ãã©ãªã®æãäžè¬çãªäœ¿çšæ³ã§ãããã©ããã¯ããããŸããããå€ãã®ããŒã ããããªã¢ã«UIã®äžã«ã³ã³ããŒãã³ãã©ã€ãã©ãªãæ§ç¯ããŠããããšããåç¥ã ãšæããŸãããã®ãããã³ã³ããŒãã³ãã決å®ã¯ãã¹ãŠãããã®ã©ã€ãã©ãªã«åæ ãããŸãã On our end we've been very happy with both performance and APIs so far.ç§ãã¡ã®åŽã§ã¯ããããŸã§ã®ãšããããã©ãŒãã³ã¹ãšAPIã®äž¡æ¹ã«éåžžã«æºè¶³ããŠããŸãã
@maciej-gurban This use case is an important one for us. @maciej-gurbanãã®ãŠãŒã¹ã±ãŒã¹ã¯ç§ãã¡ã«ãšã£ãŠéèŠãªãã®ã§ãã Our incentives are aligned to significantly improve it.ç§ãã¡ã®ã€ã³ã»ã³ãã£ãã¯ããããå€§å¹ ã«æ¹åããããã«èª¿æŽãããŠããŸãã This is one of our objectives with v5.ããã¯ãv5ã®ç®æšã®1ã€ã§ãã
For instance, we are investigating the feasibility to provide a design tool that could be put in the hands of designers (paid) and would output ready to use customized Material-UI components (MIT), corresponding documentation, Sketch & Figma kit.ããšãã°ãèšèšè
ã®æã«æž¡ãïŒææïŒãã«ã¹ã¿ãã€ãºãããMaterial-UIã³ã³ããŒãã³ãïŒMITïŒã察å¿ããããã¥ã¡ã³ããSketchïŒFigmaããããããã«äœ¿çšã§ããèšèšããŒã«ãæäŸããå¯èœæ§ã調æ»ããŠããŸãã Basically, all we have been going it for Material Design but scaling it ð.åºæ¬çã«ãç§ãã¡ã¯ãããªã¢ã«ãã¶ã€ã³ã®ããã«ãããè¡ã£ãŠããŸãããããããã¹ã±ãŒãªã³ã°ããŸãðã
The end goal here would be to free the time of a couple of front-end developers in each company.ããã§ã®æçµçãªç®æšã¯ãåäŒæ¥ã®2人ã®ããã³ããšã³ãéçºè
ã®æéã解æŸããããšã§ãã Why have front-end developers build a custom design system when it can be done by your own designers + Material-UI at a fraction of the cost?ç¬èªã®èšèšè
ãšMaterial-UIãããããªã³ã¹ãã§å®è¡ã§ããã®ã«ããªãããã³ããšã³ãéçºè
ãã«ã¹ã¿ã èšèšã·ã¹ãã ãæ§ç¯ããã®ã§ããããã + reduce risk and have your front-end developers spend time where they make the most differences: working on the product. +ãªã¹ã¯ã軜æžããããã³ããšã³ãã®éçºè
ã«ã補åã«åãçµããšããæ倧ã®éããããããæéãè²»ãããŠããããŸãã
I'm having trouble understanding some of the decisions and worried how that will affect our teamsããã€ãã®æ±ºå®ãç解ããã®ã«èŠåŽããŠããŠããããç§ãã¡ã®ããŒã ã«ã©ã®ããã«åœ±é¿ãããå¿é ããŠããŸã
If you could list them, it would be awesome.ããªãããããããªã¹ãããããšãã§ããã°ãããã¯çŽ æŽãããã§ãããã
Others have voiced their concern about move to styled componentsä»ã®äººã¯ãã¹ã¿ã€ã«ä»ãã³ã³ããŒãã³ããžã®ç§»è¡ã«ã€ããŠæžå¿µãè¡šæããŠããŸã
What's your concern with such a shift?ãã®ãããªå€åã«ã€ããŠããªãã¯äœãæžå¿µããŠããŸããïŒ Our objective on the styling side has a couple of layer:ã¹ã¿ã€ãªã³ã°åŽã®ç®çã«ã¯ãããã€ãã®ã¬ã€ã€ãŒããããŸãã
classes
API (first seen in jQuery-UI), provide default hardcoded values for each of the classes (global class names).åãclasses
APIïŒjQuery-UIã§æåã«èŠãããïŒãç¶æããåã¯ã©ã¹ïŒã°ããŒãã«ã¯ã©ã¹åïŒã«ããã©ã«ãã®ããŒãã³ãŒããããå€ãæäŸããŸãã The objective behind this shift answer to a couple of incentives.ãã®ã·ããã®èåŸã«ããç®çã¯ãããã€ãã®ã€ã³ã»ã³ãã£ãã«çããŸãã First, it's to dismiss a fear our users have, same to CRA eject mode, you won't use it but it feels safe to be present.ãŸããCRAã€ãžã§ã¯ãã¢ãŒããšåæ§ã«ããŠãŒã¶ãŒãæ±ãæããææããããšã§ããCRAã€ãžã§ã¯ãã¢ãŒãã¯äœ¿çšããŸããããååšããŠãå®å
šã ãšæããŸãã Second, it's required to be able to build the paid design tool.第äºã«ãææã®ãã¶ã€ã³ããŒã«ãæ§ç¯ã§ããå¿
èŠããããŸãã Third, it's required for the next layer第äžã«ãããã¯æ¬¡ã®å±€ã«å¿
èŠã§ãI'll focus on the other one for me - the Box component.ãã1ã€ã§ããBoxã³ã³ããŒãã³ãã«çŠç¹ãåœãŠãŸãã
Yeah, I can hear you!ãããèãããŸãïŒ I have been working with @gregberge in the past.ç§ã¯éå»ã«@gregbergeãšååããŠããŸããã At some point, we have considered hiding all the className props on @doctolib 's design system.ããæç¹ã§ã @doctolibã®èšèšã·ã¹ãã ã§ãã¹ãŠã®classNameãããããé衚瀺ã«ããããšãæ€èšããŸããã The interesting thought is that you can gain features (properties) in exchange of more constraints.èå³æ·±ãèãã¯ãããå€ãã®å¶çŽãšåŒãæãã«æ©èœïŒããããã£ïŒãååŸã§ããããšã§ãã
I wouldn't worry too much about this one.ããã«ã€ããŠã¯ããŸãæ°ã«ããŸããã This can be resolved with a global option to limit the access to the "system"'s features or an eslint rule.ããã¯ããã·ã¹ãã ãã®æ©èœãŸãã¯eslintã«ãŒã«ãžã®ã¢ã¯ã»ã¹ãå¶éããã°ããŒãã«ãªãã·ã§ã³ã§è§£æ±ºã§ããŸãã
enThe abbreviation on the Box component is confusing. Boxã³ã³ããŒãã³ãã®ç¥èªã¯çŽããããã§ãã Code is being read more than being written, so it's important to keep clear what the code is meaning.ã³ãŒãã¯æžãããŠãããããèªãŸããŠããã®ã§ãã³ãŒããäœãæå³ããŠããã®ããæ確ã«ããããšãéèŠã§ãã Last day I found "Box py={2}" in our codebase and I'm totally confused.æšæ¥ãã³ãŒãããŒã¹ã§ãBox py = {2}ããèŠã€ããŸããããå®å šã«æ··ä¹±ããŠããŸãã After a search I figured out that means "paddingY".æ€çŽ¢ãããšãããããã¯ãpaddingYããæå³ããããšãããããŸããã Those abbreviation should not be encouraged especially non-css properties (I can guess pt means padding-top but not for py)ãããã®çç¥åœ¢ã¯ãç¹ã«css以å€ã®ããããã£ãæšå¥šããã¹ãã§ã¯ãããŸããïŒptã¯padding-topãæå³ããŸãããpyã¯æå³ããªããšæããŸãïŒ
en@oliviertassinari Thanks for your patience @oliviertassinariãç解ããã ãããããšãããããŸã
I'm having trouble understanding some of the decisions and worried how that will affect our teamsããã€ãã®æ±ºå®ãç解ããã®ã«èŠåŽããŠããŠããããç§ãã¡ã®ããŒã ã«ã©ã®ããã«åœ±é¿ãããå¿é ããŠããŸã
If you could list them, it would be awesome.ããªãããããããªã¹ãããããšãã§ããã°ãããã¯çŽ æŽãããã§ãããã
I wouldn't want this to turn into a litany of things I disagree with, because ultimately you're the guys who maintain this library and our view of what makes sense will be shaped by our own needs which might and likely don't always align, and that's fine.æçµçã«ã¯ããªãããã®ã©ã€ãã©ãªã管çããŠãã人ã§ãããæå³ã®ãããã®ã«å¯Ÿããç§ãã¡ã®èŠæ¹ã¯ãåžžã«ã§ã¯ãªããããããªãç§ãã¡èªèº«ã®ããŒãºã«ãã£ãŠåœ¢äœãããã®ã§ãç§ã¯ãããç§ãåæããªããã®ã®é£ç¥·ã«å€ããããšãæãã§ããŸããæŽåããããã¯åé¡ãããŸããã I'm not against introducing the means of using other styling solutions - in fact I think it's great as it will bring more users who were holding off because of their dislike for JSS, but there's also us - the already existing users of your library who are sold on your solution, and if possible, would like to avoid massive refactor.ç§ã¯ä»ã®ã¹ã¿ã€ãªã³ã°ãœãªã¥ãŒã·ã§ã³ã䜿çšããæ段ãå°å ¥ããããšã«å察ããŠããŸãã-å®éãJSSãå«ããªããã«å»¶æããŠãããŠãŒã¶ãŒãå¢ããã®ã§çŽ æŽããããšæããŸãããç§ãã¡ãããŸã-ããªãã®ã©ã€ãã©ãªã®æ¢åã®ãŠãŒã¶ãŒã¯ãœãªã¥ãŒã·ã§ã³ã§è²©å£²ãããŠãããå¯èœã§ããã°ã倧èŠæš¡ãªãªãã¡ã¯ã¿ãªã³ã°ãé¿ããããšèããŠããŸãã
Even if you decide that "we still provide support for JSS", refactoring all demos and your components to styled components will force the teams using JSS to migrate to styled components. ãåŒãç¶ãJSSã®ãµããŒããæäŸããããšæ±ºå®ããå Žåã§ãããã¹ãŠã®ãã¢ãšã³ã³ããŒãã³ããã¹ã¿ã€ã«ä»ãã³ã³ããŒãã³ãã«ãªãã¡ã¯ã¿ãªã³ã°ãããšãJSSã䜿çšããããŒã ã¯ã¹ã¿ã€ã«ä»ãã³ã³ããŒãã³ãã«ç§»è¡ããå¿ èŠããããŸãã "Why are we still using X, when MUI team moved to Y?" ãMUIããŒã ãYã«ç§»åããã®ã«ããªããŸã Xã䜿çšããŠããã®ã§ããïŒã - will be one of the many questions in light of which it would be really hard not to agree with needing to make that migration sooner or later. -é ããæ©ãããã®ç§»è¡ãè¡ãå¿ èŠãããããšã«åæããªãã®ã¯éåžžã«é£ããããšãèãããšãå€ãã®è³ªåã®1ã€ã«ãªããŸãã
I can definitely empathize with wanting to reach a wider audience by using a styling solution that's more popular.ãã人æ°ã®ããã¹ã¿ã€ãªã³ã°ãœãªã¥ãŒã·ã§ã³ã䜿çšããããšã§ãããå€ãã®èŽè¡ã«ãªãŒãããããšããããšã«å ±æããããšãã§ããŸãã However, I think it's worth considering that "popular" is not always "best" and that a move to a different tech needs onsideration not only of advantages and disadvantages of both solution, but the context in which we're making the decision.ãã ããã人æ°ããåžžã«ãæè¯ãã§ãããšã¯éãããå¥ã®æè¡ãžã®ç§»è¡ã«ã¯ãäž¡æ¹ã®ãœãªã¥ãŒã·ã§ã³ã®é·æãšçæã ãã§ãªãã決å®ãäžãç¶æ³ã«ã€ããŠãèæ ®ããå¿ èŠãããããšãèæ ®ãã䟡å€ããããšæããŸãã
Starting fresh, looking merely at advantages of X over Y makes sense, but working on an already existing system we also need to consider the cost of switching over and domino effects this bring on downstream teams.æ°ãã«å§ããŠãYã«å¯ŸããXã®å©ç¹ã ããèŠãã®ã¯çã«ããªã£ãŠããŸãããæ¢åã®ã·ã¹ãã ã§äœæ¥ããå Žåã¯ãåãæ¿ãã®ã³ã¹ããšããããããŠã³ã¹ããªãŒã ããŒã ã«ãããããããå¹æãèæ ®ããå¿ èŠããããŸãã For this switch over to make sense the advantanges of the other solution need to outweight the cost of migrating over.ãã®åãæ¿ããæå³ã®ãããã®ã«ããããã«ãä»ã®ãœãªã¥ãŒã·ã§ã³ã®å©ç¹ã¯ã移è¡ã®ã³ã¹ããäžåãå¿ èŠããããŸãã It seems that for your team, that cost benefit analysis rules in favor of styled components, but from what I can tell looking at reactions at posts talking about styled components in your repo, your user base is far from the same conclusion.ããªãã®ããŒã ã«ãšã£ãŠããã®è²»çšäŸ¿çåæã¯ã¹ã¿ã€ã«ä»ãã³ã³ããŒãã³ããæ¯æããŠããããã§ããããªããžããªå ã®ã¹ã¿ã€ã«ä»ãã³ã³ããŒãã³ãã«ã€ããŠè©±ããŠããæçš¿ã§ã®åå¿ãèŠããšããŠãŒã¶ãŒããŒã¹ã¯åãçµè«ã«ã¯ã»ã©é ãã§ãã
Like you said, your aim is to open up MUI to more styling solutions.ããªããèšã£ãããã«ãããªãã®ç®çã¯ãMUIãããå€ãã®ã¹ã¿ã€ãªã³ã°ãœãªã¥ãŒã·ã§ã³ã«éæŸããããšã§ãã To provide good support for those solutions, there would need to be good documentation, examples and smooth integration layer - otherwise developers would find it hard to translate what they see in demos into what their styling solution of choice needs.ãããã®ãœãªã¥ãŒã·ã§ã³ãé©åã«ãµããŒãããã«ã¯ãåªããããã¥ã¡ã³ããäŸãã¹ã ãŒãºãªçµ±åã¬ã€ã€ãŒãå¿ èŠã§ããããããªããšãéçºè ã¯ãã¢ã§èŠããã®ããéžæããã¹ã¿ã€ãªã³ã°ãœãªã¥ãŒã·ã§ã³ã«å¿ èŠãªãã®ã«å€æããã®ãé£ããã§ãããã I'm just not sure if you really need to migrate to styled components to achieve the goals.ç®æšãéæããããã«ãã¹ã¿ã€ã«ä»ãã³ã³ããŒãã³ãã«æ¬åœã«ç§»è¡ããå¿ èŠããããã©ããã¯ããããŸããã Seems like your solution is also perfectly capable, if not more so than others, to build the design tool you're after since you already use actual JS object for all the styles.ãã¹ãŠã®ã¹ã¿ã€ã«ã«å®éã®JSãªããžã§ã¯ãããã§ã«äœ¿çšããŠããããããœãªã¥ãŒã·ã§ã³ã¯ãä»ã®ãœãªã¥ãŒã·ã§ã³ãããåªããŠãããšã¯èšããªããŸã§ããç®çã®ãã¶ã€ã³ããŒã«ãå®å šã«æ§ç¯ã§ããããã§ãã
enOne question I have, does this mean that the core of Mui would still use jss, and this allows for a better way to use styled components on top of that?ç§ãæã£ãŠãã1ã€ã®è³ªåã¯ãããã¯Muiã®ã³ã¢ãåŒãç¶ãjssã䜿çšããããšãæå³ããããã«ããããã®äžã«ã¹ã¿ã€ã«ä»ãã³ã³ããŒãã³ãã䜿çšããããã®ããè¯ãæ¹æ³ãå¯èœã«ãªããŸããïŒ Or would there be a way to say the core is also styled?ãããšããã³ã¢ãã¹ã¿ã€ãªã³ã°ãããŠãããšèšãæ¹æ³ã¯ãããŸããïŒ I just think it would add a lot of bloat if you have two css in js solutions. jsãœãªã¥ãŒã·ã§ã³ã«2ã€ã®cssãããå Žåãããã¯å€ãã®è¥å€§åãè¿œå ãããšæããŸãã
enHow would theming work if using styled-components?ã¹ã¿ã€ã«ä»ãã³ã³ããŒãã³ãã䜿çšããå ŽåãããŒãã¯ã©ã®ããã«æ©èœããŸããïŒ I used to use helpers in the CSS portion, and it was really messy.以åã¯CSSéšåã§ãã«ããŒã䜿çšããŠããŸããããéåžžã«é¢åã§ããã For me, the approach of applying theme props in a JS object is a lot cleaner than in a templated string.ç§ã«ãšã£ãŠãJSãªããžã§ã¯ãã«ããŒãã®å°éå ·ãé©çšããã¢ãããŒãã¯ããã³ãã¬ãŒãåãããæååãããã¯ããã«ã¯ãªãŒã³ã§ãã
enFor me (scientific backend programmer by origin), MUI styles bring beautiful, calming, predictable, parameterisable logic to the mental, crazy, bonkers-rules why-the-hell tearing-hair-out world of CSS.ç§ïŒèµ·æºã«ããç§åŠçãªããã¯ãšã³ãããã°ã©ããŒïŒã«ãšã£ãŠãMUIã¹ã¿ã€ã«ã¯ãçŸãããèœã¡çãããããäºæž¬å¯èœã§ããã©ã¡ãŒã¿ãŒåå¯èœãªããžãã¯ããCSSã®ç²Ÿç¥çã§ã¯ã¬ã€ãžãŒãªãã³ã«ãŒã«ãŒã«ã®ã«ãŒã«ã«ãããããŸãã
The styles library (and its tight integration with the theme) is the main reason I mandate use of MUI over any other components library in the two organisations I oversee tech for - it takes all the css agony away!ã¹ã¿ã€ã«ã©ã€ãã©ãªïŒããã³ããŒããšã®ç·å¯ãªçµ±åïŒããç§ãæè¡ãç£ç£ããŠãã2ã€ã®çµç¹ã®ä»ã®ã³ã³ããŒãã³ãã©ã€ãã©ãªãããMUIã®äœ¿çšã矩åä»ããŠããäž»ãªçç±ã§ã-ããã¯ãã¹ãŠã®cssã®èŠçãåãé€ããŸãïŒ At first, all the developers I work with are like "what the hell's going on? Where's the css? Just give me css!!"æåãç§ãäžç·ã«ä»äºãããŠãããã¹ãŠã®éçºè ã¯ã ãäžäœäœãèµ·ãã£ãŠããã®ãïŒcssã¯ã©ãã«ããã®ãïŒcssãããïŒãã®ãããªãã®ã§ãã and then they're like "Ohhhh. riiight. Got it. Magic."ãããŠã圌ãã¯ããããããã ããããã£ããéæ³ãã®ããã ã
In the longer term I think the current approach is going to become ever more powerful as the world moves to low/no code solutions (eg like sketch or figma, but outputting an actual routed app and set of components rather than a set of wireframes) - having styles expressed as an object unlocks the ability to introspect that - and create more new features in such an environment (like provision of a schema enabling direct use of MUI components within a CMS, or generation of 'theme from this' and hundreds I haven't thought of yet).é·æçã«ã¯ãäžçãäœ/ã³ãŒããªãã®ãœãªã¥ãŒã·ã§ã³ã«ç§»è¡ããã«ã€ããŠãçŸåšã®ã¢ãããŒãã¯ããã«åŒ·åã«ãªããšæããŸãïŒããšãã°ãã¹ã±ãããfigmaã®ããã«ãã¯ã€ã€ãŒãã¬ãŒã ã®ã»ããã§ã¯ãªããå®éã«ã«ãŒãã£ã³ã°ãããã¢ããªãšã³ã³ããŒãã³ãã®ã»ãããåºåããŸãïŒ -ã¹ã¿ã€ã«ããªããžã§ã¯ããšããŠè¡šçŸããããšã§ããããå çããæ©èœã解ãæŸãããŸã-ãããŠããã®ãããªç°å¢ã§ããå€ãã®æ°ããæ©èœãäœæããŸãïŒCMSå ã§MUIã³ã³ããŒãã³ããçŽæ¥äœ¿çšã§ããããã«ããã¹ããŒãã®æäŸããŸãã¯ãããããã®ããŒãããšæ°çŸã®Iã®çæãªã©ïŒãŸã èããŠããŸããïŒã
Moving back to the more raw-css kind of approach of styled-components
doesn't preclude that - but it does make a lot of things (particularly parameterisation on the theme) a lot jankier and frustrating to achieve, and still requires much more in-depth knowledge of CSS's technicalities making it less accessible to new programmers and creative types alike. styled-components
ã®ããçã®cssã®çš®é¡ã®ã¢ãããŒãã«æ»ãããšã¯ããããæé€ãããã®ã§ã¯ãããŸãã-ããããããã¯å€ãã®ããšïŒç¹ã«ããŒãã®ãã©ã¡ãŒã¿ãŒåïŒãéæããã®ã«éåžžã«åä»ã§ã€ã©ã€ã©ãããŸãããããŠããã§ãå¿
èŠã§ãCSSã®æè¡ã«é¢ããããæ·±ãç¥èã«ãããæ°ããããã°ã©ããŒãã¯ãªãšã€ãã£ãã¿ã€ããCSSã«ã¢ã¯ã»ã¹ãã«ãããªã£ãŠããŸãã
On the evolution of the state-of-the-art, I think styled-components
has become really popular because it's a great step in the right direction from where the world was (which is why it became popular).æå
端ã®é²åã®äžã§ã styled-components
ã¯äžçããã£ãå Žæããæ£ããæ¹åãžã®å€§ããªäžæ©ã§ãããããæ¬åœã«äººæ°ãåºãŠãããšæããŸãïŒããã人æ°ã«ãªã£ãçç±ã§ãïŒã But the existing MUI styles system is the next step on from that;ããããæ¢åã®MUIã¹ã¿ã€ã«ã·ã¹ãã ã¯ããããã®æ¬¡ã®ã¹ãããã§ãã not an incorrect side-step.ééã£ããµã€ãã¹ãããã§ã¯ãããŸããã Once everyone's migrated to styled-components then the question will be "wait: why on earth are we doing this with these weird raw strings in our components...?"å
šå¡ãstyled-componentsã«ç§»è¡ãããšã質åã¯ãåŸ
ã£ãŠãã ããããªããã³ã³ããŒãã³ãå
ã®ãããã®å¥åŠãªçã®æååã䜿çšããŠãããè¡ãã®ã§ãã...ïŒã
Maybe I'm totally wrong, but for my $0.02, I'm begging you to stay the course for at least another major version :)ãã¶ãç§ã¯å®å šã«ééã£ãŠããŸãããç§ã®0.02ãã«ã§ãå°ãªããšãå¥ã®ã¡ãžã£ãŒããŒãžã§ã³ã®ããã«ã³ãŒã¹ãç¶ããããã«ãé¡ãããŠããŸã:)
en@thclark your main concern seems to be with the CSS template string syntax vs the JavaScript style object API. @thclarkããªãã®äž»ãªé¢å¿äºã¯ãCSSãã³ãã¬ãŒãæååæ§æãšJavaScriptã¹ã¿ã€ã«ãªããžã§ã¯ãAPIã«ããããã§ãã Is this accurate?ããã¯æ£ç¢ºã§ããïŒ It also seems to be the concern with most of the other comments of the thread.ããã¯ãŸããã¹ã¬ããã®ä»ã®ã³ã¡ã³ãã®ã»ãšãã©ã«é¢ããæžå¿µã®ããã§ãã
Styled-components and emotions support both APIs.ã¹ã¿ã€ã«ä»ãã³ã³ããŒãã³ããšææ
ã¯äž¡æ¹ã®APIããµããŒãããŸãã This wasn't the main purpose of the issue.ããã¯åé¡ã®äž»ãªç®çã§ã¯ãããŸããã§ããã The objective of this issue was to anticipate the migration to a different styling solution.ãã®åé¡ã®ç®çã¯ãå¥ã®ã¹ã¿ã€ãªã³ã°ãœãªã¥ãŒã·ã§ã³ãžã®ç§»è¡ãäºæž¬ããããšã§ããã However, we never move forward with "use styled-components in all the demos even if we didn't migrate the core engine".ãã ãããã³ã¢ãšã³ãžã³ã移è¡ããªããŠãããã¹ãŠã®ãã¢ã§ã¹ã¿ã€ã«ä»ãã³ã³ããŒãã³ãã䜿çšãããããšã¯æ±ºããŠãããŸããã We have opted for keeping both synchronized.äž¡æ¹ã®åæãç¶æããããšãéžæããŸããã
At this point, keeping the issue open doesn't add much value outside triggering discussions like this one :).ãã®æç¹ã§ãåé¡ãéãããŸãŸã«ããŠããããšã¯ããã®ãããªè°è«ãåŒãèµ·ããããšä»¥å€ã«å€ãã®äŸ¡å€ãè¿œå ããŸãã:)ã We have to migrate the demos anyway for #22342.ãšã«ããïŒ22342ã®ãã¢ã移è¡ããå¿
èŠããããŸãã
I personally prefer the JavaScript API over the CSS string one because:ç§ã¯å人çã«CSSæååãããJavaScriptAPIã奜ã¿ãŸããçç±ã¯æ¬¡ã®ãšããã§ãã
However, it's unclear what the community, at large, will enjoy using most.ãã ããã³ãã¥ããã£å šäœã§äœãæããã䜿çšãããã¯äžæã§ãã CSS template has its advantages too. CSSãã³ãã¬ãŒãã«ãå©ç¹ããããŸãã It's easier to copy & paste code between the browser and the code.ãã©ãŠã¶ãšã³ãŒãã®éã§ã³ãŒããã³ããŒããŠè²Œãä»ããæ¹ãç°¡åã§ãã A lot more people (overall: designers, developers, etc.) are familiar with the approach.ããå€ãã®äººã ïŒå šäœãšããŠïŒèšèšè ãéçºè ãªã©ïŒããã®ã¢ãããŒãã«ç²ŸéããŠããŸãã
To be noted that I think that we should use the style utilities as much as possible in the demos with v5.ãªããv5ã®ãã¢ã§ã¯ãå¯èœãªéãã¹ã¿ã€ã«ãŠãŒãã£ãªãã£ã䜿çšããå¿ èŠããããšæããŸãã
@mnajdova any thoughts on the matter? @mnajdovaãã®åé¡ã«ã€ããŠäœãèãã¯ãããŸããïŒ Maybe it's worth asking the community on a poll.å€åããã¯äžè«èª¿æ»ã§ã³ãã¥ããã£ã«å°ãã䟡å€ããããŸãã
en@oliviertassinari succinctly put, as usual. @oliviertassinariã¯ãã€ãã®ããã«ç°¡æœã«èšããŸãã Yes, my main concern is retaining the Javascript API.ã¯ããç§ã®äž»ãªé¢å¿äºã¯JavascriptAPIãä¿æããããšã§ãã Honestly, I wasn't aware that styled-components retained that, as all of the examples I came across seem to be css templated.æ£çŽãªãšãããç§ãééãããã¹ãŠã®äŸã¯cssãã³ãã¬ãŒãåãããŠããããã«èŠãããããstyled-componentsããããä¿æããŠããããšã«æ°ã¥ããŠããŸããã§ããã
That perhaps moots most of my points above.ããã¯ããããäžèšã®ç§ã®ãã€ã³ãã®ã»ãšãã©ãè«ç ŽããŸãã Nevertheless, glad you didn't move across - and thanks for your and the team's continued efforts here.ããã«ãããããããããªãã移åããªãã£ãããšãããããæããŸã-ãããŠããªããšããŒã ã®ããã§ã®ç¶ç¶çãªåªåã«æè¬ããŸãã I've built things I never could have without MUI existing.ç§ã¯ãMUIãååšããªããã°å®çŸã§ããªãã£ããã®ãæ§ç¯ããŸããã
enThis issue is being resolved in v5.ãã®åé¡ã¯v5ã§è§£æ±ºãããŠããŸãã We have migrated the documentation of the slider to the new approach: https://next.material-ui.com/components/slider-styled/.ã¹ã©ã€ããŒã®ããã¥ã¡ã³ããæ°ããã¢ãããŒãã«ç§»è¡ããŸããïŒhttpsïŒ//next.material-ui.com/components/slider-styled/ã We use the sx
prop anytime simple CSS are necessary then use the styled
API for more heavy customizations.åçŽãªCSSãå¿
èŠãªå Žåã¯ãã€ã§ãsx
ããããã£ã䜿çšããããã«éãã«ã¹ã¿ãã€ãºã«ã¯styled
APIã䜿çšããŸãã I believe the previous concern raised have been handled, if not, please comment :).以åã«æèµ·ãããæžå¿µã¯åŠçããããšæããŸããããã§ãªãå Žåã¯ãã³ã¡ã³ãããŠãã ãã:)ã
æãåèã«ãªãã³ã¡ã³ã
I dont think
enstyled-components
is a good styling solution.styled-components
ãè¯ãã¹ã¿ã€ãªã³ã°ãœãªã¥ãŒã·ã§ã³ã ãšã¯æããŸããã current solution looks much much more readable, appealing, accessible and cleaner than styled.çŸåšã®ãœãªã¥ãŒã·ã§ã³ã¯ãã¹ã¿ã€ã«èšå®ãããã¯ããã«èªã¿ããããé åçã§ãã¢ã¯ã»ã¹ãããããã¯ãªãŒã³ã«èŠããŸãã i dont see any good reason to migrate.移è¡ããæ£åœãªçç±ãããããŸããã