rimmel icon indicating copy to clipboard operation
rimmel copied to clipboard

Can't bind future values outside of HTML tags

Open dariomannu opened this issue 3 months ago • 10 comments

Rimmel has spent a great deal of effort focusing on the most advanced use cases for templates with async/observable parts and complex structures.

Some excessively "basic" use cases have been deprioritised. One is the case of a template containing no HTML tags that references any future (promise or observable) value.

The following doesn't work:

const deferredValue = Promise.resolve('world');

document.body.innerHTML = rml`
    Hello, ${deferredValue}
`;

It works if it's wrapped in at least an HTML tag. A fix is required in the parser around the correspnding/relevant regular expression.

Link to reproduce

dariomannu avatar Sep 23 '25 15:09 dariomannu

Hi @dariomannu , I will take up this issue can you assign me under the hacktoberfest tag

Pawankalyan2023 avatar Sep 23 '25 17:09 Pawankalyan2023

Hi @dariomannu!!,

I see it was assigned a couple of weeks ago and wanted to check if it's still being worked on. If the issue is now available, I would be happy to take it up.

the-matrixneo avatar Oct 08 '25 11:10 the-matrixneo

Hi @Pawankalyan2023 are you actively working on this issue or you'd rather pass it to @the-matrixneo? Thanks.

dariomannu avatar Oct 08 '25 11:10 dariomannu

Yeah , I am working on this

Pawankalyan2023 avatar Oct 08 '25 13:10 Pawankalyan2023

Perfect, thanks, @Pawankalyan2023. It should be like a 1-2 liner fix plus test coverage, I believe. If you're stuck or anything's unclear, don't worry, we're here to help.

dariomannu avatar Oct 08 '25 13:10 dariomannu

@dariomannu can I work on this issue?

yashraj4 avatar Nov 05 '25 05:11 yashraj4

Hi @yashraj4 I think @Pawankalyan2023 is not really working on this anymore, so you're welcome to take this over. Please give a shout if you find anything unclear or you're stuck. If you like Rimmel, feel free to leave a star to help others find it more easily 🔍

dariomannu avatar Nov 06 '25 18:11 dariomannu

Do I need to add a test case in parser\parser.test.ts and/or add a relevant button in kitchen-sink\index.ts to test this?

yashraj4 avatar Nov 09 '25 10:11 yashraj4

Unit tests, yes, please :)

Kitchen sink is not necessary unless we feel this is an interesting case enough to keep there for playing/experimentation, manual tests...

dariomannu avatar Nov 09 '25 11:11 dariomannu