Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSR render incomplete #205

Open
happyleavesaoc opened this issue Nov 15, 2023 · 2 comments
Open

SSR render incomplete #205

happyleavesaoc opened this issue Nov 15, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@happyleavesaoc
Copy link

I'm attempting to use event-calendar with sveltekit's SSR-only mode, but the server-rendered calendar is not fully initialized. I suspect that onMount may be the culprit here.

Example component:

<script>
import Calendar from '@event-calendar/core';
import DayGrid from '@event-calendar/day-grid';
import '@event-calendar/core/index.css';

let options = {
    view: 'dayGridMonth',
    events: [
        {start: '2023-11-01', end: '2023-11-02', title: 'event', allDay: true}
    ]
};

</script>

<Calendar options={options} plugins={[DayGrid]} />

Actual output:
image

Expected output:
image

(this was generated by turning on CSR in addition to SSR)

@vkurko
Copy link
Owner

vkurko commented Nov 16, 2023

Yes, unfortunately, that's the way it works now. The event placement algorithm at some points requires information about the size of DOM elements, which becomes available only when rendering these elements in the browser. Also, various optimizations use deferred computation, which is not performed in SSR.

I'll leave this ticket open so that I can improve SSR support over time (if possible).

@vkurko
Copy link
Owner

vkurko commented Nov 16, 2023

Just for reference #162 (comment)

@vkurko vkurko added the enhancement New feature or request label Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants