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

feat(zeroconf): add cordova-plugin-zeroconf support #1260

Merged
merged 2 commits into from
Mar 28, 2017
Merged

feat(zeroconf): add cordova-plugin-zeroconf support #1260

merged 2 commits into from
Mar 28, 2017

Conversation

tkem
Copy link
Contributor

@tkem tkem commented Mar 26, 2017

This PR adds support for cordova-plugin-zeroconf, as requested in #636.

Please note that I only tested the browsing/watching functionality, since I've never published a zeroconf service myself (on a mobile device) and I wouldn't really know how to test that.

A note on naming: The plugin uses all lowercase zeroconf as pluginRef and in examples, but uses camel-case ZeroConf internally and sporadically in the docs. However, the official zeroconf site refers to Zeroconf with initial caps only. I decided to go with the latter, even if that may look unfamiliar to some (but hey, so does Geolocation). It also avoid naming the package zero-conf which isn't used widely, and might cause even more confusion.
Yes, sometimes I do pay attention to such details ;-)

Copy link
Collaborator

@ihadeed ihadeed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just minor changes. Thanks!


/**
* Publishes a new service.
* @usage
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move all the @usage documentation to the main @usage block in the class documentation.

The usage here will not be rendered in the docs page.

Please apply this fix to all methods below. Simply cut & paste them above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied this style from the BLE plugin, and you're right, this isn't rendered in the docs page, too.
Do I guess this should be changed for at least the BLE plugin also, and probably other plugins are affected, too.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this should be changed in the BLE plugin and any other similar occurrences. All usage should stay in the main @usage block in the class documentation.

Thanks!

import { Cordova, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';

export interface ZeroconfService {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this to ZeroConfService

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rationale, please?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, forget about the changes regarding the capitalization of the name.

I assumed ZeroConf is a brand name since the plugin repo has it written in that way. I traced this thing down to this page: http://www.zeroconf.org/ and realized it's called Zeroconf.

I will delete the other comments below.

Copy link
Contributor Author

@tkem tkem Mar 28, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's complicated ;-)
Thanks, I really think it is easier for people who actually know/use zeroconf that way, even if "ZeroConf" looks more natural first!
And I don't want to call this plugin @ionic-native/zero-conf (which would have to change, too, I guess) because that looks just funny...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you're right.

FYI, in cases where we have brand names that need to be capitalized. We capitalize the class name but keep the package name as one word. You can see this in OneSignal, PayPal, SQLite .. etc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, okay. Thanks, I missed that - should have looked more carefully!

@ihadeed ihadeed merged commit 68d9946 into danielsogl:master Mar 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants