Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: qonto/ember-lottie
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ca284dc036de7d0fadf4a4315603dce82cb8720b
Choose a base ref
..
head repository: qonto/ember-lottie
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 31e62c5f085f1c7d1e5813db5ab07c2009b4c21c
Choose a head ref
Showing with 59 additions and 10 deletions.
  1. +4 −4 .github/workflows/ci.yml
  2. +26 −0 CHANGELOG.md
  3. +2 −1 README.md
  4. +1 −1 ember-lottie/package.json
  5. +22 −0 ember-lottie/src/components/lottie.ts
  6. +1 −1 package.json
  7. +1 −1 pnpm-lock.yaml
  8. +2 −2 test-app/package.json
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: NullVoxPopuli/action-setup-pnpm@v1
- uses: wyvox/action-setup-pnpm@v3
name: Install pnpm
with:
pnpm-version: 8.5.1
@@ -41,12 +41,12 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: NullVoxPopuli/action-setup-pnpm@v1
- uses: wyvox/action-setup-pnpm@v3
name: Install pnpm
with:
pnpm-version: 8.5.1
node-version: 16.x
no-lockfile: true
args: "--no-lockfile"

- name: Run Tests
run: npm run test:ember
@@ -74,7 +74,7 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: NullVoxPopuli/action-setup-pnpm@v1
- uses: wyvox/action-setup-pnpm@v3
name: Install pnpm
with:
pnpm-version: 8.5.1
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@

## v0.6.1 (2023-09-07)

#### :rocket: Enhancement
* [#196](https://github.com/qonto/ember-lottie/pull/196) throw LottieError if the fetch response is not ok ([@SkoebaSteve](https://github.com/SkoebaSteve))

#### Committers: 5
- Steef Janssen ([@SkoebaSteve](https://github.com/SkoebaSteve))

## v0.6.0 (2023-09-05)

#### :rocket: Enhancement
* [#195](https://github.com/qonto/ember-lottie/pull/195) Add option to pass an onError function to handle any lottie fetch err… ([@SkoebaSteve](https://github.com/SkoebaSteve))
* [#194](https://github.com/qonto/ember-lottie/pull/194) Expose template registry and drop rollup-plugin-ts ([@vscav](https://github.com/vscav))

#### :house: Internal
* [#132](https://github.com/qonto/ember-lottie/pull/132) Remove unnecessary jobs in CI script ([@vscav](https://github.com/vscav))

#### Committers: 5
- Anastasia ([@anas7asia](https://github.com/anas7asia))
- Ewan McDougall ([@mrloop](https://github.com/mrloop))
- Steef Janssen ([@SkoebaSteve](https://github.com/SkoebaSteve))
- Vincent Scavinner ([@vscav](https://github.com/vscav))
- [@CYriuk](https://github.com/CYriuk)


## v0.5.0 (2023-04-13)

#### :house: Internal
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -51,10 +51,11 @@ ember install @qonto/ember-lottie
| speed | number | `1` is normal speed |
| containerId | string | the dom element id on which to render the animation (mandatory) |
| onDataReady | function | a function that triggers the Lottie when you want it |
| onError | function | a function that can be used as a callback when fetching the lottie file throws |

## TypeScript usage

The `Lottie`` component has proper [Glint](https://github.com/typed-ember/glint) types, which allow you to get strict type checking in your templates when using TypeScript.
The `Lottie` component has proper [Glint](https://github.com/typed-ember/glint) types, which allow you to get strict type checking in your templates when using TypeScript.

Unless you are using [strict mode](http://emberjs.github.io/rfcs/0496-handlebars-strict-mode.html) templates (via [first class component templates](http://emberjs.github.io/rfcs/0779-first-class-component-templates.html)),
you need to import the addon's Glint template registry entries as described in the [Using Addons](https://typed-ember.gitbook.io/glint/using-glint/ember/using-addons#using-glint-enabled-addons) documentation:
2 changes: 1 addition & 1 deletion ember-lottie/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@qonto/ember-lottie",
"version": "0.5.0",
"version": "0.6.1",
"description": "Render lottie after effects animations in Ember.js",
"keywords": [
"ember-addon",
22 changes: 22 additions & 0 deletions ember-lottie/src/components/lottie.ts
Original file line number Diff line number Diff line change
@@ -17,6 +17,19 @@ class NotFoundError extends Error {
Object.setPrototypeOf(this, NotFoundError.prototype);
}
}
class LottieError extends Error {
status: number;
statusText: string;

constructor(status: number, statusText: string) {
super(statusText);

this.name = 'LottieError';

this.status = status;
this.statusText = statusText;
}
}

export interface LottieArgs {
name?: string;
@@ -28,6 +41,7 @@ export interface LottieArgs {
speed?: number;
containerId?: string;
onDataReady?: () => void;
onError?: (error: unknown) => void;
}

export interface LottieSignature {
@@ -62,9 +76,17 @@ export default class LottieComponent extends Component<LottieSignature> {

if (response.status === 404) {
throw new NotFoundError();
} else if (!response.ok) {
throw new LottieError(response.status, response.statusText);
} else {
animationData = await response.json();
}
} catch (error) {
if (this.args.onError) {
this.args.onError(error);
} else {
throw error;
}
} finally {
waiter.endAsync(token);
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ember-lottie",
"version": "0.5.0",
"version": "0.6.1",
"private": true,
"repository": {
"type": "git",
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions test-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "test-app",
"version": "0.5.0",
"version": "0.6.1",
"private": true,
"description": "Test app for @qonto/ember-lottie addon",
"repository": "",
@@ -37,7 +37,7 @@
"@embroider/webpack": "^2.1.1",
"@glimmer/component": "^1.1.2",
"@glimmer/tracking": "^1.1.2",
"@qonto/ember-lottie": "*",
"@qonto/ember-lottie": "0.6.1",
"@release-it-plugins/lerna-changelog": "^5.0.0",
"@tsconfig/ember": "^2.0.0",
"@types/ember": "^4.0.3",