-
Notifications
You must be signed in to change notification settings - Fork 152
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
5.1 updates #20
5.1 updates #20
Conversation
mlwilkerson
commented
Mar 23, 2018
•
edited
Loading
edited
- Add FaLayersCounterComponent to use the new counter() API
- Remove counter support from FaLayersTextComponent
- Update all package dependencies and names for FA 5.1
- Add title support to FaLayersTextComponent
- Make title optional for FaIconComponent
- Add title to an icon in the demo app to exercise this case
- Fix the remaining CSS problems with the counter (see more below)
- Add upgrading guidelines documentation (UPGRADING.md) @robmadole
- Add some of the common docs from here to README.md @robmadole
- make cssClass formats consistent for all components (add ng- to FaLayersComponent)
- refactor FaLayersText and FaLayersCounter
- Add FaLayersCounterComponent to use the new counter() API - Remove counter support from FaLayersTextComponent - Update all package dependencies and names for FA 5.1
- Make title optional for FaIconComponent - Add title to an icon in the demo app to exercise this case
@ZeevKatz Could you have a look at this? I'm basically just building off of your structure to add the counter component. (I can't seem to invite you to a code review for some reason, but maybe you can jump in here anyway). There are a few questions that came up for me while I was doing this, since it got me to interacting more closely with your work on PR #14.
I left it for now, but it wasn't clear what purpose it serves. I see that it's binding a class name to the angular host component, but not sure what that might be for, when it's essentially duplicating the class name on the
|
@mlwilkerson Looks great! Now, About the |
Thanks for having a look, @ZeevKatz.
Could you say that another way?
Thanks again. |
package.json
Outdated
@@ -95,7 +95,7 @@ | |||
"@angular/core": "^5.0.0", | |||
"@angular/platform-browser": "^5.0.0", | |||
"@angular/platform-browser-dynamic": "^5.0.0", | |||
"@fortawesome/fontawesome": "^1.1.4", | |||
"@fortawesome/fontawesome-svg-core": "^1.2.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just experienced this when trying to pull directly from this branch, but the version matcher here won't work since the hyphenation in the specific npm package version makes it non-semver. The react 5.1 branch seems to have it correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for having a look at this @mauricew.
I'm not sure I follow as to your expectation and what you mean that this makes it "non-semver". Could you elaborate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To match a range it seems to require a strict semver, x.y.z
and nothing else at the end. The version currently on npm is 1.2.0-7 but trying to match it with ^1.2.0
or ~1.2.0
won't work. (using npm 5.6)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see. I just pushed a change for that, adding the prerelease numbers to the version strings.
I've actually been intentionally leaving those off, so as not to update them every time we version these pre-releases. yarn
is what I normally use, and it by default—when it sees that there's not a 1.2.0
with the latest
tag, prompts me to select a version. So I quickly pick the latest prerelease without thinking about it. And my reasoning is that—once we do publish the real 1.2.0
tagged as latest
, it won't require an update of its version in package.json
. So it is semantically versioned, at least in some sense: the meaning is "install the latest compatible version with the latest
tag, or if there isn't one, give me a chance to pick a prerelease." But I didn't realize npm
wasn't giving the same choose-your-own-prerelease-adventure option—when I tried it, it just choked.
So, sorry, and I'll plan to stick with the explicit prerelease version numbers for now, in the interest of the npm
users.
(Though, surely there must be a flag for npm to make it work like yarn
in this regard, isn't there?)
@mlwilkerson check my comment again |
@ZeevKatz got it. thanks. |
@mlwilkerson the counter up in the top corner of the demo is coming from our "When using text layer outside layers component". Even though it warns of that it still renders the counter. I think this is expected behavior. We aren't stopping the rendering just warning about it. |
## Installation | ||
|
||
``` | ||
$ yarn add @fortawesome/fontawesome-svg-core |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be a good idea to eliminate this step to simplify installation. This package is also included in the dependencies
of the @fortawesome/angular-fontawesome
package, so users may end up with two copies of it if versions don't match.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, this needs to be peer dependency. Let me double-check that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch @devoto13, that would cause big trouble for anyone who tries to use the library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would actually expect this to be a normal dependency, so it's less packages for users to install. Do you think it is a common use case to have more than one package depending on @fortawesome/fontawesome-svg-core
or why do you want to have it as peer dependency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need it to be a peer dependency because of the library. If multiple copies of fontawesome-svg-core
exist in node_modules
you could end up calling library.add()
on a completely separate instance of the library. Then when, for example, the angular-fontawesome component goes to look up icons it's working off of a different instance of the library.
We saw this early on with each of our other components. Directory looks a bit like this:
- node_modules
- @fortawesome
- fontawesome-svg-core # used if you import { library } in your app
- angular-fontawesome
- node_modules
- @fortawesome
fontawesome-svg-core # used by angular-fontawesome when that component uses icon()
Maybe there is a better way to solve this. Some other way to have a Singleton that even multiple installed versions of FA can use. But peer dependencies solved it rather nicely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what you're talking about. Because users need to import from fontawesome-svg-core
directly to access the icons library. I agree it makes sense to have it this way for now.
README.md
Outdated
|
||
The library provides convenient usage in your templates but you have to manage | ||
the icons separate from your components. This means that if someone | ||
accidentally removes the icon your component needs your component could break. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
your component needs your component could break.
-> your component which uses it could break.
or something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On it.
README.md
Outdated
``` | ||
<fa-icon [icon]="faSync" [spin]="isSyncAnimated" (click)="isSyncAnimated=!isSyncAnimated"></fa-icon> | ||
|
||
You can also import entire styles (but be careful!). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe clarify why - it will significantly increase bundle size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add some elaboration on that while I'm already editing this thing.
README.md
Outdated
### Explicit reference | ||
|
||
Not as convenient as using the library but if you believe "explicit is better than | ||
implicit" then this method if for you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fixing the "if" vs. "is" typo here.
README.md
Outdated
``` | ||
<fa-icon [icon]="faCircle" transform="shrink-9 right-4" [mask]="faSquare"></fa-icon> | ||
|
||
### Using the Font Awesome Library |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was confused when I started reading this section. I initially thought that by "Font Awesome Library" you meant the API library, as in fontawesome-svg-core
. I re-read the first part about templates 3 times before I realized you were talking about the library.add()
library. I wonder if that's going to trip up anyone else? I guess, without thinking really thinking about it, I've started calling fontawesome-svg-core
the "base" or "API" library. And the library.add()
thing the "icon library". And I suppose a newbie might also wonder if free-solid-svg-icons
isn't a library, but I normally call that an "icon package" or "icon pack".
So I'm calling this out as something I've been taking for granted now made strange, forcing me to maybe see it through a newcomer's eyes.
For the moment, I'm going to push a commit that changes this to "Icon Library". But I'll grant that this its debatable what stuff should be named. So, pushback or whatever.
icons bigger, rather than using font-size.
- Now that the counter() API is being used and we don't have conflicting CSS classes. - We still have a problem with the height / line-height layout of the counter.
There's just this one little nuisance remaining about the CSS on the counter, something about the relationship between the The goal here is to not rely on the the CSS tweak that @ZeevKatz needed to add to make it look right. My CSS powers have been exhausted trying to understand why it is that the default framework CSS styles for It would be nice to figure that out and remove that one last remain CSS tweak in here. But if we can't figure it out, I guess it doesn't need to block a release. |
@mlwilkerson looking at the counter thing again now |
Ok @mlwilkerson got the counters fixed with https://github.com/FortAwesome/fontawesome-buildsystem/pull/267 |
- Remove remain CSS fix for counters, given that the CSS has been fixed in fontawesome-svg-core.