Skip to content

Conversation

reakaleek
Copy link
Member

@reakaleek reakaleek commented Feb 20, 2025

Changes

  • Adds unpoly to dynamically load content in "progressive enhancement"-way.

Notes

  • I also evaluated htmx at Add htmx to dynamically load content #545
  • 👍 However, unpoly feels more natural and straight forward to use and fits our use case well
  • 👍 In the future we can also conditionally load content (e.g. the pages navigation)
  • 👎 Unpoly creates a global variable window.up and it has no typescript support.
  • 👎 When unpoly is initialized it messes up existing smooth scroll links. (e.g in ToC nav)

Result

cursorful-unpoly-1740046902275.mp4

@reakaleek reakaleek changed the title Unpoly PoC Add unpoly for dynamic content loading Feb 20, 2025
@reakaleek reakaleek requested a review from a team February 20, 2025 10:15
@reakaleek reakaleek self-assigned this Feb 20, 2025
Comment on lines +10 to +12
<meta name="pages-nav-current-page-id" content="@Model.CurrentDocument.Id">
<meta name="pages-nav-current-page-parent-ids" content="@(string.Join(",", Model.ParentIds))">
<meta name="pages-nav-current-navigation" content="@LayoutViewModel.CurrentNavigationId">
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This data is actually not needed anymore because we don't need to recreate the navigation state. But kept it here just in case.

@reakaleek reakaleek marked this pull request as draft February 20, 2025 13:33
@reakaleek
Copy link
Member Author

Closing in favour of #545

Reason:

Unpoly somehow messes up the scroll smooth behaviour of the table of contents.

@reakaleek reakaleek closed this Feb 21, 2025
@Mpdreamz Mpdreamz deleted the feature/unpoly-poc branch June 12, 2025 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant