Skip to content

Upgrade to HydePHP v2.0#16

Merged
DannyvdSluijs merged 2 commits into
mainfrom
feature/upgrade-to-hydephp-v2
Jun 22, 2026
Merged

Upgrade to HydePHP v2.0#16
DannyvdSluijs merged 2 commits into
mainfrom
feature/upgrade-to-hydephp-v2

Conversation

@DannyvdSluijs

Copy link
Copy Markdown
Contributor

Summary

Upgrades the site from HydePHP v1.8 to v2.0.2, migrating all breaking changes across PHP dependencies, config files, published vendor views, and the frontend build pipeline.

Closes the implementation plan from #14. Tracking CI/CD action pinning separately in #15.

What changed

Phase 1 — Composer

  • Bumped php ^8.1 → ^8.2, hyde/framework ^1.8 → ^2.0, laravel-zero/framework ^10.0 → ^11.0

Phase 2 — Laravel Mix → Vite

  • Replaced webpack.mix.js with vite.config.js using @tailwindcss/vite plugin
  • Replaced laravel-mix with vite in package.json; updated scripts dev/prod/watch → dev/build
  • app.js converted to an ESM entry point importing app.css

Phase 3 — Tailwind CSS v3 → v4

  • Removed tailwind.config.js; config fully migrated into app.css
  • @tailwind base/components/utilities@import "tailwindcss"
  • darkMode: 'class'@custom-variant dark
  • theme.extend.colors@theme {} block
  • Typography JS config → plain .prose CSS overrides
  • @plugin "@tailwindcss/typography" (v4 plugin syntax)
  • Added @source directives for Blade template scanning
  • Bumped hydefront ^3.4.1 → ^4.0.0, removed autoprefixer, postcss, prettier

Phase 4 — Config & published vendor views

  • config/hyde.php: NavItem::forLinkNavigation::item, removed dropped AssetService constants
  • config/docs.php: moved sidebar_order and table_of_contents into the nested sidebar key
  • app/config.php: registered NavigationServiceProvider, added HydeFront and Vite facade aliases
  • styles.blade.php: migrated Asset::mediaLink/cdnLink/hasMediaFile/injectTailwindConfig to v2 API, added Vite wrapper
  • scripts.blade.php: same asset API migration, added Vite wrapper, added type="module" to script tag
  • head.blade.php: replaced removed Hyde::mediaPath with Asset::exists/get
  • navigation.blade.php: migrated to app('navigation.main'), NavigationGroup, getLabel/getItems API
  • docs.blade.php: replaced removed search-widget/search-scripts include with search-modal

Test plan

  • composer update resolves cleanly on PHP 8.4
  • npm run build produces _media/app.css (47KB) and _media/app.js via Vite
  • php hyde build compiles all 8 pages without errors

🤖 Generated with Claude Code

DannyvdSluijs and others added 2 commits June 22, 2026 20:32
Phase 1 - Composer:
- Bump php ^8.1 -> ^8.2, hyde/framework ^1.8 -> ^2.0, laravel-zero/framework ^10.0 -> ^11.0

Phase 4 - Config & published vendor views:
- config/hyde.php: replace NavItem::forLink -> Navigation::item, remove dropped AssetService constants
- config/docs.php: move sidebar_order and table_of_contents into nested sidebar key
- app/config.php: register NavigationServiceProvider, add HydeFront and Vite facade aliases
- styles.blade.php: migrate Asset::mediaLink/cdnLink/hasMediaFile/injectTailwindConfig to v2 API, add Vite wrapper
- scripts.blade.php: same asset API migration, add Vite wrapper, add type="module" to script tag
- head.blade.php: replace removed Hyde::mediaPath with Asset::exists/get
- navigation.blade.php: migrate to app('navigation.main'), NavigationGroup, getLabel/getItems API
- docs.blade.php: replace removed search-widget/search-scripts with search-modal

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Phase 2 - Laravel Mix → Vite:
- Replace webpack.mix.js with vite.config.js using @tailwindcss/vite plugin
- Replace laravel-mix with vite in package.json
- Update npm scripts: dev/prod/watch → dev/build
- Update resources/assets/app.js to be Vite ESM entry point importing app.css
- Add "type": "module" to package.json

Phase 3 - Tailwind CSS v3 → v4:
- Rewrite resources/assets/app.css for Tailwind v4:
  - Replace @tailwind base/components/utilities with @import "tailwindcss"
  - Replace ~hydefront/dist/hyde.css (webpack alias, v3 source) with
    hydefront/components/torchlight.css (v4 source component)
  - Add @plugin "@tailwindcss/typography" (v4 plugin syntax)
  - Add @source directives for Blade template scanning
  - Migrate darkMode: 'class' to @custom-variant dark
  - Migrate theme.extend.colors to @theme block
  - Migrate typography JS config to plain CSS overrides
- Remove tailwind.config.js (fully migrated to CSS)
- Remove autoprefixer, postcss, laravel-mix, prettier from devDependencies
- Bump hydefront ^3.4.1 → ^4.0.0, tailwindcss ^3 → ^4

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@DannyvdSluijs
DannyvdSluijs merged commit 6965a10 into main Jun 22, 2026
@DannyvdSluijs
DannyvdSluijs deleted the feature/upgrade-to-hydephp-v2 branch June 22, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant