-
Notifications
You must be signed in to change notification settings - Fork 162
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
Webpack content hash #1070
Webpack content hash #1070
Conversation
Hey @HashTalmiz thanks for this! I think the reason for failing the tests is just a simple typo of the imported HtmlWebpackPlugin here. Things like this should be caught by running This will also make the diff in the PR just show the important places where you've changed the code, so we can review and merge :) Let us know if you have any issues running linting. Thanks! |
Hey @eharkins Thanks for looking into this. That typo was pretty dumb on my part lol. Installed ESLint and Linted the webpack.config file and its ready for a push with the typo fix :P In other words, Is this required,
or just this?
|
Yes, @HashTalmiz I think just the one I'm assuming the two entries that reference files in What about this one, what does it do?
Sorry for not getting to the actual content of your PR before. Go ahead and commit the linting so we can have a clean diff to look at. Thanks! |
@eharkins Well, this pull request was made a while ago and I guess a few new packages were added since then. Also I made changes on the master immediately after the fork. How you handle merge conflicts? |
@HashTalmiz in terms of conflicts, it should work to rebase your branch on auspice/master. In terms of the diff, it still seems like there are formatting changes to both files in the PR; after rebasing can you make sure that all of those are reverted so that it's just the changes relating to the html webpack plugin in the PR? Let me know if you have any trouble, thanks! |
@eharkins So I've done my best in getting the merge conflicts fixed and did a rebase to the current upstream master. The CI still fails for some reason. I found this article on a similar issue locally. But I have no idea how I can fix this. Maybe @jameshadfield can help out here? |
.eslintrc
Outdated
@@ -7,6 +7,7 @@ globals: | |||
browser: true | |||
context: true | |||
jestPuppeteer: true | |||
BASE_URL: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@HashTalmiz this line (and many others) that are supposedly changed in the PR have the exact same content as in master, which makes me think that something (perhaps the editor you're using) is adding different line ending characters (or something else invisible like tabs vs spaces) to all the lines that you edit (including the ones you merged) so that they show up different in diffs even though nothing has really changed with them.
Maybe you can test this by doing local git diff
after saving with different editors (though you may have to explicitly remove special line ending characters if they are in there now).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The thing is, I haven't made any changes manually to any of these files for my editor to do anything (Except for webpack.config and package.json) All of these were bought by the rebase which I tried to do with the master branch
With respect to the Did you run npm install to update the package-lock after adding the html webpack plugin dependency? |
I didn't. But when I did hit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wasn't white spaces or tabs, It was the date format, could it have been Git conforming to my format? Could you have a look at package.json and package-lock.json and see if there's something wrong there?
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 24/03/2020</em></div><div class="docs-prevnext"><a class="docs-next button" href="/auspice/introduction/install"><span>Install Auspice</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#license-and-copyright">License and Copyright</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><div><a href="/auspice/"><img style="padding-left:20px" src="/auspice/img/logo-light.svg" alt="Auspice" width="66" height="58"/></a></div><div><h5>External Links</h5><a href="https://github.com/nextstrain/auspice">GitHub repo</a><a href="https://www.npmjs.com/package/auspice">NPM package</a><a href="https://nextstrain.org">Nextstrain</a></div><div><h5>Contact Us</h5><a href="mailto:hello@nextstrain.org">email</a><a href="https://twitter.com/hamesjadfield">twitter</a></div></section><section class="copyright">Website built by <a href="https://twitter.com/hamesjadfield">James Hadfield</a> using <a href="https://docusaurus.io">Docusaurus</a></section><section class="copyright">If you use auspice, please cite <a href="https://doi.org/10.1093/bioinformatics/bty407">Hadfield et al., 2018</a></section><section class="copyright">Copyright © 2014-2020 Richard Neher & Trevor Bedford</section></footer></div></body></html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@HashTalmiz this line (and many others) that are supposedly changed in the PR have the exact same content as in master, which makes me think that something (perhaps the editor you're using) is adding different line ending characters (or something else invisible like tabs vs spaces) to all the lines that you edit
@eharkins I think you are referring to things like this? I almost agreed with you there but then I realized, every single one of these Lookalikes have the Date format changed!
For instance, look here, at the start of the second line on both sides
3/24/2020
on the left and 24/03/2020
on the right
I'm not sure how this came to be. I'm 100% sure I haven't opened these files for my editor to do this. Should I remove these from the PR right from github?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is from master
@eharkins Btw I remember saying "yes" to a prompt saying something about adding Git LFS. Since then I've had these unwanted files coming up as unstaged commits. Could this be causing all the differences? I'm sorry if this seems unrelated/if you have no idea what this is. |
@HashTalmiz Git LFS is a new dependency you need to install which is happening now because you rebased on master. I think all the issues here come from the rebase and merge. Maybe you can get just your webpack related changes back from the reflog without this commit that changes all the other files and (re-)add them on top of a clean master? I think this'll mean manually remaking the changes or add the commits with rebase and a clean merge. This may help https://git-scm.com/book/en/v2/Git-Branching-Rebasing. Sorry for all the trouble here and thanks for your patience! |
@eharkins Okay, so I reverted back to the best commit I've had which is where this PR is right now. Tried to do a fresh rebase after reading up all the info needed and there's where I found the problem. |
@HashTalmiz Regarding the |
all dependencies have been taken into consideration
Hashing is still not working Also Previous commit made all the double quotes to single quotes. Sorry bout that, That was my Prettier :P
Removed other html page references as per the comment made here ->(nextstrain#1037 (comment))
…ror on npm run dev) npm run build shows the hashed files!!
Hey @tsibley, Thanks for that reference; got rid of the LFS in my global .config, I no longer get that error but for some reason when I do a But anyway, I found a workaround with Edit: Some checks have failed. Not sure why but I know that the errors aren't because of the changes. |
@HashTalmiz I added your changes to the webpack config cleanly onto master in my fork, and was hoping to be able to use that to merge this work (while still attributing it to you). However, upon testing it out with Auspice customizations which we rely on for nextstrain.org, I discovered some issues (described here) that would need resolving before we could use the added webpack functionality in Auspice, since keeping nextstrain.org up and running is a priority for us right now. |
@eharkins Responded here: eharkins@4741ed4#r39276548 |
Thanks both @HashTalmiz and @eharkins for your work here, it's really appreciated. I've just read through #1126 and believe that solution to be more far-reaching than this PR and thus am going to close this one. Please reopen if there are features here not implemented by #1126. |
Description of proposed changes
What is the goal of this pull request? What does this pull request change?
To enable Cache busting.
Related issue(s)
Issue #1037, Added the features but still isn't working
Fixes #
Related to #
Testing
What steps should be taken to test the changes you've proposed?
If you added or changed behavior in the codebase, did you update the tests, or do you need help with this?
Thank you for contributing to Nextstrain!