Skip to content

Commit 301bd39

Browse files
serpentbladeclaude
andcommitted
refactor(fullcalendar): revert Angular options workaround now that the emitter aliases template-referenced imports
FullCalendarAllSlotsDemo previously hoisted the passthrough :options object into a `const calendarOptions` <script> declaration purely to pin the `@fullcalendar/list` default import — Angular AOT would otherwise tree-shake an import whose only reference lived inside the template-binding object literal, leaving listPlugin undefined and crashing FullCalendar's plugin-hook builder. The Angular emitter now aliases a <script> value-import referenced in a template expression to a `protected readonly listPlugin = listPlugin` component field, so the natural inline form is correct on all six targets. Pass the options inline again (:options="{ ..., plugins: [listPlugin] }") and keep the `import listPlugin from '@fullcalendar/list'`. The VR full-calendar-slots [angular] cell passes with the inline form end-to-end. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 9a0a2d9 commit 301bd39

1 file changed

Lines changed: 10 additions & 14 deletions

File tree

examples/demos/FullCalendarAllSlotsDemo.rozie

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,21 +69,17 @@
6969
// consumer imports it and passes it through the wrapper's now-merged
7070
// :options.plugins, which is the exact opt-in plugin-extension mechanism this
7171
// demo exercises.
72+
//
73+
// `listPlugin` is referenced INLINE in the template's :options binding below —
74+
// the natural authoring form. This is now correct on all six targets: the
75+
// Angular emitter aliases a <script> value-import referenced in a template
76+
// expression to a `protected readonly listPlugin = listPlugin` component field,
77+
// so the bare template reference resolves against the instance AND the import
78+
// stays live (Angular AOT would otherwise tree-shake an import whose only use is
79+
// in the separate template compilation context). The other five targets share
80+
// one module scope and never needed the workaround.
7281
import listPlugin from '@fullcalendar/list'
7382

74-
// Build the passthrough :options object in the SCRIPT (not inline in the
75-
// template) so the `listPlugin` import is referenced from a <script> statement.
76-
// Angular's AOT pipeline tree-shakes a default import that is ONLY referenced
77-
// inside a template-binding object literal — leaving `listPlugin` undefined at
78-
// runtime and crashing FullCalendar's plugin-hook builder. Referencing it here
79-
// pins the import on every target (the other five are unaffected either way).
80-
const calendarOptions = {
81-
weekNumbers: true,
82-
dayMaxEvents: 2,
83-
businessHours: { startTime: '09:00', endTime: '17:00' },
84-
plugins: [listPlugin],
85-
}
86-
8783
// All seed events land on a SINGLE pinned day (2026-06-15) so that — with the
8884
// passthrough dayMaxEvents: 2 — the day overflows past 2 and the engine renders
8985
// a `.fc-more-link` (which routes through the moreLink portal-slot). Fixed ISO
@@ -160,7 +156,7 @@ const remount = () => { $data.calendarMounted = true }
160156
:height="480"
161157
:selectable="true"
162158
:editable="true"
163-
:options="calendarOptions"
159+
:options="{ weekNumbers: true, dayMaxEvents: 2, businessHours: { startTime: '09:00', endTime: '17:00' }, plugins: [listPlugin] }"
164160
@eventMouseEnter="onEventMouseEnter"
165161
@eventMouseLeave="onEventMouseLeave"
166162
@unselect="onUnselect"

0 commit comments

Comments
 (0)