Skip to content

Releases: AnimaApp/anima-sdk

v0.17.0

26 Jan 15:11
bbf7925

Choose a tag to compare

This version doesn't have any user-facing changes.

v0.16.1

23 Jan 12:06
52d1724

Choose a tag to compare

No breaking changes have been introduced in this version, so upgrading from v0.16.0 to v0.16.1 will require no changes on your side.

What changed

  • Removed react/jsx-runtime from the bundle (#74) (Thanks, @sheepsteak!)

v0.16.0

13 Jan 11:51
0ab91f6

Choose a tag to compare

No breaking changes have been introduced in this version, so upgrading from v0.15.0 to v0.16.0 will require no changes on your side.

What changed

  • New optional guidelines parameter in GetCodeFromPromptParams

v0.14.0

07 Jan 10:45
0517f3b

Choose a tag to compare

No breaking changes have been introduced in this version, so upgrading from v0.13.0 to v0.14.0 will require no changes on your side.

What changed

  • New UI Library supported! You can now set uiLibrary: 'custom_design_system' for users that have configured a custom design system, with Anima, for their team.

v0.13.0

06 Jan 11:58
a416bee

Choose a tag to compare

No breaking changes have been introduced in this version, so upgrading from v0.12.0 to v0.13.0 will require no changes on your side.

What's new

  • Now, it's possible to re-attach to an existing job from the client-side. Use the new function attachJob for that.

v0.12.0

31 Dec 14:32

Choose a tag to compare

No breaking changes have been introduced in this version, so upgrading from v0.11.0 to v0.12.0 will require no changes on your side.

What's new

  • We improved the TypeScript typing for the SSE messages (SSECommonMessage, SSEGetCodeFromFigmaMessage, SSEGetCodeFromWebsiteMessage and SSEGetCodeFromPromptMessage) (#69)

v0.11.0

17 Dec 17:37
3638cf4

Choose a tag to compare

No breaking changes have been introduced in this version, so upgrading from v0.10.0 to v0.11.0 will require no changes on your side.

What's new

  • This version adds the error FileNotExportable. Now, when the Figma file is set as not exportable by viewers (see image below), this error is thrown in place of UnknownForbiddenFigmaError. You can check for this error if you want to provide better error messages.
image

v0.10.0

11 Dec 12:32
e7b12bb

Choose a tag to compare

No breaking changes have been introduced in this version, so upgrading from v0.9.0 to v0.10.0 will require no changes on your side.

What's new

  • We introduced the ability to import websites via a hosted MHTML payload, rather than a MHTML payload directly. This simplifies importing larger MHTML payloads when using the generateCodeFromWebsite method, as you can host them and then provide a URL to Anima to start the generation.

v0.9.0

04 Nov 14:49

Choose a tag to compare

Upgrading from v0.8.0 to v0.9.0 requires a few changes if you are relying on some error classes that were renamed or removed.
The main update in v0.9.0 is providing better support for error handling when the Figma user's token expires or is invalidated (e.g., was revoked).

What's new

  • onForbidden option on FigmaRestApi: callback called when a 403 Forbidden error is received from the Figma API. It receives an instance of NeedsReauthFigmaToken, ExpiredFigmaToken or UnknownForbiddenFigmaError as an argument. Check the readme to learn how to handle these errors properly.

Breaking changes

  • InvalidFigmaToken was renamed with MalformattedFigmaToken
  • FigmaTokenIssue was removed in favor of more granular errors: NeedsReauthFigmaToken, ExpiredFigmaToken and UnknownForbiddenFigmaError.
  • The undocumented function getFigmaApiErrorType was removed

Other changes

For full details, see the README.

v0.8.0

31 Oct 15:47

Choose a tag to compare

Upgrading from v0.7.x to v0.8.0 requires a few changes.
The main update in v0.8.0 is support for the new Figma API rate limit, which takes effect on November 17.

What's new

  • FigmaRestApi: A utility class for retrieving data from Figma for code generation. It was designed to handle rate limits automatically.

Breaking changes

  • <AnimaSdkProvider /> now requires a new prop: figmaRestApi
  • The hook useFigmaFile must now be called within <AnimaSdkProvider />
  • The following styling options were removed from CodegenSettings: "css_modules" | "styled_components" | "sass" | "scss"

Minor changes

  • The type ProgressMessage was updated, adding the property type: "info" | "rate_limit"

Migration steps

The main step to migrate from v0.7.x to v0.8.0 is to create an instance of FigmaRestApi and pass it to <AnimaSdkProvider />

1 - Create an instance of FigmaRestApi:

import { FigmaRestApi } from "@animaapp/anima-sdk";

const figmaRestApi = new FigmaRestApi({
  defaultOptions: { // Optional.
    token: "Figma Token", // Must start with `figd_` or `figu_`
  },
});

2 - Pass it to <AnimaSdkProvider />:

<AnimaSdkProvider
  figmaRestApi={figmaRestApi}
  ...

For full details, see the README.

Testing

You can test the new progress messages for rate limiting using the following Figma file key: