jaspr_cli
A command line interface to create, serve and build jaspr applications.
0.23.4
15K downloads/mo
#2470 most downloaded on pub.dev
schultek/jaspr
What this package is like to depend on
Last release 9 days ago
14 Aug 2026
Ships fairly regularly
a new release about every 3 weeks
Nearly every release is documented
notes for 57 of 60 stable releases
Nothing withdrawn
no release was ever pulled
3 years old
64 releases · first in 2023
25 releases in the last 12 months
see the full history below
Release timeline
64 releases · Feb 2023 to Aug 2026Releases
latest 60 of 64-
0.23.414 Aug 2026Release notes
Open source →The following packages have been updated:
jaspr_test : 0.23.3 -> 0.23.4
jaspr : 0.23.3 -> 0.23.4
jaspr_builder : 0.23.3 -> 0.23.4
jaspr_cli : 0.23.3 -> 0.23.4Release notes
Open source →- Server rendering now fails with a 500 HTTP response instead of hanging indefinitely when an error occurs during the initial build, outside of a component's
buildmethod. - Worked around a Dart VM bug that caused server rendering to crash on
linux_x64due to aNoSuchMethodErrorinsideTaskChain.then.
- Server rendering now fails with a 500 HTTP response instead of hanging indefinitely when an error occurs during the initial build, outside of a component's
-
0.23.304 Aug 2026Release notes
Open source →The following packages have been updated:
jaspr_test : 0.23.2 -> 0.23.3
jaspr : 0.23.2 -> 0.23.3
jaspr_builder : 0.23.2 -> 0.23.3
jaspr_router : 0.8.3 -> 0.9.0
jaspr_cli : 0.23.2 -> 0.23.3
jaspr_content : 0.5.3+1 -> 0.5.4
dart_quotes : 0.1.12 -> 0.1.13 (No Changelog)
dart_quotes_server : 0.1.12 -> 0.1.13 (No Changelog)
fluttercon : 0.0.13 -> 0.0.14 (No Changelog)
website : 0.1.8 -> 0.1.9 (No Changelog)Release notes
Open source →- Added
detachRootComponent()toComponentsBindingto cleanly unmount the root component. - Updated
testClientinjaspr_testto automatically unmount the root component and clean updocument.bodybetween test cases. - Fixed asynchronous errors escaping the development proxy when falling back to the app root.
- Fixed repeated copying of nested build assets.
- The sitemap
prioritytag is now omitted when a route has no priority set, instead of always defaulting to0.5. - Fixed a misconfiguration of server hotreload that caused
jaspr serveconsuming excessive CPU. - Require
build_daemon ^4.1.4to fix build error due to version mismatch.
- Added
-
0.23.214 Jul 2026Release notes
Open source →- Added
basePathproperty toAppBindingto support hosting applications under a sub-path. - Exposed
basePathparameter intestComponentsandhandlerPathinServerTester.requestto support testing under custom base paths. - Support
analyzer^12.1.0. - Added a
--portoption tojaspr buildfor configuring the server port used during static generation.
- Added
-
0.23.104 May 2026Release notes
Open source →- Fixed expression compilation when debugging a client-side application with an AOT installed CLI.
- No longer generates empty css files in standalone mode when no
@cssdeclarations are used. - Jaspr now uses OS-specific directories for its settings and cache, better respecting platform conventions.
- The old directory at '~/.jaspr/' is automatically migrated to the new locations on first run.
- The new directory location is:
- when
DART_DATA_HOMEenvironment variable is set:$DART_DATA_HOME/jaspr - on Windows:
%LOCALAPPDATA%\Dart\jaspr - on Mac OS:
$HOME/Library/Application Support/Dart/jaspr - on Linux:
$XDG_STATE_HOME/Dart/jasprif$XDG_STATE_HOMEis defined, and$HOME/.local/state/Dart/jasprotherwise.
- when
- The cli completion files are no longer auto-installed when the
JASPR_NO_COMPLETIONenvironment variable is set.
-
0.23.017 Apr 2026Release notes
Open source →
title: Version 0.23.0 description: Release notes and breaking changes.
Agent Skills for Jaspr
Jaspr now ships with a set of agent skills to improve the experience of using Jaspr with AI code generation tools.
These skills can be installed by running
jaspr install-skillsin your project directory. The install location depends on the AI tool you are using and can be configured via the--agentflag.For example to install the skills for Antigravity, use
jaspr install-skills --agent=antigravity.Use
jaspr install-skills -hto get the list of all available agents.When updating Jaspr you also should update the installed skills by running
jaspr install-skillsagain. The cli will automatically detect if the installed skills are outdated, or when new skills are available.
The following skills are available:
Skill Description jaspr-fundamentals Jaspr fundamentals, Up-to-date syntax for writing components. jaspr-pre-rendering-and-hydration Pre-rendering and hydration, @client components, entrypoints. jaspr-styling Styling in Jaspr, @css, Styles API. jaspr-convert-html Automatically converting HTML to Jaspr. jaspr-js-interop JS interop in Jaspr and Dart. CLI Improvements
The Jaspr CLI is now installable with
dart install jaspr_cli.This will install the CLI as an AOT executable and is faster than the previous version installed via
dart pub global activate.<Info> When installing the CLI with
dart install jaspr_cli, make sure to remove any previous global activation ofjaspr_cli. You can do this by runningdart pub global deactivate jaspr_cli. </Info>
Added a new
jaspr convert-htmlcommand to automatically convert raw HTML to clean and idiomatic Jaspr code.This is used by the new
jaspr-convert-htmlagent skill, but can also be used manually by providing a file path or URL to the command.- From a local file:
jaspr convert-html --file some/path/to/file.html - From a URL:
jaspr convert-html --url https://example.com
If you only need a portion of the HTML, you can use the
--queryoption with a CSS selector to target specific elements rather than converting the whole file and deleting pieces manually.jaspr convert-html --file some/path/to/file.html --query "#my-id"This will only convert and output the element with the id
my-id.Standalone CSS Generation
Jaspr now supports generating a standalone
.cssfile for your styles declared with@css.To enable this feature, add the following option to your
pubspec.yaml:jaspr: styles: standaloneBy default, all styles declared with
@cssare inlined in the pre-rendered HTML. When standalone mode is enabled, all styles are extracted to a separate.cssfile and linked in the pre-rendered HTML. This can improve the initial load time of your website, since the browser can more efficiently cache the css file.Additionally,
@cssis now also supported in client mode projects, where standalone mode is enabled by default.Unsafe Imports Lint Rule
A new lint rule
unsafe_importshas been added tojaspr_lints. It will detect and warn about unsafe platform-specific imports in components depending on where they are rendered (server or client).For example, if a component imports e.g.
dart:ioorpackage:jaspr/server.dartbut is rendered on the client, it will be flagged as unsafe. Similarly, if a component imports e.g.dart:js_interoporpackage:jaspr/client.dartbut is rendered on the server, it will be flagged as unsafe.This will help you to avoid compilation errors due to wrong imports, which before were quite hard to debug.
<Info> To further improve your experience, consider using the Jaspr VSCode Extension, which will give you in-editor hints for each component on where they are rendered (server, client, or both). </Info>
Release notes
Open source →-
Added Agent Skills for Jaspr, which can be installed with
jaspr install-skills. -
Multiple improvements to the Jaspr CLI:
- Jaspr can now be installed with
dart install jaspr_cliinstead ofdart pub global activate jaspr_cli. - Added
jaspr convert-htmlcommand to automatically convert raw HTML to Jaspr code. - Breaking Removed
jaspr tooling-daemoncommand. The functionality is now provided by thejaspr_lintspackage. - Improved logging and overall stability.
- Jaspr can now be installed with
-
Added
jaspr: styles: standaloneoption topubspec.yaml.- When enabled, all
@cssdeclarations are rendered to a standalone.cssfile instead of being inlined in the pre-rendered HTML. @cssis now also allowed in client mode projects, where standalone mode is enabled by default.
- When enabled, all
- From a local file:
-
0.23.0+117 Apr 2026Nothing published for this version
-
0.23.0+217 Apr 2026Nothing published for this version
-
0.23.0+317 Apr 2026Nothing published for this version
-
0.22.419 Mar 2026Release notes
Open source →-
Allow
analyzerversions 10.x. -
Added new
jaspr.styles: standaloneoption topubspec.yaml.- When enabled, all
@cssdeclarations are output to a standalone.cssfile instead of being inlined in the HTML. - This is enabled by default in client mode, which is why
@cssis now allowed in client mode projects.
- When enabled, all
-
-
0.22.316 Feb 2026Release notes
Open source →- Added
ServerApp.addMiddleware()method to add custom middleware to Jaspr's HTTP server.
- Added
-
0.22.205 Feb 2026Release notes
Open source →-
Added
--web-portand--proxy-portoptions tojaspr servefor configuring webdev and proxy server ports.- Allows running multiple Jaspr projects simultaneously with different ports.
-
Fixed
testComponentsfailing withRawTextcomponents due toMarkupRenderObjectcast error.- Added
RawableRenderObjectandRawableRenderTextinterfaces for raw HTML text rendering support. MarkupRenderObjectandTestRenderObjectnow implementRawableRenderObject.MarkupRenderTextandTestRenderTextnow implementRawableRenderText.
- Added
-
Fixed encoding of
lastmodproperty in generated sitemap to be a valid W3C date string. -
Fixed launching debug builds in Safari.
-
Added
--target-osand--target-archoptions to the build command to cross-compile server binaries. -
Added
--dart-define-from-fileoption to the serve and build commands. -
Respect
PUB_HOSTED_URLenvironment variable for custom pub mirrors. -
Added an example to show on pub.dev.
-
-
0.22.103 Jan 2026Release notes
Open source →- Fixed bug when using
flutter: pluginsorflutter: embeddedon Windows. - Fixed generation of
*.client.options.dartfile in client mode. - Improved detection of Flutter plugins by reading the generated
.flutter-plugins-dependenciesfile. - Fixed bug preventing event handlers from being updated in rebuilds.
- Fixed bug when using
-
0.22.010 Dec 2025Release notes
Open source →
title: Version 0.22.0 description: Release notes and breaking changes.
Overview
Version 0.22.0 is all about reducing magic in the framework and making it more expressive and modular.
The main features are:
-
Separate Entrypoints: Each project can now contain a
main.server.dart(in server and static mode) andmain.client.dart(in all modes) file. Related APIs are updated to reflect this. -
Improved @client initialization: Any
@clientcomponent is now initialized by using the newClientAppcomponent inmain.client.dart, which can be wrapped with other components for sharing state, running custom initialization logic and more. -
New
package:jaspr/dom.dartlibrary: All DOM related APIs (HTML components,Styles,css, etc.) have been moved into a separate library for better modularity. -
Reimplemented HTML Components as Classes: All HTML components have been reimplemented as classes instead of functions, allowing
constusage. -
Discontinued
jaspr_web_compilers: Flutter support can now be enabled through thejaspr.flutterconfig option inpubspec.yaml. -
Various Styling Improvements: New CSS properties like
animationandquotes, improved properties likeTransition, better support for dot-shorthands and more.
<Success> Most changes can be automatically migrated using the
jaspr migratecommand.If you are on the latest Dart and want the migrations to use dot-shorthands, additionally add
--feature=dot-shorthands. </Success>
Project Entrypoints
The project can now contain separate entrypoints for server and client environments:
<file>.server.dart(in server and static mode)<file>.client.dart(in all modes)
The generated global options file (previously
jaspr_options.dart) is now generated as<file>.server.options.dartalongside the entrypoint, and an additional<file>.client.options.dartis generated for client-side code.Client Initialization
The default
main.client.dartfile should look like this:// Previously 'browser.dart', now renamed. import 'package:jaspr/client.dart'; // Generated options file. import 'main.client.options.dart'; void main() { Jaspr.initializeApp( options: defaultClientOptions, ); runApp( // New component to initialize @client components. const ClientApp(), ); }This surfaces previously hidden functionality of the framework related to the initialization of
@clientcomponents on the client and thereby makes it easier to debug and understand what is happening.Futher, the new
ClientAppcomponent may be wrapped with other (Inherited) components to share state across multiple@clientcomponents, or to run custom initialization logic before callingrunApp.Changed
browserlibrary toclientThe
package:jaspr/browser.dartlibrary has been renamed topackage:jaspr/client.dartto better reflect its purpose. The migration can be performed automatically using thejaspr migratecommand.Migration
<Success> After upgrading Jaspr CLI to
0.22.0, you can use thejaspr migratecommand to automatically migrate your code to the new entrypoint system. </Success>In case you need or want to migrate your code manually, rename
lib/main.darttolib/main.server.dartand create a newlib/main.client.dartfile with the content shown above. Additionally, rename allpackage:jaspr/browser.dartimports topackage:jaspr/client.dart.Reason for the Change
The goal of this change is to reduce the "magic" in the framework and make it more transparent what is happening under the hood. This comes with the added benefit of enabling custom initialization logic, and sharing state across multiple
@clientcomponents, a feature that was frequently requested.Also it is now possible to debug and inspect the client-side hydration process more easily, as the
ClientAppcomponent is now explicitly visible in the code.DOM APIs
All DOM related APIs (
div()et al.,Styles,css,Coloret al.,events(),RawText, andViewTransitionMixin) have been moved into a separatepackage:jaspr/dom.dartlibrary for better modularity.HTML Class Components
All HTML components have been reimplemented as classes instead of functions. This is technically a breaking change, but it is expected to not affect most users.
Deprecated Helper Functions
Deprecated
text(),fragment()andraw()functions in favor ofComponent.text(),Component.fragment()andRawText, respectively.The new API is designed to work well with dot-shorthands while allowing
constusage.// Before: text('Hello World'); fragment([ ... ]); raw('<div>Raw HTML</div>'); // After (with dot-shorthands): .text('Hello World'); .fragment([ ... ]); RawText('<div>Raw HTML</div>');Migration
<Success> After upgrading Jaspr CLI to
0.22.0, you can use thejaspr migratecommand to automatically migrate (most of) your code to the new entrypoint system. </Success>In case you need or want to migrate your code manually, add new
package:jaspr/dom.dartimports where needed.In most cases, the new HTML class components should not need any migration, as they keep their lowercase names. One exception to this is when used with inferred typing (such as
var child = div([]);), which may now require an explicit type annotation (such asComponent child = div([]);) when assigning other values (such aschild = span([]);).Reason for the Change
The new library reduces the "pollution" of the global namespace when importing
package:jaspr/jaspr.dartand allows for more fine-grained control of imported APIs.The class components allow for using
conston html component trees, which can improve performance. Also this makes the overall code more consistent and aligned with best-practices for writing components. As an exception to the general rule, the HTML components continue to use lowercase names to keep the familiar html-like syntax and differentiate them to other components.Flutter Support
Jaspr used to support Flutter plugins and Flutter embedding through a custom
build_web_compilersfork calledjaspr_web_compilers. A range of changes has been landed upstream and so the fork is no longer needed and has been discontinued. Please replace all dependencies onjaspr_web_compilerswithbuild_web_compilersand ensure a minimum version of4.4.6.To continue using Flutter embedding or plugins, add the following to your
pubspec.yaml:jaspr: flutter: embedded # or 'plugins' for plugin supportNew and Improved CSS Properties
The following css properties have been added to
Styles()andcss.styles():Animation animation Quotes quotesAlso the
durationanddelayproperties ofTransitionnow acceptDurationinstead ofdouble. For convenience,msandsecondsextensions tointare added for simple conversion:transition: Transition('width', duration: 2.seconds, delay: 300.ms),Additionally, some APIs were improved for better ergonomics when using dot-shorthands:
Gap.row()andGap.column()constructors.Flex.grow(),Flex.shrink()andFlex.basis()constructors.Border.all()constructor.
Release notes
Open source →-
Breaking Changed project entrypoint conventions:
-
Any server entrypoint file must now end in
.server.dart(e.g.lib/main.server.dart). -
The generated server-side options file is now generated alongside the server entrypoint (e.g. as
lib/main.server.options.dart) containingdefaultServerOptions. -
Jaspr.initializeApp()now requires thepackage:jaspr/server.dartimport. -
The project can contain at least one client entrypoint file ending in
.client.dart(e.g.lib/main.client.dart) for client-side rendering (also available in client mode). -
A new client-side Jaspr options file is generated alongside the client entrypoint (e.g. as
lib/main.client.options.dart) containingdefaultClientOptions. -
Added a new
ClientAppcomponent that should be used inside the client entrypoint like this:// This file is lib/main.client.dart import 'package:jaspr/client.dart'; import 'main.client.options.dart'; void main() { Jaspr.initializeApp( options: defaultClientOptions, ); runApp( const ClientApp(), ); }
-
-
Breaking Renamed
package:jaspr/browser.dartlibrary topackage:jaspr/client.dart, as well as:- Renamed
BrowserAppBindingclass toClientAppBinding. - Renamed
package:jaspr_test/browser_test.dartlibrary topackage:jaspr_test/client_test.dart. - Renamed
testBrowser()class totestClient().
- Renamed
-
Breaking Moved all html components, style classes and dom utilities including
div()et al.,Styles,css,Coloret al.,events(),RawText, andViewTransitionMixinto a separatepackage:jaspr/dom.dartlibrary.This reduces the "pollution" of the global namespace when importing
package:jaspr/jaspr.dartand allows for more fine-grained control of imported APIs. -
Breaking All html components are now implemented as classes instead of functions, and can thereby used with
const.This is mostly a structural change, as all components keep their lowercase names to have the familiar html-like syntax and differentiate to other Components. All standard uses of these components should still work as before, with a few exceptions when used with inferred typing (such as
var child = div([]);), which may now require an explicit type annotation (such asComponent child = div([]);) when assigning other values (such aschild = span([]);). -
Deprecated
text(),fragment()andraw()functions in favor ofComponent.text(),Component.fragment()andRawText, respectively.// Before: text('Hello World'); fragment([ ... ]); raw('<div>Raw HTML</div>'); // After (with dot-shorthands): .text('Hello World'); .fragment([ ... ]); RawText('<div>Raw HTML</div>'); -
Added
dl,dt, andddhtml components topackage:jaspr/dom.dart. -
Breaking Removed deprecated
package:jaspr/ui.dartlibrary. -
Breaking Removed support for
jaspr.dev-commandoption inpubspec.yaml. -
Added support for
jaspr.portoption inpubspec.yamlto specify the default port used byjaspr serve. This can still be overridden using the--portflag. If neither is set, the default port stays8080. -
Added support for
jaspr.flutteroption inpubspec.yamlto specify either support for Flutter embedding with'embedded'or support for Flutter plugins with'plugins'.This replaces the dependency on
jaspr_web_compilerspackage, which is now discontinued. Instead, make sure to depend onbuild_web_compilerswith a minimum version constraint of4.4.6or higher. -
Breaking: Removed
jaspr analyzecommand, as the latest version ofjaspr_lintscan now be used directly withdart analyze. -
Breaking:
ResponseLike.body(returned fromrenderComponent()) is now aUint8Listinstead ofString. -
Allow binary responses in
AppContext.setStatusCode. -
Global
@cssstyles from other packages will no longer be included automatically. To include them, import the file where they are defined. -
Breaking Changed
events()method to accept only one optional type parameter for bothonInputandonChangeevents. -
Added
Animation,QuotesCSS properties. -
Added
Curve.linearFn()easing function. -
Added
Gap.row()andGap.column()constructors. -
Added
Flex.grow(),Flex.shrink()andFlex.basis()constructors. -
Added
Border.all()constructor and deprecate the unnamedBorderconstructor. -
Breaking:
Transition'sdurationanddelayare now of typeDurationinstead ofdouble. -
Added
msandsecondsextensions tointfor simple conversion toDuration. -
Breaking: Changed
FontStyle.obliqueAngleto acceptAngleinstead ofdouble. -
Added
initial,inherit,revert,revertLayerandunsettoTransition,TextShadowandBoxShadow. -
Allow nesting non-empty
Filter.listinside each other.
-
-
0.22.0-beta.105 Dec 2025 pre-releaseNothing published for this version
-
0.22.0-beta.001 Dec 2025 pre-releaseNothing published for this version
-
0.21.713 Nov 2025Release notes
Open source →@Importnow supports defining extensions and properly checks elements inside theshowparameter.- Fixed bug when using
SyncStateMixinor@syncon a@clientcomponent. - Fixed bug with
checkedandindeterminateattributes not rendering correctly oninputelements. - Fixed allowing children for
pathtag by removing it from the list of self-closing tags. - Deprecate the
package:jaspr/ui.dartlibrary that provides legacy utility components. For accessing Jaspr APIs, importpackage:jaspr/jaspr.dartinstead. For the utility components, build your own or use a component library.
-
0.21.621 Oct 2025Release notes
Open source →- Added
checkedandindeterminateparameters toinput(). These will control the state of a checkbox or radio input. - Fixed client hydration and debugging bug on chrome when running the app under a base path.
- Added
-
0.21.515 Oct 2025 -
0.21.414 Oct 2025Release notes
Open source →- Added
JasprBadgecomponent that renders a "Built with Jaspr" badge. - Add the
--no-managed-build-optionsflag to commands launching a build daemon. Without managed build options, users are responsible for configuringbuild_web_compilers. - Fixed another whitespace rendering bug.
- Added
-
0.21.326 Sep 2025 -
0.21.220 Sep 2025 -
0.21.113 Sep 2025 -
0.21.013 Sep 2025Release notes
Open source →
title: Version 0.21.0 description: Release notes and breaking changes. next: /releases/packages/jaspr-code-v0.2.2 nextTitle: VSCode Extension Release Notes
TLDR / Overview
Version 0.21.0 comes with a major overhaul of the component syntax, making it easier and even more familiar to write components. It also ships a new
jaspr migratecommand for automatic migrations to new versions, and adds support for five new CSS properties.TL;DR
- Simplified Build Methods: All component
buildmethods now return a singleComponentinstead of anIterable<Component>, making code more concise and Flutter-like. - Unified Component Factories: New factory constructors on the core
Componentclass replaceDomComponent(),Text(), andFragment()for a more consistent API. - Automatic Migration Command: The CLI now includes a
jaspr migratecommand to help you automatically update your codebase for breaking changes. - Improved Base Handling: The
baseparameter of theDocument()component can now be set tonullto suppress the<base>element. - Expanded CSS Support: Eight new CSS properties are now available for more flexible styling:
all,aspectRatio,appearance,justifyItems,justifySelf,alignContent,filter, andbackdropFilter.
Additionally, a new version of the Jaspr VSCode extension was released that contains a major improvement to the developer experience. Read more in the Extension Release Notes.
Build Method Improvement
All component
buildmethods now return a singleComponentinstead of anIterable<Component>. This includes:-
The
build()methods ofStatelessComponentandStatefulComponentsState:@override Iterable<Component> build(BuildContext context) sync* { // [!code --] yield ... // [!code --] Component build(BuildContext context) { // [!code ++] return ... // [!code ++] } -
The
builderparameter ofBuilder,ListenableBuilder,FutureBuilder,StreamBuilderandAsyncBuilder, e.g.:return Builder( builder: (context) sync* { // [!code --] yield ... // [!code --] builder: (context) { // [!code ++] return ... // [!code ++] } ); -
The
build()method ofAsyncStatelessComponent:Stream<Component> build(BuildContext context) async* { // [!code --] yield ... // [!code --] Future<Component> build(BuildContext context) async { // [!code ++] return ... // [!code ++] }
Migration
<Info> After upgrading Jaspr CLI to
0.21.0, you can use thejaspr migratecommand to automatically migrate your components to the new build method signature.The automatic migration will be able to migrate most of your components (90% to 99%). </Info>
In case you need or want to manually migrate single components to the new build method, migrating is straightforward and in most cases trivial:
- Change the method signature to
Component build(BuildContext context)for normal components/builders, andFuture<Component> build(BuildContext context)for async components/builders. - For build methods
yielding a single child, simply remove thesync*modifier andreturnthat child intead. - For build methods
yielding multiple children, return aFragmentand provide the children as aList<Component>.
Reason for the Change
We noticed that in practice most components already only return/yield a single child component. For those components, changing to a single child build method is the natural choice.
Additionally, this change allows discontinuing the special
sync*/yieldsyntax used before and instead aligns more closely with Flutter's widget syntax. And while this syntax is not officially deprecated, it is not really recommended by the Dart team as it lacks certain performance optimizations (especially in the js compiler) and doesn't support newer language features (e.g. no null-aware yield).Lastly, changing to single-child components allowed for major simplifications and optimizations of the internal framework code of Jaspr, resulting in a less-complex, easier to maintain and more performant implementation.
Foundational Component Factories
New factory constructors on the core
Componentclass have been introduced and replace the separateDomComponent(),Text()andFragment()constructors:return DomComponent(tag: 'div', ...); // [!code --] return Component.element(tag: 'div', ...); // [!code ++] return Text("..."); // [!code --] return Component.text("..."); // [!code ++] return Fragment(children: [...]); // [!code --] return Component.fragment([...]); // [!code ++]The
DomComponent,TextandFragmentclasses still exist in the implementation, but cannot be created directly anymore.Additionally, a new
Component.empty()convenience constructor was added to create an empty fragment.<Info> The html utility methods (
div(),button()etc.) still exist and are still recommended over using theComponent.elementconstructor. Same goes for thetext()method and the newfragment()method for consistency, both of which are now also part of the 'prefer_html_methods' lint ofjaspr_lints. </Info>Migration
<Info> After upgrading Jaspr CLI to
0.21.0, you can use thejaspr migratecommand to automatically migrate your components to the new factory API.The automatic migration will be able to migrate 99% of your components. </Info>
In case you need or want to manually migrate single components to the new factory API, migrating is straightforward and in most cases trivial:
- Replace any
DomComponent()invocation withComponent.element(). - Replace any
Text()invocation withComponent.text(). - Replace any
Fragment()invocation withComponent.fragment()(orComponent.empty()if it is an empty fragment).
Reason for the Change
This change was made to improve the API in terms of consistency and discoverability.
It is also designed to work well with the new dot shorthand syntax introduced in Dart 3.10. This allows you to omit the type name (in this case
Component) when accessing a static member in a context where that type is expected (in this case e.g. a component's build method or children parameter).It also better encapsulates the concept that Jaspr has (different to Flutter) a fixed set of foundational component types (instead of allowing to write any number of custom render objects), and thus better aligns with the internal implementation.
In real-world use we don't expect this to make much of a difference, as most Jaspr code should use the HTML utility methods anyways.
New Migrate Command
The CLI will include a new
migratecommand meant for helping with the migration of breaking changes in new versions. This will not only be used for the Build Method Change and Component Factories Change of this release, but also for any future change that allows for automatic migration.Using the command is straightforward and follows the same style as the
dart fixcommand:- Running
jaspr migratewith no options will check only show which migrations are available for the currently used Jaspr version, e.g. Build Method Migration for version 0.21.0 and newer. - Running
jaspr migrate --dry-runwill compute and print all proposed migrations, but makes no changes to the code. - Running
jaspr migrate --applywill compute, print and apply all migrations.
<Image caption="Migrate options for version 0.21.0" src="/releases/assets/migrate_command.png"/>
Base Handling
The
baseparameter of theDocument()component can now be set tonull, which causes the<base>head element to not be rendered. Previously this defaulted to/even when explicitly set tonull. The default when not specifying the parameter is still/.When setting to
null, the script src path of the generated client script is now corrected and does not produce an error.There is no migration needed, as the behavior for normal usage is still the same.
New CSS Properties
The following CSS properties have been added to
Styles()andcss.styles():// For resetting default styles. All all // For box sizing and layout. AspectRatio aspectRatio Appearance appearance // For flexbox and grid layouts. JustifyItems justifyItems JustifySelf justifySelf AlignContent alignContent // For applying graphical effects like blur or color shift. Filter filter Filter backdropFilter-
JustifyItems,JustifySelfandAlignContentare enums with values likeJustifyItems.center,JustifySelf.startorAlignItems.spaceAround. -
Filterdefines several filter methods likeFilter.blur(8.px),Filter.hueRotate(90.deg),Filter.opacity(0.5)orFilter.none.
Release notes
Open source →Read the full Release Notes for this version.
-
Breaking Changed all
build()methods andbuilderfunctions to return a singleComponentinstead ofIterable<Component>. Usejaspr migrateto migrate automatically after updating. -
Breaking Introduced new
Component.element(),Component.text(),Component.fragment()andComponent.wrapElement()constructors, replacingDomComponent(),Text(),Fragment()andDomComponent.wrap(), respectively. Also addedComponent.empty()to create an empty fragment. -
Allow setting
Document(base: )tonull, and fix the path to the generated client script when no<base>element exists. -
Added
justifyItems,justifySelfandalignContentstyles properties. -
Added
filterandbackdropFilterstyles properties. -
Added
all,appearanceandaspectRatiostyles properties. -
Added
--include-source-mapsoption tojaspr buildcommand. -
Added
jaspr tooling-daemoncommand and component scope analysis. -
Fixed sitemap generation bug in top-level route ('/')
-
Require
sdk: ^3.8.0. -
Update
analyzerto^8.0.0andbuildto^4.0.0.
- Simplified Build Methods: All component
-
0.21.0-dev.103 Sep 2025 pre-releaseNothing published for this version
-
0.21.0-dev.002 Sep 2025 pre-releaseNothing published for this version
-
0.20.019 Jul 2025Release notes
Open source →-
Breaking: Removed the children parameter from
inputandcolmethods as they are void elements and shouldn't be passed children. -
Breaking: Replaced the children parameter from
scriptmethod with aString? contentparameter, as it can only contain text content. Also madesrcparameter optional. -
Breaking: Removed deprecated
Color.hexandColor.namedconstructors. -
Breaking: Removed deprecated style groups (
Styles.box(),Styles.text(),Styles.background(), etc. as well as.box(),.text(), etc.). -
Breaking: Removed deprecated
EdgeInsetstype. -
Breaking: Removed deprecated
Border.allconstructor. -
Added
withOpacity(),withLightness(),withHue()andwithValues()methods toColor. -
Added
figureandfigcaptionhtml methods. -
Added the
wbrhtml method for creating a line-break opportunity element. -
Moved
DomValidatorclass to foundation library. -
Added support for disabling the sitemap generation for specific pages of
jaspr_contentsites. -
Better error handling for async components.
-
Fixed an error where building too many routes in succession caused ports to be exhausted on macOS.
-
-
0.19.119 Jun 2025Release notes
Open source →-
Added
Color.currentColorconstant. -
Added
rxandryproperties for svgrect(). -
Added
prefersContrast: Contrast.<more|less|noPreference>toMediaQuery. -
Added
MediaQuery.raw()for creating a custom media query from aString. -
Fixed rendering bug when nesting components with empty children.
-
-
0.19.014 May 2025Release notes
Open source →-
BREAKING
JasprOptions.useIsolatesis nowfalseby default (wastrue).If you want to keep the old behaviour of rendering each request in a separate isolate, use
Jaspr.initializeApp(..., useIsolates: true). -
Added
allowedPathSuffixesoption toJaspr.initializeApp()to enable handling route paths with extensions other thanhtml. -
Added support for generating a sitemap.xml in static mode. To enable this, pass
--sitemap-domain=my.domain.comtojaspr build.Add sitemap params like
changefreqandpriorityto your routes by usingRoute(settings: RouteSettings(priority: 0.5))or set them throughServerApp.requestRouteGeneration().Exclude routes from the sitemap through the
--sitemap-excludeoption tojaspr build.Read more about Generating a Sitemap.
-
Added support
@clientcomponents from other packages.Components annotated with
@clientfrom other dependent packages are now also part of the js bundle when used during pre-rendering. -
BREAKING The
Flex(basis: ...)style now accepts aUnitvalue directly instead of aFlexBasis. -
Allow nesting
css.mediaandcss.supportsrules. -
Deprecated
Color.hex()andColor.named()in favor of the defaultColor()constructor. -
Added
onReassemblestream toServerApp. -
Various bug fixes.
-
-
0.18.206 Apr 2025Release notes
Open source →- Added
jaspr daemoncommand to run a daemon server (used by the new VSCode extension). - Added
--launch-in-chromeoption tojaspr servecommand to open the browser automatically. - Added support for running
jaspr create .in an empty directory.
- Added
-
0.18.131 Mar 2025Release notes
Open source →- Better report errors during static build.
- Fixed flutter embedding issue with version 3.29.0.
- Added
onClickoverride to theahtml tag. When used, this will override the default behaviour of the link and not visit its url when clicked. - Added
--extra-js-compiler-optionand--extra-wasm-compiler-optiontojaspr buildcommand. - Added
// dart format offand// ignore_for_file: type=lintheaders to all generated files.
-
0.18.024 Feb 2025Release notes
Open source →-
BREAKING Changed
AppBindingsUri get currentUritoString get currentUrl. -
BREAKING Changed return type of
renderComponent()fromFuture<String>toFuture<({int statusCode, String body, Map<String, List<String>> headers})>.The rendered html is accessible through the
bodyproperty.statusCodeandheaderscan be used to create a response object when part of a custom http handler. -
Added
context.urlextension getter on both client and server. -
Added
context.headers,context.headersAllandcontext.cookiesextension getters on the server. These can be used to access the headers and cookies of the currently handled request. -
Added
context.setHeader()andcontext.setCookie()andcontext.setStatusCode()extension on the server. These can be used to set headers, cookies and the status code of the response. -
Deprecated having seperate style groups (
Styles.box(),Styles.text(),Styles.background(), etc. as well as.box(),.text(), etc.). All styling properties are now available under the singleStyles()constructur and.styles()method.Before:
css('.main') .box(width: 100.px, height: 100.px) .text(align: TextAlign.center) .background(color: Colors.blue);After:
css('.main').styles( width: 100.px, height: 100.px, textAlign: TextAlign.center, backgroundColor: Colors.blue, ); -
Deprecated
EdgeInsetsin favor ofPaddingandMargintypes. -
BREAKING Moved
zIndexproperty out ofPositionand directly intoStyles. -
Added
userSelect,pointerEventsandcontentproperties toStyles. -
Added
Unit.maxContent,Unit.minContent,Unit.fitContentandUnit.expression().
-
-
0.17.110 Feb 2025 -
0.17.012 Jan 2025Release notes
Open source →-
BREAKING Removed
currentStatefromGlobalKey, useGlobalStateKeyinstead. -
Added
GlobalStateKey<T extends State>to access the state of a component usingcurrentState.// Use any State type as the type parameter. final GlobalStateKey<MyComponentState> myComponentKey = GlobalStateKey(); /* ... */ // Access the state from the key. MyComponentState? state = myComponentKey.currentState; -
Added
GlobalNodeKey<T extends Node>to access native dom nodes usingcurrentNode.import 'package:universal_web/web.dart'; // Use any Node type (from package:universal_web) as the type parameter. final GlobalNodeKey<HTMLFormElement> myFormKey = GlobalNodeKey(); /* ... */ // Access the dom node from the key. HTMLFormElement? node = myFormKey.currentNode; -
Migrated all web imports from
package:webtopackage:universal_web. -
Added
prefersColorSchemeparameter toMediaQuery.
-
-
0.16.403 Jan 2025Release notes
Open source →- Added
--dart-define,--dart-define-clientand--dart-define-servertoserveandbuildcommands. - Fixed attribute validation to support attribute names including
@and:.
- Added
-
0.16.330 Dec 2024Release notes
Open source →- Added
tableand related html methods. - Added
valueparameter toselect()method. - Add 'standalone' option to
renderComponentmethod.
- Added
-
0.16.223 Nov 2024 -
0.16.120 Oct 2024Release notes
Open source →- Fixed flutter embedding in new project scaffold.
- Fixed flutter embedding on mobile to always use canvaskit renderer.
- Fixed build command on windows to correctly end child process.
-
0.16.004 Oct 2024Release notes
Open source →-
BREAKING Migrated all packages to
package:web, replacingdart:html. -
BREAKING Made
ComponentsBinding.attachRootComponent()andComponentTester.pumpComponent()synchronous. -
Added
InheritedModel<T>similar to Flutters InheritedModel -
Added
css.layer(),css.supports()andcss.keyframes()rules. -
Added
ViewTransitionMixinto use view transitions in aStatefulComponent. -
Improved html formatting on the server to not introduce unwanted whitespaces.
-
Fixed server issue during tests where the web directory would never resolve.
-
Fixed issue with unhandled parameter types of client components.
-
-
0.15.112 Sep 2024Release notes
Open source →- Include and setup
jaspr_lintsin newly created projects. - Added
jaspr analyzecommand to check all custom lints. - Added css variable support with
Unit.variable(),Color.variable(),Angle.variable()andFontFamily.variable().
- Include and setup
-
0.15.021 Aug 2024Release notes
Open source →-
Added support for using
@cssand@encoder/@decoderacross other packages.- Styles annotated with
@cssfrom other dependent packages are now also included in the pre-rendered css. - Models (or extension types) that define
@encoderand@decoderannotations from other dependent packages can now also be used together with@clientcomponents and@syncfields.
- Styles annotated with
-
BREAKING Component (or any class member) styles annotated with
@cssare now only included in the pre-rendered css if the file they are defined in is actually imported somewhere in the project.Top-level styles continue to be always included.
-
Fixed issue with wrongly generated imports of
@encoder/@decodermethods. -
Fixed spelling mistake from
spaceRvenlytospaceEvenly -
Added default
BorderStyle.solidtoBorderSideconstructor.
-
-
0.14.014 Aug 2024Release notes
Open source →-
BREAKING Calling
Jaspr.initializeApp()is now required in static and server mode. -
BREAKING Removed
Headcomponent in favor of newDocument.head()component.Document.head()has the same parameters as the oldHeadcomponent and renders its children inside the<head>element. -
Added
Document.html()andDocument.body()to modify the attributes of<html>and<body>. -
BREAKING Removed
syncIdandsyncCodecparameters fromSyncStateMixin.SyncStateMixinnow embeds its data locally in the pre-rendered html using standard json encoding. -
Added
@syncannotation. Can be used on any field of aStatefulComponentto automatically sync its value.class MyComponentState extends State<MyComponent> with MyComponentStateSyncMixin { @sync String myValue; } -
BREAKING Removed
MediaRuleQueryin favor ofMediaQuery. -
Added
css.import(),css.fontFace()andcss.media()shorthands. -
Added
@cssannotation. Can be used on a list of style rules to automatically include them in the global styles.@css final styles = [ css('.main').box(width: 100.px), ]; -
Added
Fragmentcomponent. -
Fixed missing html unescape in hydrated data.
-
-
0.13.302 Jul 2024Release notes
Open source →-
Added support for custom models as parameters to
@clientcomponents.To enable this a custom model class must have two methods:
-
An instance method that encodes the model to a primitive value and is annotated with
@encoder:@encoder String toJson() { ... } -
A static method that decodes the model from a primitive value and is annotated with
@decoder:@decoder static MyModel fromJson(String json) { ... }
The method names can be freely chosen. The encoding type must be any primitive type (
String,int,List,Map, etc.). -
-
Added
ListenableBuilderandValueListenableBuildercomponents. -
Added
Styles.listfor stylingulandolelements. -
Added
TextDecoration.noneshorthand.
-
-
0.13.214 Jun 2024Release notes
Open source →- Improved the performance of the building and diffing algorithm, and other performance improvements.
- Added
StatelessComponent.shouldRebuildandState.shouldRebuildfor possible skipping rebuilds as a performance improvement.
-
0.13.124 May 2024Release notes
Open source →- Fixed namespace handling for nested svg elements.
- Fixed global key conflicts during server-side rendering by disabling them on the server.
- Change
testComponents(isClient: _)default to true.
-
0.13.022 May 2024Release notes
Open source →-
Added
Headcomponent to render metadata inside the documents<head>.You can specify a title, metadata or custom children:
Head( title: 'My Title', meta: { 'description': 'My Page Description', 'custom': 'my-custom-metadata', }, children: [ link(rel: "canonical" href: "https://mysite.com/example"), ], )Deeper or latter
Headcomponents will override duplicate elements:Parent(children: [ Head( title: "My Title", meta: {"description": "My Page Description"} ), Child(children: [ Head( title: "Nested Title" ), ]), ]),will render:
<head> <title>Nested Title</title> <meta name="description" content="My Page Description" /> </head> -
Added
AsyncStatelessComponentandAsyncBuilder. These are special components that are only available on the server (usingpackage:jaspr/server.dart) and have an asynchronous build function. -
Improved internal framework implementation of different element types.
- Added
BuildableElementandProxyElementas replacement forMultiChildElementandSingleChildElement. - Added
Element.didMount()andElement.didUpdate()lifecycle methods.
- Added
-
Fixed race condition where routes were skipped during static rendering.
-
Fixed infinite loading bug for async server builds.
-
Fixed hydration bug with empty or nested client components.
-
Added documentation comments.
-
-
0.12.014 Apr 2024Release notes
Open source →-
BREAKING Removed
Document.file(), instead use newDocument.template(). -
Added
Document.template()for loading template html files.Files that should be used with
Document.template()must have the.template.htmlextension to differentiate between normal.htmlfiles that are served as-is. Thenameparameter provided toDocument.template()must be the simple name of the file without extension, e.g.Document.template(name: 'index')loads theweb/index.template.htmlfile. -
Added the
langattribute toDocument()constructor. -
Added
<main>asmain_()to the standard html components. -
Fixed bug with
PreloadStateMixinand improved async server builds. -
Fixed crash with server hot-reload.
-
Improved the shelf backend template for proper handling of server hot-reload.
-
Fixed
DomValidatorto allow attributes with..
-
-
0.11.104 Apr 2024 -
0.11.004 Apr 2024Release notes
Open source →-
BREAKING Changed jaspr configuration to require
jaspr.modeinpubspec.yaml:The
jaspr.modeoption now sets the rendering mode and must be one of:- static: For building a statically pre-rendered site (SSG) with optional client-side hydration.
- server: For building a server-rendered site (SSR) with optional client-side hydration.
- client: For building a purely client-rendered site (SPA).
This replaces the old
jaspr.uses-ssroption. -
BREAKING Removed
jaspr generatecommand in favor using thejaspr buildcommand in combination with the newjaspr.mode = staticoption inpubspec.yaml. -
BREAKING Removed the
runServer()method along with its support for adding middleware and listeners. Users should instead migrate to the custom backend setup usingpackage:shelf. -
BREAKING Removed
rawHtmlflag fromTextcomponent andtext()method, in favor of newRawTextcomponent andraw()method respectively, which fixes multiple bugs with the old implementation. -
Improved the
jaspr createcommand by changing to a scaffolding system as replacement for templates. You will now be walked through a configuration wizard that creates a starting project based on the selected options. -
Removed
jaspr.uses-flutteroption. This is now auto-detected based on the dependencies. -
Styles can now be written more concise using the ability to chain style groups as well as the new
css()method. -
Changes made to
main.dartare now also hot-reloaded on the server. -
Documentis no longer required when using server-side rendering. A basic document structure (<html><head>...<body>...) is automatically filled in. -
Improved how
@clientcomponents are hydrated. -
The
jaspr buildcommand now accepts an optimization option. Minification (-O 2) enabled by default. -
Fixed
DomValidatorto allow special attributes with uppercase letters and colons. -
Exceptions thrown during
renderHtmlare now correctly passed through to the spawning isolate.
-
-
0.10.022 Jan 2024Release notes
Open source →-
BREAKING Restructured core libraries:
- Removed
package:jaspr/html.dart-> Usepackage:jaspr/jaspr.dartinstead. - Renamed
package:jaspr/components.darttopackage:jaspr/ui.dart.
- Removed
-
BREAKING Updated
@clientcomponents for a more streamlined usage.Annotated components no longer generate a
.g.dartfile and don't need to implement any generated mixin anymore. Instead, a singlelib/jaspr_options.dartfile is generated when using@clientcomponents.You must now call
Jaspr.initializeApp(options: defaultJasprOptions)at the start of your app, wheredefaultJasprOptionsis part of the newly generatedjaspr_options.dartfile.Note: Calling
Jaspr.initializeApp()will be required in a future version of Jaspr, and the cli will warn you when it's not called. -
BREAKING Changed type of the
classesproperty of html components fromList<String>toString. Multiple class names can be set using a single space-delimited string, e.g.classes: 'class1 class2'. -
BREAKING Event callbacks are now typed. The
eventsproperty of html components now expects aMap<String, void Function(Event)>instead of the oldMap<String, void Function(dynamic)>.In addition to this Jaspr comes with a new
events()function to provide typed event handlers for common events, likeonClick,onInputandonChange. Use it like this:anyelement( // Uses the [events] method to provide typed event handlers. events: events( onClick: () { print("Clicked"); }, // [value] can be typed depending on the element, e.g. `String` for text inputs or `bool` for checkboxes. onInput: (String value) { print("Value: $value"); }, ), [...] )Moreover, the html components
button,input,textareaandselectnow also come with additional shorthand properties for their supported event handlers:button( onClick: () { print("Clicked"); }, [...] ) -
BREAKING Refactored components inside the
package:jaspr/ui.dartlibrary. Some component properties have changed or been discontinued. Check the separate components for details. -
BREAKING Promoted
jaspr_web_compilersto non-experimental status.This also changes the respective cli option from
jaspr create --experimental-web-compilers(old) tojaspr create --jaspr-web-compilers(new). -
Added support for rendering
svgelements. Also addedsvg(),rect(),circle(),ellipse(),line(),path()andpolygon()components. -
Refactored rendering implementation to use
RenderObjects. -
Added
NotificationListenercomponent. -
Added
Colors.transparent. -
Added
Unit.auto,Unit.vw()andUnit.vh()for responsive styling. -
Added
StyleRule.fontFace()to add external font files. -
Several bug fixes and stability improvements when running
jaspr serveorjaspr build.
-
-
0.9.309 Nov 2023Release notes
Open source →- Fixed
melos formaton Windows. - Fixed infinite loop attempting to find root directory on Windows when running a built Jaspr executable.
- Add
.exeextension to the output ofjaspr buildon Windows.
- Fixed
-
0.9.217 Oct 2023 -
0.9.109 Oct 2023Release notes
Open source →-
Improved the stability and logging of the cli and added the commands:
cleancommand to clean your project directoryupdatecommand to automatically update the cli to the latest versiondoctorcommand to print information about the environment and project
-
We added lightweight anonymous usage tracking to the cli. We use mixpanel.com and only process anonymized data. The usage statistics are made public and can be viewed here (TODO: Link will be added in next release).
To opt out of usage tracking, use
jaspr --disable-analytics.
-
-
0.9.010 Sep 2023Release notes
Open source →-
Added Static Site Generation support.
With the new
jaspr generatecommand you can generate static pages from your Jaspr app. This requires a normal server-rendered Jaspr app and will output separate.htmlpages for each of your routes.To specify which routes your application should handle, either use
jaspr_routeror callServerApp.requestRouteGeneration('/my/route');for each target route.
-
-
0.8.229 Aug 2023 -
0.8.124 Aug 2023 -
0.8.010 Aug 2023Release notes
Open source →-
Added
StyleRule.media({MediaRuleQuery query, List<StyleRule> styles})to support@mediacss statements. -
Added support for Tailwind using the
jaspr_tailwindintegration.
Simply rundart pub add jaspr_tailwind --devand start using tailwind classes in your Jaspr components.
For a full setup and usage guide see Tailwind Integration Docs
-
-
0.7.008 Aug 2023Release notes
Open source →-
Improved cli experience with better logging and progress indicators.
-
Removed
--ssrand--fluttercli options. -
Added support
jasprconfig section inpubspec.yaml.It is now possible to define certain configuration options for the Jaspr cli directly inside the
pubspec.yamlfile under thejasprsection. Initially supported options are:jaspr: uses-ssr: true # or false; Toggles server-side-rendering on or off. uses-flutter: true # or false; Whether the project uses flutter element embedding.
-
-
0.6.202 Aug 2023Release notes
Open source →- Added integrated support for seamless flutter element embedding. Refer to Flutter Embedding Docs on how to setup and use this.
-
0.6.101 Aug 2023Release notes
Open source →-
Fixed bug with
jaspr create. -
Added prompts when running
jaspr createwithout any arguments. This way the developer is guided through the creation process more dynamically.
-
-
0.6.025 Jul 2023Release notes
Open source →-
Added support for flutter web plugins.
Jaspr apps can now depend-on and import flutter plugins that work on web. This is achieved by using a modified compiler toolchain:
jaspr_web_compilers.To enable support for flutter plugins simply exchange your
build_web_compilersdependency forjaspr_web_compilers:dev_dependencies: jaspr_web_compilers: ^4.0.4For an example see
examples/flutter_plugin_interop. -
Improved flutter element embedding.
Flutter apps can now be directly embedded from your Jaspr codebase and integrated into the existing Jaspr component tree.
This removes the need for any kind of interop between apps as they can directly communicate through the usual primitives of passing properties and callbacks.
For an example see
examples/flutter_embedding. -
jaspr buildnow outputs to/build/jasprinstead of/build.
-