Home / Companies / LogRocket / Blog / July 2019

July 2019 Summaries

12 posts from LogRocket

Filter
Month: Year:
Post Summaries Back to Blog
Cookies, once the sole option for browser data storage, have been joined by newer alternatives like the Web Storage API, IndexedDB, and the Cache API, each offering distinct benefits for different use cases. Cookies remain relevant for storing small, sensitive data that requires secure server communication, enhanced by security flags like HttpOnly, Secure, and SameSite. The Web Storage API, encompassing localStorage and sessionStorage, provides a more intuitive and flexible method for client-side data management, allowing for larger data storage without bloating HTTP requests. IndexedDB offers a powerful solution for handling extensive, structured data asynchronously, though its complexity is mitigated by utility libraries. The Cache API, initially designed for service workers, enables efficient caching of network requests for improved web performance. Each method caters to specific data storage needs, providing developers with a range of tools to optimize their web applications.
Jul 31, 2019 1,906 words in the original blog post.
The newest release of Google Chrome introduces the backdrop-filter property, enabling web developers to create effects similar to iOS's frosted glass with just a few lines of CSS. This property applies filters to an element’s backdrop, allowing for various visual effects such as blur, grayscale, and sepia. Initially supported by Safari and Edge, Chrome and other Chromium-based browsers now include this feature, though developers should still account for browsers like Firefox that may not support it. Using the @supports query, developers can implement progressive enhancement to ensure compatibility across browsers, providing alternative styles when backdrop-filter isn’t supported. Beyond simple effects, multiple filters can be combined for more complex visuals, offering creative possibilities beyond the frosted glass effect. In addition to the backdrop-filter, Chrome’s update includes other features like the prefers-color-scheme media query and improvements for Progressive Web Apps (PWAs).
Jul 31, 2019 915 words in the original blog post.
In the exploration of implementing JSON Web Token (JWT) authentication in a microservice-based architecture using React for the frontend and .NET Core API for the backend, the author shares their experience of building a MERN stack application. The process involves generating, validating, and decoding JWTs to securely represent claims between two parties, with the backend generating the token using algorithms like HS512 and RS512. The author uses the jsrsasign library for handling JWTs and emphasizes keeping the private key secure while demonstrating how to generate and decode JWTs. They also touch on the importance of validating tokens to prevent tampering and explain the role of JWT in enhancing secure transmission in single-page applications. The project is part of a broader discussion on authentication mechanisms, and while the author mentions the possibility of integrating MongoDB, it is not within the scope of this particular exploration.
Jul 30, 2019 1,938 words in the original blog post.
React Storybook is a widely used tool for developing and showcasing UI components in an isolated environment, allowing developers to create interactive component documentation. The text discusses various alternatives to Storybook for React applications, including Atellier, React Cosmos, Docz, Carte Blanche, React Styleguide Generator, and React Bluekit, each offering unique features for component development and documentation. Atellier enables component preview and editing, React Cosmos focuses on rendering components with different states and dependencies, Docz provides zero-configuration documentation with live previews, Carte Blanche offers an isolated space with fuzz testing, React Styleguide Generator helps create style guides, and React Bluekit integrates with gulp for component documentation. These tools aim to enhance the UI development process by facilitating faster collaboration, improved component testing, and comprehensive documentation.
Jul 28, 2019 1,098 words in the original blog post.
Integrating working dates into web applications can be complex due to JavaScript's limited native support for advanced date operations, prompting developers to rely on third-party libraries for enhanced functionality. Moment.js, one of the earliest and most well-known libraries, offers a robust API and a variety of plugins for internationalization and formatting, although its mutable objects and larger file size have led to the development of alternatives like DayJS and Luxon. DayJS provides a similar API with a substantially smaller file size, while Luxon builds on modern browser APIs for internationalization, offering immutable objects. Date-fns emphasizes modular imports and immutability, supporting over 140 functions grouped by file. Meanwhile, libraries like ms focus on converting date formats to milliseconds, and js-joda offers an extensible framework for cleaner OOP code. Spacetime targets timezone management with a Moment.js-like API, highlighting the diverse approaches available for handling date and time complexities in JavaScript.
Jul 24, 2019 2,914 words in the original blog post.
GraphQL, a query language for APIs, allows clients to request specific data from servers, making it a streamlined alternative to REST APIs. The library urql, designed for React, aims to simplify the client-side experience of using GraphQL by offering lightweight and extensible features, contrasted with Apollo’s more comprehensive approach. urql, though less popular than Apollo, offers easier setup and a straightforward caching system, which caches data at the query level rather than normalizing it by item type, as Apollo does. This can benefit certain applications but may not suit those with heavy mutation needs, as urql's cache invalidation can be more aggressive. Both Apollo and urql provide similar APIs, but Apollo includes additional features like direct cache manipulation and persisted queries, making it more suitable for complex use cases. Despite these differences, urql's simplicity and ease of use make it a viable option for developers seeking an uncomplicated solution to implement GraphQL in their React applications, with the flexibility to switch to Apollo if needed.
Jul 23, 2019 2,465 words in the original blog post.
The evolution of JavaScript modularization has led to a complex ecosystem involving various module formats like AMD, CommonJS, and ES modules, each with specific use cases and compatibility requirements. While browsers have gradually adopted ES modules since their introduction in the ES2015 specification, Node.js has historically relied on CommonJS but has been transitioning to support ES modules, offering developers the flexibility to use both types in tandem. This shift aims to harmonize client-server JavaScript development by allowing full-stack developers to write modular code more naturally. Node.js has been working towards a seamless integration of ES modules, reflected in the progressive implementation phases and the introduction of features like the ".mjs" file extension and import/export syntax. Key developments include a new module loader system that supports ES module and CommonJS interoperability and a proposal to support dual-mode packages for backward compatibility. Despite ongoing debates and challenges, the Node.js community continues to work towards a future where ES modules may eventually replace CommonJS, fostering a unified JavaScript modular experience across platforms.
Jul 22, 2019 1,779 words in the original blog post.
JAMstack is a modern approach to building websites and apps that enhances performance, security, scalability, and developer experience by leveraging client-side functionality and third-party APIs. It shifts traditional web development paradigms by offloading complex tasks to specialized services, such as authentication and media optimization, while ensuring ease of use and compliance with industry standards. Key services include Auth0 for authentication, Firebase for backend services, Cloudinary for media management, Netlify for instant deployment, Backendless for API management, Typeform for form processing, and Contentful for content management. Each of these services offers comprehensive documentation and integration capabilities to streamline the development process, supporting the creation of high-speed, efficient applications.
Jul 16, 2019 1,188 words in the original blog post.
Node.js 12 introduces a range of significant enhancements aimed at improving the performance, security, and developer experience for JavaScript applications. Key upgrades include a more advanced V8 JavaScript engine with zero-cost async stack traces, faster function calls, and improved async function performance. Security is bolstered with TLS 1.3, enhancing both privacy and speed, while properly configured default heap limits reduce memory errors. A new http parser, llhttp, replaces the old library, offering a 156% performance boost, and diagnostic tools like on-demand reports and integrated heap dumps simplify debugging. Native module creation is streamlined with improved support for worker threads and the N-API version 4, while the removal of the experimental flag for worker threads signals their maturation. Startup times are reduced through pre-generated code caches, and the continued development of ES6 module support promises seamless JavaScript transitions between frontend and backend development. Node.js 12 requires updated compiler standards, ensuring compatibility with modern platforms, and although it will enter long-term support in October 2019, its current features already present a compelling case for adoption in server-side solutions.
Jul 15, 2019 2,056 words in the original blog post.
Meta-programming, a programming technique that allows developers to modify a language's fundamental components using the language itself, is a favorite aspect among programmers for its ability to enhance or even create new domain-specific languages (DSLs). Though JavaScript provides flexibility, it lacked certain meta-programming features until the introduction of proxies, which allow developers to surpass previous limitations by wrapping objects or functions in "traps" that execute code when triggered. The article explores using proxies to enhance JavaScript objects by demonstrating dynamic property access, custom error handling for invalid property names, and dynamic method behavior. By setting up proxies with traps and using regular expressions, developers can intercept property or method names to interpret and modify behaviors dynamically, thereby extending object functionalities without polluting the object namespace. The author also contrasts proxies with the Reflect object introduced in ES6, which offers a different syntax for executing similar functionalities without altering expected behaviors. Lastly, the article encourages creativity in using these techniques to customize JavaScript to suit individual needs.
Jul 14, 2019 2,443 words in the original blog post.
React, a popular JavaScript library for building user interfaces, benefits from the use of UI kits, which streamline the development process by providing pre-made components such as buttons and modals. These kits enhance efficiency and consistency while reducing development time and costs. The text reviews several notable React UI kits from 2019, including AtlasKit, Belle, Blueprint UI, Elemental UI, Fabric React, Grommet, Prime React, Reakit, Rebass, and Shards React, each offering unique features such as mobile optimization, accessibility standards, and theming capabilities. These kits are used by various companies and are popular within the developer community, with many available under open-source licenses and supported by consistent updates. The article emphasizes that React UI kits are crucial for building customizable and scalable applications, enhancing the overall development workflow.
Jul 05, 2019 1,170 words in the original blog post.
The article explores the implementation of both synchronous and asynchronous infinite counters using streams and generators in Node.js, highlighting their similarities and fundamental differences. It explains how the Node.js Stream API, primarily used for handling large asynchronous data, can be utilized to create both pull-based and push-based streams, demonstrating the differences in buffering and control over data flow. In contrast, generators, introduced in ES2015, offer a loop abstraction capable of representing infinite data lengths without buffering, and when combined with ES2018’s async iterators, can manage asynchronous data with precise control over each loop iteration. Through practical examples, the article illustrates the nuances between streams, which buffer data, and generators, which handle data on-demand, while providing insights into their application in creating counters that count indefinitely.
Jul 03, 2019 1,750 words in the original blog post.