ourparentcenter/micro-quasar

boot files not working

Closed this issue · 5 comments

Hi, many thanks to the inspiring project of integrating quasar v2 with single-spa.

I see the point of commenting off '.then(start)' part of client-entry.js. It is working without setting boots in quasar.

However, with boots configured in quasar, it seem all the boot files are started with 'start(app, boot)'. By commenting this off, all boots are not working.
I guess there's a possible solution to boot something in the single-spa-entry.js file. But I wasn't able to make it.

Do you have any idea on making boots working?

Thank you!

I'll take a look.

Thanks for your response. I've solved the problem. Instead of replacing strings in .quasar files, I replaced the client-entry.js file with a whole new customized entry file which contains all boot files. This works for me.

The reason string replace was used is because the. quasar folder and files are auto generated every time the program starts. if boot files are an issue I want to get this fixed so I will still examine this and attempt to reproduce and find a solution.

I haven't tested it, however it looks like the solution is to change the test: /\.js$/ to test: /(\b(\w*client-entry\w*)\b)+.js$/ in the quasar config file. The test: attribute is just a regex, so by specifying the file name in the replacement of .then(start) this should allow boot files to load since it's really only the client-entry.js file we're really concerned about and want to target.

The idea behind this is that you would develop locally the quasar micro app instance using the normal way one would with quasar by commenting out the extendWebPack and chainWebpack methods or just the stuff relevant for single-spa so that everything loads with normal quasar. Then, when you're ready to add to single-spa, uncomment those sections commented and it will load with single-spa.

I've created a v2 branch that has boot files working, Pinia and changed the toggle functionality from functions added to global window to actual browser module imports added to the header app. Please see the v2 branch if your interested.