Skip to main content

@krakentech/blueprint-measurements

0.2.1

Patch Changes

  • 2567a7c: New bundling strategy for better performance

    • Unbundle mode Packages are now bundled using tsdown's unbundle mode. This mode drastically reduces the number of generated file compared to the glob-filtered entries we used before, and prevented proper tree-shaking.

    • Automatic package.json exports tsdown is now responsible for generating the package.json exports, main, module, and types fields. This ensures packages follow best practices.

0.2.0

Minor Changes

  • 045ff0a: useMeasurementFilters: added support for a "smart" anchor date that automatically picks the most relevant date based on available data. The way it works is:

    • We query for the last 2 days measurements for a given propertyId + marketSupplyPointId.
    • If we have the full day data for yesterday, we set the anchor date to yesterday.
    • If we don't have full day data for yesterday, but we have full day data for the day before yesterday, we set the anchor date to the day before yesterday.
    • If we don't have full day data for either yesterday or the day before yesterday, we set the anchor date to yesterday (as before).

    This is useful for Krakens where data is not always available up to yesterday, as it allows us to show the most recent data available.

    No Kraken has up to date data for today at the moment, so we never consider today as a possible anchor date.

    const measurementFilters = useMeasurementFilters({
    + enableSmartAnchorDate: true,
    initialDateRange,
    + marketSupplyPointId,
    + propertyId,
    });

    Bear in mind that passing enableSmartAnchorDate: true won't allow you to also pass an initialAnchorDate, as the anchor date will be determined automatically.

0.1.0

Minor Changes

  • 911755c: Added

    • Released the new measurements package: Provides measurement data handling and logic for Blueprint applications
    • Measurement hooks and utilities for querying, filtering, and transforming measurement data
    • Local storage integration for user preferences

    Features

    • Date range selection and custom filtering for measurement data
    • Support for multiple utility types (e.g., electricity, gas)
    • Error handling and helpful messaging for invalid input
    • Integration with GraphQL API for measurement queries

    Note: This is the initial release of the measurements package.

    Breaking Changes: None (new package)

    Migration: No migration required for existing Blueprint users. The measurements package can be optionally integrated into existing applications.