janela 0.14.0 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/janela.mjs +15 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ Node, no Electron. The backend is TypeScript compiled to a native binary by
|
|
|
8
8
|
[webview/webview](https://github.com/webview/webview). A desktop binary comes
|
|
9
9
|
out around 200–400 KB — 191 KB for the smallest template — with no bundled
|
|
10
10
|
browser and no bundled runtime; iOS and Android bundles land around
|
|
11
|
-
|
|
11
|
+
211–415 KB. Per-template figures are in
|
|
12
12
|
[docs/frontend.md](../../docs/frontend.md).
|
|
13
13
|
|
|
14
14
|
Five targets, one runtime — the same `main.ts`, the same typed contract and the
|
package/bin/janela.mjs
CHANGED
|
@@ -372,6 +372,13 @@ function buildIos(root, conf, buildDir, outDir) {
|
|
|
372
372
|
`-I${join(KIT, "vendor-webview", "core", "include")}`,
|
|
373
373
|
"-framework", "UIKit", "-framework", "WebKit", "-framework", "Foundation",
|
|
374
374
|
lib,
|
|
375
|
+
// scriptc runs its section elimination only when it performs the final
|
|
376
|
+
// executable link itself; `--lib` deliberately keeps the archive intact
|
|
377
|
+
// (see executableSectionEliminationFlags in its native-toolchain.js), so
|
|
378
|
+
// on the mobile lanes the last link is ours and so is the stripping.
|
|
379
|
+
// ld64 dead-strips per symbol subsection, so the archive needs no
|
|
380
|
+
// -ffunction-sections to benefit: 409 KB -> 232 KB stripped.
|
|
381
|
+
"-Wl,-dead_strip",
|
|
375
382
|
"-o", join(bundle, conf.name),
|
|
376
383
|
]);
|
|
377
384
|
run(["strip", join(bundle, conf.name)]);
|
|
@@ -551,6 +558,14 @@ function buildAndroid(root, conf, buildDir, outDir) {
|
|
|
551
558
|
// libc++_shared.so beside ours; static keeps the APK to one library.
|
|
552
559
|
"-static-libstdc++",
|
|
553
560
|
`-I${join(KIT, "vendor-webview", "core", "include")}`,
|
|
561
|
+
// As on iOS, the final link is ours, so the section GC is too. A shared
|
|
562
|
+
// library exports every default-visibility symbol, which roots the whole
|
|
563
|
+
// scriptc archive and leaves --gc-sections nearly nothing to collect
|
|
564
|
+
// (1.41 MB -> 1.35 MB on its own). --exclude-libs drops the archive out
|
|
565
|
+
// of the dynamic symbol table first, so GC can then discard what the
|
|
566
|
+
// shell never reaches: 1.41 MB -> 853 KB stripped. The JNI entry points
|
|
567
|
+
// come from app.cc rather than the archive, so they stay exported.
|
|
568
|
+
"-Wl,--gc-sections", "-Wl,--exclude-libs,ALL",
|
|
554
569
|
lib, "-llog", "-o", so,
|
|
555
570
|
]);
|
|
556
571
|
run([join(sdk.toolchain, "llvm-strip"), so]);
|