Skip to content

1.0.1

Latest

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 reported through FlutterError.reportError rather than from maybePop, and a legacy willPop callback on the same route is asked a second time by the approved back. MagicForm is now a StatefulWidget; its constructor is unchanged, but a subclass that defines build no longer overrides anything, so its UI is never rendered (the analyzer flags an @override on it), and a subclass should wrap MagicForm instead of extending it. The parameter type is Future<bool> Function()?, the same shape as WillPopCallback, so existing callers compile as before. The package now lints with no analyzer suppression at all. (lib/src/ui/magic_form.dart, analysis_options.yaml)
  • MagicRoute.layout(routes: [...]) wraps its routes in the layout. Its list is built with MagicRoute.page, which also put each route in the top-level table, and go_router matched that copy first, so the pages rendered without the layout. The layout now takes its routes out of the top-level table; they keep their names and stay reachable. Like a group's layout pages, they are now tried after every top-level route, so a top-level catch-all such as MagicRoute.page('/:slug', ...) captures them: register a catch-all after every route it could shadow, in the last shell tried. (lib/src/routing/magic_router.dart, doc/basics/routing.md)
  • A new app's welcome view and routing config link to the live site. magic:install wrote links to the retired magic.fluttersdk.com; they now point at https://anilcancakir.com/magic, its CLI page and the routing page's URL strategy section, and the CLI card says dart run magic:dowel list instead of a magic --help that does not exist. The example app, the example CLAUDE.md (which now installs the skills with npx skills add) and the issue forms follow. (assets/stubs/install/, example/, .github/ISSUE_TEMPLATE/)
  • API doc comments show calls that exist. The routing doc comments use MagicRoute.page instead of the deprecated MagicRoute.get and MagicRoute where they named a Route facade that does not exist, Env.get describes its real conversion rules, and the FormRequest example authorises through Gate.allows. (lib/src/)