All Projects → pesterhazy → double-bundle

pesterhazy / double-bundle

Licence: other
Example for integrating React NPM dependencies with Clojurescript

Programming Languages

clojure
4091 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to double-bundle

docker-serverless
Docker image containing NodeJS, Serverless Framework and Yarn.
Stars: ✭ 74 (+221.74%)
Mutual labels:  yarn
stucco
An experimental adaptive UI toolkit.
Stars: ✭ 31 (+34.78%)
Mutual labels:  reagent
nix-npm-buildpackage
Build nix packages that use npm/yarn
Stars: ✭ 48 (+108.7%)
Mutual labels:  yarn
koa-crud-backend
Backend implementation of REST api with Node.js, Koa.js, MongoDB and Jest Tests
Stars: ✭ 56 (+143.48%)
Mutual labels:  yarn
college-management-react
This is a College management web app in MERN stack.
Stars: ✭ 42 (+82.61%)
Mutual labels:  yarn
Cloud.BookList
使用52ABP 多租户(SaaS)模式下的书单管理功能,Angular + .net core 案例功能
Stars: ✭ 14 (-39.13%)
Mutual labels:  yarn
react-in-out-textarea
A simple React.js User Interface Component that is like Google Translate with full TypeScript Support
Stars: ✭ 28 (+21.74%)
Mutual labels:  yarn
docker-npm
npm, yarn, node, npx, bower, grunt, gulp, generate-md - build and dev tools.
Stars: ✭ 53 (+130.43%)
Mutual labels:  yarn
react-simple-boilerplate
Simple React Boilerplate with Webpack, Github Actions, Scss, Lazy Loading etc....
Stars: ✭ 38 (+65.22%)
Mutual labels:  yarn
molecule
⚛️ –  – ⚛️ Boilerplate for cross platform web/native react apps with electron.
Stars: ✭ 95 (+313.04%)
Mutual labels:  yarn
vite.org
The Official Website of Vite - https://vite.org
Stars: ✭ 31 (+34.78%)
Mutual labels:  yarn
generator-react-web
Yeoman generator for creating interactive web sites with React and Redux + Webpack, Flow, ES7+, Babel, Yarn, npm Scripts, i18n, Redux Saga, SCSS, CSS Modules
Stars: ✭ 35 (+52.17%)
Mutual labels:  yarn
re-alm
An Elm Architecture experiment in ClojureScript
Stars: ✭ 24 (+4.35%)
Mutual labels:  reagent
tengen
Simple let-based Reagent component fns for Clojure/Script
Stars: ✭ 50 (+117.39%)
Mutual labels:  reagent
yarn-workspaces-simple-monorepo
Yarn Workspaces basic monorepo management without Lerna for coding examples
Stars: ✭ 31 (+34.78%)
Mutual labels:  yarn
cloud-music-mobile
This is a music player
Stars: ✭ 22 (-4.35%)
Mutual labels:  yarn
iridium
💎 Growing collection of VS Code extensions with a fancy name
Stars: ✭ 39 (+69.57%)
Mutual labels:  yarn
manager
OVHcloud Control Panel
Stars: ✭ 153 (+565.22%)
Mutual labels:  yarn
react-webpack-starter
A really simple boiler plate for creating react applications bundled by webpack (using ES6+, Babel, SASS and webpack development server) ⚛️
Stars: ✭ 86 (+273.91%)
Mutual labels:  yarn
nodejs-graphql-template
Template project for Node.js® GraphQL APIs
Stars: ✭ 13 (-43.48%)
Mutual labels:  yarn

double-bundle

Demonstration of the "double-bundle" approach to integrating NPM dependencies into ClojureScript projects

PLEASE NOTE

This repository is no longer maintained. Please refer to the cljs-spa-example project instead.

Overview

You can integrate NPM dependencies in a Clojurescript project by building a separate bundle using webpack. The resulting application contains two bundles:

  • js/npm-bundle.js, built by webpack
  • js/compiled/double_bundle.js, built by the Clojurescript compiler (and Google Closure)

Hence the name - the double bundle approach.

Details

This project is built on Reagent and Figwheel. Note, however, that neither of these are essential - a similar approach would work for any browser-based Clojurescript project that consumes NPM dependencies.

To show how to include third party React dependencies, this project includes the react-datetime calendar component.

Setup

To see the demo, run this:

yarn install
yarn build
lein figwheel

Then open your browser at localhost:3449.

Discussion

This project is based on fighweel-template. To see the changes from an empty fighwheel template, see this diff view.

For simplicity, we're not making use of the npm-deps feature included in recent versions of the Clojurescript compiler here. The Google Closure compiler is not involved. The upside of this choice is that any NPM packages should work, as long as it is added to library.js.

Similarly, for the sake of operational simplicity, we don't provide an externs files for an external component. Instead, we use goog.object/get to retrieve the component while avoiding minification during Advanced Compilation.

TODO

  • Show how to build a single prod bundle
  • Does Reagent require externs in advanced compilation?

License

Copyright © 2017 Paulus Esterhazy

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].