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

Tiled Galleries: do not rely on the Tiled Gallery module. #11061

Merged
merged 1 commit into from
Jan 3, 2019

Conversation

jeherve
Copy link
Member

@jeherve jeherve commented Jan 2, 2019

Fixes #10753

Changes proposed in this Pull Request:

With this PR, one can use the Tiled Gallery block on their site even
if the Tiled Gallery module is not active. The block, however, relies
on the Photon module.

Testing instructions:

  • Go to Jetpack > Settings
  • Disable the "Speed up image load times" option
  • Load the block editor.
  • The tiled gallery block should not be available.
  • If, however, you go back and enable the "Speed up image load times" option, the block will become available.

Proposed changelog entry for your changes:

  • Tiled Gallery block: do not rely on the Tiled Gallery module.

Fixes #10753

With this PR, one can use the Tiled Gallery block on their site even
if the Tiled Gallery module is not active. The block, however, relies
on the Photon module.
@jeherve jeherve added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Feature] Tiled Gallery A different way to display image galleries on your site, in different organizations and shapes. [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 Jan 2, 2019
@jeherve jeherve added this to the 6.9 milestone Jan 2, 2019
@jeherve jeherve self-assigned this Jan 2, 2019
@jeherve jeherve requested review from simison, sirreal and a team January 2, 2019 14:54
@matticbot
Copy link
Contributor

D22751-code. (newly created revision)

@jetpackbot
Copy link
Collaborator

Fails
🚫

Danger failed to run dangerfile.js.

Thank you for the great PR description!

When this PR is ready for review, please apply the [Status] Needs Review label. If you are an a11n, please have someone from your team review the code if possible. The Jetpack team will also review this PR and merge it to be included in the next Jetpack release.

Error TypeError

github.api.issues.getMilestones is not a function
TypeError: github.api.issues.getMilestones is not a function
    at _callee$ (dangerfile.js:65:32)
    at tryCatch (/home/travis/build/Automattic/jetpack/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:62:40)
    at Generator.invoke [as _invoke] (/home/travis/build/Automattic/jetpack/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:296:22)
    at Generator.prototype.(anonymous function) [as next] (/home/travis/build/Automattic/jetpack/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:114:21)
    at step (/home/travis/build/Automattic/jetpack/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
    at /home/travis/build/Automattic/jetpack/node_modules/babel-runtime/helpers/asyncToGenerator.js:35:14
    at new Promise (<anonymous>)
    at new F (/home/travis/build/Automattic/jetpack/node_modules/core-js/library/modules/_export.js:36:28)
    at /home/travis/build/Automattic/jetpack/node_modules/babel-runtime/helpers/asyncToGenerator.js:14:12
    at /home/travis/build/Automattic/jetpack/node_modules/danger/distribution/runner/runners/inline.js:84:32

Dangerfile

60|             const firstTuesdayOfMonth = moment().add( 1, 'months' ).startOf( 'month' );
61|             while ( firstTuesdayOfMonth.day() !== 2 ) {
62|                 firstTuesdayOfMonth.add( 1, 'day' );
63|             }
64|             jetpackReleaseDate = firstTuesdayOfMonth.format( 'LL' );
-------------------------------------------^
65|             // Calculate next code freeze date
66|             codeFreezeDate = firstTuesdayOfMonth.subtract( 7, 'd' ).format( 'LL' );
67|         }
68| 

Generated by 🚫 dangerJS against f1c15c4

@simison simison requested review from a team January 2, 2019 15:35
@simison
Copy link
Member

simison commented Jan 2, 2019

I'm concerned about the impact to user experience this will have since it's not at all obvious that gallery block depends on "speeding up images" -feature unless we rename that feature somehow.

This is a good first step, but as a next step, would it be possible to rely on Photon URLs without relying on the module being active?

Does Tiled gallery module turn Photon on in the background somehow?

@jeherve
Copy link
Member Author

jeherve commented Jan 2, 2019

would it be possible to rely on Photon URLs without relying on the module being active?

That is definitely something we can do. In fact, we already do it for other features of Jetpack like Related Posts or the Top Posts widget: we use Photon, whether you have the module on or not.
In the past we used to do it for Tiled Galleries as well, but it was causing some confusion from folks who wanted to turn off Photon on their site and still saw Photon URLs used in their galleries. They did not understand why. This is why we opted to more clearly rely on the Photon feature. It's not perfect though, I think both solutions have their downsides. I'm not sure what is best.

Ideally, I think we should always have the Tiled Gallery block available, and have it use Photon behind the scenes if the feature is on on the site. I'm not sure this can be done today though.

@gititon
Copy link
Contributor

gititon commented Jan 2, 2019

Tested, worked well.

Copy link
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.

tests well :shipit:

@brbrr brbrr added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review This PR is ready for review. labels Jan 3, 2019
@ockham
Copy link
Contributor

ockham commented Jan 3, 2019

Ideally, I think we should always have the Tiled Gallery block available, and have it use Photon behind the scenes if the feature is on on the site. I'm not sure this can be done today though.

Agree that this seems like a desirable long-term solution.

Copy link
Contributor

@ockham ockham left a comment

Choose a reason for hiding this comment

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

Code looks good and tests well 👍

@jeherve jeherve merged commit 2ccc2d0 into master Jan 3, 2019
@ghost ghost removed the [Status] Ready to Merge Go ahead, you can push that green button! label Jan 3, 2019
@jeherve jeherve deleted the update/tiled-gallery-reliance branch January 3, 2019 11:40
@sirreal
Copy link
Member

sirreal commented Jan 7, 2019

Noting that it looks like D22751-code will need some additional work which we'll need to be sure is synced back here.

@simison
Copy link
Member

simison commented Jan 14, 2019

Syncing back in #11136

simison added a commit that referenced this pull request Jan 14, 2019
Syncs with changes in D22751-code that weren't included in #11061
simison added a commit that referenced this pull request Jan 14, 2019
Syncs with changes in D22751-code that weren't included in #11061
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Tiled Gallery A different way to display image galleries on your site, in different organizations and shapes. [Focus] Blocks Issues related to the block editor, aka Gutenberg, and its extensions developed in Jetpack Touches WP.com Files [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants