Skip to content
This repository was archived by the owner on Jun 28, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
1faeb76
initial commit
mmahalwy Jul 25, 2018
4b69a52
initial commit2
mmahalwy Jul 25, 2018
f50353d
more changes
mmahalwy Jul 27, 2018
7e1552f
deps
mmahalwy Jul 27, 2018
d71ff5e
remove uneeded files
mmahalwy Jul 27, 2018
c7793ee
audioplayer working
mmahalwy Aug 2, 2018
439e959
more work
mmahalwy Aug 7, 2018
e21e141
many great updates
mmahalwy Aug 9, 2018
251d2b3
more changes
mmahalwy Aug 10, 2018
32d97ce
doing great
mmahalwy Aug 10, 2018
a08fbfc
improve circle
mmahalwy Aug 10, 2018
923c36c
work
mmahalwy Aug 10, 2018
0b7a4bc
make verse happy
mmahalwy Aug 10, 2018
ee928ba
tsc
mmahalwy Aug 10, 2018
5cc0b9e
Tests, changes and additions
mmahalwy Aug 13, 2018
fa2ab4b
added many tests
mmahalwy Aug 29, 2018
cbbcc64
fixed all ts problems
mmahalwy Aug 29, 2018
bda58b0
fix tests
mmahalwy Aug 30, 2018
f42c4e7
fix tests
mmahalwy Aug 30, 2018
d81bbe5
Remove classNames
mmahalwy Aug 30, 2018
203888b
jobs 1
mmahalwy Aug 30, 2018
44b8107
make precommit work
mmahalwy Aug 30, 2018
000f4ce
separate helmet for chapter
mmahalwy Aug 30, 2018
8f3c11f
decrease size further
mmahalwy Aug 30, 2018
805eb8e
fix bundle size
mmahalwy Aug 30, 2018
6a0c104
update
mmahalwy Aug 30, 2018
b6f0f5e
decrease bundle size drastically
mmahalwy Aug 30, 2018
57cd326
fixes https://github.com/quran/quran.com-frontend/issues/990
mmahalwy Aug 30, 2018
3f95eeb
Remove home from bundle check
mmahalwy Aug 30, 2018
4bf690b
remove jobs
mmahalwy Aug 30, 2018
d7a9b6d
wrote docs
mmahalwy Aug 30, 2018
cd35ff0
more docs
mmahalwy Aug 30, 2018
6ffb2de
work jest
mmahalwy Aug 30, 2018
f95a0c3
change config
mmahalwy Aug 30, 2018
a141f8a
change config
mmahalwy Aug 30, 2018
b16ea42
change config
mmahalwy Aug 30, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 18 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ jobs:
- run:
name: install
command: npm install
- run:
name: test
command: npm run test
- run:
name: rebuildSass
command: npm rebuild node-sass
Expand All @@ -20,8 +17,26 @@ jobs:
- run:
name: bundlesize
command: npm run bundlesize
test:
docker:
- image: circleci/node:latest
steps:
- checkout
- run:
name: install
command: npm install
- run:
name: lint
command: npm run lint
- run:
name: jest
command: npm run jest -- --forceExit --detectOpenHandles --runInBand
- run:
name: typescript
command: npm run type
workflows:
version: 2
test_and_build:
jobs:
- build
- test
Empty file removed .eslintignore
Empty file.
55 changes: 0 additions & 55 deletions .eslintrc

This file was deleted.

11 changes: 11 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const path = require('path');

const paths = [path.join(__dirname, './config/eslint/base.js')];

paths.push(path.join(__dirname, './config/eslint/typescript.js'));

paths.push(path.join(__dirname, './config/eslint/prettier.js'));

module.exports = {
extends: paths,
};
3 changes: 2 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Contributing

You want to help? You rock! Now, take a moment to be sure your contributions make sense to everyone else.
Thank you very much for your interest to help. We could use as much help as possible from our community.

## Reporting Issues

Found a problem? Want a new feature?

- See if your issue or idea has [already been reported].
- File a new issue in Github.


## Submitting Pull Requests
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ selenium-debug.log
webpack-stats.debug.json
*.DS_Store
.vscode
coverage/
coverage/
.awcache
11 changes: 0 additions & 11 deletions .prettierrc

This file was deleted.

8 changes: 8 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
useTabs: false,
printWidth: 80,
tabWidth: 2,
singleQuote: true,
trailingComma: 'es5',
jsxBracketSameLine: false,
};
7 changes: 0 additions & 7 deletions .stylelintrc

This file was deleted.

7 changes: 7 additions & 0 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
rules: {
'unit-no-unknown': true,
'no-duplicate-selectors': true,
'block-no-empty': true,
},
};
13 changes: 3 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ Read the [contributing] section before creating an issue.
- Ensure you have [nodejs] installed
- Get the source by running `git clone https://github.com/quran/quran.com-frontend/` or creating a [fork]
- Run `npm install` to do first time installation of all dependencies
- Run `npm run dev` to start the dev server. Make sure you have pm2 installed globally! `npm install -g pm2`
- Run `npm run dev` to start the dev server.
- Open `http://localhost:8000` in your browser to see the app.

## Staging
To see the app with the latest changes, see the [staging] site. Production releases are made periodically when staging is stable and well tested.

## Backend
The API source is at https://github.com/quran/quran-api-rails
The API source is at https://github.com/quran/quran.com-api

DB is private, message @mmahalwy for access.
DB is private. Message on Slack to requrest access.

The dev server uses the staging API by default. If you want to use a local API server, follow the instructions in the API repo and run the server locally then update the API_URL field in app.json to point to the local address.

Expand All @@ -34,13 +34,6 @@ Create an issue with your email for us to add you to the Slack group
## Design
We currently use InvisionApp. Again, contact me if you'd like access to it.

## Making sure main.js is small
Follow: https://www.npmjs.com/package/webpack-bundle-size-analyzer
```
env NODE_ENV=development webpack --json > bundle-stats.json
subl bundle-stats.json #so that you can the output
analyze-bundle-size bundle-stats.json
```

[Reactjs]: https://facebook.github.io/react/docs/getting-started.html
[Redux]: http://redux.js.org/
Expand Down
43 changes: 43 additions & 0 deletions config/components/ClientConfig.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import React from 'react';
import PropTypes from 'prop-types';
import serialize from 'serialize-javascript';
import filterWithRules from '../../shared/utils/objects/filterWithRules';
import values from '../values';

// Filter the config down to the properties that are allowed to be included
// in the HTML response.
const clientConfig = filterWithRules(
// These are the rules used to filter the config.
values.clientConfigFilter,
// The config values to filter.
values
);

const serializedClientConfig = serialize(clientConfig);

type Props = {
nonce: string;
};
/**
* A react component that generates a script tag that binds the allowed
* values to the window so that config values can be read within the
* browser.
*
* They get bound to window.__CLIENT_CONFIG__
*/
const ClientConfig: React.SFC<Props> = ({ nonce }: Props) => (
<script
type="text/javascript"
nonce={nonce}
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{
__html: `window.__CLIENT_CONFIG__=${serializedClientConfig}`,
}}
/>
);

ClientConfig.propTypes = {
nonce: PropTypes.string.isRequired,
};

export default ClientConfig;
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,20 @@ const serializedClientConfig = serialize(clientConfig);
*
* They get bound to window.__CLIENT_CONFIG__
*/
function ClientConfig({ nonce }) {
return (
<script
type="text/javascript"
nonce={nonce}
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{
__html: `window.__CLIENT_CONFIG__=${serializedClientConfig}`
}}
/>
);
}
// TODO: Combine with tsx
const ClientConfig = ({ nonce }) => (
<script
type="text/javascript"
nonce={nonce}
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{
__html: `window.__CLIENT_CONFIG__=${serializedClientConfig}`,
}}
/>
);

ClientConfig.propTypes = {
nonce: PropTypes.string.isRequired
nonce: PropTypes.string.isRequired,
};

export default ClientConfig;
Loading