valorkin / module-federation Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
Add a demo where we inject Angular Component from Angular application built with MF into SAP UI5 application with Custom Elements version of Container Injector
why: In current implementation this modules aren't compatible with ng-elements compile because are in commonjs
format and has circular dependencies
if possible make a PRs to original repositories
to avoid waiting for open source we could temporary publish our versions
Acceptance
@fkolar commented on Fri Oct 02 2020
Describe what can be seen here in this repo and what to find where so our application developers can better navigate thru this.
We are planning to add generator of client libraries based on data provided in remote container definition and components metadata
We are planning to generate libraries for:
Acceptance
Remove iframeuri\iframeAttr inputs from plugin launcher
why: we should work only with manageable resources and not hardcoded URIs in html
Acceptance:
@ZhmenZH commented on Mon Oct 05 2020
Module federation way is more to use components bindings just like you would use it in Angular or any other framework and less using message-bus. This applies regardless if we are dealing with Angular based plugin, Web Component or any other framework.
We should enable PluginLauncher with Bindings support so application can pass and read data in order to communicate more natively with the target application
Ideally we want something like:
<fds-plugin-launcher name="Basket" [bindings]="MapKeyValue" events="MapWithEvents"> </fds-plugin-launcher>
<fds-plugin-launcher name="Basket" sectionTitle="This is basket details" (click)="OnAddToCard($evemt)"></fds-plugin-launcher>
We should enable it to read inputs & outputs from the instantiated component or from created web component element and connect this with attributes on the host <fds-plugin-launcher>
component
@valorkin commented on Mon Oct 05 2020
mostly research and documentation to start with
via ngAst or via angular language service
element schema can be generated via custom angular builder, or meta-ui
@fkolar commented on Wed Oct 14 2020
The same like the other tasks M3
why: service
term used outside of angular context leads to a confusion
Convert Angular Containers Injector to Angular elements (this part already done)
Acceptance
@ZhmenZH commented on Mon Oct 05 2020
If a host can’t import a module when it tries we return a blank module or not allowed callback and registration
@valorkin commented on Tue Oct 06 2020
each launcher will have it's own onerror handler, if downloading of module\iframe\webcomponent downloading fails
3 retries by default, and globally configurable
and generic error handler on top of it - maybe
bubble up such events to developers to the top shell
each launcher should have @output() load and @output() error
describe lifecycle
@fkolar commented on Wed Oct 14 2020
@skocharian Let's move this one to M3
and remove all unneeded artifaces from repository
npm:
whem iframe uri provided via plugins.json
@devikiran commented on Wed Nov 04 2020
The current structure has mutiple config file which have mf urls in different locations,
for example:-
1.webpack.extra.js (publicpath)
2.app.routes.ts
3.plugins.json
4. protactor.conf.js
the url changes for diff environments like dev,qa,stage,prod....
as a developer its difficult to maintain the urls in different location and change the urls manually for every environment
,we should start having these in a central location and read it from there.
ref:-
https://github.com/valorkin/ng-mf-submodules/blob/master/packages/one-bx-shell-app/src/app/app.routes.ts
https://github.com/valorkin/ng-mf-submodules/blob/master/packages/nx-app/webpack.extra.js
https://github.com/valorkin/ng-mf-submodules/blob/master/packages/one-bx-shell-app/src/assets/config/plugins.json
https://github.com/valorkin/ng-mf-submodules/blob/master/packages/ngrx-app/e2e/protractor.conf.js
why: consumers should be able to provide and update Containers Configuration in runtime
multi: true
@optional @InjectableToken to provide Remote Containers ConfigurationAcceptance
@skocharian commented on Wed Sep 30 2020
Create generate schematics that will preconfigure webpack config. But this should have a dependency on current mf-builder work, if we get more closer to the ng commands - so this one probably has a lower priority than the other tasks. Low priority
Once MF: Resources & scss is done we need to automate this with set of schematics.
Create schematics that can generate Webpack configuration based on the angular JSON
-- New project: @fundamental-ngx/app-shell:ng-add
-- Existing project: @fundamental-ngx/app-shell:generate schematics
Reorg- existing angular structure to match our ng-mf-submodules
@fkolar commented on Wed Oct 14 2020
@skocharian let;s move this to M3, as this will have dependency to a task where we integrate CLI build with ngx-build-plus
@skocharian commented on Wed Sep 30 2020
update Gitbook with clear guidelines how to get:
@fkolar commented on Thu Oct 29 2020
Should we get technical writter for this? Now we have 2 of you full time and me working on this from like 30%.
Split God class injector into a set of injectors
why: this should be a plugable architecture, on order to be able to easily add support for ui5\react\etc.
Acceptance:
Cover all moving parts with documentation
gitbook + some website deployed as gh-pages
@skocharian commented on Wed Sep 30 2020
Create or extends configuration to keep it apart from the way we have (as part of the plugin), so plugin permission can be loaded by one-bx-application. It will list different permission defined by one-bx-developer or microservice, such as:
• Permission to listen to theme change
• Can talk to AppShell
• Can talk to other apps (app:event)
• Can propagate errors to app:shell (for the application - plugins)
• Can create custom Topics
Depending on what permission is enabled we need to update existing code inside PluginManager to add or remove certain topics from the list or enable or disable creating certain topics. or Drop communication (Publishers, Subscribers)
We can maybe just extend our plugins.json for new property permissions: [xxx, aaa, ccc] and this can be quick.
@skocharian commented on Wed Sep 30 2020
Once MF: Resources & scss is done we need to automate this with set of schematics.
Remove iframeuri\iframeAttr inputs from plugin launcher
why: we should work only with manageable resources and not hardcoded URIs in html
Acceptance:
Export loadRemoteEntry
and lookupExposedModule
from root exports so it could be consumed without deep linking
Develop Web Components Container Injector
why: ng-elements is an angular application in a nutshell and in this case we should benefit from building it with webpack 5 Module Federation and distributing with shared angular dependencies
Before start:
Acceptance:
@fkolar commented on Fri Oct 23 2020
Currently we use helper method loadRemoteModule
to load remote module and all this works well but when you try to turn this into lazy imported module, where you also add declaration into decl.d.ts its is still does not work.
loadChildren:
// todo_valorkin this should work when we switch to cli builder
// () => import('contentItemApp/ItemPageModule').then(m => m.ItemPageModule)
() => loadRemoteModule({
uri: 'http://localhost:4202/remoteEntry.js',
name: 'contentItemApp'
}, {exposedModule: './ItemDetails'} as any)
.then(m => {
console.log(m);
return m.ItemDetailsModule;
})
},
@skocharian commented on Wed Sep 30 2020
why: this will hold us back in non angular environments and has over complicated structure not compatible with frames communications (objects)
and all unused artifacts after this, like Theme Manager Service
Acceptance
Add an injector which supports injection of UI5 components via injector
Push all this repositories in one monorepo https://github.com/valorkin/module-federation
It became obsolete and we don't need it anymore
why: while we are supporting remote container configuration providers, we should move out of Maps usage, to not convert json to maps on each load
In:
Acceptance
Deploy all our demos to firebase and configure configs, so you could consume local or remote MFs
@skocharian commented on Wed Sep 30 2020
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.