-
Notifications
You must be signed in to change notification settings - Fork 75
Website Optimize #217
base: master
Are you sure you want to change the base?
Website Optimize #217
Conversation
|
||
<!-- jquery--> | ||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> | ||
<!--<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>--> | ||
<script>window.jQuery || document.write('../js/vendor/jquery-1.9.1.min.js"><\/script>')</script> | ||
<script>window.jQuery || document.write('<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"><\/script>')</script> |
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.
obviously wrong here ...
hi @maruilian11 could you please explain your reasoning for making these change? in general it's best to open an issue for discussion first before making a large structural change. |
@lmccart cdnjs can speed up the load speed of 3-party libraries, and make it easier to manage the repo, these files now don't need to be downloaded in the repo, and in the future, version upgrading can be easily done by changing the version in the url. |
I agree that leveraging cdnjs is a good idea but as far as I know, ISP in some countries are known to block, intentionally or unintentionally, calls to the CDN. What I do in my project is to leverage the cdn while having a backup copy:
With that the user's experience is guaranteed which I think is more important than the load speed. The jquery library in the original is already using this strategy. I agree with @lmccart here about opening an issue first if it is a large structural change, not to micro manage but to discuss before anyone put any effort into changing things which we might change drastically after the discussion here at the PR. PS. @maruilian11 I've added line note on the latest commit as well |
got it, this all makes great sense. i like the idea of providing the backup both in case of cdn fail, and i think eventually it'd be nice to make sure all of this can run and be developed offline for those with limited internet connectivity. |
sorry for not opening an issue first, i will delete the last commit to keep jquery file alive in repo. |
@maruilian11 To keep the local copies, for modernizr the test will simply become
However, for normalize it is much harder if not impossible. I went digging and found a couple hacks, the first one tests the Some also suggest a library like fallback.js but personally I'd say let's not add to the complexity unnecessarily and load normalize from the local copy. Also, I'm not sure if the files other than |
The reference pages are automatically generated based on this file, so rather than changing the reference files here, we'll want to update the handlebars layout in the p5.js repo: I think that should cover it.. |
hi @maruilian11 what's the status here? have the changes mentioned in the comments been implemented? |
so, can we use about |
Need a detection to fallback
So let's add it right now. |
@maruilian11 we can use modernizr directly from cdnjs while have a local copy as back up:
The same goes for prism.js as soon as it's done on cdnjs. While for all css files, yes we'll keep them as they are. I have some new ideas but I'll try it on my own stuff first before suggesting them here. If you need any help with this give me a shout any time. : ) |
@limzykenneth Thank you very much! That’s very kind of you. |
Can be closed as P5.js website has been rebuilt using Node.js, Grunt, YAML and Assemble |
No description provided.