Imba code Snippits!

Here is something I have been working on this weekend and am pretty happy with how it is coming along! The goal was to generate something to highlight my Imba code snippits
Imba version: 1.5.2

Things I am most happy about:

  • Absolutely no javascript added! All functionality through imba code alone!
  • easy to follow, easy to read code
  • scalable and reusable, easy to plug in new rule-sets or restyle and import into a new project

Things I would have liked to be easier:

  • Iterating over an array and returning a new array as a result (like I can do with
  • inline scoped CSS still not working on imba 1.52
  • some bugs with lonely operator ?
  • styling, I am just not very good at it yet
  • . or : ? such a pain, This is somewhere Imba v2 is much better

Things I learned:

  • how to pass default values to a prop
  • ternary operators in imba if ... then... else ...
  • the power of the keyword hash in Imba
  • It is difficult to open a text file by path in javascript, and Imba doesn’t have an implimentation for this

Open to any feedback on logic or style, though I purposefully used a more ruby-like style for numerous reasons which I would love to discuss in depth if anyone is curious!

Also Happy to answer any questions if anyone can think of any, cheers!

1 Like

Cool. What’s stoping you from right click the Imba module and upgrading to 1.5.3?

Good feedback in there :+1:

If you want to read a file on Node.js you would use the file system module. In the browser you have the fetch API. If you want to handle uploads, see Using files from web applications. The examples are in JavaScript but should be straight forward to translate.

When I upgrade the module it stays at 1.5.2, the sandbox I googled and started building on was 1.3.3 and I upgraded from it, so I’m not sure why I can’t upgrade to 1.5.3 :man_shrugging:

The fetch API looks super helpful, thanks! I will start plugging it in and see if I can get my text snippets stored as separate text files, looks like the fetch api is pretty promise heavy, so it will be really exciting to flex some Of Imba’s Async functionality :+1:

My bad, the 1.5.3 version has not been released but it does not fix the inlined scope CSS issue IIRC. Did you create a issue with a minimal reproducer?

I havn’t yet, the issue is fixed on Imba v2 and so I can’t imagine it getting resolved anytime soon (since so much is going into getting Imba v2 out into production), I havn’t been quiet about the fact that the current Imba v2 has made many changes that lead me to prefer imba v1, I have a work around for v1 that I use (It is called one really, really big css file :wink: ).

That said I have been digging through the issues on. github looking for one tagged with “help wanted” that I can pickup and work on-- maybe once I tackle a few small isues I can start working on improving the Imba v1 experience for other people who might feel the same way, and open issues for problems Like this.

tl;dr no, I haven’t because I don’t think it would be addressed since it has been “fixed” in the version of Imba that is recommended for use

That’s very cool. it’s looking great.

1 Like