Releases: schultek/jaspr
v0.16.0
package:web | Flutter multi-view | WASM
This release combines three amazing new features:
- Migration of all packages to
package:web
and the new js interop mechanism, replacingdart:html
. - Adding support for Flutter multi-view embedding.
- Added experimental support for compiling to WASM.
... along with a bulk of smaller features, improvements and bugfixes.
We also published a new demo site showcasing the multi-view embedding here: https://jaspr-flutter-multiview-demo.web.app/
Changelogs
jaspr, jaspr_cli, jaspr_test
-
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
ViewTransitionMixin
to use view transitions in aStatefulComponent
. -
Added new
--experimental-wasm
flag tojaspr serve
andjaspr build
. -
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.
jaspr_flutter_embed
-
BREAKING Migrated to
package:web
. -
BREAKING Added support for multi-view embedding. This allows you to use
FlutterEmbedView
multiple times across
the website and add or remove views at any time. -
Improved internals to use deferred imports for all imported flutter libraries.
-
Added
FlutterEmbedView.preload()
function to manually trigger the preload of all deferred libraries before rendering
a Flutter view. -
Added
FlutterEmbedView.deferred()
constructor as an easy way to work with deferred imports of widgets. -
Updated sdk constraints of flutter to
>=3.24.0 <4.0.0
and dart to>=3.5.0 <4.0.0
.
jaspr_serverpod
- Bump
serverpod
to2.1.1
v0.15.1
New linting package
jaspr_lints
is a collection of lints and assists for jaspr projects.
See Linting for documentation.
Changelog
- Include and setup
jaspr_lints
in newly created projects. - Added
jaspr analyze
command to check all custom lints. - Added css variable support with
Unit.variable()
,Color.variable()
,Angle.variable()
andFontFamily.variable()
.
v0.15.0
Changelog
-
Added support for using
@css
and@encoder
/@decoder
across other packages.- Styles annotated with
@css
from other dependent packages are now also included in the pre-rendered css. - Models (or extension types) that define
@encoder
and@decoder
annotations from other dependent packages can
now also be used together with@client
components and@sync
fields.
- Styles annotated with
-
BREAKING Component (or any class member) styles annotated with
@css
are 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
/@decoder
methods. -
Fixed spelling mistake from
spaceRvenly
tospaceEvenly
-
Added default
BorderStyle.solid
toBorderSide
constructor.
v0.14.0
Major documentation overhaul
This version comes together with a huge documentation overhaul over at https://docs.page/schultek/jaspr
A lot of new pages, guides, component docs and more were added to the documentation.
- Complete "Get Started" guide with detailed explanation of the different rendering modes, a page about hydration and more.
- New guides about the most important concepts and topics:
- Styling
- Routing
- Data Fetching
- SEO
- Deployment
- Separate documentation pages for all core components, like
Document
,AsyncBuilder
,Router
,FlutterEmbedView
and more - Separate documentation pages for all core utilities, like
@client
,css()
,@sync
,SyncStateMixin
,@Import
and more
Additionally the starter template, examples and packages got a lot of improved code documentation.
Changelogs
jaspr, jaspr_builder
-
BREAKING Calling
Jaspr.initializeApp()
is now required in static and server mode. -
BREAKING Removed
Head
component in favor of newDocument.head()
component.
Document.head()
has the same parameters as the oldHead
component and renders its children inside
the<head>
element. -
Added
Document.html()
andDocument.body()
to modify the attributes of<html>
and<body>
. -
BREAKING Removed
syncId
andsyncCodec
parameters fromSyncStateMixin
.
SyncStateMixin
now embeds its data locally in the pre-rendered html using standard json encoding. -
Added
@sync
annotation. Can be used on any field of aStatefulComponent
to automatically sync its value.class MyComponentState extends State<MyComponent> with MyComponentStateSyncMixin { @sync String myValue; }
-
BREAKING Removed
MediaRuleQuery
in favor ofMediaQuery
. -
Added
css.import()
,css.fontFace()
andcss.media()
shorthands. -
Added
@css
annotation. 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
Fragment
component. -
Fixed missing html unescape in hydrated data.
jaspr_router
- Changed the signature of the
Link
component,children
is now a named parameter.
jaspr_tailwind
- Added minify option to tailwind in release mode.
- Made the content section of the
tailwind.config.js
file active at build time.
v0.13.0
Changelog (jaspr)
-
Added
Head
component 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
Head
components 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
AsyncStatelessComponent
andAsyncBuilder
.
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
BuildableElement
andProxyElement
as replacement forMultiChildElement
andSingleChildElement
. - 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.
Changelog (jaspr_router)
- The title of the browser tab will no be properly set to the
title
of the current route. - Fixed race condition where routes were skipped during static rendering.
v0.11.0
The cli scaffolding update
This update ships a completely new way of creating jaspr projects using the jaspr create
command. Instead of using fixed templates, you will now be asked a series of questions to fully customize your starting project to your needs.
Changelog (jaspr, jaspr_cli)
-
BREAKING Changed jaspr configuration to require
jaspr.mode
inpubspec.yaml
:The
jaspr.mode
option 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-ssr
option. -
BREAKING Removed
jaspr generate
command in favor using thejaspr build
command in combination with
the newjaspr.mode = static
option 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
rawHtml
flag fromText
component andtext()
method, in favor of
newRawText
component andraw()
method respectively, which fixes multiple bugs with the old implementation. -
Improved the
jaspr create
command 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-flutter
option. 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.dart
are now also hot-reloaded on the server. -
Document
is no longer required when using server-side rendering. A basic document structure (<html><head>...<body>...
)
is automatically filled in. -
Improved how
@client
components are hydrated. -
The
jaspr build
command now accepts an optimization option. Minification (-O 2
) enabled by default. -
Fixed
DomValidator
to allow special attributes with uppercase letters and colons. -
Exceptions thrown during
renderHtml
are now correctly passed through to the spawning isolate.
Changelog (jaspr_router)
-
Added
Link
component to simplify router-aware navigation.The
Link
component lets the user navigate to another route by clicking or tapping on it. It uses client-side routing
if possible and fall back to the default browser navigation if noRouter
component is present in the tree. It will render
an accessible<a>
element with a validhref
, which means that things like right-clicking aLink
work as you'd expect. -
Fixed redirects on initial load.
-
Fixed proper handling of
<base>
path.
v0.10.0
The developer ergonomics update
This update combines a bunch of changes (some breaking) to improve the experience about writing websites with Jaspr. You can now write a lot more concise and compact markup using Jaspr, which drastically reduces the needed lines-of-code and produces a lot more readable code.
Changelog
-
BREAKING Restructured core libraries:
- Removed
package:jaspr/html.dart
-> Usepackage:jaspr/jaspr.dart
instead. - Renamed
package:jaspr/components.dart
topackage:jaspr/ui.dart
.
- Removed
-
BREAKING Updated
@client
components for a more streamlined usage.Annotated components no longer generate a
.g.dart
file and don't need to implement any generated mixin anymore.
Instead, a singlelib/jaspr_options.dart
file is generated when using@client
components.You must now call
Jaspr.initializeApp(options: defaultJasprOptions)
at the start of your app, where
defaultJasprOptions
is part of the newly generatedjaspr_options.dart
file.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
classes
property 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
events
property of html components now expects a
Map<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, like
onClick
,onInput
andonChange
. 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
,textarea
andselect
now also come with additional shorthand
properties for their supported event handlers:button( onClick: () { print("Clicked"); }, [...] )
-
BREAKING Refactored components inside the
package:jaspr/ui.dart
library. Some component properties have
changed or been discontinued. Check the separate components for details. -
BREAKING Promoted
jaspr_web_compilers
to non-experimental status.This also changes the respective cli option from
jaspr create --experimental-web-compilers
(old) to
jaspr create --jaspr-web-compilers
(new). -
Added support for rendering
svg
elements.
Also addedsvg()
,rect()
,circle()
,ellipse()
,line()
,path()
andpolygon()
components. -
Refactored rendering implementation to use
RenderObject
s. -
Added
NotificationListener
component. -
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 serve
orjaspr build
.
v0.9.1
CLI Update
-
Improved the stability and logging of the cli, mainly for
jaspr serve
. -
Added three commands:
clean
command to clean your project directoryupdate
command to automatically update the cli to the latest versiondoctor
command to print information about the environment and project
-
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
.
v0.9.0
Static Site Generation Release 🎉
This release adds support for static site generation in Jaspr.
The docs are updated to introduce this feature here and here
Changelog
jaspr @ 0.9.0
-
Added Static Site Generation support.
With the new
jaspr generate
command you can generate static pages from your jaspr app. This requires a normal
server-rendered jaspr app and will output separate.html
pages for each of your routes.To specify which routes your application should handle, either use
jaspr_router
or call
ServerApp.requestRouteGeneration('/my/route');
for each target route.
jaspr_router @ 0.3.0
-
Added Static Site Generation support. Pages are automatically generated for each route.
-
Fixed bug where
Router.of(context).matchList.title
always returned null.
v0.8.0
New package
-
Added
jaspr_tailwind
package for integrating tailwind with jaspr. -
Documented setup and usage at https://docs.page/schultek/jaspr/eco/tailwind
Changelog
-
Added
StyleRule.media({MediaRuleQuery query, List<StyleRule> styles})
to support@media
css statements. -
Added support for Tailwind using the
jaspr_tailwind
integration.
Simply rundart pub add jaspr_tailwind --dev
and start using tailwind classes in your jaspr components.
For a full setup and usage guide see Tailwind Integration Docs.