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

Feature - Add webpack to bundle assets #467

Merged
merged 16 commits into from
Sep 8, 2018

Conversation

pratikborsadiya
Copy link
Contributor

@pratikborsadiya pratikborsadiya commented Aug 30, 2018

This pull request aims to utilise webpack module bundler to bundle JavaScript and CSS files required for the project.

This makes it easy to manage the icons and is fast as well because only
those icons are included which are being used instead of all the icons.
- Remove vendor js libraries which are defined in package.json
- Fix some icon related issues in index-template.html
- Split javascript bundels in vendors and app
- Update prettier to fix scss source files and ignore build directory
@pratikborsadiya pratikborsadiya changed the title WIP: Feature - Add webpack to bundle assets Feature - Add webpack to bundle assets Sep 2, 2018
@pratikborsadiya
Copy link
Contributor Author

@ziahamza This feature is good to go. If there is anything else which requires modification or fixing let me know.

This will precache all the required resources and will allow the
application to respond even when the internet connection is not
available.
@pratikborsadiya
Copy link
Contributor Author

pratikborsadiya commented Sep 5, 2018

@anthonyraymond will you help me update the docker configuration if needed for this PR as the index.html file's location is changed from project root directory to build directory I assume some of the docker configurations may need updating as well.

@anthonyraymond
Copy link
Collaborator

Sure :) i'll do it asap

Package angular, angular-translate & jQuery is updated to latest
version.
@ziahamza
Copy link
Owner

ziahamza commented Sep 5, 2018

@pratikborsadiya so the only thing I am worried about is that this is published through github pages. So going to ziahamza.github.io/webui-aria2 leads to build in master and a few people use it.

One alternative we can do, is to still have an index.html page and redirect them to build directly? or perhaps we can deploy our master through netlify to a subdomain, and redirect from index.html to that sub domain that auto builds from master?

@pratikborsadiya
Copy link
Contributor Author

The other thing we can do is to rename the build folder to docs and GitHub pages can render index.html file from docs folder. I am already doing it for one of my open-source project vali-admin. What do you think?

Fix service worker not found issue when running the application from a
different folder other than domain root.
@anthonyraymond
Copy link
Collaborator

@pratikborsadiya @ziahamza i'll wait for a decision on the github-pages thing before i change the dockerfile then

@ziahamza
Copy link
Owner

ziahamza commented Sep 7, 2018

Agreed @pratikborsadiya . lets do the re-name to /docs. And then perhaps later we can think about auto-publishing either on Netlify or perhaps have CI pre-build and publish to gh-pages

This will make it easier to deploy the project on GitHub pages
@pratikborsadiya
Copy link
Contributor Author

@anthonyraymond I have updated the build process to create docs folder. You can proceed to update the docker configuration.

@anthonyraymond
Copy link
Collaborator

I have absolutely no idea why is this happening but i got this error message:
image

However the Webui seems to work flawlessly.

If that can help, it runs behind a webproxy (SSL enabled).

* Dockerfile.arm32v7 now use bundled files from docs/

* Dockerfile now use bundled files from docs/
@pratikborsadiya
Copy link
Contributor Author

@anthonyraymond This issue is happening because of the web-server running inside docker container is responding javascript files with Content-type response header as application/octet-stream which should be application/javascript for all the javascript files.

screenshot from 2018-09-08 11-39-40

@pratikborsadiya
Copy link
Contributor Author

@ziahamza You can merge the pull request as the issue mentioned by @anthonyraymond can be solved in a separate PR and will not affect the functionality of WebUI itself. The only thing which will not work in docker environment is the ability to open the WebUI when the browser is offline.

@ziahamza
Copy link
Owner

ziahamza commented Sep 8, 2018

Agreed @pratikborsadiya

@ziahamza ziahamza merged commit f11de67 into ziahamza:master Sep 8, 2018
@pratikborsadiya
Copy link
Contributor Author

@ziahamza don't forget to change the github pages root from settings.

@ziahamza
Copy link
Owner

ziahamza commented Sep 8, 2018 via email

@pratikborsadiya
Copy link
Contributor Author

Are you sure you have selected master branch /docs folder option in gihub pages source dropdown because right now https://ziahamza.github.io/webui-aria2/ is showing readme file instead of showing the WebUI.

@ziahamza
Copy link
Owner

ziahamza commented Sep 8, 2018

May take a few minutes:
screen shot 2018-09-08 at 6 31 23 pm

@pratikborsadiya
Copy link
Contributor Author

@ziahamza You'll have to push a commit to master branch for GitHub pages to change the website root and build your site again. The way GitHub pages work is that they will build your pages site on every commit. You must have changed the setting to build from docs after you merged the PR. So the root will not change to docs folder until you push a commit to master and and GitHub pages will rebuild your site. I have just got to know about this by experimenting with my own project vali-admin.

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

Successfully merging this pull request may close these issues.

3 participants