Skip to content

Commit

Permalink
v0.59.0-beta - 2022-08-11
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Aug 11, 2022
1 parent 0ea94ec commit 866ede9
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 55 deletions.
68 changes: 68 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,74 @@ HydePHP consists of two primary components, Hyde/Hyde and Hyde/Framework. Develo

<!-- CHANGELOG_START -->

## [v0.59.0-beta](https://github.com/hydephp/develop/releases/tag/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](https://github.com/hydephp/develop/issues/383): Navigation menu titles can't be set in BladeMatter
- Fix [#385](https://github.com/hydephp/develop/issues/385): `DocumentationPage::home()` did not work for custom documentation page output directories
- Fix [#386](https://github.com/hydephp/develop/issues/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](https://github.com/hydephp/develop/issues/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.

```diff
'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.


## [v0.58.0-beta](https://github.com/hydephp/develop/releases/tag/v0.58.0-beta) - 2022-08-08

### About
Expand Down
59 changes: 9 additions & 50 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,68 +2,27 @@

### 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.
Keep an Unreleased section at the top to track upcoming changes.

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.
This serves two purposes:

The RoutingService class remains for compatibility with existing code, but now only forwards calls to the new RouteCollection. The RoutingServiceContract interface is now deprecated.
1. People can see what changes they might expect in upcoming releases
2. At release time, you can move the Unreleased section changes into a new release version section.

### 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
- for new features.

### 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
- for changes in existing functionality.

### Deprecated
- Deprecated interface RoutingServiceContract
- Deprecated RoutingServiceContract::getInstance()
- for soon-to-be removed features.

### Removed
- Removed all non public-contract methods from RoutingService
- for now removed features.

### Fixed
- Fix [#383](https://github.com/hydephp/develop/issues/383): Navigation menu titles can't be set in BladeMatter
- Fix [#385](https://github.com/hydephp/develop/issues/385): `DocumentationPage::home()` did not work for custom documentation page output directories
- Fix [#386](https://github.com/hydephp/develop/issues/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](https://github.com/hydephp/develop/issues/410): Search index generator breaks when storing documentation page source files in subdirectories

- for any bug fixes.

### Security
- in case of vulnerabilities.

### 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.

```diff
'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.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"name": "hyde",
"description": "Elegant and Powerful Static App Builder",
"version": "0.58.0",
"version": "0.59.0",
"main": "hyde",
"directories": {
"test": "tests"
Expand Down
4 changes: 2 additions & 2 deletions packages/hyde/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
],
"require": {
"php": "^8.0",
"hyde/framework": "dev-master",
"hyde/framework": "^0.59",
"laravel-zero/framework": "^9.1"
},
"require-dev": {
Expand Down Expand Up @@ -56,4 +56,4 @@
"bin": [
"hyde"
]
}
}

0 comments on commit 866ede9

Please sign in to comment.