Closed aendra-rininsland closed 4 years ago
How would we change the default layout in individual projects if we wanted to (e.g. add another social button, center the headline, etc...)? I wonder if a commented out example would be helpful.
Can we still use the Origami build service? Where would we add that in?
@joannaskao —
re: Origami Build Service deps, that's currently hardcoded in g-components. Will make configurable
re: modifying the default layout, it can be done by replicating g-components/Layout and overriding individual components. As g-components
matures, more customisation will be possible without having to replicate individual components, though in general it's kind of designed to prevent non-standard design decisions without a bit of work.
The more I think about it the more I really like the separate g-components
-- I think it's a much better structure. Which made me think -- are there any more parts we could move out into separate, versioned releases? Would be great if the only code you got with Starter Kit was code that you would be very likely to modify -- like client/app.js
, config/index.js
, etc.
I think the advantages of this approach would be:
I'm imagining a fresh future Starter Kit project being just a few files -- one with the main body content, one setting up the build, a config file, a package.json
(with just a couple dependencies on g-components
, and other g-
things), as well as a few dotfiles.
One candidate would be the Webpack build -- could that potentially be pulled out into a g-builder
repository? A default Starter Kit project could then have package.json
scripts that call it.
What do you think? Good idea?
@maxharlow I do quite like that idea, I think we talked briefly last week about creating something that works similar to create-react-app
that can be saved as a dependency and then ejected if necessary. I'm inclined to sort that out sooner rather than later to benefit most from all the shared dependencies.
Closing and renaming branch to master
🎉
Okay, lots of stuff going on here.
views/
has been totally replaced by @financial-times/g-componentsserver/index.js
does the first pass of rendering the page. Once the client loads the bundle, it re-hydrates with possibly updated state or whatever else.client/
now has two JS files by default — the Webpack entry point (index.js
) and the root<App>
component (app.js
). Would love to simplify this more, not sure if it's possible. Mostly you won't ever have to do anything inindex.js
.client/app.js
. Currently you can't use Markdown, though that isn't overly difficult to add.client/components/core/top.css
. I may just minify it and put it statically in the<HtmlHead>
element ofg-components
. Doesn't seem to have broken anything, though?<Comments>
is a PureComponent and not a stateless component). It's generally better to initialise Origami stuff incomponentDidMount()
, unless the issue I was running into merely was due too-comments
not loading without a title attribute (in which case some better error logging would be nice...). See source for{' '}
in JSX to separate them from the next word when in, say, a paragraph). Please fix these as you notice them and push your fixes to this branch, thanks.g-components
because the latter needs Webpack 3 for Storybook to build properly.