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
362
S
216
G
75
Posts: 23,067
Reputation: 180,321

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
21
G
13
Posts: 549
Reputation: 20,585

Post » Mon Dec 10, 2012 9:34 pm

I doubt if @rexrainbow his 100 plugins are made with jQuery
B
104
S
29
G
22
Posts: 3,066
Reputation: 24,273

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
99
S
22
G
191
Posts: 4,172
Reputation: 110,707

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
99
S
22
G
191
Posts: 4,172
Reputation: 110,707

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
252
S
86
G
42
Posts: 7,035
Reputation: 59,160

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
362
S
216
G
75
Posts: 23,067
Reputation: 180,321

Post » Tue Dec 11, 2012 3:31 pm

@Ashley

Thanks, I will follow your steps.
B
99
S
22
G
191
Posts: 4,172
Reputation: 110,707

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