Skip to content

Element Pointer#38

Merged
kylef merged 2 commits intomasterfrom
kylef/element-pointer
Mar 28, 2017
Merged

Element Pointer#38
kylef merged 2 commits intomasterfrom
kylef/element-pointer

Conversation

@kylef
Copy link
Member

@kylef kylef commented Mar 27, 2017

Element Pointer is currently a special case and the only type that does not extend from an element which means it has special rules when it comes to serialisation and de-serialisations. These have been brought up in the discussion at #36 (comment) and while we are at it, I think it makes sense for the element pointer to become an element.

@kylef kylef mentioned this pull request Mar 27, 2017
@kylef kylef requested review from pksunkara and smizell March 27, 2017 22:20
+ element: elementPointer (fixed)
+ attributes
+ path (enum) - Path of the referenced element to transclude instad of element itself
+ element (default)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't we reserve the keyword element?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, then perhaps this could be entire to represent the entire element.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to note, we reserve it for object properties, but not sure about values (here it would be the value of the path property). With that said, it may be helpful to not use element as a possible value.

Second, do you want to require this value @kylef? I know you have expressed thinking about the Zen of Python, and it would remove a rule for the implementation (i.e. if path isn't set, do X, if not, do Y). It doesn't matter to me, so I'm just bringing it up if we want to start thinking about being more explicit with the serialization/deserialization.

Copy link
Contributor

@smizell smizell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this change. Makes it a lot simpler. I don't feel too strongly about how to handle the path value of element—whether that should be element or entire. I think element makes the most sense, but I understand if you all think it should be reserved.

I also added a comment on requiring a value for path to make it more explicit.

Overall, 👍

@pksunkara
Copy link
Contributor

Well, if we are writing down serialisation formats and rules, do we still need to reserve the element keyword? (Maybe we do for embedded refract format, but I just wanted to raise the question).

@kylef
Copy link
Member Author

kylef commented Mar 28, 2017

Ok so are we good to go with this RFC @pksunkara ?

@pksunkara
Copy link
Contributor

Yup, didn't realise element is a value here.

@kylef kylef merged commit e588d89 into master Mar 28, 2017
@kylef kylef deleted the kylef/element-pointer branch March 28, 2017 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants