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 viewer-impl and keep it simple. #6159

Closed
5 tasks done
lannka opened this issue Nov 12, 2016 · 1 comment
Closed
5 tasks done

Refactor viewer-impl and keep it simple. #6159

lannka opened this issue Nov 12, 2016 · 1 comment
Assignees

Comments

@lannka
Copy link
Contributor

lannka commented Nov 12, 2016

The viewer-impl.js is bloated. Any component that talks to the Search Viewer adds methods there. It doesn't just make the Viewer one-thousand line of code, it also had business logic scattered around.

We plan to bring back a slim viewer-impl.js, which should just provide basic methods like receiveMessage sendMessage getParam hasCapability.

We plan to move the methods to their own business components:

  • history related methods => history-impl.js
  • baseCid => cid-impl.js
  • overlay, getPaddingTop => viewport-impl.js
  • tick => performance-impl.js
  • postDocumentLoaded => resources-impl.js
    etc.

A typical usage of the new viewer code will be like:

if (viewer.hasCapability('cid')) {
  viewer.sendMessage('cid', data).then(...);
}
@muxin
Copy link
Contributor

muxin commented Nov 12, 2016

  • postScroll => viewport-impl.js
  • postDocumentReady => resources-impl.js
  • setFlushParams, flushTicks, prerenderComplete => performance-impl.js
  • updateFragment, getFragment => stay in viewer-impl.js

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

No branches or pull requests

4 participants