From 2e3563d9aa0ad4ff46412c51d70ab6b8c5e80068 Mon Sep 17 00:00:00 2001 From: Jess Archer Date: Sat, 28 May 2022 10:36:33 +1000 Subject: [PATCH 01/13] Switch to ESM imports (#5895) This improves the transition for Vite users. --- resources/js/app.js | 2 +- resources/js/bootstrap.js | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/resources/js/app.js b/resources/js/app.js index 40c55f65..e59d6a0a 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -1 +1 @@ -require('./bootstrap'); +import './bootstrap'; diff --git a/resources/js/bootstrap.js b/resources/js/bootstrap.js index 69225776..bbcdba42 100644 --- a/resources/js/bootstrap.js +++ b/resources/js/bootstrap.js @@ -1,4 +1,5 @@ -window._ = require('lodash'); +import _ from 'lodash'; +window._ = _; /** * We'll load the axios HTTP library which allows us to easily issue requests @@ -6,7 +7,8 @@ window._ = require('lodash'); * CSRF token as a header based on the value of the "XSRF" token cookie. */ -window.axios = require('axios'); +import axios from 'axios'; +window.axios = axios; window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; @@ -18,7 +20,8 @@ window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; // import Echo from 'laravel-echo'; -// window.Pusher = require('pusher-js'); +// import Pusher from 'pusher-js'; +// window.Pusher = Pusher; // window.Echo = new Echo({ // broadcaster: 'pusher', From bb0de1f14803b7ad2c05914e03f2f439ef69c320 Mon Sep 17 00:00:00 2001 From: driesvints Date: Tue, 31 May 2022 15:19:55 +0000 Subject: [PATCH 02/13] Update CHANGELOG --- CHANGELOG.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2da613ca..fa2498ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Release Notes -## [Unreleased](https://github.com/laravel/laravel/compare/v9.1.8...9.x) +## [Unreleased](https://github.com/laravel/laravel/compare/v9.1.9...9.x) + +## [v9.1.9](https://github.com/laravel/laravel/compare/v9.1.8...v9.1.9) - 2022-05-28 + +### Changed + +- Switch to ESM imports by @jessarcher in https://github.com/laravel/laravel/pull/5895 ## [v9.1.8](https://github.com/laravel/laravel/compare/v9.1.7...v9.1.8) - 2022-05-05 From b084aacc5ad105e39c2b058e9523e73655be8d1f Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 7 Jun 2022 10:03:18 -0500 Subject: [PATCH 03/13] add language line --- lang/en/validation.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lang/en/validation.php b/lang/en/validation.php index 724b5ace..77fb5118 100644 --- a/lang/en/validation.php +++ b/lang/en/validation.php @@ -129,6 +129,7 @@ return [ 'string' => 'The :attribute must be :size characters.', ], 'starts_with' => 'The :attribute must start with one of the following: :values.', + 'doesnt_start_with' => 'The :attribute may not start with one of the following: :values.', 'string' => 'The :attribute must be a string.', 'timezone' => 'The :attribute must be a valid timezone.', 'unique' => 'The :attribute has already been taken.', From 93cc51ed00dd84df64ff028bfc31be2165c3dcfe Mon Sep 17 00:00:00 2001 From: Oanh Nguyen Date: Tue, 7 Jun 2022 22:03:59 +0700 Subject: [PATCH 04/13] [9.x] Improve Pusher configuration for easy development (#5897) * Improve Pusher configuration for easy development * Fix style-ci --- config/broadcasting.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/config/broadcasting.php b/config/broadcasting.php index 67fcbbd6..7cc99087 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -36,8 +36,11 @@ return [ 'secret' => env('PUSHER_APP_SECRET'), 'app_id' => env('PUSHER_APP_ID'), 'options' => [ - 'cluster' => env('PUSHER_APP_CLUSTER'), - 'useTLS' => true, + 'host' => env('PUSHER_HOST', 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com'), + 'port' => env('PUSHER_PORT', 443), + 'scheme' => env('PUSHER_SCHEME', 'https'), + 'encrypted' => true, + 'useTLS' => env('PUSHER_SCHEME', 'https') === 'https', ], 'client_options' => [ // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html From c5c731a8aa51dc146645c4024b0f34b9dc3a28ac Mon Sep 17 00:00:00 2001 From: driesvints Date: Tue, 7 Jun 2022 15:20:23 +0000 Subject: [PATCH 05/13] Update CHANGELOG --- CHANGELOG.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa2498ea..f47a2634 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ # Release Notes -## [Unreleased](https://github.com/laravel/laravel/compare/v9.1.9...9.x) +## [Unreleased](https://github.com/laravel/laravel/compare/v9.1.10...9.x) + +## [v9.1.10](https://github.com/laravel/laravel/compare/v9.1.9...v9.1.10) - 2022-06-07 + +### Changed + +- Add language line by @taylorotwell in https://github.com/laravel/laravel/commit/b084aacc5ad105e39c2b058e9523e73655be8d1f +- Improve Pusher configuration for easy development by @oanhnn in https://github.com/laravel/laravel/pull/5897 ## [v9.1.9](https://github.com/laravel/laravel/compare/v9.1.8...v9.1.9) - 2022-05-28 From 3d7b0778d6c9f5573270aa1dda3974294cd2ce56 Mon Sep 17 00:00:00 2001 From: Farid Aghili Date: Tue, 7 Jun 2022 20:45:24 +0430 Subject: [PATCH 06/13] Sorting (#5899) Sort Alphabetically for newly added `doesnt_start_with`. --- lang/en/validation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/en/validation.php b/lang/en/validation.php index 77fb5118..cef02f58 100644 --- a/lang/en/validation.php +++ b/lang/en/validation.php @@ -43,6 +43,7 @@ return [ 'digits_between' => 'The :attribute must be between :min and :max digits.', 'dimensions' => 'The :attribute has invalid image dimensions.', 'distinct' => 'The :attribute field has a duplicate value.', + 'doesnt_start_with' => 'The :attribute may not start with one of the following: :values.', 'email' => 'The :attribute must be a valid email address.', 'ends_with' => 'The :attribute must end with one of the following: :values.', 'enum' => 'The selected :attribute is invalid.', @@ -129,7 +130,6 @@ return [ 'string' => 'The :attribute must be :size characters.', ], 'starts_with' => 'The :attribute must start with one of the following: :values.', - 'doesnt_start_with' => 'The :attribute may not start with one of the following: :values.', 'string' => 'The :attribute must be a string.', 'timezone' => 'The :attribute must be a valid timezone.', 'unique' => 'The :attribute has already been taken.', From 2e823dd31bed673730ab49382b305cffd7279c5d Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Wed, 8 Jun 2022 11:02:33 +0200 Subject: [PATCH 07/13] Update pull-requests.yml --- .github/workflows/pull-requests.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull-requests.yml b/.github/workflows/pull-requests.yml index 156b46eb..18b32b32 100644 --- a/.github/workflows/pull-requests.yml +++ b/.github/workflows/pull-requests.yml @@ -1,9 +1,8 @@ -name: Pull Requests +name: pull requests on: pull_request_target: - types: - - opened + types: [opened] permissions: pull-requests: write From 1f9eee06ddb38abf86e2f7df37a20281cd774e3d Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Wed, 8 Jun 2022 11:02:46 +0200 Subject: [PATCH 08/13] Update update-changelog.yml --- .github/workflows/update-changelog.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml index eaeaf1f8..1625bda1 100644 --- a/.github/workflows/update-changelog.yml +++ b/.github/workflows/update-changelog.yml @@ -1,4 +1,4 @@ -name: "Update Changelog" +name: update changelog on: release: From 0c3d1fabe5a9319131aa4e9d74b27f29e74a50fb Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 22 Jun 2022 11:02:43 -0500 Subject: [PATCH 09/13] use global functino --- database/factories/UserFactory.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index 23b61d24..20b35322 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -18,8 +18,8 @@ class UserFactory extends Factory public function definition() { return [ - 'name' => $this->faker->name(), - 'email' => $this->faker->unique()->safeEmail(), + 'name' => fake()->name(), + 'email' => fake()->safeEmail(), 'email_verified_at' => now(), 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password 'remember_token' => Str::random(10), From 86b4b1b65659a7b0f4b3dad1e753aa1efa5a7642 Mon Sep 17 00:00:00 2001 From: Jess Archer Date: Thu, 23 Jun 2022 04:07:47 +1000 Subject: [PATCH 10/13] [9.x] Vite (#5904) * Use Vite * Gitignore Vite build directory * Use CSS entry points * Update plugin * Linting * Update plugin --- .env.example | 4 ++-- .gitignore | 1 + .styleci.yml | 2 +- package.json | 14 +++++--------- resources/js/bootstrap.js | 4 ++-- vite.config.js | 11 +++++++++++ webpack.mix.js | 17 ----------------- 7 files changed, 22 insertions(+), 31 deletions(-) create mode 100644 vite.config.js delete mode 100644 webpack.mix.js diff --git a/.env.example b/.env.example index 9bb1bd7c..1a334043 100644 --- a/.env.example +++ b/.env.example @@ -48,5 +48,5 @@ PUSHER_APP_KEY= PUSHER_APP_SECRET= PUSHER_APP_CLUSTER=mt1 -MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" -MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" +VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}" +VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" diff --git a/.gitignore b/.gitignore index bc67a663..87ead15d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /node_modules +/public/build /public/hot /public/storage /storage/*.key diff --git a/.styleci.yml b/.styleci.yml index 79f63b44..4705a373 100644 --- a/.styleci.yml +++ b/.styleci.yml @@ -8,5 +8,5 @@ php: js: finder: not-name: - - webpack.mix.js + - vite.config.js css: true diff --git a/package.json b/package.json index 7a9aecdf..724e911f 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,14 @@ { "private": true, "scripts": { - "dev": "npm run development", - "development": "mix", - "watch": "mix watch", - "watch-poll": "mix watch -- --watch-options-poll=1000", - "hot": "mix watch --hot", - "prod": "npm run production", - "production": "mix --production" + "dev": "vite", + "build": "vite build" }, "devDependencies": { "axios": "^0.25", - "laravel-mix": "^6.0.6", + "laravel-vite-plugin": "^0.2.1", "lodash": "^4.17.19", - "postcss": "^8.1.14" + "postcss": "^8.1.14", + "vite": "^2.9.11" } } diff --git a/resources/js/bootstrap.js b/resources/js/bootstrap.js index bbcdba42..a954d249 100644 --- a/resources/js/bootstrap.js +++ b/resources/js/bootstrap.js @@ -25,7 +25,7 @@ window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; // window.Echo = new Echo({ // broadcaster: 'pusher', -// key: process.env.MIX_PUSHER_APP_KEY, -// cluster: process.env.MIX_PUSHER_APP_CLUSTER, +// key: import.meta.env.VITE_PUSHER_APP_KEY, +// cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER, // forceTLS: true // }); diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 00000000..dd941926 --- /dev/null +++ b/vite.config.js @@ -0,0 +1,11 @@ +import { defineConfig } from 'vite'; +import laravel from 'laravel-vite-plugin'; + +export default defineConfig({ + plugins: [ + laravel([ + 'resources/css/app.css', + 'resources/js/app.js', + ]), + ], +}); diff --git a/webpack.mix.js b/webpack.mix.js deleted file mode 100644 index 2a22dc12..00000000 --- a/webpack.mix.js +++ /dev/null @@ -1,17 +0,0 @@ -const mix = require('laravel-mix'); - -/* - |-------------------------------------------------------------------------- - | Mix Asset Management - |-------------------------------------------------------------------------- - | - | Mix provides a clean, fluent API for defining some Webpack build steps - | for your Laravel applications. By default, we are compiling the CSS - | file for the application as well as bundling up all the JS files. - | - */ - -mix.js('resources/js/app.js', 'public/js') - .postCss('resources/css/app.css', 'public/css', [ - // - ]); From d694bc06ccbf66f4f8ce432c39b71deea6766135 Mon Sep 17 00:00:00 2001 From: rennokki Date: Fri, 24 Jun 2022 21:35:29 +0300 Subject: [PATCH 11/13] [9.x] Added support for easy development configuration in bootstrap.js (#5900) * Added support for easy development configuration in bootstrap.js * Added extra variables for existing configuration in broadcasting * Update bootstrap.js * Setting default for empty variable * Update .env.example * Update .env.example Co-authored-by: Taylor Otwell --- .env.example | 6 ++++++ config/broadcasting.php | 2 +- resources/js/bootstrap.js | 7 +++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index 1a334043..00b6110e 100644 --- a/.env.example +++ b/.env.example @@ -46,7 +46,13 @@ AWS_USE_PATH_STYLE_ENDPOINT=false PUSHER_APP_ID= PUSHER_APP_KEY= PUSHER_APP_SECRET= +PUSHER_HOST= +PUSHER_PORT=443 +PUSHER_SCHEME=https PUSHER_APP_CLUSTER=mt1 VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}" +VITE_PUSHER_HOST="${PUSHER_HOST}" +VITE_PUSHER_PORT="${PUSHER_PORT}" +VITE_PUSHER_SCHEME="${PUSHER_SCHEME}" VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" diff --git a/config/broadcasting.php b/config/broadcasting.php index 7cc99087..16882424 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -36,7 +36,7 @@ return [ 'secret' => env('PUSHER_APP_SECRET'), 'app_id' => env('PUSHER_APP_ID'), 'options' => [ - 'host' => env('PUSHER_HOST', 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com'), + 'host' => env('PUSHER_HOST', 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com', 'port' => env('PUSHER_PORT', 443), 'scheme' => env('PUSHER_SCHEME', 'https'), 'encrypted' => true, diff --git a/resources/js/bootstrap.js b/resources/js/bootstrap.js index a954d249..57fbd3b0 100644 --- a/resources/js/bootstrap.js +++ b/resources/js/bootstrap.js @@ -26,6 +26,9 @@ window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; // window.Echo = new Echo({ // broadcaster: 'pusher', // key: import.meta.env.VITE_PUSHER_APP_KEY, -// cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER, -// forceTLS: true +// wsHost: import.meta.env.VITE_PUSHER_HOST ?? `ws-${import.meta.env.VITE_PUSHER_CLUSTER}.pusher.com`, +// wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80, +// wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443, +// forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https', +// enabledTransports: ['ws', 'wss'], // }); From f46db07ef581dbda69dec3fee8064b87a1db2ead Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Tue, 28 Jun 2022 16:36:21 +0200 Subject: [PATCH 12/13] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 164c94bd..ebc44b15 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ "require": { "php": "^8.0.2", "guzzlehttp/guzzle": "^7.2", - "laravel/framework": "^9.11", + "laravel/framework": "^9.19", "laravel/sanctum": "^2.14.1", "laravel/tinker": "^2.7" }, From bb7320563888264e956294fb70ed07b017ddfef1 Mon Sep 17 00:00:00 2001 From: driesvints Date: Tue, 28 Jun 2022 14:37:38 +0000 Subject: [PATCH 13/13] Update CHANGELOG --- CHANGELOG.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f47a2634..6535994b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,17 @@ # Release Notes -## [Unreleased](https://github.com/laravel/laravel/compare/v9.1.10...9.x) +## [Unreleased](https://github.com/laravel/laravel/compare/v9.2.0...9.x) + +## [v9.2.0](https://github.com/laravel/laravel/compare/v9.1.10...v9.2.0) - 2022-06-28 + +### Added + +- Vite by @jessarcher in https://github.com/laravel/laravel/pull/5904 +- Added support for easy development configuration in bootstrap.js by @rennokki in https://github.com/laravel/laravel/pull/5900 + +### Changed + +- Sorted entries in the `en` validation translations file by @FaridAghili in https://github.com/laravel/laravel/pull/5899 ## [v9.1.10](https://github.com/laravel/laravel/compare/v9.1.9...v9.1.10) - 2022-06-07