Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Full archetype including builder-init sample app #1

Merged
merged 57 commits into from Mar 4, 2016

Conversation

zachhale
Copy link
Contributor

This is a big one. /cc @coopy @ryan-roemer

builder-init sample app

Features

  • react-router implementation
  • redux
  • server-side rendering

I tried to simplify the app down to a barebones including the above features inspired by @coopy's example app and in a way that I would want when starting a new react app. There are some features of converter-react for bootstrapping through the querystring which I omitted. I also found the middleware model for bootstrapping data confusing for an app that has many routes that require differing bootstrapped data per route.

Testing this PR

$ npm i -g builder-init
$ builder-init /FULL/PATH/TO/builder-react-app

Once the project is generated, you'll need to npm link to the builder-react-app as well.

$ cd /FULL/PATH/TO/builder-react-app
$ npm link # links builder-react-app
$ cd dev/
$ npm link # links builder-react-app-dev
$ cd /FULL/PATH/TO/GENERATED/APP
$ npm link builder-react-app
$ npm link builder-react-app-dev

Then you can npm install in peace!

TODO

  • update READMEs to talk about using builder-init and organize development docs
  • make sure all of the dependencies are necessary and up to date.
  • partialize webpack configs
  • refactor into peerDependencies

@zachhale zachhale changed the title Converter react archetype init Full archetype including builder-init sample app Feb 22, 2016
@@ -0,0 +1 @@
node_modules
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add dist

edit: never mind, that is only for init/{{gitignore}}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need a full .gitignore here that applies to all the files in the archetype, so like init, config, etc.

Should probably at least have:

\.git
\.hg

\.DS_Store
\.project
node_modules
npm-debug\.log*
phantomjsdriver\.log

coverage

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ryan-roemer what's the reasoning for the escaped .s?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zachhale -- Long habit. But I don't remember my escaping / globbing rules where. I'd consult a modern gitignore reference and check -- the slashes may well be not needed.

@coopy
Copy link

coopy commented Feb 22, 2016

Looks great!

If you're a reviewer testing this out, you would run

$ npm i -g builder-init
$ builder-init /FULL/PATH/TO/builder-react-app

Then cd into the resulting react app and try going through the development instructions.

@divmain
Copy link

divmain commented Feb 22, 2016

Looks like you need to add .DS_Store to the local .gitignore also.

@divmain
Copy link

divmain commented Feb 23, 2016

@zachhale and remove the .DS_Store files from the branch - sorry I didn't say that before.

loaders: [
{
test: /\.jsx?$/,
exclude: [/node_modules/],
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we do path.join(ROOT, "node_modules/") here, too?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I'd recommend removing exclude

and instead doing:

include: [base.context]

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, that'd be much better.

@@ -0,0 +1,40 @@
"use strict";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove entire file as it's not needed anymore. Yay!

}
return res.json();
})
.then((data) => data)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always catch even if you just explicitly re-throw

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The promise is returned. It's upstream responsibility to catch

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question though - what's the point of the then(x => x)? This line should go away, yes?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, removing this line.

@zachhale
Copy link
Contributor Author

zachhale commented Mar 1, 2016

@baer responded to last round of feedback. Please re-review.

@ryan-roemer
Copy link
Member

@zachhale -- Looking good for getting in the first iteration! I'd really just like that blurb harmonized, and that's it for me on this round.

Huge thanks again to you and @baer for a whole lotta review ❤️

@zachhale
Copy link
Contributor Author

zachhale commented Mar 3, 2016

@ryan-roemer is this clear for merge then? I'd love to get this in and start opening up separate issues if it's good as a v1!

@ryan-roemer
Copy link
Member

@zachhale -- I'm good if @baer is!

@baer
Copy link

baer commented Mar 3, 2016

Merge it! If there is more work to be done lets do it in PRs so we can track it.

Nice work Zach!

zachhale added a commit that referenced this pull request Mar 4, 2016
Full archetype including builder-init sample app
@zachhale zachhale merged commit 5602f5b into master Mar 4, 2016
@zachhale zachhale deleted the converter-react-archetype-init branch March 4, 2016 00:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants