Directory

Platform Docs: Fix JSX error by michalczaplinski · Pull Request #59967 · WordPress/gutenberg · GitHub
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

Platform Docs: Fix JSX error #59967

Merged
merged 3 commits into from
Mar 20, 2024
Merged

Conversation

michalczaplinski
Copy link
Contributor

The example in the "Getting Started" page contained invalid JSX.

@michalczaplinski michalczaplinski added the Framework Issues related to broader framework topics, especially as it relates to javascript label Mar 18, 2024
@michalczaplinski michalczaplinski added the [Type] Developer Documentation Documentation for developers label Mar 18, 2024
/*
The BlockEditorProvider is the wrapper of the block editor's state.
All the UI elements of the block editor need to be rendered within this provider.
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

The spacing seems wrong or at least not consistent with the rest of the code block.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, I tried preserving the same spacing in the example as there was before (sans the {}).

Side note: would be great if we could format the examples using prettier to avoid this in the future. I think that we can use a standard prettier config for the platform-docs that is separate from the Gutenberg config. Just adding a prettier: {}` in the package.json of the platform-docs should be sufficient.

What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good to me 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure you made the right change to the formatting though, it seems to be using tabs for me in the GitHub diff while the rest of the example is using spaces. I'm approving the PR anyway, but maybe it's not entirely fixed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, you're right, I'm not sure why the spaces got converted to tabs.

I've updated it now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, I tried creating a new PR with improved formatting but it's a bit tricky.

The default in GB repo is tabs. But formatting the markdown docs in platform-docs using the default results in weird indentation.

I tried configuring prettier only for platform-docs to use spaces but that conflicts with some GB eslint rules
Screenshot 2024-03-21 at 12 37 50

I tried configuring overrides in https://github.com/WordPress/gutenberg/blob/d30cdd0fab1d1875317896ea4d2ef385eaa957cc/platform-docs/.eslintrc.js to overcome that but it didn't seem to work.

I might give it another shot in the future but I think I won't spend more time on it right now.

Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: michalczaplinski <czapla@git.wordpress.org>
Co-authored-by: youknowriad <youknowriad@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@michalczaplinski michalczaplinski enabled auto-merge (squash) March 20, 2024 20:01
@michalczaplinski michalczaplinski merged commit f802107 into trunk Mar 20, 2024
33 of 57 checks passed
@michalczaplinski michalczaplinski deleted the fix/platform-docs-improvement branch March 20, 2024 20:01
@github-actions github-actions bot added this to the Gutenberg 18.0 milestone Mar 20, 2024
carstingaxion pushed a commit to carstingaxion/gutenberg that referenced this pull request Mar 27, 2024
* Update BlockEditorProvider comment

* Format the comment

* Format using spaces

Co-authored-by: michalczaplinski <czapla@git.wordpress.org>
Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework Issues related to broader framework topics, especially as it relates to javascript [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants