Coder Social home page Coder Social logo

framer-motion dependency about moti HOT 8 CLOSED

nandorojo avatar nandorojo commented on August 22, 2024
framer-motion dependency

from moti.

Comments (8)

mattgperry avatar mattgperry commented on August 22, 2024 2

That's odd, it's the same with popmotion. I don't know enough about this to be able to fix it right away, will have to do some debugging.

from moti.

mattgperry avatar mattgperry commented on August 22, 2024 2

I've published new versions of popmotion and framer-motion with the preserveModules: true which helps Webpack code-splitting ES modules. So 3.8.0 should have a minimal footprint for AnimatePresence (about 2.5kb)

from moti.

nandorojo avatar nandorojo commented on August 22, 2024

Hmm that's interesting, I didn't know that.

@mattgperry curious if you have thoughts here. I'm using the usePresence hook in each component, so I'm assuming that's importing all of framer motion. Is there a better way to do this?

Tree shaking on React Native Web is incredibly hard to maintain. It takes very little to mess it up, so it's not very reliable.

from moti.

mattgperry avatar mattgperry commented on August 22, 2024

I actually just added sideEffects: false to package.json in the latest version, will that help?

from moti.

nandorojo avatar nandorojo commented on August 22, 2024

Yeah it should do it in principle. I'll update and try pushing that out, thanks for the quick response here.

from moti.

gut4 avatar gut4 commented on August 22, 2024

https://bundlephobia.com/[email protected]
Hmm sideEffects: false doesn't help. Each export has the same size as whole bundle.

from moti.

nandorojo avatar nandorojo commented on August 22, 2024

Webpack's tree shaking is something I've had trouble finding good content on. Besides a short explanation on their docs saying that you should use sideEffects: false, I haven't seen too much. I also don't know enough about this.

@mattgperry if you need any help figuring this out for Framer, let me know.

from moti.

nandorojo avatar nandorojo commented on August 22, 2024

Thanks to @mattgperry's update, moti is now down to 4.4kb gzipped: https://bundlephobia.com/[email protected]

yarn add moti

@gut4 thanks for bringing this to my attention.

from moti.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.