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

Style engine: pass CSS formatting options from global functions #43886

Merged
merged 1 commit into from
Sep 6, 2022

Conversation

ramonjd
Copy link
Member

@ramonjd ramonjd commented Sep 6, 2022

What?

Allowing passing 'prettify' option from global functions.

Why?

So we can better control testing and allow user overrides.

For example, core tests have SCRIPT_DEBUG enabled so we'd want to be able to override this for unit testing.

See: WordPress/wordpress-develop#3199

Testing Instructions

The tests should pass!

…tter control testing and allow user overrides.
Copy link
Contributor

@andrewserong andrewserong left a comment

Choose a reason for hiding this comment

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

Good idea, LGTM too! ✨

@ramonjd ramonjd merged commit 4468fb2 into trunk Sep 6, 2022
@ramonjd ramonjd deleted the update/style-engine-pass-prettify-option branch September 6, 2022 09:15
@github-actions github-actions bot added this to the Gutenberg 14.1 milestone Sep 6, 2022
ramonjd added a commit that referenced this pull request Sep 6, 2022
ramonjd added a commit to ramonjd/wordpress-develop that referenced this pull request Sep 6, 2022
ramonjd added a commit to ramonjd/wordpress-develop that referenced this pull request Sep 7, 2022
ramonjd added a commit to ramonjd/wordpress-develop that referenced this pull request Sep 8, 2022
ramonjd added a commit to ramonjd/wordpress-develop that referenced this pull request Sep 8, 2022
ramonjd added a commit to ramonjd/wordpress-develop that referenced this pull request Sep 9, 2022
ramonjd added a commit to ramonjd/wordpress-develop that referenced this pull request Sep 9, 2022
ramonjd added a commit that referenced this pull request Sep 9, 2022
ramonjd added a commit that referenced this pull request Sep 13, 2022
andrewserong pushed a commit that referenced this pull request Sep 14, 2022
)

* Initial commit. Adding further documentation, cleaning up changelog ready to populate with real changes :P

* Typos, formatting

* Typos, formatting

* Sorting out change log and formatting

* Remove enqueue option. It does nothing.

* Update packages/style-engine/docs/using-the-style-engine-with-block-supports.md

No empty lines! :D

Co-authored-by: Ari Stathopoulos <aristath@gmail.com>

* Update README.md

typo

* Updating manifest.json to include new style engine docs
Splitting the global functions out of the class files
Checking for the directory when loading rather than each individual file

* Adding type annotation

* Updating CHANGELOG.md

* Updated version to prerelease
Reverted JS comments for TS types and rebuilt docs
Removed style engine from bundle exception array

* Rebase after #43886

* Updating change logs and emphasizing that new global JS methods are available since 6.1

* Checking for functions and classes in tests so that Gutenberg tests don't fail during the backport to Core.
This is valid for 6.1. After that, developing the packages might require another solution, such as testing against `gutenberg_` prefixed functions.

* Formatting PHP doc comments and params that describe associative arrays

Updating test function names and annotations.

* Formatting

* Combining tests for get_declarations_string
Updating php doc params

* Adding message parameter to assertions where more than one assertion is used in a test method.

* Updating PHP docs
Testing for WP_Style_Engine_CSS_Rules_Store in WP_Style_Engine_Processor->add_store

* Text domain added to __()

* Refactoring sanitization tests for CSS declarations
Counting calls to mock filters executed in safecss_filter_attr() (kses.php)

* Formatting styleEngine tests
Removing duplicated test (we were already testing context below)

* My blod is typo

* Active voice rather than imperative

* Remove Gutenberg suffix

* Adding message to script loader block support enqueuing expectations

* Grammar, formatting, removing class_exists checks

* Ignore unused variable. This is a common test pattern in Core.

* Remove unusued var in tests

Co-authored-by: Ari Stathopoulos <aristath@gmail.com>
cbravobernal pushed a commit that referenced this pull request Sep 14, 2022
)

* Initial commit. Adding further documentation, cleaning up changelog ready to populate with real changes :P

* Typos, formatting

