Releases: hydephp/develop
v0.60.0-beta - 2022-08-12
About
This release continues refactoring the internal codebase. As part of this, a large part of deprecated code has been removed and the package has been updated accordingly.
Added
- Added
getRouteKey
method toPageContract
andAbstractPage
Changed
- Blog posts now have the same open graph title format as other pages
- Merged deprecated method
getRoutesForModel
intogetRoutes
inRouteCollection
- Cleans up and refactors
GeneratesDocumentationSearchIndexFile
, and marks it as internal - Changed MarkdownFileParser to expect that the supplied filepath is relative to the root of the project (this may break method calls where an absolute path is supplied, see upgrade guide)
- internal: Inline deprecated internal method usage
getOutputPath
replacing itHyde::pages()
helper with inHydeRebuildStaticSiteCommand
Removed
- Removed class
RoutingService
as it is no longer used - Removed deprecated legacy class
Compiler
from the Hyde Realtime Compiler - Removed deprecated interface
RoutingServiceContract
(deprecated in v0.59) - Removed deprecated method
stylePath
fromAssetService
(deprecated in v0.50) - Removed deprecated method
getHomeLink
fromNavigationMenu
(deprecated in v0.50) - Removed deprecated method
parseFile
fromMarkdownDocument
(deprecated in v0.56) - Removed deprecated method
getPostDescription
fromMarkdownPost
(deprecated in v0.58) - Removed deprecated method
getCanonicalLink
fromMarkdownPost
(deprecated in v0.58) - Removed deprecated method
getInstance
fromRoutingService
(deprecated in v0.59) - Removed deprecated method
getRoutesForModel
fromRouteCollection
- Removed deprecated method
getOutputPath
fromHydeRebuildStaticSiteCommand
- Removed deprecated property
$body
fromMarkdownDocument
- internal: Remove deprecated testing helper functions
backup
andrestore
Fixed
- MarkdownFileParser not using the Hyde path #399
- Undefined variable $currentRoute in search.html #421
- Fixes issues in the documentation
search.json
andsearch.html
when using custom output directories
Upgrade Guide
MarkdownFileParser path change
This class now expects the supplied filepath to be relative to the root of the project. This will only affect you if you have written any custom code that uses this class. All internal Hyde code is already updated to use the new path format.
To upgrade, change any calls you may have like follows:
-return (new MarkdownFileParser(Hyde::path('_posts/foo.md')))->get();
+return (new MarkdownFileParser('_posts/foo.md'))->get();
What's Changed
- Code quality improvements by @caendesilva in #413
- Fix static analysis issues by @caendesilva in #414
- Remove deprecated legacy Compiler class from the Hyde Realtime Compiler by @caendesilva in #415
- Remove deprecated code by @caendesilva in #417
- Clean up GeneratesDocumentationSearchIndexFile by @caendesilva in #418
- Fix #399: MarkdownFileParser not using the Hyde path by @caendesilva in #419
- Fixes issues in the documentation
search.json
andsearch.html
when using custom output directories by @caendesilva in #420 - Fix undefined variable $currentRoute in search.html by @caendesilva in #422
Full Changelog: v0.59.0-beta...v0.60.0-beta
v0.59.0-beta - 2022-08-11
About
This release refactors the internal routing system. Unless you have written custom code that directly uses these classes and methods, updating should be fairly smooth. If not, you may want to read through the following overview.
The route index has been decoupled from page index and is split into two new collection classes, PageCollection and RouteCollection. The PageCollection contains all the site's parsed pages, and the RouteCollection contains all the page routes.
The RoutingService class remains for compatibility with existing code, but now only forwards calls to the new RouteCollection. The RoutingServiceContract interface is now deprecated.
Added
- Adds a new RouteCollection class
- Adds a new PageCollection class
- Adds a $routeKey property to the AbstractPage class
- The page and route collections are now stored as properties of the HydeKernel
- Adds an option to the
Hyde::image()
helper to request the returned image path use the configured base URL if it's set - Adds a new
save()
method to Markdown-based pages, to save the page object to the filesystem - Added new internal helpers to improve serialization of object models
Changed
- breaking: Navigation menu priorities now use route keys instead of slugs, see upgrade notes below
- Removed constructor from RoutingServiceContract interface
- Refactored RoutingService to use the new RouteCollection class
- AbstractPage::all() now returns a PageCollection, and includes the source file path as the array key
- Improved ConvertsArrayToFrontMatter action, which now supports nested arrays
- An exception is now thrown when attempting to get the path to an Image without a defined source path or URI
- internal: The HydeKernel is now stored as a singleton within the kernel class, instead of the service container
- internal: Refactor commands with shared code to extend new abstract base class
- internal: A large part of the codebase has been refactored and cleaned up while making an effort to maintain compatibility with existing code
Deprecated
- Deprecated interface RoutingServiceContract
- Deprecated RoutingServiceContract::getInstance()
Removed
- Removed all non public-contract methods from RoutingService
Fixed
- Fix #383: Navigation menu titles can't be set in BladeMatter
- Fix #385:
DocumentationPage::home()
did not work for custom documentation page output directories - Fix #386: Documentation page sidebar labels were not constructed from front matter
- Fix bugs relating to the documentation sidebar labels that appeared in the last release
- Fix #410: Search index generator breaks when storing documentation page source files in subdirectories
Upgrade notes
Route keys are now used in navigation config
Prior to this release, the navigation menu priorities were based on the page slug. This has been changed to the route key. A route key in Hyde is in short the compiled page's path, relative to the site's root. For example, _site/foo/bar.html
has the route key foo/bar
.
This change is breaking as the order of navigation items may be changed unless the configuration is updated. However, this is really easy. Just change docs
to docs/index
in the config/hyde.php
file.
'navigation' => [
'order' => [
'index' => 0,
'posts' => 10,
- 'docs' => 100,
+ 'docs/index' => 100,
],
],
If you have used the config to hide the documentation page from the navigation menu, you also need to use the route key by changing 'exclude' => ['docs']
to 'exclude' => ['docs/index']
.
The same goes if you have used the config to change the navigation titles for the home and documentation pages.
What's Changed
- Fix #383: Navigation menu titles can't be set in BladeMatter by @caendesilva in #384
- Fix bug where DocumentationPage::home() did not work when the documentation page output directory is customized by @caendesilva in #385
- Add missing constructor for documentation page sidebar labels by @caendesilva in #387
- Change documentation page label fallback to previous behaviour by @caendesilva in #389
- Change browser test image fixture to more reliable host by @caendesilva in #390
- Add option to Hyde::image() helper to prefer full URI paths by @caendesilva in #394
- Refactor internal routing structure to decouple page index from route index by @caendesilva in #395
- Improve ConvertsArrayToFrontMatter action by @caendesilva in #396
- Add helper to save Markdown-based page models to disk by @caendesilva in #397
- Improve model serializations by @caendesilva in #398
- Bring out the HydeKernel singleton from the service container by @caendesilva in #400
- Code quality improvements by @caendesilva in #401
- Improve types by @caendesilva in #403
- Throw exception instead of returning null when attempting to get source for Image without source by @caendesilva in #406
- Code quality improvements by @caendesilva in #405
- Move shared command logic to base action command class by @caendesilva in #407
- Reduce complexity by using route keys to get navigation menu priorities from config by @caendesilva in #409
- Code quality improvements by @caendesilva in #408
- Fix #410: Search index generator breaks when storing documentation page source files in subdirectories by @caendesilva in #412
Full Changelog: v0.58.0-beta...v0.59.0-beta
v0.58.0-beta - 2022-08-08
About
This update contains breaking changes to the internal API regarding page models. This should only affect you directly if you've written any code that interacts with the internal page models, such as constructing them using non-built-in Hyde helpers.
The update makes large changes to how dynamic data is constructed. Instead of generating page data at runtime, now the data is generated when constructing a page object. This gives the major benefit of being able to see all dynamic data right away, without having to render the page.
The way metadata tags are handled internally is also refactored. The rendered result should not be affected.
Added
- Added
compile()
method toFacades\Markdown
, replacing theparse()
method of the same class - Adds new actions to handle complex dynamic constructors
- Adds new front matter schema traits to define the public API for front matter and hold their data
- Adds new Meta::link() helper to create
<link>
tags - Adds new Meta::get() helper to get the metadata array
- Adds a new system for creating and storing page metadata
- Adds several new metadata model classes
Changed
- Breaking: Rename AbstractMarkdownPage constructor parameter
slug
toidentifier
- Breaking: Rename AbstractPage property
slug
toidentifier
- Breaking: Change
AbstractMarkdownPage
constructor argument positions, puttingidentifier
first - Breaking: Splits Markdown data from MarkdownDocument into new Markdown model class
- Breaking: The default
config/hyde.php
file now usesModels\Author
instead ofHelpers\Author
- Major: Restructure internal page data to use new front matter schema traits
- Begin changing references to slugs to identifiers, see motivation below
- Makes some helpers in SourceFileParser public static allowing them to be used outside the class
- Page metadata is now stored as a page property, making it easier to see and understand
- Page metadata is now generated at compile time instead of build time
- Page metadata types are now strongly typed, however all types are String able, so end usage is not affected
Deprecated
- Deprecated
Facades\Markdown::parse()
, useFacades\Markdown::render()
instead - Deprecated
Facades\Markdown.php
, will be merged intoModels\Markdown.php
Removed
- Removed
Facades\Markdown.php
, merged intoModels\Markdown.php
- Removed
body()
method fromMarkdownDocumentContract
interface and all its implementations. Usemarkdown()->body()
(or cast to string) instead - Removed
body
property from Markdown pages. Usemarkdown()->body()
(or cast to string) instead - Removed deprecated
Helpers\Author
(fully merged intoModels\Author
, simply swap namespace to upgrade) - Removed metadata constructor helpers from the MarkdownPost class as it is now handled in the new metadata class
- Several internal single-use helper traits have been merged into their respective classes
Fixed
- Fix Path property in Image model should be relative to media directory #359
- Fix Add toString method to Image model to get the link #370
- Fix Blog post OpenGraph images must be resolved relatively #374
- Fix PageContract needs compile method #366
Upgrade guide and extra information
Rename slugs to identifiers
Previously internally called slug(s)
, are now called identifier(s)
. In all honestly, this has 90% to do with the fact that I hate the word "slug".
I considered using basename
as an alternative, but that does not fit with nested pages. Here instead is the definition of an identifier
in the context of HydePHP:
An identifier is a string that is in essence everything in the filepath between the source directory and the file extension.
So, for example, a page source file stored as _pages/foo/bar.md
would have the identifier foo/bar
. Each page type can only have one identifier of the same name.
But since you could have a file with the same identifier in the _posts
directory, we internally always need to specify what source model we are using.
The identifier property is closely related to the page model's route key property, which consists of the site output directory followed by the identifier.
Heavily refactor constructors of Markdown-based page models
Adds a new interface to the Markdown page model constructors, that expects instantiated FrontMatter and MarkdownDocument objects. Normally you would use the SourceFileParser to create the object.
This means that the constructor for all Markdown-based pages is completely changed. To use a format matching the old behaviour, you can use the MarkdownPageModel::make
method.
Title property has been removed from page model constructors
The following syntax has been removed: new MarkdownPage(title: 'Foo Bar')
Instead, you can add it with front matter: MarkdownPage::make(matter: ['title' => 'Foo Bar'])
Markdown pages now have front matter in an object instead of array
This means that instead of the following $post->matter['title']
, you would use $post->matter('title')
, which allows you to add a fallback like so: $post->matter('title', 'Untitled')
Author helper has been merged into the model
The deprecated Helpers\Author
has been fully merged into Models\Author
. Simply swap namespaces to upgrade.
-use Hyde\Framework\Helpers\Author;
+use Hyde\Framework\Models\Author;
What's Changed
- Breaking: Begin internal rename of slugs to identifiers by @caendesilva in #328
- Breaking: Reorder AbstractMarkdownPage constructor argument positions, putting the identifier first by @caendesilva in #329
- Make file parser helpers public by @caendesilva in #330
- Improve types for helpers added in #330 by @caendesilva in #331
- Replace Markdown::parse() with Markdown::render() by @caendesilva in #332
- Breaking refactor of Markdown based models by @caendesilva in #321
- Merge Markdown facade into model by @caendesilva in #333
- Minor Markdown models and usage updates by @caendesilva in #334
- Remove body() method from Markdown pages by @caendesilva in #335
- Update page properties by @caendesilva in #336
- Create constructor action by @caendesilva in #337
- Remove
body
property from Markdown by @caendesilva in #338 - Add magic __get method to Markdown pages to get data from front matter by @caendesilva in #339
- Don't run visual regression testing on pull request drafts by @caendesilva in #340
- Implement Stringable interface in classes using toString magic method by @caendesilva in #342
- Add magic __set method to Markdown pages to set data in front matter by @caendesilva in #343
- Add front matter support to Blade pages by @caendesilva in #346
- Create static array parser by @caendesilva in #348
- Add missing parent constructor call by @caendesilva in #349
- Inline single-use traits by @caendesilva in #350
- Merge deprecated Author helper into Author model by @caendesilva in #352
- Change internal page data structure to use new front matter schema traits by @caendesilva in #351
- Add more front matter schema traits and refactor page data structures by @caendesilva in #355
- Restructure docs to use automatic subdirectory-based categories by @caendesilva in #360
- Add getIdentifier() method to PageContract and AbstractPage by @caendesilva in #361
- Clean up SourceFileParser class by @caendesilva in #362
- Minor code cleanups and fixes by @caendesilva in #363
- Refactor page metadata to use front matter schemas by @caendesilva in #365
- Create method to construct schemas to control the call order by @caendesilva in #368
- Merge master into PR branch by @caendesilva in #369
- Add test to ensure pre-computed relative links are retained when rendering new pages by @caendesilva in #372
- Consistently use image paths relative to _media directory as described in the documentation by @caendesilva in #375
- Add page parser benchmarks by @caendesilva in #377
- Refactor metadata system by @caendesilva in #367
- Fix #366 PageContract needs compile method by @caendesilva in #379
- Fix #378: Use function empty() instead of expression by @caendesilva in #380
- Add a default category property value for documentation pages by @caendesilva in #381
...
v0.57.0-beta - 2022-08-03
About
This update refactors the internal page source model parsing. This will likely not affect you directly, however, if you have written custom code that interacts with any class relating to the PageParser contract, you'll want to take a closer look at the changes.
Added
- Added a new static shorthand to quickly parse Markdown files into MarkdownDocuments (
MarkdownFileParser::parse()
) - Added
toArray()
method to MarkdownDocuments, which returns an array of all the body lines
Changed
- All source model parsing is now handled by the new SourceFileParser action
- Blog post front matter no longer includes merged slug
- MarkdownDocument now implements the
Arrayable
interface - Markdown page models no longer includes the slug merged into the front matter
- All Markdown page models now have the title property inferred when parsing
- internal: The DocumentationPage slug now behaves like other pages, and the basename is produced at runtime, see below
- internal: Refactor search index generator to use route system
Deprecated
- Deprecated
MarkdownDocument::parseFile()
, will be renamed toMarkdownDocument::parse()
Removed
- The PageParserContract interface, and all of its implementations have been removed
- Removed
$localPath
property from DocumentationPage class, see above - Removed trait HasDynamicTitle
What's Changed
- Merge page parsers into single action by @caendesilva in #322
- Remove DocumentationPage localPath property by @caendesilva in #324
- Simplify page parsers by @caendesilva in #323
- Implement Arrayable interface in MarkdownDocument by @caendesilva in #326
- Refactor search index generator to use route system by @caendesilva in #327
- Handle complex parsing logic in new parser action by @caendesilva in #325
Full Changelog: v0.56.0-beta...v0.57.0-beta
v0.56.0-beta - 2022-08-03
About
This update makes changes to the internal Markdown services. If you have written code or integrations that uses any of these services, you may want to take a closer look. Otherwise, this should not affect you much.
Many Markdown related classes have been moved to a new namespace, and the classes themselves have been restructured. Again, this only affects those who in the past have used these classes outside of what Hyde normally provides.
Due to the nature of this refactor, where so much have been changed, not everything is documented here. See the attached pull request for the full Markdown change diff: #318
Added
- Added model FrontMatter.php
- Create MarkdownConverter.php
- Create MarkdownServiceProvider.php
- internal: Added Benchmarking framework
Changed
- Move
Markdown::hasTableOfContents()
toDocumentationPage::hasTableOfContents()
- Move most Markdown related classes into
Modules\Markdown
namespace - Rename MarkdownConverterService to MarkdownService
- Rename MarkdownFileService to MarkdownFileParser
- Replace CommonMarkConverter with Hyde MarkdownConverter
Removed
- Remove old MarkdownConverter action
- Delete HasMarkdownFeatures.php
What's Changed
- Add benchmark framework by @caendesilva in #319
- Refactor Markdown module by @caendesilva in #318
- Create front matter model by @caendesilva in #320
Full Changelog: v0.55.0-beta...v0.56.0-beta
v0.55.0-beta - 2022-08-01
About
This update removes the deprecated LegacyPageRouter class from the Hyde Realtime Compiler (HydeRC). Along with this release, the HydeRC is now on version 2.5, and requires Hyde version 0.48.0-beta or higher.
Changed
- hyde/hyde now requires HydeRC version 2.5 or higher.
- hyde/realtime-compiler no longer supports Framework versions older than v0.48.0-beta.
Removed
- Remove the deprecated LegacyPageRouter class from the HydeRC.
What's Changed
- Remove deprecated LegacyPageRouter from HydeRC by @caendesilva in #314
- Update HydeRC Composer structure by @caendesilva in #315
- Replace caret version constraint with unbound version constraint in HydeRC Composer by @caendesilva in #316
Full Changelog: v0.54.0-beta...v0.55.0-beta
v0.54.0-beta - 2022-08-01
About
This release refactors and cleans up a large part of the internal code base. For most end users, this will not have any visible effect. If you have developed integrations that depend on methods you may want to take a closer look at the associated pull requests as it is not practical to list them all here.
Overview
Here is a short overview of the areas that are impacted. If you don't know what any of these mean, they don't affect you.
- HydeKernel has been internally separated into foundation classes
- DiscoveryService has been refactored
- Page compiling logic are now handled within the page models
Added
- internal: Adds methods to the HydeKernelContract interface
- Added new filesystem helpers,
Hyde::touch()
, andHyde::unlink()
Changed
- internal: The HydeKernel has been refactored to move related logic to service classes. This does not change the end usage as the Hyde facade still works the same
DiscoveryService::getSourceFileListForModel()
now throws an exception instead of returning false when given an invalid model classDiscoveryService::getFilePathForModelClassFiles
method was renamed toDiscoveryService::getModelSourceDirectory
DiscoveryService::getFileExtensionForModelFiles
method was renamed toDiscoveryService::getModelFileExtension
- The
Hyde::copy()
helper now always uses paths relative to the project - The
Hyde::copy()
helper will always overwrite existing files - Replaced
SitemapService::canGenerateSitemap()
withFeatures::sitemap()
- Replaced
RssFeedService::canGenerateFeed()
withFeatures::rss()
- RSS feed is now always present on all pages, see reasoning in
a93e30020
Deprecated
- Deprecated trait
HasMarkdownFeatures.php
Removed
- Removed deprecated
Hyde::uriPath()
helper - Removed deprecated
CollectionService::findModelFromFilePath()
Upgrade tips
When refactoring the Hyde::copy() helper change, you have two options (that you can combine). If one or more of your inputs are already qualified Hyde paths, use the native copy helper. If you don't want to overwrite existing files, make that check first.
What's Changed
- Refactor Kernel to extract related code into Foundation classes by @caendesilva in #297
- Update HydeKernelContract interface by @caendesilva in #300
- Add psalm static analysis by @caendesilva in #301
- Fix type issues by @caendesilva in #302
- Remove deprecated CollectionService::findModelFromFilePath() by @caendesilva in #304
- Clean up DiscoveryService by @caendesilva in #305
- Delete internal deprecated trait TransfersMediaAssetsForBuildCommands.php by @caendesilva in #306
- Fix minor code issues found by static analyses by @caendesilva in #303
- Handle page compiling within the page models by @caendesilva in #308
- Refactor filesystem helpers by @caendesilva in #311
- Refactor to use features class in more places by @caendesilva in #312
Full Changelog: v0.53.0-beta...v0.54.0-beta
v0.53.0-beta - 2022-07-30
About
This release refactors some internal code. If you have published any Blade views or created any custom integrations, you may want to take a closer look at the changes. Otherwise, this should not affect most existing sites.
Added
- Added
Hyde::url()
andHyde::hasSiteUrl()
helpers, replacing now deprecatedHyde::uriPath()
helper
Changed
- The HTML page titles are now generated in the page object, using the new
htmlTitle()
helper - Renamed helper
Hyde::pageLink()
toHyde::formatHtmlPath()
- internal: DiscoveryService.php is no longer deprecated
- internal: CollectionService.php was merged into DiscoveryService
- internal: Renamed trait GeneratesPageMetadata to HasArticleMetadata
Deprecated
- Deprecated
Hyde::uriPath()
, useHyde::url()
orHyde::hasSiteUrl()
instead - Deprecated
Helpers\Author.php
, will be merged intoModels\Author.php
Removed
- internal: CollectionService.php has been removed, all its functionality has been moved to DiscoveryService
- internal: The
$currentPage
parameter of a few methods has been removed, it is no longer necessary due to it being inferred from the view being rendered
What's Changed
- Merge CollectionService into DiscoveryService by @caendesilva in #290
- Internal codebase improvements by @caendesilva in #291
- Add tests for the blog post pages by @caendesilva in #293
- Add new URL path helpers by @caendesilva in #292
- Construct the HTML page title inside the AbstractPage class by @caendesilva in #294
- Refactor page metadata generation by @caendesilva in #295
- Fix minor Scrutinizer issues by @caendesilva in #296
Full Changelog: v0.52.0-beta...v0.53.0-beta
v0.52.0-beta - 2022-07-29
About
This update internally refactors how documentation sidebars are handled. If you have published Blade views relating to these, or built framework integrations you may want to take a closer look at the changed files.
Added
- Hyde now supports nested pages!
Changed
- internal: Refactor how documentation sidebars are generated and handled
- internal: (Sidebar) categories are now internally referred to as "groups"
- internal: The sidebar related Blade views have been renamed
DocumentationPage::indexPath()
was renamed toDocumentationPage::home()
and now returns aRoute
instead of a URL. It no longer resolves to README files.
What's Changed
- Refactor documentation sidebar to use routes by @caendesilva in #286
- Rename sidebar views by @caendesilva in #287
- Replace deprecated documentation indexPath() helper by @caendesilva in #289
- Add support for nested source files by @caendesilva in #285
Full Changelog: v0.51.0-beta...v0.52.0-beta
v0.51.0-beta - 2022-07-28
Added
- Add Laravel Tinker as a development dependency for the Monorepo
- Improved the
hyde make:page
command to add page type selection shorthands
Removed
- Removed test files from the hyde/hyde sub repository
What's Changed
- Fix visual bug where navigation menu flashes on desktop until Alpine is loaded by @caendesilva in #278
- Add
@method
annotations to the Hyde facade by @caendesilva in #279 - Configure Tailwind safelist instead of using a dummy Blade file by @caendesilva in #280
- Clean up Hyde/Hyde package files by @caendesilva in #281
- Remove test files from Hyde package by @caendesilva in #282
- Add Laravel Tinker to the Monorepo by @caendesilva in #283
- Improve the make:page command by @caendesilva in #284
Full Changelog: v0.50.0-beta...v0.51.0-beta