Giter Club home page Giter Club logo

Comments (6)

eugene1g avatar eugene1g commented on August 15, 2024

Stoffel, the "routing?callback" approach is beneficial because during high-paced development this allows new routes to be available on the front-end without any further steps. Of course in production the routes do not change, and this additional look ends up being both network and resource costly, which is why this bundle has the ability to dump all your routes into a single static JS file for easy parsing. This can be done via the "app/console fos:js-routing:dump" command, which creates a single static JS file to be included immediately after you include router.js

So for development purposes having a slight delay is worth the price. For production, we dump the routes then use Assetic to combine the router.js and the static dump file (along with other relevant JS scripts) into a single minimised JS file which is cached aggressively and does not introduce any overheads in the live system. I suggest you look into this strategy as well - with or without Asseting, but at least dumping your routes into a separate file instead of relying on the over-the-wire AJAX load used in the dev environment.

from fosjsroutingbundle.

DerStoffel avatar DerStoffel commented on August 15, 2024

Eugene1g thx for your reply.

wouldn't it be helpful to solve this automatically? This is another step I would have to consider in my deployment process. Since you cannot presume users using assetic.

Also, I agree for development purposes you are right.

Kind Regards
Stoffel

from fosjsroutingbundle.

willdurand avatar willdurand commented on August 15, 2024

@DerStoffel How would you automate that?

from fosjsroutingbundle.

Blackskyliner avatar Blackskyliner commented on August 15, 2024

@willdurand Use a CompilerPass to generate the Cache.

from fosjsroutingbundle.

willdurand avatar willdurand commented on August 15, 2024

Well, that would be a CacheWarmer, not a CompilerPass.

from fosjsroutingbundle.

willdurand avatar willdurand commented on August 15, 2024

so, there is no real issue here, and no real feature request either, closing..

from fosjsroutingbundle.

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.