You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: RELEASE_NOTES.md
+76Lines changed: 76 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,12 @@ This serves two purposes:
23
23
- You can now add custom posts to the blog post feed component when including it directly in https://github.com/hydephp/develop/pull/1893
24
24
- Added a `Feature::fromName()` enum helper in https://github.com/hydephp/develop/pull/1895
25
25
- Added support for specifying features in the YAML configuration in https://github.com/hydephp/develop/pull/1896
26
+
-**Added a new consolidated Asset API to better handle media files.**
27
+
- Added several new fluent methods to the `MediaFile` class, like `getLink()`, `getLength()`, `getMimeType()`, etc.
28
+
- Added new `HydeFront` facade to handle CDN links and Tailwind config injection.
29
+
- Added method `Asset::exists()` has to check if a media file exists.
30
+
- Added a `Hyde::assets()` method to get all media file instancess in the site.
31
+
26
32
27
33
### Changed
28
34
-**Breaking:** The internals of the navigation system has been rewritten into a new Navigation API. This change is breaking for custom navigation implementations. For more information, see below.
@@ -33,6 +39,7 @@ This serves two purposes:
33
39
-**Breaking:** The `Author::get()` method now returns `null` if an author is not found, rather than creating a new instance. For more information, see below.
34
40
-**Breaking:** The custom navigation item configuration now uses array inputs instead of the previous format. For more information, see the upgrade guide below.
35
41
-**Breaking:** Renamed the `hyde.navigation.subdirectories` configuration option to `hyde.navigation.subdirectory_display`.
42
+
-**Breaking:** Renamed the `hyde.enable_cache_busting` configuration option to `hyde.cache_busting` in https://github.com/hydephp/develop/pull/1980
36
43
- Medium: The `route` function will now throw a `RouteNotFoundException` if the route does not exist in https://github.com/hydephp/develop/pull/1741
37
44
- Minor: Navigation menu items are now no longer filtered by duplicates (meaning two items with the same label can now exist in the same menu) in https://github.com/hydephp/develop/pull/1573
38
45
- Minor: Due to changes in the navigation system, it is possible that existing configuration files will need to be adjusted in order for menus to look the same (in terms of ordering etc.)
@@ -60,6 +67,21 @@ This serves two purposes:
60
67
- The build command now groups together all `InMemoryPage` instances under one progress bar group in https://github.com/hydephp/develop/pull/1897
61
68
- The `Markdown::render()` method will now always render Markdown using the custom HydePHP Markdown service (thus getting smart features like our Markdown processors) in https://github.com/hydephp/develop/pull/1900
62
69
- Improved how the `MarkdownService` class is accessed, by binding it into the service container, in https://github.com/hydephp/develop/pull/1922
70
+
- Improved the media asset transfer build task to have better output in https://github.com/hydephp/develop/pull/1904
71
+
-**Many MediaFile related helpers has been changed or completely rewritten** to provide a simplified API for interacting with media files.
72
+
-**Note:** For most end users, the changes will have minimal direct impact, but if you have custom code that interacts with media files, you may need to update it.
73
+
- The `Asset` facade has been e restructured to be more scoped and easier to use, splitting out a separate `HydeFront` facade and inlining the `AssetService` class.
74
+
- All asset retrieval methods now return a `MediaFile` instance, which can be fluently interacted with, or cast to a string to get the link (which was the previous behavior).
75
+
- The `Hyde::asset()` method and `asset()` function now return `MediaFile` instances instead of strings, and will throw an exception if the asset does not exist.
76
+
- Renamed method `Asset::hasMediaFile` to `Asset::exists` in https://github.com/hydephp/develop/pull/1957
77
+
- Renamed method `MediaFile::getContentLength` to `MediaFile::getLength` in https://github.com/hydephp/develop/pull/1904
78
+
- Replaced method `Hyde::mediaPath` with `MediaFile::sourcePath` in https://github.com/hydephp/develop/pull/1911
79
+
- Replaced method `Hyde::siteMediaPath` with `MediaFile::outputPath` in https://github.com/hydephp/develop/pull/1911
80
+
- We will now throw an exception if you try to get a media file that does not exist in order to prevent missing assets from going unnoticed in https://github.com/hydephp/develop/pull/1932
81
+
-**MediaFile performance improvements:**
82
+
- Media assets are now cached in the HydeKernel, giving a massive performance boost and making it easier to access the instances in https://github.com/hydephp/develop/pull/1917
83
+
- Media file metadata is now lazy loaded and then cached in memory, providing performance improvements for files that may not be used in a build in https://github.com/hydephp/develop/pull/1933
84
+
- We now use the much faster `CRC32` hashing algoritm instead of `MD5` for cache busting keys in https://github.com/hydephp/develop/pull/1918
63
85
64
86
### Deprecated
65
87
- for soon-to-be removed features.
@@ -72,6 +94,13 @@ This serves two purposes:
72
94
- Removed: The deprecated `PostAuthor::getName()` method is now removed (use `$author->name`) in https://github.com/hydephp/develop/pull/1782
73
95
- Internal: Removed the internal `DocumentationSearchPage::generate()` method as it was unused in https://github.com/hydephp/develop/pull/1569
74
96
- Removed the deprecated `FeaturedImage::isRemote()` method in https://github.com/hydephp/develop/pull/1883. Use `Hyperlinks::isRemote()` instead.
97
+
-**With the new Asset API, a few features had to be moved/removed:**
98
+
-`AssetService` class has been removed (was merged into the `Asset` facade) in https://github.com/hydephp/develop/pull/1908
99
+
- Removed HydeFront methods from the `Asset` facade (moved to the new HydeFront facade) in https://github.com/hydephp/develop/pull/1907
100
+
- The config options `hyde.hydefront_version` and `hyde.hydefront_cdn_url` have been removed in https://github.com/hydephp/develop/pull/1909 (as changing these could lead to incompatible asset versions, defeating the feature's purpose)
101
+
- Removed `Hyde::mediaLink()` method replaced by `Hyde::asset()` in https://github.com/hydephp/develop/pull/1932
102
+
- Removed `Hyde::mediaPath()` method replaced by `MediaFile::sourcePath()` in https://github.com/hydephp/develop/pull/1911
103
+
- Removed `Hyde::siteMediaPath()` method replaced by `MediaFile::outputPath()` in https://github.com/hydephp/develop/pull/1911
75
104
76
105
### Fixed
77
106
- Added missing collection key types in Hyde facade method annotations in https://github.com/hydephp/develop/pull/1784
@@ -240,6 +269,53 @@ The following methods in the `Features` class have been renamed to follow a more
240
269
241
270
Note that this class was previously marked as internal in v1, but the change is logged here in case it was used in configuration files or custom code.
242
271
272
+
### Asset API Changes
273
+
274
+
#### Overview
275
+
For most end users, the changes to the Asset API in HydePHP 2.x will have minimal direct impact. However, if you have custom code that interacts with media files, you may need to update it.
276
+
277
+
The most important thing to note is that all asset retrieval methods now return a `MediaFile` instance, which can be fluently interacted with, or cast to a string to get the link (which was the previous behavior).
278
+
279
+
#### Side effects to consider
280
+
281
+
Regardless of if you need to make changes to your code, there are a few side effects to consider:
282
+
283
+
- All cache busting keys will have changed since we changed the hashing algorithm from `MD5` to `CRC32`.
284
+
- Media file getters now return MediaFile instances instead of strings. But these can still be used the same way in Blade `{{ }}` tags, as they can be cast to strings.
285
+
- Due to the internal normalizations, we will consistently use cache busting keys and use qualified paths when site URLs are set.
286
+
- An exception will be thrown if you try to get a media file that does not exist in order to prevent missing assets from going unnoticed.
287
+
288
+
These side effects should not have any negative impact on your site, but may cause the generated HTML to look slightly different.
289
+
290
+
#### Impact on Your Code
291
+
292
+
If you are using strict type declarations, you may need to update your code to expect a `MediaFile` instance instead of a string path; or you should cast the `MediaFile` instance to a string when needed.
293
+
294
+
Most changes were made in https://github.com/hydephp/develop/pull/1904 which contains extra information and the reasoning behind the changes.
295
+
296
+
#### Updating Your Code
297
+
298
+
Once you have determined that you need to update your code, here are the steps you should take:
2. Rename the option `hyde.enable_cache_busting` to `hyde.cache_busting` in your configuration file.
312
+
313
+
3. Remove any references to `hyde.hydefront_version` and `hyde.hydefront_cdn_url` in your config files as these options have been removed.
314
+
315
+
4. If you were using `AssetService` directly, refactor your code to use the new `Asset` facade, `MediaFile` class, or `HydeFront` facade as appropriate.
316
+
317
+
These changes simplify the Asset API and provide more robust handling of media files. The new `MediaFile` class offers additional functionality for working with assets.
0 commit comments