Skip to content

Refactor viewer-impl and keep it simple.  #6159

@lannka

Description

@lannka

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(...);
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions