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

[2.x] New asset system #2006

Merged
merged 512 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
512 commits
Select commit Hold shift + click to select a range
713cdc4
Only render items when there are any
caendesilva Dec 1, 2024
72a5e1e
Update tests to expect the hash span
caendesilva Dec 1, 2024
21e9d64
Fix formatting
caendesilva Dec 1, 2024
0a1d2e1
Refactor to closer match existing styles
caendesilva Dec 1, 2024
12dc804
Refactor to closer match old styles
caendesilva Dec 1, 2024
9ef45dc
Update test for changed classes
caendesilva Dec 1, 2024
ccd2942
Update RELEASE_NOTES.md
caendesilva Dec 1, 2024
030cfd8
Update documentation for new table of contents system
caendesilva Dec 1, 2024
c76a52c
Cleanup code
caendesilva Dec 1, 2024
2fc56e5
Refactor to break up complex method
caendesilva Dec 1, 2024
90d8efa
Invert condition to merge up control flow
caendesilva Dec 1, 2024
1c13043
Merge pull request #2045 from hydephp/blade-table-of-contents-system
caendesilva Dec 1, 2024
6df1b80
Refactor to break up complex method
caendesilva Dec 1, 2024
73c71ca
Break out unnecessary else prefix
caendesilva Dec 1, 2024
deaebf0
Add spacing
caendesilva Dec 1, 2024
3328e41
Annotate generics and shapes of the arrays
caendesilva Dec 1, 2024
a2c420d
Fix formatting
caendesilva Dec 1, 2024
ff5ffef
Merge branch 'new-asset-system' into blade-table-of-contents-system
caendesilva Dec 1, 2024
166a551
Merge pull request #2046 from hydephp/blade-table-of-contents-system
caendesilva Dec 1, 2024
aff4388
Create HeadingRenderer.php
caendesilva Dec 1, 2024
ed7f281
Create markdown-heading.blade.php
caendesilva Dec 1, 2024
7e45297
Render slot literally
caendesilva Dec 1, 2024
5607c6d
Indent code
caendesilva Dec 1, 2024
ec6b2c6
Add an attribute for controlling permalink state
caendesilva Dec 1, 2024
98ddab1
Set state from class
caendesilva Dec 1, 2024
e1ccda8
Fix recursion issue
caendesilva Dec 1, 2024
24e459f
Support extra attributes
caendesilva Dec 1, 2024
2c3e07b
Forward node attributes
caendesilva Dec 1, 2024
6631d86
Format props
caendesilva Dec 1, 2024
07d5e97
Update added config setting
caendesilva Dec 1, 2024
c430b9b
Apply fixes from StyleCI
StyleCIBot Dec 1, 2024
b0a4ef9
Register the custom heading renderer
caendesilva Dec 1, 2024
87f03f7
Extract helper method
caendesilva Dec 1, 2024
585764d
Create heading permalinks configuration
caendesilva Dec 1, 2024
bfc93e3
Better option name
caendesilva Dec 1, 2024
cb6c70e
Construct with page class
caendesilva Dec 1, 2024
94cada0
Add permalinks only for configured pages
caendesilva Dec 1, 2024
bcf5cdd
Format long line
caendesilva Dec 1, 2024
22d30c5
Nullable class string
caendesilva Dec 1, 2024
6fbb656
Remove auto-configuration for HeadingPermalinkExtension
caendesilva Dec 1, 2024
b7f0509
Change component to match markup made by extension
caendesilva Dec 1, 2024
539a8eb
Use more explicit assertions
caendesilva Dec 1, 2024
53b158f
Make the permalink headings level configurable
caendesilva Dec 1, 2024
bb9fd0a
Default to minimum level of 2
caendesilva Dec 1, 2024
d8896ad
Introduce local variable
caendesilva Dec 1, 2024
2c53963
Post process to normalize result to CommonMark implementation
caendesilva Dec 1, 2024
358c799
Replace multiple replacements with single Regex
caendesilva Dec 1, 2024
cc8cc6d
Add a test for when heading permalinks are disabled
caendesilva Dec 1, 2024
2475010
Sync configuration files
caendesilva Dec 1, 2024
30469f4
Mock the View factory
caendesilva Dec 1, 2024
a6bcaa1
Fix mock bindings
caendesilva Dec 1, 2024
567b505
Granular mocks
caendesilva Dec 1, 2024
22a7745
Update test to test the automatic permalinks feature
caendesilva Dec 1, 2024
1100719
Remove the `MarkdownService::withPermalinks` method
caendesilva Dec 1, 2024
d03dbf3
Add todo
caendesilva Dec 1, 2024
9311bd1
Create HeadingRendererUnitTest.php
caendesilva Dec 1, 2024
80ed9d4
Create MarkdownHeadingRendererTest.php
caendesilva Dec 1, 2024
5e243e7
Create a minimal view environment
caendesilva Dec 1, 2024
c7eb6bb
Register finder path
caendesilva Dec 1, 2024
bad9eb3
Create and configure the engine resolver
caendesilva Dec 1, 2024
fd6df97
Extract helper method
caendesilva Dec 1, 2024
4995016
Basic constructor tests
caendesilva Dec 1, 2024
a13f1e8
Cleanup helper method code
caendesilva Dec 1, 2024
0d08cc5
Helper to mock child node renderer
caendesilva Dec 1, 2024
6dc0095
Improve formatting
caendesilva Dec 1, 2024
a6b26be
Set default value
caendesilva Dec 1, 2024
598d9c9
Implement initial unit test
caendesilva Dec 1, 2024
5b00e79
Test can add permalink based on configuration
caendesilva Dec 1, 2024
bc876e8
Refactor to data provider attribute
caendesilva Dec 1, 2024
10e905a
Clean up after test
caendesilva Dec 1, 2024
703e70c
Automatically reset to cached config default
caendesilva Dec 1, 2024
039c11a
More extensive range testing
caendesilva Dec 1, 2024
3a709dd
Revert "More extensive range testing"
caendesilva Dec 1, 2024
496260c
Make protected helper methods public internal
caendesilva Dec 1, 2024
90ff929
Remove tests for later refactor
caendesilva Dec 1, 2024
0382947
Cleaner and extended testing
caendesilva Dec 1, 2024
240e3dd
Test more code paths
caendesilva Dec 2, 2024
bbd5a0b
Clarify test name
caendesilva Dec 2, 2024
1195704
Apply fixes from StyleCI
StyleCIBot Dec 2, 2024
65cc1ff
Unit test the post processing
caendesilva Dec 2, 2024
2dd5c32
Clarify test name to specify the reason behind it
caendesilva Dec 2, 2024
b1b6266
Add extra test case
caendesilva Dec 2, 2024
2f31b9b
Apply fixes from StyleCI
StyleCIBot Dec 2, 2024
3c3661a
Clean up test code to remove focus from implementation details
caendesilva Dec 2, 2024
b00ea06
Implement the high level feature test
caendesilva Dec 2, 2024
a7b52d6
Add some more assertions
caendesilva Dec 2, 2024
e67a640
Assert on the full output when relevant
caendesilva Dec 2, 2024
6fe5cb8
Expand feature testing
caendesilva Dec 2, 2024
3c285a7
Add todo
caendesilva Dec 2, 2024
43d82a4
Test escaping
caendesilva Dec 2, 2024
4e80297
Document custom Markdown heading renderer
caendesilva Dec 3, 2024
f53eb4d
Remove the enabled key from the permalinks configuration
caendesilva Dec 3, 2024
ce21d66
Remove the unused `canEnablePermalinks` from `MarkdownService`
caendesilva Dec 3, 2024
3d3ed48
Improve the test
caendesilva Dec 3, 2024
7f79bee
Update RELEASE_NOTES.md
caendesilva Dec 4, 2024
0710e95
More semantic Markdown heading permalinks
caendesilva Dec 4, 2024
8737a52
Conditionally add element identifier
caendesilva Dec 4, 2024
04aa325
Remove support for custom identifier when it breaks permalinks
caendesilva Dec 4, 2024
e7be152
Expect semantic heading identifiers
caendesilva Dec 4, 2024
3c66d44
Refactor to use Tailwind permalink styles
caendesilva Dec 4, 2024
5f90cbc
Tweak styles to match original behaviour
caendesilva Dec 4, 2024
af9f4fa
Update tests for semantic Markdown permalink headers
caendesilva Dec 4, 2024
1caa631
Add scroll margin to header
caendesilva Dec 5, 2024
9c49d46
Format long line
caendesilva Dec 5, 2024
7ebd17f
Merge pull request #2052 from hydephp/semantic-markdown-heading-perma…
caendesilva Dec 5, 2024
418044e
Merge attributes dynamically
caendesilva Dec 5, 2024
4fb8e57
Unwrap unnecessary unwrapping
caendesilva Dec 5, 2024
f9f9755
Trim empty class directives
caendesilva Dec 5, 2024
a36760b
Allow side effect of extra space for edge case
caendesilva Dec 5, 2024
c78ddeb
Inline local variable override
caendesilva Dec 5, 2024
3feddd3
Revert "Inline local variable override"
caendesilva Dec 5, 2024
0d9f3e8
Remove todo as it can be handled in Blade
caendesilva Dec 5, 2024
99e2d1e
Add internal heading registry
caendesilva Dec 5, 2024
7f40d01
Start duplicate suffixes at two
caendesilva Dec 5, 2024
c4e67ff
Add suffix to heading identifiers of the same name
caendesilva Dec 5, 2024
f0adee1
Update RELEASE_NOTES.md
caendesilva Dec 5, 2024
155c456
Add more test values to ensure proper count
caendesilva Dec 5, 2024
b959d2d
Cleanup and refactor code
caendesilva Dec 5, 2024
3df7aa2
Add array types
caendesilva Dec 5, 2024
62f5092
Merge pull request #2047 from hydephp/custom-markdown-heading-renderer
caendesilva Dec 5, 2024
def9236
Merge branch '2.x-dev' into new-asset-system
caendesilva Dec 6, 2024
4163532
Merge branch '2.x-dev' into new-asset-system
caendesilva Dec 6, 2024
fb4b4fb
Merge branch '2.x-dev' into new-asset-system
caendesilva Dec 6, 2024
1458c8b
Merge branch '2.x-dev' into new-asset-system
caendesilva Dec 6, 2024
1c6105a
Refactor colored Markdown blockquotes to be rendered using Blade
caendesilva Dec 6, 2024
b929f59
Test with real Blade compiler
caendesilva Dec 6, 2024
121d1dd
Add todo
caendesilva Dec 6, 2024
d357225
Update tests to expect formatted HTML
caendesilva Dec 6, 2024
c7971f1
Move unit test to unit testing namespace
caendesilva Dec 6, 2024
cc9096e
Fix code style
caendesilva Dec 6, 2024
10bb360
Test it resolves all shortcodes
caendesilva Dec 6, 2024
c640271
Try to fix crazed test
caendesilva Dec 6, 2024
9158152
Revert "Try to fix crazed test"
caendesilva Dec 6, 2024
18f8794
Create UsesRealBladeInUnitTests.php
caendesilva Dec 6, 2024
5936d0a
Extract trait for shared testing code
caendesilva Dec 6, 2024
b074735
Try to fix crazed test by default
caendesilva Dec 6, 2024
532ba0f
Update IncludesFacadeUnitTest.php
caendesilva Dec 6, 2024
cbc4152
Forget mocked instance
caendesilva Dec 6, 2024
7f566b8
Revert "Update IncludesFacadeUnitTest.php"
caendesilva Dec 6, 2024
3840066
Revert "Try to fix crazed test by default"
caendesilva Dec 6, 2024
0b79974
Fix path for extracted method
caendesilva Dec 6, 2024
f2b1ef3
Use a partial mock to solve crazyness
caendesilva Dec 6, 2024
2b31bbb
Can now remove unrelated expectation
caendesilva Dec 6, 2024
fcf5efa
Update test for new implementation
caendesilva Dec 6, 2024
466a044
Dynamically set Tailwind blockquote colors in Blade
caendesilva Dec 6, 2024
f01590d
Update documentation for Blade Markdown blockquotes
caendesilva Dec 6, 2024
9731a8d
Update RELEASE_NOTES.md
caendesilva Dec 6, 2024
339f476
Merge pull request #2056 from hydephp/blade-based-colored-markdown-bl…
caendesilva Dec 6, 2024
7fa8492
Merge branch '2.x-dev' into new-asset-system
caendesilva Dec 6, 2024
2312b88
Document supported version for HydeFront v4
caendesilva Dec 7, 2024
3cc57cb
Document file scope
caendesilva Dec 7, 2024
cc532cc
Extract helper for making the identifier
caendesilva Dec 7, 2024
302168b
Make protected helper public internal
caendesilva Dec 7, 2024
e2a63d5
Use the same identifier generation method everywhere
caendesilva Dec 7, 2024
3f48395
Test needs kernel in isolate
caendesilva Dec 7, 2024
c4e9e05
Add unit test
caendesilva Dec 7, 2024
9784937
Refactor to use dataprovider attribute
caendesilva Dec 7, 2024
be846bf
Revert "Refactor to use dataprovider attribute"
caendesilva Dec 7, 2024
7b2a9c7
Refactor to use dataprovider
caendesilva Dec 7, 2024
d36d8a9
Add some fixtures for common real headings
caendesilva Dec 7, 2024
416338e
Add some fixtures for some edge cases
caendesilva Dec 7, 2024
94577e6
Grouped and improved fixtures
caendesilva Dec 7, 2024
0f2e322
Transliterate heading identifiers
caendesilva Dec 7, 2024
fb9f652
Add additional fixture
caendesilva Dec 7, 2024
25e0a01
Inline default dictionary value
caendesilva Dec 7, 2024
5881e13
Expand ampersands
caendesilva Dec 7, 2024
316023d
Strip escaped angle brackets
caendesilva Dec 7, 2024
fe6864b
Fix typo
caendesilva Dec 7, 2024
19a63ff
Fix faulty expectation
caendesilva Dec 7, 2024
3b7894f
Fix transliterated value
caendesilva Dec 7, 2024
b6bf449
Test heading identifier generation with escaped input
caendesilva Dec 7, 2024
d78add7
Ensure it works with escaped inputs
caendesilva Dec 7, 2024
c240c15
Join comma-separated values into a single line
caendesilva Dec 7, 2024
50f89f8
Cleanup code
caendesilva Dec 7, 2024
0a6bbfa
Merge pull request #2059 from hydephp/normalize-markdown-heading-iden…
caendesilva Dec 7, 2024
2f34586
Release notes for new asset system
caendesilva Dec 8, 2024
5e0ebed
Revert "Temporarily enable end to end testing for all branches"
caendesilva Dec 8, 2024
1a261e2
Todo comments for changes after merge
caendesilva Dec 8, 2024
748664d
Remove unnecessary comment
caendesilva Dec 8, 2024
df47004
Unwrap function call
caendesilva Dec 8, 2024
f0029d1
Extract helper method from code comment
caendesilva Dec 8, 2024
dece097
Add strict types declaration
caendesilva Dec 8, 2024
5e7c05c
Convert concatenation to a scalar values
caendesilva Dec 8, 2024
4f5d228
Replace qualifier with an import
caendesilva Dec 8, 2024
5e653a9
Add inverse test
caendesilva Dec 8, 2024
5508d35
Improve confidence of test
caendesilva Dec 8, 2024
079913d
Move up and improve test
caendesilva Dec 8, 2024
ecbf8bd
Extract helper methods
caendesilva Dec 8, 2024
029a0c6
Apply fixes from StyleCI
StyleCIBot Dec 8, 2024
aab895a
Add todo
caendesilva Dec 8, 2024
3501102
Annotate the array types
caendesilva Dec 8, 2024
0e94056
Extract helper methods
caendesilva Dec 8, 2024
7e0016b
Better document the Vite system
caendesilva Dec 8, 2024
30b0939
Swap section order
caendesilva Dec 8, 2024
a511976
Support all CSS extensions like Laravel Vite uses
caendesilva Dec 8, 2024
7230be5
Improve accuracy of test
caendesilva Dec 8, 2024
59979e3
Use else if instead of if
caendesilva Dec 8, 2024
06d9641
Revert "Use else if instead of if"
caendesilva Dec 8, 2024
da2ba15
Add more tests
caendesilva Dec 8, 2024
d5ec63d
Extract helper to format the asset path
caendesilva Dec 8, 2024
4bc0f52
Use static instead of self
caendesilva Dec 8, 2024
8af55ed
Add helper to get single asset
caendesilva Dec 8, 2024
fb3865c
Simplify test
caendesilva Dec 8, 2024
bf88379
Throw exception if the asset type is not supported
caendesilva Dec 8, 2024
b048fae
Use only hotfiles instead of internal environment variable
caendesilva Dec 8, 2024
9ffbeed
Extract constant for CSS extensions
caendesilva Dec 8, 2024
f418e2b
Support more JavaScript extensions
caendesilva Dec 8, 2024
83264ca
Extract helper method for repeated code
caendesilva Dec 8, 2024
efbb177
Merge pull request #2060 from hydephp/improve-the-vite-integration
caendesilva Dec 8, 2024
0878552
Remove section as there is only one component left
caendesilva Dec 8, 2024
a3ac13a
Document HydeSearch overloading
caendesilva Dec 8, 2024
c66e2f5
Extract helper methods
caendesilva Dec 8, 2024
2b30ef2
Use fluent sleep declaration
caendesilva Dec 8, 2024
e88c368
Make sure docs is up to date
caendesilva Dec 8, 2024
c831eea
Clean up formatting
caendesilva Dec 8, 2024
bf07112
Make Vite process nullable
caendesilva Dec 8, 2024
d1199d5
Use null safe operator
caendesilva Dec 8, 2024
35d1238
Move up option handler
caendesilva Dec 8, 2024
ba2c7c6
Inline variable
caendesilva Dec 8, 2024
96a00ea
Fix clunky wording
caendesilva Dec 8, 2024
08a9661
Expand on file documentation
caendesilva Dec 8, 2024
5110508
Add internal environment variable if we will use Vite
caendesilva Dec 8, 2024
e9881cb
Revert "Add internal environment variable if we will use Vite"
caendesilva Dec 8, 2024
d2793df
Add parameter if we will use Vite
caendesilva Dec 8, 2024
8d16f52
Mark the HeadingRenderer class as internal
caendesilva Dec 8, 2024
f3f5b08
Make variable name clearer
caendesilva Dec 8, 2024
830ddbf
Add component props
caendesilva Dec 8, 2024
8969c03
Consistent variable naming
caendesilva Dec 8, 2024
cd66953
Document reason for the heading registry
caendesilva Dec 8, 2024
a037ab1
Use consistent naming for heading identifiers
caendesilva Dec 8, 2024
9e62334
Invert ternary class logic
caendesilva Dec 8, 2024
6be9c9d
Refactor to class directive
caendesilva Dec 8, 2024
7d0d58b
Merge class directive rows into ternary expression
caendesilva Dec 8, 2024
b8bbf36
Fix typo
caendesilva Dec 8, 2024
1b5113d
Swap line order
caendesilva Dec 8, 2024
b04bff2
Improve formatting
caendesilva Dec 8, 2024
b195b2f
Breaking: Remove `DocumentationPage::hasTableOfContents` method
caendesilva Dec 8, 2024
17fa356
Slimmer formatting for single line annotations
caendesilva Dec 8, 2024
af9dd9e
Invert and merge control flow
caendesilva Dec 8, 2024
3f77d0c
Add spacing
caendesilva Dec 8, 2024
6487ee1
Clarify removal reason
caendesilva Dec 8, 2024
bae76b2
Remove parameter from `HydeFront::cdnLink()`
caendesilva Dec 8, 2024
11634c0
Remove deprecation
caendesilva Dec 8, 2024
0987ac0
Inline local variable
caendesilva Dec 8, 2024
57334a5
Clean up formatting
caendesilva Dec 8, 2024
801d9de
Extract methods from complex inner loop
caendesilva Dec 8, 2024
4fd21b6
Cleanup code
caendesilva Dec 8, 2024
b01e9ea
Add todo
caendesilva Dec 8, 2024
70a572b
Fix formatting
caendesilva Dec 8, 2024
b38248c
Merge branch '2.x-dev' into new-asset-system
caendesilva Dec 8, 2024
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
37 changes: 1 addition & 36 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,41 +109,6 @@ jobs:
run: php monorepo/scripts/tests/${{ matrix.script }}.php


build-hydefront-assets:

runs-on: ubuntu-latest
needs: run-smoke-tests

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: 'npm'

- name: Install Node.js dependencies
working-directory: 'packages/hydefront'
run: npm ci

- name: Build assets for production
working-directory: 'packages/hydefront'
run: npm run prod

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: 'hydefront'
path: 'packages/hydefront/dist'

- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
add: 'packages/hydefront/dist'
message: 'Compile HydeFront assets for production'
new_branch: compile-hydefront


build-tailwindcss:

runs-on: ubuntu-latest
Expand All @@ -164,7 +129,7 @@ jobs:
run: sed -i 's/\.\/vendor\/hyde\/framework\/resources\/views\/\*\*\/\*\.blade\.php/\.\/packages\/framework\/resources\/views\/\*\*\/\*\.blade\.php/' tailwind.config.js

- name: Build assets for production
run: npm run prod
run: npm run build

- name: Copy compiled app.css file to HydeFront dist folder
run: cp _media/app.css packages/hydefront/dist/app.css
Expand Down
120 changes: 120 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,16 @@ This serves two purposes:
- Added a `Feature::fromName()` enum helper in https://github.com/hydephp/develop/pull/1895
- Added environment variable support for saving previews in https://github.com/hydephp/develop/pull/1996
- Added support for specifying features in the YAML configuration in https://github.com/hydephp/develop/pull/1896
- Added Vite as a build tool in https://github.com/hydephp/develop/pull/2010
- **Added a new consolidated Asset API to better handle media files.**
- Added several new fluent methods to the `MediaFile` class, like `getLink()`, `getLength()`, `getMimeType()`, etc.
- Added new `HydeFront` facade to handle CDN links and Tailwind config injection.
- Added method `Asset::exists()` has to check if a media file exists.
- Added a `Hyde::assets()` method to get all media file instances in the site.
- Added new `npm run build` command for compiling frontend assets with Vite
- Added a Vite HMR support for the realtime compiler in https://github.com/hydephp/develop/pull/2016
- Added Vite facade in https://github.com/hydephp/develop/pull/2016
- Added a custom Blade-based heading renderer for Markdown conversions in https://github.com/hydephp/develop/pull/2047

### Changed

Expand Down Expand Up @@ -88,6 +93,21 @@ This serves two purposes:
- 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
- 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
- We now use the much faster `CRC32` hashing algorithm instead of `MD5` for cache busting keys in https://github.com/hydephp/develop/pull/1918
- **Replaced Laravel Mix with Vite for frontend asset compilation** in https://github.com/hydephp/develop/pull/2010
- **Breaking:** You must now use `npm run build` to compile your assets, instead of `npm run prod`
- 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
- 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
- **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
- 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
- Ported the HydeSearch plugin used for the documentation search to be an Alpine.js implementation in https://github.com/hydephp/develop/pull/2029
- Renamed Blade component `hyde::components.docs.search-widget` to `hyde::components.docs.search-modal` in https://github.com/hydephp/develop/pull/2029
- Added support for customizing the search implementation by creating a `resources/js/HydeSearch.js` file in https://github.com/hydephp/develop/pull/2031
- 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.
- Extracted CSS component partials in HydeFront in https://github.com/hydephp/develop/pull/2038
- Replaced HydeFront styles with Tailwind in https://github.com/hydephp/develop/pull/2024
- Markdown headings are now compiled using our custom Blade-based heading renderer in https://github.com/hydephp/develop/pull/2047
- The `id` attributes for heading permalinks have been moved from the anchor to the heading element in https://github.com/hydephp/develop/pull/2052
- 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

### Deprecated

Expand All @@ -97,6 +117,8 @@ This serves two purposes:

- Breaking: Removed the build task `\Hyde\Framework\Actions\PostBuildTasks\GenerateSearch` (see upgrade guide below)
- Breaking: Removed the deprecated `\Hyde\Framework\Services\BuildService::transferMediaAssets()` method (see upgrade guide below)
- 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
- Breaking: Removed the `DocumentationPage::hasTableOfContents()` method as it is now unused by the framework in https://github.com/hydephp/develop/pull/2006
- Removed the deprecated global `unslash()` function, replaced with the namespaced `\Hyde\unslash()` function in https://github.com/hydephp/develop/pull/1754
- 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
- Removed: The deprecated `PostAuthor::getName()` method is now removed (use `$author->name`) in https://github.com/hydephp/develop/pull/1782
Expand All @@ -109,15 +131,37 @@ This serves two purposes:
- Removed `Hyde::mediaLink()` method replaced by `Hyde::asset()` in https://github.com/hydephp/develop/pull/1932
- Removed `Hyde::mediaPath()` method replaced by `MediaFile::sourcePath()` in https://github.com/hydephp/develop/pull/1911
- Removed `Hyde::siteMediaPath()` method replaced by `MediaFile::outputPath()` in https://github.com/hydephp/develop/pull/1911
- Removed Laravel Mix as a dependency in https://github.com/hydephp/develop/pull/2010 (replaced with Vite)
- **Breaking:** Removed `npm run prod` command (replaced with `npm run build`)
- Removed CDN include for the HydeSearch plugin replaced by Alpine.js implementation in https://github.com/hydephp/develop/pull/2029
- 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.
- Removed the `.torchlight-enabled` CSS class in https://github.com/hydephp/develop/pull/2036.
- 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.
- Removed the `MarkdownService::withPermalinks` method in https://github.com/hydephp/develop/pull/2047
- Removed the `MarkdownService::canEnablePermalinks` method in https://github.com/hydephp/develop/pull/2047

### Fixed

- Added missing collection key types in Hyde facade method annotations in https://github.com/hydephp/develop/pull/1784
- The `app.js` file will now only be compiled if it has scripts in https://github.com/hydephp/develop/pull/2028

### Security

- in case of vulnerabilities.

### Package updates

#### Realtime Compiler

- Simplified the asset file locator to only serve files from the media source directory in https://github.com/hydephp/develop/pull/2012
- Added Vite HMR support in https://github.com/hydephp/develop/pull/2016

#### HydeFront

- Removed all Sass styles after porting everything to Tailwind in https://github.com/hydephp/develop/pull/2024
- 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
- Extracted CSS component partials in https://github.com/hydephp/develop/pull/2038

### Upgrade Guide

Please see the "Breaking changes & upgrade guide" section below for more information.
Expand Down Expand Up @@ -464,6 +508,82 @@ Hyperlinks::isRemote($source);

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.

## New Asset System

### Abstract

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.

### Enhancements

- **Replaced Laravel Mix with Vite for frontend asset compilation.** ([#2010], [#2011], [#2012], [#2013], [#2016], [#2021])
- Bundled assets are now compiled directly into the `_media` folder.
- The realtime compiler now only serves assets from the media source directory (`_media`).
- Added a new `npm run build` command for compiling frontend assets with Vite.
- Added Vite facade for Blade templates.
- Added Vite Hot Module Replacement (HMR) support to the realtime compiler.
- Build command now uses Vite to compile assets when the `--run-vite` flag is passed.

- **Improved HydeFront integration.** ([#2024], [#2029], [#2031], [#2036], [#2037], [#2038], [#2039])
- HydeFront styles are now refactored into Tailwind.
- HydeFront now acts as a component library with granular Tailwind styles in `app.css`.
- HydeSearch plugin ported to Alpine.js, improving performance and customizability.
- Normalized Tailwind Typography Prose code block styles to match Torchlight.
- Extracted CSS component partials in HydeFront.
- Removed `hyde.css` from HydeFront, as all styles are now included in `app.css`.

- **Implemented a custom Blade-based heading renderer for Markdown.** ([#2047], [#2052])
- Improves permalink handling and customization options.
- `id` attributes for heading permalinks have been moved from the anchor to the heading element.
- **Colored Markdown blockquotes are now rendered using Blade and Tailwind CSS.** ([#2056])
- The `app.js` file will now only be compiled if it has scripts. ([#2028])


### Breaking Changes

- Replaced Laravel Mix with Vite. ([#2010])
- You must now use `npm run build` to compile your assets, instead of `npm run prod`.
- Removed `--run-dev` and `--run-prod` build command flags, replaced by `--run-vite`. ([#2013])
- Removed `DocumentationPage::getTableOfContents()` method. Table of contents are now generated using a Blade component. ([#2045])
- Removed `hyde.css` from HydeFront, requiring recompilation of assets if you were extending it. ([#2037])
- Changed how HydeFront is included in projects. Instead of separate `hyde.css` and `app.css`, all styles are now in `app.css`. ([#2024])


### Removals

- Removed Laravel Mix as a dependency. ([#2010])
- Removed `npm run prod` command. ([#2010])
- Removed CDN include for HydeSearch plugin. ([#2029])
- Removed the `<x-hyde::docs.search-input />` and `<x-hyde::docs.search-scripts />` Blade components, replaced by `<x-hyde::docs.hyde-search />`. ([#2029])
- Removed the `.torchlight-enabled` CSS class. ([#2036])
- Removed the `MarkdownService::withPermalinks` and `MarkdownService::canEnablePermalinks` methods. ([#2047])


### Blade-based table of contents generator

The way we generate table of contents for documentation pages have been changed from a helper method to a Blade component.

This new system is much easier to customize and style, and is up to 40 times faster than the old system.

See https://github.com/hydephp/develop/pull/2045 for more information.

#### Scope

The likelihood of impact is low, but if any of the following are true, you may need to update your code:

- 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.
- 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.
- 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.
- 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)`

#### Changes
- Adds a new `resources/views/components/docs/table-of-contents.blade.php` component containing the structure and styles for the table of contents
- Rewrites the `GeneratesTableOfContents` class to use a custom implementation instead of using CommonMark
- 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
- Removed the `table-of-contents.css` file as styles are now made using Tailwind
- Removed the `heading-permalinks.css` file as styles are now made using Tailwind
- Removed the `blockquotes.css` file as styles are now made using Tailwind

## New features

<!-- Editors note: Todo: Maybe move to the relevant docs... -->
Expand Down
1 change: 1 addition & 0 deletions _ide_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class Asset extends \Hyde\Facades\Asset {}
class Author extends \Hyde\Facades\Author {}
class Features extends \Hyde\Facades\Features {}
class Config extends \Hyde\Facades\Config {}
class Vite extends \Hyde\Facades\Vite {}
/** @mixin \Illuminate\Filesystem\Filesystem */
class Filesystem extends \Hyde\Facades\Filesystem {}
class DataCollection extends \Hyde\Support\DataCollection {}
Expand Down
Loading
Loading