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

3.0.0 #40

Merged
merged 1 commit into from
Jan 20, 2018
Merged

3.0.0 #40

merged 1 commit into from
Jan 20, 2018

Conversation

jonathantneal
Copy link
Collaborator

This PR refactors postcss-font-family-system-ui to use the postcss-boilerplate plugin boilerplate.

cc @RyanZim

Copy link
Owner

@JLHwung JLHwung left a comment

Choose a reason for hiding this comment

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

Great work!

I strongly recommend to add yaspeller to plugin boilerplate, as postcss also use yaspeller to check document typos.

.appveyor.yml Outdated

environment:
matrix:
- nodejs_version: 4.0
Copy link
Owner

Choose a reason for hiding this comment

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

Shouldn't it be

- nodejs_version: 4
- nodejs_version: 6
- nodejs_version: 8
- nodejs_version: 9

?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Node is backwards compatible. This means Node v0.12 code works in Node v4, v9, etc. Therefore, since the lowest supported version is v4, this is the version that is tested, insuring the others will work as well.

Copy link
Owner

Choose a reason for hiding this comment

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

Node is backwards compatible. This means Node v0.12 code works in Node v4, v9, etc.

The backwards compatibility on node mostly concerns on V8 and Node.js API backwards compatibility. However, every SEMVER-MAJOR of node might introduces breaking changes due to third_party dependencies.

There is an obscure example of breakage on the daily-used \s pattern:

/\s/.test("\u180e")
// returns true on node.js 4.0
// returns false on node.js recent versions

The breakage is due to Unicode 6.3 recategorize U+180E as format control. While node.js 4.0 depends on Unicode earlier than 6.3, later version will depends on later version since the latest ECMAScript always use latest Unicode standard.

Not to detour, given the routine of the plugin is pretty simple and straightforward (we don't depends on Unicode Character Property in our regex), it is acceptable to test against node.js 4 only.

A practical node.js version principle should be testing against the minimum postcss supporting node.js version.

Another question is would nodejs_version: 4.0 be resolved as 4.0.x only on appveyor/travis? We should test against the latest nodejs 4.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree with the practical approach to test against the minimum Node version that postcss is supporting, which is v4. Will this be acceptable?

I have updated .appveyor.yml to match .travis.yml.

- yarn add coveralls
- cat ./coverage/lcov.info | ./node_modules/.bin/coveralls
node_js:
- 4
Copy link
Owner

Choose a reason for hiding this comment

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

same with above.

@@ -1,21 +0,0 @@
{
Copy link
Owner

Choose a reason for hiding this comment

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

Shouldn't yaspeller be added to postcss-plugin-boilerplate?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will add yaspeller

CHANGELOG.md Outdated
@@ -1,3 +1,15 @@
# Changes to postcss-font-family-system-ui

#### 2.1.4 (2018-01-17)
Copy link
Owner

Choose a reason for hiding this comment

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

should be 3.x.x for later manual change.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will fix the CHANGELOG

index.js Outdated
'Oxygen',
'Ubuntu',
'Cantarell',
'Fira Sans',
Copy link
Owner

Choose a reason for hiding this comment

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

I am considering remove Fira Sans as Firefox OS is dead.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is fine. I will remove it from this PR, and add the change to the CHANGELOG

index.js Outdated

// system-ui and fallbacks match
const whitespace = '[\\n\\r\\x09\\x20]';
const systemUiMatch = new RegExp(`(^|,|${whitespace})(?:${whitespace}*system-ui${whitespace}*)(?:,${whitespace}*(?:${systemUiFamily.join('|')})${whitespace}*)?(,|$)`, 'i');
Copy link
Owner

@JLHwung JLHwung Jan 18, 2018

Choose a reason for hiding this comment

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

When system-ui is used as a fallback generic font, the replace phrase will remove the extra whitespace before comma.
Expected:

"Droid Sans", system-ui, foo

Actual

"Droid Sans",system-ui, foo

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will add a test for this and fix it. Thanks!

index.js Outdated
];

// system-ui and fallbacks match
const whitespace = '[\\n\\r\\x09\\x20]';
Copy link
Owner

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I’ll add this

@jonathantneal
Copy link
Collaborator Author

Hi @JLHwung, I have addressed all of the changes you requested and rebased the commit :)

@JLHwung
Copy link
Owner

JLHwung commented Jan 19, 2018

@jonathantneal 🤔 Looks like we need yarn add --dev yaspeller-ci

@jonathantneal
Copy link
Collaborator Author

Well, the odd thing is that it’s already there: 8df7366#diff-b9cfc7f2cdf78a7f4b91a753d10865a2R46

@jonathantneal
Copy link
Collaborator Author

Looks like we’re good to merge? 😄

@JLHwung
Copy link
Owner

JLHwung commented Jan 19, 2018

I am okay with most revision except for a question on nodejs version settings. See https://github.com/JLHwung/postcss-font-family-system-ui/pull/40/files#r162538816

@jonathantneal
Copy link
Collaborator Author

I’ve addressed that and agreed with the practical approach. Let me know if that’ll work for us.

@JLHwung JLHwung merged commit 4864aba into JLHwung:master Jan 20, 2018
@JLHwung
Copy link
Owner

JLHwung commented Jan 20, 2018

3.0.0 is released. 🎉

@jonathantneal jonathantneal deleted the feature/3.0.0 branch January 20, 2018 05:27
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.

2 participants