-
Notifications
You must be signed in to change notification settings - Fork 12
feat: Export public interfaces of Node, File and Folder
#976
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
Conversation
Bundle ReportBundle size has no change ✅ |
Do we need to store them as deep reactive objects? |
|
In Vue classes instances (except data classes) aren't usually used in reactive data.
IMO, if we don't consider these object Vue-related entities, we should only work with them as non-reactive, marking Then, if they are mutable and we need to react on the mutation (e.g. attributes or That's why I asked if we need them to be reactive if we are using them as mutable objects in server/apps. |
|
Well mostly I would say no we do not need the node to be reactive but only the wrapping array. |
|
|
|
Adding |
|
I adjusted the dialogs file picker as a first step by using |
c51c354 to
83266c5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, this PR may still make sense to use, where we don't need an actual Node/File instance
If you using those classes in Vue (e.g. in data) they will cause errors, as Vue unrefs data deeply and this causes all private fields to be stripped off from the interface. Passing one of those classes from data to a function that expects e.g. `Node` will then cause a Typescript error because the passed value is lacking the private fields. So instead this provives interfaces that can be used whenever a parameter should be of one of those types. Signed-off-by: Ferdinand Thiessen <[email protected]>
83266c5 to
3e50052
Compare
I would like to discuss this issue:
If you using those classes in Vue (e.g. in data) they will cause errors, as Vue unrefs data deeply and this causes all private fields to be stripped off from the interface. Passing one of those classes from data to a function that expects e.g.
Nodewill then cause a Typescript error because the passed value is lacking the private fields.So instead this provides interfaces that can be used whenever a parameter should be of one of those types.
Example of one of those errors:

Alternative: Cast them every time you use them, like