Version 0.22.0 is all about reducing magic in the framework and making it more expressive and modular.
Read the full Release Notes for this version here.
jaspr, jaspr_builder, jaspr_cli, jaspr_test 0.22.0
-
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.
jaspr_lints 0.6.0
- Breaking Removed
custom_lintdependency and migrated to newanalysis_server_plugin.
Changes inanalysis_options.yamlare needed, see Using plugins.