-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Research /core: Evaluate available solutions for SSR of dynamic remote modules in Next.js #104
Comments
@webcrumbs-community |
GREAT, @aditya4196! This one is super important. I was (and still am) stuck with it when I wrote the #91. Let me know if you'd like to discuss any idea. Cheers! |
I would definitely like to connect and discuss on this idea through a call or something.
I would say, if you can unassign me and assign it to someone who can research and do some documentation because im trying to implement a method which i have in mind and would focus less on documenting multiple altenatives |
Hey, @aditya4196! Thanks for the insights. Let’s touch base on this later. Regarding the ports issue: it's just a dev thing. In production, we'll have a CI/CD setup similar to these workflows. I'll push some code soon to clarify this setup. On dynamic plugin management: yeah, lots to do. Experiment-1 is kinda flexible in the sense that it does load plugins based on given strings (that can potentially be called from a db in the future), but server-side management could be better for SEO and core vitals. I’m confident we’ll crack it with the brains we have here. I'll reassign the research and documentation to someone else as you focus on your method. Keep us posted on your progress! Catch you later, |
Sure, Im on it. |
So the solution which I was trying was using the next/dynamic using dynamicImports Following the #91, I did some research on micro-frontend architecture which is said to be a better way to for plugin based development. There are many open source libraries for micro-frontend architecture Tailor (Zalando Tailor): Piral (Piral Framework): qiankun (乾坤): Podium: Incase anyone is picking this story, these links should be helpful |
This is great, @aditya4196. Did not know about qiankun. I'll take a look as well. Thanks. |
I have used qiankun before and it is not suitable. There will be performance problems. |
I see. Thanks. I think the way to go is module federation. But we're having a hard time loading it dynamically on the server side. What do you think? |
Module federation looks to be a better approach for plugin based architecture. |
Got it. I'm thinking about a center registry (similar to npm) that host all the remoteEntry.js of the plugins, at registry.webcrumbs.org. So, what we see today as localhost:800x, would eventually become registry.webcrumbs.org/plugin-name/v-1/remoteEntry.js, or something like that. Then, as long as we have a database with all the plugins and urls, it should work, theoretically. But to avoid rebuild, this would be loaded dynamically (run time), i.e., without registering all plugins in each website every time a plugin is updated or included. This is being done in experiment-1. But as is it is loading on the client-side, which is bad for UX and SEO. We may find the solution at one of the module federation examples the team placed in this GitHub repo, I hope. |
Makes sense. |
Sure!! Not server side, but I'm saving here the idea to explore using import maps from SystemJS together with lazy load, for loading the 'database of all the plugins and urls'. Just crossed my mind. To be studied. Cheers! |
Hmm, just read about it. SystemJS is also a dynamic module loader which support dynamic imports and bindings |
Great, @aditya4196! Let us know how we can help. This one is key. |
Got it! |
I'm sorry for the delay in getting this task done. I was working on the database schema. |
So for the central registry for all plugins solution in future, the plugins would be rendered at the client side for every app a user creates. Would it be through the url endpoint in the remoteEntry.js? If yes for the first one, I'm a bit unsure how the plugin instance management be handled. And other issue which is a drawback of module federation i.e, Network Latency at client side For the second one, I will make sure to put up something together by tomorrow |
Don't worry, @aditya4196. This one is a challenge and will invite important discussions. I'm also taking a look, and @rovoskarl may have inputs too. So, ideally it wouldn't be downloaded locally (can be cached for speed) but it would compose in the server by the users app at runtime. Challenge. |
I'm sharing this on server side rendering micro frontends. It talks about caching too: |
Regarding composing the plugins in the server by the users app. That would make that particular plugin as a central point of expose to multiple users right? |
The envisioned scenario:
I know of the challenges. It would have to be:
|
Got it. |
No, please ask. This is really the difficult point! Ow, did you receive the newsletter? |
I missed to sign up for it. |
I think you may like it. I can send you again, if you want. |
Sure!! |
Nice! After you subscribe here https://www.webcrumbs.org/ let me know and I'll resend it just for you |
Thanks. |
Hi @aditya4196, I've committed an initial SSR setup in the new branch |
Im gonna try it out tomorrow morning and will update you |
|
Sorry @webcrumbs-community for lack of attendance. I was gonna deassign it as I was stuck in an interview process for past 2 months. But Im gonna be free from that process early next week and then Im gonna update on this task!! |
Awesome @aditya4196 ! Thanks for coming back. |
As we're diving into the new terrain of server-side loading with Next.js, we're also on the lookout for existing methods or libraries that could be beneficial for our issue #103.
Related to discussion #91
What Needs to Be Done?
The task is simple but crucial: compile a list of existing methods and libraries that enable server-side loading of remote modules in Next.js. Think of this as the scaffolding for our issue #103.
Why Is This Important?
Why do the legwork, you ask? Well, this research sets the stage for a more efficient and effective implementation of server-side loading in our upcoming experiments.
Skills Needed
Requirements
/research
Here's another chance to make an impact on the future of WebCrumbs. Take a peek at our GitHub repo and let's get this research train moving!
The text was updated successfully, but these errors were encountered: