Skip to content

Commit 29b2e51

Browse files
committed
added v2 upgrade guide
1 parent e06a7bc commit 29b2e51

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
title: Upgrade Guide
3+
order: 1200
4+
---
5+
6+
### High Impact Changes
7+
8+
- [New package name `nativephp/desktop`](#upgrading-to-20-from-1x)
9+
- [Root namespace updated to `Native\Desktop`](#update-class-imports)
10+
- [Drop macOS **_Catalina_** and **_Big Sur_** support](#macos-support)
11+
12+
### Medium Impact Changes
13+
14+
- [Serve command renamed](#renamed-codenativeservecode-command)
15+
- [Node integration disabled by default](#security-defaults)
16+
17+
## Upgrading To 2.0 From 1.x
18+
19+
NativePHP for Desktop v2 is a significant architecture overhaul & security release. The package has moved to a new repository with a new name; `nativephp/desktop`.
20+
21+
Please replace `nativephp/electron` from your `composer.json` with the new package.
22+
23+
```json
24+
"require": {
25+
"nativephp/electron": "^1.3", // [tl! remove]
26+
"nativephp/laravel": "^1.3", // [tl! remove]
27+
"nativephp/desktop": "^2.0" // [tl! add]
28+
}
29+
```
30+
31+
If you're requiring `nativephp/laravel` as well, please remove that too.
32+
33+
Then run `composer update` & `php artisan native:install` and you're good to go.
34+
35+
Afterwards the `native:install` script will be automatically installed as a `post-update-cmd`, so you won't have to manually run it after a composer update.
36+
37+
## Update class imports
38+
39+
With the package rename the root namespace has also changed. Please update all occurances of `Native\Laravel` to `Native\Desktop`.
40+
41+
```php
42+
use Native\Laravel\Facades\Window; // [tl! remove]
43+
use Native\Desktop\Facades\Window; // [tl! add]
44+
```
45+
46+
## MacOS support
47+
48+
v2 drops support for macOS **_Catalina_** and **_Big Sur_**. This change comes from the Electron v38 upgrade and aligns with Apple's supported OS versions. Most users should be unaffected, but please check your deployment targets before upgrading.
49+
50+
- <a href="https://www.electronjs.org/docs/latest/breaking-changes#removed-macos-1015-support" target="_blank" rel="noopener">Electron Catalina support dropped</a>
51+
- <a href="https://www.electronjs.org/docs/latest/breaking-changes#removed-macos-11-support" target="_blank" rel="noopener">Electron Big Sur support dropped</a>
52+
53+
## Renamed `native:serve` command
54+
55+
The `artisan native:serve` command has been renamed to `artisan native:dev` for better symmetry with the mobile package.
56+
Please update the `composer native:dev` command to use the new name.
57+
58+
## Security defaults
59+
60+
`nodeIntegration` is now disabled by default. While this improves security, it may affect applications that rely on this functionality. You can easily re-enable it using `Window::webPreferences()` where needed.

0 commit comments

Comments
 (0)