PDA

View Full Version : Ext JS 4 for node.js: node-extjs4



grgur
16 Jun 2011, 5:08 AM
Probably all of you who have worked with node.js have had that "Whoa" feeling. If you share the amazement with me, you've probably had good times with Ext JS 4, too. If we're on the same track, you've also wanted to use Ext JS 4 on server side as well as to share the code base between client and server end (for example models).

Inspired by Alson Kemp (thank you), I decided to give it a shot and build my own extjs4 package, override it (remember, node.js is not a browser), and have fun using it.

You can find the entire code, jsb3 files, and a very basic example at github:

https://github.com/grgur/node-extjs4

or install via npm

npm install node-extjs4

Please contribute with test results, feedback, etc.

Basic sample:

app.js


require('node-extjs4');

console.log(Ext.getVersion().version);


Run as:


node app.js


Output:


4.0.2a

mitchellsimoens
16 Jun 2011, 6:44 AM
Sweet stuff!

grgur
17 Jun 2011, 2:51 AM
As of now available at npm

npm install node-extjs4

Mycoding
20 Jun 2011, 7:29 AM
As of now available at npm

npm install node-extjs4

Very interesting.
That is good job.

But the matter is in this:
I have being trying to install all about NodeJS duaring 2 months.
Than I come to conclusion that NodeJS is very diffucult to install(I mean to get
fully working platform with stable module, getting static files,logging errors.)
For that reason I gave up.
Than when I got know that nodeJS hosting appears in Russia I dicide to use it.

As far as I get node-extjs4 is NodeJS version 4.0.2 with intagrated ExtJS 4.x
Am I right?

I use ExtJS 3.x and I am not going to use ExtJS 4.x cause some reasons.
More over on hosting nodeJS already exist version 4.8.

I need not-integrate ExtJS+NodeJS I need ExtCore like.
What I need:
String.format
Texmplates/XTemplates
extended Date object.
extended Function object.
And so on.

Actually I think it is very diffult to convert ExtCore to nodeJS version.
And it could be done only by Sencha.

Also it would really good if Sencha integrated some module.
For example for sending email,soap and so on.
I know that there are email, soap modules and so on.
But many modules are not stable or work wrong and developer should or choose best module from
several varient either write by him self.
Example soap module works wrong. Actually it is working at all.(Although it is in list on page of wiki modules at github)
Soap module is only one and I there is not another.
So or write by my own or use php on remote server for the same work.

About email sending also there are problems.
I use one module but it send bad RFC, and in every email I get this attention.

grgur
21 Jun 2011, 12:15 AM
Very interesting.
That is good job.
Thank you, sir


Than I come to conclusion that NodeJS is very diffucult to install(I mean to get
fully working platform with stable module, getting static files,logging errors.)
Node.js being so new (v0.4.8 atm) makes it hard to compare to module-rich php or perl, pyton, etc. However, granted some time for education and experience, it will yield fantastic results. Eventually, you'll see how easy it can be to set up a node.js app, especially if you choose to use some of the young but powerful frameworks such as express (based on connect, which is btw part of Sencha labs).


I need not-integrate ExtJS+NodeJS I need ExtCore like.
What I need:
String.format
Texmplates/XTemplates
extended Date object.
extended Function object.
And so on.

Ext Core is already built in node-extjs4. If you take a look at jsb3 file, you'll noticed that it's based on the entire core library (just like Ext JS 4). Please try it out and post your experiences. I'm aware that it's still browser-based, and it could be more node.js friendly, but I'm relying on your experiences to fix (or override) the code.

Looking forward to your feedback

charles.essien
11 Jul 2011, 11:47 AM
Very interesting! This project brings alot of potential to SSJS. I've been playing around trying to get window instance's elements generated (ultimately I would like to render charts :-? ). I couldn't get the Ext.onReady to be called. I am also trying to use the module in collaboration with JSDOM.

-Any advice in getting elements generated? What the potential problems are?

comveltech
23 Oct 2011, 3:13 AM
I create https://github.com/agebrock/extjs-node some months ago
and i had the following problems with the implementation:

- Ext is global (any chance to use the sandbox mode here ?)
- having a global "window & window.document" will may break some feature checks of other frameworks

as far as i know ExtJS registers every instance of any model useing Ext.create i was wondering if this feature should be removed serverside. I think this may flood the memory - But i had not the chance to find out. Do you have any advice about that ?

@charles.essien
have a look at https://github.com/agebrock/dojo-node/blob/master/dom.js
(https://github.com/agebrock/dojo-node/blob/master/dom.js)This needs some refactoring but it worked perfectly to bootstrap a dom environment for dojo and for ExtJS (you can even require the original ext.js file after useing)

It may does the trick ;)

OscarC
9 Nov 2011, 2:29 PM
Nice to see someone else on the same trail!

I've been using Ext-4 in node since Ext-4 pr2 - which has almost driven me mad (in the early stages) it was retrospectively a veeery premature choice. However when they finally got it working I was happy I'd taken that route.
The thing is, I did this through crude "copy n paste-make" and manual overrides. Just a few weeks ago I finally did a 'correct build' so I could use source-updates (I use jake and have a ton of jake-utils I've made myself, so I didn't even think about jsb).

The one thing I haven't gotten running so far is XTemplate. So I tried converting that one "on the side" from Ext 3.4-sources.

I know tried to drop you module in instead of using my own Ext-node-solution. After a few quirks I got my server-system running with your npm instead and in my test-runs so far it seems to work as well as with my implementation.

XTemplate, however, doesn't seem to work in your solution either? I would be sooo happy if I could get that running and drop my own templater in my web-page-generator. It's loosely similar to ext-components but for web-page generation. And ofcourse I would love to use the exact same templater on client and server!

Keep up the good work!

OscarC
10 Nov 2011, 7:56 AM
@mikhail.tatsky

Your definitely right. The serverside currently use the core. We've got our own data-package which replaces that of Ext completely (we just added wrapper methods to our Model so that Ext wouldn't know the difference). And we would like to use XTemplate to generate html also, just as you do now through 3.2.
That's it, no DOM or such required at the moment.

mschwartz
10 Nov 2011, 8:33 AM
http://github.com/mschwartz/SilkJS

See it in action at http://server5.sportstwo.com:9090/

CitizenHawk
25 Jan 2012, 7:22 PM
I think it's great that ExtJS 4 and node can produce a version # in a terminal window. But what I want to know is, how can you serve it to a browser?

mschwartz
26 Jan 2012, 7:13 AM
I think it's great that ExtJS 4 and node can produce a version # in a terminal window. But what I want to know is, how can you serve it to a browser?

Shameless plug. See: http://www.sencha.com/forum/showthread.php?160128-Announcing-SilkJS&p=702371&viewfull=1#post702371

(http://www.sencha.com/forum/showthread.php?160128-Announcing-SilkJS&p=702371&viewfull=1#post702371)

CitizenHawk
26 Jan 2012, 8:33 AM
I will definitely look into your project, SilkJS. And, maybe even implement it at www.idiotmoneymachine.com (http://www.idiotmoneymachine.com) which is a spinoff of www.rabollinger.com (http://www.rabollinger.com). Thank you mschwartz!

umr.ashrf
4 Sep 2012, 6:48 AM
After trying Node.js, I have the same idea. I was about to go tiger with the development but then took some time to google and I found that is already happened.

That's a great idea if you would do it to perfection.