-
Notifications
You must be signed in to change notification settings - Fork 24
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(common-lib): use a more object-oriented-programming approach #326
refactor(common-lib): use a more object-oriented-programming approach #326
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
CodSpeed Performance ReportMerging #326 will not alter performanceComparing Summary
|
c094438
to
e7771ef
Compare
7c33313
to
34ea37d
Compare
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.
Awesome! this is definitely in the right direction! Thank you @Tzal3x .
A few questions and suggestions on ways to improve further.
A utility class that makes it safer to load the environment variables of the project. By using this class, we can ensure that the environment variables are loaded correctly and their data types are correct. --------- Co-authored-by: giac-mysten <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Update its' functions to depict the new name.
Summary
I noticed that we need more flexibility as more features are coming in. Closes SEINT-428.
Moving on to an object-oriented approach by defining some classes and composing new ones based on them using the composition pattern will help us achieve that.
This way we can avoid spiraling down to multiple
if-else
clauses whenever a new feature request is coming.In upcoming PRs, we can create a
PageFetcherFactory
class that generates a differentpageFetcher
which will contain different rpcURLs, domain resolution logic etc based on the type of site (based on the allowlist) that we will serve.Changelog
PageFetcher
class.ResourceFetcher
class.WalrusSitesRouter
class.rpcSelector
is no longer a singleton. A differentRPCSelector
can be used for: suin resolution, resource fetching and routes fetching without adding complex conditional flow control in thecommon/
library's code.