Skip to content

v0.8.0

Choose a tag to compare

@macabeus macabeus released this 31 Oct 15:47
· 41 commits to main since this release

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: