-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Dev server mode, base.js refactor #135
Conversation
@buro9 I added a dev mode toggle in this to enable faster process when editing JS files. What do you think? |
{ amount: 60, name: 'minutes' }, | ||
{ amount: 24, name: 'hours' }, | ||
{ amount: 7, name: 'days' }, | ||
{ amount: 4.34524, name: 'weeks' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where did 4.34524 come from?
It looks like (((365*3+366)/4)/12) / (((365*3+366)/4)/52)
to determine weeks in a month over a year but it's not quite, as that produces 4.3 recurring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Literally from the article I linked in the comment.
Googling, the same factor for month to week conversion seems to be widely used, i.e.:
https://w3percentagecalculator.com/how-many-weeks-in-a-month/
https://www.checkyourmath.com/convert/time/weeks_months.php
https://www.asknumbers.com/DateTimeConversion.aspx
I have no idea where they get the number from and if it's more or less accurate than your formula.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOL, I should read the comment :)
I'm happy to trust the number if the entire world does... I just pause when I see a magic number and see if I can understand it. I think it's roughly what my formula was but probably accounts for it better (i.e. the 4.3 recurring is likely too approximate and someone's stabbed around at the decimal places to make it "good enough" without being too approximate). I cannot find the source of the number used, but hey it works for me.
router.Mount(`/`, | ||
http.FileServer(http.FS(inlinedFiles)), | ||
) | ||
if *opts.IsDevelopment { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nice... I like this for the simplicity of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to merge... it works right?
I've approved, you can hit merge I believe.
b8b3472
to
3288d64
Compare
-dev
flag so dev on JS files can happen with just a reload, instead of re-building artifactbase.js