Hi Terrell & Anthony, On Tuesday, August 22, 2017 at 12:09:13 AM UTC+10, Terrell wrote: > > In the past, there was no alternative to GreaseMonkey. Now there is. If a > script doesn't work in GreaseMonkey, many people will shift over to > TamperMonkey. >
This is my fear as well. I know many userscripts don't use the async apis, but if there is the perception of compatibility problems, people will choose/advocate what they know to 'just work'. This potentially would not be Greasemonkey. > Async APIs might* be a good idea going forward, but priority should be on > making sure that you don't break most scripts. > > Also, Tampermonkey has a previous version which was open source, so you > might be able to pull from that. > > *I say might because I'm not sold on promises. I still can't get my head > around them, as I can't find anything that really explains them except to > programmers already used to similar concepts in other languages. And I > Terrell, I'm afraid to say that promises are becoming a cornerstone of the javascript language in handling its asynchronosity. Sold or not, if you are going to code in js, you need to come to grips with them. New constructs such as 'async' and 'await' will make this easier I'm happy to say. think most userscript authors are amateur. > Certainly, there are tinkerers (or Fred in the shed types), which is a good thing. But I'm not sure what empirical evidence there is to support the 'most' quantifier in this statement. In my mind, its probably more a matter of the time required to change scripts over and to what benefits, plus ensuring they work with both old and new APIs for different browser versions and userscript extensions. > Plus, well, you aren't the only one defining APIs anymore. > Herein lay the contention between interoperability and innovation. Innovating with a new API is a good thing but only if it is perceived as better and worth the time to change. While the new API can bring about many performance and maintenance optimisations to GM, these may not be sufficient motivation for authors to change their userscripts. I've mentioned perception a few times. Technical merit, but also recogition of human behaviours together should inform decision-making, rather than technical merit alone. Anthony, I think shiming the old API is a crucial consideration for your 4.0 release. With great sincerity, I would be disappointed to see such a great addon and many years of you and your team's hard work diminished through users switching to the path of lesser resistance. I won't raise this again, but Anthony, you have been quiet on the matter. Have we swayed your view at all in terms of the priority of compatibility shims with your 4.0 release? :) Cheers, Damo. > > On Tuesday, May 30, 2017 at 12:18:09 PM UTC-5, Anthony Lieuallen wrote: >> >> On Tue, May 30, 2017 at 2:52 AM, <[email protected]> wrote: >> >>> Or using ES2017, something like: >>> >>> let sData = await GM.getValue("serialised") ; >>> let oData = JSON.parse(sData) ; >>> // useful things still happen here. >>> >>> >> I've largely decided to go for ideal design/good performance. Since I'm >> also learning the new WebExt APIs along the way I might not do so >> perfectly, but I'm trying. This means new async APIs. The possibility for >> compatibility-increasing shims, even perhaps automatic ones, is not >> impossible. But this proposal you have above is basically exactly what I'm >> doing. New APIs return promises. You can await >> <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await> >> >> a promise and get code like the example you've got above. >> >> We've been through painful compatibility migrations in the past. They're >> not awesome, but they happen. Plus, roughly half of all scripts use no >> privileged APIs and won't be affected. In the future we can invest effort >> into repairing compatibility with old scripts that haven't been updated. >> But now (read: by the time 57 is out and we have to do something to not >> break 100%) we'll have something that works, and efficiently. >> > -- You received this message because you are subscribed to the Google Groups "greasemonkey-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/greasemonkey-users. For more options, visit https://groups.google.com/d/optout.
