You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make alternative short predicates available for options hashes with @nest #62
That might be possible, but then we'll have to take into the account of the possibility of conflicting variable names.
Also, a (perhaps bigger) question is how to enable this functionality, as we may not want to enable this by default due to the possibility on conflicting variable names.
A first option could be to add some kind of annotation in the jsdoc of a variable name, which indicates that its Components.js name should be "shortened".
A second option could be to configure this across the whole package, as a flag to the generator's CLI tool.
Perhaps having both may even make sense.
Another thing I'm also not sure about is the "also allow" part of this functionality, perhaps there may be a need to "instead allow". But this could also be solved via a CLI flag.
This may be a better reflection of the actual constructor interface, and avoid conflicts completely.
This could be done internally using JSON-LD's @nest functionality.
In any case, the alias-based approach is definitely also possible.
changed the title [-]Make alternative short predicates available for options hashes[/-][+]Make alternative short predicates available for options hashes with `@nest`[/+]on May 26, 2021
Activity
rubensworks commentedon May 20, 2021
That might be possible, but then we'll have to take into the account of the possibility of conflicting variable names.
Also, a (perhaps bigger) question is how to enable this functionality, as we may not want to enable this by default due to the possibility on conflicting variable names.
A first option could be to add some kind of annotation in the jsdoc of a variable name, which indicates that its Components.js name should be "shortened".
A second option could be to configure this across the whole package, as a flag to the generator's CLI tool.
Perhaps having both may even make sense.
Another thing I'm also not sure about is the "also allow" part of this functionality, perhaps there may be a need to "instead allow". But this could also be solved via a CLI flag.
RubenVerborgh commentedon May 25, 2021
Precedence is fine here for me. (Perhaps the generator doesn't even need to know, and the JSON-LD context just overrides it.)
Default seems fine if there is precedence.
It's just an alias?
rubensworks commentedon May 26, 2021
Alternatively, we could also enable something like this:
This may be a better reflection of the actual constructor interface, and avoid conflicts completely.
This could be done internally using JSON-LD's
@nestfunctionality.In any case, the alias-based approach is definitely also possible.
RubenVerborgh commentedon May 26, 2021
I love the above.
[-]Make alternative short predicates available for options hashes[/-][+]Make alternative short predicates available for options hashes with `@nest`[/+]rubensworks commentedon Feb 8, 2022
The alias solution will be supported in 3.x. Will leave this issue open for the
@nest.