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

(fix): Add lottie player only when used in next projects #777

Merged
merged 2 commits into from
May 4, 2023

Conversation

JayaKrishnaNamburu
Copy link
Member

This fixes build size for all NextJS projects. I will cross check for all other frameworks too. lottie player is little heavy. Right now, it's being added into all projects.

Screenshot 2023-04-22 at 20 30 12

Screenshot 2023-04-22 at 20 30 46

@JayaKrishnaNamburu JayaKrishnaNamburu self-assigned this Apr 22, 2023
@JayaKrishnaNamburu JayaKrishnaNamburu added the enhancement New feature or request label Apr 22, 2023
@codecov
Copy link

codecov bot commented Apr 22, 2023

Codecov Report

Patch coverage: 20.00% and project coverage change: -0.12 ⚠️

Comparison is base (6f0f777) 70.52% compared to head (f4b0bac) 70.41%.

Additional details and impacted files
@@               Coverage Diff               @@
##           development     #777      +/-   ##
===============================================
- Coverage        70.52%   70.41%   -0.12%     
===============================================
  Files              170      170              
  Lines             6999     7016      +17     
  Branches          2031     2040       +9     
===============================================
+ Hits              4936     4940       +4     
- Misses            1894     1903       +9     
- Partials           169      173       +4     
Impacted Files Coverage Δ
...ugin-common/src/node-handlers/node-to-jsx/index.ts 76.64% <0.00%> (-1.72%) ⬇️
...project-generator-next/src/next-project-mapping.ts 100.00% <ø> (ø)
...ort-project-generator-next/src/project-template.ts 100.00% <ø> (ø)
...kages/teleport-project-generator-next/src/utils.ts 94.23% <ø> (ø)
...ages/teleport-uidl-validator/src/decoders/utils.ts 89.74% <ø> (ø)
...ages/teleport-plugin-common/src/utils/ast-utils.ts 61.27% <12.50%> (-1.36%) ⬇️
...ges/teleport-plugin-import-statements/src/index.ts 70.96% <16.66%> (-4.48%) ⬇️
.../teleport-plugin-react-base-component/src/index.ts 93.54% <66.66%> (-2.89%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@JayaKrishnaNamburu
Copy link
Member Author

JayaKrishnaNamburu commented Apr 22, 2023

The main reason was, lottie-player is something imported and registered in DOM. So, the bundlers can't perform efficient tree-shaking and so it's being added to bundle all the time. Fixes #766

@JayaKrishnaNamburu
Copy link
Member Author

JayaKrishnaNamburu commented Apr 22, 2023

@elizamaria any specific issues that we are not using @lottiefiles/react-lottie-player with NextJS. Because currently what i am seeing is, the styles are also not propagating to the web-component. So, need to fix the styling with lottie-node in NextJS as we are using web-components.

Anyways, either way we need to fix it. Since, the styled-jsx styles are not propagating even if we use with react version of it.

@JayaKrishnaNamburu JayaKrishnaNamburu merged commit 690661f into development May 4, 2023
@JayaKrishnaNamburu JayaKrishnaNamburu deleted the fix/next-lottie-import branch May 4, 2023 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant