Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🤖 Bip Bop - Fusion Framework Release #2198

Merged
merged 1 commit into from
May 27, 2024
Merged

🤖 Bip Bop - Fusion Framework Release #2198

merged 1 commit into from
May 27, 2024

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented May 24, 2024

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@equinor/[email protected]

Major Changes

  • #2181 ba2379b Thanks @odinr! - The blob and blob# Change Log methods in the HttpClient` class have been updated to provide a more robust and flexible API for fetching blob resources.

    1. The blob and blob# Change Log methods now accept an optional argsparameter of typeFetchRequestInit<T, TRequest, TResponse>, where T` is the type of the expected blob result. This allows consumers to customize the fetch request and response handling.
    2. The blob and blob# Change Log methods now return a PromiseandStreamResponserespectively, whereT` is the type of the expected blob result. This allows consumers to handle the blob data in a more type-safe manner.
    3. The blobSelector function has been updated to extract the filename (if available) from the content-disposition header and return it along with the blob data in a BlobResult object.
    4. If you were previously using the blob or blob# Change Log methods and expecting a Blobresult, you must now use the newBlobResult` type, which includes the filename (if available) and the blob data.

    [!WARNING]
    This alters the return type of the blob and `blob# Change Log methods, which is a breaking change.

    Example:

    const blobResult = await httpClient.blob('/path/to/blob');
    console.log(blobResult.filename); // 'example.pdf'
    console.log(blobResult.blob); // Blob instance
    1. If you were providing a custom selector function to the blob or blob# Change Log methods, you can now use the new BlobResult` type in your selector function.

    Example:

    const customBlobSelector = async (
        response: Response,
    ): Promise<{ filename: string; blob: Blob }> => {
        // Extract filename and blob from the response
        const { filename, blob } = await blobSelector(response);
        return { filename, blob };
    };
    
    const blobResult = await httpClient.blob('/path/to/blob', { selector: customBlobSelector });
    console.log(blobResult.filename); // 'example.pdf'
    console.log(blobResult.blob); // Blob instance
    1. If you were using the blob# Change Log method and expecting a StreamResponse, you can now use the new StreamResponsetype, whereT` is the type of the expected blob result.

    Example:

    const blobStream = httpClient.blob$('/path/to/blob');
    blobStream.subscribe((blobResult) => {
        console.log(blobResult.filename); // 'example.pdf'
        console.log(blobResult.blob); // Blob instance
    });

Patch Changes

  • #2196 1e60919 Thanks @odinr! - The jsonSelector function was not checking the error type in the catch block.
    This lead to not throwing the error with parsed data, but always throwing a parser error, where the correct error was cause in the ErrorOptions

    BREAKING CHANGE:

    If for some reason developers has catched the error and assumed the cause property would give the proper error data, this will no longer be the case.

    try {
        await jsonSelector(response);
    } catch (error) {
        if (error instanceof HttpJsonResponseError) {
            const { data, cause } = error;
            if (data) {
                console.error('the request was not `ok`, see provided error data', data);
            } else {
                console.error('failed to parse data from response, see provided cause', cause);
            }
        }
    }
    try {
      await jsonSelector(response);
    } catch (error) {
      if(error instanceof HttpJsonResponseError) {
    -    const data = error.cause instanceof HttpJsonResponseError ? err.cause.data : null;
    +    const data = error instanceof HttpJsonResponseError ? error.data : null;
        if(data) {
          console.error('the request was not `ok`, see provided error data', data);
        } else {
          console.error('failed to parse data from response, see provided cause', error.cause);
        }
      }
    }

@equinor/[email protected]

Minor Changes

  • #2181 ba2379b Thanks @odinr! - If you were previously using the blob or blob# Change Log methods from the IHttpClientand expecting aBlobresult, you must now use the newBlobResult` type, which includes the filename (if available) and the blob data.

    Migration Guide:

    // Before
    const blob = await httpClient.blob('/path/to/blob');
    console.log(blob); // Blob instance
    
    // After
    const blobResult = await httpClient.blob<Blob>('/path/to/blob');
    console.log(blobResult.filename); // 'example.pdf'
    console.log(blobResult.blob); // Blob instance

Patch Changes

@equinor/[email protected]

Minor Changes

  • #2181 ba2379b Thanks @odinr! - If you were previously using the blob or blob# Change Log methods from the IHttpClientand expecting aBlobresult, you must now use the newBlobResult` type, which includes the filename (if available) and the blob data.

    Migration Guide:

    // Before
    const blob = await httpClient.blob('/path/to/blob');
    console.log(blob); // Blob instance
    
    // After
    const blobResult = await httpClient.blob<Blob>('/path/to/blob');
    console.log(blobResult.filename); // 'example.pdf'
    console.log(blobResult.blob); // Blob instance

Patch Changes

@equinor/[email protected]

Minor Changes

  • #2207 cc6b519 Thanks @odinr! - Updated the @ag-grid-enterprise/core dependency to version ~31.3.2. This is a patch version bump.

    Sticky Group Total and Grand Total Rows: Group and grand total rows can now be displayed as sticky rows at the top or bottom of the grid, making it easier to track total values in large datasets.

    Theme Builder: A new powerful styling tool that allows users to easily build highly-customized themes for AG Grid using presets and visual configurations.

    Skeleton Content in Loading Grid Cells: Skeleton loading placeholders are now displayed in grid cells while data is being loaded, providing a better user experience.

    Background Image in Excel Exports: Users can now add a background image to Excel files exported from AG Grid.

    Global Grid Options: A new feature that allows users to apply global configuration options to all AG Grid instances in their application.

    Accessibility Improvements: AG Grid 31.3 includes enhancements to keyboard navigation and overall accessibility support.

    see full release note

@equinor/[email protected]

Minor Changes

  • #2181 ba2379b Thanks @odinr! - ## @equinor/fusion-framework-module-services

    Updated the PeopleApiClient.photo method to properly type the response as PersonPhotoApiResponse<TVersion> instead of Blob. This allows for more accurate type checking when using the method.

    To update your code:

    • If you are using the PeopleApiClient.photo method directly, no changes are needed. The method will now properly type the response.
    • If you have custom type assertions or checks around the response from PeopleApiClient.photo, you may need to update them to handle PersonPhotoApiResponse<TVersion> instead of Blob.

    Example:

    // Before
    const photoResponse: Blob = await peopleApiClient.photo('v2', 'blob', { azureId: '123' });
    console.log(typeof photoResponse); // Blob
    
    // After
    const photoResponse: PersonPhotoApiResponse<'v2'> = await peopleApiClient.photo('v2', 'blob', {
        azureId: '123',
    });
    console.log(typeof photoResponse); // Object - { filename: string, blob: Blob }

@equinor/[email protected]

Minor Changes

  • #2181 ba2379b Thanks @odinr! - If you were previously using the blob or blob# Change Log methods from the IHttpClientand expecting aBlobresult, you must now use the newBlobResult` type, which includes the filename (if available) and the blob data.

    Migration Guide:

    // Before
    const blob = await httpClient.blob('/path/to/blob');
    console.log(blob); // Blob instance
    
    // After
    const blobResult = await httpClient.blob<Blob>('/path/to/blob');
    console.log(blobResult.filename); // 'example.pdf'
    console.log(blobResult.blob); // Blob instance

Patch Changes

@equinor/[email protected]

Minor Changes

  • #2181 ba2379b Thanks @odinr! - ## @equinor/fusion-framework-module-services

    Updated the PeopleApiClient.photo method to properly type the response as PersonPhotoApiResponse<TVersion> instead of Blob. This allows for more accurate type checking when using the method.

    To update your code:

    • If you are using the PeopleApiClient.photo method directly, no changes are needed. The method will now properly type the response.
    • If you have custom type assertions or checks around the response from PeopleApiClient.photo, you may need to update them to handle PersonPhotoApiResponse<TVersion> instead of Blob.

    Example:

    // Before
    const photoResponse: Blob = await peopleApiClient.photo('v2', 'blob', { azureId: '123' });
    console.log(typeof photoResponse); // Blob
    
    // After
    const photoResponse: PersonPhotoApiResponse<'v2'> = await peopleApiClient.photo('v2', 'blob', {
        azureId: '123',
    });
    console.log(typeof photoResponse); // Object - { filename: string, blob: Blob }

Patch Changes

@equinor/[email protected]

Minor Changes

  • #2181 ba2379b Thanks @odinr! - If you were previously using the blob or blob# Change Log methods from the IHttpClientand expecting aBlobresult, you must now use the newBlobResult` type, which includes the filename (if available) and the blob data.

    Migration Guide:

    // Before
    const blob = await httpClient.blob('/path/to/blob');
    console.log(blob); // Blob instance
    
    // After
    const blobResult = await httpClient.blob<Blob>('/path/to/blob');
    console.log(blobResult.filename); // 'example.pdf'
    console.log(blobResult.blob); // Blob instance

Patch Changes

@equinor/[email protected]

Patch Changes

@equinor/[email protected]

Patch Changes

@equinor/[email protected]

Patch Changes

@equinor/[email protected]

Patch Changes

@equinor/[email protected]

Patch Changes

@equinor/[email protected]

Patch Changes

@equinor/[email protected]

Patch Changes

@equinor/[email protected]

Patch Changes

@equinor/[email protected]

Patch Changes

@equinor/[email protected]

Patch Changes

@equinor/[email protected]

Patch Changes

@equinor/[email protected]

Patch Changes

@equinor/[email protected]

Patch Changes

@equinor/[email protected]

Patch Changes

@equinor/[email protected]

Patch Changes

@equinor/[email protected]

Patch Changes

  • #2204 72f48ec Thanks @odinr! - Updated @testing-library/react dev dependency from ^14.2.0 to ^15.0.0.

    This is a patch bump because it only updates a dev dependency, which does not affect the public API or functionality of the @equinor/fusion-framework-observable package. Consumers of this package do not need to make any changes.

    The @testing-library/react library is used internally for unit testing React components. Updating to the latest version ensures we have the latest testing utilities and improvements.

    Highlights from the @testing-library/react v15.0.0 changelog:

    • Minimum supported Node.js version is 18.0
    • New version of @testing-library/dom changes various roles. Check out the changed types if you are using ByRole queries.

@equinor/[email protected]

Patch Changes

  • #2148 1681940 Thanks @odinr! - ---

    "@equinor/fusion-query": minor

    This release introduces a new method persistentQuery to the Query class. This method allows for creating persistent queries that automatically update when the underlying cache entry changes.

    The persistentQuery method was added to simplify the process of creating queries that need to stay up-to-date with the latest data. Previously, developers had to manually handle cache updates and re-subscribe to the query observable when changes occurred. With persistentQuery, this process is automated, reducing boilerplate code and improving developer experience.

    To use the persistentQuery method, simply call it with the desired query arguments and options, similar to the existing query method:

    import { Query } from '@equinor/fusion-query';
    
    const query = new Query({
        /* query options */
    });
    
    const persistentQuery$ = query.persistentQuery({ id: '123' });
    
    persistentQuery$.subscribe((result) => {
        console.log('Persistent query result:', result);
    });

    The persistentQuery method returns an observable that emits the cached result immediately if available. It then continues to emit new results whenever the cache entry changes, either due to a new query or a manual cache mutation.

    How to migrate
    If you have existing code that manually handles cache updates and re-subscribes to queries, you can migrate to the persistentQuery method by replacing the manual logic with a call to persistentQuery.

    For example, if you had code like this:

    const query$ = query.query({ id: '123' });
    const subscription = query$.subscribe((result) => {
        // Handle result
    });
    
    // Manually handle cache updates
    query.onMutate((event) => {
        if (event.detail.current?.key === 'cacheKeyFor123') {
            subscription.unsubscribe();
            const newSubscription = query.query({ id: '123' }).subscribe((result) => {
                // Handle result
            });
        }
    });

    You can replace it with the following:

    const persistentQuery$ = query.persistentQuery({ id: '123' });
    const subscription = persistentQuery$.subscribe((result) => {
        // Handle result
    });

    The persistentQuery method handles the cache updates automatically, eliminating the need for manual logic and re-subscriptions.

    Additional notes

    The persistentQuery method uses the distinctUntilChanged operator to only emit new results when the cache entry's transaction or mutation status changes, reducing unnecessary emissions.
    If you need to customize the cache validation logic for the persistentQuery, you can pass a custom validate function in the cache options object, similar to the existing query method.
    The persistentQuery method internally uses the _query and #generateCacheKey methods from the Query class, ensuring consistent behavior with the existing query functionality.

  • Updated dependencies [72f48ec]:

@equinor/[email protected]

Patch Changes

@equinor/[email protected]

Minor Changes

  • #2197 5426b23 Thanks @odinr! - - Added documentation and examples for using components from the @equinor/fusion-react-person package.

    • Implemented a useSearchPersons hook to search for persons using the People API.
    • Added a searchPerson function to perform person searches with an HTTP client.
    • Created new types for the person search API response and error handling.
    • Updated the HomePage component with an overview of working with the People API.
    • Enhanced the ListItemPage component to fetch and display a list of persons based on a search query.

    The @equinor/fusion-framework-cookbook-app-react-people package lacked documentation and examples for consuming the @equinor/fusion-react-person components. The changes aim to provide clear guidance and showcase how to interact with the People API to fetch and display person information.

    By adding the useSearchPersons hook and searchPerson function, developers how to implement functionality to their applications. The new types for the API response and error handling improve type safety and provide a structured way to handle different error scenarios.

    The updates to the HomePage and ListItemPage components demonstrate practical usage of the People API and components, making it easier for developers to understand and implement similar functionality in their own applications.

Patch Changes

  • #2205 4e64552 Thanks @odinr! - Updated @equinor/eds-core-react dependency to version ^0.38.0
    Updated @equinor/eds-utils dependency to version ^0.8.5

@equinor/[email protected]

Patch Changes

  • #2207 cc6b519 Thanks @odinr! - @equinor/fusion-framework-module-ag-grid

    Updated ag-grid dependencies to latest minor versions:

    • @ag-grid-community/client-side-row-model from ~31.2.0 to ~31.3.2
    • @ag-grid-community/core from ~31.2.0 to ~31.3.2
    • @ag-grid-community/react from ~31.2.0 to ~31.3.2
  • Updated dependencies [cc6b519]:

@equinor/[email protected]

Patch Changes

@equinor/[email protected]

Patch Changes

@equinor/[email protected]

Patch Changes

@equinor/[email protected]

Patch Changes

  • #2200 d63b99e Thanks @odinr! - Updated the following dependencies:

    • Bumped @vuepress/bundler-vite from 2.0.0-rc.9 to 2.0.0-rc.11
    • Bumped @vuepress/cli from 2.0.0-rc.9 to 2.0.0-rc.11
    • Bumped @vuepress/client from 2.0.0-rc.9 to 2.0.0-rc.11
    • Bumped @vuepress/plugin-register-components from 2.0.0-rc.21 to 2.0.0-rc.30
    • Bumped @vuepress/utils from 2.0.0-rc.9 to 2.0.0-rc.11
    • Bumped mermaid from ^10.9.0 to ^10.9.1
    • Bumped vuepress from 2.0.0-rc.9 to 2.0.0-rc.11
    • Bumped vuepress-theme-hope from 2.0.0-rc.37 to 2.0.0-rc.43
  • #2199 c568a06 Thanks @odinr! - ## @equinor/fusion-framework-docs

    Removed an outdated warning message about React version support in the Fusion Portal getting started guide.

    Why

    The warning message stated:

    The Fusion Portal only supports React@17

    However, this is no longer accurate, as the Fusion Portal now supports newer versions of React beyond 17.

@github-actions github-actions bot requested review from odinr and a team as code owners May 24, 2024 09:01
@github-actions github-actions bot marked this pull request as draft May 24, 2024 09:01
@github-actions github-actions bot force-pushed the changeset-release/main branch 12 times, most recently from e9289c1 to f0b2ce3 Compare May 27, 2024 10:15
@odinr odinr marked this pull request as ready for review May 27, 2024 10:55
@github-actions github-actions bot added 👨🏻‍🍳 cookbooks 👾 React 💾 CLI fusion framework CLI 📚 documentation Improvements or additions to documentation 🛠️ utils packages related to utils 🧬 Modules labels May 27, 2024
@odinr odinr merged commit 572f139 into main May 27, 2024
10 checks passed
@odinr odinr deleted the changeset-release/main branch May 27, 2024 10:56
Copy link
Contributor Author

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 13.07% 3795 / 29024
🔵 Statements 13.07% 3795 / 29024
🔵 Functions 13.04% 95 / 728
🔵 Branches 28.4% 238 / 838
File CoverageNo changed files found.
Generated in workflow #6504

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💾 CLI fusion framework CLI 👨🏻‍🍳 cookbooks 📚 documentation Improvements or additions to documentation 🧬 Modules 👾 React 🛠️ utils packages related to utils
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant