Removing jQuery - feedback

For developers using the Construct 2 Javascript SDK

Post » Mon Dec 10, 2012 5:22 pm

I'm considering removing jQuery form the Construct 2 engine completely. It's not strictly necessary, would simplify the code, reduce the dependencies, and jQuery stuff doesn't work in non-browser engines anyway like CocoonJS and directCanvas, so using it there is always broken.

Would this break a lot of plugins? Are any plugin developers using it in specific plugins and if so would you be able to refactor it out?
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,518

Post » Mon Dec 10, 2012 6:29 pm

I'm using jQuery in a plugin I'm developing, mainly to do a dynamic modification of index.html:
[CODE]jQuery('head').append('[text to append]');[/CODE]
(I also advised another developer to do this instead of doing a static rewrite).

But it could be refactored out - after all, jQuery is just JavaScript.
B
105
S
20
G
12
Posts: 549
Reputation: 20,320

Post » Mon Dec 10, 2012 9:34 pm

I doubt if @rexrainbow his 100 plugins are made with jQuery
B
96
S
25
G
20
Posts: 3,052
Reputation: 22,638

Post » Tue Dec 11, 2012 1:09 am

@Joannesalfa

Most of my plugins do not use jQuery. I removed them before, or made other plugins to replace them. Some plugins still had jQuery call.

I need to ensure that my plugins could be used at cocoonJS since my team member are using cocoonJS heavy.


PS. the alert system does not notify me that @Joannesalfa had marked my name at his post.rexrainbow2012-12-11 01:20:44
B
97
S
22
G
176
Posts: 4,109
Reputation: 103,021

Post » Tue Dec 11, 2012 1:14 am

@Ashley

jQuery had still be used in official plugins/behaviors like 8direction,car,dragndrop,platform ..etc

How do you replace them?
B
97
S
22
G
176
Posts: 4,109
Reputation: 103,021

Post » Tue Dec 11, 2012 5:31 am

I also think some of @Pode 's plugins contain jquery. Perhaps some of @septeven too.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Tue Dec 11, 2012 9:39 am

YEs, some of my plugin uses JQuery. There's still the possibility for a plugin dev to load it inside his plugin if it's needed, or ask the user of the plugin to copy it inside the exported directory if it's just a "static" link (something like "<script src='./jquery.js'>").
We can also add it as a "dependency : jquery.js" inside the edittime.js
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Tue Dec 11, 2012 12:13 pm

It could be problematic if several plugins specify a jquery dependency... which one do you then export?

jQuery is used in official code in several places but it shouldn't be too much of a problem to remove it.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,518

Post » Tue Dec 11, 2012 3:31 pm

@Ashley

Thanks, I will follow your steps.
B
97
S
22
G
176
Posts: 4,109
Reputation: 103,021

Post » Tue Dec 11, 2012 8:54 pm

I only use jQuery to detect mouse/keyboard input. I imagine that would be easy enough to replace, but I would need some assistance in learning how to do that.
Don't see the fnords and they won't eat you!
B
75
S
16
G
12
Posts: 322
Reputation: 11,608

Next

Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests