Code Monkey home page Code Monkey logo

Comments (9)

pagesrichie avatar pagesrichie commented on June 6, 2024 2

from pup.

evolross avatar evolross commented on June 6, 2024

How big is your bundle? Have you check with bundle-visualizer? Have you tried dynamic imports? If you get your client bundle down to 2.5MB (or less) you should be in good shape with load times.

My app has a bundle of 4MB and it takes two or three seconds to load on a new device.

from pup.

ayhid avatar ayhid commented on June 6, 2024

I also got my bundle size split by half in two minutes just by using react-loadable

in layouts/App/index.js

I replaced most of the regular components imports by Loadable Components here is an example

const AdminUsers = LoadableComponent(() => import('../../pages/AdminUsers'));
import Loadable from 'react-loadable';
import Loading from '../components/Loading';

const LoadableComponent = (dynamicImportFunction) =>
  Loadable({
    loader: dynamicImportFunction,
    loading: Loading,
  });

export default LoadableComponent;

it is a no brainer and can drastically reduce your bundle size.

IMHO this should be enabled by default on pup, why the heck do I load an admin component if the user is just looking and the home page?

from pup.

cleverbeagle avatar cleverbeagle commented on June 6, 2024

Happy to work this in

from pup.

pagesrichie avatar pagesrichie commented on June 6, 2024

@cleverbeagle Thank you so much Ryan. Also plz don't forget the client side Redux integration for those that want to use Redux on the client side (not just server side) in pup v2 by default.

Looking forward to any updates on this :). Super appreciative of your efforts to creating the best tools out there.

from pup.

pagesrichie avatar pagesrichie commented on June 6, 2024

@cleverbeagle Plz do let us know when you have any updates on this :)

from pup.

pagesrichie avatar pagesrichie commented on June 6, 2024

@ayhid , in reference to your comment (#336 (comment)) -- Were you able to get this working successfully on a cleverbeagle pup v2 based project without any issues?

from pup.

pagesrichie avatar pagesrichie commented on June 6, 2024

from pup.

 avatar commented on June 6, 2024

@pagesrichie stay tuned :)

from pup.

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.