Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Rename `Fuse.Browser` to `Fuse.Env`

#44

Fuse.Browser.Bug(...) => Fuse.Env.hasBug(...) Fuse.Browser.Feature(...) => Fuse.Env.hasFeature(...)

Reported by Kit Goncharov · July 13th, 2009 @ 11:47 AM

State: resolved
Milestone: none
Assigned to: John-David Dalton John-David Dalton

Activity

  1. Kit Goncharov
    Kit Goncharov
    • Assigned user changed from John-David Dalton to Kit Goncharov
    • State changed from new to open
    • Tag set to browser, env

    August 2nd, 2009 @ 11:34 AM

  2. John-David Dalton
  3. John-David Dalton
    John-David Dalton

    A note on changing Fuse.Env.Feature(...) to Fuse.Env.hasFeature(..).

    Currently there is a Fuse.Env.Feature.set(...) and Fuse.Env.Feature.unset(...) would changing to
    hasFeature and hasBug make setting new checks seem awkward?

    Fuse.Env.hasFeature.set({...});
    

    August 14th, 2009 @ 07:40 AM

  4. Kit Goncharov
    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 function
    

    Or maybe even Fuse.Env.addFeature and addBug...

    August 14th, 2009 @ 11:06 AM

  5. John-David Dalton
    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.

    August 14th, 2009 @ 11:16 AM

  6. Juriy Zaytsev
    Juriy Zaytsev

    I'd rather have a way to test multiple features. It's actually pretty useful. What is setting/unsetting used for?

    August 14th, 2009 @ 11:30 AM

  7. John-David Dalton
    John-David Dalton

    setting and unsetting are for adding and removing tests.

    August 14th, 2009 @ 01:03 PM

  8. John-David Dalton
    John-David Dalton

    maybe Fuse.Env.addFeatureTest(...) too verbose... I dig how short addFeature is but the name is misleading cause its adding check not extending the feature-set of the environment.

    August 14th, 2009 @ 01:06 PM

  9. Juriy Zaytsev
    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 overloaded hasFeature 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 like hasFeatures for multiple tests support (or maybe hasFeature can be renamed to hasFeatures)

    August 14th, 2009 @ 01:21 PM

  10. John-David Dalton
    John-David Dalton

    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

    August 14th, 2009 @ 01:41 PM

  11. Phred
    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'
    })
    

    August 14th, 2009 @ 02:21 PM

  12. John-David Dalton
    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 addFeatureTest a Fuse.Env.addFeatureTest(object) and Fuse.Env.addFeatureTest(name, test) is fine, no need to allow n number of arguments for that.

    August 14th, 2009 @ 02:34 PM

  13. Joe Gornick
    Joe Gornick
    • Assigned user changed from Kit Goncharov to Joe Gornick

    September 30th, 2009 @ 10:31 PM

  14. Joe Gornick
    Joe Gornick
    • State changed from open to patched
    • Assigned user changed from Joe Gornick to John-David Dalton

    October 6th, 2009 @ 11:52 PM

  15. John-David Dalton

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.