-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat-#3: Made the entire backend code from javascript to typescript #466
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Hey @Ameerjafar! Thanks for sticking to the guidelines! High five! 🙌🏻 |
@krishnaacharyaa can you review the pr sir |
Hey @Ameerjafar! Thanks for sticking to the guidelines! High five! 🙌🏻 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for taking time and refactoring the code to ts, much appreciated,
Kindly address the review comments, looks good to me
p.s: Sorry didn't get time to review the PR because of office work
deleteDataFromCache(REDIS_KEYS.ALL_POSTS), // Invalidate cache for all posts | ||
deleteDataFromCache(REDIS_KEYS.FEATURED_POSTS), // Invalidate cache for featured posts | ||
deleteDataFromCache(REDIS_KEYS.LATEST_POSTS), // Invalidate cache for latest posts | ||
// deleteDataFromCache(REDIS_KEYS.ALL_POSTS), // Invalidate cache for all posts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the problem basically we are facing here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[ErrorReply: NOAUTH Authentication required.] this is the error i got
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please figure out why we require this,
Have you setup redis locally in the said port given in the env?
Once run redis locally, and see if you can figure out something from it, you would mostly like be able to do it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@krishnaacharyaa yes sir it is working well I just gave the correct port number.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@krishnaacharyaa it shows the error in the backend/dist/server.js file (Object.defineProperty(exports, "__esModule", { value: true });) exports is not defined in the es module scope.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we good to merge or still there is error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now the deletecache function is working perfectly @krishnaacharyaa
@@ -1,6 +1,19 @@ | |||
{ | |||
"type": "module", | |||
"type": "commonjs", | |||
"dependencies": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the type module we cannot use the exports or module.exports(we have used this is somewhere in our codebase i have checked but i don't know where we have used that. this is the reason i have useed type="commonjs" @krishnaacharyaa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But module is better than commonjs,
we have used this is somewhere in our codebase i have checked but i don't know where we have used that
Can you figure out where and rectify by searching ctrl + shift +f
If not only then we'll change,
Let's not change because we are getting some error, instead lets see which is best commonjs or module? And then change our codebase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the ts config also they the mentioned module as common js @krishnaacharyaa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sukomal07 what should we ideally use ?
Any take
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@krishnaacharyaa Yeah, module is better than commonjs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the type module we cannot use the exports or module.exports(we have used this is somewhere in our codebase i have checked but i don't know where we have used that. this is the reason i have useed type="commonjs" @krishnaacharyaa
Use export syntax instead of module.exports
example:
export const replaceStr = (str, char, replacer) => { const regex = new RegExp(char, "g") const replaced = str.replace(regex, replacer) return replaced }
export async function main{ console.log("Hi there") }
export default async function main{ console.log("Hi there") }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sukomal07 This is the js code compiled by the ts compiler, In my ts code i did not use the module.exports.
@@ -0,0 +1,108 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we clean this up please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I remove the full command code ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commented code, please remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done sir @krishnaacharyaa
Thoda late karpaaungaa reviews, sorry yaar, kaam bohot hei, don't mind |
@krishnaacharyaa i have done if you time please review the pr sir. I have keep the type as module in the package.json file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the efforts @Ameerjafar, Much appreciated !
Summary
Made the entire backend code from javascript to typescript.
Description
2024-08-19.21-31-54.mp4
currently in the project the backend code has not written by the typescript This pr converted the entire backend javascript to typescript.
Issue(s) Addressed
Enter the issue number of the bug(s) that this PR fixes
Prerequisites