Rename `Fuse.Browser` to `Fuse.Env`
-
Kit Goncharov
- Assigned user changed from John-David Dalton to Kit Goncharov
- State changed from new to open
- Tag set to browser, env
-
John-David Dalton
A note on changing
Fuse.Env.Feature(...)toFuse.Env.hasFeature(..).Currently there is a
Fuse.Env.Feature.set(...)andFuse.Env.Feature.unset(...)would changing to
hasFeatureandhasBugmake setting new checks seem awkward?Fuse.Env.hasFeature.set({...}); -
Kit Goncharov
Yep, that definitely would.
A possible alternative might be to have two arguments for setting
features/bugs and one argument for getting them:Fuse.Env.hasFeature('ELEMENT_PROPERTIES_ARE_ATTRIBUTES') //=> true (if IE) Fuse.Env.hasFeature('IE_IS_A_BUGGY_BROWSER', function(){ return true; }); //Returns the setter functionOr maybe even
Fuse.Env.addFeatureandaddBug... -
John-David Dalton
Currently
Fuse.Env.hasFeature('SOME_FEATURE', 'ANOTHER_FEATURE')will return true only if both features are true.
This may be confusing so I will probably drop this usage. -
Juriy Zaytsev
I'd rather have a way to test multiple features. It's actually pretty useful. What is setting/unsetting used for?
-
John-David Dalton
settingandunsettingare for adding and removing tests. -
John-David Dalton
maybe
Fuse.Env.addFeatureTest(...)too verbose... I dig how shortaddFeatureis but the name is misleading cause its adding check not extending the feature-set of the environment. -
Juriy Zaytsev
I think set/unset seem like weird names for adding/removing user-defined feature tests. They sound more like toggling something on and off. I also think that
hasFeature.set(method on method) and overloadedhasFeatureare awkward.I would rather go with:
Fuse.Env.hasFeature(testName1[, testName2[, ...]]); Fuse.Env.addFeatureTest(testName, testBody);The downside is that
hasFeature('foo', 'bar')looks a bit awkward but I don't think it's worth adding something likehasFeaturesfor multiple tests support (or maybehasFeaturecan be renamed tohasFeatures) -
John-David Dalton
I agree and think allowing more than 1 on a singular name is fine.
currently the
addFeatureTestequive allows only passing an object, but we can make that optional,
1 argument -> object; 2 -> name and test -
Phred
Doesn't passing one object do the same (but better) of N parameters?
.addFeatureTest({ name: 'foo' ,test: fn ,other: 'we can add and deprecate values here freely' ,unlike: 'when adding/removing additional passed in args' }) -
John-David Dalton
@phred I was talking about just
Fuse.Env.hasFeature(testName1[, testName2[, ...]]);.Which would basically be the quiv of
hasFeature(testName1) && hasFeature(testName2) && hasFeature(textName3)Ya I would say for
addFeatureTestaFuse.Env.addFeatureTest(object)andFuse.Env.addFeatureTest(name, test)is fine, no need to allow n number of arguments for that. -
Joe Gornick
- Assigned user changed from Kit Goncharov to Joe Gornick
-
Joe Gornick
- State changed from open to patched
- Assigned user changed from Joe Gornick to John-David Dalton
Here's my commit: https://github.com/jgornick/fusejs/commit/d1449265157cc463710c76e52...
-
John-David Dalton
- State changed from patched to resolved
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.