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

feat(archive): Add archive loader to prepare for conversion feature flip #1137

Merged
merged 1 commit into from
Jan 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/__tests__/Preview-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2420,7 +2420,7 @@ describe('lib/Preview', () => {
stubs.getHeaders = sandbox.stub(util, 'getHeaders');
stubs.headers = {
'X-Rep-Hints':
'[3d][pdf][text][mp3][jpg?dimensions=1024x1024&paged=false][jpg?dimensions=2048x2048,png?dimensions=2048x2048]',
'[3d][pdf][text][mp3][json][jpg?dimensions=1024x1024&paged=false][jpg?dimensions=2048x2048,png?dimensions=2048x2048]',
};

preview.options.sharedLink = 'link';
Expand Down
3 changes: 1 addition & 2 deletions src/lib/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ export const STATUS_SUCCESS = 'success';
export const STATUS_VIEWABLE = 'viewable';

// X-Rep-Hints for Representations API
export const X_REP_HINT_ARCHIVE = '[json]';
export const X_REP_HINT_BASE = '[3d][pdf][text][mp3]';
export const X_REP_HINT_BASE = '[3d][pdf][text][mp3][json]';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This rep will now be hinted for every file. Did we check with the conversion team regarding the performance impact of this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This rep will now be hinted for every file. Did we check with the conversion team regarding the performance impact of this change?

Yeah, they said it's ok.

export const X_REP_HINT_DOC_THUMBNAIL = '[jpg?dimensions=1024x1024&paged=false]';
export const X_REP_HINT_IMAGE = '[jpg?dimensions=2048x2048,png?dimensions=2048x2048]';
export const X_REP_HINT_VIDEO_DASH = '[dash,mp4][filmstrip]';
Expand Down
2 changes: 2 additions & 0 deletions src/lib/loaders.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import ArchiveLoader from './viewers/archive/ArchiveLoader';
import ImageLoader from './viewers/image/ImageLoader';
import Image360Loader from './viewers/box3d/image360/Image360Loader';
import SWFLoader from './viewers/swf/SWFLoader';
Expand All @@ -11,6 +12,7 @@ import OfficeLoader from './viewers/office/OfficeLoader';

// Order in this list matters
export default [
ArchiveLoader,
TextLoader, // should come before document
OfficeLoader, // should come before document
DocLoader, // should come after text
Expand Down