Coder Social home page Coder Social logo

quantum's Introduction

Quantum

This template should help get you started developing with Tauri + Solid + TypeScript + TailwindCSS.

Note

Tauri v2 is already considered stable, though it remains in Beta while the team works on audits and documentation. No big changes are expected by this point, but accept the risk of little hiccups until it reaches the final release.

Cloning it πŸ‘

You can use the Template button on the GitHub UI and shallow clone this repository. Or, do it with degit:

npx degit atilafassina/quantum

Alternatively, good old git clone can also work. It's recommended to make a shallow clone so it doesn't bring entire repository history:

git clone --depth 1 https://github.com/atilafassina/quantum

Running 🚀

The snippets below use PNPM as the package manager and task runner, but Yarn, NPM, Bun, or Cargo should also work with the appropriate syntax.

πŸ›Ÿ Check the Tauri Docs for more guidance on building your app.

First step is always to install JavaScript dependencies from the root:

pnpm install

Desktop (MacOS, Linux, or Windows) πŸ–₯️

Once the template is properly cloned, install Node.js dependencies and you can run the Tauri app.

pnpm tauri dev

iOS 🍎

Check the prerequisites for having iOS ready to run (MacOS only). Once that is done, let’s create the XCode project:

pnpm tauri ios init

If everything runs successfully (keep an eye for warnings on your terminal). You can start the development server:

pnpm tauri ios dev --open

This command will open XCode with your project, select the simulator and get ready to run.

Android πŸ€–

Android Studio and a few other steps will be required to get things up and running. Once that's done, you can initialize the project:

pnpm tauri android init

Open the Android Studio, and run the development build:

pnpm tauri android dev

This command will open the Android Pixel simulator.

Continuous Integration and deployment

This template implements a GitHub Action workflow that builds and publishes the binaries for MacOS, Linux, and Windows. You can check the .github/workflows/release.yml file for more details. The draft and publishing of release happens through CrabNebula Cloud. To fully use this feature you will need to have a CrabNebula account and add the necessary secrets to your repository.

Key Description
CN_API_KEY The API key for your CrabNebula account.
CN_APP_SLUG The slug of the app you want to publish.
TAURI_SIGNING_PRIVATE_KEY The private key used to sign the MacOS and Windows binaries.
TAURI_SIGNING_PRIVATE_KEY_PASSWORD The password for the private key.

Besides those, in the tauri.conf.json it is also important to add a pubkey for the auto-updater.

Build Optimization ⚑

With a few opinionated defaults, Quantum enforces a smaller binary size than stock Tauri templates. Except for some special cases, these work particularly well.

  • panic = "abort" The compiler will abort the program immediately when a panic occurs in production. Without performing any cleanup. Code will execute faster, the tradeoff is you won't get as much information about the panic when it occurs.

  • codegen-units = 1 Explicitly tells the compiler to use only one code generation unit during compilation. Code generation units (CGUs) represent individual units of code that the compiler processes independently.

Reducing CGUs to a minimum will potentially reduces memory consumption and leads to faster compilation time. This setting hinders parallelization, so it's worth to benchmark in your particular app.

  • lto = true Link Time Optimization (lto) enables the compiler to make more aggressive optimizations than it can do at the individual file level, resulting in potentially significant performance improvements in the final executable. However, enabling LTO may increase compilation times and require more memory during the linking phase, as the compiler needs to analyze and optimize a larger amount of code.

  • opt-level = "s"

Specifying the optimization level to be "size-optimized." This option instructs the compiler to prioritize reducing the size of the generated code while still aiming for reasonable performance.

Using "s" is a balanced optimization. Some apps may find faster compilation times with opt-level="z", though this may bring slower runtime performance as a tradeoff.

  • strip = true

Stripping symbols from generated code is generally recommended for release builds where binary size is a concern, and debuggability is less critical. It helps produce leaner binaries, which can be beneficial for deployment, distribution, or running in resource-constrained environments. Additionally, it can slightly enhance security because it makes the binaries harder to analyze.

Suggested VSCode extensions πŸ’‘


quantum's People

Contributors

atilafassina avatar brendonovich avatar erikras avatar kunalsin9h avatar vasfvitor 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.