Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add favicon support #9

Closed
Martinsos opened this issue Mar 11, 2020 · 2 comments · Fixed by #1229
Closed

Add favicon support #9

Martinsos opened this issue Mar 11, 2020 · 2 comments · Fixed by #1229
Labels
enhancement New feature or request haskell hm Requires more thought

Comments

@Martinsos
Copy link
Member

Martinsos commented Mar 11, 2020

We want Wasp to have support for adding a favicon. This should be property of app declaration:

app MyApp {
  title: "My super app!",
  favicon: "@ext/favicon.ico"

Should favicon really go into ext/ or not (and go somewhere next to .wasp), is debatable. Also, what are the requirements on favicon? Does it have to have certain dimensions? What about specifying different favicon of different qualities, as can be normal for some cases? What about some additional properties?

It feels like this should be researched more -> understanding the essence of favicon, and then we can go from there.

@Martinsos Martinsos added the enhancement New feature or request label Mar 11, 2020
@Martinsos Martinsos added the good first issue Good for newcomers label Sep 24, 2020
@Martinsos Martinsos added hm Requires more thought and removed good first issue Good for newcomers labels Oct 20, 2020
@Martinsos
Copy link
Member Author

@matijaSos added support for custom code in the <head> -> maybe this takes care of favicon, to some degree?

@shayneczyzewski
Copy link
Contributor

shayneczyzewski commented Nov 14, 2022

Ok, so this turned out to be slightly more complex than originally described. :D A few notes on the complications and next steps based on a quick chat with @matijaSos and @sodic:

  • We can't really just list a single file, as there can be many different favicon files for different sizes and targets. And while they are often named sanely, it may be limiting to enforce a specific pattern for them.
  • Users also need to be able to update the manifest.json file as well. So is that another field? Or inferred? Etc.
  • The idea I proposed instead is to add support for a public/ dir, and we copy/merge the contents of that user dir with our defaults (including using our index.html file). In this way, they can add many different favicons with any names, customize the manifest, and add any other static images (right now we only support relative imports in React components, which is not ideal).
  • As for where this new directory, and other things like tailwind.config.js/Dockerfile should live- we may want to review our project structure again. I will create a new issue for this task, but the short overview is: should we go from src/client etc. to client/src so then we could put configs under the appropriate area, and then keep public at that top level?
    • Aside: the answer to this impacts how we copy over ExternalCode.Files.

TL;DR All of this requires a bit more thought and design (and time to implement), so it will be left for after Beta so we don't rush any idea. The only pre-Beta task will be changing the default stick to our actual logo. I will make a PR for that shortly.

EDIT: Here is the PR for favicon update (#815) and the new issue for directory structure thinking (#816).

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request haskell hm Requires more thought
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants