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

Attribute standardization #1685

Merged
merged 10 commits into from
May 30, 2024
Merged

Attribute standardization #1685

merged 10 commits into from
May 30, 2024

Conversation

tim-evans
Copy link
Collaborator

The current attributes for our standard annotations have some messiness about them. This is an effort to clean up attributes and to provide a more standardized API that is consistent across more annotations. These decisions are made in conjunction with thinking about how our content is presented by our designers for sites like vogue.com, where some features that editors and writers use are not representable currently in our annotations.

We would like to provide more support and therefore, I'm introducing two major changes:

  1. size and inset become layout.
    These fields did not mix and match and allowing both properties made it confusing for developers as to which field took precedence. This also allows designers to add new types of layouts without having to change the data model.
  2. alignment becomes textAlignment
    This is pretty self-explanatory, and is about clarity.

Note that layout as a property is added to many more blocks than size and inset were on previously. This is intentional, since there are instances where editorial teams have used these features on these blocks. We may not provide them controls to change these properties, but we would like to fully support these and respect their decisions when it comes time to represent the data for our sites to use for rendering.

@tim-evans
Copy link
Collaborator Author

@copilot-robot prerelease

@copilot-robot
Copy link

Hi, @tim-evans, a pre-release has been published:

Copy link

@natelaws natelaws left a comment

Choose a reason for hiding this comment

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

Everything in this PR looks OK, however I am a little confused with whatever is happening with captions?

isAutogenerated?: boolean;
linkStyle?: "button";

Choose a reason for hiding this comment

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

This is no longer needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was a legacy property that was replaced by a button annotation.

@@ -379,102 +379,4 @@ describe("ReactRenderer", () => {
);
});
});

describe("Subdocuments", () => {

Choose a reason for hiding this comment

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

We don't need another test for the caption related changes? Looks like the other tests have caption related things?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Subdocuments are deprecated in favor of slices and we haven't used them for many months at this point.

Copy link

@natelaws natelaws left a comment

Choose a reason for hiding this comment

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

LGTM

@tim-evans tim-evans added the 🚨 Breaking Change This introduces a breaking change to atjson. label Sep 28, 2023
@tim-evans
Copy link
Collaborator Author

Please let me merge this, as it will cause cascading changes upstream.

@tim-evans tim-evans force-pushed the attribute-standardization branch 2 times, most recently from 8b01760 to 448caed Compare October 18, 2023 19:38
@tim-evans
Copy link
Collaborator Author

@copilot-robot prerelease

@copilot-robot
Copy link

Hi, @tim-evans, a pre-release has been published:

@tim-evans
Copy link
Collaborator Author

@copilot-robot prerelease

@copilot-robot
Copy link

Hi, @tim-evans, a pre-release has been published:

@tim-evans tim-evans force-pushed the attribute-standardization branch from bb88415 to fde3165 Compare February 27, 2024 19:02
@tim-evans
Copy link
Collaborator Author

@copilot-robot prerelease

@copilot-robot
Copy link

Hi, @tim-evans, a pre-release has been published:

@tim-evans tim-evans force-pushed the attribute-standardization branch from fde3165 to ee65f5d Compare March 25, 2024 18:25
@tim-evans
Copy link
Collaborator Author

@copilot-robot prerelease

@copilot-robot
Copy link

Hi, @tim-evans, a pre-release has been published:

@tim-evans
Copy link
Collaborator Author

@copilot-robot prerelease

@copilot-robot
Copy link

Hi, @tim-evans, a pre-release has been published:

@tim-evans tim-evans force-pushed the attribute-standardization branch from 27790b8 to 8c1f2e4 Compare April 30, 2024 16:10
@tim-evans
Copy link
Collaborator Author

@copilot-robot prerelease

@copilot-robot
Copy link

Hi, @tim-evans, a pre-release has been published:

@CondeNast CondeNast deleted a comment from copilot-robot May 7, 2024
@tim-evans
Copy link
Collaborator Author

@copilot-robot prerelease

@copilot-robot
Copy link

Hi, @tim-evans, a pre-release has been published:

tim-evans added 10 commits May 30, 2024 09:30
…to the layout attribute

alignment was unclear as to what it was referring to and textAlignment
works better in different contexts.

layout is a new property that is in place of size and inset to be
more extensible for designers, and to be more explicit that mixing
size with block alignment (the inset property) doesn't actually work.
this allows us to create a more consistent property that is available
on more blocks without having this limited approach where size is on
one thing, inset is on another, and some have both. having a single
attribute for describing this will allow downstream consumers to handle
this more easily.
this was never implemented
@tim-evans tim-evans force-pushed the attribute-standardization branch from be28e1b to 91fbe8c Compare May 30, 2024 13:30
@tim-evans tim-evans merged commit 36f709f into main May 30, 2024
3 checks passed
@tim-evans tim-evans deleted the attribute-standardization branch May 30, 2024 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 Breaking Change This introduces a breaking change to atjson.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants