guppy icon indicating copy to clipboard operation
guppy copied to clipboard

Info for docs

Open joshwcomeau opened this issue 5 years ago • 7 comments

There are a few conventions we should crystallize somewhere. I'm still not sure what the best way is (if we should enumerate every low-level convention, or if we should just link to "good examples" within the codebase)... but until we figure that out, we can collect ideas here.

From #208:

  • Use it instead of test for Jest tests
  • Use prevState as the variable for the starting Redux state for reducer tests:
const prevState = { ... };

const action =  { ... };

const expectedState = {...}
const actualState = reducer(prevState, action);

expect(actualState).toEqual(expectedState);
  • Installing dependencies (use devDependencies, exact versions)
  • Flow: Use Array<x> instead of x[]

joshwcomeau avatar Sep 03 '18 16:09 joshwcomeau

Here are a few rough writeups I've done explaning some of the more complex flows:

  • Why sagas over middlewares https://gist.github.com/superhawk610/6b3302ccc423d344ba2d3c024f826363
  • Middleware/saga workflow https://gist.github.com/superhawk610/fa9b5550736d4032c4ff338295b8201b
  • Queue flow https://gist.github.com/superhawk610/b7af4eb253abf363c2c0ce7f9ac01f47

superhawk610 avatar Sep 03 '18 21:09 superhawk610

As mentioned on Gitter I'd like to add an issue to the docs that occured recently and looks like a bug but we think it's only an installation issue. The issue happend to @superhawk610 and me on Windows. I'm thinking we could add a section like known-issues during development. As I think it took me around one hour to figure out that nothing is broken.

After starting devServer or taskRun a message like following can be displayed telling that react-scripts weren't found. But the weird thing was that devServer was working just the other scripts displayed that message. (For Aaron just devServer wasn't working but the others worked.) error

It looks like an issue with spawn and environment handling but it's not and the following should help to fix the problem:

  • Remove node_modules folder (optional)
  • Run yarn
  • Reset application state (optional)
  • Create a new project for testing (It could be also caused by a messed project - but I couldn't re-create it)

It would be better to fix the issue but I couldn't find a solution. The problematic location seems to be path addtion to env in getBaseProjectEnvironment in platform.service - testwise removal seems to fix the issue but I think we should keep it as is.

AWolf81 avatar Sep 11 '18 05:09 AWolf81

hm this reminds me of the issue we used to see because of a problematic version of NPM. I thought switching to yarn would have fixed it :/

joshwcomeau avatar Sep 11 '18 16:09 joshwcomeau

@joshwcomeau I'd like to add some notes about Zenhub.

Here is a gist for Zenhub - Getting started section.

AWolf81 avatar Oct 02 '18 06:10 AWolf81

Cool, sounds good! I'll read through them tomorrow morning, as I set up Zenhub for the first time =)

joshwcomeau avatar Oct 05 '18 02:10 joshwcomeau

We should add an info to our dev docs about the process logging that I'll merge soon.

It can be enabled in src/config/app with LOGGING: true and will enable the logging of every child process. That's especially useful for tasks that don't have a terminal in Guppy UI. Tasks like eject or project creation can be debugged as every output is logged to the Chrome console.

AWolf81 avatar Oct 15 '18 13:10 AWolf81

Publishing setup (for local publishing) GH_TOKEN is required for yarn run publish to work. Go to Github settings page and create a Personal access token with Repo permission and add it to your system env. For Ubuntu I had to add it to publish call like following (env. var setting in ~/.bashrc wasn't working for me): GH_TOKEN=personal_access_token yarn run publish

This will run yarn dist and uploads the installer to the release. This is required to be called on each platform Mac, Windows & Linux.

AWolf81 avatar Oct 30 '18 23:10 AWolf81