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

Deprecate strLua types/option helpers #2003

Open
MattSturgeon opened this issue Aug 10, 2024 · 2 comments
Open

Deprecate strLua types/option helpers #2003

MattSturgeon opened this issue Aug 10, 2024 · 2 comments
Labels
tech debt Related to technical debt and/or refactoring

Comments

@MattSturgeon
Copy link
Member

MattSturgeon commented Aug 10, 2024

Why

The biggest issue with types/options that transform the value is that once implemented, we are stuck with it lest we break users configs that rely on the transformation.

The other issue is that the transformation is somewhat hidden, meaning users end up defining a config in nix that is subtly different from the lua we end up producing.

Neither of these are an issue for "normal" module options, but for rfc42 style options such as settings it is not ideal.

How

We can deprecate passing strings directly using transitionType coercion. Similar to extraFiles, we would need a transition period before eventually removing support for string definitions.

When

We should update internal uses before having a deprecation warning.

Even if we don't want to deprecate yet, replacing the option apply implementation with a coercedTo type would be a good refactor IMO.

We should consider moving to nixpkg's lib.generators.mkLuaInline too, before asking users to change their configs. See #1935

@MattSturgeon MattSturgeon added the tech debt Related to technical debt and/or refactoring label Aug 11, 2024
@MattSturgeon
Copy link
Member Author

MattSturgeon commented Aug 14, 2024

@nix-community/nixvim any thoughts on a plan here? I think we should go down the strLua = coercedTo str mkRaw rawLua route, and start using __raw in our defaults/examples.

However I'm hesitant to make this change if we're soon going to start recommending lib.generators.mkInlineLua instead of lib.nixvim.mkRaw (#1935). It's possible we'd instead want coercedTo str mkInlineLua inlineLuaType?

I think we should decide this soon, since as this decision is currently blocking #2007.

@khaneliman
Copy link
Contributor

I would be in favor of just transitioning to the new type mentioned in #1935 instead of spending time with rawLua if we will transition away from it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tech debt Related to technical debt and/or refactoring
Projects
None yet
Development

No branches or pull requests

2 participants