Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Fix frontedAttributes not using the resolved attribute values #19

Merged
merged 4 commits into from
May 19, 2022

Conversation

michalczaplinski
Copy link
Collaborator

@michalczaplinski michalczaplinski commented May 18, 2022

I've introduced a bug in #15!

The frontedAttributes should be an object with the values of the attributes. Instead, it was an object with the raw attributes from the block.json which is not what we really want!

I've also started using dprint and it seems to work fine with the extension, but I notice that the formatting is a little different which is why there are some formatting-related changes in this PR.

Also, updated package-json so that we get the latest dprint which can use a local npm installation of dprint.

@@ -0,0 +1,3 @@
{
"editor.defaultFormatter": "dprint.dprint"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it's not the best practice in a large repo to add this file, but I think for convenience and to force people to help test dprint we should add it.

Copy link
Member

Choose a reason for hiding this comment

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

Good idea. Thanks, Michal 🙂

@@ -63,7 +63,7 @@ export const hydrate = (container, element, hydrationOptions) => {
break; // break loop on first match
}
});
io.observe(element.children[0]);
io.observe(container.children[0]);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've re-ordered the arguments to match the signature of ReactDOM.hydrate()

@@ -0,0 +1,3 @@
{
"editor.defaultFormatter": "dprint.dprint"
Copy link
Member

Choose a reason for hiding this comment

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

Good idea. Thanks, Michal 🙂

@luisherranz luisherranz merged commit 4c63cdf into main May 19, 2022
@luisherranz luisherranz deleted the feature/opt-out-frontend-attributes branch September 6, 2022 10:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants