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

Introduce register_asset() and enqueue_asset() functions; refactor & test plugin #22

Merged
merged 40 commits into from
Jul 21, 2020
Merged
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
152349f
Use a static $manifests cache to avoid repeat file reads in one cycle
kadamwhite Jul 8, 2020
2cc9705
Use the new PHPCS ruleset in CI
kadamwhite Jul 8, 2020
9d3ba7b
Install PHPUnit
kadamwhite Jul 8, 2020
5d4d240
Begin moving admin script warning to new namespace, with tests
kadamwhite Jul 8, 2020
314c05f
Expand test coverage of admin script load error notice handling
kadamwhite Jul 8, 2020
b57c4b4
Include tests in travis, and add editorconfig
kadamwhite Jul 8, 2020
d77b114
Add Manifest\get_manifest_resource method
kadamwhite Jul 8, 2020
fa62dc4
Add unit tests for Paths\plugin_or_theme_file_uri
kadamwhite Jul 9, 2020
fe13729
Rename path_or_theme_file_uri to get_file_uri
kadamwhite Jul 9, 2020
5e766a6
Test is_css and adjust admin namespace test function comments
kadamwhite Jul 9, 2020
32324f4
Introduce single-resource register_asset and enqueue_asset functions
kadamwhite Jul 9, 2020
3e6a7a9
Disable side-effects rule in tests bootstrap
kadamwhite Jul 9, 2020
b66dfa1
Complete moving ssl cert error logic to Admin namespace
kadamwhite Jul 9, 2020
2220e57
Name each test case in data providers
kadamwhite Jul 9, 2020
51715ce
Add _doing_it_wrong to autoenqueue/autoregister
kadamwhite Jul 9, 2020
f45f962
Consistently apply SSL cert error notification in all main logic paths
kadamwhite Jul 9, 2020
5c0dcbb
Add CHANGELOG.md covering through upcoming 0.4
kadamwhite Jul 9, 2020
3b5c0c6
Use resource URI as script or style handle if no handle provided
kadamwhite Jul 9, 2020
213b4dd
Update README
kadamwhite Jul 9, 2020
2c2fab8
Introduce Manifest\get_version() helper to set asset version strings
kadamwhite Jul 20, 2020
1cf2d0b
Use new Manifest\get_version() function when registering assets
kadamwhite Jul 20, 2020
e2327a4
Move mocks of trailingslashit to base test class
kadamwhite Jul 20, 2020
ebf9d1f
Determine hash-ness with 16 or more chars, not 25
kadamwhite Jul 20, 2020
729305c
Add overly-complex unit test setup for register_asset method
kadamwhite Jul 21, 2020
e5716bf
Add test for complex fallback logic for CSS-only dev assets
kadamwhite Jul 21, 2020
8b9e72c
Eliminate trailing comma causing error in PHP 7.2
kadamwhite Jul 21, 2020
28ace0a
Update inc/manifest.php
kadamwhite Jul 21, 2020
d881e63
Use terse forms of composer script commands
kadamwhite Jul 21, 2020
cd9611c
Remove superfluous is_admin check
kadamwhite Jul 21, 2020
6f545d6
Rename phpcs file to remove need to manually specify --standard
kadamwhite Jul 21, 2020
de59196
Use null coalescing to obviate isset check
kadamwhite Jul 21, 2020
93e3782
Use is_readable over file_exists
kadamwhite Jul 21, 2020
6d070f5
Remove unnecessary namespace & "use"
kadamwhite Jul 21, 2020
01936ab
Remove superfluous blank line.
tfrommen Jul 21, 2020
e9f6453
Unset DOM loaded event after execution.
kadamwhite Jul 21, 2020
faf56db
Use rtrim in trailingslashit mock implementation
kadamwhite Jul 21, 2020
31fa16b
Remove admin flag from tests for function which no longer cares
kadamwhite Jul 21, 2020
6cf6f1b
Use strict_types=1 throughout codebase
kadamwhite Jul 21, 2020
0609d7e
Update CHANGELOG to reflect versioning logic changes
kadamwhite Jul 21, 2020
fd70cf2
Clarify usage of the new methods in CHANGELOG
kadamwhite Jul 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Clarify usage of the new methods in CHANGELOG
kadamwhite committed Jul 21, 2020
commit fd70cf2ca55a0dec3673810d40b5f29cd1894d94
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -5,6 +5,8 @@
- **Breaking**: Remove undocumented `Asset_Loader\is_development` method.
- **Breaking**: Remove undocumented `Asset_Loader\enqueue_assets` method.
- **New**: Introduce new `Asset_Loader\register_asset()` and `Asset_Loader\enqueue_asset()` public API.
- Assets should now be registered individually.
- If a bundle exports both a CSS and JS file, both files should be registered or enqueued individually.
- Refactor how SSL warning notice behavior gets triggered during asset registration.
- Change how version strings are determined when registering assets
- If asset is detected to be using a uniquely hashed filename, no version string is used.