davidroman0O / moleculer-nextjs

Add NextJS to Moleculer! 🎉
10 stars 2 forks source link

Example repository is missing or private #1

Open tavurth opened 5 years ago

tavurth commented 5 years ago

Hey, thanks for creating a cool repo!

I see that your example repository is private or missing, could we fix it somehow?

davidroman0O commented 5 years ago

@tavurth I never finish it actually, the code isn't really optimal for production, but anyway I can add as collaborator if you really really want it 😄

It's more about an experimentation than anything else!

tavurth commented 5 years ago

I certainly think I need something like this, but I've still not settled on quite exactly how I'll go about it yet. After playing with this library a little, I was thinking that the problem with linking next in this way is that we lose some of the amazing developer experience, HMR, next.config.js etc.

To try to avoid this I was playing around with having two services, one which simply acts as a service entry-point for moleculer calls, while the other one is a standard next.js container running a simple next start, and can be prebuilt using next build.

Then any calls into the moleculer service are simply routed to the second docker container, acting as a standard HTTP request, and so easily something that next.js can recognise.

That would simplify the problem, but adds other issues like the overhead of having to call internally inside the docker container structure, as well as having to run two containers for every SSR, which could get heavy.

Another possibility I was thinking about was to have a simple renderer service, which has a list of all available renderers as a configuration file, (serverless routes perhaps, or simply EC2), and then simply handles the external calling of them.

If you have any suggestions, or thoughts, I'd love to hear them!