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

Add ember-page-title to app default blueprint #645

Merged
merged 11 commits into from
Oct 16, 2020

Conversation

KamiKillertO
Copy link
Contributor

KamiKillertO and others added 4 commits June 25, 2020 10:26
Co-authored-by: abhilashlr <abhilashlr.789@gmail.com>
Co-authored-by: Ricardo Mendes <rokusu@gmail.com>
Co-authored-by: Melanie Sumner <melaniersumner@gmail.com>
@kellyselden
Copy link
Member

Should we audit the API of the addon as part of this effort?

@NullVoxPopuli
Copy link
Contributor

Should we audit the API of the addon as part of this effort?

@kellyselden I think so. There are certain capabilities I'd want to make sure are present, and I'd want to make sure that any addon we add "feels nice" to use


I have no experience with this addon, and haven't used anything other than custom title manipulation, so predisposition-wise, I'm starting from scratch. :D

Left some questions


## Summary

Add [`ember-page-title`](https://github.com/adopted-ember-addons/ember-page-title) to the default blueprint for new Ember apps as a way to provide improved out-of-the-box (OOB) accessibility for Ember applications.
Copy link
Contributor

@NullVoxPopuli NullVoxPopuli Jul 3, 2020

Choose a reason for hiding this comment

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

does the addon maintain a history of the titles?

Like, if I were to do a bunch of navigations where some, but not all page-title invocations have replace=true, does the title always reflect what is rendered?

Does that mean that the page title is dependent on render order?

What happens if I do?

{{#each this.breadcrumbs |breadcrumb|}}
  {{page-title breadcrumb.name}}
{{/each}} 

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure, I'll make a dummy app to test ^^

Copy link

Choose a reason for hiding this comment

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

I'll add nested route + breadcrumbs test case to ember-page-title and we'll find out.

Co-authored-by: Jan Buschtöns <buschtoens@gmail.com>
@btecu
Copy link

btecu commented Jul 3, 2020

Why ember-page-title and not something like https://github.com/mike-north/ember-cli-document-title-northm (fork of https://github.com/kimroen/ember-cli-document-title)?

@NullVoxPopuli
Copy link
Contributor

NullVoxPopuli commented Jul 3, 2020

Why ember-page-title and not something like https://github.com/mike-north/ember-cli-document-title-northm (fork of https://github.com/kimroen/ember-cli-document-title)?

💯

While I have no allegiance to any of these addons, I think in the alternatives / prior art and/or detailed design section, there should be some comparison between them? What makes one addon objectively better than the others and worth including by default?

@kellyselden
Copy link
Member

Yeah I think we should be committed to whatever addon and API we choose. It has to make sense, and not just come along because the addon is popular. For instance. I see that the way to configure the addon is a key on ENV in config/environment.js. Is that still the canonical way to configure addons in an Octane world? The answer is probably yes, but I just want to make sure.

@KamiKillertO
Copy link
Contributor Author

The first intent of the a11y strike team was to create an addon with the features of ember-page-title and ember-document-title. But, according to @MelSumner and a discussion she had with Yehuda (if remember correctly), ember-page-title is more aligned with the direction ember and front end frameworks are taking. Maybe @MelSumner can confirm 😊

@MelSumner
Copy link
Contributor

The first intent of the a11y strike team was to create an addon with the features of ember-page-title and ember-document-title. But, according to @MelSumner and a discussion she had with Yehuda (if remember correctly), ember-page-title is more aligned with the direction ember and front end frameworks are taking. Maybe @MelSumner can confirm 😊

Yes that’s correct! We felt ember-page-title was the most aligned with the current and future direction of the framework (a template-based solution).

@MelSumner MelSumner self-assigned this Jul 15, 2020
Co-authored-by: Jan Buschtöns <buschtoens@gmail.com>
@MelSumner
Copy link
Contributor

@rwjblue reminder to file the relevant issues on the addon so we can move to FCP this RFC. 👍

@knownasilya
Copy link
Contributor

@rwjblue are there any breaking changes required? Was planning on releasing a new major version this week.

text/0000-add-ember-page-title-addon.md Outdated Show resolved Hide resolved
text/0000-add-ember-page-title-addon.md Outdated Show resolved Hide resolved
@simonihmig
Copy link
Contributor

Yes that’s correct! We felt ember-page-title was the most aligned with the current and future direction of the framework (a template-based solution).

While I can relate to that, I think the RFC should explain that in some detail. Like there are a couple of other similar addons - which IIRC follow a route-based rather than template based API - and why do we pick this one and not one of the others?

Which brings me to another topic: meta tags. While this RFCs only mentions a11y concerns as a motivation - which is legit - another one is SEO, especially when used with FastBoot. But when thinking of SEO, you also want to account for proper meta tags.

While this does not necessarily be tackled within the same RFC, I think we should have at least a broad idea about how to extend support to meta tags. So there a couple of addons (e.g. ember-cli-meta-tags, ember-meta) for this, which

  • are also based on ember-cli-head
  • follow a different route-based API
  • also allow to set the title tag ⚠️

So when endorsing one addon in such a massive way by making it a default one, we should make sure there is a viable way to also support meta tags, that

  • follows the same API philosophy (template vs. route)
  • does not cause conflicts or overlapping concerns
  • and as such guarantees a pleasant DX

Or at least we should make sure there are no reasons to later revert our decisions here because of this.

Another thing: what does making a "user-land" addon a default one mean in terms of maintenance guarantees? I am in no way suggesting this addon is not well maintained (frankly I have no idea, I haven't used it before), but the addon is part of the addopted-ember-addons because of lack of maintenance in the past I assume, so does adoptig this RFC basically mean this addons gets a maintenance guarantee from some official Ember team (core, cli?), in case current maintainers are not able to provide that anymore? If so, does it make sense to transfer the addon to the @emberjs org, to signal that stability guarantee to users?

@KamiKillertO
Copy link
Contributor Author

While I can relate to that, I think the RFC should explain that in some detail. Like there are a couple of other similar addons - which IIRC follow a route-based rather than template based API - and why do we pick this one and not one of the others?

It's a good idea, I'm gonna add a small explanation 👍 .

Another thing: what does making a "user-land" addon a default one mean in terms of maintenance guarantees? I am in no way suggesting this addon is not well maintained (frankly I have no idea, I haven't used it before), but the addon is part of the addopted-ember-addons because of lack of maintenance in the past I assume, so does adopting this RFC basically mean this addons gets a maintenance guarantee from some official Ember team (core, cli?), in case current maintainers are not able to provide that anymore? If so, does it make sense to transfer the addon to the @emberjs org, to signal that stability guarantee to users?

In the RFC, it's indicated that this addon should be transferred to the Ember CLI org. It's true that making an addon part of the default blueprint involves that the official Ember team will have to maintain it somehow and we should be very careful about that. This question was raised while working on the RFC 638 and now the RFC clearly indicates that before adding any new option using an external addon, we should evaluate the maintenance cost that might come with.

@knownasilya
Copy link
Contributor

knownasilya commented Sep 25, 2020

I'm interested in the meta tags discussion, and am highly aware of the importance there as well. We just removed ember-cli-head from ember-page-title, so the meta support is no longer included because of that dependency. I think that area is worth discussing but unsure if it should be in this PR. Maybe something template based as well.

{{page-meta (hash og:title='Test')}}

Not sure we can do something like that with special characters. Will have to see if (hash 'og:title'='Test') works.


Edit, looks like it works as (hash og:title='Test') https://ember-twiddle.com/bac18e42d25f5b6896e15cdcb6eb20b2?openFiles=templates.application%5C.hbs%2C

@gossi
Copy link

gossi commented Sep 25, 2020

I agree with @simonihmig here. There is more than just <title>. I can relate to all his points. Indeed I found an old gist I put together that explains the whole problem around this: https://gist.github.com/gossi/c3d6fded03be001d8b9763a8219b0a5e It's from almost one year ago. Ignore the code, take the idea.

Actually, what I would expect from ember would be an API that the various addons can connect to. So ember is reigning <head> (or parts of it) and provides an API to that. Addons will use this API to exchange information. I as a consumer can choose an addon that provides the API I am looking for - not the one ember picks for me. For example:

I will write myself a decorator that I put on my routes, to control the title and it's hierarchy/information architecture of my site and another breadcrumb component (which I installed as an addon) that will use that generated data to control the breadcrumbs. The data lives in the "central head content repository".

@knownasilya
Copy link
Contributor

knownasilya commented Sep 25, 2020

I think we can have both, an official service and helpers that let you change that without having to install addons. For accessibility it should be included out of the box, because otherwise it's not done, especially by junior devs. I could even see a template linting rule that knows if you are at a route template and suggests adding a title, but that would be difficult if they had to go down a rabbit hole of how to setup a title with a service and where does it go, etc.

ember-page-title v6 has been released and dropped ember-cli-head (which required the use of `<HeadLayout/>`)
@MelSumner
Copy link
Contributor

@KamiKillertO now that ember-page-title has a new release, I think we can update this RFC to reflect that, and work on getting this RFC shipped. 👍🏻

@KamiKillertO
Copy link
Contributor Author

Thanks @MelSumner 👍 , I've already updated the RFC to reflect ember-page-title changes

@MelSumner
Copy link
Contributor

We have discussed this in today's Framework Core Team meeting, and decided to move this RFC to Final Comment Period.

@MelSumner MelSumner added Final Comment Period T-ember-cli RFCs that impact the ember-cli library T-learning labels Oct 9, 2020
@hergaiety
Copy link
Contributor

Just voicing support for this RFC and bringing the addon into the core app. I'm glad to see page titles will be less of an afterthought in the apps I work on every day and I'll no longer need to make a case to include another addon, as that case has already been made here! Great work to everyone involved 🎉

@raido
Copy link

raido commented Oct 15, 2020

This seems to be still relevant issue - ember-cli/ember-page-title#90 from accessibility perspective?

@KamiKillertO
Copy link
Contributor Author

KamiKillertO commented Oct 16, 2020

I don't think 🤔.
Screen readers don't announce page title updates when there are no actual page navigations (navigation to a new HTML page), which is the case with ember applications (because of the router). This is why the addon a11y-announcer exist.

@rwjblue
Copy link
Member

rwjblue commented Oct 16, 2020

Lets do it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Final Comment Period T-ember-cli RFCs that impact the ember-cli library T-learning
Projects
None yet
Development

Successfully merging this pull request may close these issues.