timers and npm

24 views
Skip to first unread message

Kaspar Emanuel

unread,
Apr 7, 2016, 4:53:45 PM4/7/16
to mozilla-labs-jetpack
Hi all,

seems to me that the lack of global `setTimeOut` and `clearTimeOut` is a constant barrier to including libraries from npm in your extension built with jpm. Any plans on providing these instead of requiring the require of `sdk/timers`?

This is what I am currently working on, an extension targeting both Chrome and Firefox: https://github.com/monostable/1clickBOM
I already had to include the promise-rate-limit library as js source because of the lack of setTimeOut and am now looking at including Bluebird promises as a js in my source as well. As an alternative I might switch to using and external bundler like browserify which is a shame since jpm already does the bundling and I would just be bypassing it.

Cheers,

Kaspar

P.S.

Kaspar Emanuel

unread,
Apr 29, 2016, 7:43:08 AM4/29/16
to mozilla-labs-jetpack
Does anyone read this forum?

William Bamberg

unread,
Apr 29, 2016, 12:06:28 PM4/29/16
to mozilla-la...@googlegroups.com
On Fri, Apr 29, 2016 at 4:43 AM, Kaspar Emanuel <kaspar...@gmail.com> wrote:
Does anyone read this forum?

It's not a very lively forum.

 


On Thursday, April 7, 2016 at 9:53:45 PM UTC+1, Kaspar Emanuel wrote:
Hi all,

seems to me that the lack of global `setTimeOut` and `clearTimeOut` is a constant barrier to including libraries from npm in your extension built with jpm. Any plans on providing these instead of requiring the require of `sdk/timers`?


I don't think this will happen: the SDK isn't expecting to add any new features. Quoting Amy's meesage on this, that I sent to this forum earlier:

***

WebExtensions are going to become the standard for add-on development, and depending on your add-on the migration could be simple (i.e. if it is an SDK add-on using high-level APIs), or more complicated (and perhaps even impossible if it is a certain type of XUL add-on). We are still fixing critical SDK bugs, but we are not adding new features, and I think once WebExtensions are in a good place support for SDK will end. I don't have exact dates right now, but the transition is expected to be complete by the end of 2017.

We've documented what we know so far on this wiki page. A good way to get started is to see if your add-on is affected by using the lookup tool.

We're here to help in the #addons channel on irc.mozilla.org and the dev-addons mailing list--please feel free to reach out.

***

 

This is what I am currently working on, an extension targeting both Chrome and Firefox: https://github.com/monostable/1clickBOM


If you want cross-browser functionality, do you think it would be worth investigating WebExtensions?
https://developer.mozilla.org/en-US/Add-ons/WebExtensions

Will

 

I already had to include the promise-rate-limit library as js source because of the lack of setTimeOut and am now looking at including Bluebird promises as a js in my source as well. As an alternative I might switch to using and external bundler like browserify which is a shame since jpm already does the bundling and I would just be bypassing it.

Cheers,

Kaspar

P.S.

--
You received this message because you are subscribed to the Google Groups "mozilla-labs-jetpack" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mozilla-labs-jet...@googlegroups.com.
To post to this group, send email to mozilla-la...@googlegroups.com.
Visit this group at https://groups.google.com/group/mozilla-labs-jetpack.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages