ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

Prefix Ionic directives with 'ion-'

Open mlynch opened this issue 12 years ago • 23 comments

We are debating whether to add prefixes to Ionic directives. So, instead of doing

<side-menus> it would be <ionic-side-menus> or <ion-side-menus>. Nav router would be <div ionic-nav-router> or <div ion-nav-router> instead of <div nav-router>.

The arguments for making the change is it makes it more clear which directives are ionic-powered, and which ones aren't. Also it reduces the possibility of clashes with other directives from other libraries.

The arguments against are that it adds extra clutter, makes the code less pretty IMO, and might not be necessary if Ionic has most of the features we need.

We'd love to hear thoughts and opinions on this change.

mlynch avatar Dec 16 '13 19:12 mlynch

Not really necessary in my opinion - less typing and it's unlikely that you'll run into collisions - when will you ever have two side menus?

adhsu avatar Dec 17 '13 00:12 adhsu

Yep I am thinking the same thing. Ionic is gonna be the main framework used in an app, I didn't see any possible collisions so far with other components.

dbaq avatar Dec 17 '13 00:12 dbaq

Thanks for the input! I'm on the same page as well

On Dec 16, 2013, at 6:50 PM, Didier Baquier [email protected] wrote:

Yep I am thinking the same thing. Ionic is gonna be the main framework used in an app, I didn't see any possible collisions so far with other components.

— Reply to this email directly or view it on GitHub.

mlynch avatar Dec 17 '13 00:12 mlynch

Please reconsider this decision:

  • It's inconsistent with the decision in #380
  • Conflicts with many ui widgets and libraries out there. Maybe not right now, or for the ones you looked at, or whatever, but it will conflict.
  • It is very easy to tell where a directive came from when its prefixed (think of apps 6 months down the line with new dev team). "Is that our custom side menu, or ion's side menu, or the foobaz side menu?"

I see a lot of big UI frameworks failing to prefix and its really bothersome because you can't mix and match them. It's just too confusing/dangerous.

ewinslow avatar Feb 07 '14 22:02 ewinslow

@ewinslow sorry for the confusion, we already decided to prefix with $ionic. Or were you referring to something else?

mlynch avatar Feb 07 '14 22:02 mlynch

Services are prefixed. Directives are not, according to this ticket

ewinslow avatar Feb 07 '14 23:02 ewinslow

@ewinslow as mentioned before though, would anyone really be using another main framework besides Ionic?

Good point #3 though about new dev team.

adhsu avatar Feb 07 '14 23:02 adhsu

They might not use a "main one" but any framework that provides similar directives will conflict. On Feb 7, 2014 3:46 PM, "adhsu" [email protected] wrote:

@ewinslow https://github.com/ewinslow as mentioned before though, would anyone really be using another main framework besides Ionic?

Good point #3 https://github.com/driftyco/ionic/issues/3 though about new dev team.

Reply to this email directly or view it on GitHubhttps://github.com/driftyco/ionic/issues/333#issuecomment-34519696 .

ewinslow avatar Feb 07 '14 23:02 ewinslow

+1 for prefixing. Even Angular core directives have the ng-.

dluxemburg avatar Feb 08 '14 19:02 dluxemburg

I'm down for it. One benefit is it makes it clear which directives do something. Maybe ion-tabs or ionic-tabs or something else. Thoughts @adamdbradley @ajoslin ?

mlynch avatar Feb 08 '14 19:02 mlynch

:+1: for ion- directive prefix.

On Sat, Feb 8, 2014 at 2:43 PM, Max Lynch [email protected] wrote:

I'm down for it. One benefit is it makes it clear which directives _do_something. Maybe ion-tabs or ionic-tabs or something else. Thoughts @adamdbradleyhttps://github.com/adamdbradley @ajoslin https://github.com/ajoslin ?

Reply to this email directly or view it on GitHubhttps://github.com/driftyco/ionic/issues/333#issuecomment-34553698 .

ajoslin avatar Feb 08 '14 19:02 ajoslin

It would also be cool to link people to a script which they could run to migrate their projects (the same one we'd write to search/replace the source).

On Sat, Feb 8, 2014 at 2:44 PM, Andy Joslin [email protected] wrote:

:+1: for ion- directive prefix.

On Sat, Feb 8, 2014 at 2:43 PM, Max Lynch [email protected]:

I'm down for it. One benefit is it makes it clear which directives _do_something. Maybe ion-tabs or ionic-tabs or something else. Thoughts @adamdbradleyhttps://github.com/adamdbradley @ajoslin https://github.com/ajoslin ?

Reply to this email directly or view it on GitHubhttps://github.com/driftyco/ionic/issues/333#issuecomment-34553698 .

ajoslin avatar Feb 08 '14 19:02 ajoslin

You guys are great for reconsidering this. Maybe it would make sense to reopen this issue?

ewinslow avatar Feb 09 '14 02:02 ewinslow

I think we should do this and vote for ion-

adamdbradley avatar Feb 09 '14 18:02 adamdbradley

:+1: Great decision. I vote for ion-

sarath2 avatar Feb 11 '14 04:02 sarath2

I vote for ion as well. It's kind of fun, like little ions all over the page!

mlynch avatar Feb 11 '14 04:02 mlynch

Oh and @ewinslow, I like to think we are somewhat reasonable people ;)

mlynch avatar Feb 11 '14 04:02 mlynch

:). Now if I can get you to prefix the classes too, that would really seal the deal!

ewinslow avatar Feb 11 '14 04:02 ewinslow

@ewinslow I said somewhat reasonable, that's just ludicrous! ;)

mlynch avatar Feb 11 '14 04:02 mlynch

Guess I better go make my case then...

ewinslow avatar Feb 11 '14 04:02 ewinslow