Skip to content

Releases

1.0.1

Choose a tag to compare

@github-actions github-actions released this 15 Nov 15:42
dbb3f6b

Changed

  • The pub.dev listing shows the Magic logo. pubspec.yaml gains a screenshots entry that points at a 1024 pixel PNG render of the repository logo, as wind_kit does. (pubspec.yaml, screenshots/)
  • The pub.dev listing and the README now lead with the product pitch and keep Laravel as a secondary note. The description, topics, README, llms.txt and CLAUDE.md say what core carries and which layers (realtime, payments, SQLite, notifications and more) are official plugins, and the Platforms row names the platforms explicitly. The installation page's introduction leads with the same pitch and moves Laravel to a "Familiar to Laravel Developers" note, and the directory-structure page's opening line names the folders first and mentions Laravel's conventions last. (pubspec.yaml, README.md, llms.txt, CLAUDE.md, doc/getting-started/)
  • The magic-framework agent skill covers the core package only. Every official plugin ships its own skill now, so the twelve references/plugin-*.md pages are gone and the skill keeps a short table of what each plugin is and which skill to load (npx skills add anilcancakir/<package>). The description and body follow the skill conventions (no counts, one-line triggers), the repository links name anilcancakir/magic, and references/plugins.md carries the install steps and provider-order rules that are common to every plugin. (skills/magic-framework/)
  • Every link from the README and doc/ to an ecosystem plugin names the new location. A plugin's package page is https://anilcancakir.com/magic/<slug> and its documentation sits under https://anilcancakir.com/magic/docs/<slug>; the core URLs do not change. (README.md, doc/)
  • Doc tables are left-aligned and the prose uses British spelling. Every table separator is left-aligned (:--- or a longer :---- form), and prose reads "behaviour", "colour", "initialise", "authorisation" and so on; code, API names and page titles keep their spelling. (doc/)
  • The README walks through each core capability. After the install steps it gives the container and providers, the facades, models, routing and middleware, auth and authorisation, validation and forms, events, cache, localisation and testing their own section, each with a sample that compiles, a table of the members you reach for and the ways it fails. The sample model reads through get<String>, as make:model generates it, and llms.txt follows with the same sample and the same failure modes. (README.md, llms.txt)
  • Vault operations finish in the order they were issued. Each read, write and delete waits for the ones issued before it, so on the web a token written before a sign-out can no longer land after the sign-out's delete. A platform call that never answers now stalls every later Vault call. (lib/src/security/magic_vault_service.dart)

Fixed

  • Security: a token refresh can no longer cross accounts. When another account signed in, or the session ended, while a refresh was in the air, the refused request was replayed with the new account's token and the refreshed token could overwrite the new session's, in memory and in Vault; a failed refresh could also log the new account out. A refresh now belongs to the session it started in: if that session changed, the refreshed token is discarded and the refused request is handed back without a retry or a logout, and a retry already on its way keeps the refreshed token instead of picking up the new session's. A sign-in no longer leaves the previous account's access or refresh token beside its own: it deletes the stored refresh token before writing its access token and writes its own refresh token last. A sign-in whose Vault writes fail puts the previous account's token back in memory and, as a best effort, as the stored access token, then rethrows; if that restoring write fails too (a keychain that stays locked), the new account's token can sit beside the previous account's cached user until the next user sync answers, and the previous refresh token may already be gone. A restore stops when a sign-in or a sign-out begins during its reads. (lib/src/auth/, doc/security/authentication.md)
  • BaseGuard.storeToken now marks a new session (upgrade note for custom guards). A token stored from outside is taken to be a sign-in, so a refresh still in the air can no longer write over it, and a stored refresh token is deleted unless the call passes a new one. Only a custom guard that rotates its own token through storeToken notices: its in-flight boot sync is discarded, a refused request is handed back instead of retried, and a rotation without a refresh token drops the stored one. Rotate through refreshToken(), which keeps the session; it needs a refreshEndpoint, a refreshTokenKey and a stored refresh token, and answers false when any of the three is missing. (lib/src/auth/guards/base_guard.dart)
  • The configuration page states how env() really converts a value. It converts only for a bool, int or double type argument (true, 1 and yes read as true; an unparsable number falls back to the default) and returns the raw string otherwise, so (true) reads as false and null or empty stay strings. The page no longer claims that process environment variables override .env at runtime: the file is a bundled asset and Magic.init() reads only it. (doc/getting-started/configuration.md)
  • The provider-list samples put AppServiceProvider before AuthServiceProvider. In the old order the user factory is not set when auth boots, so a stored session is never restored. (doc/getting-started/service-providers.md, doc/architecture/request-lifecycle.md)
  • Doc samples use only APIs that exist and compile. The facades page drops Http.patch (there is no patch verb), the installation page uses MagicRoute.page, UserController.instance and a null check, the lifecycle page mixes MagicStateMixin into a controller that reads isEmpty, redirects through redirectTarget and rebuilds through refreshUI(), the custom-rule sample returns its translation key from message(), the form-request sample authorises through Gate.allows, the FormRequest sample gives the value prepared() injects a rule so validate() keeps it, and the DevTools page imports crumbs once. (doc/)
  • Doc claims about lifecycle and wiring match the code. onInit runs the first time a stateful view backs the controller, not when it is created; reading MagicRoute.config early does not throw but freezes the router, so a later route, layout or observer registration throws; the Session.tick listener is wired in main() after Magic.init(), since a boot() that reads routerConfig can freeze the router before the routes exist; the installer writes no localization.dart. The contribution guide lists helpers/, perf/ and policies/, and the DevTools page gains its Related Documentation section. (doc/)
  • The installation page lists what magic:install writes, the facades page counts 13, and the example README matches the example. Under lib/app/ the installer writes the two providers and kernel.dart, and the flag list gains --preserve and --with-devtools. The facades page lists the 13 files under lib/src/facades/ and moves Magic, Env and Carbon, which are classes, to a Related Classes table. The example README declares its real dependencies (magic, dowel, material_ui, cupertino_icons), names lib/routes/app.dart, and quotes magic_notifications: ^1.0.0; the skill's CLI reference says magic_devtools ships its own skill. (doc/getting-started/installation.md, doc/architecture/facades.md, example/, skills/magic-framework/)
  • The magic-framework agent skill teaches what the code and the installer do. Routes are registered in RouteServiceProvider.boot(), as the magic:install stub writes them, not in register(); the Session.tick listener is wired in main() after Magic.init() through routerConfig (there is no MagicRouter.instance.router); the stored-instance sample reads Config.repository (there is no Config.load()); the ORM error sample calls setErrorsFromMap and says an empty error map also covers a refused write (a 500 or a 403); and the attribute rule no longer contradicts the docs: a model reads through typed getters built on get<T> or getAttribute(...) as T?, and code outside the model uses those getters. The skill gains an Install section, a shorter trigger description, recipes that compile as written, and plain statements in place of shouted rules. (skills/magic-framework/)
  • MagicForm.onWillPop no longer sits on Flutter's deprecated Form.onWillPop. The route now holds one pop veto (a PopEntry) for every guarded MagicForm on it. A back attempt asks each form's callback in turn and stops at the first false; when all answer true, the veto is lifted only while Navigator.maybePop runs again, so the route closes once, with its own logic (a web overlay that closes through the browser still steps the browser back), unless another pop entry on the route (a PopScope(canPop: false)) still vetoes: that entry was notified by the back itself and is not notified again. A second back while the callbacks are pending is not asked again, and the route cannot be swiped away while a callback is set. As with maybePop, an answer that arrives after the route, or the page holding its navigator, has left the top of the stack is dropped, and an approved back on the first route bubbles through each enclosing navigator, then out of the app (on Android that closes it, including for a programmatic maybePop; the veto is back before the exit goes to the platform) instead of emptying the navigator. Three things change with the move to pop entries: Navigator.maybePop answers true at once instead of waiting for your callback, an exception your callback throws is...
Read more

1.0.0

Choose a tag to compare

@github-actions github-actions released this 14 Nov 19:27
ea096d2

BREAKING

  • The CLI moved from fluttersdk_artisan to dowel, and so did every name built on it. The executable is dart run magic:dowel <cmd> (there is no artisan executable any more), MagicArtisanProvider is MagicDowelProvider, the command base classes are DowelCommand, DowelGeneratorCommand and DowelContext, the stub override variable is DOWEL_STUBS_DIR, and project state lives in .dowel/ instead of .artisan/. The executable hands over to the consumer's bin/dispatcher.dart when dart run dowel install has scaffolded one, so plugin commands keep resolving. To upgrade an app: dart pub remove fluttersdk_artisan and dart pub add dowel, move .artisan/ to .dowel/ (the install hashes survive), delete .dowel/plugins.json, the fluttersdk_* records under .dowel/installed/, bin/dispatcher.dart, bin/fsa, a leftover bin/artisan.dart, lib/app/_plugins.g.dart and lib/app/commands/_index.g.dart, rename Artisan* classes in your own commands to Dowel*, run dart run dowel install and dart run dowel commands:refresh, then dart run dowel plugin:install magic and plugin:install <package> for each plugin, so the registration lands in .dowel/plugins.json (a file a renamed plugin published earlier shows as an unmanaged-file conflict: review it, then pass --force). The full recipe is in the dowel changelog; "Upgrading from 0.0.x" in doc/getting-started/installation.md follows it. (pubspec.yaml, bin/dowel.dart, lib/cli.dart, lib/src/cli/)
  • Wind moved from fluttersdk_wind to wind_kit, which builds on material_ui, so the SDK floor is Dart 3.13 and Flutter 3.47. package:magic/magic.dart re-exports wind_kit. MagicApplication builds its MaterialApp from package:material_ui/material_ui.dart and defaults localizationsDelegates to GlobalMaterialLocalizations.delegates from the same package, which bundles the Cupertino and Widgets delegates. An app imports package:material_ui/material_ui.dart for MaterialApp, ThemeData, Colors and MaterialColor (flutter pub add material_ui, then dart fix --apply --code=deprecated_member_use); Flutter's own package:flutter/material.dart types are not interchangeable with them. magic:install adds wind_kit, material_ui and dowel to the app. flutter_localizations is no longer a dependency of core. (pubspec.yaml, lib/src/foundation/magic_app_widget.dart, lib/src/cli/)
  • Four layers left core for plugin packages, and package:magic/magic.dart no longer exports them. magic_encryption carries Crypt, MagicEncrypter, EncryptionServiceProvider and key:generate; magic_picker carries Pick and the MagicFile.toXFile() and XFile.toMagicFile() conversions (XFile leaves core, and fromXFile is replaced by toMagicFile) and the file_picker, image_picker and share_plus re-exports; magic_socket carries Echo, the broadcasting manager, the Reverb and null drivers, ListensToBroadcasts and FakeBroadcastManager (now package:magic_socket/testing.dart); magic_local_storage carries the whole SQLite layer: DB, Schema, the query builder, migrations, seeders, factories, SyncFeed and SyncLedger. Add one with flutter pub add <package> then dart run magic:dowel plugin:install <package>. The Crypt payload wire format is unchanged (AES-256-CBC, base64(iv):base64(ct)), so ciphertext written by 0.0.41 still decrypts.
  • Five facades are gone from core, so core has 13: Auth, Cache, Config, Event, Gate, Http, Lang, Launch, Log, Route, Session, Storage, Vault. Crypt, DB, Echo, Pick and Schema now come from the plugins above.
  • The installer flags --without-database and --without-broadcasting are removed, and so are make:migration, make:seeder, make:factory and key:generate. Core ships 17 make:* generators instead of 20. make:model -m/-f/-s and make:resource look the migration, factory and seeder commands up in the dowel registry and print a hint to install magic_local_storage when it is absent.
  • make:controller --broadcasts is removed. Mix ListensToBroadcasts from magic_socket into the controller by hand.
  • Storage.download on IO throws UnsupportedError unless a handler is set. Core no longer carries share_plus; magic_picker sets the new LocalAdapterContract.downloadHandler so the file is shared as before. The web adapter is unchanged.
  • Model.query() is gone from core. It is the extension ModelQuery in magic_local_storage. A model with useLocal => true throws a StateError naming magic_local_storage on every persistence leg when nothing is bound to the local_model_store container key.
  • Magic.seed is gone from core. Use Seeding.run(List<Seeder>) from magic_local_storage.
  • magic:install no longer registers DatabaseServiceProvider or BroadcastServiceProvider, so an app that needs one runs plugin:install for its plugin. An app installed on 0.0.41 also has the published lib/config/database.dart and lib/config/broadcasting.dart. The plugins export databaseConfig and broadcastingConfig from their barrels, so delete those two files before running plugin:install magic_local_storage or plugin:install magic_socket, or the import becomes ambiguous.
  • The record type of FakeCacheManager.recorded is FakeCacheCall, not CacheRecord. A test that names CacheRecord stops compiling: rename it to FakeCacheCall. The generic name collided with the CacheRecord class of the crumbs dev tool for any app that imports both barrels, and a test fake's record shape does not belong under a generic name in package:magic/magic.dart. The shape is unchanged: ({String operation, String key, dynamic value}). (lib/src/testing/fake_cache_manager.dart)

