Skip to content

Commit

Permalink
v0.5.3 - Moving away from moment and compressing images
Browse files Browse the repository at this point in the history
  • Loading branch information
KSJaay committed Aug 6, 2024
1 parent 0c60dde commit c7c528b
Show file tree
Hide file tree
Showing 24 changed files with 25 additions and 52 deletions.
11 changes: 6 additions & 5 deletions app/components/monitor/updateInfo.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import './uptime.scss';

// import dependencies
import 'moment-timezone';
import moment from 'moment';
import dayjs from 'dayjs';
import classNames from 'classnames';

// import local files
Expand All @@ -21,9 +20,11 @@ const UptimeInfo = ({ heartbeat = {} }) => {
<div className="monitor-uptime-content">
<div className={classes}>{heartbeat?.isDown ? 'DOWN' : 'UP'}</div>
<div className="monitor-uptime-info">
{moment(heartbeat.date)
.tz(timezone)
.format(`${dateformat} ${timeformat}`)}
{dayjs(
new Date(heartbeat.date).toLocaleString('en-US', {
timeZone: timezone,
})
).format(`${dateformat} ${timeformat}`)}
</div>
<div className="monitor-uptime-info">
{heartbeat.message || 'Unknown'}
Expand Down
1 change: 0 additions & 1 deletion app/components/monitor/uptime.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import './uptime.scss';

// import dependencies
import 'moment-timezone';
import PropTypes from 'prop-types';

// import local files
Expand Down
6 changes: 3 additions & 3 deletions app/components/settings/manage/member/row.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import './row.scss';

// import dependencies
import moment from 'moment';
import dayjs from 'dayjs';
import { observer } from 'mobx-react-lite';

// import local files
Expand Down Expand Up @@ -36,8 +36,8 @@ const MemberTableRow = ({ member = {} }) => {
? 'Unverified'
: positions[member.permission];

const date = moment(member.createdAt).format('MMM DD, YYYY');
const time = moment(member.createdAt).format('hh:mm A');
const date = dayjs(member.createdAt).format('MMM DD, YYYY');
const time = dayjs(member.createdAt).format('hh:mm A');

const avatarUrl = isImageUrl(member.avatar)
? member.avatar
Expand Down
13 changes: 13 additions & 0 deletions docs/internals/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Previous updates

## v0.5.3

### Moving away from moment and compressing images

### Summary

Realised that moment wasn't the best library for date/time manipulation and that it was bloating the bundle size. I've decided to move away from moment and use dayjs instead. Along with that I've also compressed and resized all the default avatars. Each avatar was taking up around 1.5MB, they are now taking all nearly under 100KB. Along with that I've also changed the size from 1024x1024 to 512x512. Planning on compressing/resizing further possibly in the future.

### Updates

- Moved from moment to dayjs
- Compressed images

## v0.5.2

### Moves to router and finally adds error page
Expand Down
41 changes: 2 additions & 39 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lunalytics",
"version": "0.5.2",
"version": "0.5.3",
"description": "Open source Node.js server/website monitoring tool",
"private": true,
"author": "KSJaay <ksjaay@gmail.com>",
Expand Down Expand Up @@ -50,8 +50,6 @@
"knex": "^3.0.1",
"mobx": "^6.12.0",
"mobx-react-lite": "^4.0.5",
"moment": "^2.30.1",
"moment-timezone": "^0.5.44",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-chartjs-2": "^5.2.0",
Expand Down
Binary file modified public/icons/Ape.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/Bear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/Cat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/Dog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/Duck.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/Eagle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/Fox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/Gerbil.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/Hamster.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/Hedgehog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/Koala.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/Ostrich.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/Panda.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/Rabbit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/Rocket.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/Smart-Dog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/Tiger.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion public/vite.svg

This file was deleted.

0 comments on commit c7c528b

Please sign in to comment.