Skip to content

Releases: schultek/jaspr

v0.23.0

Choose a tag to compare

@schultek schultek released this 17 Apr 15:48

Version 0.23.0 adds Agent Skills, CLI Improvements, Standalone CSS and Unsafe Import Analysis.

Read the full release notes here.


jaspr, jaspr_cli

  • Added Agent Skills for Jaspr, which can be installed with jaspr install-skills.

  • Multiple improvements to the Jaspr CLI:

    • Jaspr can now be installed with dart install jaspr_cli instead of dart pub global activate jaspr_cli.
    • Added jaspr convert-html command to automatically convert raw HTML to Jaspr code.
    • Breaking Removed jaspr tooling-daemon command. The functionality is now provided by the jaspr_lints package.
    • Improved logging and overall stability.
  • Added jaspr: styles: standalone option to pubspec.yaml.

    • When enabled, all @css declarations are rendered to a standalone .css file instead of being inlined in the pre-rendered HTML.
    • @css is now also allowed in client mode projects, where standalone mode is enabled by default.

jaspr_lints 0.7.0

  • Added unsafe_imports lint rule to detect unsafe platform-specific imports in components depending on where they are rendered (server or client).
  • Component scopes are now calculated by this package, instead of the jaspr tooling-daemon command.

v0.22.0

Choose a tag to compare

@schultek schultek released this 10 Dec 14:35

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.

v0.21.7

Choose a tag to compare

@schultek schultek released this 13 Nov 16:12

Various bug fixes across packages.

jaspr, jaspr_builder 0.21.7

  • @Import now supports defining extensions and properly checks elements inside the show parameter.
  • Fixed bug when using SyncStateMixin or @sync on a @client component.
  • Fixed bug with checked and indeterminate attributes not rendering correctly on input elements.
  • Fixed allowing children for path tag by removing it from the list of self-closing tags.
  • Deprecate the package:jaspr/ui.dart library that provides legacy utility components.
    For accessing Jaspr APIs, import package:jaspr/jaspr.dart instead.
    For the utility components, build your own or use a component library.

jaspr_content 0.4.4

  • Adjust styling of DocsLayout to be more responsive on large screens.

jaspr_router 0.8.0

  • Using a redirect function on Router or Route while rendering on the server will now trigger a HTTP redirect (302) instead of rendering the target page.

v0.21.0

Choose a tag to compare

@schultek schultek released this 13 Sep 14:34

Read the full Release Notes for this version here.

jaspr, jaspr_builder, jaspr_cli, jaspr_test 0.21.0

  • Breaking Changed all build() methods and builder functions to return a single Component instead of Iterable<Component>. Use jaspr migrate to migrate automatically after updating.

  • Breaking Introduced new Component.element(), Component.text(), Component.fragment() and Component.wrapElement() constructors, replacing DomComponent(), Text(), Fragment() and DomComponent.wrap(), respectively. Also added Component.empty() to create an empty fragment.

  • Allow setting Document(base: ) to null, and fix the path to the generated client script when no <base> element exists.

  • Added justifyItems, justifySelf and alignContent styles properties.

  • Added filter and backdropFilter styles properties.

  • Added all, appearance and aspectRatio styles properties.

  • Added --include-source-maps option to jaspr build command.

  • Added jaspr tooling-daemon command and component scope analysis.

  • Fixed sitemap generation bug in top-level route ('/')

  • Require sdk: ^3.8.0.

  • Update analyzer to ^8.0.0 and build to ^4.0.0.

jaspr_content 0.4.0

  • The LiquidTemplateEngine is no longer const.
  • Fixed resolution of partial files in LiquidTemplateEngine.
  • Skip adding a <style> element for an empty ContentTheme.
  • Fixed HtmlParser to treat html files as fragments.

jaspr_lints 0.5.0

  • Extend prefer_html_methods lint to also suggest using text() and fragment() methods, and offer fixes for them.

  • Changed Add styles assist to create a getter instead of variable.

  • Update analyzer to ^8.0.0.

  • Update custom_lint to ^0.8.0.

v0.20.0

Choose a tag to compare

@schultek schultek released this 19 Jul 10:45

jaspr 0.20.0

  • Breaking: Removed the children parameter from input and col methods as
    they are void elements and shouldn't be passed children.
  • Breaking: Replaced the children parameter from script method with a String? content parameter, as it can only contain text content. Also made src parameter optional.
  • Breaking: Removed deprecated Color.hex and Color.named constructors.
  • Breaking: Removed deprecated style groups (Styles.box(), Styles.text(), Styles.background(), etc. as well as .box(), .text(), etc.).
  • Breaking: Removed deprecated EdgeInsets type.
  • Breaking: Removed deprecated Border.all constructor.
  • Added withOpacity(), withLightness(), withHue() and withValues() methods to Color.
  • Added figure and figcaption html methods.
  • Added the wbr html method for creating a line-break opportunity element.
  • Moved DomValidator class to foundation library.
  • Added support for disabling the sitemap generation for specific pages of jaspr_content sites.
  • Better error handling for async components.
  • Fixed an error where building too many routes in succession caused ports to be exhausted on macOS.

jaspr_content 0.3.0

  • Breaking: Page.data now returns a PageDataMap with typed getters for
    the maps stored under page and site.
    It's also final now and should be modified using the Page.apply method.
  • Breaking: The data parameters in Page.new and MemoryPage.new have been
    renamed to initialData to reflect they don't necessarily specify the final data.
  • Breaking: Header has been moved to package:jaspr_content/components/header.dart.
  • Breaking: Sidebar has been moved to package:jaspr_content/components/sidebar.dart.
  • Added a new Markdown component for directly rendering markdown content from a String.
  • Added support for sitemap: false in the page data to exclude pages from the sitemap.
  • Ignores files and folders in the content directory starting with . (in addition to _).
  • Require Dart 3.6 or later to match the other Jaspr packages.
  • Renamed the GithubButton component to GitHubButton.
  • Fixed GitHubButton not linking to the correct repository.
  • Renamed the GithubLoader route loader to GitHubLoader.
  • Breaking: Made GitHubPageSource private.
  • Fixed subfolders in Content are not recognized on Windows.

v0.19.1

Choose a tag to compare

@schultek schultek released this 19 Jun 18:39

jaspr 0.19.1

  • Added Color.currentColor constant.
  • Added rx and ry properties for svg rect().
  • Added prefersContrast: Contrast.<more|less|noPreference> to MediaQuery.
  • Added MediaQuery.raw() for creating a custom media query from a String.
  • Fixed rendering bug when nesting components with empty children.

jaspr_content 0.2.0

  • Breaking: Changed MemoryPage.builder to accept a BuildContext instead of a Page parameter.
  • Adding or removing content files will now properly update the routes.
  • Support .yml in addition to .yaml for data files.
  • Fixed specifying the layout name in frontmatter.
  • Fixed ContentTheme.none to not apply any styles.
  • Fixed typo with keepSuffixPattern parameter in FilesystemLoader and GithubLoader.

jaspr_lints 0.4.0

  • Added 'prefer_styles_getter' lint and fix.

v0.19.0

Choose a tag to compare

@schultek schultek released this 14 May 17:06

Introducing Jaspr Content

jaspr_content is a new first-party Jaspr package for building content-driven sites like documentation, blogs, or marketing pages.

It provides out-of-the-box tools for loading, parsing, and rendering content from various sources like markdown files. It is fully customizable and you are able to add your own implementations for each part.

Checkout the docs for more: https://docs.jaspr.site/content


Changelog

  • BREAKING JasprOptions.useIsolates is now false by default (was true).

    If you want to keep the old behaviour of rendering each request in a separate isolate, use Jaspr.initializeApp(..., useIsolates: true).

  • Added allowedPathSuffixes option to Jaspr.initializeApp() to enable handling route paths with extensions other than html.

  • Added support for generating a sitemap.xml in static mode. To enable this, pass --sitemap-domain=my.domain.com to jaspr build.

    Add sitemap params like changefreq and priority to your routes by using Route(settings: RouteSettings(priority: 0.5)) or set them through ServerApp.requestRouteGeneration().

    Exclude routes from the sitemap through the --sitemap-exclude option to jaspr build.

    Read more about Generating a Sitemap.

  • Added support @client components from other packages.

    Components annotated with @client from other dependent packages are now also part of the js bundle when used during pre-rendering.

  • BREAKING The Flex(basis: ...) style now accepts a Unit value directly instead of a FlexBasis.

  • Allow nesting css.media and css.supports rules.

  • Deprecated Color.hex() and Color.named() in favor of the default Color() constructor.

  • Added onReassemble stream to ServerApp.

  • Various bug fixes.

v0.18.0

Choose a tag to compare

@schultek schultek released this 24 Feb 15:48

jaspr

  • BREAKING Changed AppBindings Uri get currentUri to String get currentUrl.

  • BREAKING Changed return type of renderComponent() from Future<String> to Future<({int statusCode, String body, Map<String, List<String>> headers})>.

    The rendered html is accessible through the body property. statusCode and headers can be used to create a response object when part of a custom http handler.

  • Added context.url extension getter on both client and server.

  • Added context.headers, context.headersAll and context.cookies extension getters on the server. These can be used to access the headers and cookies of the currently handled request.

  • Added context.setHeader() and context.setCookie() and context.setStatusCode() extension on the server. These can be used to set headers, cookies and the status code of the response.

  • Deprecated having seperate style groups (Styles.box(), Styles.text(), Styles.background(), etc. as well as .box(), .text(), etc.). All styling properties are now available under the single Styles() constructur and .styles() method.

    Before:

    css('.main')
      .box(width: 100.px, height: 100.px)
      .text(align: TextAlign.center)
      .background(color: Colors.blue);

    After:

    css('.main').styles(
      width: 100.px,
      height: 100.px,
      textAlign: TextAlign.center,
      backgroundColor: Colors.blue,
    );
  • Deprecated EdgeInsets in favor of Padding and Margin types.

  • BREAKING Moved zIndex property out of Position and directly into Styles.

  • Added userSelect, pointerEvents and content properties to Styles.

  • Added Unit.maxContent, Unit.minContent, Unit.fitContent and Unit.expression().

jaspr_lints

  • Added 'styles_ordering' lint and quick fix.

v0.17.0

Choose a tag to compare

@schultek schultek released this 12 Jan 12:16

jaspr v0.17.0

  • BREAKING Removed currentState from GlobalKey, use GlobalStateKey instead.

  • Added GlobalStateKey<T extends State> to access the state of a component using currentState.

    // Use any State type as the type parameter.
    final GlobalStateKey<MyComponentState> myComponentKey = GlobalStateKey();
    
    /* ... */
    
    // Access the state from the key.
    MyComponentState? state = myComponentKey.currentState;
  • Added GlobalNodeKey<T extends Node> to access native dom nodes using currentNode.

    import 'package:universal_web/web.dart';
    
    // Use any Node type (from package:universal_web) as the type parameter.
    final GlobalNodeKey<HTMLFormElement> myFormKey = GlobalNodeKey();
    
    /* ... */
    
    // Access the dom node from the key.
    HTMLFormElement? node = myFormKey.currentNode;
  • Migrated all web imports from package:web to package:universal_web.

  • Added prefersColorScheme parameter to MediaQuery.

v0.16.4

Choose a tag to compare

@schultek schultek released this 03 Jan 12:53

jaspr v0.16.4

  • Fixed attribute validation to support attribute names including @ and :.
  • Added table and related html methods.
  • Added value parameter to select() method.
  • Add 'standalone' option to renderComponent method.

jaspr_cli v0.16.4

  • Added --dart-define, --dart-define-client and --dart-define-server to serve and build commands.

jaspr_lints v0.2.0

  • Updated custom_lint to ^0.7.0

jaspr_serverpod v0.5.0

  • Bump serverpod to 2.3.0