From 502c55a72d7cc69a5f3fb908ff64598ee3d08c2d Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Wed, 24 Aug 2022 16:16:37 +0530 Subject: [PATCH 01/18] Document the complete list of requirements for the VFS This change attempts to exhaustively document all the requirements of the VFS. If you disagree with a point or want to add more requirements to this list, you are more than welcome! Fixes: https://github.com/nodejs/single-executable/discussions/21 Fixes: https://github.com/nodejs/single-executable/discussions/18 Signed-off-by: Darshan Sen --- README.md | 2 + docs/virtual-file-system-requirements.md | 107 +++++++++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 docs/virtual-file-system-requirements.md diff --git a/README.md b/README.md index 21c07e0..140da33 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ Table of Contents - [Existing SEA Solutions](./docs/existing-solutions.md) - [Production Node.js CLIs](./docs/production-nodejs-clis.md) +- Requirements + - [Virtual File System Requirements](./docs/virtual-file-system-requirements.md) Blog ---- diff --git a/docs/virtual-file-system-requirements.md b/docs/virtual-file-system-requirements.md new file mode 100644 index 0000000..a76b309 --- /dev/null +++ b/docs/virtual-file-system-requirements.md @@ -0,0 +1,107 @@ +Virtual File System Requirements +================================ + +This document aims to list all the requirements of the Virtual File System. + +# Supported + +## Random access reads + +The VFS must support random access reads just like any other real file system, +so that the read operations can be at least as fast as reading files from the +real file system. + +## Symbolic links + +This is critical for applications that want to use packages like [dugite][] that +attempt to download [Git executables][] that contain symlinks. Since +Electron's [ASAR][] does not support symlinks, including [dugite][] as a +dependency in an Electron app would expand every symlink into individual files, +thus significantly increase the package size which is not nice. + +## Preserve only the executable bit of the file permissions + +It is important to preserve the executable bit of the file permissions, so that +it is possible for the single-executable to be able to execute only executable +files. Other than that, all the bundled files would be readable and none will be +writable. + +## Data compression + +As an application grows, bundling all the source code, dependencies and static +assets into a single file without compression would quickly reach the maximum +segment / file (depending on the embedding approach) size limit imposed by the +single executable file format / OS. A solution to this problem would be to +minify the JS source files but that might not be enough for other kinds of +files, so supporting data compression seems to be a better solution. + +## Preserve file-hierarchy information + +A filesystem is incomplete without this because there's no way for the +single-executable to be able to access nested file paths. + +## No interference with valid paths in the file system + +If the bundled files in the VFS correspond to certain paths that already exist +in the real file system, that will be very confusing, so it should use such +paths that cannot be used by existing files. + +Pkg uses [`/snapshot`](https://github.com/vercel/pkg#snapshot-filesystem) as the +prefix for all the embedded files. This is confusing if `/snapshot` is an +existing directory on the file system. + +Boxednode allows users to enter a [namespace](https://github.com/mongodb-js/boxednode/blob/6326e3277469e8cfe593616a0ed152600a5f9045/README.md?plain=1#L69-L72) +and uses it like so: +```js + // Specify the entrypoint target name. If this is 'foo', then the resulting + // binary will be able to load the source file as 'require("foo/foo")'. + // This defaults to the basename of sourceFile, e.g. 'bar' for '/path/bar.js'. + namespace?: string; +``` + +It might be better to use the single executable path as the base path for the +files in the VFS, i.e., if the executable has `/a/b/sea` as the path and the VFS +contains a file named `file.txt`, it would be accessible by the application +using `/a/b/sea/file.txt`. This approach is similar to how Electron's [ASAR][] +works, i.e., if the application asar is placed in `/a/b/app.asar`, the +embedded `file.txt` file would use `/a/b/app.asar/file.txt` as the path. + +## Cross-platform tooling + +The tooling required for archiving / extracting files into / from the VFS must +be available on all the [platforms supported by Node.js][]. + +## File path contents + +Should not limit the size or the character contents of the file paths to stay as +close as possible to what a real file system provides. + +# Not supported + +## No need for supporting write operations + +Since the VFS is going to be embedded into the single-executable and also +protected by codesigning, making changes to the contents of the VFS should +invalidate the signature and crash the application if run again. Hence, no write +operation needs to be supported. + +# Optionally support + +## Case Sensitivity and Case Preservation + +It should be the same as what users of the OS the executable has been packaged +for expects. This list is based on [case sensitivity in files systems][]. + +* Unix - case-sensitive +* MacOS - case-insensitive and case-preserving +* Windows - case-insensitive and case-preserving + +## Increase locality of related files + +For performance reasons. + +[ASAR]: https://github.com/electron/asar +[Git executables]: https://github.com/desktop/dugite-native/releases/ +[dugite]: https://www.npmjs.com/package/dugite +[platforms supported by Node.js]: https://github.com/nodejs/node/blob/main/BUILDING.md#supported-platforms +[case sensitivity in file systems]: https://en.wikipedia.org/wiki/Case_sensitivity#In_filesystems From 01915c4264b3e783325a74ae8c3add56aa5b5515 Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Thu, 25 Aug 2022 15:43:54 +0530 Subject: [PATCH 02/18] Add a "Requirements" item to the readme Signed-off-by: Darshan Sen --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 140da33..1616fe7 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Table of Contents - [Existing SEA Solutions](./docs/existing-solutions.md) - [Production Node.js CLIs](./docs/production-nodejs-clis.md) - Requirements - - [Virtual File System Requirements](./docs/virtual-file-system-requirements.md) + - [Virtual File System](./docs/virtual-file-system-requirements.md) Blog ---- From 21ef34c912e589a99eddebe2cabb715c1e95bf08 Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Thu, 25 Aug 2022 16:01:46 +0530 Subject: [PATCH 03/18] Fmt impl in multiple langs & consensus on building native exts Signed-off-by: Darshan Sen --- docs/virtual-file-system-requirements.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/virtual-file-system-requirements.md b/docs/virtual-file-system-requirements.md index a76b309..d177f3b 100644 --- a/docs/virtual-file-system-requirements.md +++ b/docs/virtual-file-system-requirements.md @@ -100,6 +100,19 @@ for expects. This list is based on [case sensitivity in files systems][]. For performance reasons. +## Format implementation in multiple languages + +We want this format to already have implementation in *multiple* languages (not +just JS, since not all tools used in the JS ecosystem are written in JS), all +ideally production-grade and well-maintained. + +## Consensus with third-party tools on building native integrations + +We want this format to be consensual enough that third-party tools (VSCode, +emacs, ...) won't object to build native integrations with it (for instance, +Esbuild recently added zip support to integrate w/ Yarn's zip installs; it would +have been a much harder sell if Yarn had used a custom-made format). + [ASAR]: https://github.com/electron/asar [Git executables]: https://github.com/desktop/dugite-native/releases/ [dugite]: https://www.npmjs.com/package/dugite From 6916bdb76b04ba66e688560d478f3e8b8b75f28d Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Thu, 25 Aug 2022 16:03:44 +0530 Subject: [PATCH 04/18] Remove "only" from "only the executable bit" Signed-off-by: Darshan Sen --- docs/virtual-file-system-requirements.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/virtual-file-system-requirements.md b/docs/virtual-file-system-requirements.md index d177f3b..db49341 100644 --- a/docs/virtual-file-system-requirements.md +++ b/docs/virtual-file-system-requirements.md @@ -19,7 +19,7 @@ Electron's [ASAR][] does not support symlinks, including [dugite][] as a dependency in an Electron app would expand every symlink into individual files, thus significantly increase the package size which is not nice. -## Preserve only the executable bit of the file permissions +## Preserve the executable bit of the file permissions It is important to preserve the executable bit of the file permissions, so that it is possible for the single-executable to be able to execute only executable From 9ade7e501007a43c62d9b4a68d3c6880eb2e2227 Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Thu, 25 Aug 2022 16:05:30 +0530 Subject: [PATCH 05/18] "Data compression" -> "Optional data compression" Signed-off-by: Darshan Sen --- docs/virtual-file-system-requirements.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/virtual-file-system-requirements.md b/docs/virtual-file-system-requirements.md index db49341..f06f818 100644 --- a/docs/virtual-file-system-requirements.md +++ b/docs/virtual-file-system-requirements.md @@ -26,7 +26,7 @@ it is possible for the single-executable to be able to execute only executable files. Other than that, all the bundled files would be readable and none will be writable. -## Data compression +## Optional data compression As an application grows, bundling all the source code, dependencies and static assets into a single file without compression would quickly reach the maximum From a9dc58cd7de92eca0289ba828c86c93f6df1d1b4 Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Thu, 25 Aug 2022 16:19:23 +0530 Subject: [PATCH 06/18] All paths will be case sensititve Signed-off-by: Darshan Sen --- docs/virtual-file-system-requirements.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/docs/virtual-file-system-requirements.md b/docs/virtual-file-system-requirements.md index f06f818..2df49ae 100644 --- a/docs/virtual-file-system-requirements.md +++ b/docs/virtual-file-system-requirements.md @@ -76,6 +76,14 @@ be available on all the [platforms supported by Node.js][]. Should not limit the size or the character contents of the file paths to stay as close as possible to what a real file system provides. +## Case Sensitive + +From Yarn's experience with zip, forcing case sensitivity within the archives +didn't break anything, improved consistency. By contrast, making the code case +insensitive would have increased the complexity, worsened the runtime +performance, increased the attack surface, for a use case that virtually no-one +cares about. Hence, the paths in the VFS will be case sensitive. + # Not supported ## No need for supporting write operations @@ -87,15 +95,6 @@ operation needs to be supported. # Optionally support -## Case Sensitivity and Case Preservation - -It should be the same as what users of the OS the executable has been packaged -for expects. This list is based on [case sensitivity in files systems][]. - -* Unix - case-sensitive -* MacOS - case-insensitive and case-preserving -* Windows - case-insensitive and case-preserving - ## Increase locality of related files For performance reasons. @@ -117,4 +116,3 @@ have been a much harder sell if Yarn had used a custom-made format). [Git executables]: https://github.com/desktop/dugite-native/releases/ [dugite]: https://www.npmjs.com/package/dugite [platforms supported by Node.js]: https://github.com/nodejs/node/blob/main/BUILDING.md#supported-platforms -[case sensitivity in file systems]: https://en.wikipedia.org/wiki/Case_sensitivity#In_filesystems From aba2207b2140e8f47588c0407fab5ac56a4fb6ed Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Thu, 25 Aug 2022 16:48:58 +0530 Subject: [PATCH 07/18] Document where Docker places files Signed-off-by: Darshan Sen --- docs/virtual-file-system-requirements.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/virtual-file-system-requirements.md b/docs/virtual-file-system-requirements.md index 2df49ae..9d029bd 100644 --- a/docs/virtual-file-system-requirements.md +++ b/docs/virtual-file-system-requirements.md @@ -48,7 +48,9 @@ paths that cannot be used by existing files. Pkg uses [`/snapshot`](https://github.com/vercel/pkg#snapshot-filesystem) as the prefix for all the embedded files. This is confusing if `/snapshot` is an -existing directory on the file system. +existing directory on the file system. Docker workflows routinely copy files to, +and run things at, the root of the filesystem, so following that approach too +would run into the same problem. Boxednode allows users to enter a [namespace](https://github.com/mongodb-js/boxednode/blob/6326e3277469e8cfe593616a0ed152600a5f9045/README.md?plain=1#L69-L72) and uses it like so: From 4f0151c3c1d959dd8637e97f1f76ecefbdfcd054 Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Mon, 29 Aug 2022 18:08:44 +0530 Subject: [PATCH 08/18] Add globbing info Signed-off-by: Darshan Sen --- docs/virtual-file-system-requirements.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/virtual-file-system-requirements.md b/docs/virtual-file-system-requirements.md index 9d029bd..abe7269 100644 --- a/docs/virtual-file-system-requirements.md +++ b/docs/virtual-file-system-requirements.md @@ -68,6 +68,14 @@ using `/a/b/sea/file.txt`. This approach is similar to how Electron's [ASAR][] works, i.e., if the application asar is placed in `/a/b/app.asar`, the embedded `file.txt` file would use `/a/b/app.asar/file.txt` as the path. +## Globbing + +`fs.statSync(process.execPath).isDirectory()` will return `false` and +`fs.statSync(process.execPath).isFile()` will return `true`. That way, if code +within the single-executable does naive globbing using an off-the-shelf glob +library, VFS file paths, which are considered internal to the single-executable, +would not interfere with the actual file paths. + ## Cross-platform tooling The tooling required for archiving / extracting files into / from the VFS must From c9f0ce53533ccf2874af1fe49d365705eaf2c15f Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Wed, 31 Aug 2022 18:29:22 +0530 Subject: [PATCH 09/18] Add TODO about interaction with Native Addons Signed-off-by: Darshan Sen --- docs/virtual-file-system-requirements.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/virtual-file-system-requirements.md b/docs/virtual-file-system-requirements.md index abe7269..6fc2031 100644 --- a/docs/virtual-file-system-requirements.md +++ b/docs/virtual-file-system-requirements.md @@ -94,6 +94,10 @@ insensitive would have increased the complexity, worsened the runtime performance, increased the attack surface, for a use case that virtually no-one cares about. Hence, the paths in the VFS will be case sensitive. +## Interaction with Native Addons + +TODO: Still under discussion in https://github.com/nodejs/single-executable/discussions/29. + # Not supported ## No need for supporting write operations From 151e6067db5fc04a92e98293c53c09c025f68519 Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Wed, 31 Aug 2022 18:30:03 +0530 Subject: [PATCH 10/18] Support for imports and requires Signed-off-by: Darshan Sen --- docs/virtual-file-system-requirements.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/virtual-file-system-requirements.md b/docs/virtual-file-system-requirements.md index 6fc2031..7833784 100644 --- a/docs/virtual-file-system-requirements.md +++ b/docs/virtual-file-system-requirements.md @@ -94,6 +94,14 @@ insensitive would have increased the complexity, worsened the runtime performance, increased the attack surface, for a use case that virtually no-one cares about. Hence, the paths in the VFS will be case sensitive. +## Imports and Requires + +Should support: +* static import +* static require +* dynamic import +* dynamic require + ## Interaction with Native Addons TODO: Still under discussion in https://github.com/nodejs/single-executable/discussions/29. From 6424ccd34d4146f131f4aa77771d6080b5e12184 Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Wed, 31 Aug 2022 18:30:38 +0530 Subject: [PATCH 11/18] VFS path manipulation as strings and URL objects Signed-off-by: Darshan Sen --- docs/virtual-file-system-requirements.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/virtual-file-system-requirements.md b/docs/virtual-file-system-requirements.md index 7833784..dde49bf 100644 --- a/docs/virtual-file-system-requirements.md +++ b/docs/virtual-file-system-requirements.md @@ -102,6 +102,10 @@ Should support: * dynamic import * dynamic require +## VFS path manipulation as strings and URL objects + +Should support both. + ## Interaction with Native Addons TODO: Still under discussion in https://github.com/nodejs/single-executable/discussions/29. From 33bfd88c12fdc0b0b623fcdc03692969fe1ebe48 Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Thu, 8 Sep 2022 16:59:34 +0530 Subject: [PATCH 12/18] fixup! Support for imports and requires Signed-off-by: Darshan Sen --- docs/virtual-file-system-requirements.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/docs/virtual-file-system-requirements.md b/docs/virtual-file-system-requirements.md index dde49bf..8974ace 100644 --- a/docs/virtual-file-system-requirements.md +++ b/docs/virtual-file-system-requirements.md @@ -94,13 +94,10 @@ insensitive would have increased the complexity, worsened the runtime performance, increased the attack surface, for a use case that virtually no-one cares about. Hence, the paths in the VFS will be case sensitive. -## Imports and Requires +## Dynamic imports and requires -Should support: -* static import -* static require -* dynamic import -* dynamic require +`require(require.resolve('./file.js'))` should work for files that are on the +real file system and the VFS. ## VFS path manipulation as strings and URL objects From 21b44f21de8522aac62445bd7dbe14268710252a Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Thu, 8 Sep 2022 17:01:32 +0530 Subject: [PATCH 13/18] fixup! VFS path manipulation as strings and URL objects Signed-off-by: Darshan Sen --- docs/virtual-file-system-requirements.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/virtual-file-system-requirements.md b/docs/virtual-file-system-requirements.md index 8974ace..6cc84ff 100644 --- a/docs/virtual-file-system-requirements.md +++ b/docs/virtual-file-system-requirements.md @@ -101,7 +101,15 @@ real file system and the VFS. ## VFS path manipulation as strings and URL objects -Should support both. +If someone proposes that the VFS exist at a `vfs-file://` prefix, then this +might become an issue. `fs` APIs accept `URL` objects, but this means code in +(transitive) dependencies which assumes all native paths are strings may fail +when passed `URL` objects. Perhaps a (transitive) dependency uses +`require.resolve()`. + +Using something like `vfs-file://` might be a potential solution for placing the +VFS contents somewhere that has no interference with valid paths in the file +system. ## Interaction with Native Addons From 2a8f035d6168bfb099119353d32c9ffb3216383c Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Thu, 8 Sep 2022 17:09:48 +0530 Subject: [PATCH 14/18] Accept file paths in the VFS as arguments Signed-off-by: Darshan Sen --- docs/virtual-file-system-requirements.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/virtual-file-system-requirements.md b/docs/virtual-file-system-requirements.md index 6cc84ff..f8c8ec1 100644 --- a/docs/virtual-file-system-requirements.md +++ b/docs/virtual-file-system-requirements.md @@ -76,6 +76,12 @@ within the single-executable does naive globbing using an off-the-shelf glob library, VFS file paths, which are considered internal to the single-executable, would not interfere with the actual file paths. +## Accept file paths in the VFS as arguments + +If a single-executable formatter is run with an argument that is a path to a +file inside the VFS, it should be able to use the `fs` APIs to read, format and +print the formatted contents to `stdout`. + ## Cross-platform tooling The tooling required for archiving / extracting files into / from the VFS must From b7f5638bc36c441f6721d4832ca89382b357c405 Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Thu, 8 Sep 2022 17:10:50 +0530 Subject: [PATCH 15/18] Reword VFS paths Signed-off-by: Darshan Sen --- docs/virtual-file-system-requirements.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/virtual-file-system-requirements.md b/docs/virtual-file-system-requirements.md index f8c8ec1..69547bd 100644 --- a/docs/virtual-file-system-requirements.md +++ b/docs/virtual-file-system-requirements.md @@ -43,8 +43,8 @@ single-executable to be able to access nested file paths. ## No interference with valid paths in the file system If the bundled files in the VFS correspond to certain paths that already exist -in the real file system, that will be very confusing, so it should use such -paths that cannot be used by existing files. +in the real file system, that will break certain use-cases, so it should use +such paths that cannot be used by existing files. Pkg uses [`/snapshot`](https://github.com/vercel/pkg#snapshot-filesystem) as the prefix for all the embedded files. This is confusing if `/snapshot` is an From 019398e05142367704a2c1c9a84af6bce6f4024f Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Fri, 9 Sep 2022 17:35:06 +0530 Subject: [PATCH 16/18] fixup! Add globbing info Signed-off-by: Darshan Sen --- docs/virtual-file-system-requirements.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/virtual-file-system-requirements.md b/docs/virtual-file-system-requirements.md index 69547bd..5b462f8 100644 --- a/docs/virtual-file-system-requirements.md +++ b/docs/virtual-file-system-requirements.md @@ -70,11 +70,10 @@ embedded `file.txt` file would use `/a/b/app.asar/file.txt` as the path. ## Globbing -`fs.statSync(process.execPath).isDirectory()` will return `false` and -`fs.statSync(process.execPath).isFile()` will return `true`. That way, if code +`fs.statSync(process.execPath).isDirectory()` will return `true` and +`fs.statSync(process.execPath).isFile()` will return `false`. That way, if code within the single-executable does naive globbing using an off-the-shelf glob -library, VFS file paths, which are considered internal to the single-executable, -would not interfere with the actual file paths. +library, paths inside the VFS would also get picked up. ## Accept file paths in the VFS as arguments From a2f4bfe8eed2d6230364e52ac09b685722f0e72f Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Fri, 9 Sep 2022 17:39:24 +0530 Subject: [PATCH 17/18] It might be better -> A possible solution Signed-off-by: Darshan Sen --- docs/virtual-file-system-requirements.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/virtual-file-system-requirements.md b/docs/virtual-file-system-requirements.md index 5b462f8..aec6dd5 100644 --- a/docs/virtual-file-system-requirements.md +++ b/docs/virtual-file-system-requirements.md @@ -61,9 +61,9 @@ and uses it like so: namespace?: string; ``` -It might be better to use the single executable path as the base path for the -files in the VFS, i.e., if the executable has `/a/b/sea` as the path and the VFS -contains a file named `file.txt`, it would be accessible by the application +A possible solution is to use the single executable path as the base path for +the files in the VFS, i.e., if the executable has `/a/b/sea` as the path and the +VFS contains a file named `file.txt`, it would be accessible by the application using `/a/b/sea/file.txt`. This approach is similar to how Electron's [ASAR][] works, i.e., if the application asar is placed in `/a/b/app.asar`, the embedded `file.txt` file would use `/a/b/app.asar/file.txt` as the path. From 2c7aec3202ce55f1f1ffdc2f8be8f88d6be135b5 Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Fri, 9 Sep 2022 17:40:48 +0530 Subject: [PATCH 18/18] Move data compression part to optional Signed-off-by: Darshan Sen --- docs/virtual-file-system-requirements.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/virtual-file-system-requirements.md b/docs/virtual-file-system-requirements.md index aec6dd5..d161bbe 100644 --- a/docs/virtual-file-system-requirements.md +++ b/docs/virtual-file-system-requirements.md @@ -26,15 +26,6 @@ it is possible for the single-executable to be able to execute only executable files. Other than that, all the bundled files would be readable and none will be writable. -## Optional data compression - -As an application grows, bundling all the source code, dependencies and static -assets into a single file without compression would quickly reach the maximum -segment / file (depending on the embedding approach) size limit imposed by the -single executable file format / OS. A solution to this problem would be to -minify the JS source files but that might not be enough for other kinds of -files, so supporting data compression seems to be a better solution. - ## Preserve file-hierarchy information A filesystem is incomplete without this because there's no way for the @@ -148,6 +139,15 @@ emacs, ...) won't object to build native integrations with it (for instance, Esbuild recently added zip support to integrate w/ Yarn's zip installs; it would have been a much harder sell if Yarn had used a custom-made format). +## Optional data compression + +As an application grows, bundling all the source code, dependencies and static +assets into a single file without compression would quickly reach the maximum +segment / file (depending on the embedding approach) size limit imposed by the +single executable file format / OS. A solution to this problem would be to +minify the JS source files but that might not be enough for other kinds of +files, so supporting data compression seems to be a better solution. + [ASAR]: https://github.com/electron/asar [Git executables]: https://github.com/desktop/dugite-native/releases/ [dugite]: https://www.npmjs.com/package/dugite