Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Nov 4, 2025

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@playhtml/common@0.4.0

Minor Changes

  • 1427a62: Add cursor presence and stable awareness APIs with improved element awareness scoping

    This release adds new APIs for accessing cursor positions and per-user awareness data keyed by stable user IDs, eliminating the need to access internal providers directly.

    New Cursor Presence APIs:

    // Get all cursor presences (slim shape, keyed by stable ID)
    const presences = playhtml.cursorClient.getCursorPresences();
    
    // Subscribe to cursor presence changes
    const unsubscribe = playhtml.cursorClient.onCursorPresencesChange(
      (presences) => {
        // presences is Map<string, CursorPresenceView>
      }
    );
    
    // Get my stable player identity
    const identity = playhtml.cursorClient.getMyPlayerIdentity();
    const stableId = identity.publicKey; // Persists across sessions

    New Awareness API - awarenessByStableId:

    Element awareness is now provided keyed by stable user ID in addition to the array format:

    // Core playhtml
    updateElementAwareness: ({ awareness, awarenessByStableId }) => {
      const userDrunkLevel = awarenessByStableId.get(stableId)?.drunkLevel;
    };
    
    // React withSharedState
    withSharedState(({ data, awareness, awarenessByStableId, myAwareness }) => {
      const userDrunkLevel = awarenessByStableId.get(stableId)?.drunkLevel;
      // ...
    });

    New React Hook:

    import { useCursorPresences } from "@playhtml/react";
    
    function MyComponent() {
      const cursorPresences = useCursorPresences();
      // Map<string, CursorPresenceView> keyed by stable ID
    }

    Breaking Change - Awareness Scope:

    Element awareness now follows cursor scope instead of always being page-specific:

    • If cursors are configured with room: "domain", element awareness is domain-wide
    • If cursors are configured with room: "page", element awareness is page-specific
    • If cursors are configured with room: "section", element awareness is section-specific

    This is more intuitive (your user state follows you) but may affect apps that relied on the old behavior. To restore page-specific awareness when cursors are domain-wide, you can configure cursors to use page scope separately.

    Benefits:

    • Stable user IDs (playerIdentity.publicKey) persist across page refreshes
    • No need to access (playhtml.cursorClient as any).provider - use clean public APIs
    • Easier to correlate cursor positions with user-specific awareness data
    • Awareness scope matches cursor scope for more intuitive behavior
  • 3e385c7: Add composable cursor room configuration with filtering and styling options.

playhtml@2.6.0

Minor Changes

  • 1427a62: Add cursor presence and stable awareness APIs with improved element awareness scoping

    This release adds new APIs for accessing cursor positions and per-user awareness data keyed by stable user IDs, eliminating the need to access internal providers directly.

    New Cursor Presence APIs:

    // Get all cursor presences (slim shape, keyed by stable ID)
    const presences = playhtml.cursorClient.getCursorPresences();
    
    // Subscribe to cursor presence changes
    const unsubscribe = playhtml.cursorClient.onCursorPresencesChange(
      (presences) => {
        // presences is Map<string, CursorPresenceView>
      }
    );
    
    // Get my stable player identity
    const identity = playhtml.cursorClient.getMyPlayerIdentity();
    const stableId = identity.publicKey; // Persists across sessions

    New Awareness API - awarenessByStableId:

    Element awareness is now provided keyed by stable user ID in addition to the array format:

    // Core playhtml
    updateElementAwareness: ({ awareness, awarenessByStableId }) => {
      const userDrunkLevel = awarenessByStableId.get(stableId)?.drunkLevel;
    };
    
    // React withSharedState
    withSharedState(({ data, awareness, awarenessByStableId, myAwareness }) => {
      const userDrunkLevel = awarenessByStableId.get(stableId)?.drunkLevel;
      // ...
    });

    New React Hook:

    import { useCursorPresences } from "@playhtml/react";
    
    function MyComponent() {
      const cursorPresences = useCursorPresences();
      // Map<string, CursorPresenceView> keyed by stable ID
    }

    Breaking Change - Awareness Scope:

    Element awareness now follows cursor scope instead of always being page-specific:

    • If cursors are configured with room: "domain", element awareness is domain-wide
    • If cursors are configured with room: "page", element awareness is page-specific
    • If cursors are configured with room: "section", element awareness is section-specific

    This is more intuitive (your user state follows you) but may affect apps that relied on the old behavior. To restore page-specific awareness when cursors are domain-wide, you can configure cursors to use page scope separately.

    Benefits:

    • Stable user IDs (playerIdentity.publicKey) persist across page refreshes
    • No need to access (playhtml.cursorClient as any).provider - use clean public APIs
    • Easier to correlate cursor positions with user-specific awareness data
    • Awareness scope matches cursor scope for more intuitive behavior
  • 3e385c7: Add composable cursor room configuration with filtering and styling options.

  • 7cc91bd: Add removeElementData API for cleaning up orphaned element data

    This release adds a new removeElementData(tag, elementId) function to both the core playhtml package and the React wrapper. This function allows you to clean up orphaned data when elements are deleted, preventing accumulation of stale data in the database.

    Usage:

    import { removeElementData } from "@playhtml/react";
    
    // Or access via playhtml object
    import { playhtml } from "@playhtml/react";
    playhtml.removeElementData("can-move", elementId);

Patch Changes

  • Updated dependencies [1427a62]
  • Updated dependencies [3e385c7]
    • @playhtml/common@0.4.0

@playhtml/react@0.8.0

Minor Changes

  • 1427a62: Add cursor presence and stable awareness APIs with improved element awareness scoping

    This release adds new APIs for accessing cursor positions and per-user awareness data keyed by stable user IDs, eliminating the need to access internal providers directly.

    New Cursor Presence APIs:

    // Get all cursor presences (slim shape, keyed by stable ID)
    const presences = playhtml.cursorClient.getCursorPresences();
    
    // Subscribe to cursor presence changes
    const unsubscribe = playhtml.cursorClient.onCursorPresencesChange(
      (presences) => {
        // presences is Map<string, CursorPresenceView>
      }
    );
    
    // Get my stable player identity
    const identity = playhtml.cursorClient.getMyPlayerIdentity();
    const stableId = identity.publicKey; // Persists across sessions

    New Awareness API - awarenessByStableId:

    Element awareness is now provided keyed by stable user ID in addition to the array format:

    // Core playhtml
    updateElementAwareness: ({ awareness, awarenessByStableId }) => {
      const userDrunkLevel = awarenessByStableId.get(stableId)?.drunkLevel;
    };
    
    // React withSharedState
    withSharedState(({ data, awareness, awarenessByStableId, myAwareness }) => {
      const userDrunkLevel = awarenessByStableId.get(stableId)?.drunkLevel;
      // ...
    });

    New React Hook:

    import { useCursorPresences } from "@playhtml/react";
    
    function MyComponent() {
      const cursorPresences = useCursorPresences();
      // Map<string, CursorPresenceView> keyed by stable ID
    }

    Breaking Change - Awareness Scope:

    Element awareness now follows cursor scope instead of always being page-specific:

    • If cursors are configured with room: "domain", element awareness is domain-wide
    • If cursors are configured with room: "page", element awareness is page-specific
    • If cursors are configured with room: "section", element awareness is section-specific

    This is more intuitive (your user state follows you) but may affect apps that relied on the old behavior. To restore page-specific awareness when cursors are domain-wide, you can configure cursors to use page scope separately.

    Benefits:

    • Stable user IDs (playerIdentity.publicKey) persist across page refreshes
    • No need to access (playhtml.cursorClient as any).provider - use clean public APIs
    • Easier to correlate cursor positions with user-specific awareness data
    • Awareness scope matches cursor scope for more intuitive behavior
  • 3e385c7: Add composable cursor room configuration with filtering and styling options.

  • 7cc91bd: Add removeElementData API for cleaning up orphaned element data

    This release adds a new removeElementData(tag, elementId) function to both the core playhtml package and the React wrapper. This function allows you to clean up orphaned data when elements are deleted, preventing accumulation of stale data in the database.

    Usage:

    import { removeElementData } from "@playhtml/react";
    
    // Or access via playhtml object
    import { playhtml } from "@playhtml/react";
    playhtml.removeElementData("can-move", elementId);

Patch Changes

  • Updated dependencies [1427a62]
  • Updated dependencies [3e385c7]
  • Updated dependencies [7cc91bd]
    • playhtml@2.6.0
    • @playhtml/common@0.4.0

@playhtml/extension@0.1.6

Patch Changes

  • Updated dependencies [1427a62]
  • Updated dependencies [3e385c7]
  • Updated dependencies [7cc91bd]
    • playhtml@2.6.0
    • @playhtml/common@0.4.0
    • @playhtml/react@0.8.0

@github-actions github-actions bot force-pushed the changeset-release/main branch 3 times, most recently from 5878b05 to c4747fb Compare November 10, 2025 18:00
@github-actions github-actions bot force-pushed the changeset-release/main branch 3 times, most recently from 90d6a98 to 0041484 Compare November 19, 2025 23:05
@github-actions github-actions bot force-pushed the changeset-release/main branch 2 times, most recently from 1149234 to 657c65b Compare November 21, 2025 07:02
@github-actions github-actions bot force-pushed the changeset-release/main branch from 657c65b to 090917e Compare December 5, 2025 02:40
@github-actions github-actions bot force-pushed the changeset-release/main branch 6 times, most recently from b7e6c92 to 3e47b3b Compare January 9, 2026 19:29
@github-actions github-actions bot force-pushed the changeset-release/main branch 2 times, most recently from 009995b to 66063b4 Compare January 19, 2026 23:06
@github-actions github-actions bot force-pushed the changeset-release/main branch 5 times, most recently from fa0b848 to 7a4fdee Compare February 4, 2026 22:29
@github-actions github-actions bot force-pushed the changeset-release/main branch from 7a4fdee to 893e733 Compare February 12, 2026 00:30
@github-actions github-actions bot force-pushed the changeset-release/main branch from 893e733 to 35720b2 Compare February 12, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants