Directory

Theme.json Documentation - Added new FAQ on disabling caching of theme.json by schutzsmith · Pull Request #42346 · WordPress/gutenberg · GitHub
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

Theme.json Documentation - Added new FAQ on disabling caching of theme.json #42346

Merged
merged 1 commit into from
Jul 12, 2022

Conversation

schutzsmith
Copy link
Contributor

@schutzsmith schutzsmith commented Jul 12, 2022

What?

One of the issues that many devs face when working with theme.json for the first time is waiting for the browser to show their changes. Unfortunately it takes 30+ seconds if you do not have WP_DEBUG or SCRIPT_DEBUG set to true to bypass caching theme.json.

Why?

This documentation is to help other developers learning for the first time. Will provide a better developer experience.

How?

Explains what they need to do to bypass caching of theme.json

Testing Instructions

Screenshots or screencast

I posed this question to twitter and the community has provided a terrific answer that deserves to be included here for future developers to also utilize and hopefully avoid any initial frustrations in the developer experience.

Original Tweet: https://twitter.com/schutzsmith/status/1544365317731880963?s=21&t=nCyZ2sva06NMv_8khBOgdw

Answer 1: https://twitter.com/cometmarie/status/1544411492010835970

Answer 2: https://twitter.com/fklux/status/1545297824794959872

One of the issues that many devs face when working with theme.json for the first time is waiting for the browser to show their changes. 

I posed this question to twitter and the community has provided a terrific answer that deserves to be included here for future developers to also utilize and hopefully avoid any initial frustrations in the developer experience.

Original Tweet: https://twitter.com/schutzsmith/status/1544365317731880963?s=21&t=nCyZ2sva06NMv_8khBOgdw

Answer 1: https://twitter.com/cometmarie/status/1544411492010835970

Answer 2: https://twitter.com/fklux/status/1545297824794959872
@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Jul 12, 2022
@github-actions
Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @schutzsmith! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

Copy link
Member

@fabiankaegy fabiankaegy 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 super helpful information :) Thanks for adding this section!

@fabiankaegy
Copy link
Member

fabiankaegy commented Jul 12, 2022

For anyone interested here is the actual code where it determines whether to cache the results or not: https://github.com/WordPress/wordpress-develop/blob/9b105d92a4b769f396ba798db1f106abab75001f/src/wp-includes/global-styles-and-settings.php#L91-L97

@fabiankaegy fabiankaegy added the [Type] Developer Documentation Documentation for developers label Jul 12, 2022
@fabiankaegy fabiankaegy merged commit 43abc6e into WordPress:trunk Jul 12, 2022
@github-actions
Copy link

Congratulations on your first merged pull request, @schutzsmith! We'd like to credit you for your contribution in the post announcing the next WordPress release, but we can't find a WordPress.org profile associated with your GitHub account. When you have a moment, visit the following URL and click "link your GitHub account" under "GitHub Username" to link your accounts:

https://profiles.wordpress.org/me/profile/edit/

And if you don't have a WordPress.org account, you can create one on this page:

https://login.wordpress.org/register

Kudos!

@github-actions github-actions bot added this to the Gutenberg 13.7 milestone Jul 12, 2022
@carolinan
Copy link
Contributor

carolinan commented Jul 13, 2022

Thank you, I copied the information to the theme developer handbook in case someone uses that as their entry point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants