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

Use _activityPubOptions at runtime #1168

Merged
merged 6 commits into from
Jan 17, 2025

Conversation

mattwiebe
Copy link
Contributor

@mattwiebe mattwiebe commented Jan 15, 2025

It turns out that #1131 breaks stuff on dotcom. But even printing in wp_head wasn't good enough, because the scripts were demanding the option to be present at instantiation time. But with a more flexible approach, we can assume that the option will be there at runtime, which is good enough. So I introduced a getOptions helper to do that.

Note that we could get around this by adding proper inline script dependencies to each script in turn, but that was giving problems with the script handles registered through block.json via register_block_type_from_metadata. This is why I moved to just outputting it.

Testing

All blocks, in editor and the frontend, should keep working properly

@mattwiebe mattwiebe requested a review from a team January 15, 2025 17:44
@mattwiebe mattwiebe self-assigned this Jan 15, 2025
@github-actions github-actions bot added the [Focus] Editor Changes to the ActivityPub experience in the block editor label Jan 15, 2025
pfefferle
pfefferle previously approved these changes Jan 15, 2025
@mattwiebe mattwiebe changed the title Print _activityPubOptions in <head> Use _activityPubOptions at runtime Jan 15, 2025
src/shared/get-options.js Outdated Show resolved Hide resolved
obenland
obenland previously approved these changes Jan 17, 2025
@mattwiebe mattwiebe merged commit 2f347b1 into trunk Jan 17, 2025
20 checks passed
@mattwiebe mattwiebe deleted the fix/activitypub-options-back-in-head branch January 17, 2025 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Follow Me [Block] Followers [Block] Reactions [Block] Remote Reply aka "Reply on the Fediverse", in the comment list [Feature] Reactions [Focus] Editor Changes to the ActivityPub experience in the block editor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants