1. #1
    grgur's Avatar
    Join Date
    Aug 2007
    Location
    Split, Croatia
    Posts
    155
    Vote Rating
    24
    grgur has a spectacular aura about grgur has a spectacular aura about

      1  

    Lightbulb Ext JS 4 for node.js: node-extjs4

    Ext JS 4 for node.js: node-extjs4


    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
    PHP Code:
    npm install node-extjs4 
    Please contribute with test results, feedback, etc.

    Basic sample:

    app.js
    PHP Code:
    require('node-extjs4');

    console.log(Ext.getVersion().version); 
    Run as:
    PHP Code:
    node app.js 
    Output:
    PHP Code:
    4.0.2a 
    Last edited by grgur; 17 Jun 2011 at 2:52 AM. Reason: added npm
    Grgur Grisogono
    Ext JS in Action SE co-author
    Exercising awesomeness at Modus Create - Official Sencha Partner

    Get in touch for Sencha Touch Training
    @ggrgur

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,522
    Vote Rating
    814
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Sweet stuff!
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    grgur's Avatar
    Join Date
    Aug 2007
    Location
    Split, Croatia
    Posts
    155
    Vote Rating
    24
    grgur has a spectacular aura about grgur has a spectacular aura about

      1  

    Default


    As of now available at npm
    PHP Code:
    npm install node-extjs4 
    Grgur Grisogono
    Ext JS in Action SE co-author
    Exercising awesomeness at Modus Create - Official Sencha Partner

    Get in touch for Sencha Touch Training
    @ggrgur

  4. #4
    Sencha User Mycoding's Avatar
    Join Date
    May 2010
    Location
    Russia, Volgograd
    Posts
    460
    Vote Rating
    0
    Mycoding is on a distinguished road

      0  

    Default


    Quote Originally Posted by grgur View Post
    As of now available at npm
    PHP Code:
    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.

  5. #5
    grgur's Avatar
    Join Date
    Aug 2007
    Location
    Split, Croatia
    Posts
    155
    Vote Rating
    24
    grgur has a spectacular aura about grgur has a spectacular aura about

      0  

    Default


    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
    Grgur Grisogono
    Ext JS in Action SE co-author
    Exercising awesomeness at Modus Create - Official Sencha Partner

    Get in touch for Sencha Touch Training
    @ggrgur

  6. #6
    Sencha User
    Join Date
    Jul 2011
    Posts
    3
    Vote Rating
    0
    charles.essien is on a distinguished road

      0  

    Default


    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?

  7. #7
    Ext JS Premium Member
    Join Date
    Jan 2011
    Posts
    4
    Vote Rating
    0
    comveltech is on a distinguished road

      0  

    Default Thx for sharing

    Thx for sharing


    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
    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



  8. #8
    Sencha User
    Join Date
    Oct 2008
    Posts
    2
    Vote Rating
    0
    OscarC is on a distinguished road

      0  

    Default


    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!

  9. #9
    Sencha User
    Join Date
    Oct 2008
    Posts
    2
    Vote Rating
    0
    OscarC is on a distinguished road

      0  

    Default


    @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.

  10. #10