-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Hey everyone! This is a planning issue to map out all the tasks to be covered in the upcoming weeks and create a room for further discussions and improvements.
Note: see original proposal here: https://publiclab.org/notes/itm2017004/03-12-2020/outreachy-proposal-optimize-performance-and-accessibility-of-public-lab-content
Performance Analysis and Improvement:
Tasks:
- Using WebpageTest and PageSpeedInsight to study the current waterfalls.
- Minify js by setting
uglifiergem inconfig/production.rbfile. (Configure Uglifier gem to minify js #7937 closed minify leaflet scripts using uglifier #8159 open) - Minify css using yui or sass-rails (Already done)
- Removing the older version of font-awesome currently being loaded (2 versions being used now 5.12 and 4.7) and replacing it with a gem so that it is included in the asset pipeline. More info can be found here (all closed Add font-awesome rails gem and remove other fontawesome packages from… #7938 and Fix icon Font awesome error #8026 fix icons error by preloading FA 5 first #8041 )
- Async or defer attributes to be added to js files to reduce first paint time.(more information here
- Replace jquery with cdn since it is widely used and would be available as cache in most client’s browser.More info can be found here,here and here.This will allow us to externalize jquery from application.js allowing us to call application.js asynchronously. (externalise jquery using jquery-rails-cdn and jquery-rails fallback #8161 open - tests failing need to investigate after some pending work gets merged first)
- Check if all the js files are duplicates (i.e if already present in the manifest file as well as assets.rb) and remove redundancies. (remove duplicate from assets.rb already present in application.js #7958 open)
- Only load critical css for the first paint and rest asynchronously using
loadcss-railsandcritical-path-css-rails(open Load critical css and rest asynchronously #7996) - Remove CDN and other links otherwise available from asset pipeline in file
app/views/csvfiles/new.html.erb( - Replace
bootstrap-slider.jswith minified js and async tag or add it into the asset pipeline.(Also can be considered for removing since it is obsolete and most of the code isn't used) (Minify bootstrap slider script and add defer tag #7939 open) - Minify leaflet js files by calling them from already present asset pipeline (closed replace leaflet css/js files in editor rich #8087 and open replace leaflet files from assets.rb in questionRich.html and _mapDependencies.html #7945 )
- Minify
esri-leaflet-renderers.js(closed replace esri cdn link with minified cdn #8164) - Replacing the delivr cdn of mathjax with an alternative npm or serve it in a minified manner
- Adding
font-display:swaptag for fonts imported to allow it to fallback to normal font in the first paint till it gets loaded.(Check for browser compatibility or invisible text issue) - Add lazy loading for images and serve them in next-gen formats.More info can be found here. (lazy load images using lazyload-rails gem #8043 )
- Add Rack deflater to gzip files that are not already gzipped.More info can be found here
New work added (not defined in the scope before)
- Remove n+1 queries (eliminate n+1 query in questions comments parent method #8272 refactor and remove unused code in user controller #8269 eliminate n+1 query of subscription tagname method #8268 eliminate n+1 query of comment parent method #8267 eliminate n+1 queries of tags #8183 closed wip: remove n+1 query from revision#path method #8191 wip: remove n+1 query from user#tagnames method #8190)
- Replace .length/.count with .size (main issue Replace all instances of .length and .count with .size #8194 ftos created by @cesswairimu 👏 more ftos to be created ahead)
Accessibility
See https://firefox-source-docs.mozilla.org/devtools-user/accessibility_inspector/index.html for firefox accessibility inspector, and WAVE assessment
Tasks
- Add labels to forms wherever applicable.(break-me-up tag can be used to break it down into several components) (Flagged as missing form label)
- Add aria-label if we don’t want the label to be visible but accessible.(break-me-up tag can be used to break it down into several components) (Flagged as missing form label for cases where we want hidden form labels)
- Check and test if on zooming into text all the elements of the page are visible or not and apply changes accordingly.(break-me-up tag can be used to break it down into several components)
- Add accessible names to button to prevent screen readers from announcing it as “button”.(break-me-up) (Flagged as empty button problem)
- Add meaningful text into links to promote uniqueness and accessibility.(break-me-up) (Flagged as empty link problem)
- Add alternative text for images to promote SEO and accessibility.(break-me-up) (wip: Add alternate text for lead images #8106 stuck and not sure how to work on this TBD after printability)
Worked on a route-to-route basis by testing against WAVE assessment (#8054 #8028 #7995 #7989 #7977 #7975 #7968 #7966 #7962 )
FTOs opened (#8094 #8093 #8092 #8055 #8032 #8030 #8029 #8007 #8006 #8005 #8001 #8000 )
Printability
Tasks:
Modified scope to avoid working with additional libraries:-
- Using js script and DOM manipulations to create the print preview
- Set topics section display as None in the stylesheet.
- Add better contrast to the links printed by changing the colour of a tag in the stylesheet.
- Images can be scaled down in the stylesheet for uniformity across the documents.
- Add css to display tables in proper tabular format
- Proper styling done with help of @ebarry
//more points to be added here as and while developing if more improvements can be made
Documentation
Tasks:
#8057 https://hackmd.io/@itm2017004/BJuqtap6L
- Creating a proper documentation guide covering all the points above ensuring that contributors abide by it to promote accessibility.
- The guide will contain sections for adding aria-labels,form-labels,alt text and testing 200% zoom on pages.
//more points to be added here as and while developing if more improvements can be made
Up for discussion
Tasks:
- Running Lighthouse CI for pull request to ensure performance and accessibility in further code.More details can be found here. (Discussion issue here Lighthouse ci for performance and accessibility monitoring #8112 awaiting input)
- Replace will-paginate gem with pagy which is much more memory efficient and can improve performance.
- Serving assets over HTTP/2 instead of HTTP/1.1
- Add descriptive text for links for better Search Engine Optimization.
- Add rel="noopener" to links having target=’_blank’ to allow safety of cross-origin destinations.
- Allow password copy-pasting since it is flagged as not a secure policy by Lighthouse.
- Remove error logging into the console in the production environment.
- The turbolinks gem is present in the gemfile but not used. So needs to be removed assuming we ran into some issue with it ?