-
When writing a string of multiple utility classes, always do so in an order with meaning. The "Concentric CSS" approach works well with utility classes (i.e,. 1. positioning/visibility 2. box model 3. borders 4. backgrounds 5. typography 6. other visual adjustments). Once you establish a familiar pattern of ordering, parsing through long strings of utility classes will become much, much faster so a little more effort up front goes a long way!
-
Always use fewer utility classes when possible. For example, use
mx-2
instead ofml-2 mr-2
and don't be afraid to use the simplerp-4 lg:pt-8
instead of the longer, more complicatedpt-4 lg:pt-8 pr-4 pb-4 pl-4
. -
Prefix all utility classes that will only apply at a certain breakpoint with that breakpoint's prefix. For example, use
block lg:flex lg:flex-col lg:justify-center
instead ofblock lg:flex flex-col justify-center
to make it very clear that the flexbox utilities are only applicable at the
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<button @click="simulateLoading"> | |
Simulate Loading | |
</button> | |
</div> | |
</template> | |
<script> | |
import Layout from "../Shared/Layout"; | |
import { fireStartEvent, fireFinishEvent } from "@inertiajs/inertia/src/events"; |
$ git checkout --orphan NEWBRANCH
$ git rm -rf .
--orphan
creates a new branch, but it starts without any commit. After running the above command you are on a new branch "NEWBRANCH", and the first commit you create from this state will start a new history without any ancestry.
You can then start adding files and commit them and they will live in their own branch. If you take a look at the log, you will see that it is isolated from the original log.
- Имена полей в ответе задавать в
snake_case
(prr_page
,created_at
,system_name
,...) - Для времени использовать
ISO 8601
(формат: YYYY-MM-DDTHH:MM:SSZ) - Отдавать данные (сам контент, поля сущностей, массивы сущностей), помещая их в
data
- GET: /api/users — получить список пользователей;
- GET: /api/users/123 — получить указанного пользователя;
- POST: /api/users — создать нового пользователя;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Аббревиатура REST расшифровывается как representational state transfer — «передача состояния представления» или, лучше сказать, представление данных в удобном для клиента формате. Термин “REST” был введен Роем Филдингом в 2000 г. Основная идея REST в том, что каждое обращение к сервису переводит клиентское приложение в новое состояние. По сути, REST — не протокол и не стандарт, а подход, архитектурный стиль проектирования API. | |
Любой ресурс имеет ID, по которому можно получить данные. | |
Сервер не хранит состояние — это значит, сервер не отделяет один вызов от другого, не сохраняет все сессии в памяти. | |
Методы POST и PUT должны возвращать обратно объект, который они изменили или создали, — это позволит сократить время обращения к сервису вдвое. | |
Возвращайте соответствующие http коды статуса в каждом ответе. Успешные ответы должны содержать следующие коды: | |
200 — для GET запроса и для синхронных DETELE и PATCH | |
201 — для синхронного POST запроса | |
202 — для асинхронных POST, DELETE и PATCH запросов |