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

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

Open
3 tasks done
rjborba opened this issue Nov 5, 2024 · 0 comments
Open
3 tasks done
Labels

Comments

@rjborba
Copy link

rjborba commented Nov 5, 2024

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

@ionitron-bot ionitron-bot bot added the triage label Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant