MinkSelenium2Driver icon indicating copy to clipboard operation
MinkSelenium2Driver copied to clipboard

Queries re use of Syn library

Open andrewnicols opened this issue 7 years ago • 5 comments

#233 claimed to update to version 0.0.3 of the Syn library, however it actually just made unknown changes to 0.0.2.

I really think that we need to update to the latest version, and I think that we can do so relatively easily.

The Syn library has seen several changes between our custom version and 0.0.3, including a number of bug fixes (I've contributed to some of them).

The breaking changes that I'm aware of boil down to:

  • renamed from Syn to syn, and
  • changed argument order for all calls from 'eventname', {options}, {{ELEMENT}} to {{ELEMENT}}, 'eventname', {optionalOptions})

Since they have made both of these changes, we can add a b/c layer which essentially does:

window.Syn = {
    trigger: function(eventName, options, element) {
        console.log("Deprecated. Update to window.syn and swap your arguments");
        return window.syn.trigger(element, eventName, options);
    }
};

andrewnicols avatar Feb 05 '18 01:02 andrewnicols

Incidentally, I'd support updating to the latest version of Syn.

andrewnicols avatar Feb 05 '18 03:02 andrewnicols

  1. I think Syn is internal stuff of the driver and BC layer isn't necessary. What you think @stof ?
  2. @andrewnicols , if all tests, that use Syn currently pass you can safely send PR with updated Syn version.

aik099 avatar Feb 05 '18 06:02 aik099

Thanks @aik099 ,

Sadly I don't think that we can consider Syn to be purely internal because a driver extending MinkSelenium2Driver can still call functions belonging to the Syn library.

I'll see if I can put a PR together with that during this week.

andrewnicols avatar Feb 05 '18 06:02 andrewnicols

@andrewnicols I think we can still update Syn in a minor version of the driver and document the change. I would not consider extending the driver to use Syn to be an intended usage of the driver. It should have been internal.

Regarding the BC layer, I'm not sure this logging message would be visible in a place where users are seeing it, so it would be worse IMO.

stof avatar Feb 05 '18 15:02 stof

I suspected as much, but I hadn't had a chance to confirm. Thanks for the info.

I'll try and put the pull request together.

andrewnicols avatar Feb 06 '18 00:02 andrewnicols