Notes on the Pluralsight course “Angular Best Practices” by Jim Cooper

Notes on the Pluralsight course “Angular Best Practices” by Jim Cooper
Notes File and Folder Structure LIFT: Locate code quickly, Identify code at a glance, Flattest structure possible, Try to be DRY organize code into feature areas one item (service/component/directive) per file General Coding Practices Single Responsibility Principle (example: re-factor data access service to separate services for user and catalog) prefer immutability use small functions Angular Module Organization App Module Core Module: shared singleton services, app-level components (e.
Read more →

Notes on Angular Component Communication (Pluralsight Course)

Notes on Angular Component Communication (Pluralsight Course)
cover image from PluralSight I’m learning Angular right now – as a React.js fangirl. Pluralsight offered a free month of learning in April. I’ve taken advantage of it. Here are some notes on the course Angular Component Communication by Deborah Kurata. Angular Component Communication Introduction components need to communicate with each other, with its template, with the router, can use a service as an intermediary check GitHub repository Communication with a Template template binding, e.
Read more →

Notes on Angular Services (Pluralsight Course)

I’m learning Angular right now – as a React.js fangirl. Pluralsight offers a free month of learning in April. I’m taking advantage of it. Here are some notes on the course Angular Services by Brice Wilson. Angular Services What and Why? reusable piece of (single) functionality shared across components (is it like a React hook? 🤔) able to be delivered when and where it is needed components should only contain logic for the view, all other logic should be inside services Creating and Using Services service = basically a TypeScript class @Injectable decorator Provider required Example Service:
Read more →

Next.js With Apollo, SSR, Cookies, and Typescript

How to wire up a Next.js TypeScript application with Apollo Client, using Server Side Rendering and Static Site Generation In this blog post I’ll show you how I created a working Next.js TypeScript setup with Apollo Client. You can fetch data from a GraphQL endpoint both on the Node.js server as well as on the Next.js client, utilizing the Apollo Cache. You are also able to work with protected endpoints using cookie-based authentication.
Read more →

How to Extend Express Request With Session in Typescript (TS2339 error)

You’ve got a Node.js back-end server running Express and want to store sessions. You use TypeScript for your server. Let’s see some example code. Excerpt: // src/resolvers/AuthResolver.ts import { MyContext } from '../graphql-types/MyContext'; // more imports // { ... } @Mutation(() => UserResponse) async login( @Arg("input") { email, password }: AuthInput, @Ctx() ctx: MyContext ): Promise<UserResponse> { const user = await User.findOne({ where: { email } }) if (!
Read more →

Friday Picks 074

Read more →

Friday Picks 066

Here are some links for this weekend. I hope you’ll enjoy them! Full Stack Serverless - Building a Real-time Chat App with GraphQL, CDK, AppSync, and React: a concise tutorial by Nader Dabit Build A Confirmation Modal in React with State Machines: learn more about state machines with Dave Ceddia Building Microservices with Deno, Reno, and PostgreSQL: by James Wright Show your latest dev.to posts automatically on your GitHub profile readme: a GitHub action that automatically fetches blog posts from dev.
Read more →

Tuesday Picks 006

Read more →

Friday Picks 054

Read more →

Static File Server With Deno and Abc

Let’s say I have some static files I want to serve. For example, a React app or a Svelte app. Create Svelte App Let’s use the Svelte template: npx degit sveltejs/template svelte-app cd svelte-app npm install Now we need to create a production build: npm run build The command will create an optimized build in the public folder. Create Deno Server Install Deno. We’ll use the third-party module Abc to create a simple web server.
Read more →

Sign up for the newletter!

powered by Buttondown