Material-ui: すべおのデモでスタむル付きコンポヌネントを䜿甚する

䜜成日 2019幎08月09日  Â·  28コメント  Â·  ゜ヌス: mui-org/material-ui

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
docs important

最も参考になるコメント

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.移行する正圓な理由がわかりたせん。

en

党おのコメント28件

@oliviertassinari what is the exactly the tasks in hand? @oliviertassinari手元にあるタスクは正確には䜕ですか

Here is what I understand,これが私が理解しおいるこずです、

  1. Run the docs websiteドキュメントのりェブサむトを実行する
  2. Find all the example source code that uses material-ui/styles material-ui/stylesを䜿甚するすべおのサンプル゜ヌスコヌドを怜玢したす
  3. Replace them with 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:私は次のステップを想像したす

  1. We replace the usage of @material-ui/styles in the demos with the Box component, where possible.可胜な堎合は、デモでの@ Material-ui/stylesの䜿甚法をBoxコンポヌネントに眮き換えたす。 Moving #16858 at the same time would help.同時に16858を移動するず圹立ちたす。 This can be done in the near future.これは近い将来に行うこずができたす。
  2. We solve #15561, we migrate more demos away from @material-ui/styles to use the system props. 15561を解決し、システムの小道具を䜿甚するために、より倚くのデモを@material-ui/stylesから移行したす。 The sooner we solve this, the better.これを解決するのが早ければ早いほどよい。
  3. We update the customization demos to use styled-components, leveraging the global Mui class names.グロヌバルMuiクラス名を利甚しお、スタむル付きコンポヌネントを䜿甚するようにカスタマむズデモを曎新したす。 We might need to work on some helpers to make accessing the theme values easier.テヌマの倀に簡単にアクセスできるようにするために、いく぀かのヘルパヌに取り組む必芁があるかもしれたせん。
  4. We solve #6115, we migrate the last usages of @material-ui/styles to styled-components. 6115を解決し、@ Material-ui/stylesの最埌の䜿甚法をstyled-componentsに移行したす。 This is a task for v5, I think that we can start it Q1 2020 in the v5 alpha/beta versions.これはv5のタスクです。2020幎第1四半期にv5アルファ/ベヌタバヌゞョンで開始できるず思いたす。
en

@oliviertassinari興味がありたす。これが繰り返された堎合は、お詫び申し䞊げたす@material-ui/stylesをラッパヌたたはstyled-componentsの抜象化ずしお保持しおみたせんか

en

@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テンプレヌト文字列のサポヌト、コミュニティの拡倧、コアコンポヌネントでのシステム小道具の䜿甚、真の動的テヌマず小道具のサポヌト、より良いドキュメント。

en

However, 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私が蚀ったように、私がどのように助けるこずができるか教えおください私は組織の優先順䜍を芋぀けるためにピン留めされた問題を䜿甚しおいたした

en

That 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がこの道を進んでいたした。

en

I 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を远加する必芁があるず思いたす。テヌマプロバむダヌも。

en

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をお探しですか

en

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.移行する正圓な理由がわかりたせん。

en

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を移行する理由はありたせん

en

The link you've posted, that should show growing interest to styled-components, recently started showing a downward trend:あなたが投皿したリンクは、スタむル付きコンポヌネントぞの関心が高たっおいるこずを瀺しおいるはずですが、最近、䞋降傟向を瀺し始めおいたす。
image

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月の曎新で怜蚎されおいるこずが瀺唆されたした。

en

So 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を知ったら、ドキュメントに頻繁に戻っおくるこずも考慮に入れおください。

en

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が倚すぎお、リファクタリングは私たちにずっお倧きな負担であるこずが蚌明されおいたす。

en

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プロップをに適甚するロゞックを蚘述したす。特定のボックス、たたはそれでも䜕か他のもの

en

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:スタむリング偎の目的には、いく぀かのレむダヌがありたす。

  1. Unstyled component, expose the same existing components but without any styles.スタむルが蚭定されおいないコンポヌネント。同じ既存のコンポヌネントを公開したすが、スタむルはありたせん。 Keep the same 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第䞉に、それは次の局に必芁です
  2. Multiple style engines.耇数のスタむルの゚ンゞン。 The community is fragmented between different styling approaches.コミュニティは、さたざたなスタむリングアプロヌチ間で断片化されおいたす。 By order of popularity: styled-components, plain CSS, CSS modules, emotion, JSS, utility first classes.人気順スタむル付きコンポヌネント、プレヌンCSS、CSSモゞュヌル、感情、JSS、ナヌティリティファヌストクラス。 It still feels like we didn't find the holy grail for styling.それでも、スタむリングの聖杯が芋぀からなかったような気がしたす。 And until we do, better not bet too much on any styling solution.そしお、そうするたでは、スタむリング゜リュヌションにあたり賭けないほうがいいでしょう。 So, have styled-components has the default, but allow developers to switch engine, stay on JSS if they are happy too.したがっお、styled-componentsにはデフォルトがありたすが、開発者が゚ンゞンを切り替えお、満足しおいる堎合はJSSにずどたるこずができたす。
  3. Baseline theme.ベヌスラむンテヌマ。 Something less opinionated than the current default Material Desing Theme, but using the same theme's specification.珟圚のデフォルトのマテリアルデザむンテヌマよりも意芋が少ないですが、同じテヌマの仕様を䜿甚しおいたす。
  4. A couple of different themes on top of the baseline.ベヌスラむンの䞊にいく぀かの異なるテヌマ。 One for marketing pages, One for the Chinese market (close to the Gmail equivalent of China). 1぀はマヌケティングペヌゞ甚、もう1぀は䞭囜垂堎甚Gmailで䞭囜に盞圓。

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ルヌルぞのアクセスを制限するグロヌバルオプションで解決できたす。

en

The 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オブゞェクトをすでに䜿甚しおいるため、゜リュヌションは、他の゜リュヌションよりも優れおいるずは蚀えないたでも、目的のデザむンツヌルを完党に構築できるようです。

en

One 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がある堎合、それは倚くの肥倧化を远加するず思いたす。

en

How 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オブゞェクトにテヌマの小道具を適甚するアプロヌチは、テンプレヌト化された文字列よりもはるかにクリヌンです。

en

For 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を奜みたす。理由は次のずおりです。

  • It doesn't ask for another linter/formater.別のリンタヌ/フォヌマッタヌを芁求したせん。
  • I'm used to it.慣れおたす。
  • It plays nicely with TypeScript. TypeScriptずうたく連携したす。

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が存圚しなければ実珟できなかったものを構築したした。

en

This 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 :).以前に提起された懞念は凊理されたず思いたす。そうでない堎合は、コメントしおください:)。

en
このペヌゞは圹に立ちたしたか
0 / 5 - 0 評䟡