From b7b742107b311e249eac5fae3af3d946ba3a38b9 Mon Sep 17 00:00:00 2001 From: Nikolay Gagarinov Date: Sun, 16 Jun 2024 02:07:55 +0500 Subject: [PATCH] fix ujs --- package-lock.json | 23 +++++++++++------------ package.json | 2 +- resources/js/app.js | 4 ++-- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index a97e864c..d793d45f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "@codemirror/state": "^6.3.3", "@codemirror/view": "^6.22.2", "@popperjs/core": "^2.11.8", + "@rails/ujs": "^7.1.3-4", "@reduxjs/toolkit": "^2.0.1", "axios": "^1.6", "bootstrap": "^5.3.2", @@ -23,7 +24,6 @@ "highlight.js": "^11.x", "i18next": "^23.7.8", "jquery": "^3.7.1", - "jquery-ujs": "^1.2.3", "lodash": "^4.17.21", "react": "^18.2.0", "react-bootstrap": "^2.9.1", @@ -1617,6 +1617,11 @@ "url": "https://opencollective.com/popperjs" } }, + "node_modules/@rails/ujs": { + "version": "7.1.3-4", + "resolved": "https://registry.npmjs.org/@rails/ujs/-/ujs-7.1.3-4.tgz", + "integrity": "sha512-z0ckI5jrAJfImcObjMT1RBz2IxH6I5q6ZTMFex6AfxSQKZuuL8JxAXvg2CvBuodGCxKvybFVolDyMHXlBLeYAA==" + }, "node_modules/@react-aria/ssr": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/@react-aria/ssr/-/ssr-3.8.0.tgz", @@ -6588,13 +6593,6 @@ "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz", "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==" }, - "node_modules/jquery-ujs": { - "version": "1.2.3", - "license": "MIT", - "peerDependencies": { - "jquery": ">=1.8.0" - } - }, "node_modules/js-beautify": { "version": "1.14.11", "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.14.11.tgz", @@ -11990,6 +11988,11 @@ "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==" }, + "@rails/ujs": { + "version": "7.1.3-4", + "resolved": "https://registry.npmjs.org/@rails/ujs/-/ujs-7.1.3-4.tgz", + "integrity": "sha512-z0ckI5jrAJfImcObjMT1RBz2IxH6I5q6ZTMFex6AfxSQKZuuL8JxAXvg2CvBuodGCxKvybFVolDyMHXlBLeYAA==" + }, "@react-aria/ssr": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/@react-aria/ssr/-/ssr-3.8.0.tgz", @@ -15470,10 +15473,6 @@ "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz", "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==" }, - "jquery-ujs": { - "version": "1.2.3", - "requires": {} - }, "js-beautify": { "version": "1.14.11", "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.14.11.tgz", diff --git a/package.json b/package.json index ebc6b348..9e6c608d 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "@codemirror/state": "^6.3.3", "@codemirror/view": "^6.22.2", "@popperjs/core": "^2.11.8", + "@rails/ujs": "^7.1.3-4", "@reduxjs/toolkit": "^2.0.1", "axios": "^1.6", "bootstrap": "^5.3.2", @@ -29,7 +30,6 @@ "highlight.js": "^11.x", "i18next": "^23.7.8", "jquery": "^3.7.1", - "jquery-ujs": "^1.2.3", "lodash": "^4.17.21", "react": "^18.2.0", "react-bootstrap": "^2.9.1", diff --git a/resources/js/app.js b/resources/js/app.js index 80ebfa79..09e3f714 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -2,10 +2,9 @@ import $ from 'jquery'; import lodash from 'lodash'; import * as bootstrap from 'bootstrap'; import axios from 'axios'; +import ujs from '@rails/ujs'; import correctionListener from './correction'; -import 'jquery-ujs'; - import.meta.glob([ '../assets/images/**', ]); @@ -16,5 +15,6 @@ window.jQuery = $; window._ = lodash; window.axios = axios; window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; +ujs.start(); correctionListener();