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

Upgrade FontAwesome to 5.3.1 #2186

Merged
merged 5 commits into from Sep 18, 2018
Merged

Upgrade FontAwesome to 5.3.1 #2186

merged 5 commits into from Sep 18, 2018

Conversation

alandipert
Copy link
Contributor

@alandipert alandipert commented Sep 17, 2018

  • This upgrades FontAwesome to a new major (by itself, breaking) version, but
    is backwards compatible because we include the v4-shims CSS that maps
    old names to new.
  • icon tags are now browsable
  • This is a step toward full V5 adoption that doesn't require us to
    come up with a plan for deprecating V4 icon names.

(Related: #2156 and #1966)

Confirmed that the FontAwesome CSS and webfont licenses didn't change between 4 and 5, added CC license for .svgs we now also include.

R/bootstrap.R Outdated
htmlDependencies(iconTag) <- htmlDependency(
"font-awesome", "4.7.0", c(href="shared/font-awesome"),
stylesheet = "css/font-awesome.min.css"
if (lib %in% c("font-awesome", "fontawesome")) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm I'm not sure about this. Perhaps we should do this:

  • If it's font-awesome, load the shim
  • If it's fontawesome, don't load the shim

Then in subsequent versions of Shiny that ship V5 w/out the shim, specifying font-awesome is an error and fontawesome is the new deault lib

Copy link
Member

Choose a reason for hiding this comment

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

What was the reason for adding fontawesome as a valid option in the first place?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A half-baked scheme for supporting 4 and 5 in a subsequent release, but there's no reason to do it now. Removed and simplified.

R/bootstrap.R Outdated
htmlDependency(
"fontawesome-v4-shims", "5.3.1", c(href="shared/fontawesome"),
stylesheet = "css/v4-shims.min.css"
)
Copy link
Member

Choose a reason for hiding this comment

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

I think it should be a single htmlDependency named font-awesome, with both stylesheets included. This isn't aesthetic, it matters for dependency resolution that happens when the page is rendered; if the dependency name is different, the page could load both 4.7.0 and 5.3.1, and whichever one is loaded last would win (to the degree that there are collisions, that is).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense. I did it 👍

@eawachtel
Copy link

I'm really confused on what the current status of fontawesome in shiny is? I'm using shiny v 1.0.5 and have download the fontawesome 4.7 and placed in www/shared. I can not get most icons to work. I see the svg files for the icons I want, but they do not work. Any help appreciated

@jcheng5
Copy link
Member

jcheng5 commented Sep 18, 2018

@eawachtel Please file a separate issue if you're having trouble with icons in 4.7.0. It'd be great if you could include a minimal reproducible example. Thanks!

@eawachtel
Copy link

eawachtel commented Sep 18, 2018 via email

- Upgrades FontAwesome to a new major (breaking) version, but
  is backwards compatible because we include the v4-shims CSS that maps
  old names to new.
- This is a step toward full V5 adoption that doesn't require us to
  come up with a plan for deprecating V4 icon names.
- Details: https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4
- Related to #2156 and #1966
@alandipert
Copy link
Contributor Author

@eawachtel I think gas-pump doesn't work because it was added in FontAwesome 5, and the currently-released version of Shiny only has FontAwesome 4.7. Once this PR is merged and we've released Shiny 1.2, gas-pump will work.

@jcheng5
Copy link
Member

jcheng5 commented Sep 18, 2018

@alandipert Are we missing "CC BY 4.0 License" in the LICENSE file? It looks like it applies to the SVG data, which we appear to be bundling.

- Clarify in docs that fontawesome V5 icons accessible with V4-style names
- Make icons browseable: icon('address-book') will now open the Viewer
  pane of RStudio IDE so that icons can be experimented with more easily.
@jcheng5 jcheng5 added this to the 1.2 milestone Sep 18, 2018
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.

None yet

3 participants