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

HTML output is in a .js file #476

Closed
2 tasks done
kylecordes opened this issue Jun 11, 2022 · 5 comments
Closed
2 tasks done

HTML output is in a .js file #476

kylecordes opened this issue Jun 11, 2022 · 5 comments

Comments

@kylecordes
Copy link
Contributor

  • I am interested in helping provide a fix!

Scope

  • This only impacts specific generators/outputs (please list them here):

Describe the bug

The html output target lands in a file with .js extension.

To Reproduce

yarn
yarn ci:build

Then look at packages/e2e-app/output/html/src/components/my-component.js

Expected behavior

HTML output in a .html file, or perhaps consider some other extension indicating it is meant to be included in other HTML? (.inc?), But not .js.

@samijaber
Copy link
Contributor

@PatrickJS Do you have any thoughts on this from your work on the HTML generator?

It might be as simple as adding the right extension here for mitosis build

export const getFileExtensionForTarget = (target: Target) => {

@PatrickJS
Copy link
Contributor

PatrickJS commented Jun 14, 2022

Ive been focusing on webcomponent only. Html output needs some work. It's a little bit confusing what html output should be. Because i's not webcomponent it does make sense to keep them .html files but they're not exactly js components. I guess we could make our own component pattern too

kylecordes pushed a commit to kylecordes/mitosis that referenced this issue Jun 18, 2022
@kylecordes
Copy link
Contributor Author

Sure, my bug report was only at a initial, highly surface level. That the contents of the file should match the extension.

For the real question of what the output should be, does anyone know what the output looks like for existing, already popular component sets packaged as web components? I'm just catching up on email on the weekend as I write this, otherwise I would go research right now...

@PatrickJS
Copy link
Contributor

@samijaber @steve8708 what is the expected html output? Is it the same thing as webcomponent just with no custom elements?

kylecordes pushed a commit to kylecordes/mitosis that referenced this issue Jun 19, 2022
@steve8708
Copy link
Contributor

yeah exactly, the initial thinking was this is useful for very simple things. so can support basic HTML output, event listeners, data bindings. so is useful for codegen for things like Builder. not necessarily sure how it could or ever would child components tho, that is the main known constraint right now

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

No branches or pull requests

4 participants