Skip to content
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

Next 13 app dir #619

Closed
r34son opened this issue Mar 9, 2023 · 14 comments
Closed

Next 13 app dir #619

r34son opened this issue Mar 9, 2023 · 14 comments
Labels
area: Next Plugin ✨ enhancement New feature or request help wanted Extra attention is needed nextjs-mf nextjs-mf package identifier no-issue-activity urgency: Low

Comments

@r34son
Copy link

r34son commented Mar 9, 2023

Screen Shot 2023-03-09 at 15 12 48

is it planned to add support for next 13 app dir feature?
@ScriptedAlchemy
Copy link
Member

When its stable, yes - its a complex problem and quite low on the priority list at the moment.
Theres PR/Issues open around RSC support, but ive been busy with other things that have more immediate impacts to the userbase

@ScriptedAlchemy ScriptedAlchemy added help wanted Extra attention is needed nextjs-mf nextjs-mf package identifier area: Next Plugin ✨ enhancement New feature or request urgency: Low labels Mar 18, 2023
@matt-kruse
Copy link

Is this something that would be reasonable for anyone else to pick up, @ScriptedAlchemy , or is it complex enough that it's really on you? I really want to see this working. I've dug into it just a little and there's a lot of magic happening behind the scenes. I'll gladly keep digging unless it's a waste of my time. :)

@ScriptedAlchemy
Copy link
Member

Yeah anyone could pick it up, id help :)

I mostly know what needs to be done - just dont have the capacity to go through trial and error of it.

If we wanted to support, id suggest we try RSC with the stock webpack example from facebook. Get federation of RSC woring without next, then backport the concept back.

What needs to happen is 1 module needs to become two.

  1. normal ssr/client module
  2. RSC proxy module

So we need to make a way for exposed modules to export two possibilities, or we need to double expose them and pass one exposed file over the RSC loader

import thing from 'remote/myExposed_RSC' for example, the consumer needs to understand if they are RSC and if so theyd want to load the _RSC name off the entry.

If i had extra hands, im sure we could solve this without much pains. Trial and error takes time though. How next does this is via loader layers. So if the parent import is RSC, it knows the child import should be rsc proxy component.

When you expose stuff though, there is no parent in the same manner - so we need to apply the loader

@matt-kruse
Copy link

For me personally, I don't even care about RSC MF. I just want normal CSR run-time MF to work when using /app. I'm looking into the code to try to figure out why it's throwing errors with such a simple use case (one basic remote client component) but I don't know enough about the internals to find my way. I'll keep looking, because I'm interested in understanding and possibly helping.

@snitin315
Copy link

@ScriptedAlchemy I think a quick fix would be to add an option that can disable the auto-injection of defaults here:
https://github.com/module-federation/universe/blob/e4b85b537f74a52a48122bf3e9afe6729dc0f6e2/packages/nextjs-mf/src/loaders/patchDefaultSharedLoader.ts#L26-L31

Netx.js 13 expects use client; before any imports in a file, so, in this case, we can import defaults manually.

@ScriptedAlchemy
Copy link
Member

@snitin315 if you want to send me a PR, I'm happy to merge into v6

@ScriptedAlchemy
Copy link
Member

I'd also recommend looking at the async boundary runtime PR.

With next async, I no longer need auto injection, since shared internals now work

@matsgm
Copy link

matsgm commented May 16, 2023

App Router is now stable since NextJS 13.4 (May 4th, 2023)

@github-actions
Copy link
Contributor

Stale issue message

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 22, 2023
@matsgm
Copy link

matsgm commented Jul 29, 2023

Stale issue message

No

@dhalbrook
Copy link
Contributor

I'm seeing this error and I'm not using the app directory at all.

@ScriptedAlchemy
Copy link
Member

can you post repo or screenshot?

@dhalbrook
Copy link
Contributor

dhalbrook commented Sep 14, 2023

I realized I commented in the wrong thread. My bad... let me move this discussion.

@ScriptedAlchemy
Copy link
Member

#2002

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Next Plugin ✨ enhancement New feature or request help wanted Extra attention is needed nextjs-mf nextjs-mf package identifier no-issue-activity urgency: Low
Projects
None yet
Development

No branches or pull requests

6 participants