Skip to main content

Web Components

info

Web Development Components For The Component Era. Web Components are independent and reusable bits of code. They serve the same purpose as JavaScript functions, but work in isolation.

Web components are a set of web platform APIs that enables creating new custom, reusable, encapsulated HTML tags to use in web pages and web apps.

Based on existing web standards. They enable web developers to extend HTML with new elements with encapsulated styling and custom behavior.


React

reactLogo

React is for building user interfaces (UIs). It is an open-source, front end, JavaScript library created by Facebook.

React is a declarative, efficient, and flexible JavaScript library. It enables creating complex UIs from small and isolated pieces of code called “components”.

React code is made of entities called components. Components can be rendered to a particular element. A component is the core building block of a React application. Every component resides in the same space, but works independently from one another and merges all them in a parent component, which is the final UI of the application."


React JSX {#jsx}

jsxlogo

The core development technology of Docusaurus and React is JavaScript. React has created JSX, a syntax extension to JavaScript. JSX is not part of the web programming languages Troika. Browsers do not understand how to render JSX. React created a compiler to transform JSX code into standard JavaScript at build time.

JSX (JavaScript XML), is a React syntax extension to the JavaScript language. It is similar to a template language, but it has full power of JavaScript. It is similar in appearance to HTML, JSX provides a way to structure component rendering using syntax familiar to many developers. React components are written using JSX.

React embraces the fact that rendering logic is inherently coupled with other UI logic: how events are handled, how the state changes over time, and how the data is prepared for display. Instead of artificially separating technologies by putting markup and logic in separate files, React separates concerns with cohesive components that contain both.


MDX

mdxLogo

MDX is Markdown for the component era. It enables seamlessly writing JSX in Markdown documents. It is compiled to JSX components, It enables using Markdown’s terse syntax for writing website material, and JSX for components.

Markdown is a faster way of creating and maintaining website material. It is a HTLM abstraction that is compiled to web standard HTML

John Gruber published the original Markdown Syntax Guide. Different flavors of Markdown have evolved since then.

"Markdown is a better way to write HTML. It is compiled into HTML at deploy time. Markdown is a lightweight plaintext markup language used to add formatting elements to documents. Markdown is now one of the world’s popular markup languages. Using Markdown is different from using a WYSIWYG editor. In an application like Microsoft Word, you click buttons to format words and phrases, and the changes are visible immediately. Markdown is not like that. In a Markdown-formatted file. Markdown syntax is added to the text to indicate which words and phrases look different."

Markdown has been characterized by an informal specification and a reference implementation for conversion to HTML. Over time, many Markdown implementations have appeared. They are driven by the need for additional features like tables, footnotes, definition lists, and HTML inside Markdown blocks. The behavior of additional features diverge from the reference implementation and informal specification, and have attracted attention. Not all flavors of Markdown are compatible or supported by all frameworks.

I'm hesitant creating website material without using a version of Markdown. My preference is using MDX.

❤️ Powerful: MDX blends markdown and JSX syntax to fit perfectly in React/JSX-based projects.

💻 Everything is a component: Use existing components inside MDX file and import other MDX files as plain components.

🔧 Customizable: Decide which component is rendered for each markdown element.

📚 Markdown-based: The simplicity and elegance of markdown remains, JSX is interleaved when you want to.

🔥 Blazingly blazing fast: MDX has no runtime, all compilation occurs during the build stage."