• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

JetBrains/kotlin-wrappers: Kotlin wrappers for popular JavaScript libraries

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

JetBrains/kotlin-wrappers

开源软件地址(OpenSource Url):

https://github.com/JetBrains/kotlin-wrappers

开源编程语言(OpenSource Language):

Kotlin 100.0%

开源软件介绍(OpenSource Introduction):

JetBrains team project CI Maven Central Kotlin Slack channel

Kotlin Wrappers

This repository hosts a number of Kotlin wrappers for popular JavaScript libraries.

To learn more please refer to the READMEs of individual modules.

README Version
kotlin-browser Maven Central
kotlin-cesium Maven Central
kotlin-css Maven Central
kotlin-csstype Maven Central
kotlin-emotion Maven Central
kotlin-extensions Maven Central
kotlin-history Maven Central
kotlin-js Maven Central
kotlin-mui Maven Central
kotlin-mui-icons Maven Central
kotlin-node Maven Central
kotlin-popper Maven Central
kotlin-react Maven Central
kotlin-react-beautiful-dnd Maven Central
kotlin-react-core Maven Central
kotlin-react-dom Maven Central
kotlin-react-dom-legacy Maven Central
kotlin-react-legacy Maven Central
kotlin-react-redux Maven Central
kotlin-react-router-dom Maven Central
kotlin-react-popper Maven Central
kotlin-react-query Maven Central
kotlin-react-table Maven Central
kotlin-react-virtual Maven Central
kotlin-redux Maven Central
kotlin-ring-ui Maven Central
kotlin-styled Maven Central
kotlin-styled-next Maven Central
kotlin-tanstack-react-table Maven Central
kotlin-typescript Maven Central
kotlin-webrtc Maven Central
kotlin-wrappers-bom Maven Central

Artifacts are published to Maven Central, see the corresponding README files for package coordinates.

All packages require JDK 8 to be installed.

Using In Your Projects

Use the "Kotlin Wrappers BOM" which helps to ensure consistency between the modules and allows you not to think about version compatibility.

Just declare kotlin-wrappers-bom and specify the modules you need:

val kotlinWrappersVersion = "1.0.0-pre.351"

dependencies {
    implementation(enforcedPlatform("org.jetbrains.kotlin-wrappers:kotlin-wrappers-bom:$kotlinWrappersVersion"))
    implementation("org.jetbrains.kotlin-wrappers:kotlin-emotion")
    implementation("org.jetbrains.kotlin-wrappers:kotlin-react")
    implementation("org.jetbrains.kotlin-wrappers:kotlin-react-dom")
    implementation("org.jetbrains.kotlin-wrappers:kotlin-react-table")
    // other wrappers
}

Or use a helper function:

fun kotlinw(target: String): String =
    "org.jetbrains.kotlin-wrappers:kotlin-$target"

val kotlinWrappersVersion = "1.0.0-pre.351"

dependencies {
    implementation(enforcedPlatform(kotlinw("wrappers-bom:$kotlinWrappersVersion")))
    implementation(kotlinw("emotion"))
    implementation(kotlinw("react"))
    implementation(kotlinw("react-dom"))
    implementation(kotlinw("react-table"))
    // other wrappers
}

Make sure that you have mavenCentral() in the list of repositories.

Examples

  1. To-do list example

  2. Tic-Tac-Toe example

  3. A port of "Thinking in React" example

  4. An example of using axios to fetch remote data. It also demonstrates how to add typings for an external library.

  5. An example of using Quill that shows how to use an external React component.

  6. An example of using react-router-dom that shows how to use react-route-dom with hooks API.

  7. Building Web Applications with React and Kotlin/JS, a tutorial by JetBrains.

  8. A full-stack demo application written in Kotlin for JetBrains Night Moscow 2019.

  9. An example of using react-table that shows how to use react-table with hooks API.

  10. An example of using Material UI.

  11. ByteLegend: an open-source, real-world HTML5 MMORPG game.

Follow these examples to learn how to start developing your React apps with Kotlin. Good luck and have fun! You also can clone my-kotlin-react-sample to see the result directly.

Experimental IR Backend

Please note that React wrappers in particular heavily relied on specific characteristics of the default backend, which might make your current code incompatible with the new IR backend.

React error: "X not a function" in production mode

  • Every interface implementing Props or State should be marked as external interface. Otherwise, you will get Uncaught ClassCastException. If you’re implementing these interfaces via a class, you can mark it as @JsExport — however, we suggest evaluating if you could use an external interface instead.
  • Every component extending RComponent must be marked with @JsExport. Otherwise, you might run into issues such as TypeError: l.render is not a function (react-dom.production.min.js:182)
  • https://youtrack.jetbrains.com/issue/KT-42427, https://youtrack.jetbrains.com/issue/KT-39506

Contributing

Contributions to this project are welcome! Please see the open issues or chat with us on the #react channel in our Slack.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap