Git Product home page Git Product logo

Comments (12)

dkhrunov avatar dkhrunov commented on June 10, 2024 1

Now i need time to figure out a solution, I m comeback when have solution.

Have you example repository?

from ngx-mfe.

dkhrunov avatar dkhrunov commented on June 10, 2024

Can you load your config when app is starting?

For example:

@NgModule({
  imports: [BrowserModule, HttpClientModule],
  declarations: [AppComponent],
  bootstrap: [AppComponent],
  providers: [{
    provide: APP_INITIALIZER,
    useFactory: loadConfig,
    deps: [HttpClient],
    multi: true
  }]
})
export class AppModule {}

from ngx-mfe.

out-dev avatar out-dev commented on June 10, 2024

Yes I can but if forRoot(xxx) is called the providers gets overriden right?

Or what is your idea?

Ps: Great response time ;-)

from ngx-mfe.

out-dev avatar out-dev commented on June 10, 2024

Unfotunatly "@angular-architects/module-federation" does not provide already loaded MFE Manifest

from ngx-mfe.

dkhrunov avatar dkhrunov commented on June 10, 2024

Yes I can but if forRoot(xxx) is called the providers gets overriden right?

yes

Or what is your idea?

I collect all requirements of your problem, and try to form a universal solution that would suit not only your case

from ngx-mfe.

dkhrunov avatar dkhrunov commented on June 10, 2024

Can you give me more code with your sample ?
Have you example repository?

from ngx-mfe.

dkhrunov avatar dkhrunov commented on June 10, 2024

You want load MFE Manifest and provide it to forRoot({ mfeConfig: ##here## }) as Promise or Observable, right?
Or you want load all config for configure lib forRoot(##all config as Promise or Observable##)?

from ngx-mfe.

out-dev avatar out-dev commented on June 10, 2024

Currently my MFE configuration comes from an Api call.
I would like to use the result for the following configuration NgxMfeOptions['mfeConfig'].

I can make the API call in the APP_INITIALIZER or in a factory but how can I use the result in forRoot or make it known to the MfeModule for configuration?

Or am I completely blind?

from ngx-mfe.

Pigzields avatar Pigzields commented on June 10, 2024

Hi,
currently I have implement microfrontends with @angular-architects/module-federation and using the manifest concept so basically using loadRemoteModule method in routing with type = 'manifest'

If I implement this library is it possible for ngx-mfe to read the manifest directly as anyhow loadManifest is called in the main.ts ?

from ngx-mfe.

dkhrunov avatar dkhrunov commented on June 10, 2024

Hi, currently I have implement microfrontends with @angular-architects/module-federation and using the manifest concept so basically using loadRemoteModule method in routing with type = 'manifest'

If I implement this library is it possible for ngx-mfe to read the manifest directly as anyhow loadManifest is called in the main.ts ?

Hi, idk, I haven't worked with the mfe concept in production for a long time.
Can you provide me with a code sample or repository, it's hard to answer a question without diving into the problem.

from ngx-mfe.

dkhrunov avatar dkhrunov commented on June 10, 2024

@out-dev Hi, you can now try to load your config asynchronously [Pull request #19], like this:

MfeModule.forRoot({
  mfeConfig: {
    useLoader:  (http: HttpClient): Observable<MfeConfig> => http.get<MfeConfig>('/manifest.json'),
    deps: [HttpClient]
  },
})

Update lib to v15.1.0.
Read more here

from ngx-mfe.

out-dev avatar out-dev commented on June 10, 2024

Will try it out :-)

from ngx-mfe.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.