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

refactor(external_link): migrate config during load_config #4414

Merged
merged 1 commit into from Jul 20, 2020

Conversation

SukkaW
Copy link
Member

@SukkaW SukkaW commented Jul 11, 2020

What does it do?

Instead of migrating old boolean format config into object format every time the filter is executed, run the config migration during load_config.

How to test

git clone -b config-external-link-process https://github.com/sukkaw/hexo.git
cd hexo
npm install
npm test

Screenshots

Pull request tasks

  • Add test cases for the changes.
  • Passed the CI test.

@SukkaW SukkaW requested review from curbengh and a team July 11, 2020 06:04
@coveralls
Copy link

coveralls commented Jul 11, 2020

Coverage Status

Coverage decreased (-0.002%) to 98.236% when pulling 10d8388 on SukkaW:config-external-link-process into 97cb698 on hexojs:master.

stevenjoezhang
stevenjoezhang previously approved these changes Jul 12, 2020
lib/hexo/load_config.js Outdated Show resolved Hide resolved
lib/hexo/load_config.js Outdated Show resolved Hide resolved
@SukkaW SukkaW force-pushed the config-external-link-process branch from a4bbd82 to f9b375e Compare July 17, 2020 05:28
@SukkaW SukkaW requested a review from curbengh July 17, 2020 05:28
lib/hexo/load_config.js Outdated Show resolved Hide resolved
lib/plugins/filter/after_post_render/external_link.js Outdated Show resolved Hide resolved
lib/plugins/filter/after_post_render/external_link.js Outdated Show resolved Hide resolved
@SukkaW SukkaW force-pushed the config-external-link-process branch from fbed7ed to 10d8388 Compare July 19, 2020 06:22
Copy link
Contributor

@curbengh curbengh left a comment

Choose a reason for hiding this comment

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

This is a minor breaking change since config.external_link is modified. It was already a breaking change in #3675, and later attempted to retain original config.external_link #4134.

However, most probably users won't notice the difference, other than seeing the deprecation message; this only breaks if user has a script or theme that checks truthy value, i.e. if (config.external_link), it's now always truthy.

@SukkaW SukkaW merged commit 850ffbc into hexojs:master Jul 20, 2020
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.

None yet

5 participants