Skip to content

Commit 5ed15b7

Browse files
committed
feat: improve Next.js snippet prefix
1 parent 4ef3785 commit 5ed15b7

File tree

6 files changed

+90
-85
lines changed

6 files changed

+90
-85
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
All notable changes to the "vscode-js-ts-react-nextjs-snippets" extension will be documented in this file.
44

5+
## 1.3.0 <small>- 2022/05/27</small>
6+
7+
- Fixed JS-TS prefix inconsistencies on Next.js snippets
8+
- Improved Next.js snippet prefix
9+
510
## 1.2.0 <small>- 2022/05/27</small>
611

712
- Updated snippet's prefix emoji: 🟨 for JavaScript, and 🟦 for TypeScript

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "JS/TS React/Next.js Snippets",
44
"description": "JS/TS, React/Next.js, React Query, & other Front-end snippets",
55
"icon": "images/logo.png",
6-
"version": "1.2.2",
6+
"version": "1.3.0",
77
"publisher": "afifu",
88
"keywords": [
99
"vscode",

snippets/javascript.json

+16-16
Original file line numberDiff line numberDiff line change
@@ -430,8 +430,8 @@
430430
"description": "React create custom hook",
431431
"scope": "javascript,javascriptreact"
432432
},
433-
"nextGSS": {
434-
"prefix": "nGSS.$nGSS.getServerSideProps.🟨",
433+
"nextSSR": {
434+
"prefix": "nSSR.$nSSR.getServerSideProps.🟨",
435435
"body": [
436436
"export async function getServerSideProps(${1:{ req, res, params, query \\}}) {",
437437
"\t${0:// code}",
@@ -445,8 +445,8 @@
445445
"description": "Next.js getServerSideProps",
446446
"scope": "javascript,javascriptreact"
447447
},
448-
"nextGST": {
449-
"prefix": "nGST.$nGST.getStaticProps.🟨",
448+
"nextSSG": {
449+
"prefix": "nSSG.$nSSG.getStaticProps.🟨",
450450
"body": [
451451
"export async function getStaticProps(${1:{ params \\}}) {",
452452
"\t${0:// code}",
@@ -476,8 +476,8 @@
476476
"description": "Next.js getStaticPaths",
477477
"scope": "javascript,javascriptreact"
478478
},
479-
"nextPageGSS": {
480-
"prefix": "npGSS.$npGSS.🟨",
479+
"nextPageSSR": {
480+
"prefix": "npSSR.$npSSR.🟨",
481481
"body": [
482482
"export async function getServerSideProps(${2:{ req, res, params, query \\}}) {",
483483
"\t${0:// code}",
@@ -499,8 +499,8 @@
499499
"description": "Next.js page with getServerSideProps",
500500
"scope": "javascript,javascriptreact"
501501
},
502-
"nextPageGST": {
503-
"prefix": "npGST.$npGST.🟨",
502+
"nextPageSSG": {
503+
"prefix": "npSSG.$npSSG.🟨",
504504
"body": [
505505
"export async function getStaticProps(${2:{ params \\}}) {",
506506
"\t${0:// code}",
@@ -522,8 +522,8 @@
522522
"description": "Next.js page with getStaticProps",
523523
"scope": "javascript,javascriptreact"
524524
},
525-
"nextGSSArrowFunction": {
526-
"prefix": "naGSS.$naGSS.getServerSideProps.🟨",
525+
"nextSSRArrowFunction": {
526+
"prefix": "naSSR.$naSSR.getServerSideProps.🟨",
527527
"body": [
528528
"export const getServerSideProps = async (${1:{ req, res, params, query \\}}) => {",
529529
"\t${0:// code}",
@@ -537,8 +537,8 @@
537537
"description": "Next.js getServerSideProps arrow function",
538538
"scope": "javascript,javascriptreact"
539539
},
540-
"nextGSTArrowFunction": {
541-
"prefix": "naGST.$naGST.getStaticProps.🟨",
540+
"nextSSGArrowFunction": {
541+
"prefix": "naSSG.$naSSG.getStaticProps.🟨",
542542
"body": [
543543
"export const getStaticProps = async (${1:{ params \\}}) => {",
544544
"\t${0:// code}",
@@ -568,8 +568,8 @@
568568
"description": "Next.js getStaticPaths arrow function",
569569
"scope": "javascript,javascriptreact"
570570
},
571-
"nextPageGSSArrowFunction": {
572-
"prefix": "npaGSS.$npaGSS.🟨",
571+
"nextPageSSRArrowFunction": {
572+
"prefix": "npaSSR.$npaSSR.🟨",
573573
"body": [
574574
"export const getServerSideProps = async (${2:{ req, res, params, query \\}}) => {",
575575
"\t${0:// code}",
@@ -593,8 +593,8 @@
593593
"description": "Next.js page with getServerSideProps",
594594
"scope": "javascript,javascriptreact"
595595
},
596-
"nextPageGSTArrowFunction": {
597-
"prefix": "npaGST.$npaGST.🟨",
596+
"nextPageSSGArrowFunction": {
597+
"prefix": "npaSSG.$npaSSG.🟨",
598598
"body": [
599599
"export const getStaticProps = async (${2:{ params \\}}) => {",
600600
"\t${0:// code}",

snippets/typescript.json

+34-34
Original file line numberDiff line numberDiff line change
@@ -609,8 +609,8 @@
609609
"description": "React useCallback",
610610
"scope": "javascript,typescript,javascriptreact,typescriptreact"
611611
},
612-
"nextGSS": {
613-
"prefix": "nGSS.$nGSS.getServerSideProps.🟨",
612+
"nextSSR": {
613+
"prefix": "nSSR.$nSSR.getServerSideProps.🟨",
614614
"body": [
615615
"export async function getServerSideProps(${1:{ req, res, params, query \\}}) {",
616616
"\t${0:// code}",
@@ -624,8 +624,8 @@
624624
"description": "Next.js getServerSideProps",
625625
"scope": "javascript,typescript,javascriptreact,typescriptreact"
626626
},
627-
"nextGST": {
628-
"prefix": "nGST.$nGST.getStaticProps.🟨",
627+
"nextSSG": {
628+
"prefix": "nSSG.$nSSG.getStaticProps.🟨",
629629
"body": [
630630
"export async function getStaticProps(${1:{ params \\}}) {",
631631
"\t${0:// code}",
@@ -655,8 +655,8 @@
655655
"description": "Next.js getStaticPaths",
656656
"scope": "javascript,typescript,javascriptreact,typescriptreact"
657657
},
658-
"nextPageGSS": {
659-
"prefix": "npGSS.$npGSS.🟨",
658+
"nextPageSSR": {
659+
"prefix": "npSSR.$npSSR.🟨",
660660
"body": [
661661
"export async function getServerSideProps(${2:{ req, res, params, query \\}}) {",
662662
"\t${0:// code}",
@@ -678,8 +678,8 @@
678678
"description": "Next.js page with getServerSideProps",
679679
"scope": "javascript,typescript,javascriptreact,typescriptreact"
680680
},
681-
"nextPageGST": {
682-
"prefix": "npGST.$npGST.🟨",
681+
"nextPageSSG": {
682+
"prefix": "npSSG.$npSSG.🟨",
683683
"body": [
684684
"export async function getStaticProps(${2:{ params \\}}) {",
685685
"\t${0:// code}",
@@ -701,8 +701,8 @@
701701
"description": "Next.js page with getStaticProps",
702702
"scope": "javascript,typescript,javascriptreact,typescriptreact"
703703
},
704-
"nextGSSArrowFunction": {
705-
"prefix": "naGSS.$naGSS.getServerSideProps.🟨",
704+
"nextSSRArrowFunction": {
705+
"prefix": "naSSR.$naSSR.getServerSideProps.🟨",
706706
"body": [
707707
"export const getServerSideProps = async (${1:{ req, res, params, query \\}}) => {",
708708
"\t${0:// code}",
@@ -716,8 +716,8 @@
716716
"description": "Next.js getServerSideProps arrow function",
717717
"scope": "javascript,typescript,javascriptreact,typescriptreact"
718718
},
719-
"nextGSTArrowFunction": {
720-
"prefix": "naGST.$naGST.getStaticProps.🟨",
719+
"nextSSGArrowFunction": {
720+
"prefix": "naSSG.$naSSG.getStaticProps.🟨",
721721
"body": [
722722
"export const getStaticProps = async (${1:{ params \\}}) => {",
723723
"\t${0:// code}",
@@ -747,8 +747,8 @@
747747
"description": "Next.js getStaticPaths arrow function",
748748
"scope": "javascript,typescript,javascriptreact,typescriptreact"
749749
},
750-
"nextPageGSSArrowFunction": {
751-
"prefix": "npaGSS.$npaGSS.🟨",
750+
"nextPageSSRArrowFunction": {
751+
"prefix": "npaSSR.$npaSSR.🟨",
752752
"body": [
753753
"export const getServerSideProps = async (${2:{ req, res, params, query \\}}) => {",
754754
"\t${0:// code}",
@@ -772,8 +772,8 @@
772772
"description": "Next.js page with getServerSideProps",
773773
"scope": "javascript,typescript,javascriptreact,typescriptreact"
774774
},
775-
"nextPageGSTArrowFunction": {
776-
"prefix": "npaGST.$npaGST.🟨",
775+
"nextPageSSGArrowFunction": {
776+
"prefix": "npaSSG.$npaSSG.🟨",
777777
"body": [
778778
"export const getStaticProps = async (${2:{ params \\}}) => {",
779779
"\t${0:// code}",
@@ -836,8 +836,8 @@
836836
"description": "Next.js Custom Document component",
837837
"scope": "javascript,typescript,javascriptreact,typescriptreact"
838838
},
839-
"tsNextGSS": {
840-
"prefix": "nxGSS.TS.$$nxGSS.getServerSideProps.🟦",
839+
"tsNextSSR": {
840+
"prefix": "nSSR.TS.$$nSSR.getServerSideProps.🟦",
841841
"body": [
842842
"import { GetServerSidePropsContext, GetServerSidePropsResult } from 'next'",
843843
"",
@@ -858,8 +858,8 @@
858858
"description": "Next.js getServerSideProps",
859859
"scope": "javascript,typescript,javascriptreact,typescriptreact"
860860
},
861-
"tsNextGST": {
862-
"prefix": "nxGST.TS.$$nxGST.getStaticProps.🟦",
861+
"tsNextSSG": {
862+
"prefix": "nSSG.TS.$$nSSG.getStaticProps.🟦",
863863
"body": [
864864
"import { GetStaticPropsContext, GetStaticPropsResult } from 'next'",
865865
"",
@@ -881,7 +881,7 @@
881881
"scope": "javascript,typescript,javascriptreact,typescriptreact"
882882
},
883883
"tsNextGSP": {
884-
"prefix": "nxGSP.TS.$$nxGSP.getStaticPaths.🟦",
884+
"prefix": "nGSP.TS.$$nGSP.getStaticPaths.🟦",
885885
"body": [
886886
"import { GetStaticPathsResult } from 'next'",
887887
"",
@@ -898,8 +898,8 @@
898898
"description": "Next.js getStaticPaths",
899899
"scope": "javascript,typescript,javascriptreact,typescriptreact"
900900
},
901-
"tsNextPageGSS": {
902-
"prefix": "nxpGSS.TS.$$nxpGSS.🟦",
901+
"tsNextPageSSR": {
902+
"prefix": "npSSR.TS.$$npSSR.🟦",
903903
"body": [
904904
"import { GetServerSidePropsContext, GetServerSidePropsResult } from 'next'",
905905
"",
@@ -928,8 +928,8 @@
928928
"description": "Next.js page with getServerSideProps",
929929
"scope": "javascript,typescript,javascriptreact,typescriptreact"
930930
},
931-
"tsNextPageGST": {
932-
"prefix": "nxpGST.TS.$$nxpGST.🟦",
931+
"tsNextPageSSG": {
932+
"prefix": "npSSG.TS.$$npSSG.🟦",
933933
"body": [
934934
"import { GetStaticPropsContext, GetStaticPropsResult } from 'next'",
935935
"",
@@ -958,8 +958,8 @@
958958
"description": "Next.js page with getStaticProps",
959959
"scope": "javascript,typescript,javascriptreact,typescriptreact"
960960
},
961-
"tsNextGSSArrowFunction": {
962-
"prefix": "nxaGSS.TS.$$nxaGSS.getServerSideProps.🟦",
961+
"tsNextSSRArrowFunction": {
962+
"prefix": "naSSR.TS.$$naSSR.getServerSideProps.🟦",
963963
"body": [
964964
"import { GetServerSideProps } from 'next'",
965965
"",
@@ -977,8 +977,8 @@
977977
"description": "Next.js getServerSideProps arrow function",
978978
"scope": "javascript,typescript,javascriptreact,typescriptreact"
979979
},
980-
"tsNextGSTArrowFunction": {
981-
"prefix": "nxaGST.TS.$$nxaGST.getStaticProps.🟦",
980+
"tsNextSSGArrowFunction": {
981+
"prefix": "naSSG.TS.$$naSSG.getStaticProps.🟦",
982982
"body": [
983983
"import { GetStaticProps } from 'next'",
984984
"",
@@ -997,7 +997,7 @@
997997
"scope": "javascript,typescript,javascriptreact,typescriptreact"
998998
},
999999
"tsNextGSPArrowFunction": {
1000-
"prefix": "nxaGSP.TS.$$nxaGSP.getStaticPaths.🟦",
1000+
"prefix": "naGSP.TS.$$naGSP.getStaticPaths.🟦",
10011001
"body": [
10021002
"import { GetStaticPaths } from 'next'",
10031003
"",
@@ -1014,8 +1014,8 @@
10141014
"description": "Next.js getStaticPaths arrow function",
10151015
"scope": "javascript,typescript,javascriptreact,typescriptreact"
10161016
},
1017-
"tsNextPageGSSArrowFunction": {
1018-
"prefix": "nxpaGSS.TS.$$nxpaGSS.🟦",
1017+
"tsNextPageSSRArrowFunction": {
1018+
"prefix": "npaSSR.TS.$$npaSSR.🟦",
10191019
"body": [
10201020
"import { GetServerSideProps } from 'next'",
10211021
"",
@@ -1043,8 +1043,8 @@
10431043
"description": "Next.js page with getServerSideProps",
10441044
"scope": "javascript,typescript,javascriptreact,typescriptreact"
10451045
},
1046-
"tsNextPageGSTArrowFunction": {
1047-
"prefix": "nxpaGST.TS.$$nxpaGST.🟦",
1046+
"tsNextPageSSGArrowFunction": {
1047+
"prefix": "npaSSG.TS.$$npaSSG.🟦",
10481048
"body": [
10491049
"import { GetStaticProps } from 'next'",
10501050
"",

0 commit comments

Comments
 (0)