-
-
Notifications
You must be signed in to change notification settings - Fork 804
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #497 from codigoencasa/feature/breaking-change
Feature/breaking change
- Loading branch information
Showing
10 changed files
with
217 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"recommendations": ["dbaeumer.vscode-eslint", "unifiedjs.vscode-mdx"], | ||
"unwantedRecommendations": [] | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"onGet": { | ||
"scope": "javascriptreact,typescriptreact", | ||
"prefix": "q:onGet", | ||
"description": "onGet function for a route index", | ||
"body": [ | ||
"export const onGet: RequestHandler = (request) => {", | ||
" $0", | ||
"};" | ||
] | ||
}, | ||
"onGet (typed)": { | ||
"scope": "javascriptreact,typescriptreact", | ||
"prefix": "q:onGet typed", | ||
"description": "onGet function for a route index", | ||
"body": [ | ||
"export interface ${1:PageData} {", | ||
" $2", | ||
"};", | ||
"", | ||
"export const onGet: RequestHandler<$1> = (request) => {", | ||
" $4", | ||
"};" | ||
] | ||
}, | ||
"useEndpoint": { | ||
"scope": "javascriptreact,typescriptreact", | ||
"prefix": "q:useEndpoint", | ||
"description": "useEndpoint declaration", | ||
"body": "const $1 = useEndpoint<typeof onGet>();" | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
{ | ||
"Qwik component (simple)": { | ||
"scope": "javascriptreact,typescriptreact", | ||
"prefix": "q:component", | ||
"description": "Simple Qwik component", | ||
"body": [ | ||
"export const ${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/}} = component$(() => {", | ||
" return <${2:div}>$4</$2>", | ||
"});" | ||
] | ||
}, | ||
"Qwik component (props)": { | ||
"scope": "typescriptreact", | ||
"prefix": "q:component w/props", | ||
"description": "Qwik component w/ props", | ||
"body": [ | ||
"export interface ${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/}}Props {", | ||
" $2", | ||
"}", | ||
"", | ||
"export const $1 = component$<$1Props>((props) => {", | ||
" const ${2:count} = useSignal(0);", | ||
" return (", | ||
" <${3:div} on${4:Click}$={(ev) => {$5}}>", | ||
" $6", | ||
" </${3}>", | ||
" );", | ||
"});" | ||
] | ||
}, | ||
"Qwik signal": { | ||
"scope": "javascriptreact,typescriptreact", | ||
"prefix": "q:useSignal", | ||
"description": "useSignal() declaration", | ||
"body": ["const ${1:foo} = useSignal($2);", "$0"] | ||
}, | ||
"Qwik store": { | ||
"scope": "javascriptreact,typescriptreact", | ||
"prefix": "q:useStore", | ||
"description": "useStore() declaration", | ||
"body": ["const ${1:state} = useStore({", " $2", "});", "$0"] | ||
}, | ||
"$ hook": { | ||
"scope": "javascriptreact,typescriptreact", | ||
"prefix": "q:$", | ||
"description": "$() function hook", | ||
"body": ["$(() => {", " $0", "});", ""] | ||
}, | ||
"useClientEffect": { | ||
"scope": "javascriptreact,typescriptreact", | ||
"prefix": "q:useClientEffect", | ||
"description": "useClientEffect$() function hook", | ||
"body": ["useClientEffect$(({ track }) => {", " $0", "});", ""] | ||
}, | ||
"useTask": { | ||
"scope": "javascriptreact,typescriptreact", | ||
"prefix": "q:useTask", | ||
"description": "useTask$() function hook", | ||
"body": [ | ||
"useTask$(({ track }) => {", | ||
" track(() => $1);", | ||
" $0", | ||
"});", | ||
"" | ||
] | ||
}, | ||
"useResource": { | ||
"scope": "javascriptreact,typescriptreact", | ||
"prefix": "q:useResource", | ||
"description": "useResource$() declaration", | ||
"body": [ | ||
"const $1 = useResource$(({ track, cleanup }) => {", | ||
" $0", | ||
"});", | ||
"" | ||
] | ||
}, | ||
"useServerMount": { | ||
"scope": "javascriptreact,typescriptreact", | ||
"prefix": "q:useServerMount", | ||
"description": "useServerMount$() function hook", | ||
"body": ["useServerMount$(() => {", " $0", "});", ""] | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const notFounds = [ | ||
[ | ||
'/', | ||
'<!DOCTYPE html>\n<html>\n<head>\n <meta charset="utf-8">\n <meta http-equiv="Status" content="404"/>\n <title>404 Resource Not Found</title>\n <meta name="viewport" content="width=device-width,initial-scale=1">\n <style>\n body { color: #006ce9; background-color: #fafafa; padding: 30px; font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif; }\n p { max-width: 600px; margin: 60px auto 30px auto; background: white; border-radius: 4px; box-shadow: 0px 0px 50px -20px #006ce9; overflow: hidden; }\n strong { display: inline-block; padding: 15px; background: #006ce9; color: white; }\n span { display: inline-block; padding: 15px; }\n pre { max-width: 580px; margin: 0 auto; }\n </style>\n</head>\n<body>\n <p><strong>404</strong> <span>Resource Not Found</span></p>\n</body>\n</html>', | ||
], | ||
] | ||
function getNotFound(p) { | ||
for (const r of notFounds) { | ||
if (p.startsWith(r[0])) { | ||
return r[1] | ||
} | ||
} | ||
return 'Resource Not Found' | ||
} | ||
export { getNotFound } |
Oops, something went wrong.