Skip to content

bug: externalRuntime flag makes @stencil/store changes no trigger render #6040

Closed

Description

@rjborba

Prerequisites

Stencil Version

4.22.2

Current Behavior

When registering components through defineCustomElement on dist-custom-elements output build, @stencil/store does not trigger a rerender on the application. If you force rerender by changing a @State property, only then it is possible to see the store value updated. It only happens when externalRuntime flag is set to false.

Expected Behavior

Store should trigger a re-render as expected.

System Info

System: node 20.12.1
    Platform: linux (6.1.43)
   CPU Model: AMD EPYC (2 cpus)
    Compiler: /project/workspace/node_modules/.pnpm/@[email protected]/node_modules/@stencil/core/compiler/stencil.js
       Build: 1729874537
     Stencil: 4.22.2 🎺
  TypeScript: 5.5.4
      Rollup: 2.56.3
      Parse5: 7.1.2
      jQuery: 4.0.0-pre

Steps to Reproduce

  1. On a Stencil app use build dist-custom-elements with externalRuntime flag set to false
  2. Create a component that consumes and updates a Store value
  3. Createa a React/Vite project and import the Stencil app as dependency
  4. Access import defineCustomElement at {YOU_STENCIL_PROJECT}/dist/components/my-component.js
  5. Display current value of store
  6. Try to call the button that updates the store value

Code Reproduction URL

https://codesandbox.io/p/devbox/stencil-minimal-reproducible-issue-gc9nxh

Additional Information

For the live example just run pnpm dev

Activity

  1. christian-bromann commented on Jan 25, 2025

    @christian-bromann
    Member

    A fix for this has been released today as part of Stencil v4.25.1!

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions