Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

refactor(): add directive prefixes #157

Closed
ProLoser opened this issue Feb 19, 2013 · 28 comments
Closed

refactor(): add directive prefixes #157

ProLoser opened this issue Feb 19, 2013 · 28 comments

Comments

@ProLoser
Copy link
Member

Creating this since only the group thread existed previously.

I was working today and realized the AngularUI version of modal is broken-ish. I want to use the Bootstrap version, but unfortunately everywhere I have a modal class will start having breaking because the bootstrap AND angularUI versions will start doubling up.

This lib really needs to be prefixed, it's sort of frustrating.

https://groups.google.com/forum/?fromgroups=#!searchin/angular-ui/prefix/angular-ui/WPg58BFQDJc/kikQuy5OAcsJ

@ajoslin
Copy link
Contributor

ajoslin commented May 22, 2013

+1 we should get to this. Plan it for 0.4.0?

Also we should decide on a prefix ... since we have so many requests to support zurb someday.

@joshdmiller
Copy link
Contributor

Agreed. And I think bs- is the best bet; it somewhat excludes Zurb but the project is called "Bootstrap", so unless we re-brand it, which doesn't make sense right now, then bs- seems most self-evident.

@ajoslin
Copy link
Contributor

ajoslin commented May 22, 2013

OK! Who wants to write a script to do 99% of the work for this for us? :-)

@joshdmiller
Copy link
Contributor

Shell scripts are my friend. A few sed commands should do the trick. Unless someone has her heart set on it, I'll take a stab later today.

@ajoslin
Copy link
Contributor

ajoslin commented May 22, 2013

Go for it! 💃

Make sure it replaces the docs' html in addition to the source files.

@joshdmiller
Copy link
Contributor

Just an update, I did write a script like a week ago that ran a bunch of sed commands, but it caused a few little problems that are unique to specific directives (as expected). I plan on finishing it in the next day or two and then I'll submit a PR and post the script here. Sorry for the delay.

@ProLoser
Copy link
Member Author

You guys need to do this. I'm very annoyed that I can't use the HTML5 <progress> element without running into errors and having to specify every module EXCEPT ui.bootstrap.progress.

Seriously, it's annoying. You guys need to add prefixes./

@ajoslin
Copy link
Contributor

ajoslin commented Jun 21, 2013

@joshdmiller any progress?

@chrisirhc
Copy link
Contributor

bs- or ui- are good possibilities.

There's one other thing, there's also the possibility of allowing custom prefixes by using $compileProvider.directive() to register the directives and providing it with a constant.

I think this is a really good use case for module constants.

However, for this to work well, users must rely on the custom module build functionality to generate the JS files (so that it generates the files with the correct header) and it will break the ability to just download the separate JS files straight from the repo. I think that's a decent compromise, though.

I'll be happy to post an example on how to do this (it's getting late now, otherwise I'll whip it out) if there are doubts about how to do it. I realized this as I was reading https://github.com/angular/angular.js/blob/master/src/AngularPublic.js#L139-L158 .

@mvhecke
Copy link
Contributor

mvhecke commented Jan 19, 2014

@chrisirhc I think ui- would be the best prefix as the organization is angular-ui, it however shouldn't conflict with the other projects. About the allowing custom prefixes, this would be a great idea. At this point I think that most people already use the custom build process, so I don't really see a compromise though. Shouldn't this discussion be part of #1530?

@AgDude
Copy link

AgDude commented Jul 23, 2014

Since this issue is still lingering, I'll add my opinion. First off, I think ui makes sense for a prefix, and for a such a widely used package this seems like a serious issue to address.

With regard to @chrisirhc comment about custom builds, don't force users to do that. Making it an option might be nice, but encouraging it prevents users from getting the benefits of using a CDN.

@pjfsilva
Copy link

Any news about this? This seems to be a "blocker" to many people and doesn't seem very hard to implement...

@ilanbiala
Copy link

+1 please resolve this issue.

@pfraces
Copy link

pfraces commented Nov 27, 2014

+1

@reidlai
Copy link

reidlai commented Dec 5, 2014

I have already merge bootstrap-sass and angular-ui/bootstrap in a new project. Please try and give me some advice. Thanks.

http://github.com/reidlai/Pluzero-Angular-Bootstrap

@samuelkitazume
Copy link

Me and my team were thinking about implementing ui-bootstrap on our work's project, but this issue cant be ignored. =/ Any idea when the solution is coming? these tools seems so appealing!

@dlwhiteman
Copy link

I understand there are lots of frameworks out there, and it would be impossible not to collide with one of them. That said, ui-bootstrap and angular-strap are two very popular frameworks, so it would seem to be a fairly common issue to have this collision.

This is clearly a hot issue on the angular-strap issues list as well: mgcrea/angular-strap#521

@bzitzow
Copy link

bzitzow commented Jan 27, 2015

+1

@ryanhburbank
Copy link

prefixing would be fantastic, +1

@caseyhoward
Copy link

+1 for bs

@julian-iFactory
Copy link

+1 - This issue has been an annoyance for a long time. Prefixing vendor namespace also makes it a lot easier to figure out at a glance who the vendor of a directive is, you can then quickly refer to their docs for help.

@JetFault
Copy link

+1 for any kind of prefix

@rvanbaalen
Copy link
Contributor

Guys. Decide on which prefix to use (ui, bs, ngui, uibs, bsui..), create a branch where these changes should be implemented and let everyone throw PR's at it so we can all chip in and help to get this over with?

It's been more than a year two years since this issue was recognised. It's time to squash it and move on. And I'm willing to help doing so.

I would vote against automating this with shell scripts though. That just calls for issues on the long run which could've been caught when going over this line by line.

@Foxandxss
Copy link
Contributor

Long time issue indeed. We are going to do it for release 1.0 (when we get up to date with angular and bootstrap) since it is when we can change the API. After that we will do semver as well.

@hugsbrugs
Copy link

Where are we ?

I'm using angularjs 1.3.3, ui-bootstrap-tpls-0.12.1.min.js (and a bunch of other plugins) and still get this error :

[$compile:multidir] http://errors.angularjs.org/1.3.3/$compile/multidir?p0=match&p1=typeaheadMa…%3D%22match%22%20query%3D%22query%22%20template-url%3D%22templateUrl%22%3E

Where can I manually change the match directive name to avoid this conflit (If I have correctly read tour potst ! ) ??

@dmitriz
Copy link

dmitriz commented Apr 20, 2015

Proposal

  • Add names to the anonymous functions defining directives.
  • Add prefixed directives declarations linking to those functions.

If this is considered a breaking change, follow the same route as in my proposal
#3396 (comment)

@skidvd
Copy link

skidvd commented May 18, 2015

+1

@rvanbaalen
Copy link
Contributor

We're moving all prefix-related discussion to one topic: #3396

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

No branches or pull requests