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

Using Template literals (Template strings) #557

Merged
merged 10 commits into from
Jan 5, 2019
Merged

Using Template literals (Template strings) #557

merged 10 commits into from
Jan 5, 2019

Conversation

stevenjoezhang
Copy link
Contributor

@stevenjoezhang stevenjoezhang commented Dec 31, 2018

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines.
  • Tests for the changes was maked (for bug fixes / features).
    • Muse | Mist have been tested.
    • Pisces | Gemini have been tested.
  • Docs in NexT website have been added / updated (for new features).

PR Type

What kind of change does this PR introduce?

  • Bugfix.
  • Feature.
  • Code style update (formatting, local variables).
  • Refactoring (no functional changes, no api changes).
  • Build related changes.
  • CI related changes.
  • Documentation content changes.
  • Other... Please describe:

What is the current behavior?

Issue Number(s): N/A

What is the new behavior?

Description about this pull, in several words...

  • Screens with this changes: N/A
  • Link to demo site with this changes: N/A

How to use?

In NexT _config.yml:

...

Does this PR introduce a breaking change?

  • Yes.
  • No.

Copy link
Member

@ivan-nginx ivan-nginx left a comment

Choose a reason for hiding this comment

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

Hmm... good. Template literals easiest way to use than interpolaric expressions.

@ivan-nginx ivan-nginx added this to the v6.7.0 milestone Dec 31, 2018
@stevenjoezhang stevenjoezhang changed the title Bug fix in tabs.js & using Template literals (Template strings) Bug fix in scripts/tags/tabs.js & using Template literals (Template strings) Dec 31, 2018
@ivan-nginx
Copy link
Member

ivan-nginx commented Dec 31, 2018

Maybe we push this changes only in v7.x? Because ES2015 needed to compatability with template literals, as I see from docs.


But it seems nodejs v6.x supported template literals: https://node.green/#ES2015-syntax-template-literals.


And NexT v6.x still partially support IE, but Template Literals not supported by IE: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Browser_compatibility


I think need to push it to v7.x from tomorrow. What you think? And separated bugfix can be pushed to v6.x also.

P.S. That's why need to split pull request via stash / pop git features. It's better to do 2 pulls / 2 pushes / 2 branches, than 1 big mixed pull.

@ivan-nginx ivan-nginx removed this from the v6.7.0 milestone Dec 31, 2018
Copy link
Member

@ivan-nginx ivan-nginx left a comment

Choose a reason for hiding this comment

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

Can you to separate bugfix from this pull and make additional pull with bugfix only for push it in v6.x and v7.x in future?

@stevenjoezhang
Copy link
Contributor Author

Sure, I'll make another pull request

@stevenjoezhang stevenjoezhang changed the title Bug fix in scripts/tags/tabs.js & using Template literals (Template strings) Using Template literals (Template strings) Dec 31, 2018
@theme-next theme-next deleted a comment Dec 31, 2018
@theme-next theme-next deleted a comment Dec 31, 2018
@theme-next theme-next deleted a comment Dec 31, 2018
@theme-next theme-next deleted a comment Dec 31, 2018
@theme-next theme-next deleted a comment Dec 31, 2018
@theme-next theme-next deleted a comment Dec 31, 2018
@theme-next theme-next deleted a comment Dec 31, 2018
@theme-next theme-next deleted a comment Dec 31, 2018
Copy link
Member

@ivan-nginx ivan-nginx left a comment

Choose a reason for hiding this comment

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

When will v7 branch.

@stevenjoezhang
Copy link
Contributor Author

What to do now?

@ivan-nginx
Copy link
Member

ivan-nginx commented Jan 2, 2019

Now need to create a plan for:

  1. Master branch – all changes.
  2. v6.x branch – only fixes / optimizations.
  3. v7.x branch – fixes / optiomizations / features.

Need to create new issue with suggests on it.

@stevenjoezhang stevenjoezhang mentioned this pull request Jan 3, 2019
15 tasks
@ivan-nginx ivan-nginx mentioned this pull request Jan 5, 2019
@ivan-nginx
Copy link
Member

If all done here, «Squash and merge».

@ivan-nginx ivan-nginx added this to the v7.0.0 milestone Jan 5, 2019
@stevenjoezhang
Copy link
Contributor Author

Done

@stevenjoezhang stevenjoezhang merged commit 06ee5ad into theme-next:master Jan 5, 2019
@maple3142
Copy link
Contributor

@stevenjoezhang Is there any reason to use template literals in client side script without babel?
Wouldn't it break old browser without es6?

@ivan-nginx
Copy link
Member

@stevenjoezhang
Copy link
Contributor Author

stevenjoezhang commented Jan 6, 2019

@maple3142 I don't think it's a problem. ES6 was released about 4 years ago, it's supported by most browsers.
2019-01-05 2 22 56
The only exception is IE, and bloggers can use v6.x if really want to support it.
For older browsers like IE8 or safari on iOS4, this update won't break them, because they have already been broken by HTML5 and CSS3.
What's your opinion? Is babel or some other solutions needed?

@maple3142
Copy link
Contributor

maple3142 commented Jan 6, 2019

The problem is uglify-js only support es5, which will cause my blog unable to minify javascripts in the future.
So I think use es6 without babel in production is too early.
Introducing babel to NexT might be another backward compatible choice.

@ivan-nginx
Copy link
Member

uglify-js used in hexo-filter-optimize?

@stevenjoezhang
Copy link
Contributor Author

stevenjoezhang commented Jan 6, 2019

@maple3142
Copy link
Contributor

@ivan-nginx I don't use it, because I use my own build script instead.

@stevenjoezhang I know that es6-aware minifiers does exist, but why do NexT need to use template literals?
In my opinion, I think that both using pure es5 and es6+babel is good.

@ivan-nginx
Copy link
Member

So, mb cleant-side scripts don't need literals?

@ivan-nginx
Copy link
Member

@maple3142 reverted via #590.

@ivan-nginx ivan-nginx mentioned this pull request Jul 17, 2019
33 tasks
tongluyang pushed a commit to tongluyang/hexo-theme-next that referenced this pull request Nov 19, 2019
* Format code

* Update lean-analytics.swig

* Update note.js
tongluyang pushed a commit to tongluyang/hexo-theme-next that referenced this pull request Nov 19, 2019
@stevenjoezhang
Copy link
Contributor Author

Revert reverted via #1023.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants