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

feat: use *.asset.php for enqueued asset version and dependencies #55

Merged
merged 3 commits into from
Feb 29, 2024

Conversation

jasonbahl
Copy link
Collaborator

@jasonbahl jasonbahl commented Feb 28, 2024

wp-scripts will generate an assets.php file that tracks all of the WordPress dependencies used in the codebase (i.e. @wordpress/element, @wordpress/data, etc) and outputs those dependencies in a PHP file that can be used to declare any dependencies that need to be loaded before our custom script is loaded.

This allows us to add more @wordpress/* packages in the future, or remove them if they're not needed, and not have to worry about manually updating the dependencies array in wp_enqueue_script().

This also ensures that cache is busted when the build changes, as the version number is dynamically generated based on a build and not tied to a plugin version number.

closes #43
closes #53

@jasonbahl jasonbahl self-assigned this Feb 28, 2024
@josephfusco josephfusco changed the base branch from main to feat/implement-redux February 28, 2024 23:55
josephfusco
josephfusco previously approved these changes Feb 28, 2024
@josephfusco josephfusco changed the base branch from feat/implement-redux to main February 28, 2024 23:59
@josephfusco josephfusco dismissed their stale review February 28, 2024 23:59

The base branch was changed.

…use-asset.php

# Conflicts:
#	package-lock.json
#	package.json
#	wpgraphql-ide.php
@josephfusco josephfusco merged commit 237ddfd into main Feb 29, 2024
4 checks passed
@josephfusco josephfusco deleted the feat/43-use-asset.php branch May 17, 2024 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Styles for new IDE are impacting the legacy IDE Use asset.php to determine version/dependencies
2 participants