#706 ✓ resolved
brianchirls

Plugin Best Practices

Reported by brianchirls | September 2nd, 2011 @ 12:11 PM | in 1.0 Release (closed)

I have taken the liberty of starting a "Best Practices" document, based the Popcorn pieces I've built, in particular Europeana and the BAVC/Factory projects. I found myself rewriting almost every plugin from scratch because they were too specific or not specific enough. Most of the generalization and advanced features I looked for could be handled in plugins without touching the core.

Please review the document at Google Docs and post comments here.

https://docs.google.com/document/pub?id=17f6iSpXM_pZ8Wj6rirHpLnt2fp...

Comments and changes to this ticket

  • Rick

    Rick September 2nd, 2011 @ 12:51 PM

    One thing to note, we've always used underscores to prefix plugin specific properties added to options - but that prefixing was based on the need to differentiate properties that should and should not be included in track event serialization by Butter (because DOM elements cannot be serialized with JSON.stringify() ). That practice may no longer be nec. but I'd like to make sure that Bobby or someone close to the Popcorn Maker & Butter projects weighs in on that.

    Aside from that, I really like this document.

  • Bobby Richter

    Bobby Richter September 2nd, 2011 @ 12:58 PM

    Popcorn objects are safely encapsulated inside Butter TrackEvent objects, and are serialized in a different way now.

    Only if we decide to change any basic properties like start, end, target, etc., it's something we should be aware of.

  • Rick
  • brianchirls

    brianchirls September 13th, 2011 @ 06:03 PM

    Thank you both for the feedback on the document.

    We saw a lot of attention and feedback at the Open Video Conference this weekend, so if that lead to any new insights, I'd appreciate seeing them here.

    Trying to take my own advice for once, I've started building a new plugin for one of the Popcorn Maker templates, that conforms to most of the points listed. Hopefully this can serve as a starting point for a reference implementation. Expect more revisions.

    https://github.com/brianchirls/popcorn-maker/blob/master/external/l...

  • David Seifried

    David Seifried September 14th, 2011 @ 06:28 PM

    • Milestone set to 1.0 Release
    • Milestone order changed from “77” to “0”
  • David Humphrey

    David Humphrey September 16th, 2011 @ 11:15 AM

    • State changed from “new” to “home-page”
    • Tag set to documentation

    Two thoughts. First, we should translate this into documentation on the site. Second, following the discussion in #673, we should consider if we can create any base plugin types that can do some of these stuff for free.

    Thanks for starting this, Brian.

  • brianchirls

    brianchirls September 16th, 2011 @ 11:20 AM

    I agree with both of those.

    I'd like to see some discussion of the points before putting it on the site.

    Do we have any style guidelines for documentation?

    If anyone can give me an example of a simple base plugin that does nothing, I can put a lot of this logic in there. I have most of it already in some plugins I've been building for the Popcorn Maker templates.

  • David Seifried

    David Seifried October 18th, 2011 @ 04:37 PM

    • Assigned user set to “David Seifried”

    Im going to be adding this into the current documentation for this release.

  • Scott Downe

    Scott Downe October 26th, 2011 @ 01:38 PM

    Consider #326 when doing this. Loading scripts can be a huge cotchya moment.

  • David Seifried

    David Seifried October 30th, 2011 @ 08:06 PM

    • State changed from “home-page” to “blocked”

    docs are being done in #727, when that is complete this will also be done

  • David Seifried

    David Seifried November 1st, 2011 @ 03:26 PM

    Best practices are up here now http://popcornjs.org/API/best-practices

    Lemmie know what everyone thinks

  • brianchirls

    brianchirls November 1st, 2011 @ 03:28 PM

    Awesome! Thanks!

    I may have some suggestions for changes/updates. Will go through it and post here.

  • David Seifried

    David Seifried November 2nd, 2011 @ 03:22 PM

    • Assigned user cleared.
    • State changed from “blocked” to “review-looks-good”

    Hey Brian,

    Im setting this as resolved, as we need to get through this release and the docs are up. Feel free to create a new ticket for some changes that could be added and we will get those in.

    Looking forward to some feedback :)

  • David Seifried

    David Seifried November 2nd, 2011 @ 03:24 PM

    • State changed from “review-looks-good” to “resolved”

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Popcorn.js is an HTML5 video framework that lets you bring elements of the web into your videos.

Popcorn.js is a project of Web Made Movies, Mozilla's Open Video Lab.

Shared Ticket Bins

Referenced by

Pages