Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How develop pure JS library involving multiple source files?

12 views
Skip to first unread message

kent...@gmail.com

unread,
Aug 29, 2016, 2:02:44 AM8/29/16
to
I am interested in porting a little dataflow aka reactive aka databinding library of mine from Common Lisp to javascript. It will be about 2kloc and would be edited most easily as about ten different .js files.

My immediate problem is quite simple: how do I edit/run/test as I go? Is it necessary to run a server and test in a browser where each file is loaded via a script tag? I do not plan immediately to mess with DOM since it is purely about the dataflow between JS objects, so it would be great to just sit in an IDE and hit Run to test as I go.

I have installed WebStorm and it works fine for a single source file, but for the life of me I do not see how to get it to load all the JS files I have added to the project. And I did see something suggesting I would have to use a build tool to concatenate the different JS files, suggesting WebStorm does not handle that for me.

If I have to test in a browser I will live, but an IDE would rock. Maybe I will see if Aptana is more approachable.

Insights welcome.

-kt

Ben Bacarisse

unread,
Aug 29, 2016, 5:44:37 AM8/29/16
to
kent...@gmail.com writes:

> I am interested in porting a little dataflow aka reactive aka
> databinding library of mine from Common Lisp to javascript. It will be
> about 2kloc and would be edited most easily as about ten different .js
> files.
>
> My immediate problem is quite simple: how do I edit/run/test as I go?
> Is it necessary to run a server and test in a browser where each file
> is loaded via a script tag?

No, because:

> I do not plan immediately to mess with DOM

and that means you only need an ECMAScript implementation with some IO
capability. As a Linux user I use nodejs, but you name some things
below that I've not heard of so I think you many be using Windows.

> since it is purely about the dataflow between JS objects, so it would
> be great to just sit in an IDE and hit Run to test as I go.
>
> I have installed WebStorm and it works fine for a single source file,
> but for the life of me I do not see how to get it to load all the JS
> files I have added to the project. And I did see something suggesting
> I would have to use a build tool to concatenate the different JS
> files, suggesting WebStorm does not handle that for me.

That would be a very severe restriction (and a strange one, too), but
I'm not familiar with the software. Some people with Windows experience
will be along soon and they can weigh in with how they do this sort of
development.

<snip>
--
Ben.

Ken Tilton

unread,
Aug 29, 2016, 7:20:22 AM8/29/16
to
Thanks, Ben, I am up and running with nodejs. This page explained the bit I was missing: how to use "require" to go cross-file:

http://openmymind.net/2012/2/3/Node-Require-and-Exports/

btw, I am running a Node.js Express project under Webstorm on Ubuntu, though it does have Windows and Mac OS versions.

Thx again. -kt

Ben Bacarisse

unread,
Aug 29, 2016, 7:58:06 AM8/29/16
to
Ken Tilton <kent...@gmail.com> writes:

> On Monday, August 29, 2016 at 5:44:37 AM UTC-4, Ben Bacarisse wrote:
>> ... As a Linux user I use nodejs, but you name some things
>> below that I've not heard of so I think you many be using Windows.
<snip>
> Thanks, Ben, I am up and running with nodejs. This page explained the
> bit I was missing: how to use "require" to go cross-file:
>
> http://openmymind.net/2012/2/3/Node-Require-and-Exports/
>
> btw, I am running a Node.js Express project under Webstorm on Ubuntu,
> though it does have Windows and Mac OS versions.

Ah, OK. I've got too familiar with my editor to want to investigate
other interfaces so I was not aware of Webstorm on Linux, but it's good
I've now heard of it!

Glad you're up and running.

--
Ben.
0 new messages