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

[wip] Use yarn to manage frontend dependencies #314

Open
wants to merge 20 commits into
base: develop
Choose a base branch
from

Conversation

NyanHelsing
Copy link
Contributor

Ticket

Purpose

Changes

Side effects

QA Notes

Deployment Notes

#######################

node_modules
node_modules/*
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't want node_modules committed

RUN apt-get install nodejs \
apt-get install npm \
&& npm run build

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to check, should install all deps and build everything into dist

```bash
yarn
yarn build
```
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some instructions

bla Outdated
@@ -0,0 +1,92 @@
/* Copyright 2017 Mozilla Foundation
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to confirm this is needed

@@ -3,5 +3,4 @@
Your browser does not support the audio tag.
</audio>

<script src="/static/js/mfr.js"></script>
<script src="/static/js/mfr.child.js"></script>
<script src="/assets/mfr.child.js"></script>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only reason mfr.js was included prior was to get pym.js library in the iframe. Webpack builds it in now.

@@ -0,0 +1,32 @@
import {Child} from "pym.js";
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 file is exactly the same save for this import

@@ -0,0 +1,131 @@
// Mfr.js is a library which renders common file formats to be displayed in an iframe.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removes inlined minified pym.js, the rest is the same

*/
/* globals module, __non_webpack_require__ */

module.exports = require('pdfjs/pdf');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Re exports the pdfjs lib so the viewer can find it properly

"enablePrintAutoRotate": false,
"disablePageMode": false,
"disablePageLabels": false
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure what to do with this yet. I don't like where it is but pdfjs looks for it in a very particular place.

},
{
test: /\.js$/i,
loader: path.join(__dirname, 'node_modules/pdf.js/external/webpack/pdfjsdev-loader.js'),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because pdfjs wrote their own loader

Copy link
Contributor

@cslzchen cslzchen left a comment

Choose a reason for hiding this comment

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

Is this an active PR and what's the ticket? Looks like an incomplete or temporary PR to me from the commit messages lol. Is this partially replaced by the package managing PR or blocked by it?

@NyanHelsing NyanHelsing changed the title ****wip Ft/pdf js build wip Ft/pdf js build May 15, 2018
@NyanHelsing NyanHelsing changed the title wip Ft/pdf js build [wip] Use yarn to manage frontend dependencies Aug 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants