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

feat: write the first part of the tutorial in English #647

Closed
wants to merge 1 commit into from

Conversation

illright
Copy link
Member

Background

Continuation of #574

Changelog

Replaced the English tutorial with part 1 of the new one. It should be better than the old one even when only consisting of one part.

Copy link

netlify bot commented Dec 17, 2023

Deploy Preview for pr-fsd ready!

Name Link
🔨 Latest commit ee87a92
🔍 Latest deploy log https://app.netlify.com/sites/pr-fsd/deploys/657f60909e417e0008ad90f9
😎 Deploy Preview https://deploy-preview-647--pr-fsd.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

- `i18n` — locales and internationalization providers
- `store`\* — store providers
- `routes` — route constants
- `env` — environment variables
Copy link
Member

@NazariiShvets NazariiShvets Dec 18, 2023

Choose a reason for hiding this comment

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

env — environment variables

Imo it should be more familiar config segment. Since we already declared it in other articles and for envs it could be shared/config/env.ts

- `ui` — the UI kit
- `api` — the configuration of the API client
- `i18n` — locales and internationalization providers
- `store`\* — store providers
Copy link
Member

@NazariiShvets NazariiShvets Dec 18, 2023

Choose a reason for hiding this comment

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

store* - store providers

I don't get this one. Could you elaborate on this, maybe provide some examples?

Which stores we provide? If we talk about some shared providers like I18nProvider or NotificationProvider or something like that, we probably should leave this providers within their original slices

- `api` — the configuration of the API client
- `i18n` — locales and internationalization providers
- `store`\* — store providers
- `routes` — route constants
Copy link
Member

Choose a reason for hiding this comment

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

routes — route constants

Probably should be shared/router/paths.ts rather specific usecase, so if we need add more things there which are about router it would be clear where to put it


- `ui` — the UI kit
- `api` — the configuration of the API client
- `i18n` — locales and internationalization providers
Copy link
Member

Choose a reason for hiding this comment

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

i18n — ...

👍


Usually, these two layers are the best places to define your custom segments. Don’t be afraid to create new segments, they don’t cost you anything. For example, your Shared layer could consist of the following segments:

- `ui` — the UI kit
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: Probably should order them in alphabetical order, because they aren't layers, so people don't loose their shit trying to find extensions for ordering or renaming with 01_ui

- api
- config
- i18n
- router
- ui

image


*Every element that represents as entity or a feature is placed in the folder of that entity or feature.*

Once you fully realise that we’re suggesting to have a separate folder for a lousy Delete button, you may rightfully protest, thinking that it is pure overhead with no benefit. And you’re right, it is a lot of overhead. You don’t have to decompose this precisely, though. We believe in what we like to call **Pain-Driven Development** — when you only need to do something if *not doing it* causes you pain. Many small applications don’t really need to have the Features layer, and sometimes they don’t even need the Entities layer. Our application is a prime example of that, however, for the educational purposes of this tutorial, we will go all the way. <!-- TODO: At the end, we will present two versions of the final application: one *fully decomposed* and one *reasonable*. -->
Copy link
Member

Choose a reason for hiding this comment

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

👍

📂 features/
📁 edit-note/
📁 delete-note/
📁 sync-notes/
Copy link
Member

Choose a reason for hiding this comment

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

I didn't find any button or something in images which references sync-notes feature, so I don't get why we need this feature

📁 authenticate/
```

We grouped some features together (like create and edit, or log in and log out) and omitted some features altogether (reading notes requires no interaction with the app apart from page navigation) because that’s what makes sense from the technical side.
Copy link
Member

@NazariiShvets NazariiShvets Dec 18, 2023

Choose a reason for hiding this comment

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

nit: Technically we didn't group them, we merge them into one feature called auth/authenticate * (at least I perceived it in that way)
Grouping is about new folder without reuse code

Probably you mean this

- authenticate
   - sign-out or logout
   - sign-in

instead of (its not that I against of this approach, but wording could be more clear)

- authenticate
  - model 
    - sign-in.model.ts
    - sign-out.model.ts
  - ui
    - sign-in-form
    - sign-out-button

- Model segment — storage of the fetched notes for app-wide access
- Features
- Authenticate slice
- UI segment — the button to sign in that displays the current user
Copy link
Member

Choose a reason for hiding this comment

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

you missed here mention about sign-in form
image

Comment on lines +250 to +254
- Entities
- Note slice
- UI segment — the appearance of a note card
- API segment — query for a list of notes from the backend
- Model segment — storage of the fetched notes for app-wide access
Copy link
Member

Choose a reason for hiding this comment

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

Probably should contain entity user/session so it would be clear from where we read user name Sign-out (Lev)

@illright illright marked this pull request as draft January 7, 2024 17:07
@illright
Copy link
Member Author

This tutorial is no good as well

@illright illright closed this Feb 18, 2024
@illright illright deleted the new-tutorial-2 branch February 18, 2024 18:47
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.

2 participants