-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove insights- repo name #381
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[![Build Status](https://travis-ci.org/RedHatInsights/insights-frontend-starter-app.svg?branch=master)](https://travis-ci.org/RedHatInsights/insights-frontend-starter-app) | ||
[![Build Status](https://travis-ci.org/RedHatInsights/frontend-starter-app.svg?branch=master)](https://travis-ci.org/RedHatInsights/frontend-starter-app) | ||
|
||
# insights-frontend-starter-app | ||
# frontend-starter-app | ||
|
||
React.js starter app for Red Hat Insights products that includes Patternfly 4 and shared cloud.redhat.com utilities. | ||
|
||
|
@@ -60,68 +60,16 @@ Note: You will need to set up the Insights environment if you want to develop wi | |
|
||
## Insights Components | ||
|
||
Insights Platform will deliver components and static assets through [npm](https://www.npmjs.com/package/@red-hat-insights/insights-frontend-components). ESI tags are used to import the [chroming](https://github.com/RedHatInsights/insights-chrome) which takes care of the header, sidebar, and footer. | ||
Insights Platform will deliver components and static assets through [npm](https://www.npmjs.com/package/@redhat-cloud-services/frontend-components). ESI tags are used to import the [chroming](https://github.com/RedHatInsights/insights-chrome) which takes care of the header, sidebar, and footer. | ||
|
||
## Technologies | ||
|
||
### Webpack | ||
|
||
#### Webpack.config.js | ||
There is [shared common config](https://www.npmjs.com/package/@redhat-cloud-services/frontend-components-config) with predefined values and lifecycles to build and run your application. | ||
|
||
This file exports an object with the configuration for webpack and webpack dev server. | ||
We are used [federated modules](https://webpack.js.org/concepts/module-federation/) to seamlessly load multiple application. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are used -> We use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wanted to go with |
||
|
||
```Javascript | ||
{ | ||
mode: https://webpack.js.org/concepts/mode/, | ||
devtool: https://webpack.js.org/configuration/devtool/, | ||
|
||
// different bundle options. | ||
// allows you to completely separate vendor code from app code and much more. | ||
// https://webpack.js.org/plugins/split-chunks-plugin/ | ||
optimization: { | ||
chunks: https://webpack.js.org/plugins/split-chunks-plugin/#optimization-splitchunks-chunks-all, | ||
runtimeChunk: https://webpack.js.org/plugins/split-chunks-plugin/#optimization-runtimechunk, | ||
|
||
// https://webpack.js.org/plugins/split-chunks-plugin/#configuring-cache-groups | ||
cacheGroups: { | ||
|
||
// bundles all vendor code needed to run the entry file | ||
common_initial: { | ||
test: // file regex: /[\\/]node_modules[\\/]/, | ||
name: // filename: 'common.initial', | ||
chunks: // chunk type initial, async, all | ||
} | ||
} | ||
}, | ||
|
||
// each property of entry maps to the name of an entry file | ||
// https://webpack.js.org/concepts/entry-points/ | ||
entry: { | ||
|
||
// example bunde names | ||
bundle1: 'src/entry1.js', | ||
bundle2: 'src/entry2.js' | ||
}, | ||
|
||
// bundle output options. | ||
output: { | ||
filename: https://webpack.js.org/configuration/output/#output-filename, | ||
path: https://webpack.js.org/configuration/output/#output-path, | ||
publicPath: https://webpack.js.org/configuration/output/#output-publicpath, | ||
chunkFilename: https://webpack.js.org/configuration/output/#output-chunkfilename | ||
}, | ||
module: { | ||
rules: https://webpack.js.org/configuration/module/#module-rules | ||
}, | ||
|
||
// An array of webpack plugins look at webpack.plugins.js | ||
// https://webpack.js.org/plugins/ | ||
plugins: [], | ||
|
||
// webpack dev serve options | ||
// https://github.com/webpack/webpack-dev-server | ||
devServer: {} | ||
} | ||
``` | ||
|
||
### React | ||
|
@@ -153,6 +101,8 @@ Redux doesn't have a Dispatcher or support many stores. Instead, there is just a | |
|
||
[Create Store](https://redux.js.org/api-reference/createstore): ```createStore(reducer, preloadedState, enhancer)``` | ||
|
||
There is helper function used to create store with option to plug reducers on the fly called [getRegistry](https://github.com/RedHatInsights/frontend-components/blob/master/packages/utils/doc/redux.md#reducer-registry) you can see the usage of it throughout this repository. | ||
|
||
- methods | ||
- [getState()](https://redux.js.org/api-reference/store#dispatch) | ||
- [dispatch(action)](https://redux.js.org/api-reference/store#dispatch) | ||
|
@@ -199,6 +149,10 @@ Ex) [/src/api/System/getSystems.js](https://github.com/RedHatInsights/turbo-octo | |
- Makes the Redux store available to the connect() | ||
- [connect([mapStateToProps], [mapDispatchToProps], [mergeProps], [options])](https://github.com/reactjs/react-redux/blob/master/docs/api.md#connectmapstatetoprops-mapdispatchtoprops-mergeprops-options) | ||
- Connects a React component to a Redux store | ||
- [useSelector](https://react-redux.js.org/api/hooks#useselector) | ||
- Instead of connect's mapStateToProps you can use this hook in function components | ||
- [useDispatch](https://react-redux.js.org/api/hooks#usedispatch) | ||
- Instead of connect's mapDispatchToProps you can use this hook in function components | ||
|
||
### React-router-dom | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove
Insights
from each of these?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I went trough the docs and removed bunch of other insights mentions.