What is best practice for boot file dependencies

  • As you have noticed already I’m pretty new to javaScript and the Quasar Framework. Currently I’m implementing msal in my project. All is working fine but I’m a bit concerned about the folder structure I used.

    So, in the Quasar docs for boot files it says:

    With boot files, it is possible to split each of your dependencies into self-contained, easy to maintain files.

    My project structure currently looks like this:

    /src/boo/auth.js // add msal to Vue.prototype
    /src/boot/auth // FOLDER
    /src/boot/auth/authIndex.js // instantiates the msal object
    /src/boot/auth/authPopup.js // msal popup functions
    /src/boot/auth/authRedirect.js // msal redirect functions
    /src/config/authConfig.js // confg settings

    As there is a sub folder in the “/src/boot” folder I was wondering if this is ok? How do other people handle this? Is there a better/cleaner way? What are the best practices?

    Thank you for any advice you might have.

  • AFAIK, there are no real “best practice” with boot files except general JavaScript module practices. Keep em small and manageable i.e. modules should follow SRP. Sounds like you are doing the right thing from what I can tell. 🙂 The only other thing I might suggest is, and it depends on what your authIndex.js file is doing, but to call it just index.js. That is a usual practice in the JS world.

    Anyone else have a tip or two?


Log in to reply