Skip to content

Conversation

@natebosch
Copy link
Member

Closes dart-lang/build#892

If the users has not specified a favicon chrome will attempt to load
/favicon.ico by default. If this would otherwise be a 404 we can
provide a default and avoid an error in the console.

The default icon is the same as the dart.dev site.

Closes dart-lang/build#892

If the users has not specified a favicon chrome will attempt to load
`/favicon.ico` by default. If this would otherwise be a 404 we can
provide a default and avoid an error in the console.

The default icon is the same as the `dart.dev` site.
@natebosch natebosch requested review from grouma and jakemac53 June 5, 2019 00:00
@jakemac53
Copy link
Contributor

Hmm, I am not sure we should really do this. It is on the application developer to provide a favicon, and hiding the error at development time just means it will show up when they deploy which would be unexpected.

I sort of view this as a similar issue to how flutter enables internet by default but only at debug mode causing all kinds of confusion.

@grouma
Copy link
Member

grouma commented Jun 5, 2019

LGTM. I don't have strong feelings on this one. We have similar logic in DDR and package:test. This would be consistent with those tools at least.

@natebosch
Copy link
Member Author

hiding the error at development time just means it will show up when they deploy

That argument makes sense.

From another perspective the favicon is something that it's nice to not have to think about, and not make noise in the console, very early in a project lifecycle until you're getting closer to going to production.

@kevmoo
Copy link
Member

kevmoo commented Jun 7, 2019

DBC – wonder if this would be a useful thing to just have in pkg:shelf – pondering...

return (request) async {
var response = await handler(request);
if (response.statusCode == 404 &&
request.url.path.endsWith('favicon.ico')) {
Copy link
Member

Choose a reason for hiding this comment

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

I'd change this to pathSegments.length >= 1 && pathSegments.last == 'favicon.ico' – maybe?

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@jakemac53 jakemac53 left a comment

Choose a reason for hiding this comment

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

Still doesn't feel right to me but 🤷‍♂️

@natebosch
Copy link
Member Author

Still doesn't feel right to me

We can revert at the first sign that someone accidentally ships to production because they thought that this favicon would work for free 😄

@nshahan
Copy link
Contributor

nshahan commented Jun 10, 2019

This does sound like a net positive because I like to have the binary signal of "error in the console or not" when I start building a web project. Seems reasonable to me that since we are using the dart logo as the icon it could almost serve as a reminder that you need to eventually replace it with your own.

@nshahan
Copy link
Contributor

nshahan commented Jun 10, 2019

Which one is using the correct icon colors though? Right now it looks like dart.dev and pub.dev use slightly different icons but the colors on the pub.dev icon match the colors on the page better.

Screen Shot 2019-06-10 at 9 33 55 AM

@natebosch
Copy link
Member Author

I'm not sure which is the current colorscheme, I pulled the one from dart.dev...

@nshahan
Copy link
Contributor

nshahan commented Jun 10, 2019

I just filed: dart-lang/site-www#1673 for consistency.

@natebosch natebosch merged commit bea35d0 into master Jun 10, 2019
@natebosch natebosch deleted the favicon branch June 10, 2019 17:48
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.

Silly: Consider a default favicon.ico if missing/404

6 participants