Subscribes to the server action response by calling a 'use cache' function. The server action invalidates the tag when done which triggers the newly retrieved timezone to be sent down the wire.
Allows very granular timezone access.
Playing around with some ways to get client's timezone for next.js SSR for date logic.
Read the timezone from the cookie, otherwise render a client component that calls a server action to set the timezone cookie.
@leeerob Something felt wrong about returning the input values in the action, and I didn't like the idea of storing them in local storage or having to switch to controlled components.
Bypassing the form action like mentioned in a different reply sounds promising. Not sure what's best!
@leeerob I've been trying to figure this out too. I've settled on using this hook to save the previously submitted formData. Then populating the "defaultValue" of an input based on that data.
I also have a bunch of helper functions for dealing with getting the right types in/out.
@paulg Honestly curious. Does the same apply for you? Have you ever wanted empathy and not a solution from someone else? You reckon it was a blindspot or just a different experience?
Hoping that regular practice of Yoga Nidra leads to an all around reduction in tension in daily life.
The key is just realising that relaxing is exactly the same as letting go.
And once you let go you’ll suddenly have so much more space to use tension when you need it.
Jaw clenching, teeth grinding, breath holding, shoulder tensing, neck bending. It all adds up.
I’ve always considered myself a calm person, but have never stopped to realise how much tension I carry everyday.
Trying to allow myself to take it slow and cut my coding time down.
Means accepting that things will take a long time to create, but that the chance of it actually being created is higher since I’ll be able to sustain the effort.
The problem with programming for me is how pervasive and mentally stimulating it is.
It’s so easy to get in flow and “burnout” by just completely forgetting to take care of myself (forget to eat, sleep late, etc).
My strategy for improving at bouldering is just to climb a lot, try hard, have fun, and not get injured.
The temptation is definitely there to optimise things, but I don’t really know what for.
It’s fun for me so I’m gonna try and keep it that way.
My current protocol for improving my flexibility
- get in a position that my body feels like it needs
- contract the opposing muscles
- relax completely
- get deeper into the position
- try and relax
- rinse and repeat
Becoming more flexible is just a process of letting go
Sometimes I feel like I’m unreasonably obsessive about perfecting apps which are effectively spreadsheets—serving customers which I have no predisposition to.
But it’s fun.
A lot of my recent antsiness has come from feeling time-pressure and societal-pressure to make money now.
The things I want to make feel like they take unreasonable amounts of time.
But accepting that good and fulfilling work takes time has given me back that space to create.
Have the urge to make this a real local first app instead of a glorified webpage.
Will require a more extensive migration and rearchitecture.
Looking into cr-sqlite for client + server db and using GRDB for querying and GRDBQuery for reactive data
Keepon Rebuild Log
Lost a lot of momentum with this last year.
Spent a lot of time trying to get things feeling native to the platform, which was just endless tweaking & tweaking. This was fun for a while, but was really making such small progress in the grand scheme of things.
I find it very hard to accept when things feel janky and out of place, I love the feel of apps that feel like they are built for the platform.
Fighting jank made me lose motivation and I've only just realised it. I hate compromising on these things in design, I want all the little details to be perfect (blessing & curse).
I feel a lot better about programming when it feels like a craft. Polishing the details that basically no-one will ever notice is one of my favourite things to do.
Also, when I personally choose between apps I tend to pick the one that's native for the platform. Much more likely that it's gonna feel nice, be efficient, and use platform-specific features.
In that vain I'm restarting the rebuild.
I reckon it'll be faster to just rebuild the iOS app in native Swift and just deprecate the web app for now.
(Note: original native iOS app is 8 years old, not written by me, written in Objective C, so very hard to maintain)
New goals for this rebuild:
1) Use as many platform-defaults as possible
2) Use modern SwiftUI
3) Get it feature-parity as fast as possible
THEN, rebuild the backend. This doesn't really make sense from any business perspective but I want to make the insides as nice as the outsides—and then make everything as efficient and simple as possible.
Goals for backend:
1) Move from Postgres to Sqlite
2) Move to a fullstack js framework
3) Move from Google Cloud to a VPS provider
4) Use the new suite of typesafe query builders
Then longer-term goals would be to simplify the product, consider lifetime pricing, double-down on the features users are actually using, and double-down on iOS native features (dynamic island, live activities etc.).
It's a lot of work with honestly basically little immediate benefit to users. But working on the app has felt like a drag for a long time. Getting it to the stage where it feels like I can iterate quickly would be huge from just a morale perspective.
And most importantly I feel like I'm learning and following my curiosity. Spent a lot of time this past year figuring out good patterns for building React apps, and will be fun to see how they play out in the Swift world.
I have a tendency to be very optimistic & too ambitious about these things, so I'll give myself a week of solid work on it and see 1) how it feels, and 2) how far I get.
I'll post all updates+learnings in this thread.
Keepon has a native iOS and web app, but seems unmaintainable with solo dev and old cold base.
Have played before with converting to next.js/react-native but always bite off more than I can chew.
Gonna retry with limiting scope to JUST the frontend & NO changing functionality.
Day 1 Summary
Have chosen to not use CocoaPods and just add packages via Xcode > File > Add Package Dependencies...
Missing HMR (like when using React), have got https://t.co/2kEIJEwNSh semi-working.
Missing Prettier, am using https://t.co/lHPi8krKEZ with a behaviour that runs `swift-format format -i -r --ignore-unparsable-files -p $PWD` on a keyboard shortcut
Have thought about tanstack query style caching, but I think it's a premature optimisation. When/if I decide to do it I'm considering using https://t.co/uu7wHRVhbR as a KV store for caching.
Plan is to implement each screen roughly with default styling, get all screens making API requests, and to "cover the canvas".
See GIF for where I got up to.
@visakanv A related warning: often times people who “don’t want to write mediocre stuff” are not motivated by pursuit of excellence, truly, but are motivated by status regulation. Very important that people not confuse the two, or get tempted from the first into the second.