On 7 Oct 2019, at 15:41, Shaping <shaping@uurda.org> wrote:
On 7 Oct 2019, at 05:12, Shaping <shaping@uurda.org <mailto:shaping@uurda.org>> wrote:
How does PharoJS deal with the JS reuse issue? There are lots of JS widgets out there that we would just like to use, but we donât want to read JS if we donât have to. There are many wheels to reinvent, or at least recode in DSL, if I understand the PharoJS scheme correctly, but I may not.
PharoJS allows to reuse existing JS libraries. Just reference constructors as you reference Pharo classes.
Below is a link to an example, where we reuse the physics engine MatterJS https://pharojs.github.io/Demos/MatterJsDemo/ <https://pharojs.github.io/Demos/MatterJsDemo/>
Hi Noury.
Are you saying that none of the JS was manually written or that some of it was and the rest is coming from an imported library. Iâm looking at the page in Chrome dev tools now.
Exactly. That's the whole point of having PharoJS :-) The HTML file imports 2 js file. One is the MatterJS library, and the other is generated by PharoJS Noury