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

One more or up to three more steps in Imba clever syntax #870

Open
madmaniak opened this issue Aug 28, 2023 · 0 comments
Open

One more or up to three more steps in Imba clever syntax #870

madmaniak opened this issue Aug 28, 2023 · 0 comments
Labels

Comments

@madmaniak
Copy link
Member

madmaniak commented Aug 28, 2023

  1. I just realised there's redundant information about what is style attribute and html/imba attribute.
    We write:
<div[h:20rem w:10rem] attribute=some_data>

But we could write:

<div h:20rem w:10rem attribute=some_data>

# or

<div attribute=some_data h:20rem w:10rem>

# or even

<div h:20rem attribute=some_data w:10rem>

As parser can recognise what is for style and what is another by : and = characters.

  1. I would propose an alias for tag imba-component and allow simply:
<imba-component>

# as an equivalent of

tag imba-component
  <self>

Parser can understand it's a tag declaration because there's no indentation. It could lead to super clean - especially small - files which look just like html.

  1. Both upper proposals are backwards compatible and following not. I'd like to remind one feature of Imba1 which was very clean passing data to the component, like this:
<some-component[person]>

# and then object was accessed inside some-component through `data` like this:

data.name

I was using it a lot and it is great for decorating object - which for example came straight from backend - with a visual part.
Considering that you like 1) proposal it would be possible to reintroduce that feature.
I would change data into some symbol, for example @ so we could write something like this:

tag person-component
  <self>
    <div> @name 
    <div> @surname

# and use it

<person-component[person]>

Pick any or none as you like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant