Skip to content

Gutenberg: add view files to Gutenberg tester#10154

Merged
simison merged 5 commits intomasterfrom
update/gutenberg-tester-add-view-file
Sep 18, 2018
Merged

Gutenberg: add view files to Gutenberg tester#10154
simison merged 5 commits intomasterfrom
update/gutenberg-tester-add-view-file

Conversation

@simison
Copy link
Copy Markdown
Member

@simison simison commented Sep 17, 2018

  • Adds view files to Gutenberg tester
  • Renames editor files from jetpack-editor.* to editor.*
  • Add support for RTL CSS files

Testing instructions:

  • Switch to try/stylish-hello-dolly branch in Calypso (Gutenberg: add styles to Hello Dolly wp-calypso#27241)

  • From calypso folder, generate files — note to change output-dir to correct place:

    npm run sdk -- gutenberg \
      --editor-script=client/gutenberg/extensions/presets/jetpack/editor.js \
      --view-script=client/gutenberg/extensions/presets/jetpack/view.js \
      --output-editor-file=editor \
      --output-view-file=view \
      --output-dir=/absolute_path_to_your_jetpack/_inc/blocks
  • Add these filters to your Jetpack setup, e.g. to a file in mu-plugins folder:

    add_filter( 'jetpack_gutenberg', '__return_true' );

    These will: enable loading these Gutenberg assets from the CDN. You should see all the files throw 404. We'll still need tofollow up and add these files.

  • To disable loading via CDN and load files from your local disk instead, add:

    add_filter( 'jetpack_gutenberg_cdn', '__return_false' );

    You should now see all the files load and "Hello Dolly" Gutenberg block be available:
    image

  • If you switch your site to RTL mode (e.g. with rtl-tester e.g. by changing your language from settings to Hebrew. RTL tester doesn't seem to trigger is_rtl()), you should see at both theme, and the editor side RTL CSS files loaded instead.

@simison simison added Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] Needs Review This PR is ready for review. [Focus] Blocks Issues related to the block editor, aka Gutenberg, and its extensions developed in Jetpack labels Sep 17, 2018
@simison simison self-assigned this Sep 17, 2018
@simison simison requested review from a team and oskosk September 17, 2018 12:35
@simison simison requested a review from a team as a code owner September 17, 2018 12:35
@simison simison changed the title Gutenberg: add Gutenberg: add view files to Gutenberg tester Sep 17, 2018
@jetpackbot
Copy link
Copy Markdown
Collaborator

Warnings
⚠️

"Proposed changelog entry" is missing for this PR. Please include any meaningful changes

This is automated check which relies on PULL_REQUEST_TEMPLATE.We encourage you to follow that template as it helps Jetpack maintainers do their job. If you think 'Testing instructions' or 'Proposed changelog entry' are not needed for your PR - please explain why you think so. Thanks for cooperation 🤖

Generated by 🚫 dangerJS

@simison
Copy link
Copy Markdown
Member Author

simison commented Sep 18, 2018

Noting that all filenames might need renaming when Automattic/wp-calypso#27257 is merged (Update: done in this PR and instructions already)

Copy link
Copy Markdown
Contributor

@brbrr brbrr left a comment

Choose a reason for hiding this comment

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

Tested with JN gutenpack (https://jurassic.ninja/create/?shortlived&gutenberg&gutenpack&jetpack-beta&branch=update/gutenberg-tester-add-view-file&calypsobranch=try/stylish-hello-dolly)

Functionally works well, no errors shown. _inc/blocks/jetpack-editor.rtl.css RTL styles loaded for RTL language.

@simison simison removed the [Status] Needs Review This PR is ready for review. label Sep 18, 2018
Copy link
Copy Markdown
Member

@tyxla tyxla left a comment

Choose a reason for hiding this comment

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

Tests well for me, and code looks great 👍 Great work! 💯

$version
);
wp_register_style( 'jetpack-blocks-editor', $editor_style, array(), $version );
wp_register_script( 'jetpack-blocks-view', $view_script, array(), $version );
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We eventually might want to audit the dependencies here, as some of the blocks might end up needing specific WordPress packages or another script.

@simison simison merged commit 790e4bb into master Sep 18, 2018
@simison simison deleted the update/gutenberg-tester-add-view-file branch September 18, 2018 13:13
jeherve added a commit that referenced this pull request Sep 24, 2018
jeherve added a commit that referenced this pull request Sep 25, 2018
* Readme: add boilerplate for next release, 6.6

* Add 6.5 to the changelog.txt file

* Set boilerplate testing list for 6.6

* Readme: update stable tag to 6.5

* Add bullets to 6.5 changelog items

* Readme: add link to previous changelogs

This will help folks who want to know more about past releases,
while keeping the readme.txt short so as to not overwhelm translators and site owners only looking for information about the last release.

* Changelog: add information at the top of the changelog file.

* Changelog: add #10054

* Changelog: add #10078

* Changelog: add #10079

* Changelog: add #10064

* Changelog: add #10094

* Changelog: add #10096

* Testing list: add more information based on #10087

* Changelog: add #9847

* Changelog: add #10084

* Changelog: add #9918

* Changelog: add #7614

* Changelog: add #10116

* Changelog: add #10108

* Changelog: add #10041

* Changelog: add #10121

* Changelog: add #10134

* Changelog: add #10130

* Changelog: add #10109

* changelog: add #10137

* changelog: add #9952

* changelog: add #10120

* changelog: add #10162

* Changelog: add #10163

* Changelog: add #10092

* changelog: add #10156

* Changelog: add #10154

* changelog: add #10122

* Changelog: add #10101

* changelog: add #10105

* changelog: add #10190

* Changelog: add #10196

* changelog: add #10152

* Changelog: add #10153

* Testing list: add more details to Site Verification testing steps.

@see #10143 (comment)

* changelog: add #10194

* Changelog: add #10193
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Focus] Blocks Issues related to the block editor, aka Gutenberg, and its extensions developed in Jetpack

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants