Closed kalutheo closed 5 years ago
I think that we should consider two scenario :
For the first scenario, in my opinion, generator-elm-starter-kit cli is more appropriate. It doesn't rely on parcel, it's just plain elm so it's blazing fast to launch.
On the other hand, for bootstraping a new project, generator-elm-parcel
is more complete, and has many options that helps for the long run.
I suggest to get some inspiration from vue/cli
https://cli.vuejs.org/guide/
I like the presets concept.
We can imagine the elm-app-gen
to have two modes (aka presets) :
simple mode : This is the default mode and is great for prototyping. it does not depend on anything , just plain elm
advanced mode : This is a mode that we can activate by providing some arguments to the cli such as --advanced
this will display more advanced choices and is perfect for creating a new project.
What do you think about that @MattCheely ?
I have been thinking about some similar things, but maybe not quite in the same way. I'm just going to make a list of ideas I think are related and you can tell me if any of them mesh well with what you're thinking:
create
for new projects, and add
to add new things to an existing project.quickstart
command which just goes straight for the defaultsI'm curious about what you have in mind for the details of fast prototyping. It looks like Vue's version just serves a single file with no project. Is that what you were thinking, or just something that very quickly created a project and started serving it?
You mentioned that generator-elm-starter-kit
is fast to launch because it just relies on Elm and not parcel. Are you saying that's because there are fewer dependencies to fetch and install, or is there another factor at play? I would be curious to see what the actual time difference is vs using parcel without all of the setup prompts.
I have been thinking of two commands for the CLI, create for new projects, and add to add new things to an existing project.
I have the same vision here
I think that the current start-up prompts may be a bit too verbose by default. I think that could be fixed by choosing a few to remove, or by providing a quickstart command which just goes straight for the defaults
Definitely
I have thought about doing presets as well, but sidelined it as a nice-to-have item to add later. I forgot about it though when we were discussing the roadmap, but now that you mention it, yes I think it's a good idea.
Great :-)
I also think that eventually the project should be similar to vue-cli where there's a global CLI command, but what it does is based on a local dependency in the project.
Ok for me
You mentioned that generator-elm-starter-kit is fast to launch because it just relies on Elm and not parcel. Are you saying that's because there are fewer dependencies to fetch and install, or is there another factor at play?
Here i'm talking about first installation time. When using parcel, we are installing a bunch of node_modules under the hood. But it's not a bad thing , it's just normal . I suggest disabling by default parcel in quick mode
but once we enter the full verbose mode, we can select parcel. We can even have a --preset parcel
option .. But again it's just a matter of providing good default to our end users
If parcel is disabled in the quick mode, how does the transition from a quick setup to a full project work? Does the user have to run another command to upgrade to parcel, or do we set parcel as a dependency and they have to come back later and run npm install
and end up using a different build server the second time around?
What if we can get the best of both approaches? Fast start-up with the hot-reloading and full build pipeline of parcel? It seems like vue-cli
and generator-elm-starter-kit
both get really fast startup by using build tools that are globally installed as dependencies for the cli command, so there's no npm install
approach. So the speed doesn't come from parcel vs standalone elm, but from when the build tools is installed.
What if when elm-app-gen
is installed globally it includes parcel and elm and the other dependencies that are loaded in a new project by default? When users create the new project, we generate the files for them (should be very fast), immediately start the parcel live-server from the global install of elm-app-gen
and then run npm/yarn install in the background while the server is running. Startup is crazy fast, but next time they come back to the project they get the exact same experience as before, rather than a potentially different build tool.
I experimented with the approach above briefly - just the part about running parcel directly from elm-app-gen, and it took about 4-5 seconds to start the server and compile the app. Parcel still wants to install some dependencies when this happens, but it's fast enough that I think by the time the end user gets the browser open, the app should be ready. There's also no extra click-through actions for the user to take once the browser is open, as with elm-reactor.
Okay i got your point, we can keep parcel. I didn't think about the use case of installing the tool globally. I think opening the app straight after the building without requiring an additional click is also a good point.
I have finished migrating my templates in my feature branch. i will now need to see how it plays with parcel i hope i can finish to merge my work with yours by the end of next week
Sounds good. Thanks for bringing the start-up speed into the conversation, by the way. I spent quite a bit of time thinking about it the other day, and I think considering it will be a nice improvement to the project. Apologies if my response came across as pushy. I had a lot of questions and ideas after considering it, and on re-reading it seems like I didn't take much care in crafting my responses and just brain dumped directly into the thread, which usually doesn't come across well.
Resolved in #17
Be able to select a kind of program like https://github.com/kalutheo/generator-elm-starter-kit