Sencha ExtJS 6.5.1 - Dynamic package dependency - extjs

I'm using dynamic package feature ("uses") to load packages dynamically in a classic toolkit app.
However, the dynamic package requires additional classes from another packages.
Building the app in production mode does not include those additional files (from second package) in the combined package file.
How can I add the required classes into the dynamic package build.
App
requires: ['packageA'],
uses: ['packageB']
PackageB
requires: ['packageA']
Currently only those classes are included (from packageA) which are requires by the App but not the once that are required in PackageB.

I think I was able to find a problem. I was using old style .sencha directory in the app which was using old build.xml file. I removed .sencha directory and updated the build.xml file from the latest ExtJS examples and it started to work correctly.
Now all dependencies from PackageA are loaded properly into app.js file.

Related

Creating a NativeScript custom UI plugin with TypeScript

I'm trying to create a custom UI plugin in TypeScript
Here's the steps I'm taking
create a plugin project in a local folder
write .ts files for custom UI in the plugin project root
generate .js files out of those .ts files with tsc command in the plugin project root
go to the test NativeScript project and run tns plugin add <local plugin path> to include the created plugin
But I get compiling errors at step 3 because I have importing statements as follows
import { ContentView } from "ui/content-view";
import...
I referenced an example here https://github.com/NathanWalker/nativescript-cardview/blob/master/cardview.ios.ts
My question is how cardview.ios.ts in the example 'nativescript-cardview' is being compiled to cardview.io.js? It seems impossible to do this...
In the plugin, you have referenced the author has created a demo app and is using the declaration file for tns-core-modules from that demo. Look at this line where tns-core-modules.d.ts is included in tsconfig.json
You can follow this practice for testing cases and for your release you can create a relative path to the tns-core-modules (and references) declaration files from the app node_modules folder like done here
As a side note noEmiOnError flag in your package.json will allow the translation to continue without hanging on errors.
Thanks for linking to your repo. NativeScript's docs state that "if you are using a transpiler, make sure to include the transpiled JavaScript files in your plugin".
Your package.json specifies cardview.js as the entrypoint, but your transpiled JavaScript files haven't been added to the repo. I solved this problem in my nativescript-midi plugin by committing the transpiled files in a \dist directory. The plugin is written in ES 6 but transpiled to ES 5 for consumption. To make sure that the src and dist directories remain in sync, I use a git pre-commit hook that automatically runs the build command and commits the results. If you clone the nativescript-midi repo, you can view it in .git/hooks/pre-commit . A benefit of using this approach for your plugin is that it will also allow it to be used by developers who are not using TypeScript.

extjs how to create production build?

I am trying to create production build through the command "sencha app build production"(sencha 5.1.3). It gets created but some of the view is not being served.can some one suggest that how I should ensure all the required js file has been loaded so that the minified app.js should serve fine. Or there are some other steps to create the production build.(I am using sencha 5.1.3)
In order to have all files included you have have to reference them somewhere with one of the config requires, uses, controllers, stores, views, etc.
Sencha cmd determines also the order of inclusion with these configurations.

Maven Project Organization

I am trying to create module within an existing multi-module maven project. This module will require Grunt, Bower, NPM, Angular JS, bootstrap among others. The output of this project (after the build is done) are static resources (fonts, js-files, application-js, application-css).
There is a separate Web module within the project that hosts the Web-Application portion of the Application.
I need to accomplish the following
Ensure that Maven can kick of the build of Grunt/Bower based UI Module.
Ensure that this module can be plugged in as a dependency for the Web Module.
So far, I have been able to figure out how to include a UI module as a dependency for a Web Project (via WEB-INF/lib/ui.jar...servlet 3.0 spec related).
Question:
What should the structure of the project be like to ensure that I don't copy unnecessary files into the JAR (like package.json or node_modules folder)?
Is there a way Maven can do an incremental build on such a project?
I am finding it hard to reconcile the two different project structures due to my own shortcomings I guess.

Ext deployed application: ext.js vs ext-all.js - what's a better option?

Looking at the deploy process for an ExtJS 4 application I performed the following steps (using SDK Tools 2.0.0-beta3):
sencha create jsb -a http://localhost:8080/myapp/ -p app.jsb3
sencha build -p app.jsb3 -d .
This created for me all-classes.js and app-all.js. The next step was to switch form ext-all.js to ext.js. Doing that my app stop working. Looking at the console, I noticed that Ext tried to load the required classes separately, from a src folder.
src/AbstractPlugin.js?_dc=1372193551701
So, I'm assuming that ext.js requires the src folder that have the unminified version of the components, and it will do one request for each component that my view require, correct?
In this case ext-all.js would be a better option, but it load all components, even the ones that I don't need (1MB size).
Is there some way to build an ext.js version only with the required components (maybe with SDK tools)?
These 2 files serve different purposes. ext.js contains the core functionality needed to run an application, while ext-all.js contains all of the framework code. The first one will require your components to correctly use the requires and uses config properties to organize your code dependencies properly. Then, when you run Sencha Command to build the app, all of your classes will be combined with the core from ext.js, and all your other dependencies from the ExtJS library that you included, and put into that app-all.js file.
If you are trying to use the Sencha SDK to build your app, I would strongly recommend upgrading to the latest version (Sencha Command version 3, available here: http://www.sencha.com/products/sencha-cmd/download) - they have fixed many, many bugs, and it works very well out of the box using the tutorial located here: http://docs.sencha.com/extjs/4.2.1/#!/guide/command.

Adding packages like moment.js & account.js to meteor Project

How do I add these JS packages to a meteor project? Do I simply place the JS files in the public folder so the client and server can access them? Or is there some specific steps that I need to follow?
These kind of standalone libraries can be directly placed in the /lib directory under your project.
For use on both the client and the server, place them into project/lib folder.
Or if you want to use them only at client-side, place them as usual in project/client/lib
In short, It depends.
I would recommend you check out http://atmosphere.meteor.com for a list of packages. If what you're looking for is there, install meteorite with npm install -g meteorite (https://github.com/oortcloud/meteorite)
Once you have metorite installed you can install these community packages quite easily using mrt add packagename
Most packages are on http://atmosphere.meteor.com.
But if for some reason the JS package you want isn't on atmosphere, depending on the package, if its a UI package (e.g datepicker, etc) put it in the /client/lib folder to avoid meteor crashing (only accessible by client).
If its a type of module abstractor (e.g backbone - backbone is included in meteor already btw: add using meteor add backbone) you could put it in the /lib directory of your package, it will be referenced automatically by both the server and client.
You have to add the packages via console.
Type "meteor add accounts-password" for example.
See here
Perhaps you should watch some of these videos here
to get an idea how meteor packages are added.

Resources