Open asavin opened 9 years ago
:+1: on everything you said.
So I guess it's going to be an npm module, and the full journey for the first time user will be like this:
npm install -g reflex
- or whatever the name will bereflex init helloworld && reflex s
npm install -g reflex
?
Thanks, yes, -g
Just thought of an idea. Should reflex s
also start a gulp watch and recompile with changes...?
Yeah I think it's a great idea to combine server with hot code reload.
One fun thing for the example app would be having responsive layout in place and different looking components that are replacing each other for each breakpoint while sharing the same data.
Also generate tests for UI components: props go in -> expected html comes out
What would be the difference between scaffold and generate?
Yeah that's kind of confusing. generate
should just take a parameter which defines what to generate. ie. reflex g route [path] [(optional) component]
@dpiatek in Rails you can generate
skeleton of the app, then generate
some extra models / controllers, and then scaffold
views for CRUD actions on those models. What sort of things are we possibly interested in generating, apart from routes
?
@tabazevedo assuming that componentName
will always match routeName
?
@asavin no, i meant that you can specify the component name but it defaults to matching the path. I guess path
and routeName
will be different though so I suppose it would be reflex g route [path] [routeName] [(optional) componentName]
and by default componentName = routeName
@asavin isn't scaffold just a generator in Rails, as in rails generate scaffold
? http://guides.rubyonrails.org/v3.2.13/getting_started.html#getting-up-and-running-quickly-with-scaffolding . Would nice to have one command to generate them codes.
Yeah in Rails it just generates a model with a controller with a view (and some other misc stuff), so its a bit of shorthand.
Is there anything else besides routes
we want to generate? I was hoping to stick with something like reflex g tweets friends profile
- which would generate pages and routes for the given array of things.
(just thinking out loud)
that would generate following URL:s, root components and tests:
.../tweets
.../friends
.../profile
...aaaaaand a navbar component with links to all those pages.
More potential batteries to the box:
@asavin I think eventually, we'd like to generate "state observers" too. I'm not sure what to call them, but the things that listen on the app-state and respond to changes.
@asavin I feel like things like auth and locales are really application-specific and shouldn't be part of the cli...
@asavin Agree with @tabazevedo on auth and localisation. It shouldn't even be a part of the core framework. We should strive to make the plugins capable enough that these things are simple to build as one.
An auth plugin, for example, would be 1) a module with the logic needed, 2) a CLI plugin with a generator for the app integration. Makes sense?
@charypar yep, makes total sense
What it should be able to do
reflex i[nit] [appname]
- generates a fully functioning skeleton of the Reflex appreflex s[erver]
- serves the appreflex g[enerate] routname[s]
- generates and appends new routes into the app (with appropriate views). You can pass an array of routes.reflex install [module name]
- something about pluggable modules for the Reflex fwreflex scaffold
- something similar to Rails, but maybe not needed at allIdeas
init
would generate all the necessary files, as well as runnpm install
andgulp
, so that the app is ready to be launched withreflex server
reflex init example [name]
Principles
git
, but is ok to hidenpm
,gulp
and whatever else is required to generate and start the app