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

Automatically parse any THREE Enum property types #87

Closed
jo-chemla opened this issue Jun 19, 2023 · 4 comments
Closed

Automatically parse any THREE Enum property types #87

jo-chemla opened this issue Jun 19, 2023 · 4 comments
Labels
High priority M Issue is a medium amount of effort. New feature New feature or request

Comments

@jo-chemla
Copy link

It would be great if all THREE Enums property types - properties other than bool, number, string, color, vector3, transforms, array etc - could be handled all automatically without the need to do the associations on a per property basis within the triplex codebase.

For example, atm, side property and multiple other dropdowns offer no options at the moment. When set through code via the editor, a warning is shown within triplex UI, prop is controlled by code, and the value is not applied.
Probably linked to literal-union-input.tsx and prop-input.tsx, as well as useLazySubscription from @triplex/ws-client

Temporary quickfix: allow for free-form string text fields for properties which were not parsed, and when the user enters a string starting with THREE., then evaluate that code block.

@itsdouges itsdouges added the New feature New feature or request label Jun 20, 2023
@itsdouges itsdouges added this to the Ready for beta milestone Jun 20, 2023
@itsdouges itsdouges added the M Issue is a medium amount of effort. label Aug 23, 2023
@itsdouges
Copy link
Collaborator

@jo-chemla can you confirm what you see in the latest Triplex + Three.js release? Looks like side is now a numeric literal. Is that the same for other THREE enums?

image image image

Obviously it's not helpful seeing numbers in the UI so we'd need to improve that.

@itsdouges
Copy link
Collaborator

itsdouges commented Oct 15, 2023

Looks like the @type/three definition has moved from enums to literals? Unless they were always like this? 🤔

image

@itsdouges
Copy link
Collaborator

itsdouges commented Oct 16, 2023

This is what it will look like in the next release of Triplex:

In Editor:

image

In Code:

image

Currently don't pull out the objects into code and instead just use the literals because that is more things to handle (add/remove etc). Can update in the future if needed.

@jo-chemla
Copy link
Author

Impressive, thanks for the updated fix this looks great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
High priority M Issue is a medium amount of effort. New feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants