RFC: Interfaces between nix <-> python <-> javascript #1832

Open
opened 2024-07-30 14:29:51 +00:00 by Qubasa · 2 comments
Owner

Problem: dataclass generation makes it such that nix code and clan-app (python code) has to have the same git revision. However a user can have an old clan-app installed and create a new clan that uses different nix code modules with a slightly differing interface. Before we could check if a field exists and "ignore" it or set default values due to the nature of dynamic typing.

Two solutions.

  1. clan-app can only be started from a clan devshell (and not globally)
    --> Problem: Can't use clan uri invocations through desktop files if not globally installed

  2. Don't generate Dataclasses and instead make everything only runtime checked.
    --> How do we fix incompatible frontend code that expects different values for a nix module
    --> How do we fix the inventory which may have an incompatible or old schema
    SOLUTION:
    --> Every clan module needs to ship with the frontend code
    --> Every clan module needs to ship with a inventory migration script
    --> Every clan module should ship with a test

Problem: dataclass generation makes it such that nix code and clan-app (python code) has to have the same git revision. However a user can have an old clan-app installed and create a new clan that uses different nix code modules with a slightly differing interface. Before we could check if a field exists and "ignore" it or set default values due to the nature of dynamic typing. Two solutions. 1. clan-app can only be started from a clan devshell (and not globally) --> Problem: Can't use clan uri invocations through desktop files if not globally installed 2. Don't generate Dataclasses and instead make everything only runtime checked. --> How do we fix incompatible frontend code that expects different values for a nix module --> How do we fix the inventory which may have an incompatible or old schema SOLUTION: --> Every clan module needs to ship with the frontend code --> Every clan module needs to ship with a inventory migration script --> Every clan module should ship with a test
Qubasa added this to the Clan_Kanban_Board project 2024-07-30 14:29:51 +00:00
Qubasa changed title from clan-app to RFC: Interfaces between nix and python and javascript 2024-07-30 14:32:51 +00:00
Qubasa added the
needs-review
label 2024-07-30 14:33:04 +00:00
Owner

3. Solution

clan-app becomes a thin wrapper that runs nix run --inputs-from <local-flake> .#clan-web, that actually contains all the code that the currently in clan-app. This allows to freely generate all python/ts code as part of the build and make sure everything is always in sync. We also no longer need to check in python code because we can just add a library package to propagatedBuildInputs of clan-web

Problem: Can't have UI for external clan modules

## 3. Solution clan-app becomes a thin wrapper that runs `nix run --inputs-from <local-flake> .#clan-web`, that actually contains all the code that the currently in `clan-app`. This allows to freely generate all python/ts code as part of the build and make sure everything is always in sync. We also no longer need to check in python code because we can just add a library package to propagatedBuildInputs of `clan-web` Problem: Can't have UI for external clan modules
Qubasa changed title from RFC: Interfaces between nix and python and javascript to RFC: Interfaces between nix <-> python <-> javascript 2024-07-31 10:37:39 +00:00
Owner

I like the idea of @mic92. The problem that we "cant" have a ui for external modules, can be solved. If the external clan modules are rendered completely dynamically. But apart from the UI, they also need to be compatible to the "core" modules.
So it'd be best if everything is in sync with each other, everything else can lead to undefined behavior, but might be fine?

For UI, i'd like to allow modules, some form of templating language, that allows them to ship a config mask that is dynamically loaded. But that needs a while...

I like the idea of @mic92. The problem that we "cant" have a ui for external modules, can be solved. If the external clan modules are rendered completely dynamically. But apart from the UI, they also need to be compatible to the "core" modules. So it'd be best if everything is in sync with each other, everything else can lead to undefined behavior, but might be fine? For UI, i'd like to allow modules, some form of templating language, that allows them to ship a config mask that is dynamically loaded. But that needs a while...
Qubasa removed the
needs-review
label 2024-08-10 22:46:46 +00:00
Qubasa self-assigned this 2024-09-02 20:34:21 +00:00
hsjobeki was assigned by Qubasa 2024-09-02 20:34:21 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: clan/clan-core#1832
No description provided.