single-spa 是微前端技术的核心库,用于注册和发布应用
single-spa 是微前端技术的核心库,用于注册和发布应用Features
- Add option for exact matches in pathToActiveWhen. (#694) Documentation - single-spa/single-spa.js.org#388
Maintenance
Assets
2
joeldenning released this
Fixes
- Add type for custom event detail (#680 via @andygauntnervertex) 43d2ffd
- fix: error message (#678 via @CodeLittlePrince) bd31d08
Maintenance
- Update slack invitation link 7b787a5
Assets
2
joeldenning released this
Fixes
- Only fire artificial popstate events after start() is called. Resolves #655 (#657)
- Wait for mount to finish before attempting to unmount parcels. Resolves #656. (#660)
Maintenance
- Bump dot-prop from 4.2.0 to 4.2.1 (#653)
Assets
2
joeldenning released this
Fixes
- Fix bug where
evt.target
for artificial popstate events wasnull
instead ofwindow
. See (#651)
Assets
2
Features
unregisterApplication('app-name').then(() => {
console.log('The application is unmounted, unloaded, and no longer registered!');
})
Maintenance
- feat: add file size reporter workflow to PR flow (#622 via @tiagostutz)
Assets
2
joeldenning released this
Features
- Add support for canceling navigation events (#641)
- Add additional properties to single-spa routing events:
oldUrl
,newUrl
, andnavigationIsCanceled
(#641)
window.addEventListener('single-spa:before-routing-event', evt => {
console.log(evt.detail.oldUrl);
console.log(evt.detail.newUrl);
console.log(evt.detail.navigationIsCanceled);
evt.detail.cancelNavigation();
})
Assets
2
Fixes
Assets
2
Features
Maintenance
Assets
2
joeldenning released this
Fixes
- Fixed
pathToActiveWhen
so that pathname matching allows for arbitrary hashnames after the prefix (@pkhodaveissi #600)
Assets
2
Assets
2
Fixes
- Small ie11 fixes, and adding lint safe guards for ie11 (#559 via @Sauloxd)
- fix(activeWhen): activeWhen with string literal should be exact match (#565 via @kuitos)
import { registerApplication, checkActivityFunctions } from 'single-spa'
registerApplication({
name: "app1",
app: () => System.import('app1'),
activeWhen: '/app1'
})
// Both 5.5.1 and 5.5.2
checkActivityFunctions(new URL('http://localhost:8080/app1')) // ['app1']
checkActivityFunctions(new URL('http://localhost:8080/app1/sub')) // ['app1']
// With 5.5.1, single-spa did not require the location to have a slash after the prefix
checkActivityFunctions(new URL('http://localhost:8080/app1WithExtra')) // ['app1']
// Changed with 5.5.2 - single-spa now requires the location to have a slash after the prefix
checkActivityFunctions(new URL('http://localhost:8080/app1WithExtra')) // []
Maintenance
Assets
2
joeldenning released this
Fixes
- Change
includes
toindexOf
for IE11 support. (#558)
Assets
2
Features
- Allow calling checkActivityFunctions without location object as an argument. This is already in the documentation, but wasn't implemented (#544)
- New
single-spa:before-app-change
andsingle-spa:before-no-app-change
events. (#545 #547)
Fixes
- The CustomEvent.detail for
single-spa:before-routing-event
andsingle-spa:before-mount-routing-event
now shows the new statuses for apps, meaning the status that the app will be in after the routing event finishes. Previously the current, older status was being reported as the new status. (#547)
Performance
- Refactor: only call activity functions one time per reroute. This is better for performance because each URL reroute results in less work. (#546)
Maintenance
Assets
2
Features
- Support short-circuited, partial rerouting. This occurs when the URL changes in the middle of a single
reroute
(#529 via @arturovt) - Add extra properties to PopStateEvents that originate within single-spa - Documentation (#532 via @jamesopti)
- Custom props provided to applications may now be passed in as a function that returns an object - Documentation (#533 via @joeldenning)
- Add new
single-spa:before-mount-routing-event
fired to the window - Documentation (#534 via @joeldenning) - New API
pathToActiveWhen
is exposed as a single-spa export - Documentation (#535 via @joeldenning)
Fixes
- Fix strict mode error where functions were declared inside of
if
statement. Fixes IE10 issues (#537 via @bloody-ux)
Assets
2
Fixes
- Fix bug in navigateToUrl with URL query comparison #519 (@DuLinRain)
Assets
2
Fixes
- The UMD and System.register builds of single-spa now run in strict mode (#507 via @frehner)
- Fix types for parcels (#510 via @kuitos)
- Add extra information to
single-spa:app-change
event (#508 via @joeldenning) (see below)
window.addEventListener('single-spa:app-change', evt => {
console.log(evt.newAppStatuses) // { app1: MOUNTED, app2: NOT_MOUNTED }
console.log(evt.appsByNewStatus) // { MOUNTED: ['app1'], NOT_MOUNTED: ['app2'] }
console.log(evt.totalAppChanges) // 2
})
Assets
2
joeldenning released this
Fixes
- Fix duplicate error codes for single-spa error documentation (#499 via @Sauloxd)
- Typescript: now exporting
StartOpts
type (#501 via @kuitos) - Typescript: allow for each lifecycle to be either an array or function (#502 via @kuitos)
- Typescript: correct problem with mountParcel and mountRootParcel typings (#500 via @kuitos)
Assets
2
joeldenning released this
Fixes
- Updated typescript definitions for
start(opts)
(#493 @krzyswiatkowski)
Assets
2
Features
Maintenance
Assets
2
Motivation
single-spa@5 is focused on performance and developer experience. The bundle size for single-spa has gone down from ~25kb to ~15kb ungzipped (6kb to 5kb gzipped). We have created new error pages which give in-depth information about console errors, and link to those pages in both development and production builds. We now publish single-spa.dev.js files for easier debugging of single-spa itself. And we have removed all of our deprecated APIs (that have been deprecated and not documented for about two years).
Migration path
99% of single-spa users can simply upgrade to single-spa@5.0.0 without any changes to their code and everything will work exactly as it was before. You'll just benefit from a smaller bundle size and better DX for errors. See the breaking changes below for the few breaking changes that exist.
Breaking changes
- Removing the declareChildApplication and unloadChildApplication apis that have been deprecated for two years. You can use the registerApplication and unloadApplication apis instead. (#390).
- Removing err.name and err.appName from errors passed to single-spa error handlers (#404)
Features
- Switching to "error codes" to communicate what went wrong with single-spa applications. The error codes link to pages such as https://single-spa.js.org/error/?code=1 which give in-depth explanations of what is happening.
- Adding support for warningMillis timeout configuration. This lets you configure or turn off the "application's mount lifecycle did not resolve or reject in 1000 milliseconds" console warnings. (#389)
Fixes
- Fixing link to the new error code documentation pages (#406)
- Fixing error debugging info for parcel-related messages (#407)
- Fix bug where route listeners that throw errors caused other route listeners not to be called (#449)
Performance
- Reducing bundle size with babel/rollup changes (#392)
- Reducing bundle size by removing class syntax (#393)
- Reducing bundle size with various refactors (#396)
- Reducing bundle size by switching from object spread syntax to a manual object assign (#401)
Maintenance
Assets
2
joeldenning released this
Fixes
- Fixed typescript definitions for error handlers (#429 via @tannerlyons)
Assets
2
Features
Fixes
Maintenance
Assets
2
joeldenning released this
Fixes
- Switched applications in LOAD_ERROR status to retry loading after a period of time, instead of route change (#345)
Assets
2
Watchers:165 |
Star:8514 |
Fork:633 |
创建时间: 2015-09-22 14:34:46 |
最后Commits: 前天 |
许可协议:View license |
分类:其它杂项 / JavaScript开发 |
收录时间:2019-10-01 13:56:02 |
6e94bf5
Compare
Fixes
isStarted
from typescript definition, since it's not part of the public API (#717 #715)