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

Tech registry #2782

Closed
wants to merge 9 commits into from
Closed

Tech registry #2782

wants to merge 9 commits into from

Conversation

gkatsev
Copy link
Member

@gkatsev gkatsev commented Nov 5, 2015

This depends on #2773 but adds in a Tech registry which fixes #2772.

@gkatsev gkatsev mentioned this pull request Nov 5, 2015
@pam
Copy link

pam commented Nov 5, 2015

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: b9ec25231bac4c8cf0c9da438fd7b19d90511b57
Build details: https://travis-ci.org/pam/video.js/builds/89505231

(Please note that this is a fully automated comment.)

@pam
Copy link

pam commented Nov 5, 2015

Tests passed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED

Commit: bb329136bdc3ab58d7b6a1d811a4c2d2502aa1c7
Build details: https://travis-ci.org/pam/video.js/builds/89506744

(Please note that this is a fully automated comment.)

@pam
Copy link

pam commented Nov 6, 2015

Tests passed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED

Commit: 28e20f7
Build details: https://travis-ci.org/pam/video.js/builds/89737724

(Please note that this is a fully automated comment.)

return Tech.techs_[name];
}

if (window && window.videojs && window.videojs[name]) {
Copy link
Member

Choose a reason for hiding this comment

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

I feel like there should probably be a Tech.isTech(window.videojs[name]) condition here to prevent misleading log.warn calls.

Copy link
Member Author

Choose a reason for hiding this comment

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

What should it do if it isn't a tech? Component doesn't do that checking currently either and I basically just copied the code from there.
I think it makes sense to warn/throw if you're trying to register something as a tech that isn't, this function could be slightly more permissive.

Copy link
Member

Choose a reason for hiding this comment

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

Not 100% sure on that - or that anything needs to be done, given more reflection.

My original thinking was that if someone were to reach this with a value that wasn't a tech, but was available on the window, it would suggest they were doing something really weird and we shouldn't say "don't access your techs like this". Perhaps the log.warn is enough to suggest they did something strange/wrong.

Copy link
Member Author

Choose a reason for hiding this comment

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

Decided not to do anything here but throw if trying to register a non-tech as a tech.

Copy link
Member

Choose a reason for hiding this comment

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

👍

@pam
Copy link

pam commented Nov 6, 2015

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: f39847122102900adbd438c1655b22194ccd7223
Build details: https://travis-ci.org/pam/video.js/builds/89737704

(Please note that this is a fully automated comment.)

@gkatsev
Copy link
Member Author

gkatsev commented Nov 6, 2015

The last pam message is for an older build.

* Registers a Tech
*
* @param {String} name Name of the Tech to register
* @param {Object} tech The tecj to register
Copy link
Member Author

Choose a reason for hiding this comment

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

oops.

@gkatsev gkatsev mentioned this pull request Nov 9, 2015
@pam
Copy link

pam commented Nov 9, 2015

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: 25f7d80
Build details: https://travis-ci.org/pam/video.js/builds/90131888

(Please note that this is a fully automated comment.)

let tech = Tech.getTech(techName);

if (!tech) {
tech = Component.getComponent(techName);
Copy link
Member

Choose a reason for hiding this comment

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

This would mean that the tech was only registered as a component? I think it's worth a comment above this to remind ourselves to one day get rid of it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, this is basically to support the now-deprecated feature of registering techs as components.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll add a comment.

@dmlap
Copy link
Member

dmlap commented Nov 9, 2015

One tiny comment, otherwise LGTM

@pam
Copy link

pam commented Nov 9, 2015

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: e0b9824
Build details: https://travis-ci.org/pam/video.js/builds/90136767

(Please note that this is a fully automated comment.)

@pam
Copy link

pam commented Nov 9, 2015

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: 3d832d9
Build details: https://travis-ci.org/pam/video.js/builds/90132847

(Please note that this is a fully automated comment.)

@gkatsev
Copy link
Member Author

gkatsev commented Nov 9, 2015

@pam retry

@gkatsev
Copy link
Member Author

gkatsev commented Nov 9, 2015

I just realized I need to do the check for Tech.getTech/getComponent in a few other places :/

@pam
Copy link

pam commented Nov 9, 2015

Tests passed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED

Commit: e0b9824
Build details: https://travis-ci.org/pam/video.js/builds/90154515

(Please note that this is a fully automated comment.)

@pam
Copy link

pam commented Nov 9, 2015

Tests passed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED

Commit: c58e037
Build details: https://travis-ci.org/pam/video.js/builds/90157667

(Please note that this is a fully automated comment.)

@gkatsev gkatsev closed this in b1e8636 Nov 9, 2015
@gkatsev gkatsev deleted the tech-registry branch March 8, 2016 20:39
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.

Are Techs Components?
4 participants