Third-party JS frameworks and compatibility

I don't use javascript much, but I'm sure there are a number of go-to libraries for various developers.


However, what would be some consequences if we all chose to use whatever libraries we wanted for our own scripts?


Would it increase the chances that scripts are incompatible with other scripts?


Is it better to use third-party libraries sparingly?
MV doesn't use much of a DOM for it's purposes, as we can see from the demo. There will be 3rd party scripts for WebGL and Canvas, much like how MV is using the 3rd party library Pixi.js, however the main issue would be ensuring compatibility with Pixi first (We have V2, not V3). Aside from that, 3rd party libraries get complicated because then the developer would need to include them into their project as well, unless you're plugin is going to include the entirety of the library.

Personally, I'd recommend against 3rd party libraries as much as possible. If there's really no other way, just find the funcitonality you want and see if you can replicate it before pulling in an entire library for it. I'd rather we used user-made libraries that are MV specific.
I was thinking for example if we could just include box2D for all of the physics and collision related algorithms we can save a lot of from having to implement our own.


But there may be a bunch of other similar libraries.
I was thinking for example if we could just include box2D for all of the physics and collision related algorithms we can save a lot of from having to implement our own.


But there may be a bunch of other similar libraries.
Hm, libs like box2d shouldn't be hard to integrate with MV, but I don't know it very well.
MV doesn't use much of a DOM for it's purposes, as we can see from the demo. There will be 3rd party scripts for WebGL and Canvas, much like how MV is using the 3rd party library Pixi.js, however the main issue would be ensuring compatibility with Pixi first (We have V2, not V3). Aside from that, 3rd party libraries get complicated because then the developer would need to include them into their project as well, unless you're plugin is going to include the entirety of the library.

Personally, I'd recommend against 3rd party libraries as much as possible. If there's really no other way, just find the funcitonality you want and see if you can replicate it before pulling in an entire library for it. I'd rather we used user-made libraries that are MV specific.

Just because don't have a dom doesn't mean we can use the canvas element. For example consider the following code:

var c = document.getElementById("canvas");var ctx = c.getContext("2d");ctx.fillStyle = "#FF0000";ctx.fillRect(0,0,150,75);Now here you get the canvas element and then draw a red box.

I was thinking for example if we could just include box2D for all of the physics and collision related algorithms we can save a lot of from having to implement our own.

But there may be a bunch of other similar libraries.

To answer you initial question yes you can. Have you heard of technologies like Babel? Or Gulp? You can use these to concatenate your third party libraries to then you can write code that uses them. Because as others have pointed out we dont have a dom per say we do have a canvas element so for instance I would be using: https://github.com/Flipboard/react-canvas to create React Components and Draw on the canvas creating new UI components that are stateful and immutable.

you CAN use third party libraries. You need external tools to concatenate and compile them. This is where I would release a minified version and a development version for people top hack on. The development version should be on something like github.

third party libraries will also let you write more modular code and not re-invent the wheel so much.

So yes Box 2d would work, you would just target the canvas element and use other tools to compile your scripts.
I too think it would completely depend on what framework you are trying to implement..

There will always be people saying 'why reinvent the wheel', but dedicated MV plugins would be better imo.. Dont get me wrong, if a 3rd party framework works, use it, if not, I wouldnt spend too much time trying to make it work, I would just write my own variation of the system doing only the features I required. 🙂
I too think it would completely depend on what framework you are trying to implement..

There will always be people saying 'why reinvent the wheel', but dedicated MV plugins would be better imo.. Dont get me wrong, if a 3rd party framework works, use it, if not, I wouldnt spend too much time trying to make it work, I would just write my own variation of the system doing only the features I required. 🙂

don't re invent the wheel when it comes to common components. Use whats already out there.

Original thread: https://forums.rpgmakerweb.com/threads/third-party-js-frameworks-and-compatibility.45777/