Skip to content

Deprecate theme attribute in site config JSON#2235

Merged
itsyme merged 6 commits intoMarkBind:masterfrom
itsyme:deprecate-theme
Mar 28, 2023
Merged

Deprecate theme attribute in site config JSON#2235
itsyme merged 6 commits intoMarkBind:masterfrom
itsyme:deprecate-theme

Conversation

@itsyme
Copy link
Contributor

@itsyme itsyme commented Mar 25, 2023

What is the purpose of this pull request?

  • Documentation update
  • Bug fix
  • Feature addition or enhancement
  • Code maintenance
  • DevOps
  • Improve developer experience
  • Others, please explain:

Overview of changes:
Resolves #2232. Fully deprecates theme attribute in site config JSON.

theme attribute in site config JSON has been fully deprecated.

To migrate:
Use "style": {"bootstrapTheme": "..."} instead of "theme": "...".

For example,
Original (in site.json):

{
"theme": "bootswatch-cerulean"
}

Updated (in site.json):

{
  "style": {
    "bootstrapTheme": "bootswatch-cerulean"
  }
}

Anything you'd like to highlight/discuss:

Testing instructions:

Proposed commit message: (wrap lines at 72 characters)
Deprecate theme attribute in site config JSON

Theme attribute in site config JSON is supported, though not
documented.

This could be confusing for users when trying to search for the
theme attribute in documentation or when referring to older
MarkBind sites which still use the theme attribute.

Let's deprecate the theme attribute in site config JSON fully so that
all MarkBind sites use style.bootstrapTheme, which is documented.

This prevents confusion for users by standardising the use of
style.bootstrapTheme to set the bootstrap theme.


Checklist: ☑️

  • Updated the documentation for feature additions and enhancements
  • Added tests for bug fixes or features
  • Linked all related issues
  • No unrelated changes

Copy link
Contributor

@yucheng11122017 yucheng11122017 left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you @itsyme

@itsyme itsyme changed the title Deprecate theme attribute in site config JSON Deprecate theme attribute in site config JSON Mar 26, 2023
@lhw-1
Copy link
Contributor

lhw-1 commented Mar 26, 2023

Thanks for the PR @itsyme! LGTM 👍

Are there no tests that need to be updated for this?

@itsyme
Copy link
Contributor Author

itsyme commented Mar 26, 2023

Thanks for the PR @itsyme! LGTM 👍

Are there no tests that need to be updated for this?

I was worried about that as well, but I searched through all instances of theme, style.bootstrapTheme and looked through the Site.test.js but found nothing relevant to any tests to be deprecated.

Though I found something else in packages/core/src/Site/index.js but am not sure if we want to deprecate it this way or change the variable name to bootstrapTheme instead.

*/
copyBootstrapTheme(isRebuild) {
const { theme } = this.siteConfig;
const theme = this.siteConfig.style.bootstrapTheme;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wondering if we should rename the theme to bootstrapTheme?

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 we should rename it. Makes more sense since the function is called copyBootstrapTheme.

Copy link
Contributor

@raysonkoh raysonkoh left a comment

Choose a reason for hiding this comment

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

LGTM other than the minor naming issue.

@jovyntls jovyntls added the breakingChange 💥 Feature will behave significantly different, or is made obsolete label Mar 28, 2023
Copy link
Contributor

@jovyntls jovyntls left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the quick fix @itsyme

Could you update the commit message before merging? Reasoning being that this is a breaking change, so we may want more context in the commit message for future reference.

@jovyntls jovyntls added this to the v5.0.0 milestone Mar 28, 2023
@itsyme itsyme merged commit 62f67aa into MarkBind:master Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breakingChange 💥 Feature will behave significantly different, or is made obsolete

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fully deprecate theme attribute in site config JSON

5 participants