Skip to content

A platform for community discussion. Free, open, simple.

DEV: allows to load full calendar 6 as an async bundle (#33448)

Joffrey JAFFEUX51419f94ba8a
diff --git a/app/assets/javascripts/discourse/app/lib/load-full-calendar.js b/app/assets/javascripts/discourse/app/lib/load-full-calendar.js
new file mode 100644
index 00000000000..fdb2ed85ab7
--- /dev/null
+++ b/app/assets/javascripts/discourse/app/lib/load-full-calendar.js
@@ -0,0 +1,7 @@
+import { waitForPromise } from "@ember/test-waiters";
+
+export default async function loadFullCalendar() {
+ const promise = import("discourse/static/full-calendar-bundle");
+ waitForPromise(promise);
+ return await promise;
+}
diff --git a/app/assets/javascripts/discourse/app/static/full-calendar-bundle.js b/app/assets/javascripts/discourse/app/static/full-calendar-bundle.js
new file mode 100644
index 00000000000..5c2269eb08e
--- /dev/null
+++ b/app/assets/javascripts/discourse/app/static/full-calendar-bundle.js
@@ -0,0 +1,4 @@
+export { Calendar } from "@fullcalendar/core";
+export { default as DayGrid } from "@fullcalendar/daygrid";
+export { default as TimeGrid } from "@fullcalendar/timegrid";
+export { default as List } from "@fullcalendar/list";
diff --git a/app/assets/javascripts/discourse/package.json b/app/assets/javascripts/discourse/package.json
index e184be9a3fc..aa6b81f220b 100644
--- a/app/assets/javascripts/discourse/package.json
+++ b/app/assets/javascripts/discourse/package.json
@@ -20,6 +20,10 @@
},
"dependencies": {
"@faker-js/faker": "^9.9.0",
+ "@fullcalendar/core": "^6.1.18",
+ "@fullcalendar/daygrid": "^6.1.18",
+ "@fullcalendar/list": "^6.1.18",
+ "@fullcalendar/timegrid": "^6.1.18",
"@glimmer/syntax": "0.93.1",
"@highlightjs/cdn-assets": "11.11.1",
"@json-editor/json-editor": "2.15.2",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 1d9f25786cc..07e8bc10908 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -263,6 +263,18 @@ importers:
'@faker-js/faker':
specifier: ^9.9.0
version: 9.9.0
+ '@fullcalendar/core':
+ specifier: ^6.1.18
+ version: 6.1.18
+ '@fullcalendar/daygrid':
+ specifier: ^6.1.18
+ version: 6.1.18(@fullcalendar/[email protected])
+ '@fullcalendar/list':
+ specifier: ^6.1.18
+ version: 6.1.18(@fullcalendar/[email protected])
+ '@fullcalendar/timegrid':
+ specifier: ^6.1.18
+ version: 6.1.18(@fullcalendar/[email protected])
'@glimmer/syntax':
specifier: 0.93.1
version: 0.93.1
@@ -686,7 +698,7 @@ importers:
version: 4.3.0
ember-this-fallback:
specifier: ^0.4.0
- version: 0.4.0(patch_hash=znalyv6akdxlqfpmxunrdi3osa)([email protected])([email protected](patch_hash=pqnuctuxbp6ekxyjszyhrgmysm)(@glimmer/[email protected](@babel/[email protected]))(@glint/[email protected])([email protected])([email protected](@swc/[email protected])([email protected])))
+ version: 0.4.0(patch_hash=znalyv6akdxlqfpmxunrdi3osa)([email protected])([email protected](patch_hash=pqnuctuxbp6ekxyjszyhrgmysm)(@glimmer/[email protected](@babel/[email protected]))(@glint/[email protected])([email protected]))
devDependencies:
ember-cli:
specifier: ~6.5.0
@@ -1053,7 +1065,7 @@ importers:
version: 5.12.0(patch_hash=pqnuctuxbp6ekxyjszyhrgmysm)(@glimmer/[email protected](@babel/[email protected]))(@glint/[email protected])([email protected])([email protected](@swc/[email protected])([email protected]))
ember-this-fallback:
specifier: ^0.4.0
- version: 0.4.0(patch_hash=znalyv6akdxlqfpmxunrdi3osa)([email protected])([email protected](patch_hash=pqnuctuxbp6ekxyjszyhrgmysm)(@glimmer/[email protected](@babel/[email protected]))(@glint/[email protected])([email protected])([email protected](@swc/[email protected])([email protected])))
+ version: 0.4.0(patch_hash=znalyv6akdxlqfpmxunrdi3osa)([email protected])([email protected](patch_hash=pqnuctuxbp6ekxyjszyhrgmysm)(@glimmer/[email protected](@babel/[email protected]))(@glint/[email protected])([email protected]))
fastestsmallesttextencoderdecoder:
specifier: ^1.0.22
version: 1.0.22
@@ -2097,6 +2109,24 @@ packages:
resolution: {integrity: sha512-JUOtgFW6k9u4Y+xeIaEiLr3+cjoUPiAuLXoyKOJSia6Duzb7pq+A76P9ZdPDoAoxHdHzq6gE9/jKBGXlZT8FbA==}
engines: {node: '>=6'}
+ '@fullcalendar/[email protected]':
+ resolution: {integrity: sha512-cD7XtZIZZ87Cg2+itnpsONCsZ89VIfLLDZ22pQX4IQVWlpYUB3bcCf878DhWkqyEen6dhi5ePtBoqYgm5K+0fQ==}
+
+ '@fullcalendar/[email protected]':
+ resolution: {integrity: sha512-s452Zle1SdMEzZDw+pDczm8m3JLIZzS9ANMThXTnqeqJewW1gqNFYas18aHypJSgF9Fh9rDJjTSUw04BpXB/Mg==}
+ peerDependencies:
+ '@fullcalendar/core': ~6.1.18
+
+ '@fullcalendar/[email protected]':
+ resolution: {integrity: sha512-XPZI50mq3HXyDQ5sT3jmqQUuwG8zQb5H14dQIUAmOHAIFRA3WpkxlzrXO0U1SrosvGySMPyyNNxvMKI1Q/jL7A==}
+ peerDependencies:
+ '@fullcalendar/core': ~6.1.18
+
+ '@fullcalendar/[email protected]':
+ resolution: {integrity: sha512-T/ouhs+T1tM8JcW7Cjx+KiohL/qQWKqvRITwjol8ktJ1e1N/6noC40/obR1tyolqOxMRWHjJkYoj9fUqfoez9A==}
+ peerDependencies:
+ '@fullcalendar/core': ~6.1.18
+
'@glimmer/[email protected]':
resolution: {integrity: sha512-xoR8F6fsgFqWbPbCfSgJuJ95vaLnXw0SgDCwyl/KMeeaSxpHwJbr8+BfiUl+7ko2A+HzrY5dPXXnGr4ZM+CUXw==}
engines: {node: '>= 16.0.0'}
@@ -7131,6 +7161,9 @@ packages:
resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==}
engines: {node: ^10 || ^12 || >=14}
+ resolution: {integrity: sha512-l8386ixSsBdbreOAkqtrwqHwdvR35ID8c3rKPa8lCWuO86dBi32QWHV4vfsZK1utLLFMvw+Z5Ad4XLkZzchscg==}
+
resolution: {integrity: sha512-kKYfePf9rzKnxOAKDpsWhg/ysrHPqT+yQ7UW4JjdnqjFIeNUnNcEJvhuA8fDenxAGWzUqtd51DfVg7xp/8T9NA==}
@@ -10140,6 +10173,23 @@ snapshots:
'@fortawesome/[email protected]': {}
+ '@fullcalendar/[email protected]':
+ dependencies:
+ preact: 10.12.1
+
+ '@fullcalendar/[email protected](@fullcalendar/[email protected])':
+ dependencies:
+ '@fullcalendar/core': 6.1.18
+
+ '@fullcalendar/[email protected](@fullcalendar/[email protected])':
+ dependencies:
+ '@fullcalendar/core': 6.1.18
+
+ '@fullcalendar/[email protected](@fullcalendar/[email protected])':
+ dependencies:
+ '@fullcalendar/core': 6.1.18
+ '@fullcalendar/daygrid': 6.1.18(@fullcalendar/[email protected])
+
'@glimmer/[email protected]':
dependencies:
'@glimmer/interfaces': 0.92.3
@@ -13397,7 +13447,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
- [email protected](patch_hash=znalyv6akdxlqfpmxunrdi3osa)([email protected])([email protected](patch_hash=pqnuctuxbp6ekxyjszyhrgmysm)(@glimmer/[email protected](@babel/[email protected]))(@glint/[email protected])([email protected])([email protected](@swc/[email protected])([email protected]))):
+ [email protected](patch_hash=znalyv6akdxlqfpmxunrdi3osa)([email protected])([email protected](patch_hash=pqnuctuxbp6ekxyjszyhrgmysm)(@glimmer/[email protected](@babel/[email protected]))(@glint/[email protected])([email protected])):
dependencies:
'@glimmer/syntax': 0.84.3
babel-plugin-ember-template-compilation: 2.4.1
@@ -16463,6 +16513,8 @@ snapshots:
picocolors: 1.1.1
source-map-js: 1.2.1
+