@flyboarder Is browserify absolutely required for codemirror? Couldn't you write deps.cljs entries with proper requires for each addon so they depend on each other correctly
With browserify we would need to include all files instead of just those needed by the app
@juhoteperi: there are some packages which require the standalone build option from browserify otherwise they attempt to load things at runtime via require
, anyway we can get browserify as a cljsjs task?
@juhoteperi: I'm not sure I understand what you mean by include all the files?
@flyboarder The bundle created by browserify contains all the addons, instead of just those used by the app
BUT, if the addons are indeed CommonJS modules and use require
we do indeed need to use browserify (for now)
@juhoteperi i see, can we put packaged (browserified) files in with cljsjs?
Yes, there are several packages that do that
does the project have existing browserify config?
At least I'm quite sure some existing packages do that
no which is part of the problem š
browser ready packages are not available from the vendor lib
Material-ui uses webpack, it is another package without included configuration
any pros at cljsjs-ifying packages have some helpful hints for wrapping up a complex library such as https://github.com/oliviertassinari/react-swipeable-views ?
Iām guessing itāll involve something along the lines of what is described here: http://krasimirtsonev.com/blog/article/distributing-react-components-babel-browserify-webpack-uglifyjs
e.g. using browserify or something to pull in a build of the library with all of its dependencies but exclude, e.g. React and shim it as a global?
@sherbondy there usually is some build task to build a single js file. Have you tried running npm build
in the root of that project?
@sherbondy I just wanted to give it a try but my NPM stuff is wrecked somehow š
@martinklepsch yeah, in this case it builds a lib directory and spits out a number of individual deps, all of which contain ārequires"
@martinklepsch I had to run ānpm run buildā for some reason
@martinklepsch Iāve gotten closer since asking. I then took the resulting SwipeableViews.js file from lib and ran it through browserify
right re: npm run build
always forget š
@martinklepsch apparently babel changed the way is does dep exports so in my browserify standalone build the obj. is showing up at window.SwipeableViews.default instead of just window.SwipeableViews
Iāve tried running through "JavaScript Externs Generatorā to gen extern.js but Iām getting a āNamespace SwipeableViews was not foundā issue, anybody have tips for inspecting what the externs generator is seeing?
@sherbondy if you open the console and check whats inside the global context that's pretty much what the generator sees
@martinklepsch oh sweet, got it working! At window.SwipableViews.default instead of just window.SwipeableViews, but still! Woohoo!
@sherbondy š