-
Notifications
You must be signed in to change notification settings - Fork 20
Add support for Angular 2 #7
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
base: master
Are you sure you want to change the base?
Conversation
|
I wonder if we could do better. I expect the bundles we currently have to go away in the next few months for most serious apps - those apps will either bundle their own Angular or they will use an alternative building method that we are working on. The problem is that there are many constraints at play:
Given these constraints, the number of options we have is quite limited. The fact that Angular 2 doesn't use any distinctive html tags or attributes means that we have even fewer options. I think we should add the version object into Angular 2. We wanted to do that regardless. But that will not help us with lazy loaded apps. We could set a timer and check after 1 second but that feels slightly lame, inefficient and on slow connection we'd still miss Angular (which might be ok, since on slow connections users have other things to worry about). Other ideas? With regards to the icon, could we just use Angular 1 and Angular 2 icons to distinguish between the two? I know that the difference is not big but it might be sufficient and consistent with our branding. If you want people to report more Angular 2 sites, we should make it possible for ng-detector to autosubmit Angular sites on the first visit (after people opt-in to that mode) to a shared datastore. But that's a separate issue that we should deal with later. |
|
Thanks Igor for your thoughts 1. Version object for Angular 2 2. Icons 3. Auto-submitting
|
How would this work?
If done properly then I don't see why this shouldn't work. (we wouldn't be checking the url but rather if
let's start with just the original icons and if we need to highlight the version difference then we'll add the badges.
I think the extension should keep local db of all angular sites already visited and posted so that we don't post to the db more often than we need to (performance and privacy concerns). We should also not post any urls not reachable from the internet (protected/intranet sites). And there should be a black list for sites people don't want to expose. The rest sounds good. |
|
Regarding item 1, it may be possible to monitor network traffic using the chrome.webRequest API. I've seen Chrome apps like this one that seem to do this. After each network request that has a javascript file, ng-detector could check if the Regarding item 2, sounds good about the icons. I've updated the PR. Regarding item 3, makes sense about using a local db. How would the extension detect that a site is not public? I haven't done this before so curious how it could be done. Here's the current workflow with a local db:
|
This PR adds support for detecting Angular 2 apps with ng-detector.
Description
When a user visits an Angular 2 app, this extension now adds:
Regarding item 2, my thinking here is that it would be easier and quicker to see a differently colored icon and recognize an Angular 2 app instead of relying on the title alone. However, this should be consistent with branding for Angular 2, so let me know what your thoughts are here
To test