NODE_ENV = staging Well, here we go again - the same old mistake showing up in a new project. In our daily work, we usually have three environments: development, staging and production. We write code locally, run tests, deploy to staging, and if everything looks good - ship to prod. All clear - until you remember that NODE_ENV is not just any variable. It’s a special one used internally by Node.js and many libraries (React, Express, webpack, etc.) to control optimizations and conditional logic. And guess what? It only supports three standard values: "development", "production", and "test". 😀 Anything else (like "staging") can cause warnings - or worse, break something 🤨 . So, if you need to distinguish between staging and production (for example in Airbrake or Langfuse), just use a separate variable, like: APP_ENV=staging Lesson learned (again). #NodeJS #JavaScript #WebDevelopment #SoftwareEngineering #Debugging #DevOps #Backend #EnvironmentVariables #DeveloperNotes #TechTips
Avoid using NODE_ENV for staging in Node.js projects
More Relevant Posts
-
𝗗𝗿𝗶𝘃𝗶𝗻𝗴 𝗜𝗻𝗻𝗼𝘃𝗮𝘁𝗶𝗼𝗻 𝘄𝗶𝘁𝗵 𝘁𝗵𝗲 𝗥𝗶𝗴𝗵𝘁 𝗧𝗼𝗼𝗹𝘀 🔧 Faster builds. Better performance. Zero migration headaches. That's what modern tooling delivers. We took an outdated codebase and rebuilt it with: 📌 JavaScript 📌 React.js 📌 Vite The impact: → Reduced build times → Improved performance → Seamless migration Quality software starts with the right foundation - tools that make your team faster and your users happier. Read the case study - link in the comments. #programming #webdevelopment #javascript #reactJS #vite #softwaredevelopment #frontend
To view or add a comment, sign in
-
-
𝐑𝐞𝐚𝐜𝐭 𝐂𝐨𝐦𝐩𝐢𝐥𝐞𝐫: 𝐓𝐡𝐞 𝐄𝐧𝐝 𝐨𝐟 𝐌𝐚𝐧𝐮𝐚𝐥 𝐌𝐞𝐦𝐨𝐢𝐳𝐚𝐭𝐢𝐨𝐧 Every React developer knows the burden: spending valuable time manually wrapping code with `useMemo`, `useCallback`, and `React.memo()`. This chore is error-prone, clutters the code, and often adds its own maintenance overhead. This era is ending. The React Compiler, a groundbreaking build-time tool, is designed to eliminate this developer overhead completely. * The Problem Solved: The compiler analyzes your code and the rules of JavaScript to automatically determine exactly when and where memoization is needed. * The Result: It achieves fine-grained reactivity by automatically applying the equivalent of `memo` to your components and expressions. This guarantees that your application only re-renders the absolute minimal part of the UI that has genuinely changed. The compiler's promise is simple: "Just write plain JavaScript." It assumes responsibility for runtime efficiency, allowing you to focus purely on business logic. This is the biggest mental model shift since Hooks and the future of clean, performant React development. #reactjs #reactcompiler #frontend #optimization #usememo #javascript
To view or add a comment, sign in
-
🔹 What Are React Hooks? React Hooks are special functions that let you use state and other React features without writing a class. They make your code simpler, reusable, and easier to maintain. 💡 Common Hooks: useState() → For managing component state useEffect() → For side effects like fetching data or updating the DOM useRef() → For accessing DOM elements or storing mutable values useContext() → For using global data across components Hooks allow you to write cleaner and functional components, making React development faster and more efficient! ⚛️ #React #JavaScript #WebDevelopment #Frontend #Coding #LearnReact
To view or add a comment, sign in
-
How to Build Custom React Hooks: A Practical Guide Custom hooks are one of React's most underutilized features. They allow you to extract and reuse component logic elegantly, keeping your code DRY and maintainable. In this tutorial, I break down: 𝟭. 𝗪𝗵𝗮𝘁 𝗮𝗿𝗲 𝗖𝘂𝘀𝘁𝗼𝗺 𝗛𝗼𝗼𝗸𝘀? Reusable functions that encapsulate stateful logic. They can use other React hooks and follow the same rules, but are completely flexible to your needs. 𝟮. 𝗧𝗵𝗲 𝗘𝘀𝘀𝗲𝗻𝘁𝗶𝗮𝗹 𝗥𝘂𝗹𝗲𝘀 - Must start with "use" - Only call at the top level - Can compose other hooks These conventions ensure React can track state correctly. 𝟯. 𝗥𝗲𝗮𝗹-𝗪𝗼𝗿𝗹𝗱 𝗘𝘅𝗮𝗺𝗽𝗹𝗲: 𝘂𝘀𝗲𝗙𝗲𝘁𝗰𝗵 I walk through building a complete data-fetching hook that handles loading states, errors, and data, all reusable across your entire application. 𝟰. 𝗣𝗿𝗮𝗰𝘁𝗶𝗰𝗮𝗹 𝗔𝗽𝗽𝗹𝗶𝗰𝗮𝘁𝗶𝗼𝗻𝘀 Some custom hooks I've built in production: - useLocalStorage - Persist state across sessions - useDebounce - Optimize API calls and search - useWindowSize - Responsive UI logic - useAuth - Centralized authentication state 💡 𝗞𝗲𝘆 𝗜𝗻𝘀𝗶𝗴𝗵𝘁: When you find yourself copying the same logic between components, that's your signal to extract it into a custom hook. In my recent projects, using custom hooks reduced code duplication by ~40% and made testing significantly easier by isolating logic from presentation. What's your favorite custom hook to build? Or do you have questions about implementing them? #ReactJS #JavaScript #WebDevelopment #SoftwareEngineering #CustomHooks #FrontendDevelopment #FullStackDevelopment #Programming #CleanCode #ReactTutorial #DeveloperTips #TechEducation #SoftwareDeveloper #CodingTutorial #WebDev #UKJOB
To view or add a comment, sign in
-
🚀 Clean code isn’t just about style — it’s about speed, scalability, and peace of mind. In this post, I wanted to show how a few small changes in how we write and organize our code in Angular + TypeScript can make a huge difference in performance and maintainability. We often focus on making things work, but real growth comes when we make them work better. 💡 Because clean code means fewer bugs, better performance, and a smoother developer experience overall. ✨ Curious to see how a simple refactor can boost your project’s “speedometer”? Take a look at the slides and tell me: 👉 What’s your favorite best practice when coding with Angular or TypeScript? #Angular #TypeScript #CleanCode #WebDevelopment #Frontend #BestPractices #Testing #DeveloperCommunity
To view or add a comment, sign in
-
Clean architecture or chaos — the choice is yours. ⚡ Express.js gives flexibility and minimalism, but as projects scale, structure becomes a challenge. That’s where NestJS shines — it brings architecture, scalability, and maintainability on top of Express. ✅ Modular & testable design ✅ Clear separation of concerns ✅ Enterprise-ready architecture If you’ve ever struggled with messy backend folders in Express, NestJS is a game changer. 🚀 Know where to put your code. One stack, infinite builds. #NestJS #ExpressJS #NodeJS #BackendDevelopment #JavaScript #FrontendDevelopment#WebDevelopment #CleanCode #FullStackDeveloper #Programming #Developers #SoftwareEngineering #TechCommunity
To view or add a comment, sign in
-
-
Leveling Up Your Angular Game: Best Practices That Make a Difference After working with Angular for several years, I've realized that writing functional code is just the beginning. Writing clean, scalable, and maintainable Angular code is where the real magic happens. Here are a few Angular best practices that have consistently helped me build better apps: 🔹 Use Standalone Components (Angular 15+) They simplify module management and reduce boilerplate. Cleaner structure, faster onboarding. 🔹 Leverage Reactive Forms Over Template-Driven Forms More control, better scalability, and easier testing. 🔹 Avoid Logic in Templates Keep templates clean. Move logic to the component class to improve readability and testability. 🔹 Use async Pipe Instead of Subscribing Manually It handles subscription and unsubscription automatically—less memory leak risk! 🔹 Structure Your Project by Feature, Not by Type A feature-based folder structure improves modularity and makes large apps easier to navigate. 🔹 Strict Typing & Linting Enable strict mode and use tools like ESLint to catch issues early. #Angular #WebDevelopment #Frontend #BestPractices #CleanCode #JavaScript #TypeScript #Angular15
To view or add a comment, sign in
-
💡 What’s the difference between package.json and package-lock.json? And which one should you commit to Git? 🤔 Let’s break it down 👇 📦 package.json This file defines your project’s dependencies, scripts, and metadata. Example 👇 "dependencies": { "rxjs": "^7.5.0", "typescript": "~5.1.6" } When you run npm install, it will fetch the latest versions based on the prefix: ^7.5.0 → downloads the latest minor version (e.g., 7.6.0) ~5.1.6 → downloads the latest patch version (e.g., 5.1.9) So, ^ gives flexibility for non-breaking updates, while ~ gives more stability. 🔒 package-lock.json This file locks the exact versions of every dependency and sub-dependency installed. It ensures everyone on the team (and CI/CD) installs identical versions — avoiding those classic “it works on my machine” issues. ✅ Which file to commit? ✔️ Commit both. package.json → defines what you need package-lock.json → locks exactly what you installed Together, they make your project predictable and consistent across all environments. 🧠 Quick takeaway: package.json = What you want package-lock.json = What you actually get 💬 Found this helpful? 👉 Follow me for more real-world frontend & Angular insights every week. #Angular #NodeJS #Frontend #WebDevelopment #JavaScript #npm #DeveloperTips #SoftwareEngineering #CareerGrowth
To view or add a comment, sign in
-
TYPESCRIPT ⚙️ “It was working fine… until someone passed a string instead of a number.” If you’ve ever debugged a JavaScript app at 2 AM — you know that feeling 😅 That’s when I realized: 👉 JavaScript is powerful. 👉 But TypeScript makes it predictable. 💡 What is TypeScript really? It’s JavaScript with a safety net. It doesn’t replace JS — it enhances it with types, interfaces, and compiler checks that catch errors before runtime. It’s like having a second pair of eyes reviewing every line you write 👀 🧠 Why it’s a game-changer * Type safety — No more “undefined is not a function” moments. * Intellisense — Smarter autocompletion, refactoring, and documentation directly in your IDE. * Scalability — As your codebase grows, your sanity stays intact. Now if someone does add("5", 10) — TypeScript politely says: 🚫 “Nope. That’s not what we agreed on.” It’s not about being strict. It’s about being safe and confident in every line of code. Key take aways: * JavaScript gives you speed. * TypeScript gives you confidence. * Together, they give you maintainable software. * Once you start using it, you’ll never want to go back. #TypeScript #JavaScript #WebDevelopment #Frontend #FullStackDeveloper #NodeJS #React #Coding #CleanCode #Developers
To view or add a comment, sign in
-
Clean structure vs complete chaos. NestJS brings architecture, scalability, and maintainability — all built on top of Express. Express.js gives flexibility, but NestJS gives direction. Choose your stack wisely — build smarter, not harder. #nestjs #expressjs #nodejs #backenddevelopment #webdevelopment #javascript #typescript #fullstackdeveloper #codinglife #softwaredevelopment #cleanarchitecture #developers #api #frameworks #programmingcommunity #techstack #backendengineer #webdev #coders
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development