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
message: 'Compile HydeFront assets for production'
144
-
new_branch: compile-hydefront
145
-
146
-
147
112
build-tailwindcss:
148
113
149
114
runs-on: ubuntu-latest
@@ -164,7 +129,7 @@ jobs:
164
129
run: sed -i 's/\.\/vendor\/hyde\/framework\/resources\/views\/\*\*\/\*\.blade\.php/\.\/packages\/framework\/resources\/views\/\*\*\/\*\.blade\.php/' tailwind.config.js
165
130
166
131
- name: Build assets for production
167
-
run: npm run prod
132
+
run: npm run build
168
133
169
134
- name: Copy compiled app.css file to HydeFront dist folder
Copy file name to clipboardExpand all lines: RELEASE_NOTES.md
+120Lines changed: 120 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,11 +26,16 @@ This serves two purposes:
26
26
- Added a `Feature::fromName()` enum helper in https://github.com/hydephp/develop/pull/1895
27
27
- Added environment variable support for saving previews in https://github.com/hydephp/develop/pull/1996
28
28
- Added support for specifying features in the YAML configuration in https://github.com/hydephp/develop/pull/1896
29
+
- Added Vite as a build tool in https://github.com/hydephp/develop/pull/2010
29
30
-**Added a new consolidated Asset API to better handle media files.**
30
31
- Added several new fluent methods to the `MediaFile` class, like `getLink()`, `getLength()`, `getMimeType()`, etc.
31
32
- Added new `HydeFront` facade to handle CDN links and Tailwind config injection.
32
33
- Added method `Asset::exists()` has to check if a media file exists.
33
34
- Added a `Hyde::assets()` method to get all media file instances in the site.
35
+
- Added new `npm run build` command for compiling frontend assets with Vite
36
+
- Added a Vite HMR support for the realtime compiler in https://github.com/hydephp/develop/pull/2016
37
+
- Added Vite facade in https://github.com/hydephp/develop/pull/2016
38
+
- Added a custom Blade-based heading renderer for Markdown conversions in https://github.com/hydephp/develop/pull/2047
34
39
35
40
### Changed
36
41
@@ -88,6 +93,21 @@ This serves two purposes:
88
93
- 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
89
94
- 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
90
95
- We now use the much faster `CRC32` hashing algorithm instead of `MD5` for cache busting keys in https://github.com/hydephp/develop/pull/1918
96
+
-**Replaced Laravel Mix with Vite for frontend asset compilation** in https://github.com/hydephp/develop/pull/2010
97
+
-**Breaking:** You must now use `npm run build` to compile your assets, instead of `npm run prod`
98
+
- Bundled assets are now compiled directly into the `_media` folder, and will not be copied to the `_site/media` folder by the NPM command in https://github.com/hydephp/develop/pull/2011
99
+
- The realtime compiler now only serves assets from the media source directory (`_media`), and no longer checks the site output directory (`_site/media`) in https://github.com/hydephp/develop/pull/2012
100
+
-**Breaking:** Replaced `--run-dev` and `--run-prod` build command flags with a single `--run-vite` flag that uses Vite to build assets in https://github.com/hydephp/develop/pull/2013
101
+
- Moved the Vite build step to run before the site build to prevent duplicate media asset transfers in https://github.com/hydephp/develop/pull/2013
102
+
- Ported the HydeSearch plugin used for the documentation search to be an Alpine.js implementation in https://github.com/hydephp/develop/pull/2029
103
+
- Renamed Blade component `hyde::components.docs.search-widget` to `hyde::components.docs.search-modal` in https://github.com/hydephp/develop/pull/2029
104
+
- Added support for customizing the search implementation by creating a `resources/js/HydeSearch.js` file in https://github.com/hydephp/develop/pull/2031
105
+
- Normalized default Tailwind Typography Prose code block styles to match Torchlight's theme, ensuring consistent styling across Markdown and Torchlight code blocks in https://github.com/hydephp/develop/pull/2036.
106
+
- Extracted CSS component partials in HydeFront in https://github.com/hydephp/develop/pull/2038
107
+
- Replaced HydeFront styles with Tailwind in https://github.com/hydephp/develop/pull/2024
108
+
- Markdown headings are now compiled using our custom Blade-based heading renderer in https://github.com/hydephp/develop/pull/2047
109
+
- The `id` attributes for heading permalinks have been moved from the anchor to the heading element in https://github.com/hydephp/develop/pull/2052
110
+
- Colored Markdown blockquotes are now rendered using Blade and TailwindCSS, this change is not visible in the rendered result, but the HTML output has changed in https://github.com/hydephp/develop/pull/2056
91
111
92
112
### Deprecated
93
113
@@ -97,6 +117,8 @@ This serves two purposes:
97
117
98
118
- Breaking: Removed the build task `\Hyde\Framework\Actions\PostBuildTasks\GenerateSearch` (see upgrade guide below)
99
119
- Breaking: Removed the deprecated `\Hyde\Framework\Services\BuildService::transferMediaAssets()` method (see upgrade guide below)
120
+
- Breaking: Removed the `DocumentationPage::getTableOfContents()` method as we now use Blade to generate the table of contents in https://github.com/hydephp/develop/pull/2045
121
+
- Breaking: Removed the `DocumentationPage::hasTableOfContents()` method as it is now unused by the framework in https://github.com/hydephp/develop/pull/2006
100
122
- Removed the deprecated global `unslash()` function, replaced with the namespaced `\Hyde\unslash()` function in https://github.com/hydephp/develop/pull/1754
101
123
- Removed the deprecated `BaseUrlNotSetException` class, with the `Hyde::url()` helper now throwing `BadMethodCallException` if no base URL is set in https://github.com/hydephp/develop/pull/1760
102
124
- Removed: The deprecated `PostAuthor::getName()` method is now removed (use `$author->name`) in https://github.com/hydephp/develop/pull/1782
@@ -109,15 +131,37 @@ This serves two purposes:
109
131
- Removed `Hyde::mediaLink()` method replaced by `Hyde::asset()` in https://github.com/hydephp/develop/pull/1932
110
132
- Removed `Hyde::mediaPath()` method replaced by `MediaFile::sourcePath()` in https://github.com/hydephp/develop/pull/1911
111
133
- Removed `Hyde::siteMediaPath()` method replaced by `MediaFile::outputPath()` in https://github.com/hydephp/develop/pull/1911
134
+
- Removed Laravel Mix as a dependency in https://github.com/hydephp/develop/pull/2010 (replaced with Vite)
135
+
-**Breaking:** Removed `npm run prod` command (replaced with `npm run build`)
136
+
- Removed CDN include for the HydeSearch plugin replaced by Alpine.js implementation in https://github.com/hydephp/develop/pull/2029
137
+
- This also removes the `<x-hyde::docs.search-input />` and `<x-hyde::docs.search-scripts />` Blade components, replaced by the new `<x-hyde::docs.hyde-search />` component.
138
+
- Removed the `.torchlight-enabled` CSS class in https://github.com/hydephp/develop/pull/2036.
139
+
- Removed The `hyde.css` file from HydeFront in https://github.com/hydephp/develop/pull/2037 as all styles were refactored to Tailwind in https://github.com/hydephp/develop/pull/2024.
140
+
- Removed the `MarkdownService::withPermalinks` method in https://github.com/hydephp/develop/pull/2047
141
+
- Removed the `MarkdownService::canEnablePermalinks` method in https://github.com/hydephp/develop/pull/2047
112
142
113
143
### Fixed
114
144
115
145
- Added missing collection key types in Hyde facade method annotations in https://github.com/hydephp/develop/pull/1784
146
+
- The `app.js` file will now only be compiled if it has scripts in https://github.com/hydephp/develop/pull/2028
116
147
117
148
### Security
118
149
119
150
- in case of vulnerabilities.
120
151
152
+
### Package updates
153
+
154
+
#### Realtime Compiler
155
+
156
+
- Simplified the asset file locator to only serve files from the media source directory in https://github.com/hydephp/develop/pull/2012
157
+
- Added Vite HMR support in https://github.com/hydephp/develop/pull/2016
158
+
159
+
#### HydeFront
160
+
161
+
- Removed all Sass styles after porting everything to Tailwind in https://github.com/hydephp/develop/pull/2024
162
+
- Removed the `hyde.css` file in https://github.com/hydephp/develop/pull/2037 as all its styles were refactored to Tailwind in https://github.com/hydephp/develop/pull/2024
163
+
- Extracted CSS component partials in https://github.com/hydephp/develop/pull/2038
164
+
121
165
### Upgrade Guide
122
166
123
167
Please see the "Breaking changes & upgrade guide" section below for more information.
This change was implemented in https://github.com/hydephp/develop/pull/1883. Make sure to update any instances of `FeaturedImage::isRemote()` in your codebase to ensure compatibility with HydePHP v2.0.
466
510
511
+
## New Asset System
512
+
513
+
### Abstract
514
+
515
+
The new asset system is a complete rewrite of the HydeFront asset handling system, replacing Laravel Mix with Vite, and favouring Blade-based components with Tailwind classes over CSS partials and custom stylesheets.
516
+
517
+
### Enhancements
518
+
519
+
-**Replaced Laravel Mix with Vite for frontend asset compilation.** ([#2010], [#2011], [#2012], [#2013], [#2016], [#2021])
520
+
- Bundled assets are now compiled directly into the `_media` folder.
521
+
- The realtime compiler now only serves assets from the media source directory (`_media`).
522
+
- Added a new `npm run build` command for compiling frontend assets with Vite.
523
+
- Added Vite facade for Blade templates.
524
+
- Added Vite Hot Module Replacement (HMR) support to the realtime compiler.
525
+
- Build command now uses Vite to compile assets when the `--run-vite` flag is passed.
- HydeFront styles are now refactored into Tailwind.
529
+
- HydeFront now acts as a component library with granular Tailwind styles in `app.css`.
530
+
- HydeSearch plugin ported to Alpine.js, improving performance and customizability.
531
+
- Normalized Tailwind Typography Prose code block styles to match Torchlight.
532
+
- Extracted CSS component partials in HydeFront.
533
+
- Removed `hyde.css` from HydeFront, as all styles are now included in `app.css`.
534
+
535
+
-**Implemented a custom Blade-based heading renderer for Markdown.** ([#2047], [#2052])
536
+
- Improves permalink handling and customization options.
537
+
-`id` attributes for heading permalinks have been moved from the anchor to the heading element.
538
+
-**Colored Markdown blockquotes are now rendered using Blade and Tailwind CSS.** ([#2056])
539
+
- The `app.js` file will now only be compiled if it has scripts. ([#2028])
540
+
541
+
542
+
### Breaking Changes
543
+
544
+
- Replaced Laravel Mix with Vite. ([#2010])
545
+
- You must now use `npm run build` to compile your assets, instead of `npm run prod`.
546
+
- Removed `--run-dev` and `--run-prod` build command flags, replaced by `--run-vite`. ([#2013])
547
+
- Removed `DocumentationPage::getTableOfContents()` method. Table of contents are now generated using a Blade component. ([#2045])
548
+
- Removed `hyde.css` from HydeFront, requiring recompilation of assets if you were extending it. ([#2037])
549
+
- Changed how HydeFront is included in projects. Instead of separate `hyde.css` and `app.css`, all styles are now in `app.css`. ([#2024])
550
+
551
+
552
+
### Removals
553
+
554
+
- Removed Laravel Mix as a dependency. ([#2010])
555
+
- Removed `npm run prod` command. ([#2010])
556
+
- Removed CDN include for HydeSearch plugin. ([#2029])
557
+
- Removed the `<x-hyde::docs.search-input />` and `<x-hyde::docs.search-scripts />` Blade components, replaced by `<x-hyde::docs.hyde-search />`. ([#2029])
558
+
- Removed the `.torchlight-enabled` CSS class. ([#2036])
559
+
- Removed the `MarkdownService::withPermalinks` and `MarkdownService::canEnablePermalinks` methods. ([#2047])
560
+
561
+
562
+
### Blade-based table of contents generator
563
+
564
+
The way we generate table of contents for documentation pages have been changed from a helper method to a Blade component.
565
+
566
+
This new system is much easier to customize and style, and is up to 40 times faster than the old system.
567
+
568
+
See https://github.com/hydephp/develop/pull/2045 for more information.
569
+
570
+
#### Scope
571
+
572
+
The likelihood of impact is low, but if any of the following are true, you may need to update your code:
573
+
574
+
- If you have used the `Hyde\Framework\Actions\GeneratesTableOfContents` class in custom code, you will likely need to update that code for the rewritten class.
575
+
- If you have published the `resources/views/components/docs/sidebar-item.blade.php` component, you will need to update it to call the new component instead of the old generator rendering.
576
+
- If you have called the now removed `getTableOfContents` method of the `DocumentationPage` class in custom code, you will need to update that usage as to possibly call the new Blade component directly, depending on your use case.
577
+
- If you have called the now removed `hasTableOfContents` method of the `DocumentationPage` class in custom code you will need to replace the method call with `Config::getBool('docs.sidebar.table_of_contents.enabled', true)`
578
+
579
+
#### Changes
580
+
- Adds a new `resources/views/components/docs/table-of-contents.blade.php` component containing the structure and styles for the table of contents
581
+
- Rewrites the `GeneratesTableOfContents` class to use a custom implementation instead of using CommonMark
582
+
- The `execute` method of the `GeneratesTableOfContents` class now returns an array of data, instead of a string of HTML. This data should be fed into the new component
583
+
- Removed the `table-of-contents.css` file as styles are now made using Tailwind
584
+
- Removed the `heading-permalinks.css` file as styles are now made using Tailwind
585
+
- Removed the `blockquotes.css` file as styles are now made using Tailwind
586
+
467
587
## New features
468
588
469
589
<!-- Editors note: Todo: Maybe move to the relevant docs... -->
0 commit comments