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

Component with just child component as the markup shows the source code #4

Closed
ArielOfAtlantica opened this issue Sep 6, 2024 · 2 comments
Labels
bug Something isn't working Deployed Fix

Comments

@ArielOfAtlantica
Copy link

What version of Temple are you using?

0.1.4

What OS are you experiencing this issue?

Mac

What Browser are you experiencing this issue?

Google Chrome Latest

Describe the Bug

I have a footer.tml file that looks like this, and loads just fine.

<link rel="import" type="component" href="./manifest.tml" />
<script>
  import { props, children } from '@ossph/temple';
  const { year, href } = props();
  const company = children();
</script>
<footer class="text-center">
  <manifest {year} {href} {company} />
</footer> 

This is what I see (this is okay).
image

When I remove the <footer> like this:

<link rel="import" type="component" href="./manifest.tml" />
<script>
  import { props, children } from '@ossph/temple';
  const { year, href } = props();
  const company = children();
</script> 
<manifest {year} {href} {company} />

It now looks like this:

image

Expected Behavior

When a component just has another component as the markup, it should still render.

To Reproduce

Here are all my templates.

page.dtml

<link rel="import" type="component" href="./footer.tml" />
<style>
  @tailwind base;
  @tailwind components;
  @tailwind utilities;
</style>
<script>
  import { env, props } from '@ossph/temple';
  const { BUILD_ID, APP_DATA, NODE_ENV } = env();
  const { title } = props();
</script>
<html>
  <head>
    <title>{title}</title>
    <link rel="stylesheet" type="text/css" href={`/build/${BUILD_ID}.css`} />
    <script data-app={APP_DATA} src={`/build/${BUILD_ID}.js`}></script>
    <if true={NODE_ENV !== 'production'}>
      <script src="/dev.js"></script>
    </if>
  </head>
  <body>
    <main class="py-24">
      <h1 class="text-center">{title}</h1>
    </main>
    <footer year={2021} href="https://www.acmeinc.com">
      {'Acme Inc'}
    </footer>
  </body>
</html>

footer.tml

<link rel="import" type="component" href="./manifest.tml" />
<script>
  import { props, children } from '@ossph/temple';
  const { year, href } = props();
  const company = children();
</script>
<manifest {year} {href} {company} />

manifest.tml

<script>
  import { props } from '@ossph/temple';
  const { year, href, company } = props();
</script>
&copy; {year} <a href={href}>{company}</a>

Just load this on the browser to see the issue.

Include git repo/fork so we can easily reproduce the issue

No response

@ArielOfAtlantica ArielOfAtlantica added the bug Something isn't working label Sep 6, 2024
cblanquera added a commit that referenced this issue Sep 6, 2024
@cblanquera
Copy link
Collaborator

The fix is now deployed in 0.1.5 - https://www.npmjs.com/package/@ossph/temple/v/0.1.5

@ArielOfAtlantica
Copy link
Author

Thanks working now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Deployed Fix
Projects
None yet
Development

No branches or pull requests

2 participants