Skip to content

IDE: complete and validate the data object in $component() callback #113

Closed

Description

@JuroOravec

Version

citry 0.5.0

What happened?

When I was recording a demo, I noticed that the data obj in component's JS' $component callback was NOT typed by the LSP. It should be.

Minimal reproduction

class Examples(Component):
    # NOTE: This behavior should be checked with both `js_data` and explicit `JsData`
    def js_data(self, kwargs, slots):
        return {
            "a": "str",
            "b": 1,
        }

    js = """
      $component(({ data }) => {
        // BUG - Writing `data.` should offer `data.a` and `data.b`
        //       as autocomplete suggestions
        // BUG - IDE hints should should suggest `data.b` to be JS `number`,
        //       and `data.a` to be JS `string`
        console.log(data.b)
        // BUG - Unknown fields should raise linter error
        console.log(data.c)
      });
    """

Environment

No response

Activity

  1. added
    bug
    on Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions