Skip to content

Instantly share code, notes, and snippets.

View evnchn's full-sized avatar
🪨
唆るぜこれは

Evan Chan evnchn

🪨
唆るぜこれは
View GitHub Profile
@evnchn
evnchn / NestJS Dependency Migration Guide.md
Created January 27, 2026 04:16
NestJS Dependency Migration Guide.md

Architectural Migration Strategy: NestJS v10 to v11 Ecosystem Upgrade

1. Executive Context and Strategic Overview

The transition from NestJS v10 to v11 represents a watershed moment in the framework's evolution, marking a decisive shift toward modern Node.js paradigms and strictly typed infrastructure. Unlike minor version upgrades that typically introduce non-intrusive features, this migration is characterized by structural modifications to the underlying HTTP abstraction layer, specifically the adoption of Express v5 as the default server engine.1 This change, coupled with the enforcement of Node.js v20+ runtime requirements 1, necessitates a comprehensive architectural audit rather than a simple dependency update.

For enterprise-grade applications relying on the dependency set specified—ranging from @nestjs/core to auxiliary libraries like @nestjs/bullmq and @nestjs/config—the migration surface area is broad. The interconnected nature of these packages means that a change in the core routi

@evnchn
evnchn / reference.py
Created November 22, 2025 12:52
Tabbed interface for NiceGUI documentation (works but need UI work)
from __future__ import annotations
import inspect
from typing import Callable
from nicegui import binding, ui
from nicegui.elements.markdown import remove_indentation
from ..style import create_anchor_name, subheading
from .custom_restructured_text import CustomRestructuredText as custom_restructured_text
import os
import ssl
import sys
from datetime import UTC, datetime
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
# Define log file path
from nicegui import ui
ui.add_head_html('''
<style>
.extra-compact, .extra-compact .q-field__control, .extra-compact .q-field__append, .extra-compact .q-field__control--addon {
height: 30px !important;
max-height: 30px !important;
min-height: 30px !important;
align-items: center;
}
# Pieced together from:
# (1) https://github.com/Vizonex/Winloop?tab=readme-ov-file#how-to-use-winloop-with-fastapi
# (2) https://www.reddit.com/r/nicegui/comments/1dlx3or/fastapi_nicegui_integration/
# (3) https://github.com/pgjones/hypercorn?tab=readme-ov-file#quickstart
from fastapi import FastAPI
from fastapi.responses import HTMLResponse
import winloop
from hypercorn.config import Config
from hypercorn.asyncio import serve
import asyncio
# Pieced together from:
# (1) https://github.com/Vizonex/Winloop?tab=readme-ov-file#how-to-use-winloop-with-fastapi
# (2) https://www.reddit.com/r/nicegui/comments/1dlx3or/fastapi_nicegui_integration/
from fastapi import FastAPI
from fastapi.responses import HTMLResponse
import winloop
import uvicorn
import asyncio
import datetime
from nicegui import ui
const True = true;
const False = false;
const None = undefined;
let app = undefined;
let mounted_app = undefined;
const loaded_libraries = new Set();
const loaded_components = new Set();
print("__name__ is", __name__)
DEV = True # True for development with hot reload, False for production with no hot reload
from nicegui.ui_run import run as ui_run # just importing the function to run the server
if not DEV or not __name__ == "__main__": # you can do `if True:` to bypass this to revert to the normal behavior, but that is slow...
# Explanation: 2 reasons for running this code:
# 1. not in dev mode, so there is no __mp_main__, this is already where NiceGUI will run
# 2. or, in dev mode, and this is the __mp_main__, so we want to run this code
from nicegui import ui
class my_widget:
def __init__(self, name, value):
self.name = name
self.value = value
self.container = ui.row()
self.create_widget()
adg// NOTE: I only go so far as to ensure this works with the nicegui-speed
// Based on NiceGUI 2.12.1
const True = true;
const False = false;
const None = undefined;
let app = undefined;
let mounted_app = undefined;