Added

  • LocalModelStore, the one contract core keeps for local persistence. Model resolves it from the container under 'local_model_store', and magic_local_storage binds it. Core keeps the base Model (API-first, useLocal false by default), casts, HasTimestamps, InteractsWithPersistence, model_events and db_events. (lib/src/database/contracts/local_model_store.dart)
  • LocalAdapterContract.downloadHandler, the seam that lets a plugin own the IO download. (lib/src/storage/drivers/local/local_adapter_contract.dart)

Changed

  • First stable release: version 1.0.0 replaces the planned 0.1.0 and follows 0.0.41, so the 0.x caret trap is gone: a package on magic: ^1.0.0 takes every 1.x release. It requires dowel ^1.0.0 and wind_kit ^1.12.0; no API change beyond what is listed here.
  • The web local storage adapter reads and writes localStorage directly. Keys (flutter. plus the path) and the json-encoded base64 value format are the same, so files stored by 0.0.41 stay readable.
  • The installer's lib/main.dart preview draws an in-repo unified diff instead of using more.
  • The sqlite3 floor is ^3.9.1 and the sqlite3.wasm pin moves to 3.9.1. Both now belong to magic_local_storage, whose local_storage:install downloads the wasm.
  • magic:install --with-devtools wires the tapir and crumbs debug trio. fluttersdk_dusk and fluttersdk_telescope are discontinued, so the flag adds magic_devtools ^1.0.0, tapir ^1.0.0 and crumbs ^1.0.0 to dependencies and writes the TapirPlugin and CrumbsPlugin blocks (with the ExceptionWatcher and DumpWatcher) into lib/main.dart under !kReleaseMode (debug and profile builds carry the tools, so a perf measurement runs on a profile build; release tree-shakes them), with MagicPerfIntegration.install() before Magic.init() and MagicTapirIntegration and MagicCrumbsIntegration after it. A call already in lib/main.dart is never written twice, and an app already calling MagicDevtools.installPre( is left untouched. Its post-install message lists plugin:install tapir, plugin:install crumbs, tapir:install and crumbs:install. (lib/src/cli/commands/magic_install_command.dart, install.yaml)
  • Every direct dependency constraint is raised to its latest release. wind_kit ^1.12.0, dowel ^1.0.0, go_router ^18.1.4 (the 17.x floor is gone), flutter_secure_storage ^11.2.0, dio ^5.11.1, logger ^2.8.0, jiffy ^6.4.5, meta ^1.19.0 and the rest to their current patch.

Removed

  • Ten dependencies leave core's pubspec.yaml: more, sqlite3_flutter_libs, shared_preferences, encrypt, file_picker, image_picker, share_plus, web_socket_channel, sqlite3 and faker. A consumer that used one of them transitively adds it, or the plugin that now owns it, to its own pubspec.yaml. (pubspec.yaml)

Fixed

  • Five doc comments no longer carry bare angle brackets. pana reports unintended_html_in_doc_comment for them even though analysis_options.yaml ignores the lint, and the publish workflow requires full pana points. The generic types now sit inside backticks. (lib/src/actions/magic_action.dart, lib/src/cli/helpers/main_dart_smart_merger.dart, lib/src/database/eloquent/model.dart, lib/src/foundation/config_repository.dart, lib/src/ui/magic_form_data.dart)
  • An overlay route opened as a dialog puts a transparent Material above its panel, as the sheet does. The dialog route had no Material above the panel, so a bare Text or WText in it was drawn with the debug fallback style (a yellow double underline) where the same panel looked right as a sheet, and every panel had to bring its own. The Material paints nothing and does not absorb a tap, so the scrim around the panel still closes the dialog when canDismiss allows it; the panel still draws its own surface and size. (#285, lib/src/routing/magic_overlay_page.dart)
  • A transport failure is a failed response, so fetchList and fetchOne report an error instead of an empty list. DioNetworkDriver answers a timeout or a dead link with status 0 ...
Read more

0.0.41

Choose a tag to compare

@github-actions github-actions released this 09 Nov 21:35
34de75c

Changed

  • Every sibling floor names this batch's release. fluttersdk_wind moves ^1.11.0 to ^1.11.1. The old range already admitted the new version, so a fresh pub get resolves nothing differently; what changes is that the floor names the release magic is verified against. wind 1.11.1 only fixes a horizontally scrolling WDiv painting its border across the viewport, so nothing magic calls changes. (pubspec.yaml)

Fixed

  • A layout's shell is a MaterialPage on every go_router the constraint admits. The ShellRoute had only a builder, so go_router chose its page: a MaterialPage when it recognised a MaterialApp, a NoTransitionPage otherwise. go_router 18 recognises material_ui's MaterialApp alone, so under Flutter's own MaterialApp.router (what MagicApplication builds) the shell lost its page transition and its route stopped using Theme.of(context).pageTransitionsTheme. The router now builds the page itself with the key, name, arguments and restoration id go_router 17 gave it, so 17 and 18 behave alike. (lib/src/routing/magic_router.dart)

Improvements

  • The example's tips overlay opens as a centred dialog from 1024 px. RouteServiceProvider installs a MagicRoute.useOverlayPresentation resolver, and WelcomeSheetView draws its own surface in both frames: a bottom sheet below, a centred card with four rounded corners above. A panel can tell the frame by ModalRoute.of(context) is RawDialogRoute, so magic exposes nothing new for it. (example/)

0.0.40

Choose a tag to compare

@github-actions github-actions released this 06 Nov 03:07
0427c34

Added

  • An overlay route can open as a centred dialog instead of a bottom sheet. MagicRoute.useOverlayPresentation((context) => ...) installs a resolver, asked once each time an overlay opens with the root navigator's context, that answers MagicOverlayPresentation.sheet or .dialog; magic itself holds no breakpoint, so the app decides (by window width, typically). The dialog is a bare DialogRoute on the root navigator with the sheet's scrim and no safe-area padding, so the panel draws its own surface. It shares the sheet's dismissal: canDismiss read live (scrim and Escape off while it says no) and a user's close sent through the browser's Back on the web. Without a resolver every overlay stays the sheet it was, and MagicRouter.reset() drops the resolver. (lib/src/routing/magic_overlay_page.dart, lib/src/routing/magic_router.dart, lib/src/facades/route.dart)

0.0.39

Choose a tag to compare

@github-actions github-actions released this 04 Nov 14:40
4792229

Fixed

  • An overlay sheet a refused drag slid shut under the guard's own question comes back when that question closes. A canDismiss that refuses usually asks why in a route pushed over the sheet, so the sheet was no longer current when its fling ended and stayed shut, invisible, with the scrim swallowing every tap. The route now slides back up in didPopNext when it is still active, shut and the guard still refuses. (lib/src/routing/magic_overlay_page.dart)

0.0.38

Choose a tag to compare

@github-actions github-actions released this 03 Nov 14:22
a850a27

BREAKING

  • MagicVaultService.macOsUsesDataProtectionKeychain is now bool?, and an absent security.vault.macos_data_protection_keychain means "probe" rather than true. Code that read the field as a bool no longer compiles. The config key stays as the explicit override, and true or false is honoured without a probe.

Added

  • A route can open as a bottom sheet with its own URL. RouteDefinition.overlay(base:, canDismiss:) makes to() always push the route as a ModalBottomSheetRoute on the root navigator over the page on screen (a deep link or post-login redirect through to() included); back(), the system back button and browser Back return to that page with its state, and the address bar shows the sheet's URL. A replacing arrival (the initial location, platform route information such as a reload, a go_router go()) is redirected to base and the sheet is pushed over it in the next frame, only if the navigation actually landed on base; MagicRoute.replace() to an overlay is not such an entry. base must name another registered page route, and may declare parameters, filled from the overlay location, that the overlay path must also declare; otherwise the router throws a StateError when it builds. canDismiss is asked before every close (scrim, drag, system back, browser Back, back(), a to() that replaces the stack, through GoRoute.onExit) and turns the scrim and the drag off while it answers no; a refused browser Back keeps the sheet and the address bar on the sheet's URL. A second to() for a sheet already on top (a double click) is ignored. On the web a cold load waits until the browser holds an entry for base before it pushes the sheet, so the history is [base, sheet] and the first browser Back closes the sheet instead of leaving the app; a reload with the sheet open leaves base in the history twice (measured in Chrome through Playwright). This is best effort until the user has interacted with the page: Chrome's history intervention lets its real Back button skip an entry added without a user gesture, which Playwright's goBack does not exercise. A guarded sheet takes a go_router onExit on every platform, so Navigator.popUntil over it does not terminate, and a navigation issued while it is on top runs one event later so a Navigator.pop() just before it cannot drop it; a second pop of the same sheet in one event is refused instead of completing it twice. On the web, closing the sheet with MagicRoute.back(), a scrim tap or a drag steps the browser history back under the same rule as a stacked() page (see Fixed), so a later browser Back does not reopen it; a panel that refuses the pop itself (PopScope(canPop: false), a refusing Form) keeps a scrim tap or Escape from moving the browser at all, a Navigator.pop from the panel closes in the app and adds an entry, and a DraggableScrollableSheet that closes by shrinking to its minimum does too (measured in Chrome). The frame is the one showModalBottomSheet(backgroundColor: Colors.transparent, isScrollControlled: true, useRootNavigator: true) builds, with no drag handle, no safe area and no constraints; the route's widget is the panel, and it inherits the app-level themes rather than a layout's local ones. An overlay declared in a layout group keeps its prefix and middleware, opens above the shell, and is matched before the layout's pages, so its path must not also match a page path. While an overlay is on top, the title, currentPath, Request.route() and the query readers answer for the sheet, not for the page a layout builds beneath it. (lib/src/routing/magic_overlay_page.dart, lib/src/routing/magic_router.dart, lib/src/routing/route_definition.dart)
  • MagicVaultService.usesDataProtectionKeychain reports the keychain in use. null until the first operation has resolved it.
  • MagicVaultException.statusCode and isMissingEntitlement name the cause of a failed operation. statusCode is the OSStatus the keychain returned (taken from the wrapped PlatformException.details, since the exception code is the same string for every status), and isMissingEntitlement is true for -34018. A write that fails for want of the entitlement now says so in its message.

Changed

  • The macOS Vault chooses its keychain on first use instead of assuming the data protection one. With no security.vault.macos_data_protection_keychain config, MagicVaultService writes and deletes a throwaway item in the data protection keychain once. It keeps that keychain when the write works and falls back to the legacy login keychain, with one Log.warning, when the keychain answers errSecMissingEntitlement (-34018), which is what an ad-hoc build or one without a provisioning profile gets. Before this, every Vault.put on such a build failed and a sign-in showed only a generic error. The probe writes because a read of the data protection keychain on such a build finds nothing instead of failing. Any other probe failure surfaces as a MagicVaultException and the next operation probes again. A signed build that was already on the data protection keychain keeps it. An app that fell back to the legacy keychain and is later signed with a profile moves to the data protection keychain and does not see its old items (there is no migration between the two); pin macos_data_protection_keychain: false for such an app. A release build with no provisioning profile now stores in the legacy keychain, with one warning, instead of failing every write; set the key to true to have it fail loudly instead. The legacy keychain ties an item to the signature that wrote it, so an ad-hoc build that is rebuilt can raise a system keychain prompt per stored item on its next launch: sign local builds with a stable identity.
  • The fluttersdk_wind floor moves ^1.9.0 to ^1.11.0. The old range already admitted 1.11.0, so a fresh pub get resolves nothing differently; what changes is that the floor names the release magic is verified against. wind 1.9.1 to 1.11.0 add and fix without a break a consumer inherits (WButton, WPopover and WSelect semantics, WInput vertical centring and a locale decimal mark, WImage object position, wWindowClassOf), and magic needed no change for them. The stack lines in CLAUDE.md and .github/copilot-instructions.md quote the new floor. (pubspec.yaml, CLAUDE.md, .github/copilot-instructions.md)

Fixed

  • to() on a stacked() route decides "the screen already showing" from the top of the page stack. It read the location of the page whose builder ran last, which over a page inside a layout is the page beneath (the shell builds after the pushed page). The documented query swap (to('/monitors/42', queryParameters: {'tab': 'checks'}) on /monitors/42) then pushed a second copy of the screen instead of swapping its tab, and two to() calls for the same stacked route in one frame (a double click) pushed it twice. Both now behave as documented on every platform. (lib/src/routing/magic_router.dart)
  • On the web, MagicRoute.back() from a stacked() page no longer leaves the page behind the browser's Back. go_router reports every change of the page stack as a new history entry, so back() added the page underneath as a NEW entry, and the next browser Back reopened the page just closed. back() now closes a page pushed by MagicRoute.to() or MagicRoute.push() through history.back() when the browser's current entry is the one that push created over the stack beneath (compared by the encoded stack, page keys included); the browser answers as it does its own Back button, so no entry is added and Forward reopens the page. A second back() before the browser answers does nothing, and a to(), push() or replace() issued meanwhile runs after it. A step the browser does not answer within a second is given up and the page stays; nothing closes in the app then, so a late answer closes it like a browser Back. A replace(), including the query swap to() does on the screen already showing, gives up the claim, since go_router reports it as a new entry with the same page key. Every other close happens in the app as before and adds an entry: Navigator.pop and popUntil from app code (their synchronous pop is kept: no route gains a go_router onExit for this), a go_router context.push, two pushes in one frame, and any page after the app closed a page in the app. Native platforms are unchanged. Measured in Chrome; Safari, Firefox and mobile browsers were not measured. (lib/src/routing/magic_router.dart, lib/src/routing/browser_history_web.dart, lib/src/routing/browser_history_stub.dart)

0.0.37

Choose a tag to compare

@github-actions github-actions released this 02 Nov 11:28
ba95b2e

Added

  • MagicImage draws a network image from a copy kept on the device. MagicImage.of(url, {fallback, cacheWidth}) answers an ImageProvider that reads the image from the images storage disk when it is held and fetches it once when it is not, so a poster is a request the first time and never again, across launches. A fallback address is the stand-in: it draws at once when held, the address replaces it when it lands, and when the address cannot be fetched the fallback is fetched and stays, with the address asked again after retryAfter. MagicImageCache owns the fetch and the retry window (five minutes by default), shares one request between two draws of a URL, trims the folder to 300 MiB least recently used first on the first use of a launch and again after a quarter of the cap has been written, and has clear(). MagicImageStore is the folder, files named by the SHA-1 of the URL with atomic writes, and MagicImageWire is the dart:io fetch: http and https only, a JPEG, PNG, GIF or WebP body of at most 8 MiB, timeouts, and failures that never name the address. A key that failed, or a stand-in that outlived the retry window (noted per key, so the same address at another cacheWidth retries too), is dropped from the memory cache so the next resolve loads again, and bytes that pass the signature check but do not decode are refused for the retry window instead of downloaded on every resolve. A fetched image the disk will not keep (a full disk) is drawn from memory and not held against the host: the cache throws a MagicImageNotStored carrying the bytes. clear() empties the folder and keeps the root, so the backup exclusion of the disk survives it. On the web MagicImage.of answers a NetworkImage, and MagicImageCache.instance.clear() and MagicImageException exist there so shared sign-out code compiles. Declare the disk in the app's filesystems config with 'exclude_from_backup': true (defaultFilesystemsConfig carries the entry, which Magic.init does not merge by itself); a disk that is not declared or cannot be opened leaves images drawn with no copy kept, with one warning logged. crypto becomes a direct dependency. (lib/src/storage/images/)
  • A local disk can keep its root out of iCloud and Time Machine backup. Setting 'exclude_from_backup': true on a local disk marks its root directory with kCFURLIsExcludedFromBackupKey on iOS and macOS, through dart:ffi into CoreFoundation, on the first path the disk resolves, whether it created the directory or found it there. Files under the root inherit the exclusion, which suits large downloads the app can fetch again. A refused mark throws a FileSystemException instead of resolving the path. The key defaults to false, and it does nothing on Android, Windows, Linux or the web; a disk without it behaves as before. (lib/src/storage/storage_manager.dart, lib/src/storage/drivers/local/backup_exclusion_io.dart, lib/src/storage/drivers/local/local_adapter_io.dart)

0.0.36

Choose a tag to compare

@github-actions github-actions released this 29 Oct 20:53
1aa6b7a

Added

  • MagicDecryptException is exported from package:magic/magic.dart. Crypt.decrypt and Crypt.decryptWithDeviceKey document on MagicDecryptException, but the type was not in the barrel, so a caller could only catch a bare Exception. (lib/magic.dart)
  • MagicTest.bootProviders and MagicTest.disposeBooted. bootProviders(providers) registers every provider and then boots every provider, in list order, the way Magic.init does, without loading an env file or config. disposeBooted() disposes the registered controllers newest first, detaches SessionScope, resets MagicRouter and flushes the container, covering what Magic.flush() leaves behind. (lib/src/testing/magic_test.dart)
  • references/plugin-device.md, the skill's page for magic_device 0.0.1. The ecosystem plugin table, the reference index and the skill's trigger line now name the package, and the page covers DevicePower (the mains-power gate with its television predicate, and how idle is measured per platform), WindowFullscreen (the shared instance, active against target and transitioning, the will and did notifications on magic_device/window, what toggle() refuses), the BatteryState re-export, and testing through injected readers. (skills/magic-framework/)

0.0.35

Choose a tag to compare

@github-actions github-actions released this 28 Oct 16:54
9e4c5f6

Fixed

  • A web tab keeps its page title after the router moves on. Chrome keeps a tab title per history entry. After a page builds, the Flutter engine calls history.pushState or replaceState to report the route, and the title written during that build did not follow the new entry: the tab fell back to the previous entry's title, or to the bare host, while document.title still read correctly. Blink only reports a title to the browser when it changes, so writing the same one again did nothing, and the tab stayed wrong until the next navigation. MagicApplication now re-sends the title after every change of the browser's current history entry (a title written with a zero-width suffix, then the real one) through the Navigation API; where the browser has none, and on every other platform, nothing changes. (lib/src/routing/tab_title_sync.dart, lib/src/foundation/magic_app_widget.dart)

0.0.34

Choose a tag to compare

@github-actions github-actions released this 27 Oct 14:50
90a0736

Fixed

  • A picked file uploads from a release web build. Http.upload recognised a MagicFile or an XFile by comparing runtimeType.toString() with the class name, and dart2js minifies class names in a release build, so on the web every file from Pick was refused with Unsupported file type: minified:.. before a request left the browser. Debug runs and tests were unaffected, which is why it shipped. The driver now uses type tests. (lib/src/network/drivers/dio_network_driver.dart)