Skip to content
This repository was archived by the owner on Jun 28, 2021. It is now read-only.

Code splitting #516

Merged
merged 3 commits into from
Dec 5, 2016
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/components/Audioplayer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { connect } from 'react-redux';
import { camelize } from 'humps';

// Redux
import * as AudioActions from '../../redux/actions/audioplayer';
import * as AudioActions from 'redux/actions/audioplayer';

// Components
import Track from './Track';
Expand All @@ -12,8 +12,8 @@ import ScrollButton from './ScrollButton';
import RepeatDropdown from './RepeatDropdown';

// Helpers
import debug from '../../helpers/debug';
import scroller from '../../utils/scroller';
import debug from 'helpers/debug';
import scroller from 'utils/scroller';

const style = require('./style.scss');

Expand Down
6 changes: 3 additions & 3 deletions src/components/Ayah/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import React, { Component, PropTypes } from 'react';
import Link from 'react-router/lib/Link';
import { Element } from 'react-scroll';

import Copy from '../Copy';
import Copy from 'components/Copy';

import debug from '../../helpers/debug';
import debug from 'helpers/debug';

import bindTooltip from '../../utils/bindTooltip';
import bindTooltip from 'utils/bindTooltip';

const styles = require('./style.scss');

Expand Down
2 changes: 1 addition & 1 deletion src/components/FontStyles/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { fontFaceStyle, fontFaceStyleLoaded } from '../../helpers/buildFontFaces';
import { fontFaceStyle, fontFaceStyleLoaded } from 'helpers/buildFontFaces';
import { load } from 'redux/actions/fontFace.js';

import debug from 'helpers/debug';
Expand Down
6 changes: 3 additions & 3 deletions src/components/Footer/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Component, PropTypes } from 'react';
import React from 'react';
import Link from 'react-router/lib/Link';

import Grid from 'react-bootstrap/lib/Grid';
Expand All @@ -15,8 +15,8 @@ const Footer = () => (
<Col md={2} sm={4} xs={12} className={styles.about}>
<p>Navigate</p>
<ul className={`source-sans ${styles.list}`}>
<li><a href="/about">About</a></li>
<li><a href="/contact">Contact</a></li>
<li><Link to="/about">About</Link></li>
<li><Link to="/contact">Contact</Link></li>
<li>
<a href="https://quran.zendesk.com/hc/en-us/articles/210090626-Development-help" target="_blank" data-metrics-event-name="Footer:Link:Developer">
Developers
Expand Down
2 changes: 1 addition & 1 deletion src/components/Home/LastVisit/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { PropTypes } from 'react';
import debug from '../../../helpers/debug';
import debug from 'helpers/debug';
const styles = require('./style.scss');

const LastVisit = (props) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Home/QuickSurahs/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import debug from '../../../helpers/debug';
import debug from 'helpers/debug';
import Link from 'react-router/lib/Link';

const styles = require('containers/Home/style.scss');
Expand Down
2 changes: 1 addition & 1 deletion src/components/Home/SurahsList/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { PropTypes } from 'react';
import debug from '../../../helpers/debug';
import debug from 'helpers/debug';
import Link from 'react-router/lib/Link';
const styles = require('./style.scss');

Expand Down
4 changes: 2 additions & 2 deletions src/components/IndexHeader/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { Component, PropTypes } from 'react';
import Link from 'react-router/lib/Link';

import SearchInput from '../SearchInput';
import SearchInput from 'components/SearchInput';
import Nav from './Nav';

import debug from '../../helpers/debug';
import debug from 'helpers/debug';

const logo = require('../../../static/images/logo-lg-w.png');

Expand Down
2 changes: 1 addition & 1 deletion src/components/LazyLoad/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, PropTypes } from 'react';
import ReactDOM from 'react-dom';

import debug from '../../helpers/debug';
import debug from 'helpers/debug';

export default class LazyLoad extends Component {
static propTypes = {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Line/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { PropTypes } from 'react';
import debug from '../../helpers/debug';
import debug from 'helpers/debug';

const styles = require('../Ayah/style.scss');

Expand Down
2 changes: 1 addition & 1 deletion src/components/ReadingModeToggle/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { PropTypes } from 'react';

import SwitchToggle from '../SwitchToggle';
import SwitchToggle from 'components/SwitchToggle';

const ReadingModeToggle = ({ onReadingModeToggle, isToggled }) => (
<div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/SearchAutocomplete/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component, PropTypes } from 'react';
import ApiClient from '../../helpers/ApiClient';
import ApiClient from 'helpers/ApiClient';
import { connect } from 'react-redux';
import { push } from 'react-router-redux';

Expand Down
4 changes: 2 additions & 2 deletions src/components/SearchInput/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { PropTypes as MetricsPropTypes } from 'react-metrics';
import { push } from 'react-router-redux';
import { connect } from 'react-redux';

import SearchAutocomplete from '../SearchAutocomplete';
import SearchAutocomplete from 'components/SearchAutocomplete';

import debug from '../../helpers/debug';
import debug from 'helpers/debug';


class SearchInput extends Component {
Expand Down
2 changes: 1 addition & 1 deletion src/components/TooltipDropdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Popover from 'react-bootstrap/lib/Popover';
import Row from 'react-bootstrap/lib/Row';
import Col from 'react-bootstrap/lib/Col';

import SwitchToggle from '../SwitchToggle';
import SwitchToggle from 'components/SwitchToggle';

const style = require('./style.scss');

Expand Down
2 changes: 1 addition & 1 deletion src/containers/About/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import IndexHeader from '../../components/IndexHeader';
import IndexHeader from 'components/IndexHeader';
import Helmet from 'react-helmet';

import Grid from 'react-bootstrap/lib/Grid';
Expand Down
7 changes: 4 additions & 3 deletions src/containers/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ const ModalHeader = Modal.Header;
const ModalTitle = Modal.Title;
const ModalBody = Modal.Body;

import debug from '../../helpers/debug';
import config from '../../config';
import metricsConfig from '../../helpers/metrics';
import debug from 'helpers/debug';
import config from 'config';
import metricsConfig from 'helpers/metrics';
import { authConnect } from './connect';
import Footer from 'components/Footer';

Expand Down Expand Up @@ -64,6 +64,7 @@ class App extends Component {
);
}
}
console.log(metricsConfig);

const metricsApp = metrics(metricsConfig)(App);
const AsyncApp = asyncConnect([{ promise: authConnect }])(metricsApp);
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Contact/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import superagent from 'superagent';

import IndexHeader from '../../components/IndexHeader';
import IndexHeader from 'components/IndexHeader';

export default class Contact extends Component {
state = {
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Donations/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import IndexHeader from '../../components/IndexHeader';
import IndexHeader from 'components/IndexHeader';

import Grid from 'react-bootstrap/lib/Grid';
import Row from 'react-bootstrap/lib/Row';
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Error/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { PropTypes } from 'react';
import IndexHeader from '../../components/IndexHeader';
import IndexHeader from 'components/IndexHeader';
import Helmet from 'react-helmet';

const error = {
Expand Down
4 changes: 2 additions & 2 deletions src/containers/Home/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import Helmet from 'react-helmet';
import IndexHeader from 'components/IndexHeader';
import { asyncConnect } from 'redux-connect';
import { connect } from 'react-redux';
import debug from '../../helpers/debug';
import { isAllLoaded, loadAll } from '../../redux/actions/surahs.js';
import debug from 'helpers/debug';
import { isAllLoaded, loadAll } from 'redux/actions/surahs.js';

import SurahsList from 'components/Home/SurahsList';
import QuickSurahs from 'components/Home/QuickSurahs';
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Search/Header/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import SearchInput from '../../../components/SearchInput';
import SearchInput from 'components/SearchInput';
import Link from 'react-router/lib/Link';

const logo = require('../../../../static/images/logo-lg-w.png');
Expand Down
6 changes: 3 additions & 3 deletions src/containers/Search/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import Row from 'react-bootstrap/lib/Row';
import Col from 'react-bootstrap/lib/Col';

import Header from './Header';
import Ayah from '../../components/Ayah';
import CoreLoader from '../../components/Loader';
import Ayah from 'components/Ayah';
import CoreLoader from 'components/Loader';

import { search } from '../../redux/actions/search.js';
import { search } from 'redux/actions/search.js';

const style = require('./style.scss');

Expand Down
2 changes: 1 addition & 1 deletion src/containers/Surah/Header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Col from 'react-bootstrap/lib/Col';
import Navbar from 'react-bootstrap/lib/Navbar';
const Header = Navbar.Header;

import debug from '../../../helpers/debug';
import debug from 'helpers/debug';

// const ornamentLeft = require('../../../../static/images/ornament-left.png');
// const ornamentRight = require('../../../../static/images/ornament-right.png');
Expand Down
4 changes: 2 additions & 2 deletions src/containers/Surah/connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import {
isAllLoaded,
loadAll,
setCurrent as setCurrentSurah
} from '../../redux/actions/surahs.js';
} from 'redux/actions/surahs.js';

import {
clearCurrent,
load as loadAyahs
} from '../../redux/actions/ayahs.js';
} from 'redux/actions/ayahs.js';

import {debug, isLoaded} from 'helpers';

Expand Down
11 changes: 5 additions & 6 deletions src/containers/Surah/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,14 @@ import makeHeadTags from 'helpers/makeHeadTags';
import debug from 'helpers/debug';

import descriptions from './descriptions';
import Title from './Title';

import { surahsConnect, ayahsConnect } from './connect';

import * as AudioActions from '../../redux/actions/audioplayer.js';
import * as AyahActions from '../../redux/actions/ayahs.js';
import * as BookmarkActions from '../../redux/actions/bookmarks.js';
import * as OptionsActions from '../../redux/actions/options.js';
import * as MediaActions from '../../redux/actions/media.js';
import * as AudioActions from 'redux/actions/audioplayer.js';
import * as AyahActions from 'redux/actions/ayahs.js';
import * as BookmarkActions from 'redux/actions/bookmarks.js';
import * as OptionsActions from 'redux/actions/options.js';
import * as MediaActions from 'redux/actions/media.js';

const style = require('./style.scss');

Expand Down
2 changes: 1 addition & 1 deletion src/helpers/ApiClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import qs from 'qs';
import { decamelizeKeys } from 'humps';
import cookie from 'react-cookie';

import config from '../config';
import config from 'config';

const methods = ['get', 'post', 'put', 'patch', 'del'];

Expand Down
2 changes: 1 addition & 1 deletion src/redux/actions/audioplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
SET_REPEAT,
TOGGLE_SCROLL,
BUILD_ON_CLIENT,
UPDATE } from '../constants/audioplayer.js';
UPDATE } from 'redux/constants/audioplayer.js';

export function setUserAgent(userAgent) {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/redux/actions/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
LOAD,
LOAD_SUCCESS,
LOAD_FAILURE
} from '../constants/auth';
} from 'redux/constants/auth';

export function isLoaded(globalState) {
return globalState.auth && globalState.auth.user;
Expand Down
4 changes: 2 additions & 2 deletions src/redux/actions/ayahs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ayahsSchema } from '../schemas';
import { ayahsSchema } from 'redux/schemas';

import { arrayOf } from 'normalizr';

Expand All @@ -10,7 +10,7 @@ import {
SET_CURRENT_AYAH,
SET_CURRENT_WORD,
CLEAR_CURRENT_WORD
} from '../constants/ayahs.js';
} from 'redux/constants/ayahs.js';

// For safe measure
const defaultOptions = {
Expand Down
4 changes: 2 additions & 2 deletions src/redux/actions/bookmarks.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { bookmarksSchema } from '../schemas';
import { bookmarksSchema } from 'redux/schemas';
import { arrayOf } from 'normalizr';
import {
LOAD,
Expand All @@ -10,7 +10,7 @@ import {
REMOVE_BOOKMARK,
REMOVE_BOOKMARK_SUCCESS,
REMOVE_BOOKMARK_FAILURE
} from '../constants/bookmarks';
} from 'redux/constants/bookmarks';

export function isLoaded(globalState) {
return globalState.auth && globalState.auth.user;
Expand Down
2 changes: 1 addition & 1 deletion src/redux/actions/fontFace.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LOAD } from '../constants/fontFace.js';
import { LOAD } from 'redux/constants/fontFace.js';

export function load(className) {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/redux/actions/media.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
SET_MEDIA,
REMOVE_MEDIA
} from '../constants/media';
} from 'redux/constants/media';

export function setMedia(content) {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/redux/actions/options.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import cookie from 'react-cookie';
import { TOGGLE_READING_MODE, SET_OPTION } from '../constants/options.js';
import { TOGGLE_READING_MODE, SET_OPTION } from 'redux/constants/options.js';

export function isReadingMode(globalState) {
return globalState.options.isReadingMode;
Expand Down
4 changes: 2 additions & 2 deletions src/redux/actions/search.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ayahsSchema } from '../schemas';
import { ayahsSchema } from 'redux/schemas';
import { arrayOf } from 'normalizr';

import {
SEARCH,
SEARCH_SUCCESS,
SEARCH_FAIL
} from '../constants/search.js';
} from 'redux/constants/search.js';

export function search(params) {
return {
Expand Down
6 changes: 3 additions & 3 deletions src/redux/actions/spec.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as audioplayerActions from './audioplayer.js';
import * as ayahsActions from './ayahs.js';
import * as surahsActions from './surahs.js';
import * as audioplayerConstant from '../constants/audioplayer.js';
import * as ayahsConstants from '../constants/ayahs.js';
import * as surahsConstants from '../constants/surahs.js';
import * as audioplayerConstant from 'redux/constants/audioplayer.js';
import * as ayahsConstants from 'redux/constants/ayahs.js';
import * as surahsConstants from 'redux/constants/surahs.js';


describe("action tests", () => {
Expand Down
4 changes: 2 additions & 2 deletions src/redux/actions/surahs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { surahsSchema } from '../schemas';
import { surahsSchema } from 'redux/schemas';
import { arrayOf } from 'normalizr';
import {
LOAD,
Expand All @@ -7,7 +7,7 @@ import {
LOAD_INFO,
LOAD_INFO_SUCCESS,
LOAD_INFO_FAIL,
SET_CURRENT } from '../constants/surahs.js';
SET_CURRENT } from 'redux/constants/surahs.js';

export function loadAll() {
return {
Expand Down
Loading