WebStorm AngularJS, Angular CLI, React Native & React App - javascript

I couldn't find an answer to this... so, when I open a new project in WebStorm I have the 4 options (and many more) mentioned above - AngularJS, Angular CLI, React Native & React App. I have found out that Angular CLI is corresponding to Angular 2.
My question is: which of the 4 or maybe another option I did not mention here is corresponding to Angular 4 which is the newer version of Angular 2 as I understand it.
Also, if someone can please help me understand better the difference between the 4 options I have mentioned: which should I use and for what purpose? For example if I want to build a minesweeper game, which of the three would you choose?
Also, in my search I've found that React Native is for mobile use (apps) so what is the difference between that and React App? And is any of these are suitable for creating a game in PC browser (and not on mobile)?

1.'Angular CLI' option allows creating Angular 4 project using Angular CLI
'AngularJS' option just clones https://github.com/angular/angular-seed - a project stub for Angular 1 application
'React Native' creates a React Native project stub using react native cli
'React App' creates a React project stub with create-react-app
React itself is a JavaScript library; React Native allows creating mobile applications using React library + native components. If you like to create a web game to be run in browser, you don't need react Native. You can use React, or Angular.x, or any other JavaScript framework that supports creating custom UI components

Related

Micro-front end web app using webpack, react and angular(latest version)

I want to create a web application using JavaScript frameworks. The basic idea is to create a simple navbar through which we can switch to Angular and react module. I want to use webpack as a base library for hosting front-end app. For state management, I want to use rxjs
Can anyone help me in that?

Continue building React project with newer version

I have a really big project with React version 16.6.0 with Class components...
I would like to upgrade the project to a newer version of react (18 for example), but the code base is so large, just can't change it all. So I thought of something like creating a new react app, but how can I connect these 2 together, I need some advice.
I've encountered a similar situation when I had to add features to an old react app.
Fundamentally React, by design, is incrementally useable, i.e., you can use React only in certain parts of the app and the rest can be anything. Similarly, you could use Hooks & Functional Components in a incremental way.
Start by using Functional Components & Hooks only for the new features that you add. Later if you want to make changes to existing features try to rewrite them with FC one by one.
You DO NOT have to start with a new react app from the scratch.
Without a new app
Upgrade to react 16 latest version.
React 16.x versions greater than 16.8, such as 16.14.0, would be a good choice for you. No major breaking changes, and with react hooks(advanced functional components) support.
Using multiple react versions.
Checkout
https://medium.jonasbandi.net/hosting-multiple-react-applications-on-the-same-document-c887df1a1fcd
https://betterprogramming.pub/6-steps-to-create-a-multi-version-react-application-1c3e5b5df7e9
With a new app
Mix two react apps with an Nginx server.
Place all your new pages inside a subroute, such as https://my_domain/new/*, then configure your nginx server:
{
location / {
root /old-html;
}
location /new/ {
root /new-html;
}
}
You need to handle authorization in the new react app, though.

If I build a component in the latest version of Angular, can that component be used by apps built with earlier Angular versions?

I would like to build a component using the latest version of Angular.
However, the goal is for that component to used in two different Angular applications - one built with Angular 6, and another build using Angular 10.
Is that possible?
In other words - can my component, once built, be used in apps built with earlier Angular versions?
Or, do I need to build the component using the same version of Angular as the application(s) that will include it?
Thanks in advance.
Turns out that the answer is no:
From here:
https://angular.io/guide/creating-libraries#ensuring-library-version-compatibility
The Angular version used to build an application should always be the
same or greater than the Angular versions used to build any of its
dependent libraries. For example, if you had a library using Angular
version 12, the application that depends on that library should use
Angular version 12 or later. Angular does not support using an earlier
version for the application

use react component in angular 4+

We have an existing react application (.JS not in TS) that has components that renders SVG graphics with user interactions and we are now thinking to use these components in an angular application. Can we use react components directly in angular 4+ application?.
We have tried to use the available solutions but failed with various of reason...
1) ngReact --> We are getting support to use this in angularJs 1.* applications , however we are targeting to use in angular 4+ (https://github.com/ngReact/ngReact)
2) angular-react --> we tried to use this ,and here we need to convert react application as react library and again we need to create custom modules to understand the angular-react to use the existing components.( https://github.com/Microsoft/angular-react)
do we have any direct solutions to use the existing react components in angular applications? Will that turn out to be a good approach long-term?

can React native use JavaScript remotely?

I am new to React Native, and I understand React Native injects JS to a JavaScriptCore. By looking at the examples or new react app, I can see the JavaScript is hosted in localhost:8081. In release/prod version, JavaScript files shipped within the app.
Can React Native use some JavaScript(React JS) from server in production? (like WebView which can load any html locally and remotely)
It would be great if we can deploy new UI without App release.
Thanks in advance.
Yes. Its possible to update new UI without App release in React Native.
We need to use react-native-code-push library to enable dynamic app update.

Categories

Resources