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

Prefix Ionic directives with 'ion-' #333

Closed
mlynch opened this issue Dec 16, 2013 · 23 comments
Closed

Prefix Ionic directives with 'ion-' #333

mlynch opened this issue Dec 16, 2013 · 23 comments
Milestone

Comments

@mlynch
Copy link
Contributor

mlynch commented Dec 16, 2013

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.

@adhsu
Copy link

adhsu commented Dec 17, 2013

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?

@dbaq
Copy link

dbaq commented Dec 17, 2013

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.

@mlynch
Copy link
Contributor Author

mlynch commented Dec 17, 2013

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

On Dec 16, 2013, at 6:50 PM, Didier Baquier notifications@github.com 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 mlynch closed this as completed Dec 19, 2013
@ewinslow
Copy link

ewinslow commented Feb 7, 2014

Please reconsider this decision:

  • It's inconsistent with the decision in Rename services to use $ and ionic prefix? #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.

@mlynch
Copy link
Contributor Author

mlynch commented Feb 7, 2014

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

@ewinslow
Copy link

ewinslow commented Feb 7, 2014

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

@adhsu
Copy link

adhsu commented Feb 7, 2014

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

Good point #3 though about new dev team.

@ewinslow
Copy link

ewinslow commented Feb 7, 2014

They might not use a "main one" but any framework that provides similar
directives will conflict.
On Feb 7, 2014 3:46 PM, "adhsu" notifications@github.com wrote:

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

Good point #3 #3 though about
new dev team.

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

@dluxemburg
Copy link

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

@mlynch
Copy link
Contributor Author

mlynch commented Feb 8, 2014

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 ?

@ajoslin
Copy link
Contributor

ajoslin commented Feb 8, 2014

👍 for ion- directive prefix.

On Sat, Feb 8, 2014 at 2:43 PM, Max Lynch notifications@github.com 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//issues/333#issuecomment-34553698
.

@ajoslin
Copy link
Contributor

ajoslin commented Feb 8, 2014

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 andytjoslin@gmail.com wrote:

👍 for ion- directive prefix.

On Sat, Feb 8, 2014 at 2:43 PM, Max Lynch notifications@github.comwrote:

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//issues/333#issuecomment-34553698
.

@ewinslow
Copy link

ewinslow commented Feb 9, 2014

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

@adamdbradley adamdbradley reopened this Feb 9, 2014
@adamdbradley
Copy link
Contributor

I think we should do this and vote for ion-

@sarath2
Copy link

sarath2 commented Feb 11, 2014

👍 Great decision. I vote for ion-

@mlynch
Copy link
Contributor Author

mlynch commented Feb 11, 2014

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

@mlynch
Copy link
Contributor Author

mlynch commented Feb 11, 2014

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

@ewinslow
Copy link

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

@mlynch
Copy link
Contributor Author

mlynch commented Feb 11, 2014

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

@ewinslow
Copy link

Guess I better go make my case then...

@adamdbradley adamdbradley added this to the 0.9.25 milestone Feb 17, 2014
@adamdbradley
Copy link
Contributor

Directive prefixing is scheduled for the 0.9.25 release.

@adamdbradley
Copy link
Contributor

Closed 2c39a21

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 6, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants