Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

feat(externals): add flag to not throw if externals semver have mismatch #591

Merged
merged 3 commits into from
Oct 23, 2021

Conversation

Matthew-Mallimo
Copy link
Member

Description

Adds a new flag, DANGEROUSLY_ACCEPT_BREAKING_EXTERNALS, that when set true, will log a warning instead of throwing an error whenever a mismatch in version for externals is detected.

Motivation and Context

When upgrading versions of providedExternals set by your route module, it can be frustrating because one-app will fail to start up because it throws an error when mismatching external versions are found. If the app is already running, module map polling will fail.

The DANGEROUSLY_ACCEPT_BREAKING_EXTERNALS flag will prevent this from happening by logging a warning instead of throwing an error.

This is a dangerous flag to set because mismatching versions can cause unexpected behaviors for modules, and should only be used during a transition of external versions.

How Has This Been Tested?

unit tested

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (adding or updating documentation)
  • Dependency update
  • Security update

Checklist:

  • My change requires a change to the documentation and I have updated the documentation accordingly.
  • These changes should be applied to a maintenance branch.
  • This change requires cross browser checks.
  • Performance tests should be ran against the server prior to merging.
  • This change impacts caching for client browsers.
  • This change impacts HTTP headers.
  • This change adds additional environment variable requirements for One App users.
  • I have added the Apache 2.0 license header to any new files created.

What is the Impact to Developers Using One App?

@github-actions
Copy link
Contributor

github-actions bot commented Oct 1, 2021

📊 Bundle Size Report

file name size on disk gzip
app.js 311.5KB 91.4KB
runtime.js 15.6KB 5.5KB
vendors.js 129.1KB 40KB
app~vendors.js 421.5KB 109.7KB
service-worker-client.js 17.1KB 5.3KB
legacy/app.js 332.6KB 96.8KB
legacy/runtime.js 15.6KB 5.5KB
legacy/vendors.js 189.3KB 51.7KB
legacy/app~vendors.js 444.6KB 115.5KB
legacy/service-worker-client.js 17.6KB 5.5KB

Generated by 🚫 dangerJS against 8c0acbc

@10xLaCroixDrinker
Copy link
Member

How Has This Been Tested?

unit tested

This requires more than unit tests. What scenarios have you run in a development environment?

@Matthew-Mallimo
Copy link
Member Author

How Has This Been Tested?

unit tested

This requires more than unit tests. What scenarios have you run in a development environment?

I have also run this locally. Tested:

  • Starting one-app with externals semver mismatch - Flag off - Fails to start
  • Starting one-app with externals semver mismatch - Flag on - Starts up with no issues
  • Deploying a module with semver mismatch while one-app is running - Flag off - module map polling fails
  • Deploying a module with semver mismatch while one-app is running - Flag on - Module map continues to poll successfully while logging the warning to the console.

Co-authored-by: Jonny Adshead <JAdshead@users.noreply.github.com>
@10xLaCroixDrinker 10xLaCroixDrinker merged commit 232d83e into main Oct 23, 2021
@10xLaCroixDrinker 10xLaCroixDrinker deleted the feat/semverExternalsWarning branch October 23, 2021 02:08
@Matthew-Mallimo Matthew-Mallimo changed the title feat(externals): added flag to not throw if externals versions have a mismatch feat(externals): add flag to not throw if externals semver have mismatch Oct 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants