popcodeorg / popcodeorg/popcode
Replace Moment.js with a lighter-weight alternative
Nobody has claimed this yet.
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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