Next.js based e-commerce template written in JavaScript
Unanswered
Masai Lion posted this in #help-forum
Masai LionOP
Hi everyone.
I'm relatively new to Next.js, having completed most of a Udemy course (all in JavaScript), I wanted to try my hand at building a e-commerce website. After doing some research I found that there are some readily available commerce templates that can be used to build on-top of (Next.js Commerce, Medusa Commerce etc.). However, all of these template are written in TypeScript and I don't know any TS, so I was hoping you guys could help me find similar templates but written in JavaScript? Alternatively, what toolkits or templates are there for just User Management and authentication specifically
TL;DR : Are there any Next.js based e-commerce templates written in JavaScript and not TypeScript that I can use to build on-top of?
I'm relatively new to Next.js, having completed most of a Udemy course (all in JavaScript), I wanted to try my hand at building a e-commerce website. After doing some research I found that there are some readily available commerce templates that can be used to build on-top of (Next.js Commerce, Medusa Commerce etc.). However, all of these template are written in TypeScript and I don't know any TS, so I was hoping you guys could help me find similar templates but written in JavaScript? Alternatively, what toolkits or templates are there for just User Management and authentication specifically
TL;DR : Are there any Next.js based e-commerce templates written in JavaScript and not TypeScript that I can use to build on-top of?
8 Replies
American Crow
It sucks at the beginning but you'll have to pick up Typescript.
Otherwise you'll have the same problem with 90% of all libs/packages/repos.
Some support js/ts but there is a strong trend to Typescript which will only be more dominant in the future.
Most common Auth packages are Auth.js (former NextAuth), Clerk and Lucia
Otherwise you'll have the same problem with 90% of all libs/packages/repos.
Some support js/ts but there is a strong trend to Typescript which will only be more dominant in the future.
Most common Auth packages are Auth.js (former NextAuth), Clerk and Lucia
Bigeye scad
To be honest, starting with a TS template shouldn't give you too many issues, but rather help you out. If you really can't work with it, I would suggest just redefining all of your types to
any@American Crow It sucks at the beginning but you'll have to pick up Typescript.
Otherwise you'll have the same problem with 90% of all libs/packages/repos.
Some support js/ts but there is a strong trend to Typescript which will only be more dominant in the future.
Most common Auth packages are Auth.js (former NextAuth), Clerk and Lucia
Masai LionOP
I will eventually learn TypeScript, it seems inevitable but just really wanted to do this with the skills I have learned so far before jumping right into learning a new framework ya know. Thank you for your input though
@Bigeye scad To be honest, starting with a TS template shouldn't give you too many issues, but rather help you out. If you really can't work with it, I would suggest just redefining all of your types to `any`
Masai LionOP
You saying I should still be able to use those templates even though they are written in TS? If I wanted to add custom components but in JSX would that cause any problems? Thanks for the feedback
@Masai Lion You saying I should still be able to use those templates even though they are written in TS? If I wanted to add custom components but in JSX would that cause any problems? Thanks for the feedback
American Crow
He is saying to always use .ts and .tsx but declare all types as
While possible, mixing tsx and jsx will lead to problems when importing one into the other
any in your code.While possible, mixing tsx and jsx will lead to problems when importing one into the other
@Masai Lion You saying I should still be able to use those templates even though they are written in TS? If I wanted to add custom components but in JSX would that cause any problems? Thanks for the feedback
Bigeye scad
As @American Crow said. Still create components ending in
.tsx, but without any type definitions or make those typed as anyFor example, wherever you see something like this:
Replace with
type MyType = {
name: string;
age: number;
somethingElse: string;
}Replace with
type MyType = any;And any place where you see a variable typed, by using this syntax:
Just replace with
function (param1: MyType) : AnotherType {}Just replace with
function (param1: any) : any {}