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
Adding react template #30
Conversation
@@ -0,0 +1,24 @@ | |||
package config | |||
|
|||
type reactApp struct { |
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.
these types are not exported to avoid namespace pollution
@@ -1,11 +1,17 @@ | |||
{ | |||
"name": "{{ .Name }}", | |||
"name": "commit0", |
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.
this file is only used for local dev, see corresponding template file that is used in code generation
<Layout> | ||
<Router> | ||
<Switch> | ||
<Route path="/a"> |
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.
these are just placeholders as we add more meaningful content
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.
I guess we would be eventually be generating routes from API?
@@ -0,0 +1,15 @@ | |||
export default { |
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.
this file is only used for local dev, see corresponding template file that is used in code generation
@@ -0,0 +1,31 @@ | |||
const initialState = { |
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.
create a generic reducer that we will be able to use for common redux stores..
import { createMuiTheme } from '@material-ui/core/styles'; | ||
|
||
// A custom theme for this app | ||
const theme = createMuiTheme({ |
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.
was thinking to templatize these variables, but thought might be an overkill
func removeTmplDuplicates(keys []string) []string { | ||
filteredKeys := []string{} | ||
for _, key := range keys { | ||
if !containsStr(keys, key+".tmpl") { |
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.
essentially if we have a .tmpl
file with the same name, ignore the original file as its only used for local dev
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.
looks good so far, going to test this today
<Layout> | ||
<Router> | ||
<Switch> | ||
<Route path="/a"> |
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.
I guess we would be eventually be generating routes from API?
This addresses couple of things:
.tmpl
extnesions.. for example you can haveconfig.js
for running your react app while development andconfig.js.tmpl
as templating file.. when skeleton is generated it will skipconfig.js
and useconfig.js.tmpl
to generateconfig.js
file instead