popcodeorg / popcodeorg/popcode

Replace Moment.js with a lighter-weight alternative

Open
#1,435 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted performance
Dominant language
JavaScript
Stars
191
Forks
143
Avg merge
4d 11h
Merged PRs (30d)
5

Description

Moment.js contributes a disproportionately large proportion of our bundle size given its limited actual use in the application. dayjs is an API-compatible replacement that is much smaller, though we would have to confirm it supports the browsers/versions we need. date-fns is another library that, while not API-compatible, has been much-touted recently as a good replacement for Moment.

To evaluate effectiveness at reducing bundle size, you can build a production-like environment with:

$ PROFILE_BUILD=true npm run preview

And then access:

  • http://localhost:3000/profile/bundle-analyzer.html
  • http://localhost:3000/profile/webpack-visualizer.html

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running PROFILE_BUILD=true npm run preview and inspect the bundle-analyzer.html and webpack-visualizer.html pages. Then identify the current Moment.js usage and verify whether dayjs or date-fns supports the required browsers. Done means replacing Moment.js with a suitable alternative and demonstrating a reduced production bundle size.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, performance, web-dev
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.