Giter Site home page Giter Site logo

hoffipublic / compose-jetsnack-custom Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 3.41 MB

a kotlin multiplatform WASM-Browser/Desktop only project derived from https://github.com/android/compose-samples/tree/main/Jetsnack

Kotlin 97.09% Shell 1.52% HTML 1.11% JavaScript 0.28%

compose-jetsnack-custom's Introduction

Jetsnack

Web version of Jetsnack application built with Compose Multiplatform for Web and Kotlin/Wasm.

To learn more about the Jetsnack application, visit the README.md of the original project.

Kotlin/Wasm

Note Kotlin/Wasm is Experimental and may be changed at any time. Use it only for evaluation purposes. We would appreciate your feedback on it in the public Slack channel #webassembly. If you face any issues, please report them on YouTrack.

Kotlin/Wasm is a new experimental target that enables developers to compile Kotlin code to WebAssembly (Wasm).

By compiling Kotlin code to WebAssembly, you can run it on any WebAssembly-compatible environment that meets Kotlin's requirements, including web browsers. This creates numerous opportunities, such as developing high-performance web applications and serverless functions.

Compose Multiplatform for Web

Note Web support is Experimental and may be changed at any time. Use it only for evaluation purposes. We would appreciate your feedback on it in the public Slack channel #compose-web. If you face any issues, please report them on GitHub.

Compose for Web is based on Kotlin/Wasm, the newest target for Kotlin Multiplatform projects. It allows you to run your code in the browser with all the benefits that WebAssembly has to offer, such as good and predictable performance for your applications.

Setup environment

IDE

We recommend using IntelliJ IDEA 2023.1 or later to work with the project. It has Kotlin/Wasm support out of the box.

Browser (for Kotlin/Wasm target)

Almost all modern browsers already support WebAssembly 1.0.

To run applications built with Kotlin/Wasm in a browser, you need to enable an experimental garbage collection feature:

Chrome:

For version 109:

  1. Run the application with the --js-flags=--experimental-wasm-gc command line argument.

For version 110 or later:

  1. Go to chrome://flags/#enable-webassembly-garbage-collection in your browser.
  2. Enable WebAssembly Garbage Collection.
  3. Relaunch your browser.

Firefox Nightly:

For version 112 or later:

  1. Go to about:config in your browser.
  2. Enable javascript.options.wasm_function_references and javascript.options.wasm_gc options.
  3. Relaunch your browser.

Edge:

For version 109 or later:

  1. Run the application with the --js-flags=--experimental-wasm-gc command line argument.

For more information see https://kotl.in/wasm_help/.

Build and run

Check out the repository, navigate to the project folder, and use the following commands:

Run Web version via Gradle

Run the following Gradle command in the terminal: ./gradlew :web:wasmJsRun

Once the application starts, open the following URL in your browser: http://localhost:8080

Run Desktop version via Gradle

Run the following Gradle command in the terminal: ./gradlew :desktop:run

Install Android application via Gradle

Run the following Gradle command in the terminal: ./gradlew :android:installDebug

Feedback & questions

Give it a try, and share your feedback and ask questions in the Kotlin Slack #compose-web channel (if you’re not a member, apply here) or on Twitter to @bashorov.

Learn more

compose-jetsnack-custom's People

Contributors

hoffimuc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.