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

Load the twenty twenty one theme by default in Gutenberg's wp-env config #26414

Merged
merged 2 commits into from
Oct 26, 2020

Conversation

youknowriad
Copy link
Contributor

To help us work and test Full site editing, this PR loads the 2021 blocks theme in Gutenberg's default wp-env.

@youknowriad youknowriad added [Type] Build Tooling Issues or PRs related to build tooling [Feature] Full Site Editing labels Oct 23, 2020
@youknowriad youknowriad self-assigned this Oct 23, 2020
.wp-env.json Outdated Show resolved Hide resolved
@github-actions
Copy link

Size Change: 0 B

Total Size: 1.2 MB

ℹ️ View Unchanged
Filename Size Change
build/a11y/index.js 1.14 kB 0 B
build/annotations/index.js 3.54 kB 0 B
build/api-fetch/index.js 3.35 kB 0 B
build/autop/index.js 2.72 kB 0 B
build/blob/index.js 668 B 0 B
build/block-directory/index.js 8.59 kB 0 B
build/block-directory/style-rtl.css 943 B 0 B
build/block-directory/style.css 942 B 0 B
build/block-editor/index.js 130 kB 0 B
build/block-editor/style-rtl.css 11 kB 0 B
build/block-editor/style.css 11 kB 0 B
build/block-library/editor-rtl.css 8.93 kB 0 B
build/block-library/editor.css 8.93 kB 0 B
build/block-library/index.js 145 kB 0 B
build/block-library/style-rtl.css 7.75 kB 0 B
build/block-library/style.css 7.75 kB 0 B
build/block-library/theme-rtl.css 741 B 0 B
build/block-library/theme.css 741 B 0 B
build/block-serialization-default-parser/index.js 1.77 kB 0 B
build/block-serialization-spec-parser/index.js 3.1 kB 0 B
build/blocks/index.js 47.6 kB 0 B
build/components/index.js 170 kB 0 B
build/components/style-rtl.css 15.4 kB 0 B
build/components/style.css 15.4 kB 0 B
build/compose/index.js 9.63 kB 0 B
build/core-data/index.js 12.1 kB 0 B
build/data-controls/index.js 684 B 0 B
build/data/index.js 8.63 kB 0 B
build/date/index.js 31.9 kB 0 B
build/deprecated/index.js 772 B 0 B
build/dom-ready/index.js 569 B 0 B
build/dom/index.js 4.43 kB 0 B
build/edit-navigation/index.js 10.8 kB 0 B
build/edit-navigation/style-rtl.css 881 B 0 B
build/edit-navigation/style.css 885 B 0 B
build/edit-post/index.js 306 kB 0 B
build/edit-post/style-rtl.css 6.37 kB 0 B
build/edit-post/style.css 6.35 kB 0 B
build/edit-site/index.js 21.7 kB 0 B
build/edit-site/style-rtl.css 3.79 kB 0 B
build/edit-site/style.css 3.79 kB 0 B
build/edit-widgets/index.js 26.6 kB 0 B
build/edit-widgets/style-rtl.css 3.09 kB 0 B
build/edit-widgets/style.css 3.09 kB 0 B
build/editor/editor-styles-rtl.css 480 B 0 B
build/editor/editor-styles.css 482 B 0 B
build/editor/index.js 42.6 kB 0 B
build/editor/style-rtl.css 3.85 kB 0 B
build/editor/style.css 3.84 kB 0 B
build/element/index.js 4.45 kB 0 B
build/escape-html/index.js 733 B 0 B
build/format-library/index.js 7.49 kB 0 B
build/format-library/style-rtl.css 547 B 0 B
build/format-library/style.css 548 B 0 B
build/hooks/index.js 1.74 kB 0 B
build/html-entities/index.js 622 B 0 B
build/i18n/index.js 3.54 kB 0 B
build/is-shallow-equal/index.js 709 B 0 B
build/keyboard-shortcuts/index.js 2.39 kB 0 B
build/keycodes/index.js 1.85 kB 0 B
build/list-reusable-blocks/index.js 3.02 kB 0 B
build/list-reusable-blocks/style-rtl.css 476 B 0 B
build/list-reusable-blocks/style.css 476 B 0 B
build/media-utils/index.js 5.12 kB 0 B
build/notices/index.js 1.69 kB 0 B
build/nux/index.js 3.27 kB 0 B
build/nux/style-rtl.css 671 B 0 B
build/nux/style.css 668 B 0 B
build/plugins/index.js 2.45 kB 0 B
build/primitives/index.js 1.35 kB 0 B
build/priority-queue/index.js 789 B 0 B
build/redux-routine/index.js 2.85 kB 0 B
build/reusable-blocks/index.js 3.06 kB 0 B
build/rich-text/index.js 13 kB 0 B
build/server-side-render/index.js 2.61 kB 0 B
build/shortcode/index.js 1.7 kB 0 B
build/token-list/index.js 1.24 kB 0 B
build/url/index.js 4.06 kB 0 B
build/viewport/index.js 1.75 kB 0 B
build/warning/index.js 1.13 kB 0 B
build/wordcount/index.js 1.23 kB 0 B

compressed-size-action

@youknowriad youknowriad force-pushed the add/2021-blocks-theme-to-env branch from dbcd0c8 to 5af4918 Compare October 26, 2020 09:29
@youknowriad youknowriad merged commit 5f4f4f4 into master Oct 26, 2020
@youknowriad youknowriad deleted the add/2021-blocks-theme-to-env branch October 26, 2020 10:43
@github-actions github-actions bot added this to the Gutenberg 9.3 milestone Oct 26, 2020
@Copons
Copy link
Contributor

Copons commented Nov 5, 2020

🤔 This isn't working for me locally.

Whenever I start wp-env (installed globally and fully updated), it fails with this error:

✖ could not find repository from '/Users/**********/.wp-env/d3848c158ff09da2cc146ac0439f18f4/theme-experiments/twentytwentyone-blocks'
[Error: could not find repository from '/Users/**********/.wp-env/d3848c158ff09da2cc146ac0439f18f4/theme-experiments/twentytwentyone-blocks'] {
  errno: -3,
  errorFunction: 'Repository.open'
}

I normally override the themes with "themes": [ "WordPress/theme-experiments" ] to have them all, but I've been debugging an e2e issue failing at:
await activateTheme( 'twentytwentyone-blocks' );
because all theme experiments are loaded with slug such as theme-experiments/twentytwentyone-blocks instead...

@youknowriad
Copy link
Contributor Author

@Copons if you override the default config, there's a change the e2e tests won't work for you. that's to be expected since these themes will end up in sub folders.

Do you have issues with the default config without overriding?

@Copons
Copy link
Contributor

Copons commented Nov 5, 2020

@youknowriad Yup, sorry I wrote a very confusing comment.

I've tried running wp-env without theme overrides (in order to work on some e2e tests), and it fails with that error.

(The rest of the comment was to report that overriding "themes": [ "WordPress/theme-experiments" ] seems to work for me — although, yes, it has other issues when running e2e tests.)

@youknowriad
Copy link
Contributor Author

I've tried running wp-env without theme overrides (in order to work on some e2e tests), and it fails with that error.

That's because of some cache in wp-env, try removing ~/.wp-env folder and restart, it should work properly IMO.

@Copons
Copy link
Contributor

Copons commented Nov 5, 2020

@youknowriad nope, still nothing 😞

@youknowriad
Copy link
Contributor Author

I had the same issue personally, and the cache was the reason for me because wp-env don't recreate it if the config changes (override removed). When I said "restart", I meant "destroy all your containers and restart :P"

@Copons
Copy link
Contributor

Copons commented Nov 5, 2020

I had the same issue personally, and the cache was the reason for me because wp-env don't recreate it if the config changes (override removed). When I said "restart", I meant "destroy all your containers and restart :P"

Yeah I've tried deleting .wp-env, the wordpress folder inside Gutenberg, all Docker images (plus restarting Docker itself)...
I wonder if there are other things I could delete 😅

@noahtallen
Copy link
Member

the cache was the reason for me because wp-env don't recreate it if the config changes (override removed).

That's weird, the intention is that when the config changes, then the cache would be updated and it would reconfigure everything 🤔 Do you think this points to a bug in wp-env or maybe I misunderstand?

@youknowriad
Copy link
Contributor Author

Do you think this points to a bug in wp-env or maybe I misunderstand?

Yes, definitely :)

const shouldConfigureWp =
		update ||
		( await didCacheChange( CONFIG_CACHE_KEY, configHash, {
			workDirectoryPath,
		} ) );

See if it's an "update", the shouldConfigureWp doesn't take the cache key into consideration :)

@Copons
Copy link
Contributor

Copons commented Nov 6, 2020

I've figured out where it breaks, but not how to fix it (I'm very unfamiliar with all of this).

"themes": [ "WordPress/theme-experiments/twentytwentyone-blocks" ] works fine when using the local wp-env (npm run wp-env), but not when using the global one.

EDIT:
@noahtallen gave me a very simple and in hindsight obvious explanation: the recent updates to wp-env to load the 2021-blocks experiment haven't been published to npm yet, so it's just normal that the global wp-env doesn't work. 🙂

@noahtallen
Copy link
Member

See if it's an "update", the shouldConfigureWp doesn't take the cache key into consideration :)

That shouldn't matter though, unless I'm missing something:

  1. If the update flag is set to true, then yes we need to configure WP
  2. If the config changed, then yes we need to configure WP

After we set shouldConfigureWp to true in either (or both) of those situations, then all configuration is supposed to happen correctly. In both cases, we set the cache after configuring WordPress as the last step.

So if it's an "update" then it doesn't matter whether or not the config changed since we still run all the same configuration steps. And we always use the current config file from the filesystem (so it shouldn't be cached). We just cache a hash of the config file so that we can avoid configuration when the config file hasn't changed.

I'm happy to try to fix the issue, I just don't quite understand what the issue is :)

@youknowriad
Copy link
Contributor Author

You're right, not sure exactly but i did notice that unless I remove the cache manually, the volumes don't get downloaded/synced again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Build Tooling Issues or PRs related to build tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants