jaspr_test 0.14.0
jaspr_test: ^0.14.0 copied to clipboard
Testing utilities for jaspr.
0.14.0 #
-
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.3 #
-
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.). - An instance method that encodes the model to a primitive value and is annotated with
-
Added
ListenableBuilderandValueListenableBuildercomponents. -
Added
Styles.listfor stylingulandolelements. -
Added
TextDecoration.noneshorthand.
0.13.2 #
- 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.1 #
- 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.0 #
-
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.0 #
-
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.1 #
- Fixed bug with base paths.
0.11.0 #
-
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.0 #
-
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.3 #
- 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.
0.9.2 #
- Fixed cli execution on windows.
0.9.1 #
-
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.0 #
-
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.2 #
- Fixed client template to set
uses-ssr: falsecorrectly.
0.8.1 #
- Fixed bug with rebuilding the root component.
0.8.0 #
-
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.0 #
-
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.2 #
- Added integrated support for seamless flutter element embedding. Refer to Flutter Embedding Docs on how to setup and use this.
0.6.1 #
-
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.0 #
-
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](https://github.com/schultek/Jaspr/tree/main/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](https://github.com/schultek/jaspr/tree/main/examples/flutter_embedding). -
jaspr buildnow outputs to/build/jasprinstead of/build.
0.5.0 #
-
BREAKING Added
@clientas replacement for both@appand@island.Components annotated with
@clientact as entry points for the client application and are automatically detected, compiled and shipped to the client when using theDocument()component.This combines the behaviour of the now removed
@appand@islandannotations, as well as the removedDocument.app()andDocument.islands()constructors. Use the defaultDocument()constructor instead. -
BREAKING Removed
DeferRenderMixinas async first builds are no longer permitted on clients. -
Added support for Flutter element embedding.
Flutter apps can now easily be embedded within Jaspr sites. The cli supports the
--flutterargument for both theserveandbuildcommands to specify the entrypoint of the flutter application.The complete setup is demonstrated in the flutter_embedding example.
-
Fixed handling of initial uri.
-
Added
SynchronousFuture.
0.4.0 #
-
BREAKING Bindings are no longer singletons.
ComponentsBinding.instance,SchedulerBinding.instanceetc. were removed.- You can access the current binding through
BuildContextscontext.bindingproperty.
-
BREAKING Removed
ComponentTester.setUp(),BrowserTester.setUp()andServerTester.setUp().- Use
testComponents(),testBrowser()andtestServer()instead.
- Use
-
Requires Dart 3.0 or later.
0.3.0 #
- BREAKING The cli is now a separate package:
jaspr_cli. To migrate run:
The usage stays the same withdart pub global deactivate jaspr dart pub global activate jaspr_clijaspr create,jaspr serveandjaspr build.
0.2.0 #
BREAKING: This is the first major release after the initial publish and contains several breaking changes.
- Update to Dart 2.17
- Rewrite of the rendering system that comes with a lot of improvements in stability and performance.
- Added support for custom backend & server setup.
- Added support for multiple apps on the client as well as island components.
- Added html utility components for common elements.
- Added
Stylesclass for writing typed css in dart. - Various other improvements throughout the framework.
0.1.0 #
- Initial version