Micro Frontends Architecture with Module Federation · บทเรียน

กลยุทธ์การกำหนดเวอร์ชันและย้อนกลับ

เรียนรู้การกำหนดเวอร์ชันให้แอประยะไกลแบบรวมอย่างปลอดภัย และย้อนกลับไมโครฟรอนต์เอนด์เพียงตัวเดียวได้ทันทีเมื่อการนำไปใช้งานเกิดปัญหา

บทเรียน 4 จาก 413 ขั้นตอน

กลยุทธ์การกำหนดเวอร์ชันและย้อนกลับ เป็นบทเรียน Micro Frontends Architecture with Module Federation ฟรีบน CoddyKit นี่คือบทเรียนที่ 4 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน Micro Frontends Architecture with Module Federation และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส Micro Frontends Architecture with Module Federation มีบทเรียนทั้งหมด 4 บทเรียน

บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ

Why Versioning Is Hard in MFEs

Each micro frontend deploys independently, yet they run together in the browser. Without disciplined versioning, one bad deploy can break a host that was working moments ago.

Immutable Build Artifacts

The foundation of safe deployment is immutable artifacts: every build produces uniquely named files that are never overwritten.

/cart/2.4.1/remoteEntry.js
/cart/2.4.2/remoteEntry.js

Content Hashing

Adding a content hash to filenames guarantees a changed bundle gets a new URL, so caches and hosts never serve a stale or mismatched file by accident.

/cart/remoteEntry.7f3a9c.js

A Version Manifest

A small manifest maps each remote name to the URL currently in production. The host reads it to discover which remote version to load.

{
  "cart": "/cart/2.4.2/remoteEntry.js",
  "search": "/search/1.9.0/remoteEntry.js"
}

Deploying = Updating the Manifest

Because artifacts are immutable, a deployment is just pointing the manifest to a new version. This makes promotion and rollback a single, fast change.

Instant Rollback

To roll back, point the manifest entry back to the previous version. Since the old artifact still exists, the rollback is immediate and risk-free.

// rollback cart
"cart": "/cart/2.4.1/remoteEntry.js"

Canary Releases per Remote

Serve a new remote version to a small percentage of users via the manifest, watch metrics, then ramp to 100% — or roll back instantly if errors spike.

Semantic Versioning of Remotes

Use semver for remotes and especially for shared contracts. A major bump signals a breaking interface change that consumers must coordinate around.

Coordinating Shared Dependencies

Rolling back one remote while others advanced can create shared-dependency mismatches. Keep shared library versions within compatible ranges so any single rollback stays safe.

Automating Rollback in CI/CD

Wire health checks into the pipeline so a failed post-deploy check automatically reverts the manifest, turning rollback into a hands-off safety net.

if ! healthcheck cart; then
  promote cart 2.4.1 # auto rollback
fi

Auditing Versions

Log every manifest change with who, what, and when. This audit trail is invaluable when diagnosing which deploy introduced a regression.

Quick Check

Test your versioning and rollback knowledge.

Recap

You learned versioning and rollback:

  • Use immutable, content-hashed artifacts
  • A manifest maps remotes to current versions
  • Deploy and rollback by changing the manifest
  • Canary per remote and use semver for contracts
  • Automate rollback on failed health checks

Disciplined versioning makes independent deploys safe.

เริ่มต้นได้ฟรี

เรียนรู้ JavaScript ด้วย AI tutor — ฟรี

เขียนและเรียกใช้โค้ดจริงในเบราว์เซอร์ของคุณ รับความช่วยเหลือทันทีจาก AI tutor 24/7 และเรียนรู้ต่อจากที่คุณหยุดบนเว็บหรือในแอป

คอร์ส
12
บทเรียน
48

คำถามที่พบบ่อย

บทเรียน “กลยุทธ์การกำหนดเวอร์ชันและย้อนกลับ” ฟรีหรือไม่

ใช่ — ข้อความเต็มของ “กลยุทธ์การกำหนดเวอร์ชันและย้อนกลับ” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส Micro Frontends Architecture with Module Federation ให้อัปเกรดเป็น CoddyKit PRO คอร์ส Micro Frontends Architecture with Module Federation มีบทเรียนทั้งหมด 4 บทเรียน

คุณจะเรียนรู้อะไรในบทเรียน “กลยุทธ์การกำหนดเวอร์ชันและย้อนกลับ”

เรียนรู้การกำหนดเวอร์ชันให้แอประยะไกลแบบรวมอย่างปลอดภัย และย้อนกลับไมโครฟรอนต์เอนด์เพียงตัวเดียวได้ทันทีเมื่อการนำไปใช้งานเกิดปัญหา คุณปฏิบัติ Micro Frontends Architecture with Module Federation ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน

คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน Micro Frontends Architecture with Module Federation หรือไม่

ไม่จำเป็นต้องมีประสบการณ์มาก่อน Micro Frontends Architecture with Module Federation บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 4 จากทั้งหมด 4 บทเรียน

บทเรียน “กลยุทธ์การกำหนดเวอร์ชันและย้อนกลับ” ใช้เวลานานแค่ไหน

บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย

ฉันเขียนและรันโค้ดในบทเรียน Micro Frontends Architecture with Module Federation นี้ได้ไหม

ได้ บทเรียน Micro Frontends Architecture with Module Federation ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ

บทเรียนทั้งหมดในหลักสูตรนี้

  1. ไปป์ไลน์การติดตั้งใช้งานอย่างอิสระ
  2. การสร้างและการเผยแพร่อัตโนมัติ
  3. การโฮสต์และการปรับขนาดแอปแบบสหพันธ์
  4. กลยุทธ์การกำหนดเวอร์ชันและย้อนกลับ
← กลับไปที่ Micro Frontends Architecture with Module Federation