Let's discuss a command to create a functional test project

Hola =D

Everything started with this issue. After that, I created this draft PR.

The goal is to make it easier to contribute to Redwood, create a ‘canonical’ functional first project that you can have an application running in a couple of minutes, and see how cool Redwood is. With good documentation guiding new contributors on how to do this.

And how to do it? As proposed by @thedavid, the idea is to have a script that uses create-redwood-app.js, apply codemods and run the application.

At this moment, we are trying to figure out what people (you) would like to see in this app.

Some examples:

  1. A simple TODO application
  2. A bit more complex shopping
  3. A blog

This decision directly impacts how this app is expandable and the ‘showcase’ of the features. Also, it might be a good opportunity to have features like authentication, prerendering, set, layouts, etc.

So, the question is: if you were starting to contribute to Redwood and have a ‘canonical’ project to start looking at some code/features, what you would like to see?

3 Likes

I would think that simply running a script that does all of Tutorial 1+2 would be a logical first project, and then we would want a second project that expands out with more complex features.

4 Likes

good suggestion! I’m also thinking about about letting the user to select the project she would like to create? like 1, 2 or 1+2. what do you think?

1 Like

Instead of a CLI command, what it there are repos of Example RedwoodJS apps – or a repo of many Example RedwoodJS apps and then one could simply fork those or just dl and extract the zip and then yarn it and run the db migrations (ok maybe setup a db too).

That way you didn’t need the FW (with the CLI) at all but you get the app itself. It’s the entire app – not an incremental set of files patched atop a base CRWA install.

Or, you know how there are these “Deploy to Heroku” or “Deploy to Netlify” buttons — something like that.

Sounds like the first step in any case, would be to create those “canonical reference example apps” and maintain upgrade them across releases until 1.0.

3 Likes

I’m going to be expanding the example-blog app to have comments, as well as proper tests and Storybook stories, pretty much bringing you up to the end of Tutorial II…

3 Likes

Instead of a CLI command, what it there are repos of Example RedwoodJS apps – or a repo of many Example RedwoodJS apps and then one could simply fork those or just dl and extract the zip and then yarn it and run the db migrations (ok maybe setup a db too).

That way you didn’t need the FW (with the CLI) at all but you get the app itself. It’s the entire app – not an incremental set of files patched atop a base CRWA install.

Or, you know how there are these “Deploy to Heroku” or “Deploy to Netlify” buttons — something like that.

I think there’s two somewhat different things we’re trying to accomplish here. Having example projects people can use to test out Redwood quickly is good, and I think we basically already have that you just need to give a clear README to describe how to get a db setup and seeded, which is what you’re referring to here.

But I think there’s also a lot of value in having an automated process that runs through something that approximates actually building these apps. This is what Tobbe and David are referring to with this bonus bullet point.

So from that point of view you want to go through a significant amount of the steps to find weird little breaking changes that come out in unexpected ways from ripple effects when we change things from version to version.

If we just use completed example projects then we already know those work, that’s why they’re example projects, so we wouldn’t be finding many errors that way.

good suggestion! I’m also thinking about about letting the user to select the project she would like to create? like 1, 2 or 1+2. what do you think?

Yeah that’s a good question, my first thought would be to have something that runs through just the first tutorial and then another for just the second tutorial since the second tutorial starts you off with the completed Example Blog anyway.

1 Like

Following up on my message from yesterday, we chatted about this a little bit today in Discord and DT let me know that we’re already part way there:

There are e2e tests for the tutorial. It runs CRWA and then applies the tutorial steps.

And according to Tobbe:

Currently they do part of the first tutorial. And only on Linux.

So it sounds like we have a base to build on that needs to be extended to the rest of the tutorial and other operating systems.

1 Like

yes, I’ve seen that before. it uses cypress to add the codemods etc. might be a good idea to use the same script structure I’ve added to the PR with the tutorials?

@thedavid what do you think about this?

Can I ask why and what the value is? I am really curious.

  1. If I download or fork and existing app repo, I have a working app and can read the code to learn.

  2. If I follow a tutorial and write the code myself, I learn.

  3. If I download and run a script that effectively recreates 1, then what do I learn?

What DP and Tobbe mention in

bonus: developer could extend the automatic project build “instructions” with additional commands and code mods, e.g. need to add a specific auth provider, components/pages, setup commands, etc. for repeated or collaborative development testing

I think, they are referring to in e2e testing, in order to easily make a more robust and feature rich/complex app during CI and before releases – not for a tutorial or app boilerplate case.

But I could be mistaken.

Haha, so much confusion

:popcorn:

Same reason you’d ever want an end to end test, because it discovers bugs unit tests will not. You are implying that we will never break the tutorial, which is of course not the case. A test like I’m describing would have discovered the migration_lock.toml debacle which took someone actually running through the tutorial to discover.

So the purpose is to test the tutorial?

Yes, exactly, sorry if I didn’t make that clear :sweat_smile:. I think this becomes especially useful since we are promoting the tutorial as the way to build Redwood apps.

2 Likes

Late to the discussion here — appreciate everyone contributing their ideas!

I failed to clarify the scope correctly at the beginning, which is one reason there’s lack of synthesis about the use-case and requirements. To that end, this is not meant to be a “template” for building an application; it’s meant to be a functional starter project for development and testing. I do think more “starter templates” for projects that are more SPA-like is a great idea. We have some of these already — the existing challenge with repos-as-starters is keeping versions + code mods up to date.

Here’s my comment on the related PR for further discussion. Hope it helps clarify. Still very interested in suggestions and discussion as applicable: