@absolutejs/absolute 0.20.0-beta.3 → 0.20.0-beta.31
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 +167 -0
- package/dist/angular/browser.js +15 -1
- package/dist/angular/browser.js.map +3 -3
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +341 -22
- package/dist/angular/index.js.map +8 -5
- package/dist/angular/server.js +341 -22
- package/dist/angular/server.js.map +8 -5
- package/dist/build.js +2058 -1105
- package/dist/build.js.map +17 -13
- package/dist/cli/index.js +4085 -1139
- package/dist/dev/client/cssUtils.ts +16 -2
- package/dist/dev/client/handlers/rebuild.ts +11 -1
- package/dist/dev/client/hmrClient.ts +32 -3
- package/dist/dev/client/hmrTiming.ts +14 -7
- package/dist/dev/client/syncDevtools.ts +237 -0
- package/dist/index.js +2483 -1367
- package/dist/index.js.map +27 -22
- package/dist/mobile/browser.js +123 -1
- package/dist/mobile/browser.js.map +6 -4
- package/dist/mobile/index.js +2948 -328
- package/dist/mobile/index.js.map +27 -13
- package/dist/mobile/remoteMacAgentEntry.js +29 -0
- package/dist/mobile/shellAuth.js +36 -0
- package/dist/mobile/shellBootstrap.js +806 -0
- package/dist/mobile/shellSync.js +173 -0
- package/dist/src/angular/pageHandler.d.ts +3 -0
- package/dist/src/build/pwa.d.ts +16 -0
- package/dist/src/cli/config/server.d.ts +1 -1
- package/dist/src/core/devBuild.d.ts +1 -0
- package/dist/src/core/pageHandlers.d.ts +11 -2
- package/dist/src/core/prepare.d.ts +24 -0
- package/dist/src/mobile/androidEmulatorController.d.ts +6 -1
- package/dist/src/mobile/androidTestReport.d.ts +14 -0
- package/dist/src/mobile/androidUpgradeConformance.d.ts +47 -0
- package/dist/src/mobile/androidWebView.d.ts +1 -0
- package/dist/src/mobile/browser.d.ts +1 -0
- package/dist/src/mobile/buildPipeline.d.ts +1 -0
- package/dist/src/mobile/capacitorBundle.d.ts +22 -1
- package/dist/src/mobile/client.d.ts +4 -0
- package/dist/src/mobile/config.d.ts +1 -0
- package/dist/src/mobile/devDeviceAdapter.d.ts +3 -0
- package/dist/src/mobile/deviceCapabilities.d.ts +46 -0
- package/dist/src/mobile/index.d.ts +8 -0
- package/dist/src/mobile/iosTestReport.d.ts +23 -0
- package/dist/src/mobile/nativeAuth.d.ts +17 -0
- package/dist/src/mobile/nativeBackgroundSync.d.ts +4 -0
- package/dist/src/mobile/nativeDeviceCapabilities.d.ts +6 -0
- package/dist/src/mobile/nativeTestReport.d.ts +85 -0
- package/dist/src/mobile/releaseArtifact.d.ts +2 -0
- package/dist/src/mobile/remoteMacAgent.d.ts +2 -0
- package/dist/src/mobile/remoteMacAgentEntry.d.ts +1 -0
- package/dist/src/mobile/remoteMacProtocol.d.ts +114 -0
- package/dist/src/mobile/remoteMacWire.d.ts +2 -0
- package/dist/src/mobile/shellAuth.d.ts +15 -0
- package/dist/src/mobile/shellBootstrap.d.ts +22 -1
- package/dist/src/mobile/shellHttp.d.ts +2 -0
- package/dist/src/mobile/shellPush.d.ts +11 -0
- package/dist/src/mobile/shellSync.d.ts +47 -0
- package/dist/src/mobile/staticDocument.d.ts +5 -0
- package/dist/src/mobile/syncRemediation.d.ts +10 -0
- package/dist/src/mobile/syncSchema.d.ts +9 -0
- package/dist/src/mobile/transport.d.ts +16 -1
- package/dist/src/plugins/imageOptimizer.d.ts +1 -1
- package/dist/src/svelte/pageHandler.d.ts +3 -0
- package/dist/src/utils/imageProcessing.d.ts +3 -0
- package/dist/src/utils/loadConfig.d.ts +1 -0
- package/dist/src/vue/pageHandler.d.ts +3 -0
- package/dist/svelte/index.js +312 -23
- package/dist/svelte/index.js.map +7 -4
- package/dist/svelte/server.js +307 -18
- package/dist/svelte/server.js.map +7 -4
- package/dist/types/build.d.ts +29 -0
- package/dist/vue/index.js +312 -23
- package/dist/vue/index.js.map +7 -4
- package/dist/vue/server.js +307 -18
- package/dist/vue/server.js.map +7 -4
- package/package.json +38 -10
package/README.md
CHANGED
|
@@ -105,6 +105,173 @@ export const server = new Elysia()
|
|
|
105
105
|
2. Route handlers (`handleReactPageRequest`, `handleSveltePageRequest`, …) stream HTML and inject scripts/assets based on that manifest.
|
|
106
106
|
3. The static plugin serves all compiled files from `/build`.
|
|
107
107
|
|
|
108
|
+
### Installable PWA and offline Sync
|
|
109
|
+
|
|
110
|
+
Enable the web-app shell once in `absolutejs.config.ts`. AbsoluteJS generates a
|
|
111
|
+
single shared browser bootstrap, service worker, and optional manifest, then
|
|
112
|
+
wires them into React, Vue, Svelte, Angular, HTML, HTMX, and island client
|
|
113
|
+
entries. Route and page code does not change.
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
import { defineConfig } from '@absolutejs/absolute';
|
|
117
|
+
|
|
118
|
+
export default defineConfig({
|
|
119
|
+
// Existing framework directories and build settings...
|
|
120
|
+
pwa: {
|
|
121
|
+
manifest: {
|
|
122
|
+
name: 'Acme',
|
|
123
|
+
shortName: 'Acme',
|
|
124
|
+
themeColor: '#111827',
|
|
125
|
+
icons: [
|
|
126
|
+
{
|
|
127
|
+
src: '/icons/app-512.png',
|
|
128
|
+
sizes: '512x512',
|
|
129
|
+
type: 'image/png'
|
|
130
|
+
}
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
serviceWorker: {
|
|
134
|
+
offline: {
|
|
135
|
+
fallback: '/offline.html',
|
|
136
|
+
assetPrefix: '/assets/'
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
// With @absolutejs/auth + syncSocket(), this provisions the existing
|
|
140
|
+
// HTTP-only web session and durable IndexedDB transport automatically.
|
|
141
|
+
sync: true,
|
|
142
|
+
// Optional: importing pushNotifications enables this automatically.
|
|
143
|
+
// The public key defaults to VAPID_PUBLIC_KEY at build time.
|
|
144
|
+
push: true
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
The default outputs are `/sw.js`, `/manifest.webmanifest`, and the internal
|
|
150
|
+
shared bootstrap at `/__absolute/pwa/bootstrap.js`. Put referenced icons and the
|
|
151
|
+
offline fallback in `publicDirectory`. The worker uses Background Sync when the
|
|
152
|
+
browser offers it, while online/focus/visibility resume remains the correctness
|
|
153
|
+
path. Native Capacitor clients continue to use their Bearer and SQLite
|
|
154
|
+
transport; no web cookie or token is copied into the worker.
|
|
155
|
+
|
|
156
|
+
Portable push uses the same `pushNotifications` API in the browser and a
|
|
157
|
+
Capacitor shell. AbsoluteJS generates Web Push registration and subscription
|
|
158
|
+
rotation against the same-origin `/auth/push` route. Configure the trusted
|
|
159
|
+
server once with `auth({ push: { registrar, tenant, topics } })`; Auth derives
|
|
160
|
+
identity, tenant, and authorized topics, while page code never receives APNs,
|
|
161
|
+
FCM, or Web Push credentials. Only the public VAPID key enters browser output;
|
|
162
|
+
keep `VAPID_PRIVATE_KEY` in the server-side Dispatch sender.
|
|
163
|
+
|
|
164
|
+
`@absolutejs/pwa/client` also exposes `onPwaSyncResult()` and
|
|
165
|
+
`getLastPwaSyncResult()` (plus the `absolute:pwa-sync-result` DOM event) for
|
|
166
|
+
application-owned diagnostics. Results contain only success, duration, trigger,
|
|
167
|
+
and aggregate counts—never credentials, namespaces, endpoints, arguments, or
|
|
168
|
+
rows. Account changes are re-resolved before focus/online/visible Sync and the
|
|
169
|
+
old worker run is aborted and cleared before the new namespace can run.
|
|
170
|
+
|
|
171
|
+
AbsoluteJS also generates one local-storage migration bundle for web and native
|
|
172
|
+
from the app plus installed Sync packs. Routes stay unchanged. A package that
|
|
173
|
+
owns persisted data declares its JSON-safe evolution in `package.json`:
|
|
174
|
+
|
|
175
|
+
```json
|
|
176
|
+
{
|
|
177
|
+
"absolutejs": {
|
|
178
|
+
"sync": {
|
|
179
|
+
"localSchema": {
|
|
180
|
+
"version": 2,
|
|
181
|
+
"migrations": [
|
|
182
|
+
{
|
|
183
|
+
"toVersion": 2,
|
|
184
|
+
"operations": [
|
|
185
|
+
{
|
|
186
|
+
"type": "set-default",
|
|
187
|
+
"collection": "tasks",
|
|
188
|
+
"field": "completed",
|
|
189
|
+
"value": false
|
|
190
|
+
}
|
|
191
|
+
]
|
|
192
|
+
}
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Absolute derives stable component IDs from package names, keeps independent
|
|
201
|
+
version ledgers, validates migration gaps during build/doctor, and applies the
|
|
202
|
+
same transaction atomically in IndexedDB or Capacitor SQLite before Sync starts.
|
|
203
|
+
The same `localSchema` object can declare `localData` rules for sensitivity,
|
|
204
|
+
encryption, memory-only fallback, whole-cache retention, eviction priority, and
|
|
205
|
+
per-principal quota. Absolute mobile stores record payloads as AES-256-GCM
|
|
206
|
+
ciphertext using a random key held by Keychain/Keystore; native background Sync
|
|
207
|
+
uses the identical authenticated format. Browsers without an audited key
|
|
208
|
+
provider either keep a declared fallback in memory only or fail closed. Pending
|
|
209
|
+
mutations are never evicted to satisfy quota.
|
|
210
|
+
|
|
211
|
+
App updates are consent-driven: `onUpdateAvailable()` latches a waiting worker
|
|
212
|
+
for late UI subscribers, `checkForUpdate()` performs a passive check, and
|
|
213
|
+
`applyUpdate()` activates and reloads only after the user accepts. AbsoluteJS
|
|
214
|
+
does not silently replace a running application session.
|
|
215
|
+
|
|
216
|
+
### Native device capabilities
|
|
217
|
+
|
|
218
|
+
Application code uses one provider-neutral API in web pages and Capacitor apps:
|
|
219
|
+
|
|
220
|
+
```ts
|
|
221
|
+
import {
|
|
222
|
+
camera,
|
|
223
|
+
clipboard,
|
|
224
|
+
haptics,
|
|
225
|
+
keyboard,
|
|
226
|
+
photos,
|
|
227
|
+
share,
|
|
228
|
+
systemBars
|
|
229
|
+
} from '@absolutejs/devices';
|
|
230
|
+
|
|
231
|
+
await clipboard.writeText('Copied everywhere');
|
|
232
|
+
await share.share({ text: 'Shared everywhere', url: 'https://absolutejs.com' });
|
|
233
|
+
await haptics.impact('light');
|
|
234
|
+
const removeKeyboard = await keyboard.onChange(({ visible, heightPx }) => {
|
|
235
|
+
document.documentElement.style.setProperty(
|
|
236
|
+
'--keyboard-height',
|
|
237
|
+
visible ? `${heightPx}px` : '0px'
|
|
238
|
+
);
|
|
239
|
+
});
|
|
240
|
+
await systemBars.setAppearance('light', 'status');
|
|
241
|
+
const permission = await camera.requestPermission();
|
|
242
|
+
if (permission.state === 'granted') {
|
|
243
|
+
const capture = await camera.takePhoto();
|
|
244
|
+
image.src = capture.webPath;
|
|
245
|
+
}
|
|
246
|
+
const chosen = await photos.pick({ limit: 1 });
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
`absolute mobile init` and `absolute mobile sync` discover these named value
|
|
250
|
+
imports, read the tested mappings published by `@absolutejs/devices-capacitor`,
|
|
251
|
+
and offer to install only the exact Capacitor plugins in use. The generated
|
|
252
|
+
shell wires them into the shared device facade; users do not import Capacitor,
|
|
253
|
+
edit Swift/Kotlin, or maintain native bootstrap code. Type-only imports and test
|
|
254
|
+
sources do not provision plugins. `absolute mobile doctor release` rejects a
|
|
255
|
+
missing or mismatched plugin before release.
|
|
256
|
+
|
|
257
|
+
`keyboard` provides portable visibility, CSS-pixel height, dismissal, and
|
|
258
|
+
cleanup-safe change events. `systemBars` controls modern edge-to-edge status and
|
|
259
|
+
navigation bar foreground appearance/visibility through Capacitor 8 core. Its
|
|
260
|
+
`light` and `dark` values name the icon/text foreground. Web appearance uses
|
|
261
|
+
best-effort `color-scheme`; browser chrome visibility reports unsupported.
|
|
262
|
+
|
|
263
|
+
Camera capture requires an explicit `camera.requestPermission()` call from an
|
|
264
|
+
intentional user action. `photos.pick()` uses the item-scoped system picker
|
|
265
|
+
without requesting broad library access. AbsoluteJS generates the required iOS
|
|
266
|
+
usage descriptions from the same audited capability metadata; this first slice
|
|
267
|
+
does not expose EXIF metadata or save captures into the gallery, and Android does
|
|
268
|
+
not receive unnecessary camera/storage permissions.
|
|
269
|
+
|
|
270
|
+
Clipboard and Share use browser standards on the web and fail with normalized
|
|
271
|
+
errors when unavailable. Haptics uses vibration where supported and otherwise
|
|
272
|
+
safely becomes a no-op, because tactile feedback must never be required to
|
|
273
|
+
complete an action.
|
|
274
|
+
|
|
108
275
|
### Immutable production images
|
|
109
276
|
|
|
110
277
|
Build production assets and the server bundle while constructing the image,
|
package/dist/angular/browser.js
CHANGED
|
@@ -9191,6 +9191,20 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
9191
9191
|
return "webp";
|
|
9192
9192
|
}
|
|
9193
9193
|
return "jpeg";
|
|
9194
|
+
}, sniffImageMime = (buffer) => {
|
|
9195
|
+
if (buffer.length < 12)
|
|
9196
|
+
return null;
|
|
9197
|
+
if (buffer[0] === 137 && buffer[1] === 80 && buffer[2] === 78)
|
|
9198
|
+
return "image/png";
|
|
9199
|
+
if (buffer[0] === 255 && buffer[1] === 216)
|
|
9200
|
+
return "image/jpeg";
|
|
9201
|
+
if (buffer[0] === 71 && buffer[1] === 73 && buffer[2] === 70)
|
|
9202
|
+
return "image/gif";
|
|
9203
|
+
if (buffer.toString("ascii", 0, 4) === "RIFF" && buffer.toString("ascii", 8, 12) === "WEBP")
|
|
9204
|
+
return "image/webp";
|
|
9205
|
+
if (buffer.toString("ascii", 4, 12) === "ftypavif")
|
|
9206
|
+
return "image/avif";
|
|
9207
|
+
return null;
|
|
9194
9208
|
}, AVIF_QUALITY_OFFSET = 20, AVIF_EFFORT = 3, PNG_COMPRESSION_LEVEL = 9, optimizeWithBunImage = async (buffer, width, quality, format) => {
|
|
9195
9209
|
const pipeline = new Bun.Image(buffer).resize(width, undefined, {
|
|
9196
9210
|
withoutEnlargement: true
|
|
@@ -10361,5 +10375,5 @@ export {
|
|
|
10361
10375
|
ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER
|
|
10362
10376
|
};
|
|
10363
10377
|
|
|
10364
|
-
//# debugId=
|
|
10378
|
+
//# debugId=0318D343B2F494ED64756E2164756E21
|
|
10365
10379
|
//# sourceMappingURL=browser.js.map
|