Giter VIP home page Giter VIP logo

Comments (3)

tomatau avatar tomatau commented on August 27, 2024

Hey @nasushkov thanks for this! Let me go through each of these.

  • I'd suggest react-helmet as a more convenient way to manage page head
    • This looks very interesting! Want to make a PR? I'm not sure what the benefits are over react-document-meta?
  • It also would be nice to add react-intl support for internationalization
    • In my experience with INTL support, implementations can be forced based on business requirements and so it would be hard to find a simple solution that meets everyone's requirements. I'll certainly have a play with this though! It could definitely help for big apps if done well!
  • You have a socket.io support included in this boilerplate. There is no need for socket.io in my case. Is it necessary for any infrastructure to work properly (I mean hot-reload first of all)?
    • Nope! You can remove it completely, all the hot reloading logic is handled within the hotReload file. The only infrastructure requirements are some dependency injection happening in the server.
  • Your koa server setup is spread across several files (partly in app.js, partly in start.js). So at the first time it's hard to grasp, what is happening here. Maybe it would be better to move koa app setup code to app.js file and leave at start.js only isomorphic tools configuration
    • This is very much on purpose!
    • The scripts/start.js command hosts the root of hot reloading logic because it needs to sit outside of hotreloads to keep a single app instance.
    • Src/server/index.js hosts the app initialisation... this is so it can be tested! The tests plug in test routes to make sure this app middleware is configured correctly (error handling, compression, session)
    • Src/server/index.js is used to test in conjunction with Src/server/router.js... this is also for hot reloading of routes.. the router provides a function that assets can be injected into as well as allowing the makeRoutes function to be stubbed and hot reloaded. I've wrote a blog article about the hot reloading here: https://tomatao-blog.herokuapp.com/ "Server and CSS Hot Updates"

from breko-hub.

nasushkov avatar nasushkov commented on August 27, 2024

Thanks, Thomas, Your blog post clarifies a lot. React-helmet plays as a react-component so you can change page data on the client. For example, I use it for locale switching. I'll try to make a PR if it's ok

from breko-hub.

tomatau avatar tomatau commented on August 27, 2024

Glad to hear it helped!

we're already using react-document-meta which does the same!

from breko-hub.

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.