Open strigefleur opened 1 month ago
In a barebones Angular 16 and 17 app, as soon as I add the ng-zorro-antd package, native federation errors and the app fails to serve. Not to jump on your ticket, but I'd also like to see for native federation.
@adchsm well, you can bypass initial native federation issues by manually importing problematic packages to devDependencies and then adding same list to nf skip:
'd3-shape',
'd3-drag',
'd3-selection',
'd3-zoom',
'd3-transition',
'dagre-compound',
So unless you have to deal with singleton this and singleton that, it's gonna work.
Also I did some research on providedIn: 'platform'
and it appears to provide more issues than solving: due to being 'platform injector' it's not just copy-paste replacement. Perhaps my initial issue is solvable by correct provider import layers between mfe and shell, omw.
What problem does this feature solve?
Frontend federation makes it so that one shell-app loads multiple module-apps. NgAnt has some features (NzMessageService, NzNotificationService etc) that appear to be root-bound via
providedIn: 'root'
decorator options and thus leading to multiple instances of same module loaded within federated frontend.As of Angular 9 there's
providedIn: 'platform'
decorator option that should replaceprovidedIn: 'root'
in such cases I suppose.As far as it's impossible to create service of 'platform' level having internal 'root' level dependency it's show stopper for some scenarios involving NgAnt framework.
I'm not sure that's the only concern that should be cared of so would love to have some feedback.
What does the proposed API look like?