Extjs 5 multiple application with central library - javascript

Recently i've been exploring ExtJS 5 and making some applications with it. I've been using the Sencha CMD to generate a new application every time and the problem i see is that every application needs the whole ext framework with all the classes (which in total is 123MB, which is quite alot when you have 10+ applications).
Since there is no way for me to make 1 application with multiple subapplications (since i also have other, non-extjs, applications running on my local website), my question is rather simple: Is there a way to let all the applications use the same extjs framework build? for example in a /lib/extjs/ folder in my root?
I've looked through the sencha forum and documentation already, but i found nothing that suggests this is possible. I saw that the bootstrap.js has all the paths to the extjs framework, however if i have to manually edit all these, its going to be very time consuming..
Thanks in advance.

The solution to the problem is to create a workspace:
sencha -sdk /path/to/ext generate workspace myws
cd myws
sencha -sdk ext generate app MyApp myapp
The above copies the library to myws/ext and all application in this workspace use the same copy of Ext.

Related

Angular app, Inside an Asp.Net Core Project, pros & cons

I would like to create a Single Page Web App with Angular but I couldn't decide to project type.
(Just generated files by tools like angular-cli or that generated files inside an Asp.Net Core Project)
I got some question.
What are the advantages and disadvantages of building angular app on ASP.NET Core Project?
Which cases I should prefer to locate angular app inside a ASP.NET Core Project?
I'd like to take a stab at this. I'll agree that the answer is on some part opinion based though.
I have just been comparing the two versions for a new project that I am involved in.
First some facts
The Angular project created inside of the ASP.Net core application is in no way dependant on the .Net code. You can navigate to the directory and type ng serve and run it by itself.
You can copy the angular code to another directory or repo and host it by itself if you for some reason later on decide that you don't want to combine it. All you have to do is copy paste the angular code, and then remove some lines in startup.cs regarding the internal hosting.
The code that gets added inside of the asp net core template is close to the base angular app with a few examples added on.
If you use the login functionality template it implements an oidc client, and an identity server on the back end, (opinion) pretty much the same way I would have done it myself. There is nothing stopping you from rewriting it if you don't like it. At worst it's a good example of how it can be done.
As of today the template is using Angular 8.0.0, you can just change the package.json to get the latest version and run npm install. It works great.
You can still use Visual Studio Code for the Angular parts with a combined project.
Here are when Id choose the different versions (warning opinions ahead).
When to choose the asp.net core angular project.
Small web app with limited functionality.
Small team, probably same person writing angular code as api code.
If you are unsure. You can always split later.
When to choose separate apps.
Big team with deployment builds and automation.
If you want to host angular and asp.net core separately (for reasons such as to achieve maximum performance and load balancing in apps with thousands of visitors).
Separate people coding angular and asp.net
You don't like having it all in same repo and want to split it up.
In a bigger teams and contexts with multiple APIs you will probably have to deal with CORS anyways, but if not you will have to at least think about it for this to work.
If you are unsure, you can always combine it to one app later.

Angular2.JS files with d.ts files WITHOUT npm Visual Studio 2015

Does anyone know of a recent blog post or tutorial on which angular 2 .js files along with the appropriate d.ts files I need so I can just drop them into an existing VS solution without using NPM? I see that I can get the angular files here, but not sure which ones I need. According to the Angular docs, I need do nothing to get typings files for library packages that include d.ts files—as all Angular packages do., but again, when I look thru a sample Angular app, don't know which d.ts files I need.
I can't stand bloat and clutter. Below is a brand new asp.net core on .net 4.6 on the left, the same thing on the right after following this blog:
I can't stomache having to add over 13,000 files to get ahold of maybe 20?, 30? files.
Maybe I'm being too OCD about this, but right now I'll take any suggestions to avoid that bloat, even going with another front-end framework. I've briefly looked at Aurelia, which I like, but again, NPM. Not sure React is appropriate.
My business domain includes Category, which is a self-referencing class/table, and I'm after an intuitive UI where the user can quickly create their own Category structure without having to do a bunch of post-backs to the server. Seems with either Angular2 or Aurelia, I'd only need a couple of Components to accomplish this in the browser.
I know Angular 1.5 added Components, and I may explore that if need be. From what I understand about React, it's not for data management.
So to reiterate my questions, can I get just the Angular2 files along with their d.ts files so I can code in typescript? If not, the same question for Aurelia. And if not, any way that I can keep bloat down yet still write some elegant front-end code.
Any help will be appreciated
Ok so for Development purposes yes your Angular 2 stuff will be massive (its annoying but necissary) however as I am sure you know, once you build your angular app for production (using angular cli for example) it cuts all those 40,000 files down to about 10. for example this is my application before and after production...
and after
So I would guess you want to build your angular stuff out first and then drop it in you application

Ext 6 without Sencha Cmd - how to drop an Ext 6 component into existing app?

First, I want to acknowledge the existence of this question:
How can I create several ExtJs apps without duplicating the Framework
However, you'll notice that, despite the title, the accepted answer is one using Sencha Cmd :).
With that out of the way, I have an existing application where I would like to make use of one or two Ext 6 components. This application will not be a "Sencha Ext JS application" in the sense that it was not initially built out with Cmd and I have no intention of refactoring to make use of Cmd. In fact, I would prefer that Cmd not be part of my build process if at all possible.
Is there a supported pathway to cherry-picking Ext 6 components for a non "Ext JS application"? With e.g. Ext 4 and earlier you could just include ext-all-debug.[js|css] and get going. It was also possible to generate a lean file for production using just the source files necessary without necessarily using Cmd.

How to add AngularJS 2 in existing Java Web project

I have some experience using AngularJS 1.x in .Net MVC application. In that project, we basically downloaded all required Angularjs min files and included them in project. We did not use npm or bower. It worked fine.
Now my next project is on Java Web application. This is an existing application with plain servlet/jsp. I want to use Angularjs 2 on new pages that I'm developing. But I'm not able to make progress on how to include Angularjs in this existing project.
Angular team recommends to use Typescript along with npm/gulp. But I want to stick to javascript and not introduce complications with TypeScript in existing project. I was expecting to download angular min files and include in my JSP and get going. Apparently I cannot even find link do download min files. New Angular website doesn't even have link to download them. I also looked up angular github but couldn't find min files.
I would appreciate if someone can guide me in right direction. At this point, I'm thinking to stick to 1.x instead of 2.0. Thank you.
Wow, that is so annoying.
You could try creating a test project using NPM, add the dependencies you need, and then build the project. From there, you could copy paste out the javascript files you need.
Hope that helps.
You can find angular2 versions prior to release here : https://code.angularjs.org but if you want the latest ones you will have to try Samuel's answer.
Besides, if you're doing this project at school and it asks you to use servlet / jsp, you should stick with it and use something like bootstrap for easier html/css.
Doing the frontend with angular might be considered a cheat or a workaround ( speaking from experience )

Trigger.io Collaboration

Hey I'm collaborating on a Trigger.io project and I'm curious if there is documentation on how to best do this? I have other guys who are loading my project into their environments (via github) using TriggerToolkit, and they can't run the projects because there are conflicts with identity.json.
We're working on a simpler way for team collaboration, but for now the process for importing and existing Trigger.io will be similar to the instructions here for one of our demo apps:
https://github.com/amirnathoo/Sales-Square
Basically each app you create has a unique src/identity.json file which is also specific to your account. You should avoid checking in your src/identity.json file and a collaborator should create their own by creating a new app and then copying your code into the src directory.
Update: we've now enabled better collaboration with our Projects launch announced last week:
http://trigger.io/cross-platform-application-development-blog/2013/01/15/introducing-projects/
This should remove the need to manually create / overwrite the src/identity.json file to share Trigger.io app code

Categories

Resources