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

Treat module scrope correctly for Svelte and Vue #1311

Open
nmn opened this issue Dec 3, 2023 · 0 comments
Open

Treat module scrope correctly for Svelte and Vue #1311

nmn opened this issue Dec 3, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@nmn
Copy link

nmn commented Dec 3, 2023

I am interested in helping provide a fix!

No

Which generators are impacted?

  • Svelte
  • Vue

Reproduction case

https://mitosis.builder.io/?outputTab=IYOw5grgNsBOQ%3D%3D%3D&code=JYWwDg9gTgLgBAbzgVwM4FMDKMCGN1wC%2BcAZlBCHAEQACARssADYAm6UAdMBAPQjAwIqYKioBuAFChIsOACo4OVHFQwAnk3QAPUuUoByGqo3aAVqh7HNW%2FZIkBjCADtVK9ZuUBeNya0d7UOh46AAUCBJwcHRK6ABciBGRcI5M0PH6gSz6ADSJhBKEAJR22jLwbCQ4yEzwJMhO9jDcTnAAsmoAwhSQTuhOMCFg5GCohQmRji7wANpOOCDo2SroMABy8%2BgAunDeaFi4%2BCFU2OgAbuhUxRKJgTDIUC0hiZEAPCzApwB8z0kvwE5gZAwH5JRAccFWdCoDhDCAjEKQ6HRDCFfKg0GnHBMZDoTwIOYLNHoyLODoACxwTgA5riECEzn0YGNPJ9lmsNvTzv0OLgoDSYBxMdj0KiQXAeN9iQAJdBMVIAQjgAElkpS4FB6nB%2FnAAEpBRpLABqOKWmAgTGALCW0DgABlgABHRgseU%2FF48d5fRJXQhAA

Expected Behaviour

Any constants define outside the component function body should be treated as follows:

In Svelte, it should be output in a <script context="module"> tag

In Vue, it should go into a <script> tag without the setup attribute.

Actual Behaviour

Currently module scope gets mixed with component scope.

Additional Information

No response

@nmn nmn added the bug Something isn't working label Dec 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant