GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — refactor(core): remove core.lua and adopt services as shared primitives by jensenojs · Pull Request #360 · sudo-tee/opencode.nvim Conversation
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pull request overviewThis PR removes the legacy Changes:
Reviewed changesCopilot reviewed 25 out of 25 changed files in this pull request and generated 10 comments. Show a summary per file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsUh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page.
jensenojs
force-pushed
the
clean-code-remove-core
branch
from
4b21675 to
4008866
Compare
test: split legacy core_spec into service-focused specs chore(docs): align handlers/services AGENTS boundaries
jensenojs
force-pushed
the
clean-code-remove-core
branch
from
4008866 to
b271725
Compare
|
There was an error while loading. Please reload this page.
|
This PR is just a beginning; it doesn't actually clean up the code (call chain). I'll add an analysis and explanation later. The division of phases in this stage is quite rough and not very instructive, but I still hope you can review this architecture diagram or the vision here. I believe this approach is key to improving maintainability in the future. Currently, the hierarchy of dependencies between Lua modules is very messy, so splitting the core merely shifts the focus of the problem without truly solving it. I'm working on a small script to trace the call chains between this plugin's modules. The specific design of the call flow is a topic open for further discussion (defined by JSON). We can use that little tool to see the gap between the current state of the code and the expected outcome, as well as the extent of reference relationship cleanup under each diff. In a way, I think it might be the endpoint of architectural code cleanup? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
using #361 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
The split make sense to me, even if it does not resolve the dependency you hoped for. Do you need more work on this to reduce the depedency ? I think that will have a hard time to reduce the module coupling since we use require directly. Until we adopt a Dependency injection mechanism, but I'm not sure I want to go there yet as this is time consuming and this plugin is not an entreprise framework but only a hobby |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Yes, I agree with your point. The direction of this PR is still correct; it just highlights an issue (which actually has little impact), and I think it can be merged. When I saw that dependency topology, I felt a bit of despair for a moment, as the workload seemed quite substantial. My amateur interest drives me to intermittently do some code cleanup because it’s quite enjoyable for me. Or perhaps we only care about code quality in projects we value, haha. lately, we might all need a break. I imagine you must be quite tired. However, on the positive side, I think there are at least two very good things. This tool helps us outline the current state of the architecture at a global level, although this starting point may not be ideal And I also tried to give what seems like a rather elegant endpoint (if you haven't seen that architecture diagram yet, I'd like to ask you to take another look #322 (comment) —in our internet jargon here, it might be called "alignment" haha). The advantage is that future functional implementations can be relatively freely combined. #318 (comment) As long as we can reach a broad consensus on the starting point and the endpoint, it might not matter if our next large-scale refactoring happens months or even years from now (or maybe others will be interested in continuing the refactoring?). Especially since subsequent refactoring should involve some convergence in direction. We are also unlikely to have serious design reviews, especially for the coordination between large-scale refactorings, as we have more or less created some new issues I intuitively feel that if the current code architecture is to be transformed into my ideal architecture, there might be some layering and migration of modules. The current UI module and state module both seem quite large (haha, I haven’t looked closely at your PR). Just thinking about such a large-scale migration gives me a headache, even though theoretically it’s similar to this PR—some metrics might appear worse, but it should just be temporary localized pain. But let’s take break for now , let's talk about it the next time we find it interesting @sudo-tee , Thank you for your time and effort. by the way, I didn't quite get how this relates to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
For the so we call require('opencode.state').something , rather that having But to do this would be a major refactor that I'm not sure is really worth it. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Oh, I mean that even when using require, their dependency graph should still be relatively simple. But I understand your point. I agree; we'll stop at this stage until something interesting gets blocked by the current code. Just finding a random place to jot down potentially interesting PRs |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…es (sudo-tee#360) test: split legacy core_spec into service-focused specs chore(docs): align handlers/services AGENTS boundaries
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.