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

Themes: ES6ify all the things #5315

Merged
merged 9 commits into from
May 12, 2016
Merged

Themes: ES6ify all the things #5315

merged 9 commits into from
May 12, 2016

Conversation

ockham
Copy link
Contributor

@ockham ockham commented May 10, 2016

This ES6ifies most if not all of my-sites/themes, and then some. Main objective is more granular imports of helpers (no more this references), and generally better ease-of-use (e.g. to also replace signup and customize actions by their get...Url() counterparts further down the road, cf #5284).

This is a change that touches a lot of files, so be sure to give it a thorough testing (try different flows in the theme showcase, be sure to cover all possible actions; use e2e tests!)

@ockham ockham self-assigned this May 10, 2016
@ockham ockham added [Feature Group] Appearance & Themes Features related to the appearance of sites. [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels May 10, 2016
@ockham ockham force-pushed the update/themes-es6ify branch from 733eff5 to ca472ca Compare May 10, 2016 12:59
const oldShowcaseUrl = '//wordpress.com/themes/';

export function getSignupUrl( theme ) {
let url = '/start/with-theme?ref=calypshowcase&theme=' + theme.id;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's a nice opportunity to apply templates literals

let url = `/start/with-theme?ref=calypshowcase&theme${ theme.id }`;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TBH, I'd like to stick with simple concatenation here, since it's only two strings (plus, concatenation is more efficient than template strings ;-) )

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@seear
Copy link
Contributor

seear commented May 12, 2016

helpers.js is tough to review here. Any changes in that module other than removing the class and this refs?

@ockham
Copy link
Contributor Author

ockham commented May 12, 2016

helpers.js is tough to review here. Any changes in that module other than removing the class and this refs?

No, that's pretty much it. Plus the usual ES6 stuff (require -> import etc). But I think it's best covered by testing the showcase.

@ockham ockham force-pushed the update/themes-es6ify branch from feca13d to ba9546e Compare May 12, 2016 14:16
@ockham
Copy link
Contributor Author

ockham commented May 12, 2016

Rebased on master.

@seear
Copy link
Contributor

seear commented May 12, 2016

I don't see anything suspicious here. Seems fine with brief testing. 🚢

@ockham ockham force-pushed the update/themes-es6ify branch from ba9546e to 0479147 Compare May 12, 2016 16:14
@ockham ockham merged commit 37365af into master May 12, 2016
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label May 12, 2016
@ockham ockham deleted the update/themes-es6ify branch May 12, 2016 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature Group] Appearance & Themes Features related to the appearance of sites. [Type] Janitorial
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants