Skip to content

Releases: schultek/jaspr

v0.16.0

04 Oct 17:45
Compare
Choose a tag to compare

package:web | Flutter multi-view | WASM

This release combines three amazing new features:

  1. Migration of all packages to package:web and the new js interop mechanism, replacing dart:html.
  2. Adding support for Flutter multi-view embedding.
  3. 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, replacing dart:html.

  • BREAKING Made ComponentsBinding.attachRootComponent() and ComponentTester.pumpComponent() synchronous.

  • Added InheritedModel<T> similar to Flutters InheritedModel

  • Added css.layer(), css.supports() and css.keyframes() rules.

  • Added ViewTransitionMixin to use view transitions in a StatefulComponent.

  • Added new --experimental-wasm flag to jaspr serve and jaspr 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 to 2.1.1

v0.15.1

14 Sep 09:12
Compare
Choose a tag to compare

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() and FontFamily.variable().

v0.15.0

21 Aug 08:38
Compare
Choose a tag to compare

Changelog

  • Added support for using @css and @encoder/@decoder across other packages.

    1. Styles annotated with @css from other dependent packages are now also included in the pre-rendered css.
    2. 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.
  • 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 to spaceEvenly

  • Added default BorderStyle.solid to BorderSide constructor.

v0.14.0

14 Aug 17:18
Compare
Choose a tag to compare

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 new Document.head() component.
    Document.head() has the same parameters as the old Head component and renders its children inside
    the <head> element.

  • Added Document.html() and Document.body() to modify the attributes of <html> and <body>.

  • BREAKING Removed syncId and syncCodec parameters from SyncStateMixin.
    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 a StatefulComponent to automatically sync its value.

    class MyComponentState extends State<MyComponent> with MyComponentStateSyncMixin {
      @sync
      String myValue;
    }
  • BREAKING Removed MediaRuleQuery in favor of MediaQuery.

  • Added css.import(), css.fontFace() and css.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

22 May 08:18
Compare
Choose a tag to compare

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 and AsyncBuilder.
    These are special components that are only available on the server (using package:jaspr/server.dart) and have an
    asynchronous build function.

  • Improved internal framework implementation of different element types.

    • Added BuildableElement and ProxyElement as replacement for MultiChildElement and SingleChildElement.
    • Added Element.didMount() and Element.didUpdate() lifecycle methods.
  • 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

04 Apr 13:32
Compare
Choose a tag to compare

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 in pubspec.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 the jaspr build command in combination with
    the new jaspr.mode = static option in pubspec.yaml.

  • BREAKING Removed the runServer() method along with its support for adding middleware and listeners. Users should instead
    migrate to the custom backend setup using package:shelf.

  • BREAKING Removed rawHtml flag from Text component and text() method, in favor of
    new RawText component and raw() 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 no Router component is present in the tree. It will render
    an accessible <a> element with a valid href, which means that things like right-clicking a Link work as you'd expect.

  • Fixed redirects on initial load.

  • Fixed proper handling of <base> path.

v0.10.0

22 Jan 14:31
Compare
Choose a tag to compare

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 -> Use package:jaspr/jaspr.dart instead.
    • Renamed package:jaspr/components.dart to package:jaspr/ui.dart.
  • 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 single lib/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 generated jaspr_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 from List<String> to String. 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 old Map<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 and onChange. 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 and select 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 added svg(), rect(), circle(), ellipse(), line(), path() and polygon() components.

  • Refactored rendering implementation to use RenderObjects.

  • Added NotificationListener component.

  • Added Colors.transparent.

  • Added Unit.auto, Unit.vw() and Unit.vh() for responsive styling.

  • Added StyleRule.fontFace() to add external font files.

  • Several bug fixes and stability improvements when running jaspr serve or jaspr build.

v0.9.1

09 Oct 08:29
Compare
Choose a tag to compare

CLI Update

  • Improved the stability and logging of the cli, mainly for jaspr serve.

  • Added three commands:

    • clean command to clean your project directory
    • update command to automatically update the cli to the latest version
    • doctor 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

10 Sep 21:29
Compare
Choose a tag to compare

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

10 Aug 18:49
Compare
Choose a tag to compare

New package

Changelog

  • Added StyleRule.media({MediaRuleQuery query, List<StyleRule> styles}) to support @media css statements.

  • Added support for Tailwind using the jaspr_tailwind integration.
    Simply run dart 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.