Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] Adapt deno_tauri #30

Merged
merged 85 commits into from Apr 5, 2022
Merged

[feat] Adapt deno_tauri #30

merged 85 commits into from Apr 5, 2022

Conversation

marc2332
Copy link
Member

@marc2332 marc2332 commented Apr 5, 2022

This is a summary of all the changes we have been working on for the past 2.5 months. Original poc deno_tauri.

Description

Astrodon doesn't use FFI anymore, instead it has it's own Deno runtime that integrates natively with Wry. This allows Astrodon to stay performant while ensuring cross-platform compatibility, which we previosuly didn't have.

Astrodon is not meant to be a simple library, but a framework in which to build apps on.

Changes

Config file

Astrodon projects now require some more information, like the app's name, version, description, etc.. Like shown in the example.

Example:

export default <AppConfig> {
  entry: join(__dirname, "demo.ts"),
  dist: join(__dirname, "dist"),
  info: {
    name: "MarcApp",
    id: "marc.app
    version: "0.1.0",
    author: "Marc Espín",
    shortDescription: "Some description",
    longDescription: "Moooore description!!",
    homepage: "https://github.com/marc2332",
    copyright: "2022",
    icon: [],
    resources: [],
    permissions: { // You can also specify the Deno permissions your app will be run with
      allow_hrtime: true,
      prompt: true,
      allow_net: [],
    },
  },
};

Cli

Astrodon now has a CLI you can use if you want ( we recommend you to), unless you have very specific cases.

It has these commands:

astrodon build

Used to build the standalone version of your app. Cross-compiling is supported too.

astrodon run

Used to run your app in development mode.

astrodon init

Easily create a new project.

Development & build scripts

If the CLI built-in build and run commands are not enough for you, you can make use of the internal APIs, like showed in here with Builder and Develop.

Installers

We provide an integration with deno_installer, this means you can easily create Installers for your apps, it supports the three major OS, Windows, MacOS And Linux. But, you cannot cross-compile the installers since each one depends on OS-dependencies.

Runtimes

NOTE: These are just the internals of Astrodon, you won't need to care about this.

Astrodon runtime, this is the Deno Runtime with built-in APIs for wry. This serves as base layer for the development and standalone runtimes.

The Development Runtime is only used for development purposes, it has some development-only features such as parsing TypeScript, HTTP imports, which we believe it only makes sense while developing.

That's why there is also the Standalone Runtime, it's a more lightweight version and it's meant to be used only production. It puts the source code of your app (not your frontend assets yet, for that you would need to pack them with the installer for now, we also plan to bundle them) in a binary alongside the runtime, like Deno does, with eszip).

Since we do not use Deno's CLI, the final executable size is smaller. But, this comes with some trade-offs, like not supporting deno test, if Deno's CLI was more modularized...

Conclusion

There is still a lot of work to-do, but I think we are going pretty good. For now, we will keep working on this next release 0.2.0-alpha.1 and publish it when it's ready.

@marc2332 marc2332 added the enhancement New feature or request label Apr 5, 2022
@denyncrawford denyncrawford marked this pull request as ready for review April 5, 2022 16:42
@denyncrawford denyncrawford merged commit 4a5b059 into main Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants