辛宝Otto

辛宝Otto 的玄酒清谈

北漂前端程序员儿 / 探索新事物 / Web Worker 主播之一/内向话痨
xiaoyuzhou
email

Modern.js Prequel - Byte Modern Web Development

image.png

Looking back and adding: The onlooker is perplexed. Now looking back at the development of Modern.js, compared to the early promotion, it reveals just the tip of the iceberg. Constantly refreshing. Originally published on Yuque, now moved to the blog.

The original text corresponds to the speech at GMTC2021 Entering Modern Web Development (Full Text of the GMTC 2021 Speech "Byte's Modern Web Development Practices")

There is also a corresponding PDF, which will not be released for now.

Technical Details#

Three parts:

  • Overall review of "traditional development" and identifying bottlenecks
  • Changes and trends that occurred to solve the problems
  • Byte's technical output, referred to as "engine upgrade"

In large companies like Byte, there are many projects, and due to the large scale, frontend issues are more apparent.

Traditional Development and Issues#

The following image shows the traditional development tech stack, read the image.

image.png

In the image, from bottom to top, it represents the abstraction layer from the lowest to the highest. The three blocks on the far right extend from the bottom to the top, representing that they are all end-to-end solutions, which are disconnected from the system on the left and from each other, containing a lot of redundancy. Due to time constraints, this sharing will not cover these parts.

The blue blocks are code-level, and the green blocks are platform-level.

This set of technologies has reached a point of stagnation, which manifests many problems.

  • Scaffolding. Structured with examples

  • Some files must be modified to conform to the actual project structure after changes

  • Multiple projects using the same scaffolding develop independently, and eventually, the differences become significant, making reuse difficult

  • The scaffolding has iterated but does not benefit the original projects

  • Project templates

  • Different projects have different templates, which will increase over time

  • Templates continuously evolve and some will stop updating

  • Webpack packaging

  • To avoid everyone needing to configure webpack, encapsulation and packaging are done as a convention

  • The abstraction level of the packaging is limited, and the configuration APIs are varied; once it gets complex, changes are needed. There are too many standards

  • Evolution of compilation tools. Besides webpack, there are more options. This is referred to as the third era of JS. Specific technical details are omitted

  • Dev build alone is not enough; the image below is quite insightful, looking at it column by column. It expresses that there is still a lot of work for the frontend; dev and build are insufficient. Moreover, it does not cover the underlying services of the project.

This segment of text in the image comes from an article written by Dan, the author of Redux, discussing the design of JS tools' configuration APIs. This text talks about how abstraction and design in this area can have a huge impact, requiring a high threshold and serious professionalism. This work also requires a high level of concentration, rather than being left to "Webpack engineers" to handle various "standards."

The Third Age of JavaScript: https://www.swyx.io/writing/js-third-age

image.png

Continuing

  • Frontend engineering. Limited to the code level, not reaching the platform level. (Is serverless vaguely implied?)

  • Issues with React.

  • Which specific technology framework to choose. They gradually unify around React, due to community ecology, application scale, design evolution, and design trends. This part is not very interesting; just the conclusion is enough.

  • React is incomplete as a framework

  • Looking at framework-level options, such as Nest, which provides backend-centered development, has little relation to ordinary web project frontends, and introduces a higher threshold from Node to BFF, etc., which will be omitted

  • The core is: layering + separation of concerns (there is definitely serverless below)

Reference links:

Advancing the web framework ecosystem (Chrome Dev Summit 2019): https://youtu.be/QDljY2I1Pfw

NestJS Philosophy: https://docs.nestjs.com/#philosophy

The Clean Architecture: https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html

The BFF Pattern (Backend for Frontend): An Introduction: https://blog.bitsrc.io/bff-pattern-backend-for-frontend-an-introduction-e4fa965128bf

Continuing

  • IaaS and backend PaaS. Even less related to the frontend. The blue part should have a unified closure. (What is it? It must be serverless)

The image below shows that the green part is the underlying service. The yellow and blue represent the frontend and backend.

image.png

Thus, the first part ends.

The problems have been raised; how to solve them is the content of the second part.

https://2017.jsconfchina.com/files/02-modern-web-dev-dexteryy.pdf

Technology is evolving

image.png

First, look at the blue part:

Next, looking at the orange part, to be continued.

  • JAMstack

  • j,js -> CSR corresponds to single-page

  • A, apis -> BFF ContentMesh

  • Markup SSR/SSG serverless

  • SHAMstack

  • Static Hosting -> serverless

  • Apis+js

  • Markup

  • STAR app

  • meta-framework

Star is a combination based on the above two.

image.png

The foreign tech community mentions meta-framework,

Essentially, it combines the emphasized parts of JAMstack and STAR to form a client-centered, higher-level abstract, general web framework that meets these needs, abstracting and simplifying various patterns within.

It also included an S-curve to illustrate that as UI frameworks approach stability, integration based on React forms new mainstream technologies.

Reference materials

We can move on to the next topic, which is the transition from traditional development to modern web development, called paradigm shift, Paradigm shift, where various old models transition to new models.

Defining Modern Development#

Now to define

"Modern Web Development" achieves integrated development within the same program, enabling "serverless" capabilities in development, debugging, running, and deployment stages, making it easier for frontend technology stack developers to become true "product developers."

Reference links

Entering the third part

Byte's Best Practices#

Looking back, traditional and modern development

image.png

image.png

In the image, the green part represents platform-based infrastructure, which exceeds the blue part representing pure code-level infrastructure.

image.png

image.png

The project is generated entirely online and can be previewed with one click.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.