Notice: jQuery support in the runtime is deprecated

For developers using the Construct 2 Javascript SDK

Post » Sun May 24, 2015 12:40 pm

This is an advance notice of something which is likely to eventually happen in the long term (probably at least 6 months away).

The C2 runtime ships with jQuery. In 2015, this is really no longer necessary. The browser DOM APIs have very good standards compliance and consistency across platforms, meaning you can often simply make direct DOM calls instead. See http://youmightnotneedjquery.com/ for lots of good examples.

jQuery is also slow. We've worked to minimise the performance overhead of using jQuery in the runtime, but it's still a very easy way to do something expensive per-frame and that will cause a significant CPU usage increase, and is especially taxing on mobile. Direct DOM calls are sometimes cheaper than equivalent jQuery calls, and can be easier to optimise (e.g. eliminating redundant calls). I am of the opinion that these days jQuery has no place in a high-performance game engine.

Removing jQuery also reduces the download size and complexity of the C2 engine. Removing it could actually improve compatibility in some cases, since we support some platforms which jQuery was not designed for and therefore causes problems.

So while nothing is likely to happen for a while, please do not write any new plugins that make jQuery calls, since it may be difficult to update when we eventually remove jQuery. Also if it is feasible, please consider removing any use of jQuery from existing plugins.

We may have a compatibility fallback where jQuery is included only if the project uses plugins that need it, but this cancels out all the above advantages of removing jQuery, so even if that happens it is still best to remove jQuery where possible.
Scirra Founder
B
398
S
236
G
88
Posts: 24,433
Reputation: 194,635

Post » Sun May 24, 2015 9:45 pm

Sounds great! Looking forward to this, and seeing the effects on performance. Thanks for the heads up!
B
14
S
3
G
1
Posts: 78
Reputation: 1,037

Post » Tue May 26, 2015 6:34 pm

sad news :(
ImageImage
B
81
S
27
G
7
Posts: 191
Reputation: 10,545

Post » Mon Aug 08, 2016 4:00 am

Thanks for the heads up.

I wrote a dom manipulation plugin that will definitely need some updating, should be fun!
B
12
S
2
Posts: 39
Reputation: 1,082


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 2 guests