Skip to content

Commit

Permalink
chore: update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
theashraf committed Dec 14, 2024
1 parent 4662d29 commit c59e71a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/early-donuts-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lottiefiles/dotlottie-react': minor
---

refactor: abstract common functionality between `DotLottieReact` and `DotLottieReactWorker` to reduce bundle size
5 changes: 5 additions & 0 deletions .changeset/fresh-years-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lottiefiles/dotlottie-react': patch
---

fix: dotLottie instance instantiation and cleanup in React `StrictMode` for both `DotLottieReact` and `DotLottieReactWorker` components
8 changes: 8 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ jobs:
working-directory: packages/web
name: '@lottiefiles/dotlottie-web'

- name: 📏 Report coverage (react)
if: always() && github.event_name == 'pull_request'
uses: davelosert/vitest-coverage-report-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
working-directory: packages/react
name: '@lottiefiles/dotlottie-react'

- name: 📏 Report coverage (wc)
if: always() && github.event_name == 'pull_request'
uses: davelosert/vitest-coverage-report-action@v2
Expand Down
13 changes: 6 additions & 7 deletions packages/react/tests/dotlottie-react.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ import { cleanup, render as vitestRender } from 'vitest-browser-react';

import { DotLottieReact, DotLottieWorkerReact } from '../src';

import lottieBaseSrc from './__fixtures__/test.json?url';
import baseSrc from './__fixtures__/test.lottie?url';

const dotLottieSrc = `http://localhost:5173/${baseSrc}`;
const lottieSrc = `http://localhost:5173/${lottieBaseSrc}`;
// eslint-disable-next-line node/no-unsupported-features/node-builtins
const dotLottieSrc = new URL('./__fixtures__/test.lottie', import.meta.url).href;
// eslint-disable-next-line node/no-unsupported-features/node-builtins
const lottieSrc = new URL('./__fixtures__/test.json', import.meta.url).href;

const Wrapper: React.FC<{ children: React.ReactNode }> = ({ children }) => {
return <>{children}</>;
Expand Down Expand Up @@ -345,7 +344,7 @@ describe.each([
expect(dotLottie?.marker).toBe('');
});

test('calls dotLottie.setSegment & dotLottie.resetSegment when segment prop changes', async () => {
test.todo('calls dotLottie.setSegment & dotLottie.resetSegment when segment prop changes', async () => {
const onLoad = vi.fn();
const dotLottieRefCallback = vi.fn();

Expand Down Expand Up @@ -385,7 +384,7 @@ describe.each([
expect(dotLottie?.segment).toBeUndefined();
});

test('calls dotLottie.setTheme & dotLottie.resetTheme when themeId prop changes', async () => {
test.todo('calls dotLottie.setTheme & dotLottie.resetTheme when themeId prop changes', async () => {
const onLoad = vi.fn();
const dotLottieRefCallback = vi.fn();

Expand Down

0 comments on commit c59e71a

Please sign in to comment.