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

Sync with main repo @ 9fe39d8e #33

Open
wants to merge 73 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
e465983
updated prisma migrate usage in docs (#419)
amdolan Mar 23, 2021
605a361
Merge branch 'main' into canary
flybayer Apr 5, 2021
eed14c6
Update docs for upgrade to React Query v3 (#424)
philipj93 Apr 5, 2021
08fb629
Document Routes Manifest (#430)
Skn0tt Apr 10, 2021
ff957b7
Updated dependencies
JuanM04 Apr 12, 2021
20e1fb4
Uppercased "admin" in session-management.mdx (#441)
sean-brydon Apr 13, 2021
195b9a0
Few maintainers retire
flybayer Apr 14, 2021
1d1f0d7
Add myself as L1 Maintainer (#443)
Apr 14, 2021
f0c1fd1
Fix the first two issues of #436 (#439)
laubonghaudoi Apr 14, 2021
bf68c8d
Edit Dieman's personal website (#445)
Apr 15, 2021
fc1a58b
Merge branch 'main' into canary
flybayer Apr 16, 2021
dc28c78
update hero code sample to use new Routes object
flybayer Apr 16, 2021
fb9d45d
new maintainer TommasoBruno added (#444)
Apr 16, 2021
b27cfb5
Added `--inspect` flag to CLI (#447)
antonykamp Apr 17, 2021
82436ec
Fix minor typo in query-usage.mdx (#449)
wKovacs64 Apr 18, 2021
6ce3d92
Added a note about broken symlinks
JuanM04 Apr 19, 2021
fcf53b2
Typo in contributing.mdx
JuanM04 Apr 19, 2021
00986a8
Improve deploy-vercel.mdx consistency and clarity (#450)
frontsideair Apr 19, 2021
15baf5e
Upgraded dependencies
JuanM04 Apr 19, 2021
f6ce373
Remove Anonymous Functions Exports (#451)
roshan-sama Apr 19, 2021
4dbbdab
Added BlitzApiHandler
JuanM04 Apr 19, 2021
4b0a1d0
Update contributing.mdx
flybayer Apr 20, 2021
c7c36dd
add RIT as sponsor
flybayer Apr 21, 2021
287b7ba
Added description to `useInfiniteQuery` and `usePaginatedQuery` (#453)
antonykamp Apr 21, 2021
2f576f6
update docs for server.ts
flybayer Apr 21, 2021
00be103
Update get-started.mdx
flybayer Apr 22, 2021
3f003d2
Formatted docs
JuanM04 Apr 25, 2021
1bb9378
Updated dependencies
JuanM04 Apr 25, 2021
5ad4349
Fix typo tutorial.mdx (#458)
mlabate Apr 25, 2021
2c987bb
Admonitions --> Cards (#456)
JuanM04 Apr 27, 2021
a67a535
Recommend customTsParser for building a new recipe (#455)
tmcw Apr 27, 2021
d21543d
add info for proxy-support https://github.com/blitz-js/blitz/pull/226…
mubaidr Apr 27, 2021
8fdf721
Documentation for new schema.prisma transform utilities (#457)
MrLeebo Apr 27, 2021
a52e32d
Extend "run postgres via docker" section (#460)
antonykamp Apr 27, 2021
63d81ed
add multitenancy doc page
flybayer Apr 28, 2021
1b4420a
update query and mutation docs to reflect latest recommendations
flybayer Apr 28, 2021
8d31fab
add example of creating entity to multitenancy page
flybayer Apr 29, 2021
4524161
Merge branch 'main' into canary
flybayer Apr 29, 2021
bf793f8
update docs for blitz.config.ts
flybayer Apr 29, 2021
5ed8f32
update docs for nextjs 10.2
flybayer Apr 29, 2021
072cb16
another update
flybayer Apr 29, 2021
a383c86
Changed Prettier config to match new app config
JuanM04 Apr 29, 2021
0275b46
Add `scroll-behavior: smooth;` to main.css (#461)
dawnofmidnight Apr 30, 2021
9b573d2
Update use-paginated-query.mdx
flybayer May 4, 2021
e3632e9
Update use-infinite-query.mdx
flybayer May 6, 2021
5048188
Create guide to deploy to Railway (#462)
abuuzayr May 6, 2021
30f8d9a
fix tutorial
flybayer May 6, 2021
7aca5c6
update link
flybayer May 7, 2021
ed76c18
Update done method in passportjs.mdx (#464)
Kosai106 May 7, 2021
af4fae4
Update use-infinite-query.mdx
flybayer May 8, 2021
bfbb004
Fix typo in tutorial.mdx (#467)
meepdeew May 9, 2021
9ea2500
fix build
flybayer May 10, 2021
1d95336
Toggling text and removing outline (#469)
Hardik3296 May 10, 2021
e334eb8
Update query-usage.mdx
flybayer May 10, 2021
e6f46ef
add docs for setting up node.js
flybayer May 10, 2021
7209765
Documentation about prefetching and dehydratedState (#465)
MrLeebo May 10, 2021
8c8c48e
Merge branch 'main' into canary
flybayer May 10, 2021
1c11b91
improve custom server doc
flybayer May 10, 2021
d348d41
Fixes import path for useCurrentUser in authorization.mdx (#471)
craigglennie May 11, 2021
fdaa2cf
Update session-management.mdx
flybayer May 12, 2021
bd8bfc9
Images optimization (#474)
roshan-sama May 12, 2021
df4bc25
redirectAuthenticatedTo with Routes Manifest in authorization.mdx (#475)
Skn0tt May 15, 2021
70a4ef1
Typo in tradeoffs.mdx (#477)
swiftgaruda May 16, 2021
bc32f82
Update query-usage.mdx
flybayer May 17, 2021
5375fa0
Documentation Improvement: Page.authenticate implies Page.suppressFir…
Patil2099 May 17, 2021
7e1e2a7
add cookie prefix to docs
flybayer May 17, 2021
9302210
Merge branch 'canary'
flybayer May 17, 2021
28e83cc
Add doc page for eslint config and fix typo (#478)
roshan-sama May 19, 2021
e501d27
Missing import (#480)
May 19, 2021
5129c96
Avoid hardcoding "admin" role during impersonation (#481)
May 19, 2021
03e52b7
`resolver.authorize` description at resolver-server-utilities.mdx (#484)
antonykamp May 21, 2021
9fe39d8
Fix theme toggle (#485)
enemycnt May 21, 2021
cd84217
merging all conflicts
blitzjs-bot May 24, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .alexrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
// Use a "maybe" level of profanity instead of the default "unlikely".
exports.profanitySureness = 1

exports.allow = ["simple", "special", "invalid", "he-she", "her-him", "herself-himself", "obvious"]
exports.allow = [
"simple",
"special",
"invalid",
"he-she",
"her-him",
"herself-himself",
"obvious",
"easy",
]
4 changes: 3 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"files": "*.mdx",
"options": {
"printWidth": 74,
"proseWrap": "always"
"proseWrap": "always",
"bracketSpacing": true,
"trailingComma": "es5"
}
}
]
Expand Down
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,24 @@ Example:
```

If you aren't totally sure how the slug should look like, or just want to automate the process, run `yarn english-slugify`

## Cards

You can use cards, like the one at the start of [_API Routes_](https://blitzjs.com/docs/api-routes) like this:

```md
<Card type="info">

Unlike Next.js, your `api/` folder should be a sibling of `pages/` instead
of being nested inside. But `pages/api` is still supported for
compatibility with Next.js.

</Card>
```

Properties:

- `type`: `'caution' | 'info' | 'note'`
- `title`: `string` (optional)

**Remember to leave an empty line** between the component tag and the content as shown in the example above.
7 changes: 6 additions & 1 deletion app/core/components/DarkModeToggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,20 @@ const DarkModeToggle = ({className}) => {
return (
<button
onClick={switchTheme}
className={`pr-2 rounded focus:outline-none focus:ring-inset focus:ring-white focus:ring-2 ${className}`}
className={`pr-2 rounded focus:outline-none focus:ring-inset focus:ring-white ${className}`}
>
{theme === "dark" ? (
<BiToggleRight size="2rem" className="inline" />
) : (
<BiToggleLeft size="2rem" className="inline" />
)}
<span className="mx-1">
<<<<<<< HEAD
Donker<span className="lg:hidden">e Modus</span>
=======
{theme === "dark" ? "Dark" : "Light"}
<span className="lg:hidden"> Mode</span>
>>>>>>> 9fe39d8ebeff642759bb10ad1b0cd2f1114ec7aa
</span>
</button>
)
Expand Down
10 changes: 9 additions & 1 deletion app/core/components/SponsorPack.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ const sponsors = [
tier: 3,
cost: 250,
},
{
name: "RIT",
href:
"https://rit-inc.co.jp/?utm_source=BlitzJS&utm_medium=sponsorship&utm_campaign=BlitzJS_Sponsorship_2021",
imageUrl: "https://raw.githubusercontent.com/blitz-js/blitz/canary/assets/rit_logo.png",
tier: 3,
cost: 250,
},
{
name: "Andreas",
href: "https://andreas.fyi/",
Expand Down Expand Up @@ -53,7 +61,7 @@ const sponsors = [
{
name: "userTrack",
href: "https://www.usertrack.net/?ref=blitzjs_web",
imageUrl: "https://i.imgur.com/UDBeazC.png",
imageUrl: "https://raw.githubusercontent.com/blitz-js/blitz/canary/assets/usertrack.png",
tier: 4,
cost: 100,
},
Expand Down
44 changes: 44 additions & 0 deletions app/core/components/docs/Card.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import clsx from "clsx"

import styles from "./Card.module.css"

/**
* @param {{type: 'caution' | 'info' | 'note', title: string, children: any}}
* @returns
*/
export function Card({type, title, children}) {
const defaultTitle = type[0].toUpperCase() + type.substr(1)

return (
<div
className={clsx(
styles.container,
type === "caution"
? "bg-[#fdea69]"
: type === "info"
? "bg-[#69c6fd]"
: type === "note"
? "bg-blue-primary"
: undefined,
)}
>
<h5 className={styles.heading}>
<span className={styles.icon}>
<InfoIcon />
</span>
{title || defaultTitle}
</h5>
<div className={styles.content}>{children}</div>
</div>
)
}

const InfoIcon = () => (
<svg width={15} height={15} viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx={7.5} cy={7.5} r={6.75} stroke="black" strokeWidth={1.5} strokeLinecap="round" />
<path
d="M6.81226 4.27344H8.18774V5.91699L7.83179 8.94043H7.177L6.81226 5.91699V4.27344ZM6.84302 9.45898H8.15259V10.729H6.84302V9.45898Z"
fill="black"
/>
</svg>
)
30 changes: 30 additions & 0 deletions app/core/components/docs/Card.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.container {
@apply p-5 mb-4 rounded-xl;

a {
/* Remember to change this if you update the a (anchor, link) styles */
@apply text-purple-light font-medium no-underline hover:underline;
}
}

.heading {
@apply mt-0 mb-4 capitalize font-bold flex items-center text-black;
}

.icon {
@apply inline-block align-middle mr-2;

svg {
@apply block w-4 h-4 stroke-0;
}
}

.content {
* {
@apply text-black;
}

strong {
color: inherit !important;
}
}
11 changes: 9 additions & 2 deletions app/core/components/home/HeroCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import tokenize from "../../macros/tokenize.macro.js"

const pageTokenized = tokenize.jsx(
`// app/pages/projects/new.tsx
import { Link, useRouter, useMutation, BlitzPage } from "blitz"
import { Link, Routes, useRouter, useMutation, BlitzPage } from "blitz"
import Layout from "app/core/layouts/Layout"
// Merk op hoe we de server functie rechtstreeks importeren
import createProject, {CreateProject} from "app/projects/mutations/createProject"
import { ProjectForm, FORM_ERROR } from "app/projects/components/ProjectForm"
import { ProjectForm } from "app/projects/components/ProjectForm"

const NewProjectPage: BlitzPage = () => {
const router = useRouter()
Expand All @@ -25,13 +25,20 @@ const NewProjectPage: BlitzPage = () => {
submitText="Project aanmaken"
schema={CreateProject}
onSubmit={async (values) => {
<<<<<<< HEAD
try {
// Dit is hetzelfde als de server functie rechtstreeks te callen
const project = await createProjectMutation(values)
router.push("/projects/" + project.id)
} catch (error) {
return { [FORM_ERROR]: error.toString() }
}
=======
// This is equivalent to calling the server function directly
const project = await createProjectMutation(values)
// Notice the 'Routes' object Blitz provides for routing
router.push(Routes.ProjectsPage({projectId: project.id}}))
>>>>>>> 9fe39d8ebeff642759bb10ad1b0cd2f1114ec7aa
}}
/>
</div>
Expand Down
3 changes: 2 additions & 1 deletion app/core/components/home/VideoPlayer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ReactPlayer from "react-player"
import ReactPlayer from "react-player/lazy"

const VideoPlayer = ({url, className = ""}) => {
return (
Expand All @@ -9,6 +9,7 @@ const VideoPlayer = ({url, className = ""}) => {
width="100%"
height="100%"
controls={true}
light={true}
/>
</div>
)
Expand Down
2 changes: 1 addition & 1 deletion app/core/layouts/ContentsLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export function ContentsLayout({children, meta, tableOfContents: toc}) {
<a
href={
"https://github.com/blitz-js/blitzjs.com/edit/main/app/pages" +
router.asPath +
router.asPath.split("#")[0] +
".mdx"
}
target="_blank"
Expand Down
13 changes: 9 additions & 4 deletions app/core/navs/documentation.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
},
"pages": [
"pages",
"redirects",
"error-pages",
"head-component",
"document-component",
Expand All @@ -73,8 +72,12 @@
"link",
"route-params-query",
"router",
"redirects",
"rewrites",
"headers",
"api-routes",
"shallow-routing"
"shallow-routing",
"route-manifest"
]
},
{
Expand Down Expand Up @@ -125,15 +128,15 @@
"iconPath": "/img/mutations.svg",
"iconDarkPath": "/img/mutations-white.svg"
},
"pages": ["background-processing-with-quirrel", "middleware", "custom-server"]
"pages": ["multitenancy", "background-processing-with-quirrel", "middleware", "custom-server"]
},
{
"title": {
"title": "Deploying to Production",
"iconPath": "/img/deploying-to-production.svg",
"iconDarkPath": "/img/deploying-to-production-white.svg"
},
"pages": ["deploy-render", "deploy-heroku", "deploy-vercel"]
"pages": ["deploy-render", "deploy-heroku", "deploy-vercel", "deploy-railway"]
},
{
"title": {
Expand All @@ -153,6 +156,7 @@
"blitz-config",
"webpack-config",
"postcss-config",
"eslint-config",
"rpc-specification",
"measuring-performance"
]
Expand All @@ -173,6 +177,7 @@
"cli-db",
"cli-prisma",
"cli-generate",
"cli-codegen",
"cli-console",
"cli-install",
"cli-autocomplete",
Expand Down
1 change: 1 addition & 0 deletions app/core/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

html {
font-family: "Libre Franklin", sans-serif;
scroll-behavior: smooth;
}

.player-wrapper {
Expand Down
55 changes: 0 additions & 55 deletions app/core/styles/utilities.css
Original file line number Diff line number Diff line change
Expand Up @@ -130,61 +130,6 @@ body.cursor-grabbing * {
background-repeat: no-repeat;
}

/* Like doing `!important`, but worse */
.admonition.admonition.admonition {
@apply px-5 pt-5 pb-px rounded-xl text-black;

a {
/* Remember to change this if you update the a (anchor, link) styles */
@apply text-purple-light font-medium no-underline hover:underline;
}
}

.admonition-content > *:first-child {
@apply mt-2;
}

.admonition.admonition-caution {
@apply bg-supplementary-yellow;
}

.admonition.admonition-info {
@apply bg-supplementary-blue;
}

.admonition.admonition-note {
@apply bg-blue-primary;
}

.admonition .admonition-heading {
@apply capitalize font-bold;
}

.admonition .admonition-heading > * {
@apply flex items-center;
margin-top: 0;
}

.admonition .admonition-icon {
@apply mr-2;
}

.admonition .admonition-icon {
@apply mr-2;
}

.dark .admonition .admonition-heading h5 {
@apply text-black;
}

.dark .admonition .admonition-content.admonition-content {
@apply text-black;
}

.dark .admonition .admonition-content.admonition-content strong {
color: inherit;
}

.topic-select .topic-select__placeholder,
.topic-select .topic-select__menu-list,
.topic-select .topic-select__single-value {
Expand Down
2 changes: 1 addition & 1 deletion app/pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default function App({Component, pageProps, router}) {
<meta key="og:type" property="og:type" content="article" />
<meta key="og:description" property="og:description" content={meta.description} />
</Head>
<ThemeProvider defaultTheme="dark" attribute="class">
<ThemeProvider defaultTheme="dark" enableSystem={false} attribute="class">
<Component {...pageProps} />
</ThemeProvider>
</>
Expand Down
Loading