-
-
Notifications
You must be signed in to change notification settings - Fork 264
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
Big breaking change: Make the compiled file do less and implement autorecompilation #402
base: master
Are you sure you want to change the base?
Big breaking change: Make the compiled file do less and implement autorecompilation #402
Conversation
Oh: it's probably out of scope for this PR, but I want to design this change such that it enables adding plugins imperatively, i.e. via a command. Probably a good idea to look at how |
This PR is also going to need some mechanism for migrating users, e.g. by deleting their old |
Will auto compilation happen at startup ? when will the check happen actually?
Any comment on #307 . Things like #393 will continue to be an issue but more unexpectedly as some plugins will work and some won't based on what filesname packer choses for the loader.
What happens when they are out of sync? Say I wanted to test out someone elses config or a framework more importently trying to isolate a plugin to file a bug report . If I comment out some plugins will that be an erroe? |
Right now, I'm thinking the check happens at startup; recompilation happens on
#307 is on my queue to reply to. From what I remember the last time I looked at it, it's somewhat orthogonal to this set of changes (i.e. we can make the move to be fully-opt if we decide to without causing a breaking change), but, regardless, the name of the compiled file should not matter - it won't be somewhere that Neovim sources, but will be explicitly loaded/run by
The idea of autocompilation would be that, when you're testing another config, your compiled file automatically gets rebuilt and sourced, and when you go back to your usual config, it gets rebuilt and sourced again for you. So all you see is a slightly slower startup time those two times. I think there is a question here around how we handle using different configs e.g. with cleaning "unused" plugins, etc., but in my mind that's more of an argument in favor of #307.
No. Without #307, if they're |
Ok got it .
I wasn't meaning compiled file but the file in |
So we need to make |
Ah, my bad. Yes, I think that without #307 or similar, which file the user chooses to call
I have a slightly different architecture in mind:
|
@wbthomason this all sounds good. One question, would a user still have to keep all they configs/setup in the main packer file. Not sure anything that's been mentioned implies that but we previously discussed that maybe being required and I'm curious if that might be a new restriction but I don't see why. I'm wondering how you want to tackle this I appreciate that there's a breaking change and maybe the sense that this can/should be done in one PR but I'm wondering if this work can't be chunked up into bits maybe some code changes that aren't used till a particular point where things finally get switched over. I'd be happy to help with bits of it as time permits but I guess I'm wondering how we can split this out in a way where it's easier for multiple people to pick up chunks until we reach a stage where we want to flip the switch and move everything over. Or maybe making incremental PRs into this one 🤷🏾 . |
They should still be able to split their config across files, but must ensure that any files specifying plugins they want to use are sourced before they call the new loader function in their config. This is compatible with all the current use cases I'm aware of; they could always just call the loader function in a file in
Yeah, splitting this up would be smart. I think I prefer to make multiple PRs into this PR branch, but I'm open to suggestions. I think there are a few separable chunks to this work:
An implementation of the ideas in #307 could also fit into this big set of changes, as part of (1) and (2). That said, I'm not sure if it's wise to change so much all at once. |
To that last point, I currently (with the new Lua runtime PR merged) have
This is working very well for me right now, and I would like to keep it this way ;) |
@clason That should still be 100% compatible with both this PR and #307. EDIT: Actually, I spoke a bit too quickly. That use case is definitely fine under this PR. It would be broken by #307, I think, because it's possible that some of your |
I think I'll propose removing compilation again . I've been testing in my branch without compilation . I'm getting ~10% startup time degradation ( couple of ms :P ) without compilation though I think most of it is from calling |
Removing manual compilation (though I still plan to "compile" - more like cache to file - some information that can be automatically updated and saves us from needing to do some expensive FS operations at startup) is still a priority. I'm disentangling that from #307 for now. The main blocker right now is just that my (admittedly limited) maintenance time for This is the work I have planned to move away from manual compilation: Code changes
Docs/community changes
If the community wants this prioritized over other bug fixes and issue maintenance, I'm happy to focus on it. |
Ok if you want to do it that way . Actually I'm not much concerned about #307 ever since I figured I can change XDG env vars to move packers location. Also I can very well setup a system like #307 from currently available config options.
I feel like we don't need to keep track of ftdetect files. runtime! OPT ftdetect/**/*.vim
runtime! OPT ftdetect/**/*.lua Nvim itself basically runs |
@shadmansaleh Ah, I didn't know about |
24d18d3
to
f049f5b
Compare
Hey, So, assuming users are still able to nicely maintain their plugin registrations, this is a comparison on how fast the currently compiled file gets sourced versus a user having to load all its plugin registrations. Assuming the Today I was working on a better stringify function for the compilation (as |
37c58ae
to
57dbc3d
Compare
@shadmansaleh @akinsho Now that #331 is merged, this PR will be the big breaking change to:
packer
config alwayssetup
andconfig
as well ascond
andafter
stdpath('cache')
luv
instead of e.g.vim.fn
wherever possible, in general simplify and tidy things which have grown cruft over the course ofpacker
's existence so far.