Skip to content
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(daemon): Consolidate interface definitions and cleanup #2225

Merged
merged 4 commits into from
Apr 24, 2024

Conversation

kriskowal
Copy link
Member

These individually reviewable commits consolidate some recurring patterns, move interface definitions into a separate module, adds more explanatory comments, and fixes some lingering errors.

Copy link
Contributor

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! A couple of inline comments. The interfaces refactor is most appreciated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, why not interfaces/index.js and interfaces/web.js? Indeed, why a separate file at all?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I loathe the Node.js index.js lookup because it assumes a search path that doesn’t translate to the web. Of course, that’s immaterial since we’re never going to be free of a bundler or import-map, but I prefer to live in the make-believe so as to be ready for change.

I separated interfaces/web.js because these interfaces are not canon to the daemon itself but a contract between the web server and client, and the web client should shake out the interfaces it doesn’t need in its bundle.

type: 'known-peers-store',
});
// We generate formulas for some entities that are presumed to exist
// because they are parts of the daemon's root object.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// because they are parts of the daemon's root object.
// because they are part of the daemon's root object.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the cardinality of “formulas”, “entities”, “are”, and “parts” should agree here.

Base automatically changed from kriskowal-daemon-at-import to master April 24, 2024 00:54
@kriskowal kriskowal merged commit dc486dc into master Apr 24, 2024
20 checks passed
@kriskowal kriskowal deleted the kriskowal-daemon-cleanup branch April 24, 2024 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants