Skip to content

Instantly share code, notes, and snippets.

@gauravtiwari
Last active February 19, 2017 10:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gauravtiwari/6ebcaf6955ac5cda58871bcba87ab028 to your computer and use it in GitHub Desktop.
Save gauravtiwari/6ebcaf6955ac5cda58871bcba87ab028 to your computer and use it in GitHub Desktop.
folder structure
// entry: app/javascript/packs/calendar.js
require('calendar') or import 'calendar'; // in es6 world
// 1. Angular app
// Main index file that loads all dependent code and bootstraps module to DOM if required
require('./components/calendar.js') or import './components/calendar.js';
require('./models/calendar.js') or import './models/calendar.js';
// app/javascript/calendar/index.js
// Modular js much like rails app folder
// app/javascript/calendar/components/calendar.js
// app/javascript/calendar/models/month.js
// app/javascript/calendar/templates/calendar.js
// app/javascript/calendar/services/calendar.js
// app/javascript/calendar/routes/calendar.js
// 1. React app
// Main index file that loads all dependent code and bootstraps module to DOM if required
require('./components/calendar.js') or import './components/calendar.js';
require('./routes/calendar.js') or import './routes/calendar.js';
// app/javascript/calendar/index.js
// Modular js much like rails app folder
// app/javascript/calendar/components/calendar.jsx
// app/javascript/calendar/routes/calendar.jsx
// app/javascript/calendar/data/calendar.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment