Skip to content
This repository was archived by the owner on Sep 24, 2018. It is now read-only.

Change comment author to structured data - #955

Merged
rachelbaker merged 4 commits into
developfrom
structured-comment-author
Mar 25, 2015
Merged

Change comment author to structured data#955
rachelbaker merged 4 commits into
developfrom
structured-comment-author

Conversation

@rmccue

@rmccue rmccue commented Mar 1, 2015

Copy link
Copy Markdown
Member

For comments, we currently have destructured author data in the following form:

{
    "author": "admin",
    "author_email": "admin@example.com",
    "author_url": ""
}

Why did we switch from structured data (author: { ... }) to destructured data in the first place? Is anyone opposed to changing that back?

Also fixes #893.

@rmccue rmccue added this to the 2.0 milestone Mar 1, 2015
@danielbachhuber

Copy link
Copy Markdown
Member

Destructured data is easier to use, and more consistent with the rest of the API

@rmccue

rmccue commented Mar 2, 2015

Copy link
Copy Markdown
Member Author

Destructured data is easier to use

I'm not sure exactly what you mean by "easier to use". There are contexts certainly where destructured data is easier to use; Backbone models are a good example of that (with model.get()). However, structured data is a lot easier to use in other contexts, such as Handlebars templates:

{{#with author}}
    <h2>By <a href="{{ url }}">{{ name }}</a></h2>
{{/with}}

I don't think there's a clear benefit to destructured data in that context.

and more consistent with the rest of the API

More consistent with what exactly? One advantage of having structured data for comment authors is that you can get a user-like object, which means you can share code for things like views.

rachelbaker added a commit that referenced this pull request Mar 25, 2015
Change comment author to structured data
@rachelbaker
rachelbaker merged commit e81be7b into develop Mar 25, 2015
@rachelbaker

Copy link
Copy Markdown
Member

Merged #955

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Comment author email address probably shouldn't be exposed by default

3 participants