Rename `Fuse.Browser` to `Fuse.Env`
Reported by Kit Goncharov | July 13th, 2009 @ 11:47 AM
Fuse.Browser.Bug(...)
=>
Fuse.Env.hasBug(...)
Fuse.Browser.Feature(...)
=>
Fuse.Env.hasFeature(...)
Comments and changes to this ticket
-
Kit Goncharov August 2nd, 2009 @ 11:34 AM
- Assigned user changed from John-David Dalton to Kit Goncharov
- State changed from new to open
- Tag set to browser, env
-
John-David Dalton August 14th, 2009 @ 07:40 AM
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
hasFeature
andhasBug
make setting new checks seem awkward?Fuse.Env.hasFeature.set({...});
-
Kit Goncharov August 14th, 2009 @ 11:06 AM
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 function
Or maybe even
Fuse.Env.addFeature
andaddBug
... -
John-David Dalton August 14th, 2009 @ 11:16 AM
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 August 14th, 2009 @ 11:30 AM
I'd rather have a way to test multiple features. It's actually pretty useful. What is setting/unsetting used for?
-
John-David Dalton August 14th, 2009 @ 01:03 PM
setting
andunsetting
are for adding and removing tests. -
John-David Dalton August 14th, 2009 @ 01:06 PM
maybe
Fuse.Env.addFeatureTest(...)
too verbose... I dig how shortaddFeature
is but the name is misleading cause its adding check not extending the feature-set of the environment. -
Juriy Zaytsev August 14th, 2009 @ 01:21 PM
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 overloadedhasFeature
are 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 likehasFeatures
for multiple tests support (or maybehasFeature
can be renamed tohasFeatures
) -
John-David Dalton August 14th, 2009 @ 01:41 PM
I agree and think allowing more than 1 on a singular name is fine.
currently the
addFeatureTest
equive allows only passing an object, but we can make that optional,
1 argument -> object; 2 -> name and test -
Phred August 14th, 2009 @ 02:21 PM
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 August 14th, 2009 @ 02:34 PM
@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
addFeatureTest
aFuse.Env.addFeatureTest(object)
andFuse.Env.addFeatureTest(name, test)
is fine, no need to allow n number of arguments for that. -
Joe Gornick September 30th, 2009 @ 10:31 PM
- Assigned user changed from Kit Goncharov to Joe Gornick
-
Joe Gornick October 6th, 2009 @ 11:52 PM
- 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 January 27th, 2010 @ 10:37 AM
- 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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
JavaScript frameworks share similar features and functionality such as DOM manipulation, event registration, and CSS selector engines. FuseJS attempts to incorporate the strengths of these frameworks into one stable, efficient, and optimized core JavaScript framework.