Latest Updates

  • Debugging Sencha Ext JS

    Debugging Sencha Ext JS

    See how to fix rendering/layout bugs, event handling issues, data/store problems, memory leaks, slow UIs or integration issues with backend APIs. Ext JS apps are component-heavy and stateful. Knowing how to inspect components, stores and layouts is essential for reliable maintenance and performance.

    High‑level process

    1. Find how to reproduce the issue
    2. Use framework and browser tools to locate the component/store/lifecycle point
    3. Inspect component config/state and store data
    4. Trace the event/data flow and network activity
    5. Use profiler/heap snapshots for performance and memory issues
    6. Verify fixes in production-like builds and multiple browsers

    Tools you’ll use

    • Browser DevTools (Chrome/Chromium, Firefox): Elements/Console/Network/Sources/Performance/Memory
    • Ext-specific: Ext Inspector (browser extension or standalone component tree, configs, layouts)
    • Sencha Cmd: build, dev server, generate source maps, and manage themes/build optimizations
    • Logging/monitoring: console, remote logging (Sentry/LogRocket), HAR exports
    • Optional: Source control, CI for automated smoke/perf tests, remote debugging tools for devices

    How Ext apps are structured

    • Components: Ext.Component subclasses (panels, grids, forms, windows). They have configs, items, listeners and methods
    • Views: component hierarchies and layouts (VBox/HBox/Border/Fit/Card)
    • Controllers / ViewControllers: event handlers and glue logic (MVC/MVVM patterns)
    • ViewModel & Data Binding: bindings, formulas and session/state management
    • Stores & Models: Ext.data.Store, Ext.data.Model, proxies (ajax/rest), readers/writers, paging
    • Layout managers: compute sizes, perform reflows. Many layout bugs start here
    • Plugins & Mixins: added behavior may inject listeners or modify lifecycle.
    • ComponentQuery & global registries: Ext.getCmp, Ext.ComponentQuery.query() for locating instances
    white spiral stair

    Step‑by‑step guide

    1. Locate the component instance
    • Use Ext Inspector to browse component tree and click components to highlight DOM and show config
    • In Console: Ext.getCmp(‘componentId’) if you know id. Use Ext.ComponentQuery.query(‘componentSelector’) (e.g., ‘grid[itemId=myGrid]’) to find components. Example:
    Code
    Ext.ComponentQuery.query('gridpanel[itemId=myGrid]')[0]
    
    var c
    
    • Use component.down(), up(), ownerCt, or getRefOwner() from controllers to navigate hierarchy.
    1. Inspect config, state, and runtime props
    • In Console, once you have a component:
      • console.dir(cmp) or inspect(cmp) (Chrome) to explore methods and properties
      • Examine cmp.config, cmp.items, cmp.getStore(), cmp.getView(), cmp.getEl(), cmp.el.dom, cmp.rendered, cmp.isVisible()
    • For grids: inspect columns (cmp.headerCt), store (cmp.getStore()), selection model, view (cmp.getView()), and bufferedRenderer plugin if used
    1. Trace event handlers and listeners
    • Check cmp.listeners and cmp.hasListener(eventName). Use cmp.events to inspect observable events
    • Use Ext.util.Observable APIs; for classes that extend Observable, check using cmp.getListeners? and cmp.getObservableListeners (API may vary by version)
    • Use DevTools “Event Listener Breakpoints” for DOM events and add conditional breakpoints in JS handlers
    1. Debug store, model, and proxy flows
    • Inspect store state:
      • store.getCount(), store.getTotalCount(), store.getData().items, store.getRange(0,100)
      • Check store.getProxy() — proxy.url, reader config, writer config, and extraParams
    • Monitor network requests in DevTools (Network tab) to see request/response payloads, status codes and headers. Export HAR for sharing
    • For paging: check start/limit params and server response shape (total property expected by reader)
    1. Use breakpoints and stack traces
    • Use source maps (Sencha Cmd generates them for dev builds) to set breakpoints in original source instead of minified files. Enable source maps in browser DevTools
    • Insert debugger; statements in suspect code paths (controllers, listeners). Use conditional breakpoints for loops or frequent events
    1. Layout and rendering debugging
    • Check layout managers: call cmp.doLayout() or cmp.updateLayout() to force recompute (use carefully in production)
    • Inspect element sizes via cmp.getWidth(), getHeight(), cmp.getEl().getBoundingClientRect()
    • Look for configs that affect size: flex, width, height, min/max sizes, margins/padding. For container layouts (hbox/vbox), ensure child items have proper flex or explicit dimensions
    • Watch for nested containers with 100% heights lacking parent height, this is a common “zero height” issue
    1. Performance profiling & memory
    • Use browser Performance tab to record interactions; look for long tasks, layout thrashing and paint counts
    • Use Memory/Heap snapshots to find detached DOM nodes or retained component instances. Search for Ext.Component instances in heap snapshots to see growth over time
    • Check for unremoved listeners (listeners referencing closures preventing GC) – Ext.util.Observable listeners should be removed in destroy handlers or use managed listeners (listeners config with scope and destroy cleanup)
    1. Ext-specific debugging tips
    • Ext.getVersion() gives Ext JS version this is helpful to know for API differences
    • Ext.Loader and dynamic class loading: watch network requests for class files in dev mode. In production, classes are bundled by Sencha Cmd, use separate dev builds to debug class loading
    • Use Ext.each, Ext.Array methods and Ext.apply/Ext.merge carefully, misuse can mutate shared configs. Prefer clone/copies when reusing config objects
    • For grids with buffered rendering or infinite scrolling, inspect bufferedRenderer plugin config (view.bufferedRenderer) and server-side total/offset behavior
    • Use ComponentQuery to find components even without ids, be careful with overly broad queries for performance reasons
    Eyeglasses reflecting computer code on a monitor, ideal for technology and programming themes.

    Common pitfalls and how to avoid them

    • Relying on global ids: prefer itemId and ComponentQuery in large apps to avoid id collisions
    • Mutating prototype objects used as configs. Always clone config objects when reusing
    • Forgetting to destroy components or remove listeners. Implement destroy handlers and use managed listeners when possible
    • Using synchronous Ajax in production or blocking UI during heavy processing. Offload heavy tasks to WebWorkers or break into async chunks
    • Not enabling source maps in dev. Makes stepping through original code much easier

    Practical examples (Console snippets)

    Find a grid and its store:

    Code
    var grid = Ext.ComponentQuery.query('gridpanel[itemId=myGrid]')[0];
    console.log(grid.getStore().getData().items);
    

    Get a component by id and inspect:

    Code
    var cmp = Ext.getCmp('myPanelId');
    console.dir(cmp);
    

    See listeners on a component:

    Code
    console.log(cmp.listeners || cmp.events);
    

    Force a layout recompute:

    Code
    cmp.updateLayout(); cmp.ownerCt && cmp.ownerCt.updateLayout();
    

    Sencha Cmd & builds

    • Use Sencha Cmd to generate dev builds with source maps: builds created via sencha app watch or sencha app build development include easier-to-debug outputs. Production builds minify and concat files—use dev builds to reproduce and debug before producing a production build. Sencha Cmd also manages theming and classpath resolution

    Logging, monitoring & sharing traces

    • Use console.debug/info/warn/error with clear tags (e.g., console.debug(‘[MyApp:Grid] rowData’, rowData))
    • Capture HAR from Network panel and share with teammates
    • Export performance traces or heap snapshots. Anonymize any sensitive payloads before sharing
    • Use remote logging (Sentry/LogRocket) for production errors, but pair with local reproductions for stateful bugs

    Versioning and API differences

    • Ext JS APIs and namespaces change across major versions. Always confirm Ext.getVersion() and consult corresponding docs for that version: https://docs.sencha.com/
    • Some debugging techniques (internal property names, loader behavior) differ between classic and modern toolkits. Check which toolkit your app uses.

    Resources and references

    • Ext Inspector project/resources (search for current extension or builds compatible with your Ext version).
    • Sencha Cmd docs: https://docs.sencha.com/cmd/
    • Browser DevTools guides: Chrome DevTools docs, Firefox DevTools docs.
  • Inspecting JavaScript Framework Internals

    Inspecting JavaScript Framework Internals

    Why inspect framework internals?

    • Debugging: locate where UI state is created or changed, find origin of events or render issues
    • Learning: understand architecture, lifecycle and data flow of unfamiliar frameworks
    • Integration: hook into lifecycle, extend components or migrate features safely
    • Security & performance: spot unsafe patterns, memory leaks or heavy render hotspots

    Which frameworks this applies to

    • Component-based: React, Vue, Angular, Svelte
    • Classic/class-system frameworks: Ext JS, Dojo, Ember
    • State-management heavy: Redux/MobX/Vuex, Flux patterns

    What you can learn by inspecting

    • Component/view tree and hierarchy
    • Instance properties: props, state, internal fields, DOM refs
    • Model/data stores: shape, current values, subscribers/listeners
    • Class names and inheritance chain (prototype / ES class)
    • Event listeners and where they attach (DOM vs. framework event bus)
    • Lifecycle hooks and order of operations
    • Templates, render output, and bindings to data
    • Network/data flows that populate models (XHR/fetch/GraphQL)

    Tools to use (built‑in + popular extensions)

    • Browser DevTools (Elements/Console/Sources/Network/Performance/Memory)
    • Framework DevTools:
      • React DevTools (components, hooks, profiler)
      • Vue Devtools (component tree, Vuex inspection)
      • Angular DevTools / Augury (component tree, change detection profiling)
      • Ember Inspector (routes, components, data, templates)
      • Svelte Devtools (component state)
      • Ext JS Inspector (for Ext JS apps, component tree, configs, layouts)
    • Generic helpers:
      • Wappalyzer / BuiltWith — detect framework used
      • Redux DevTools — inspect Redux action/state history
      • XHR/fetch breakpoints and Network HAR export
      • Source-map enabled Debugger for readable stack traces
    • Code instrumentation & runtime probes:
      • console.log/console.dir, console.table
      • debugger statements and conditional breakpoints
      • Performance.mark/measure and User Timing API
      • MutationObserver and EventListener breakpoint APIs
    • Automated tools & profilers:
      • Lighthouse, WebPageTest, and framework profilers (React Profiler)

    Sample basic workflow steps for any framework

    1. Identify the framework: use Wappalyzer or inspect global objects (window.React, window.Vue, Ext, Ember)
    2. Open the appropriate framework DevTools if available (React/Vue/Ext Inspector). If not available, use DOM + Console
    3. Locate the component/view of interest using the element picker. In framework devtools, follow the component tree; in DOM inspector, find nearest root node and inspect attached data via DOM properties or dataset attributes
    4. Inspect instance state: framework tools show props/state; otherwise check element.__reactFiber / vue / Ext.getCmp or global registries used by the framework
    5. Trace event handlers: set breakpoints on event listeners (Sources → Event Listener Breakpoints) or right‑click in Console to list listeners (getEventListeners(node))
    6. Trace data flow: monitor XHR/fetch in Network, set XHR/fetch breakpoints, or instrument store actions (Redux DevTools)
    7. Debug lifecycle: set breakpoints in constructor/connectedCallback/render/useEffect/mounted hooks via source maps in the Debugger
    8. Check memory: take heap snapshots before/after actions to find detached nodes or retained closures.
    9. Confirm fixes across browsers and with production minified bundles using source maps

    Specific toolsets

    a computer screen with a keyboard and a box with a logo
    • React
      • Use React DevTools to inspect component tree, props, state, and hooks. Use the Profiler to find expensive renders
      • In Console, React adds REACT_DEVTOOLS_GLOBAL_HOOK and elements may expose internal fibers at element._reactRootContainer or el[Object.keys(el).find(k=>k.startsWith(“__reactInternalInstance”))]. Use caution as internals change across versions
      • For class components, inspect instance methods; for hooks, use DevTools hook inspection
    • Vue
      • Vue Devtools shows component tree, reactive data, and Vuex store.
      • In Console, components attach to vue on DOM nodes. Access component instance with $vm0 after selecting in devtools or use document.querySelector(…).vue
    • Angular
      • Use Angular DevTools (and Augury historically) to inspect component trees and change detection
      • Access component instance via ng.getComponent(element) in modern Angular devtools-enabled pages
    • Ext JS
      • Use Ext JS Inspector (standalone extension) to browse component tree, configs, and layouts. Ext apps commonly expose Ext global; find components with Ext.getCmp(id) or Ext.ComponentQuery.query(selector). Inspect component.config, getStore(), and getView() for grids/lists
    • Generic/class inspection
      • Inspect prototype chain: in Console run Object.getPrototypeOf(instance) repeatedly or use console.dir(instance) to view methods
      • Identify classes by constructor.name (careful: minified builds rename names). For minified code, rely on source maps
    • Events & DOM listeners
      • getEventListeners(node) in Console (Chrome) or inspect via Event Listener Breakpoints in Sources. Use MonitorEvents(node) to log events
      • For framework-emitted events, inspect framework-specific event buses (e.g., Ember.Evented, Ext.util.Observable)
    • Stores & models
      • For Redux: use Redux DevTools or window.REDUX_DEVTOOLS_EXTENSION to replay actions and inspect state diffs
      • For MobX/Vuex/Ext data stores: inspect store objects, subscribe callbacks, and check mutation logs where available

    Tips

    • Enable source maps in production builds for easier debugging, if not available, use pretty-print in Sources
    • Use conditional breakpoints to avoid stepping through tight loops
    • Avoid relying on private internals in production code, use public APIs or official hooks.
    • When inspecting minified/prod builds, map stack traces with source maps or re-run a non-minified local build for debugging
    • Use read-only inspection first, prefer not to change app state in production unless safe and reversible

    Privacy/security note

    • Don’t paste secrets or PII into console or external debugging tools. Use sanitized HARs and recordings when sharing
  • Key differences between Chromium-based DevTools and Firefox DevTools

    Key differences between Chromium-based DevTools and Firefox DevTools

    This is a follow up on our previous firefox post so if you haven’t already read it check here for any questions. That is more of a detailed guide that can be used with chromium browsers as well with the key differences being noted below.

    • CSS Grid & Flexbox visualization
      • Firefox: stronger, more detailed Grid and Flexbox highlighters (interactive overlays, gap/line labels)
      • Chromium: good visualizers but generally less feature-rich for grid diagnostics
    • Layout & box-model UX
      • Firefox: clearer box-model inspector and overlay controls for spacing troubleshooting
      • Chromium: similar capabilities but different UI placement and terminology
    • Performance tooling & profiler UI
      • Firefox: comparable profiling features with different visualizations and emphasis on paint/layout diagnostics
      • Chromium: integrated Lighthouse and early experimental features, flame charts and profiler UX differ
    • Memory tools
      • Firefox: robust heap snapshot and retainers view focused on DOM detachment patterns
      • Chromium: allocation instrumentation and allocation profiler with different workflows for tracking leaks
    • Issues / centralized warnings
      • Firefox: reports many issues via Console and Security panels but lacks identical centralized Issues UI
      • Chromium: built-in Issues panel aggregating CSP, deprecations, mixed content etc
    • Rendering diagnostics (paint/layers)
      • Firefox: paint flashing, layer borders and compositing tools with different visualization strengths
      • Chromium: comparable rendering tools and an FPS meter, implementations and visuals differ
    • Early experimental features
      • Firefox: may lag on some experiments but offers unique UX strengths for CSS/layout.
      • Chromium: often receives experimental DevTools features earlier (and integrates Lighthouse)
    • Framework/extension ecosystem
      • Firefox: supports major framework devtools but fewer third‑party DevTools extensions overall
      • Chromium: broader extension availability (React/Vue tools, Lighthouse extension, many DevTools extensions)
    • Remote debugging UX
      • Firefox: about:debugging for remote devices; comparable but different workflow.
      • Chromium: chrome://inspect for Android and a large ecosystem of remote/debugging tools
    • Default privacy/telemetry posture
      • Firefox: generally more privacy-forward in defaults (affects telemetry and some DevTools integrations)
      • Chromium: more integrations and telemetry options enabled by default in many builds
    • UI/interaction differences (short list)
      • Panels naming: Elements (Chromium) vs. Inspector (Firefox)
      • Device Mode (Chromium) vs. Responsive Design Mode (Firefox): similar features, different controls
      • Console toggling and shortcuts are mostly the same but some keybindings and menu placements differ
    Chromium devtools screenshot

    Using both Chromium based browser and Firefox tools together

    Use both toolchains when diagnosing cross‑browser issues. If you reproduce in both you can catch engine-specific rendering, layout or JS differences.

    For example you can use the Elements/Inspector panels to compare computed styles, box‑model overlays and Grid/Flexbox highlighters to spot layout differences; toggle and edit CSS live in each to see engine‑specific rendering.

    Capture network activity and HARs from both browsers to compare request timing, caching headers, and resource sizes, then run performance recordings (flame charts in Chrome, Performance/paint diagnostics in Firefox) to identify different long‑tasks, layout thrashing or paint costs.

    Take heap snapshots or allocation profiles in each to detect memory leaks that may manifest differently across engines.

    Run accessibility audits (Lighthouse in Chrome and the Accessibility Inspector in Firefox) and validate with a screen reader to surface divergent ARIA or focus issues.

    Finally, reproduce fixes in both browsers and retest in Device/Responsive modes and on real devices via remote debugging (chrome://inspect and about:debugging) to ensure cross‑browser consistency.

    Resources and links

  • Using Firefox to Inspect a Webpage

    Using Firefox to Inspect a Webpage

    Why inspect a page?

    • Debugging: find broken DOM, CSS specificity issues, JS errors
    • Performance: spot slow network requests, heavy scripts, memory leaks
    • Accessibility & SEO: verify semantic markup, ARIA, headings and meta tags
    • Learning & reverse‑engineering: understand layout patterns, CSS tricks and JS behavior
    • Rapid prototyping: live-edit HTML/CSS and test fixes without redeploying

    How to open Developer Tools

    • Keyboard shortcut: F12 or Ctrl+Shift+I (Cmd+Opt+I on macOS)
    • Right‑click any element → Inspect Element
    • Menu: Tools → Web Developer → Web Developer Tools
    • Remote: about:debugging → Connect to device / Firefox instance

    Overview of built‑in DevTools

    • Inspector (Page Inspector)
      • View/edit DOM and CSS rules, computed styles, box model and layout
      • Use: layout bugs, specificity problems, CSS experiments
      • Features: element picker, rule search, style editing, box model overlays, CSS variables preview
    • Box Model & Layout tools
      • Visual margins/padding/border overlays; Grid and Flexbox highlighters
      • Use: debug spacing, alignment, grid gaps
    • Fonts panel
      • See used webfonts, font-face declarations, fallback chain, line-height, weight
      • Use: typography debugging and license checks
    • Animations inspector
      • Timeline for CSS and Web Animations API; scrub, replay, slow motion
      • Use: debug timing and easing, capture frames
    • Web Console
      • Logs, errors, warnings, network messages, DOM exceptions, CSS warnings
      • Execute JS in page context, inspect objects and elements
      • Use: quick evaluation, console.table, saving logs
    • JavaScript Debugger
      • Set breakpoints (line, conditional, XHR/fetch), step through, watch expressions, examine call stack and scopes
      • Use: tracing runtime bugs, async stack traces, break on exceptions
    • Network Monitor
      • Full request/response view, timings (DNS/connect/TLS/TTFB), size, initiator, priority, headers, preview/response body, throttling
      • Use: asset optimization, caching issues, API debugging
    • Performance (Profiler)
      • Record frames, JavaScript CPU usage, paint/layout events, call trees, flame charts
      • Use: find code hotspots, layout thrashing, long tasks causing jank
    • Memory
      • Heap snapshots, allocation stacks, retainers, detect leaks and high memory objects
      • Use: reduce memory bloat, track closures holding DOM
    • Storage / Application panel
      • Inspect cookies, localStorage, sessionStorage, IndexedDB, Cache Storage, service workers
      • Use: debug auth, caching strategies, stale content
    • Responsive Design Mode
      • Emulate device viewports, DPR, touch, UA, and network throttling
      • Use: visual QA across screen sizes and simulated slow connections
    • Accessibility Inspector
      • Accessibility tree, computed name/role/state, contrast checker, ARIA properties
      • Use: compliance checks, screen reader troubleshooting
    • Security
      • TLS/HTTPS status, mixed content, certificate info
      • Use: detect insecure resources and certificate issues
    • Application Security & Permissions
      • Inspect permissions, feature policy, CSP violations in console
    • Performance Tools for Graphics & Layers
      • Paint flashing, layer borders and frame-rate diagnostics for heavy animations

    Tips and tricks

    • Use Ctrl/Cmd+F in Inspector to search HTML/CSS
    • Right‑click a rule → Copy → Copy Rule or Copy Declaration to transfer fixes
    • Use “Toggle Element State” to force :hover/:active/:focus states for testing
    • Pin frequently used panels (three‑dot menu → Settings → Toolbox) to keep your layout
    • Use multi‑selection (Shift/Ctrl) in Console for batch operations
    • Persist logs across reloads (Console “Preserve log”) when debugging redirects or service worker registrations
    • Throttle network to Slow 3G to surface timing bugs and lazy load problems early
    • Use the “Disable Cache” option (Network panel) while DevTools is open to bypass cache during reloads
    • Use pretty-print and source maps in Debugger for minified code
    • Use conditional breakpoints to avoid noisy stepping in loops
    • Use “Break on attribute mutation” or “Break on subtree modifications” in Inspector for dynamic DOM problems
    • Use the “Take screenshot” and “Capture node screenshot” options in the Inspector for image assets or bug reports

    Useful built‑in workflows

    • Audit large page loads: open Network → sort by size/time → identify big assets → compress/serve smaller formats (WebP/AVIF), lazy load images and implement HTTP caching headers
    • Find memory leaks: take two Heap snapshots before/after action, diff the snapshots and inspect retained DOM nodes and detached elements
    • Speed up time‑to‑interactive: record Performance while loading, inspect long tasks and paint/layout recalc events, prioritize code splitting and defer non‑critical work

    Add‑ons and external tools that pair well with Firefox DevTools

    ExtensionAdds / PurposeUse Cases
    Web Developer (by Chris Pederick)Extra toolbar of DOM/CSS utilities (disable styles, outline elements, forms tools)Quick diagnostic actions and mass toggles
    React Developer ToolsInspect React component tree, props, state, hooksDebug React structure and performance; integrates with DevTools profiler
    Vue.js DevtoolsVue component inspector, performanceVue SPA debugging and state inspection
    Redux DevToolsTime‑travel debugging for Redux storesFor Redux-driven apps to replay actions and inspect state
    WappalyzerDetect tech stack, frameworks, libs usedQuick reconnaissance and dependency checks
    Lighthouse (via extension or CLI)Automated performance/accessibility/SEO auditsHigh-level audits and actionable suggestions
    ColorZilla / EyedropperPick colors from the page and create palettesVisual QA and color checks
    HTTP Header Live / Modify HeadersView/modify request headers on the flyTest CORS, security headers, feature detection
    LiveReload / BrowserSync (local dev)Auto-refresh and synced testing across devicesRapid local development iteration
    CSS PeeperRead styles, fonts, assets in a friendly UIFast style extraction for design handoff

    Note: many capabilities (network, console, accessibility) already exist in DevTools. Some extensions mainly add framework-specific inspection, recon tools or UI conveniences

    Accessibility and testing considerations

    • Use the Accessibility Inspector to surface missing labels, roles and improper semantics
    • Use color contrast tool in Accessibility panel. Fix low contrast by adjusting foreground/background or font weight
    • Use keyboard testing (Tab order inspector) to ensure logical focus flow
    • Test with a screen reader (NVDA/VoiceOver) where possible, the Accessibility Inspector helps but should not replace real assistive tech

    Advanced topics & workflows

    • Remote debugging: connect Firefox on Android or another desktop instance via about:debugging → connect and debug pages on the device
    • Source maps & transpiled code: enable source maps in Debugger settings to step through original TypeScript or transpiled code
    • Automating checks: combine Lighthouse, Puppeteer or Playwright tests to run performance/accessibility checks in CI
    • Custom DevTools extensions: build an extension for a bespoke workflow (see “Extending DevTools” in Firefox docs)
    • Network recording for reproducible bug reports: export HAR from Network Monitor to share with teammates

    Common pitfalls and how to avoid them

    • Caching hides changes, use “Disable cache” while DevTools is open
    • Minified code without source maps, enable source maps or generate them in your build
    • Over-reliance on developer mode alone — cross‑check in real devices and browsers

    Resources and Official Docs