Load extensions JS before page-specific code for reviewable pages.

Review Request #9193 — Created Sept. 13, 2017 and submitted

Information

Review Board
release-3.0.x
8dee384...

Reviewers

Review request fields and entries now support extension-provided view classes,
but the code that used them was parsing before the extension-provided JS was
loaded, making things fail. I've overridden the relevant blocks for the
view_diff.html and review_detail.html templates, loading all the JS before
page-specific code.

Used this in conjunction with an extension-provided field view class.

Description From Last Updated

Trying to get a better understanding of how things look here. At what point do we need the extension fields …

chipx86chipx86

Can you separate these with a blank line? Kinda blends in otherwise.

chipx86chipx86

Same here.

chipx86chipx86
chipx86
  1. 
      
  2. Show all issues

    Trying to get a better understanding of how things look here. At what point do we need the extension fields to be set up? I'm a little worried about the ordering here because some customer extensions expect a page to exist when they're initialized. Can we lazily look up the fields instead?

    1. This isn't requiring the fields to be set up, just defined. The problem is that we get a name resolution error because the extension fields haven't been defined at the time that the inline <script> is being parsed. Any extension JS that actually interacts with the page JS should (and in our cases at least, does) use RB.PageManager to wait until the page has finished initializing.

    2. This is the code in review_request_box.js, right? Can we maybe load that code at the end of the js_extensions block instead, so it's the last thing that happens?

  3. 
      
david
chipx86
  1. 
      
  2. Show all issues

    Can you separate these with a blank line? Kinda blends in otherwise.

  3. Show all issues

    Same here.

  4. 
      
david
chipx86
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to release-3.0.x (9102f42)