Comments (11)
We came back to our app recently where we use one of your spinners as our main loading animation. Updated to 0.4.3 and changed the import like you said and now our bundle size dropped by 50KB.
Just wanted to say thanks! 👍
from react-spinners.
Would also be interested in this! Currently react-spinners is 9% of our small apps total bundle size.
Love the spinners though! RingLoader is awesome :)
from react-spinners.
@archansel @ThomasBem, I ran a quick test, looks you like can import just one.
import BarLoader from 'react-spinners/dist/spinners/BarLoader';
Trying to see how I can remove the /dist/spinners
part`.
import { BarLoader } from 'react-spinners';
: 51.23 KB
import BarLoader from 'react-spinners/dist/spinners/BarLoader';
: 47.44 KB
The file sizes are the size after gzip. I used create-react-app
and just added the loader and build the production build.
Can you guys give that a try and see if the bundle size is reduced?
from react-spinners.
@davidhu2000 Figured I would chime in to confirm this worked on my end. I used source-map-explorer
for a quick test. https://www.npmjs.com/package/source-map-explorer
I'm only using BarLoader and PulseLoader
import PulseLoader from 'react-spinners/dist/spinners/PulseLoader';
import BarLoader from 'react-spinners/dist/spinners/BarLoader';
from react-spinners.
@GuillaumeCisco Just merged in your PR, but looks like single loader import isn't working.
I'm looking at possible solutions, not sure why. I had to deprecate 0.4.0
. We need to push out a patch for this.
from react-spinners.
I just published a patch 0.4.1 that removes the single loader import from the readme. So hopefully very few people uses 0.4.0.
from react-spinners.
looks like the issue is you need to import BarLoader from 'react-spinners/dist/BarLoader';
from react-spinners.
from react-spinners.
This is fixed in >= 0.4.2
from react-spinners.
@davidhu2000 Can't use this import method with typescript. I've got error: Could not find a declaration file for module 'react-spinners/GridLoader'.
from react-spinners.
hmm, @alexmironof can you open a new issue? This feels like a different issue that the current issue.
from react-spinners.
Related Issues (20)
- PuffLoader has zero size HOT 1
- Prop `style` did not match HOT 2
- Feature request: Support React Native HOT 3
- Pacman Loader overlaps with other content HOT 2
- Update colors prop to validate using typings
- FaderLoader does not have feature to resize. HOT 3
- beat_loader.js(x) HOT 1
- NextJS 13 doesn't render SSR HOT 2
- Delay at beginning of spinner HOT 1
- Font-size 0 breaks em CSS unit sizing for Pacman loader
- Is It Possible To add a variable CSS Color as Color? HOT 1
- Bounce & Pacman - broken on first part of the animation
- Spinner isn't not Spinning in Nextjs 14 (Server Side) HOT 8
- FadeLoader is not centered
- Proposal for Implementing Search Filters on React Spinners
- HashLoader color is taken from the last HashLoader component
- HashLoader rgb color hides 2 lines
- MoonLoader wobbles when provided a size not evenly divisible by 7
- Upgrading from 0.13.8 to 1.0.0 HOT 3
- Type error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-spinners.