From ebb86591e8ce22d2036294683164ac2b36c7ae79 Mon Sep 17 00:00:00 2001
From: Henry Jonas
Date: Thu, 5 Dec 2024 14:15:11 -0400
Subject: [PATCH 01/30] FOUR-20583: S2: Improve vendors
---
webpack.mix.js | 49 ++++++++++++++++++++++++++++++++++++++++---------
1 file changed, 40 insertions(+), 9 deletions(-)
diff --git a/webpack.mix.js b/webpack.mix.js
index ef6c05502a..e4915f4519 100644
--- a/webpack.mix.js
+++ b/webpack.mix.js
@@ -22,7 +22,38 @@ mix.webpackConfig({
symlinks: false,
alias: {
"vue-monaco": path.resolve(__dirname, "resources/js/vue-monaco-amd.js"),
- "styles": path.resolve(__dirname, "resources/sass"),
+ styles: path.resolve(__dirname, "resources/sass"),
+ },
+ },
+ optimization: {
+ splitChunks: {
+ cacheGroups: {
+ vueVendor: {
+ test: /[\\/]node_modules[\\/](vue|vue-router|axios|lodash)[\\/]/,
+ name: "js/vue-vendor",
+ chunks: "all",
+ },
+ bootstrapVendor: {
+ test: /[\\/]node_modules[\\/](bootstrap|jquery|bootstrap-vue|popper.js)[\\/]/,
+ name: "js/bootstrap-vendor",
+ chunks: "all",
+ },
+ fortawesomeVendor: {
+ test: /[\\/]node_modules[\\/](@fortawesome\/fontawesome-free|@fortawesome\/fontawesome-svg-core|@fortawesome\/free-brands-svg-icons|@fortawesome\/free-solid-svg-icons|@fortawesome\/vue-fontawesome)[\\/]/,
+ name: "js/fortawesome-vendor",
+ chunks: "all",
+ },
+ modelerVendor: {
+ test: /[\\/]node_modules[\\/](jointjs|bpmn-moddle|luxon)[\\/]/,
+ name: "js/modeler-vendor",
+ chunks: "all",
+ },
+ vendor: {
+ test: /[\\/]node_modules[\\/]/,
+ name: "js/vendor",
+ chunks: "all",
+ },
+ },
},
},
});
@@ -52,7 +83,7 @@ mix
"@fortawesome/free-brands-svg-icons",
"@fortawesome/free-solid-svg-icons",
"@fortawesome/vue-fontawesome",
- ])
+ ], "public/js")
.copy("resources/img/*", "public/img")
.copy("resources/img/launchpad-images/*", "public/img/launchpad-images")
.copy("resources/img/launchpad-images/icons/*", "public/img/launchpad-images/icons")
@@ -133,18 +164,18 @@ mix
.js("resources/js/tasks/show.js", "public/js/tasks/show.js")
.js("resources/js/notifications/index.js", "public/js/notifications/index.js")
- .js('resources/js/inbox-rules/index.js', 'public/js/inbox-rules')
- .js('resources/js/inbox-rules/show.js', 'public/js/inbox-rules')
+ .js("resources/js/inbox-rules/index.js", "public/js/inbox-rules")
+ .js("resources/js/inbox-rules/show.js", "public/js/inbox-rules")
.js("resources/js/admin/devlink/index.js", "public/js/admin/devlink")
// Note, that this should go last for the extract to properly put the manifest and vendor in the right location
// See: https://github.com/JeffreyWay/laravel-mix/issues/1118
.js("resources/js/app.js", "public/js");
- // .polyfill({
- // enabled: true,
- // useBuiltIns: false,
- // targets: "> 0.25%, not dead"
- // });
+// .polyfill({
+// enabled: true,
+// useBuiltIns: false,
+// targets: "> 0.25%, not dead"
+// });
// Monaco AMD modules. Copy only the files we need to make the build faster.
const monacoSource = "node_modules/monaco-editor/min/vs/";
From 489f064fa39791c94a1b7297e1e36236de34092e Mon Sep 17 00:00:00 2001
From: Henry Jonas
Date: Fri, 6 Dec 2024 14:19:35 -0400
Subject: [PATCH 02/30] FOUR-20583: S2: Improve vendors
---
package.json | 1 +
resources/js/empty.js | 16 ++++++++
webpack-vendors.mix.js | 83 ++++++++++++++++++++++++++++++++++++++++++
webpack.mix.js | 33 +----------------
4 files changed, 101 insertions(+), 32 deletions(-)
create mode 100644 resources/js/empty.js
create mode 100644 webpack-vendors.mix.js
diff --git a/package.json b/package.json
index 7ee0065443..714de2e60e 100644
--- a/package.json
+++ b/package.json
@@ -10,6 +10,7 @@
"postinstall": "mkdir -p public/css/precompiled && cp -rf node_modules/npm-font-open-sans public/css/precompiled/npm-font-open-sans && cp -rf node_modules/bootstrap/scss public/css/precompiled/bootstrap && cp -rf node_modules/@fortawesome/fontawesome-free public/css/precompiled/fontawesome-free && cp -rf node_modules/@fontsource/poppins public/css/precompiled/poppins && cp -rf node_modules/@processmaker/vue-multiselect/dist/vue-multiselect.min.css public/css/precompiled",
"dev": "npm run development && mix --mix-config=webpack-login.mix.js",
"development": "mix",
+ "vendors": "mix --mix-config=webpack-vendors.mix.js",
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
diff --git a/resources/js/empty.js b/resources/js/empty.js
new file mode 100644
index 0000000000..3310000ea8
--- /dev/null
+++ b/resources/js/empty.js
@@ -0,0 +1,16 @@
+import vue from "vue";
+import vueRouter from "vue-router";
+import jquery from "jquery";
+import bootstrapVue from "bootstrap-vue";
+import axios from "axios";
+import popper from "popper.js";
+import lodash from "lodash";
+import bootstrap from "bootstrap";
+import jointjs from "jointjs";
+import luxon from "luxon";
+import bpmnModdle from "bpmn-moddle";
+import fontawesomeFree from "@fortawesome/fontawesome-free";
+import fontawesomeSvgCore from "@fortawesome/fontawesome-svg-core";
+import fontawesomeFreeBrandsSvgIcons from "@fortawesome/free-brands-svg-icons";
+import fontawesomeFreeSolidSvgIcons from "@fortawesome/free-solid-svg-icons";
+import fontawesomeVueFontawesome from "@fortawesome/vue-fontawesome";
diff --git a/webpack-vendors.mix.js b/webpack-vendors.mix.js
new file mode 100644
index 0000000000..a70e104b29
--- /dev/null
+++ b/webpack-vendors.mix.js
@@ -0,0 +1,83 @@
+const mix = require("laravel-mix");
+const path = require("path");
+const fs = require("fs");
+
+const manifestPath = path.resolve(__dirname, "public/mix-manifest.json");
+let existingContent = {};
+
+require("laravel-mix-polyfill");
+
+/*
+ |--------------------------------------------------------------------------
+ | Mix Asset Management
+ |--------------------------------------------------------------------------
+ |
+ | Mix provides a clean, fluent API for defining some Webpack build steps
+ | for your Laravel application. By default, we are compiling the Sass
+ | file for the application as well as bundling up all the JS files.
+ |
+*/
+
+mix.webpackConfig({
+ plugins: [],
+ externals: [],
+ resolve: {
+ extensions: [".*", ".js", ".ts", ".mjs", ".vue", ".json"],
+ symlinks: false,
+ alias: {
+ styles: path.resolve(__dirname, "resources/sass"),
+ },
+ },
+});
+
+mix.options({
+ legacyNodePolyfills: false,
+ terser: {
+ parallel: true,
+ },
+});
+
+mix.extract([
+ "jquery",
+ "bootstrap-vue",
+ "popper.js",
+ "bootstrap",
+], "public/js/bootstrap-vendor.js")
+ .extract([
+ "@fortawesome/fontawesome-free",
+ "@fortawesome/fontawesome-svg-core",
+ "@fortawesome/free-brands-svg-icons",
+ "@fortawesome/free-solid-svg-icons",
+ "@fortawesome/vue-fontawesome",
+ ], "public/js/fortawesome-vendor.js")
+ .extract([
+ "jointjs",
+ "luxon",
+ "bpmn-moddle",
+ ], "public/js/modeler-vendor.js")
+ .extract([
+ "vue",
+ "vue-router",
+ "axios",
+ "lodash",
+ ], "public/js/vue-vendor.js")
+ .js("resources/js/empty.js", "public/js")
+ .version();
+
+mix.vue({ version: 2 })
+ .before(() => {
+ // Check if the manifest file already exists and get the current content
+ if (fs.existsSync(manifestPath)) {
+ existingContent = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
+ }
+ })
+ .then(() => {
+ // Reload the generated manifest content
+ const newContent = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
+
+ // Merge the existing content with the newly generated content
+ const mergedContent = { ...existingContent, ...newContent };
+
+ // Output the result as formatted JSON
+ fs.writeFileSync(manifestPath, JSON.stringify(mergedContent, null, 4));
+ });
diff --git a/webpack.mix.js b/webpack.mix.js
index e4915f4519..e86f55045a 100644
--- a/webpack.mix.js
+++ b/webpack.mix.js
@@ -25,37 +25,6 @@ mix.webpackConfig({
styles: path.resolve(__dirname, "resources/sass"),
},
},
- optimization: {
- splitChunks: {
- cacheGroups: {
- vueVendor: {
- test: /[\\/]node_modules[\\/](vue|vue-router|axios|lodash)[\\/]/,
- name: "js/vue-vendor",
- chunks: "all",
- },
- bootstrapVendor: {
- test: /[\\/]node_modules[\\/](bootstrap|jquery|bootstrap-vue|popper.js)[\\/]/,
- name: "js/bootstrap-vendor",
- chunks: "all",
- },
- fortawesomeVendor: {
- test: /[\\/]node_modules[\\/](@fortawesome\/fontawesome-free|@fortawesome\/fontawesome-svg-core|@fortawesome\/free-brands-svg-icons|@fortawesome\/free-solid-svg-icons|@fortawesome\/vue-fontawesome)[\\/]/,
- name: "js/fortawesome-vendor",
- chunks: "all",
- },
- modelerVendor: {
- test: /[\\/]node_modules[\\/](jointjs|bpmn-moddle|luxon)[\\/]/,
- name: "js/modeler-vendor",
- chunks: "all",
- },
- vendor: {
- test: /[\\/]node_modules[\\/]/,
- name: "js/vendor",
- chunks: "all",
- },
- },
- },
- },
});
mix.options({
@@ -83,7 +52,7 @@ mix
"@fortawesome/free-brands-svg-icons",
"@fortawesome/free-solid-svg-icons",
"@fortawesome/vue-fontawesome",
- ], "public/js")
+ ])
.copy("resources/img/*", "public/img")
.copy("resources/img/launchpad-images/*", "public/img/launchpad-images")
.copy("resources/img/launchpad-images/icons/*", "public/img/launchpad-images/icons")
From 189442ccde8e6fa21a4da6d8314b2c2ac0755528 Mon Sep 17 00:00:00 2001
From: Henry Jonas
Date: Fri, 6 Dec 2024 14:55:01 -0400
Subject: [PATCH 03/30] FOUR-20583: S2: Improve vendors
---
resources/js/empty.js | 16 ----
.../views/auth/passwords/change.blade.php | 5 +-
.../views/layouts/ai-qr-mobile.blade.php | 5 +-
resources/views/layouts/layout.blade.php | 5 +-
resources/views/layouts/preview.blade.php | 5 +-
resources/views/layouts/print.blade.php | 5 +-
resources/views/layouts/process-map.blade.php | 5 +-
resources/views/tasks/preview.blade.php | 5 +-
webpack-vendors.mix.js | 83 -------------------
webpack.mix.js | 22 +++--
10 files changed, 42 insertions(+), 114 deletions(-)
delete mode 100644 resources/js/empty.js
delete mode 100644 webpack-vendors.mix.js
diff --git a/resources/js/empty.js b/resources/js/empty.js
deleted file mode 100644
index 3310000ea8..0000000000
--- a/resources/js/empty.js
+++ /dev/null
@@ -1,16 +0,0 @@
-import vue from "vue";
-import vueRouter from "vue-router";
-import jquery from "jquery";
-import bootstrapVue from "bootstrap-vue";
-import axios from "axios";
-import popper from "popper.js";
-import lodash from "lodash";
-import bootstrap from "bootstrap";
-import jointjs from "jointjs";
-import luxon from "luxon";
-import bpmnModdle from "bpmn-moddle";
-import fontawesomeFree from "@fortawesome/fontawesome-free";
-import fontawesomeSvgCore from "@fortawesome/fontawesome-svg-core";
-import fontawesomeFreeBrandsSvgIcons from "@fortawesome/free-brands-svg-icons";
-import fontawesomeFreeSolidSvgIcons from "@fortawesome/free-solid-svg-icons";
-import fontawesomeVueFontawesome from "@fortawesome/vue-fontawesome";
diff --git a/resources/views/auth/passwords/change.blade.php b/resources/views/auth/passwords/change.blade.php
index 1410c0d3dc..d126b301cb 100644
--- a/resources/views/auth/passwords/change.blade.php
+++ b/resources/views/auth/passwords/change.blade.php
@@ -67,7 +67,10 @@
@section('js')
-
+
+
+
+
@endif
-
+
+
+
+
@endif
-
+
+
+
+
@endif
-
+
+
+
+
@endif
-
+
+
+
+
@endif
-
+
+
+
+
@endif
-
+
+
+
+
';
+ $tag .= '';
+ $content = str_replace('
+@{{ __('Skip to Content') }}
+
+ @if (shouldShow('leftSideBar'))
+
+ @else
+
+ @endif
+
+
+ @include('layouts.navbar')
+
+
+
+ @yield('content')
+
+
+
+
+
+
+
@{{__('Sorry! API failed to load')}}
+
@{{__('Something went wrong. Try refreshing the application')}}
+
+
+
+@if(config('broadcasting.default') == 'redis')
+
+@endif
+{{-- --}}
+
+ @yield('js')
+
+
+
+
+ {{-- @isset($addons)
+ @foreach ($addons as $addon)
+ @if (!empty($addon['script_mix']))
+
+ @endif
+ @if (!empty($addon['script_mix_module']))
+
+ @endif
+ @endforeach
+ @endisset
+
+ @if (hasPackage('package-accessibility'))
+ @include('package-accessibility::userway')
+ @endif --}}
+
+