Skip to content

v0.22.0

Latest

Choose a tag to compare

@schultek schultek released this 10 Dec 14:35
· 4 commits to main since this release

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) containing defaultServerOptions.

    • Jaspr.initializeApp() now requires the package:jaspr/server.dart import.

    • 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) containing defaultClientOptions.

    • Added a new ClientApp component 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.dart library to package:jaspr/client.dart, as well as:

    • Renamed BrowserAppBinding class to ClientAppBinding.
    • Renamed package:jaspr_test/browser_test.dart library to package:jaspr_test/client_test.dart.
    • Renamed testBrowser() class to testClient().
  • Breaking Moved all html components, style classes and dom utilities including div() et al., Styles, css, Color et al., events(), RawText, and ViewTransitionMixin to a separate package:jaspr/dom.dart library.

    This reduces the "pollution" of the global namespace when importing package:jaspr/jaspr.dart and 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 as Component child = div([]);) when assigning other values (such as child = span([]);).

  • Deprecated text(), fragment() and raw() functions in favor of Component.text(), Component.fragment() and RawText, 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, and dd html components to package:jaspr/dom.dart.

  • Breaking Removed deprecated package:jaspr/ui.dart library.

  • Breaking Removed support for jaspr.dev-command option in pubspec.yaml.

  • Added support for jaspr.port option in pubspec.yaml to specify the default port used by jaspr serve.
    This can still be overridden using the --port flag. If neither is set, the default port stays 8080.

  • Added support for jaspr.flutter option in pubspec.yaml to specify either support for Flutter embedding with 'embedded' or support for Flutter plugins with 'plugins'.

    This replaces the dependency on jaspr_web_compilers package, which is now discontinued. Instead, make sure to depend on build_web_compilers with a minimum version constraint of 4.4.6 or higher.

  • Breaking: Removed jaspr analyze command, as the latest version of jaspr_lints can now be used directly with dart analyze.

  • Breaking: ResponseLike.body (returned from renderComponent()) is now a Uint8List instead of String.

  • Allow binary responses in AppContext.setStatusCode.

  • Global @css styles 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 both onInput and onChange events.

  • Added Animation, Quotes CSS properties.

  • Added Curve.linearFn() easing function.

  • Added Gap.row() and Gap.column() constructors.

  • Added Flex.grow(), Flex.shrink() and Flex.basis() constructors.

  • Added Border.all() constructor and deprecate the unnamed Border constructor.

  • Breaking: Transition's duration and delay are now of type Duration instead of double.

  • Added ms and seconds extensions to int for simple conversion to Duration.

  • Breaking: Changed FontStyle.obliqueAngle to accept Angle instead of double.

  • Added initial, inherit, revert, revertLayer and unset to Transition, TextShadow and BoxShadow.

  • Allow nesting non-empty Filter.list inside each other.

jaspr_lints 0.6.0

  • Breaking Removed custom_lint dependency and migrated to new analysis_server_plugin.
    Changes in analysis_options.yaml are needed, see Using plugins.