-
Notifications
You must be signed in to change notification settings - Fork 2
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
refactor hardcoded layout strings #834
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Datadog ReportBranch report: ✅ 0 Failed, 167 Passed, 34 Skipped, 35.4s Total Time |
I'm a bit confused by this statement. I feel we should lean in to the inferred types from TypeScript, which can provide an early warning system specifically for such issues. The If there are places where this wasn't caught, we should fix the root cause which is that the types are not being defined correctly. |
You have a point! Before starteing this PR, I reflected on the challenges I had in the past weeks, esp. as a newcomer to the codebase. There's some area of improvements that slowed down my onboarding which I hope I can address to make things easier for others in the future. The goal of this PR is to improve two key areas:
Yes, we could address this with more documentation, but IMO documentation can sometimes cause more problems than it solves. This is esp. true if it isn’t regularly maintained, which will happen to us more often since the team is limited in time and manpower (also, keeping it up-to-date is more chore than anything) Here are a few examples to illustrate this (Note: they are overlapping in some cases)
To be clear, this change will probably have minimal impact when it comes to enforcing type checks. Since both |
…ngohjw/refactor-hardcoded-layout-strings
case "homepage": | ||
case "notfound": |
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.
nit: for standardisation should we also use ISOMER_PAGE_LAYOUTS
here?
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.
yes but... i have no idea why npm run build
fails with a totally unrelated error message when i import that. Spend quite some time trying to debug that but couldn't figure out why too
…ngohjw/refactor-hardcoded-layout-strings
…ngohjw/refactor-hardcoded-layout-strings
This pull request has been stale for more than 30 days! Could someone please take a look at it @opengovsg/isomer-engineers |
This pull request has been stale for more than 30 days! Could someone please take a look at it @opengovsg/isomer-engineers |
too stale - will create it in another PR subsequently |
Problem
Currently all layout are hardcoded as string throughout the app, across UI and Studio.
This makes it hard to debug/improve + more prone to error due to carelessness
Solution
Breaking Changes
Features:
Improvements:
Using a Single Source of Truth approach
ISOMER_PAGE_LAYOUTS
and use it whenever possible insteadTAILWIND_SIMPLIFIED_LAYOUTS
and use it whenever possible instead