Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some major changes #3388

Merged
merged 5 commits into from
Jan 10, 2018
Merged

Some major changes #3388

merged 5 commits into from
Jan 10, 2018

Conversation

shannonbux
Copy link
Contributor

I streamlined this to just one option: CSS Modules. I saved all the text that I took out in case we need it later or want to put it back in.

One edit that I wrote in my notebook, which I now don't understand, reads: "Tell people to create src/pages/about-styled-components.js

I streamlined this to just one option: CSS Modules. I saved all the text that I took out in case we need it later or want to put it back in. 

One edit that I wrote in my notebook, which I now don't understand, reads: "Tell people to create `src/pages/about-styled-components.js`
@ghost ghost assigned shannonbux Jan 2, 2018
@ghost ghost added the review label Jan 2, 2018
@gatsbybot
Copy link
Collaborator

gatsbybot commented Jan 2, 2018

Deploy preview ready!

Built with commit e5ed00a

https://deploy-preview-3388--gatsbygram.netlify.com

Copy link
Contributor

@KyleAMathews KyleAMathews left a comment

Choose a reason for hiding this comment

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

I really like in general the idea of simplifying this part of the tutorial. Are we sure it's confusing though? It's very clear that the Glamor/Styled Components parts are duplicates and I think it's really important that we introduce css-in-js at this point. Have you heard negative feedback from people about this part of the tutorial?

It'd be nice if there was a clear winner in this space that we could push people to. I feel 90% confident that css-in-js will win so want to make sure we're introducing people to it.

@@ -108,8 +108,9 @@ plugins.

## Installing your first Gatsby plugin

Let's start by creating a new site. Similar to Part One, run the following to
create a new site.
Let's start by creating a new site. At this point it probably makes sense to close the terminal window(s) you used to build tutorial-part-one so that you don't accidentally start building tutorial-part-two in the wrong place. If you don't close tutorial-part-one prior to building tutorial-part-two, you will see that tutorial-part-two appears at localhost:8001 instead of localhost:8000.
Copy link
Contributor

Choose a reason for hiding this comment

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

💯

@@ -229,8 +230,8 @@ Ah, this is starting to look nice!
What we're seeing here is the default CSS Typography.js produces. We can easily
customize it, however. Let's do that.

In your site, create a new directory at `src/utils`. There create a file named
`typography.js`. In it, add the following code.
In your site, create a new directory at `src/utils` (hint: in code editors, creating a new directory looks like creating a new folder). In that directory, create a file named
Copy link
Contributor

Choose a reason for hiding this comment

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

a directory is the same thing as a folder :-)

If this is confusing, let's make sure to use the same word throughout the tutorial (and documentation).

Choose a reason for hiding this comment

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

I believe directory is more standard in this industry. "folder" seems so non-professional.

@shannonbux
Copy link
Contributor Author

shannonbux commented Jan 2, 2018 via email

This unfortunate restriction can lead to elaborate (and often confusing)
selector naming schemes.
Note: CSS-in-JS is another viable method for styling components which solves many of the problems with
traditional CSS. We don't have room to focus on it in this tutorial, so we'll point you to the following resources for backgroung reading on CSS-in-JS:
Copy link
Contributor

Choose a reason for hiding this comment

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

background

@dustinhorton
Copy link
Contributor

dustinhorton commented Jan 3, 2018

I'm not aligned on what the entire goal for this tutorial is (or your opinion on CSS-in-JS), but personally do think it really muddies one of the main resources on how to use Gatsby with such an optional/opinionated tech, especially multiple flavors. I think it'd be stronger with none (instead share the simplest, most standard styling method) or one (your preferred method).

@whmountains
Copy link

Please don't remove the section about CSS-in-JS. I'm admittedly biased, but I think it's premature to "bless" a particular styling solution. The community is still figuring it out.

@KyleAMathews
Copy link
Contributor

personally do think it really muddies one of the main resources on how to use Gatsby with such an optional/opinionated tech, especially multiple flavors. I think it'd be stronger with none (instead share the simplest, most standard styling method) or one (your preferred method).

