Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor annotations to use a modern JS framework #556

Open
icanb opened this issue Aug 16, 2015 · 2 comments
Open

Refactor annotations to use a modern JS framework #556

icanb opened this issue Aug 16, 2015 · 2 comments

Comments

@icanb
Copy link
Member

icanb commented Aug 16, 2015

Right now the code is not DRY at all and we're using weird libraries like elt to create DOM elements.

Tool of choice is open to comments, but I have two options in mind (or maybe combination of both):

  • Backbone: The model/collection structure seems very ideal considering the collection of annotations we have. We can have AnnotationCollection, AnnotationModel and AnnotationView. PageView would listen to changes on the instance of AnnotationCollection and render new annotations as they are inserted. As for rendering the view; we are not doing anything crazy, so I think _.template would work fine for us.
  • React: It's cool and is good rendering views. However, I feel like it might be an overkill, especially considering that we'd need some extra tooling to compile the JSX templates and such. But I've never used this in production, so I'm not entirely sure about the benefits.

@jez What do you think?

@icanb icanb assigned jez and icanb and unassigned jez Aug 16, 2015
@jez
Copy link
Contributor

jez commented Aug 18, 2015

Yeah I'm not sure.

If we pick one, I'm partial to React. I've used it at work in in a number of my own side projects now, and I really enjoy it. I haven't used Backbone, though. I hear it's pretty nice, and Backbone + React aren't mutually exclusive especially when you're using the Flux pattern.

That being said, I've only used React with respect to designing single-page apps. We certainly could make a move towards making Autolab a single-page app, but I don't know that the benefits in the long-run outweigh the time spent refactoring in the short term. If we were going to approach it just from the perspective of annotations, I'm not sure what benefit it would have. I'm also not that up to speed on the annotations code though.

@dlbucci
Copy link
Member

dlbucci commented Aug 18, 2015

The only SPA I like are the ones that don't reload every static asset with each new page, instead reloading the body, or some portion of the site (a feature that Rails 5 is supposed to support). Also, I'm pretty sure we tried to write the gradesheet in bootstrap and ended up adding 100 lines of code. Also, elt is not a library, it's an 11-line function that does more than most libraries do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants