kandi X-RAY | micro-app Summary
kandi X-RAY | micro-app Summary
微前端的使用
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of micro-app
micro-app Key Features
micro-app Examples and Code Snippets
Community Discussions
Trending Discussions on micro-app
QUESTION
I have an npm project with the following structure:
...ANSWER
Answered 2021-Feb-13 at 08:50I think the problem has to do with the import or the pack, I ellaborate below with the steps to follow.
Also, make sure that you are exporting all the classes that you want to make available from the outside.
For TypeScript libraries
You can simply use "tsc" and then pack the generated code inside the dist folder with "npm pack" and install the dependency in your application with "npm install ".
This may get complicated due to the different module systems and bundlers, check this links for more info on Webpack:
https://marcobotto.com/blog/compiling-and-bundling-typescript-libraries-with-webpack/
https://webpack.js.org/guides/author-libraries/
For CSS libraries
The "npm pack" has to be executed in the root folder. You may want to process your styles with sass before and only pack the result.
For Angular libraries
By default with Angular CLI when you build a library project the code is generated in /dist/mylibrary folder.
If you want to use that code in other project, the steps are:
- Build your library with "ng build mylibrary" (add --prod for production).
- From your library, move into /dist/mylibrary folder and then execute a "npm pack", that will generate a tgz package.
- From your application in which you want to use the library execute "npm install " to install the dependency.
- To import code from the library use "import * from 'mylibrary'"
Other option would be using "npm link", that creates a link between your node_nodules and the library code as explained here:
https://www.willtaylor.blog/complete-guide-to-angular-libraries/
That would be the way to go with local libraries, usually these libraries are published into Npm repository (public or private) and installed remotely with "npm install ". These steps are only for local usage.
QUESTION
I'm currently having a go at Angular Elements to make micro-apps. This all works fine and the process of including my micro-app into the container application works fine, but I'm having trouble when trying to increase the complexity of my micro apps to allow them to have their own router outlet.
I have added a router outlet into the main component of my Element and it does route through the components I have created but it changes the top level URL of the hosting application.
I was wanting to have this application route independently of the main application, and I tried this by using a named router outlet in my extension app and adding that name to the routes, but this resulted in an error saying the path could not be found.
Is there something obvious I am missing here, or is what I'm trying to do not yet supported by Angular Elements? All of the articles I have found online do not mention the router at all when showing how to make Angular Elements.
Thanks!
...ANSWER
Answered 2019-Nov-26 at 11:32For anyone who comes to this question - I found a great article that I managed to follow to get what I needed from this.
https://medium.com/@timon.grassl/how-to-use-routing-in-angular-web-components-c6a76449cdb
The gist of the article is that you can use a named router outlet inside the element app. You then choose either to use the RouterTestingModule to handle routes and not have the overall application URL change on nevigate, or do some poking around to get the named router outlet to affect the URL. Well worth a read.
QUESTION
I'm pretty new in developing Angular (7), because I think about the architecture for a new large web project. So I play a little bit with the possible options, especially using a micro frontend.
I created two angular projects -> "micro-app-shell" and "micro-app-a".
The shell is the outer container of the web application, which manages several micro-apps.
I read some articals about micro apps with angular and want to try the custom-elements approach.
"micro-app-a"
excerpt of "app.module.ts"
...ANSWER
Answered 2019-Jan-06 at 17:37You check my sample project here https://github.com/xmlking/angular-elements-in-angular-shell I am still planing improve developer experience
QUESTION
Under a Microservice Architecture, I am implementing 2 different micro apps: one for users administration and another for tasks administration.
User Microservice:
Under this micro-app I am defining a User
model which holds all the information of the user object in the database.
Task Microservice:
Under this micro-app I am defining a Task
model which holds all the information of the task object in the database, plus the user reference in the task.
Since the application is developed under a Microservice Architecture, the User
, and Task
models will reside in two different micro-services, and given that any task contains a user reference, I am obliged to define the user model in the Task microservice too, and this is contradicting the loose coupling concept and is a bad approach for the maintainability of the application as a whole.
ANSWER
Answered 2018-Aug-24 at 04:15When you are working you split your application down into services based on certain guidelines( be it biz driven or logic entities being together) and this will lead to similar problem as you have mentioned. My take on that is when you working on your service you want to take control of what your view of that service is. User service is free to define task as they seem fit and you may use User as is or you can change user model as suited for Task service. Important thing is you get to decide (ofcourse aligned to the User service). They are source of truth for user and you are for Task.
Your view of User is built from what ever User service says but you can structure it way you want to. So you do have to define User model but it not tightly coupled. Important thing for you is to make sure that you never share your model of user out to the world. Always the reference.
User service is free to add anything to the user model ( and remove provided others are not using and if they are, User service is breaking a contract) And you are free to pick and choose from the User Response you get from user service.
Thats how two are decoupled. If you talk about code redundancy, where in different services have to create a user model and make api calls and handle failures, well thats a different issue, and you can mitigate it by asking services to expose packages with models and basics calls.
QUESTION
I've been told by Google that "Your app (com.package.name) includes a ZIP file which contains ELF files." I have searched my project. I haven't used a zip file or ELF file anywhere in my project. Thus, it must be in one of my dependencies, but I don't know which one.
I used the following dependencies:
...ANSWER
Answered 2018-Sep-26 at 07:52I don't know for sure. But looking at your dependencies, when I google for AppsFly it seems like a platform which delivers dynamic code to apps. And Google Play policy says (as you quote)
An app distributed on Google Play may not modify, replace, or update itself using any method other than Google Play's update mechanism.
So using AppsFly might be against the Policy. To clarify, I know nothing about AppsFly as their website doesn't have much information, but it sure sounds like it breaks the Google Play policy.
QUESTION
There are a bunch of old SO threads dealing with running NodeJS on Android. Most of these are no longer viable (JXCore) and/or provide confusing, outdated, incomplete, or erroneous information.
Therefore I have investigated what seems to be currently (as of August 2017) viable approaches and found three likely candidates.
To decide between them I would like to know:
- the primary differences between these approaches
- specific pro's and con's on each approach
- likely hurdles, challenges and shortcomings
- do you know of other viable alternatives?
Viable approaches are:
- Running V8 javascript engine which includes NodeJS (J2V8)
- Use NodeJS directly, embedded as native library (node-on-android)
- Combining React Native with NodeJS app-as-a-service (react-native-node)
Besides that I have found a number of related interesting resources:
- NPM install NodeJS directly using Termux without rooting (not for end-users)
- LiquidCore - native mobile micro-app devenv (not investigated, interesting concepts)
- dna2oslab - has a working NodeJS build script for node executables
- Building NodeJS for Android - blog with useful compilation tips and example project
ANSWER
Answered 2017-Aug-03 at 05:30I received an answer from @dna2github, the creator of NodeBase (thanks a lot!) that I'll include here (with permission):
Hi,
Thx for your question. I will do a brief answer in my view.
1. Running V8 javascript engine on android which includes NodeJSpros:
- integrated with Java world; can get full control of code.
cons:
- a little hard to integrate with 3rd packages (need time to learn how).
- need to learn about NodeJS and V8 things and also J2V8 docs (it consume long time).
pros:
- focus on js dev and no need to consider android side.
- less learning time; similar to Cordova phonegap ....
cons:
- js app => apk is a black box.
pros:
- flexible
cons:
- no gui
Not familar with LiquidCore; build micro service especially from url, I think, is to resolve no direct available storage on iOS. react-native-node the Android part is based on NodeBase method and use the prebuilt binary.
For NodeBase:
pros:
- similar to 3; difference is that it has its own gui to start/stop app.
- it can be a template for everything; for example, if would like to run django, you just need to replace node to python; rails, ruby...
cons:
- native process access problem; the process cannot inherit access from Android app.
- happy toy happy open source not like a commercial app; need more design if want to distribute to customers
At first, I run node in terminal; I find only dev can easily to use it to start js app. My friends and families also wanna some tools for example make water mark on picture in batch. NodeBase is created for them to easy to start/stop app. Then they just need to open browser to use it. My another idea to create NodeBase is that we can build sharable applications that can be shared in the same Wi-Fi. When host starts an app, it can be visited by near people. Then they can work and play together. For example, we play werewolf and when there is no judge, we will start the werewolf app to have a judge for the first round. We can also share files between devices via download/upload.
For me, I can build what I want flexibly for example, I would like to make my Android as a machine learning runner; it can help me run machine learning programs at anytime (with node and python, thus in my another repo: dna2oslab is focus on building binaries) to make use of phone running time.
For you, if wanna port your app in a short time, I recommend 2; if you have time and other resources, 1 is better. 3 if you just make a toy/demo. 4 other is always possible and just do your imagination to create works.
Best wishes, Seven
QUESTION
I'm trying to understand Phoenix 1.3 contexts.
I understand the separability into contexts (which in my mind I perceive as micro-apps, with clearly defined API boundaries), but I struggle when trying to figure out how to do a many-to-many relationship between them.
In the case of building a slack clone, a User can have many Chatrooms and a Chatroom can have many users.
In the 'model' based way of doing it, you would create an intermediate table user_rooms (with fields user_id, room_id), and then do join_through
.
What's confusing for me is:
- If I'm supposed to keep these are truly isolated, do I really want to be joining tables? There's nothing separate about that.
- If I have to keep my intermediate table user_rooms, what context should that go in?
(for background, I'm trying to do Step 4 of this https://medium.com/@benhansen/lets-build-a-slack-clone-with-elixir-phoenix-and-react-part-4-creating-chat-rooms-80dc74f4f704)
...ANSWER
Answered 2018-Aug-04 at 22:06One way to think about contexts is to view them as a layer of abstraction when you are designing your app. As it is put in the docs,
Phoenix projects are structured like Elixir and any other Elixir project – we split our code into contexts. A context will group related functionality, such as posts and comments, often encapsulating patterns such as data access and data validation. By using contexts, we decouple and isolate our systems into manageable, independent parts.
Models themselves with their underlying schema are therefore the units which you group into contexts. Models can have more fine-grained api which is necessary for their inner workings. Contexts in turn only expose methods which are useful to other application components or contexts, thus hiding the underlying implementation detail of the models.
It is not necessary to extend the context boundary down through the models level for absolute isolation. Instead you create your schema as usual, with all the many-to-many relations you need on the models. Then implement whatever low-level methods on the models directly. Put in the context only those methods which are either public api of the context or private methods touching more than one model.
UPDATE
In your scenario you might have e.g. Chats
context where you put the rooms
method. Its signature might be e.g. Chats.rooms_of(user)
. Repo.get()
also goes to the context as, e.g. def get(id), do: Repo.get(User, id)
. The models end up containing changesets, validation methods, private methods with no dependencies to other models. The context in turn gets most of the group's publicly available business logic methods.
QUESTION
I'm running into an issue with latency when using a set of micro-apps on EB with the load balancer. This issue is specifically with one nginx powered app trying to hit another app on ELB. If we hit the API using postman it's fast, but posting to the endpoint through nginx-lua is incredibly slow comparatively.
My requests are being proxy_passed by nginx-lua (openresty) for security purposes, along with a rewrite being done in nginx. Ex (changed paths and variable names)
...ANSWER
Answered 2018-May-21 at 15:54So the issue ended up being a problem we could fix by updating our resolvers.
In the location block we specified the resolvers for amazons DNS service, while we left the other resolvers the same to work for some internal proxy stuff.
This is now giving us the expected speed.
QUESTION
I've been working on a project in Asp.net for a few months and trying to slowly replace the frontend from razor to Vue. Currently, I have an issue where I want to communicate between a page and a partial component. They are in separate files so it seems like my best option to speak to them is through Vuex. I've only used Vuex a couple of times but really like what it does.
My problem is that every page I've created in the current application is broken into its own new Vue instead of encompassing the app into one Vue application (This was done because I was slowly moving from razor to Vue, I hope to eventually embody everything in one Vue frontend)
Is there any way for me to call Vuex between two separate Vue micro-applications?
...ANSWER
Answered 2018-Apr-23 at 15:14You have to add the store
to each Vue instance:
QUESTION
I would like to bootstrap an Angular 4 micro app multiple times on the same page. Basically, foreach instance of class ‘.angular-micro-app’, bootstrap a new app instance.
I understand that traditionally these would be Angular components within a single parent App. In my case, that is not possible and I need multiple instances of the same root level app (component), on the same page. This was fairly trivial with AngularJS 1.x, but is proving rather frustrating with Angular.
Example:
index.html snippet:
...ANSWER
Answered 2018-Mar-07 at 04:29This can be accomplished by manually bootstrapping your root level component(s) in the NgModule ngDoBootstrap method.
(Note that in Angular 5+ this method may no longer be required, see this Angular PR)
We first find all root elements we want to bootstrap and give them a unique ID. Then for each instance, hack the component factory selector with the new ID and trigger the bootstrap.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install micro-app
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page