* Typos, formatting

* Sorting out change log and formatting

* Remove enqueue option. It does nothing.

* Update packages/style-engine/docs/using-the-style-engine-with-block-supports.md

No empty lines! :D

Co-authored-by: Ari Stathopoulos <aristath@gmail.com>

* Update README.md

typo

* Updating manifest.json to include new style engine docs
Splitting the global functions out of the class files
Checking for the directory when loading rather than each individual file

* Adding type annotation

* Updating CHANGELOG.md

* Updated version to prerelease
Reverted JS comments for TS types and rebuilt docs
Removed style engine from bundle exception array

* Rebase after #43886

* Updating change logs and emphasizing that new global JS methods are available since 6.1

* Checking for functions and classes in tests so that Gutenberg tests don't fail during the backport to Core.
This is valid for 6.1. After that, developing the packages might require another solution, such as testing against `gutenberg_` prefixed functions.

* Formatting PHP doc comments and params that describe associative arrays

Updating test function names and annotations.

* Formatting

* Combining tests for get_declarations_string
Updating php doc params

* Adding message parameter to assertions where more than one assertion is used in a test method.

* Updating PHP docs
Testing for WP_Style_Engine_CSS_Rules_Store in WP_Style_Engine_Processor->add_store

* Text domain added to __()

* Refactoring sanitization tests for CSS declarations
Counting calls to mock filters executed in safecss_filter_attr() (kses.php)

* Formatting styleEngine tests
Removing duplicated test (we were already testing context below)

* My blod is typo

* Active voice rather than imperative

* Remove Gutenberg suffix

* Adding message to script loader block support enqueuing expectations

* Grammar, formatting, removing class_exists checks

* Ignore unused variable. This is a common test pattern in Core.

* Remove unusued var in tests

Co-authored-by: Ari Stathopoulos <aristath@gmail.com>
ockham pushed a commit that referenced this pull request Sep 19, 2022
)

* Initial commit. Adding further documentation, cleaning up changelog ready to populate with real changes :P

* Typos, formatting

* Typos, formatting

* Sorting out change log and formatting

* Remove enqueue option. It does nothing.

* Update packages/style-engine/docs/using-the-style-engine-with-block-supports.md

No empty lines! :D

Co-authored-by: Ari Stathopoulos <aristath@gmail.com>

* Update README.md

typo

* Updating manifest.json to include new style engine docs
Splitting the global functions out of the class files
Checking for the directory when loading rather than each individual file

* Adding type annotation

* Updating CHANGELOG.md

* Updated version to prerelease
Reverted JS comments for TS types and rebuilt docs
Removed style engine from bundle exception array

* Rebase after #43886

* Updating change logs and emphasizing that new global JS methods are available since 6.1

* Checking for functions and classes in tests so that Gutenberg tests don't fail during the backport to Core.
This is valid for 6.1. After that, developing the packages might require another solution, such as testing against `gutenberg_` prefixed functions.

* Formatting PHP doc comments and params that describe associative arrays

Updating test function names and annotations.

* Formatting

* Combining tests for get_declarations_string
Updating php doc params

* Adding message parameter to assertions where more than one assertion is used in a test method.

* Updating PHP docs
Testing for WP_Style_Engine_CSS_Rules_Store in WP_Style_Engine_Processor->add_store

* Text domain added to __()

* Refactoring sanitization tests for CSS declarations
Counting calls to mock filters executed in safecss_filter_attr() (kses.php)

* Formatting styleEngine tests
Removing duplicated test (we were already testing context below)

* My blod is typo

* Active voice rather than imperative

* Remove Gutenberg suffix

* Adding message to script loader block support enqueuing expectations

* Grammar, formatting, removing class_exists checks

* Ignore unused variable. This is a common test pattern in Core.

* Remove unusued var in tests

Co-authored-by: Ari Stathopoulos <aristath@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Style Engine /packages/style-engine [Type] Enhancement A suggestion for improvement.
Projects
Status: 🏆 Done
Development

Successfully merging this pull request may close these issues.

3 participants