blackboardsh / electrobun Goto Github PK
View Code? Open in Web Editor NEWBuild ultra fast, tiny, and cross-platform desktop apps with Typescript.
Home Page: https://www.electrobun.dev
License: MIT License
Build ultra fast, tiny, and cross-platform desktop apps with Typescript.
Home Page: https://www.electrobun.dev
License: MIT License
Two paths:
Open questions:
dev
distribution
dev
distribution
// version.json -- in the app bundle
{
"version": "1.0.0",
"channel": "stable",
"url": "http://example.com/update.json"
}
// update.json -- hosted somewhere
{
"baseUrl": "http://example.com/updates/",
"channels": {
"stable": {
"1.0.0": {
"notes": "This is a stable release",
"targets": {
"windows-x64": {
"bundle": {
"checksum": "1234567890abcdef",
"filesize": 102900
},
"app": {
"checksum": "1234567890abcdef",
"filesize": 102400
},
"bun": {
"checksum": "abcdef1234567890",
"filesize": 20480
},
"webview": {
"checksum": "fedcba0987654321",
"filesize": 30720
}
},
"linux-arm64": {
"bundle": {
"checksum": "1234567890abcdef",
"filesize": 102900
},
"app": {
"checksum": "0987654321fedcba",
"filesize": 51200
},
"bun": {
"checksum": "abcdef1234567890",
"filesize": 15360
},
"webview": {
"checksum": "1234567890abcdef",
"filesize": 20480
}
}
}
}
},
"canary": {
"1.1.0": {
"notes": "This is a beta release",
"targets": {
// Similar structure for canary builds
}
}
},
"dev": {
"1.2.0": {
"notes": "This is a dev release",
"targets": {
// Similar structure for dev builds
}
}
}
}
}
Tasks:
This is a high level roadmap for how we're thinking about building Electrobun over the next few months
The example app should be interactive with a sidebar that lets users explore all the Electrobun features and then jump into the code to see how it works. It would also function as a smoketest/QA tool when iterating on new features
Originally the thought was to just separate the bun runtime from your application code and download them separately. this made more sense when all your app files were packed into a tar or asar file or embedded into the zig binary.
With app bundles there are also complexities because you need the codesign info and stapled notarization and so on.
But the reality is a given app will have lots of separate files (eg: included binaries and assets that can't be bundled) along with text bundles and/or embedded files.
With a typical .blockmap mechanism you can quickly run into offset issues. ie: if some bytes changed near the start of the chunking changed it could offset the rest causing it to think that the whole rest of the chunks need to be downloaded again.
On the other end of the spectrum are things like text diffing and Courgette (which looks at sort of an assembly ast of an executable binary and determines what's actually changed to eliminate offset misinterpretation within a binary).
I think what's needed for the generic electrobun case is something like .blockmap with content delineated chunks (ie: looking at each file separately to eliminate offset issues between files), and then as a follow up later can add more advanced things for specific file types. Although keeping the complexity for the mechanism low and formats for the metadata files relatively stable is a higher priority than trying to save every possible byte of bandwidth during updates)
This task is to figure out a custom binary file format or pair of files that describes:
So something like a tar or zip file, where every file is compressed, some kind of checksum is provided to quickly check if the file has changed, a mapping so you can quickly see if any files have been added or removed and what byte offset the compressed file bytes are at.
you can imagine either a single file where you just over-read the first 100 bytes from s3 and parse out how big the metadata section is and where the starting byte is, then read the metadata, then check those files against the current app bundle's files, fetch all the required file chunks, decompress, then build the new version of the bundle with a mix of local and once the bundle is verified to match codesign/notarization then swap it with the application wherever it was running and restart the app.
as well as a mechanism to do that to the local bundle, to determine exactly what byte ranges you need to download to build the new update bundle.
I think some intricacies of all this depend on how things get packaged on windows and linux, so I'm gonna break diff updates out of #3 into this task and revisit it later.
ideally the mechanism would just work with any object storage that allows downloading byte ranges (cloud storage / s3) so you don't need to run an actual server to provide update bytes.
It's cool to see your progress here! Should I tinker with it or wait a little bit?
oven-sh/bun#790 (reply in thread)
linux builds (if/when people ask)
I am hereby doing so. :)
Thanks !
Enable building for and distributing to linux targets.
Probably requires more than this, but off the top of my head
with an Applications shortcut or whatever to drag your app into
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.