Doka Documentation
repository·main·Indexed 23 days ago
https://github.com/doka-guide/contentA practical and accessible encyclopedia for web developers. This documentation serves as the source of truth for the project, containing technical guides, articles, and interactive demos. It covers core principles of accessible HTML, including semantic markup, ARIA roles and properties, heading hierarchies, and accessible form implementation.
What's inside Doka
- As projects grow in size, modules provide a way to organize code, making it easier to navigate, write, and maintain. Modules allow you to structure your program logically and reuse code across different parts of your application by importing and exporting functions and variables from other files.
Overview of accessible forms
mainForms are critical interface elements that can be visually and cognitively complex. Making forms accessible ensures that users—including those with disabilities—can navigate them without getting stuck. Accessibility is achieved through logical structure, simplicity, clear error/format awareness, and correct markup (such as properly associating<label>elements with their corresponding input fields).Overview of the Console API
mainThe
consoleobject provides access to debugging and logging methods. It is available as a property of the global object:windowin browsers andglobalin Node.js.The Console API methods are categorized into:
- Logging methods: For outputting messages at different levels.
- Counting functions: For tracking occurrences.
- Grouping functions: For organizing related logs.
- Timers: For measuring execution time.
Logging levels vary by environment but typically include:
error(error)warning(warning)info(info)debugorverbose(debug / verbose)
Evaluate the pros and cons of Functional Programming
mainAdvantages
- Reliability and Testability: Pure functions are predictable and easy to test because they do not require complex test infrastructure or external state.
- Compilation Optimization: Referential transparency allows compilers to pre-calculate function results (constant folding/memoization) to save runtime resources.
- Concurrency and Thread Safety: Since FP prohibits state mutation, it eliminates race conditions where multiple threads attempt to write to the same variable, making parallel execution safer.
Disadvantages
- Memory Consumption: Because state is immutable, 'modifying' data requires creating copies, which can increase memory usage if not managed via efficient allocation and garbage collection.
- Complexity with Side Effects: Integrating pure FP with real-world systems (which are inherently side-effect driven, like I/O or network calls) requires specific architectural patterns to manage impurity.
Use the `color` property to set text color
mainThe
colorCSS property sets the color of text and its decorative elements (such as underlines, overlines, and strikethroughs). It is distinct frombackground-color(which sets the background) andborder-color(which sets the border color)..element { color: red; }Understand the advantages and disadvantages of PWAs
mainProgressive Web Apps (PWAs) leverage web technologies to provide an experience similar to native applications.
Advantages
- True Cross-platform Compatibility: Runs on any device with a browser and internet access (wearables, TVs, VR/AR, etc.) using a single codebase.
- Native-like Behavior: Can be launched via home screen icons, integrate with OS features (URI handlers, file extensions), work offline, receive push notifications, and access hardware (Camera, Microphone, Bluetooth, USB, NFC, GPU).
- Offline Capabilities: Uses caching to allow offline operation and faster subsequent launches. Advanced implementations can sync client-side data with the server once connectivity is restored.
- No Installation/Update Friction: Users access them via a URL. Caching can handle background updates automatically.
- Small Footprint: PWAs call existing browser APIs rather than implementing them, loading only necessary code.
- Web Platform Benefits: SEO indexing, deep linking via URLs, and standard web features (text selection, translation, scaling, printing).
- Security: Runs in a browser sandbox using HTTPS and utilizes a permission-based model for sensitive hardware access.
- Low Barrier to Entry: Requires only HTML, JS, and CSS knowledge; no proprietary SDKs or specific hardware (like for iOS development) are required.
Disadvantages
- Decentralization: Lack of a centralized, large-scale app store for discovery, reviews, and screenshots.
- Inconsistent Platform Support: Behavior depends on the browser and its engine. Different browsers, versions, or even the same browser on different OSs may have varying Web API support. For example, on iOS, all browsers are forced to use the WebKit engine, which may have limited or delayed Web API support compared to other platforms.
Use the `<input>` tag for interactive elements
mainThe
<input>tag is a versatile container used to create various interactive elements such as text fields, buttons, sliders, and checkboxes. It allows users to enter data, make selections, or trigger actions.To ensure that data entered into an
<input>is sent to a server, you must either wrap the input inside a<form>element or associate it with a form using anid.<label for="name">Введите название (от 4 до 8 символов):</label> <input type="text" id="name" name="name" required minlength="4" maxlength="8" size="10" >Comparison of reactivity approaches in modern frameworks
mainWhen choosing a framework, consider how they handle change detection and DOM updates:
- Virtual DOM (React, Vue): Maintains an in-memory representation of the application state. It finds changes by comparing two versions of the tree. While efficient for many tasks, very large applications can consume significant memory, and frequent updates require tree comparison overhead.
- Angular: Uses automatic change detection strategies, but also provides secondary strategies that developers can implement to optimize performance in specific scenarios.
- Svelte: Uses a compilation-based approach. It generates highly targeted code during the build process that tracks only the necessary changes, resulting in a smaller and faster runtime footprint.
Core features of Rollup
mainRollup provides several optimization and build features:
- Real-time rebuilding: Rebuilds the bundle automatically when code changes.
- Syntax and formatting checks: Validates code integrity.
- Multi-bundle output: Can generate multiple bundles from one project (e.g., ES6, ES5 for older browsers, and Node.js versions).
- Minification: Removes whitespace to reduce file size.
- Plugin support: Extends functionality via plugins.
- Tree Shaking: Automatically removes unused code to reduce bundle weight and improve performance. This is enabled by default.
- Code Splitting: Supports loading code progressively (lazy loading) to prevent long initial load times.
Core principles of accessible HTML
mainWeb accessibility relies on several fundamental rules to ensure content is usable by everyone, including those using assistive technologies:
- Use semantic HTML tags: Prefer native elements over generic containers to provide built-in meaning and functionality.
- Provide obvious and accessible content: Ensure the text content of tags is clear and meaningful.
- Use labels for form elements: Always use the
<label>tag to associate text with form inputs. - Ensure scalability: Use
user-scalableandmaximum-scalewithin the<meta>tag to allow users to zoom. - Use ARIA as a supplement: Only use WAI-ARIA when native HTML elements cannot fulfill the required functionality.
What is ARIA and how it works
mainARIA (Accessible Rich Internet Applications) is a set of additional attributes that extend the capabilities of HTML, SVG, and other languages to create more accessible interfaces.
Key characteristics:
- ARIA helps improve the accessibility of interactive elements, link elements together, indicate their state, mark page changes, or describe document structure.
- ARIA does not affect the visual appearance or behavior of elements.
- ARIA does not change the DOM.
- ARIA only changes how browsers, the Accessibility API, and assistive technologies (like screen readers, Braille displays, screen magnifiers, and voice control) interact with the elements.
What is a Command Line Interface (CLI)?
mainA Command Line Interface (also known as a terminal, console, or CLI) is a method of interacting with a computer using text-based commands in a specific format. These commands instruct the computer on what actions to perform and in what sequence. The computer responds by outputting information about the results of those commands to the screen.