Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Titanium Redux - JSS, short-hand instantiation of controls, and more...

My brother just created an external js file that you can include in your projects that addresses some of Appcelerator's shortcomings:

https://github.com/dawsontoth/Appcelerator-Titanium-Redux

Some highlights:

JSS (similar to CSS)
Shorthand form for creating controls: var label = new Label()
Ability to set defaults for controls: $.setDefault('helloWorld', { text: 'Hello, World!', color: 'red' });

Check it out and let me know what you think!

— asked November 10th 2010 by Justin Toth
0 Comments

4 Answers

  • Just had a gander through the readme.. Looks great. I am curious if you have experienced any issues with performance?

    other then that.. I can't wait to give it a shot.

    — answered November 10th 2010 by Critter
    permalink
    1 Comment
    • Performance hits should be minimal. They way stuff gets wired in isn't very invasive. Even the parsing of the JSS is very quick, as it's just running a couple replaces to turn your JSS into valid JavaScript that can be run.

      I'm using it in a couple of apps that I developed without it then converted over for the shorter syntax. They're easier to maintain and update, and I saw no performance hits at all.

      — commented November 10th 2010 by Dawson Toth
  • Hopefully the folks over at Titanium view this post and incorporate some of these things into the next release…

    — answered November 10th 2010 by Justin Toth
    permalink
    0 Comments
  • Oh, brilliant!

    Looks great, have you noticed any performance drop using this?

    — answered November 16th 2010 by Fredrik Nordlund
    permalink
    2 Comments
    • So long as you're using the latest version (as of right now it's v4.1) there shouldn't be any performance hit, there definitely was with parsing the JSS in v3 but that has been fixed.

      — commented November 17th 2010 by Justin Toth
    • I have made some quick tests now and it works like a charm. :)

      The fact that its possible to just go with … = new xxx(); and go bananas with JSS is really great. I wonder why the Titanium syntax isnt built like that.

      Are you working on some more features? How far away is chaining selectors?

      — commented November 17th 2010 by Fredrik Nordlund
  • Checking it out..

    — answered November 10th 2010 by Critter
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.