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

Not possible to omit a {block} in a snippet import if it's declared in the snippet #6821

Open
dword-design opened this issue Feb 1, 2025 · 3 comments
Labels
bug 🐞 Something isn't working

Comments

@dword-design
Copy link

If I have this snippet:

(foo) {
  reverse_proxy localhost:3000
  {block}
}

This works:

example.com {
  import foo {
    file_server
  }
}

But this doesn't:

example.com {
  import foo
}

So basically the block is always mandatory and it's not possible to not declare it.

(The example doesn't make any sense, it's basically to show the issue.)

@francislavoie
Copy link
Member

FYI @elee1766

@francislavoie francislavoie added the bug 🐞 Something isn't working label Feb 1, 2025
@elee1766
Copy link
Contributor

elee1766 commented Feb 1, 2025

hmmm yes. I guess this is something I didnt think of.

so I guess In my head I wanted to make the block required since I didn't want my sre/developers to "forget" that they needed to supply a block, because it's not so clear if a snippet uses a block or not.(without looking at the snippet. which is something they usually wouldn't have written)

for now of course you should be able to put just an empty block like {}, and it will work I hope?

I think you're right that probably it should just silently substitute to nothing? I can see a use case where you want to provide optional options and therefore would want to skip the block.

@dword-design
Copy link
Author

dword-design commented Feb 1, 2025

#@elee1766 {} doesn't work but { log } does 😋.

I come from the Vue world and there are slots for components where you can render additional stuff and when the user doesn't implement them, they won't ne shown.

Apart from that it's a great project and I'm happy now to have a server now that I can maintain as a frontend dev without all the admin hassle.

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

3 participants