cljsjs

2016-09-03T17:34:17.000007Z

@flyboarder Done

flyboarder 2016-09-03T17:35:39.000008Z

@mac how's your understanding of closure foreign libs!

flyboarder 2016-09-03T17:35:43.000009Z

?*

2016-09-03T17:36:00.000010Z

@flyboarder limited ๐Ÿ™‚

flyboarder 2016-09-03T17:36:44.000011Z

Hahaha no problem, so we are basically looking to fork cljsjs/packages and create a new package

flyboarder 2016-09-03T17:37:12.000012Z

Have you created a package locally for this already?

2016-09-03T17:37:26.000013Z

@flyboarder nope

flyboarder 2016-09-03T17:40:22.000014Z

@mac hmm doesnt seem like there is a distributed version of this yet?

2016-09-03T17:40:44.000015Z

@flyboarder I wonder if this is the right path, since what I am building is not the complete library. I do have a dist of all the packages which I have built locally.

flyboarder 2016-09-03T17:43:10.000016Z

@mac you should be able to build a dist like so: https://github.com/ProseMirror/prosemirror/blob/master/package.json#L37

2016-09-03T17:44:03.000019Z

@flyboarder I have that, generated a dist dir with lots of sub dirs.

flyboarder 2016-09-03T17:44:48.000020Z

Ah ok, so issue 1 with js libraries, is when they dont package as a single file. You need to include each of these files as a foreign lib.

flyboarder 2016-09-03T17:45:18.000021Z

And they must rely on each other in the correct order, otherwise they cannot load

flyboarder 2016-09-03T17:46:33.000022Z

So it seems the prosemirror editor is in dist/edit/index.js, we will need the order of the things it requires in there.

2016-09-03T17:46:39.000023Z

@flyboarder The dist dir has 19 subdirs and 100 files

flyboarder 2016-09-03T17:47:23.000024Z

@mac i dont think this is going be a smooth package, you will need to bundle all these things as a foreign lib

flyboarder 2016-09-03T17:48:19.000025Z

Currently if you look at cljsjs/codemirror they did this automatically for an older version. But it was not done entirely right so some packages error, because they all require codemirror but not eachother correctly

flyboarder 2016-09-03T17:49:41.000028Z

See: https://github.com/cljsjs/packages/tree/master/codemirror

2016-09-03T17:49:48.000031Z

@flyboarder And there is no way to automate this ?

flyboarder 2016-09-03T17:50:36.000032Z

There is no browserify thing in boot that I am aware of.

flyboarder 2016-09-03T17:51:36.000033Z

the problem is that codemirror loads things into the dom (inluding modules) as needed, which is why they have the minification part of their site which packages selected modules for you

2016-09-03T17:51:54.000034Z

@flyboarder Can't I just pull in the demo bundle using foreign-libs - for now at least?

flyboarder 2016-09-03T17:53:18.000035Z

@mac no, none of the demo is bundled.

flyboarder 2016-09-03T17:53:31.000036Z

its all raw src which looks for other files

flyboarder 2016-09-03T17:53:35.000037Z

and requires them

flyboarder 2016-09-03T17:55:13.000038Z

Your option right now without a packaged .js file would be to use a script tag like before. But you will not be able to compile your cljs with :advanced optimizations

2016-09-03T17:55:54.000039Z

@flyboarder ok, but I do have a bundle from the demo site that is selfcontained.

flyboarder 2016-09-03T17:56:27.000040Z

could you zip me that folder?

flyboarder 2016-09-03T17:58:12.000041Z

actually did you just make the dist via babel? you should be able to run browserify on that dist to get closer to what we want

flyboarder 2016-09-03T17:58:33.000042Z

then we will know what modules are missing

flyboarder 2016-09-03T17:59:47.000043Z

How i got simplemde working is that they actually package their entire thing as a single file, which is why it works

flyboarder 2016-09-03T18:02:38.000044Z

@mac ok so that file still calls require to a whole bunch of files, looks like each of those modules will need to be bundled before the main one

flyboarder 2016-09-03T18:03:12.000045Z

Basically itโ€™s not actually recursively bundling them

flyboarder 2016-09-03T18:07:05.000046Z

@mac i think you might just need the standalone option on browserify to make this work for you

2016-09-03T18:09:31.000049Z

@flyboarder I don't understand how that can be when it runs when pulled in using a script tag. I

flyboarder 2016-09-03T18:10:19.000050Z

Itโ€™s fetching the other files when run like that, but that wont work when you compile the library with google closure compiler

flyboarder 2016-09-03T18:10:39.000051Z

since it mangles the names of what it is looking for

flyboarder 2016-09-03T18:11:06.000052Z

using the script tag will work fine if you dont need :advanced optimizations

flyboarder 2016-09-03T18:11:54.000053Z

itโ€™s a rock and hard-place until the js library packages itself as a standalone file

2016-09-03T18:12:38.000054Z

@flyboarder Yeah, sounds like it.

flyboarder 2016-09-03T18:13:00.000055Z

So far codemirror and ace both have this problem because they assume you will build off of them

flyboarder 2016-09-03T18:13:24.000056Z

so they leave things as modules, but really I dont want a module loader running in production software

flyboarder 2016-09-03T18:14:55.000057Z

that stackoverflow question shows how the modules can be bundled separate but, I would want the library maintainers doing that for me

flyboarder 2016-09-03T18:15:32.000058Z

A ticket should get opened for packaging it as a single file, or at least package as modules properly

flyboarder 2016-09-03T18:15:51.000059Z

So you can just browserify standalone yourself

flyboarder 2016-09-03T18:17:09.000060Z

For this editor Iโ€™d say the proper solution does not yet exist.

2016-09-03T18:18:05.000061Z

@flyboarder Doesn't look like. Thanks for your help.

flyboarder 2016-09-03T18:18:23.000062Z

np, sorry i couldnt get it working ๐Ÿ˜•

2016-09-03T18:22:07.000063Z

@flyboarder No problem ๐Ÿ™‚