Most of the code for www.wikipedia.org was written in 2015 using Node.js. At that time, Node didn't support native language constructs like Promises or array functions like map/reduce/filter. Because of this, many dependencies were added to provide this functionality. Now, many of these dependencies are no longer necessary, and so it's time to get rid of them.
Project scope
The codebase is split into three distinct areas:
- the data layer - responsible for gathering the statistics data and translations for the www.wikipedia.org page. This is written in Node.js.
- the build process - responsible for combining the data with the front-end code and producing the final production ready page. This is written in Gulp.js.
- The front-end layer - This is the HTML/CSS/JS that you see on the final www.wikipedia.org page. This code is written in vanilla JS, handlebars templates and the PostCSS processor.
There are opportunities for modernization across all three of these layers, but the highest priority for this project will be data layer and certain parts of the build process. Some of the larger parts of this project include:
- Adding the Jest.js testing framework and unit tests
- Refactoring how translations are generated
- Removing many Gulp.js dependencies
- Creating better separating between the data layer and the build-step.
Skills required
If you have a good understanding of Node.js & asynchronous code, javascript, and the Gulp.js build tool and Jest.js testing tool, this project could be suitable for you.
Check out the Wikimedia-Portals tag on phabricator to learn more about this project.
Possible mentor(s)
Microtasks
- Replace the underscore npm library with native array functions
- Replace the bluebird.js npm library with native promises or async await.
- Replace the deepmerge npm library with native Array.concat
- Replace the del npm library with native Node.js file system functions
- Replace the preq npm library with native Node Fetch API
- Replace the moment.js library with Luxon (or native Node functions if possible).
Estimated hours: 90h
Estimated difficulty: easy to intermediate