One student I interviewed
in Germany (LekoArts) did mention feeling overwhelmed by Part Two and
suggested that it be divided into two tutorials (one about Typography and
one about CSS). This is what he said: "I personally think that Part Two
should be split up and the Styling have its own Part. If you have no idea
what the styling in React looks like (and your background is plain
css/scss) this can be a bit overwhelming. I also re-read it multiple times
to get the gist of every possibility."

Hmmmm yeah — it is needlessly confusing to have all three. Here's a different idea — how about we trim things back to just CSS Modules like this PR does but we take the glamor/styled components and move them into mini tutorials on separate pages and link to them so if people want to see what using css-in-js w/ Gatsby is like, they can try those.

How's that sound?

@KyleAMathews
Copy link
Contributor

but if it makes more sense to have a "Tutorial Zero" for this kind of stuff

yeah! Or perhaps a "glossary" of terms that Gatsby uses — we could even get fancy and add hover explanations for potentially confusing ideas.

@KyleAMathews
Copy link
Contributor

I do like the idea of having lots of mini-tutorials that can be linked to lots of places. The main tutorial should be a bright path through the heart of learning Gatsby but be composed of multiple shorter tutorials + there should be lots of branches off the mainline for people to explore.

@shannonbux
Copy link
Contributor Author

shannonbux commented Jan 3, 2018 via email

@benjaminhoffman
Copy link
Contributor

FWIW... my vote....

@shannonbux when I went through this part of the tute many months ago, I benefited from the compare/contrast aspect of the CSS. But I also agree with you that offering too many options could be debilitating.

I like the middle ground... choose one then put the other two in another section that's broken out. At the top of Part Two, add a note, something like "To learn two alternative ways to use CSS with Gatsby, click here" ... or something along those lines.

@shannonbux
Copy link
Contributor Author

shannonbux commented Jan 4, 2018

Yeah, let's keep the tutorial simple with one choice but offer the other two options as mini-tutorials for people who are ready for that.

Research about why it's helpful to streamline tutorials for novices and offer extra optional resources for experts

*Side note: if you read through the research I just linked to, you'll also notice there are sort of 7 deadly sins of online tutorials, some of them being excessive hyperlinks (i.e. rabbit holes, which are terrible for novices) and attention splitting (e.g. having to toggle between multiple screens whilst going through the tutorial)

@shannonbux
Copy link
Contributor Author

shannonbux commented Jan 4, 2018

A relevant comment from @NerdCowboy just now: "I’m a bit confused why css modules isn’t listed on the plugins page—is that just apart of Gatsby core?

Both Glamor and Styled Components are listed in the plugins page, but CSS Modules is missing (though there’s now a typescript css modules plugin listed). The only place I can find any information on CSS Modules is in the tutorial—something not everyone will go through.

So even if it is technically apart of Gatsby core, I would still expect to find some documentation even if it’s simply just mentioning the file’s naming scheme and linking to the official css-modules plugin for full documentation."

@shannonbux
Copy link
Contributor Author

Ok, just created a PR to create mini-tutorials for Glamor and Styled Components. Wondering if the code examples make sense when they are not part of a bigger tutorial (in other words, will the code examples make sense to someone who is not using the gatsby tutorial-part-two starter?

@ghost ghost assigned KyleAMathews Jan 10, 2018
@KyleAMathews
Copy link
Contributor

Made a few tweaks but looks really good! Thanks for the extensive review/surgery here! I think this will really help streamline the flow through this part of the tutorial.

@KyleAMathews KyleAMathews merged commit bf6d031 into master Jan 10, 2018
@ghost ghost removed the review label Jan 10, 2018
@KyleAMathews KyleAMathews deleted the shannonbux-patch-1 branch January 10, 2018 00:42
jastack pushed a commit to jastack/gatsby that referenced this pull request Jan 24, 2018
* Some major changes

I streamlined this to just one option: CSS Modules. I saved all the text that I took out in case we need it later or want to put it back in. 

One edit that I wrote in my notebook, which I now don't understand, reads: "Tell people to create `src/pages/about-styled-components.js`

* Update index.md

* Reintroducing Glamor and Styled Components as "bonus" items

Now they are separate mini-tutorials.

* Update index.md

* Update index.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants