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

Block API: Ensure backwards compatibility for block matchers #3519

Merged
merged 2 commits into from Nov 20, 2017

Conversation

Projects
None yet
2 participants
@youknowriad
Contributor

youknowriad commented Nov 16, 2017

with #2854 it's no longer possible to use attribute matchers to define the block attributes. This PR adds a way to ensure backwards compatibility while warning about the "deprecated" status of these matchers.

Testing instructions

  • Update any block's attributes definition to the old matchers signature (example: source.attr( 'myattribute' ))
  • Load Gutenberg
  • the block should still work as expected
  • A warning should show up in the console when loading the editor.

@youknowriad youknowriad self-assigned this Nov 16, 2017

@youknowriad youknowriad requested review from mtias and aduth Nov 16, 2017

@codecov

This comment has been minimized.

Show comment
Hide comment
@codecov

codecov bot Nov 16, 2017

Codecov Report

Merging #3519 into master will increase coverage by 0.05%.
The diff coverage is 46.66%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #3519      +/-   ##
=========================================
+ Coverage   35.04%   35.1%   +0.05%     
=========================================
  Files         263     265       +2     
  Lines        6705    6735      +30     
  Branches     1220    1221       +1     
=========================================
+ Hits         2350    2364      +14     
- Misses       3677    3693      +16     
  Partials      678     678
Impacted Files Coverage Δ
blocks/library/button/index.js 9.3% <ø> (ø) ⬆️
blocks/api/matchers.js 92.85% <ø> (ø)
blocks/api/parser.js 98% <ø> (ø) ⬆️
blocks/hooks/index.js 100% <100%> (ø) ⬆️
blocks/index.js 100% <100%> (ø)
blocks/hooks/matchers.js 42.85% <42.85%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7d79f94...d8249a9. Read the comment docs.

codecov bot commented Nov 16, 2017

Codecov Report

Merging #3519 into master will increase coverage by 0.05%.
The diff coverage is 46.66%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #3519      +/-   ##
=========================================
+ Coverage   35.04%   35.1%   +0.05%     
=========================================
  Files         263     265       +2     
  Lines        6705    6735      +30     
  Branches     1220    1221       +1     
=========================================
+ Hits         2350    2364      +14     
- Misses       3677    3693      +16     
  Partials      678     678
Impacted Files Coverage Δ
blocks/library/button/index.js 9.3% <ø> (ø) ⬆️
blocks/api/matchers.js 92.85% <ø> (ø)
blocks/api/parser.js 98% <ø> (ø) ⬆️
blocks/hooks/index.js 100% <100%> (ø) ⬆️
blocks/index.js 100% <100%> (ø)
blocks/hooks/matchers.js 42.85% <42.85%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7d79f94...d8249a9. Read the comment docs.

Show outdated Hide outdated blocks/api/source.js Outdated
Show outdated Hide outdated blocks/api/source.js Outdated
@@ -156,6 +156,7 @@ class ButtonBlock extends Component {
</span>,
focus && (
<form
key="form-link"

This comment has been minimized.

@aduth

aduth Nov 16, 2017

Member

Was this change intentional?

@aduth

aduth Nov 16, 2017

Member

Was this change intentional?

This comment has been minimized.

@youknowriad

youknowriad Nov 16, 2017

Contributor

Oops, this was a bug fix I wanted to publish separately and accidentally made it to this PR

@youknowriad

youknowriad Nov 16, 2017

Contributor

Oops, this was a bug fix I wanted to publish separately and accidentally made it to this PR

This comment has been minimized.

@youknowriad

youknowriad Nov 16, 2017

Contributor

I can extract it to a separate PR but maybe not worth it

@youknowriad

youknowriad Nov 16, 2017

Contributor

I can extract it to a separate PR but maybe not worth it

Show outdated Hide outdated blocks/api/registration.js Outdated
@aduth

aduth approved these changes Nov 16, 2017

@youknowriad youknowriad merged commit 7f5281c into master Nov 20, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@youknowriad youknowriad deleted the update/block-attributes branch Nov 20, 2017

return settings;
}
export default function anchor( { addFilter } ) {

This comment has been minimized.

@aduth

aduth Nov 20, 2017

Member

Copypasta.

@aduth

aduth Nov 20, 2017

Member

Copypasta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment