Skip to content

Instantly share code, notes, and snippets.

@radekstepan
Last active August 29, 2015 14:08
Show Gist options
  • Save radekstepan/3bd3318e8a741721ef98 to your computer and use it in GitHub Desktop.
Save radekstepan/3bd3318e8a741721ef98 to your computer and use it in GitHub Desktop.
Issues with Ractive

#Issues with Ractive

  • multiple transitions of the same component would not clear listeners leading to zombies in memory and ultimate browser crash; fixed in 0.6.0
  • events like tap do not work together with adapters like ractive-ractive because one uses dependencies and one uses peerDependencies
  • deeply nested POJO saved as a map with set triggers a change even if nothing has changed
  • ractive-ractive does not update parent model if we have passed in its subset like parent.name instead of parent; the data gets changed but no update event gets fired
  • setting a key to [] (resetting an array) has won't clear the array items from memory if they were linked to components, a while loop on all the items in the array and their subsequent pop works
  • an error in a component fails silently killing with it some part of the template logic
  • does not handle tags in templates that seem unclosed because they are closed in an if condition
  • have to do this listing="{{ { 'ID': ID, 'seo_address': seo_address } }}" because this is empty for some reason...
  • in a template the following: {{#key}} is supposed to check if key exists, but this block of code is not re-executed and template re-rendered when key is removed from a model
  • if I fire ractive.update() ot triggers a change event on all keys of ractive, rather than those that have changed
  • I have one loop that renders new properties in a grid and another that clears them; Ractive will try to tear them down even before they've finished rendering :(
  • Ractive does not update some templates when we toggle a key (IE11)
  • tap event fires all other click events in ractive (IE11)

##New Rules

  • No Model adaptors, wire everything manually, disposing of listener appropriately.
  • Hide rather then re-render.
  • Use Backbone.Models for persistence
  • do not rely on layouts which rely on reading element sizes, especially if we do not have a promises API that would tell is when these are rendered
  • if rendering a site on the serve and then enhancing it on the client, use 1 pipeline only
  • switch to Knockout or Knockback even for viewmodel
  • have a way to log errors into console when a component fails to render
  • http://facebook.github.io/react/docs/working-with-the-browser.html maybe React?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment