Ideas for a Enyo FAQ

edited April 2012 in Enyo 2
We're looking for good questions for a Enyo FAQ, especially for beginners. What are some items that you missed from the documentation or that need more explanation that might work well in a FAQ format.

I've already got one about not seeing new items after a call to createComponents that I'm working on, so you don't need to submit that one.

Comments

  • edited April 2012
    One thing i had a little trouble at the beginning (in enyo 1.0) was with over-riding methods, or expanding them.. with this.inherited(arguments).
    Also with functions like create, rendered, etc..


  • Yes, I think a master list of functions that are intended to be overridden that are available in all/most components, as well as documenting them in the individual component docs would be awesome. :)
  • @ekdikeo, @chrisvahnooser I would've killed for something like that, but not sure if that list would fit in a FAQ format. Anyways, it's terribly needed.

  • The chrome/client wrapper feature is incredibly useful and almost undocumented. It should definitely be in the FAQ. I'd also like to see more info on the way that the 'classes' properties and published properties can be overridden in sub-kinds - I've always been a bit vague on that...
  • As far as beginning users go, I completely agree with @chrisvanhooser. A straight-forward guide that lays out exactly what happens when a component is created, with notes about which methods you should override for which tasks (along with documentation for this.inherited) would have been ridiculously useful for me.

    Heck, it still would. I often find myself randomly tossing code between constructor, created, and rendered just to see if it will do what I want at the earliest possible point in time.

    I don't know if it's a newbie topic, but it would also be useful to me to know more about how components tie into the DOM. For instance, I have several times needed to mix DOM scripting with Enyo methods (in TapNote, for instance, I have a bunch of DOM scripting for working with selected text), but it's not always easy to tell how to access the DOM for a particular Enyo component, when the DOM will be ready for it, etc. I almost always have to go source-code diving in Enyo when it comes time to try and work with the node directly.

    I also agree with @omastudios that chrome/client and most of the other standard properties available to components are woefully under-documented.
  • Good one -- after a call to the control's rendered() method, it will be in the DOM. If you need earlier access, calling hasNode() is the way to find the DOM element, it will return NULL if it's not been rendered yet.

    I just helped @SugarDave debug another good gotcha -- we was using nested enyo.Repeaters, and wasn't returning true from the onSetupRow handler, so was getting doubled items because of event bubbling.
  • Maybe you guys can take a gander at this wiki page Object-Lifecycle and tell me if it answers some of these questions (or not).

    Thanks!
    S
  • @sjmiles: Yes! That wiki page is extremely helpful. The only suggestion I have is to add a short aside somewhere when you introduce this.inherited to mention that arguments is a standard/magic Javascript variable that contains all of the arguments passed to the function (and obviates the need to pass anything else to this.inherited, even if you are passing some random number of parameters to your constructor function or similar).

    Most of us are probably already aware of, but that's the kind of detail that I dearly wished people would mention when I was still getting into Javascript. Particularly with a framework like Enyo it's sometimes difficult to tell what is native Javascript and what is framework magic.
  • Thanks for the feedback, @onecrayon. I made a change as per your suggestion.

    Also, sorry for hijacking this useful thread. Keep the FAQ ideas coming.
  • List and Repeater event handling (tap, selection handling, etc) isn't really documented or explained, although that should probably go in the documentation for those controls rather than a FAQ.

    Also, it isn't entirely clear which methods should be used for rendering/re-rendering lists and repeaters, e.g. should we use build() or render() or both for repeaters, and when to use refresh() vs reset() for lists.
  • The Object Lifecycle document is definitely a help, although a condensed form of "Here's a list of everything intended to be overridden", as well as having some kind of documentation for all the functions in a kind in the docs, would be helpful too.
  • Ben wrote:
    > We're looking for good questions for a Enyo FAQ, especially for beginners.
    > What are some items that you missed from the documentation

    I assume this is only referring to documentation that is available here: http://enyojs.com/#documentation

    For real beginners I think there are more fundamental questions - which perhaps are not addressed in the currents docs:
    + why would I want to use Enyo ?
    + what is the relation between Enyo and webOS and other items like Isis, Onxy, Ares, etc?
    + where is a high level architecture picture that relates all items?
    + what prerequisites do I need to know to get started with Enyo (javascript, HTML5, ... ?) ?
    + what other JS frameworks can I combine with Enyo ; which are recommended; which I don't need or which overlap with Enyo ?
    + should I Enyo-fy functions from other JS frameworks before using them in my code?
    + how can I write my Enyo app once and then it adjusts itself to all platforms and form factors?
    + how can I convert my web-server based handicrafted HTML5 apps into Enyo apps?
    + which target platforms can I cover with Enyo ?
    + what type of applications can I build with Enyo - and what not ?
    + do I need to start with Enyo1 and then learn Enyo2 - or better wait for Enyo3 ?
    + how can I contribute to improve Enyo in future ?
    + how to report defects and enhancement requests ?
    + how to package, publish and sell my Enyo apps; what app stores can I use ?
    + will Enyo2 apps run on all existing and future HP webOS hardware?
    + ...

    I think for most readers of this forums the answers might be evident - but imagine beginners who heard about Enyo for the very first time.
  • Thanks Martin, your thoughtful list is very helpful.
  • - how to run in Chrome desktop browser for debugging with a hint to the "inspect element" menu item
    - an hint that function() {}.bind(this) only works on webOS and Chrome because of the missing prototype lib on other systems and the enyo.bind() replacement
    - for each major system some step-by-step which lead to a running app
    - what step are necessary to create a small-as-possible but still complete enyojs folder
Sign In or Register to comment.