Skip to content
This repository has been archived by the owner on Nov 19, 2022. It is now read-only.

WIP: Add @material-ui/icons support #33

Closed
wants to merge 485 commits into from
Closed

WIP: Add @material-ui/icons support #33

wants to merge 485 commits into from

Conversation

gm666q
Copy link
Contributor

@gm666q gm666q commented Aug 21, 2020

This PR is work in progress.

Related issue: #25

@toliner
Copy link

toliner commented Aug 24, 2020

Thanks for your work. Code in this PR help me a lot.

I think that kotlin wrapper of @material-ui/icons should be auto-generated, because there are over 1100 icons.

From material-ui's document

Material Design has standardized over 1,100 official icons, each in five different "themes" (see below). For each SVG icon, we export the respective React component from the @material-ui/icons package. You can search the full list of these icons.

Hand-writing such a large number of wrappers is so hard.
I have an idea how to generate wrapper code:

  1. Get list of icons from material-icons's source dir
  2. Generate imports.kt based on the list
  3. Generate dsl functions (extension functions for RBuilder) for each icons

Here is the example of code-generation, build and publish: https://github.com/justincase-jp/AWS-CDK-Kotlin-DSL
I did it, so I can help you if you want to do code-generation.


Japanese:
英語が怪しいので日本語で要約

公式ドキュメントによると、Materialのアイコン数は1100以上、スタイルの差も含めたらjsファイルが6672個あるらしい。
手で書くのは流石に無理では?コード生成した方が良いと思います。
Material-uiのソースコードからiconの一覧は取得可能なので、それを使えばできるはずです。
私は別件でKotlinのコード生成 & ビルド & デプロイをやった事があるので、お手伝いできると思います。

@subroh0508
Copy link
Owner

@toliner Thanks for the suggestion! If you can write to write generator, I welcome your contribution😎

So please send me a Pull Request!


Japanese:

提案ありがとうございます!自動生成での対応、良いと思います😎
レビューは適宜しますので、Pull Requestを送ってくださると大変嬉しいです!

@gm666q
Copy link
Contributor Author

gm666q commented Aug 27, 2020

I wrote a crude generator in Rust I can share that or rewrite it if you prefer another language. I added remaining icons but didn't test it too much since there is more then 6000 icons. I also updated .gitingore because it wasn't ignoring OS specific files and gradle files correctly (https://github.com/JetBrains/idea-gitignore).

@gm666q gm666q closed this by deleting the head repository Apr 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants