Repository navigation
fix(deps): update dependency @frontify/app-bridge to v4 - #232
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR body was truncated due to platform limits.
This PR contains the following updates:
^3.11.0→^4.0.0Release Notes
Frontify/brand-sdk (@frontify/app-bridge)
v4.0.0Major Changes
#1819
e3daa30Thanks @ragi96! - refactor(EmitterEvents): remove theAppBridge:BlockAssetsUpdatedandAppBridge:ViewerOpenedeventsRead the block assets from
appBridge.context('assets')instead, or use theuseBlockAssetshook to re-render when they change.#1819
e3daa30Thanks @ragi96! - refactor(useReadyForPrint): remove theuseReadyForPrinthookIt had no effect: printing a guideline didn't wait for the readiness it reported. There is no replacement, remove the hook from your block.
#1819
e3daa30Thanks @ragi96! - feat(useAssetUpload): upload through the hostuseAssetUploadnow uploads throughappBridge.api(createAssets(...)). It no longer calls Frontify's upload endpoints itself, so later backend changes won't break built blocks. It takes the app bridge as its first argument, like the other hooks:The callbacks,
resultsanddoneAllkeep their shape. An upload still in progress is cancelled when the component unmounts.#1819
e3daa30Thanks @ragi96! - refactor: export the testing utilities only from@frontify/app-bridge/testinggetAppBridgeBlockStub,withAppBridgeBlockStubsand the*Dummyfixtures are no longer exported from@frontify/app-bridge. Importing anything from the main entry no longer pullssinoninto your production bundle.#1819
e3daa30Thanks @ragi96! - perf: stop enabling Immer'sMapSetplugin on import@frontify/app-bridgeno longer depends onimmerand no longer callsenableMapSet()when it's imported. Blocks that don't use Immer themselves no longer ship it, which saves about 11 KB minified.If your code uses Immer with
MaporSet, enable the plugin yourself:#1819
e3daa30Thanks @ragi96! - refactor: remove thedownloadColorKitmethodAppBridgeBlock.downloadColorKitand thedownloadColorKitvalue returned from theuseColorPaletteshook have been removed.#1819
e3daa30Thanks @ragi96! - refactor(useAssetUpload): report the upload payloads instead ofMessageEventsThe hook used to imitate the upload worker it replaced: it wrapped every callback payload in a
MessageEvent, andonUploadDonereported a snake_casefile_id/file_name/generic_urlobject instead of the asset. The callbacks now receive the payloads of thecreateAssetsAPI method directly.onUploadProgressCreateAssetsFileProgress—{ file, index, loaded, total }onUploadProgressAllCreateAssetsProgress—{ loaded, total }onUploadDoneCreateAssetsFileSuccess—{ file, index, asset }onUploadAssetFailCreateAssetsFileFailure—{ file, index, message }onUploadDoneAllandonUploadFailare unchanged. Read the payload directly where you used to reach forevent.data:#1819
e3daa30Thanks @ragi96! - refactor(EmitterEvents): remove theAppBridge:OpenNavigationManagereventNothing emits or listens to this event. Code that still references it can drop the reference, since the event never fires.
#1819
e3daa30Thanks @ragi96! - refactor(EmitterEvents): remove theAppBridge:BlockSettingsUpdatedeventThe event, its
BlockSettingsUpdateEventtype and theblockSettingsdeclaration onWindoware removed. Read the block settings fromappBridge.context('settings')instead, or use theuseBlockSettingshook to re-render when they change.getAppBridgeBlockStubno longer writeswindow.blockSettings, and itsgetBlockSettings()now resolves the stubbed block's settings.#1819
e3daa30Thanks @ragi96! - refactor(HttpClient): removeHttpClientandHttpClientErrorBlocks shouldn't call Frontify endpoints themselves: use
appBridge.api(...)instead. TheHttpUtilResponsetype and theHttpUtilResponseDummytest helper are removed as well.#1819
e3daa30Thanks @ragi96! - refactor: remove the color palette APIuseColorPalettes,AppBridgeBlock.getColorPalettesWithColors, theColor,ColorAsset,ColorRevisionandColorPalettetypes, and theColorDummyandColorPaletteDummytest dummies from@frontify/app-bridge/testingare gone. Let users pick colors through the host color chooser instead:In a block's settings flyout, the
ColorChoosercomponent from@frontify/guideline-blocks-settingsdoes this for you.#1819
e3daa30Thanks @ragi96! - refactor(EmitterEvents): remove theAppBridge:PrivacySettingsChangedeventRead the privacy settings from
appBridge.context('privacySettings')instead, or use theusePrivacySettingshook to re-render when they change.#1819
e3daa30Thanks @ragi96! - feat: modifyDocumentSectionandDocumentSectionApitype to allowtitleto benull.#1819
e3daa30Thanks @ragi96! - refactor: remove deprecated document methods and types fromAppBridgeBlockRemoved the
getAllDocuments,getDocumentPagesByDocumentId, andgetDocumentSectionsByDocumentPageIdmethods, along with the now-unusedDocument,DocumentPage,DocumentSection, andTargetstypes and their test dummies (TargetsDummy,TargetsApiDummy,DocumentSectionDummy,DocumentSectionApiDummy). There is no replacement — Link Chooser is being in-sourced and will be opened via a command instead.#1819
e3daa30Thanks @ragi96! - refactor: removeDocumentApiDummyandDocumentDummytesting utils, cleanup types inDocument.ts, removegetDocumentsByDocumentGroupIdfrom AppBridgeBlock#1819
e3daa30Thanks @ragi96! - chore: require Node 22 or newerengines.nodewas still>=18. Node 18 and 20 have both reached end of life, so the package now declares>=22, matching@frontify/frontify-cli.The README also gains a worked block example, a testing example, and a note on what moved between 3.x and 4.
#1819
e3daa30Thanks @ragi96! - refactor: removeuseDocumentTargetsanduseDocumentCategories#1819
e3daa30Thanks @ragi96! - refactor(useFileUpload): remove the hookUse
useAssetUploadinstead. The@frontify/app-bridge/upload-workerexport is removed as well.#1819
e3daa30Thanks @ragi96! - refactor(AppBridgeBlock): removegetProjectIdandgetTranslationLanguageRead the project id and the translation language from the block context instead:
getAppBridgeBlockStubno longer takes alanguageoption. PasstranslationLanguageinstead.#1819
e3daa30Thanks @ragi96! - refactor: remove thewindow.applicationtypeapp-bridge no longer reads
window.application, so it no longer declares it onWindow.#1819
e3daa30Thanks @ragi96! - feat: first alpha release, removes all deprecated functions on the AppBridgeBlock#1819
e3daa30Thanks @ragi96! - fix: publish complete type declarationsThe published types used a
Nullabletype that the package didn't ship. Fields such asAsset.alternativeTextandColor.revision.hexwere typedanyin your project, or failed to compile withoutskipLibCheck. They now have their real types, such asstring | null, so code that relied onanymay need anullcheck.Projects with
"moduleResolution": "node16"or"nodenext"can now resolve the types. Before, every named import from@frontify/app-bridgefailed to compile there.#1819
e3daa30Thanks @ragi96! - refactor: removecreateColorPalette,updateColorPalette,deleteColorPaletteand adjustuseColorPalettereact hook#1819
e3daa30Thanks @ragi96! - chore(deps): makesinonan optional peer dependencynpm and pnpm no longer install
sinonalongside@frontify/app-bridge, and Yarn no longer warns when it's missing. Only@frontify/app-bridge/testingneeds it.If you import from
@frontify/app-bridge/testing, addsinonto your own dev dependencies:#1819
e3daa30Thanks @ragi96! - refactor: remove the unused types, hooks and test dummiesNothing in the package, in Frontify, or in the guideline blocks referenced these, and they have no replacement:
useAfterInsertionhook.DispatchPayloadandDispatchHandlertypes, a stale copy of the command registry, and theSubscriptionandSubscriptionCallbacktypes, a stale copy of the event registry.TerrificComponent,AssetChooserAssetChosenCallbackandTemplateChooserTemplateChosenCallbacktypes.UseFileInputInterfaceandUseFileInputReturnTypestypes.useFileInputitself is unchanged.compareObjectshelper, andisObject, which is now internal.AssetChooserOptionsDummyandAssetChooserResultDummydummies from@frontify/app-bridge/testing.#1819
e3daa30Thanks @ragi96! - refactor: remove deprecatedupdateColor,createColor, anddeleteColormethods from the AppBridge, theuseColorshook, and related testsMinor Changes
#1819
e3daa30Thanks @ragi96! - refactor: remove react hooks and related eventsuseCategorizedDocumentPagesuseDocumentPageTargetsuseUncategorizedDocumentPages#1819
e3daa30Thanks @ragi96! - feat(BlockContext): addprojectIdandtranslationLanguageThe block context now declares the guideline's
projectIdand thetranslationLanguagethe page is translated into (an empty string when it isn't a translation).getAppBridgeBlockStubanswers both from itsprojectIdandtranslationLanguageoptions:#1819
e3daa30Thanks @ragi96! - feat(AppBridgeBlock): add thecreateAssetsAPI methodBlocks can upload files through the host and get the created assets back. Nothing calls it yet:
useAssetUploadwill switch to it in a later release.getAppBridgeBlockStubanswerscreateAssetswith oneAssetDummyper file and callsonProgress,onFileProgressandonFileDonefor each file.#1819
e3daa30Thanks @ragi96! - feat: add thecreateAssetBulkDownloadAPI methodIt prepares an archive with the given assets and resolves with its download URL once the archive is ready. It rejects when preparing the archive fails or when the signal is aborted.
getAppBridgeBlockStubresolves it with a dummy URL.#1819
e3daa30Thanks @ragi96! - refactor: remove color related methods:getColors,getColorPalettesWithColors,getColorPalettes,getColorsByColorPaletteIdand react hooks:useColors,useColorPalettes#1819
e3daa30Thanks @ragi96! - feat: addtrackEventcommandUse the
trackEventcommand to log custom events within blocks.The event accepts
TrackActionsand an optional payload.If you need more actions, please reach out through the Frontify Friends Slack channel.
Example usage:
#1819
e3daa30Thanks @ragi96! - feat: addopenColorChooser/closeColorChooserblock commands to render the host color chooser into an element#1819
e3daa30Thanks @ragi96! - feat(BlockContext): addprivacySettingsThe block context now declares the guideline's
privacySettings, andgetAppBridgeBlockStubanswerscontext('privacySettings')from itsprivacySettingsoption:#1819
e3daa30Thanks @ragi96! - feat(BlockContext): addtemplatesThe block context now declares the block's
templates.getAppBridgeBlockStubanswerscontext('templates')from itsblockTemplatesoption and updates it whenaddTemplateIdsToBlockTemplateKey()ordeleteTemplateIdsFromBlockTemplateKey()is called:#1819
e3daa30Thanks @ragi96! - refactor(useBlockAssets): source state fromContext.assetsThe hook now seeds and updates
blockAssetsfromappBridge.context('assets')and no longer fetches viagetBlockAssets()on mount. It also no longer listens to or emitsAppBridge:BlockAssetsUpdated; mutation helpers (addAssetIdsToKey,deleteAssetIdsFromKey,updateAssetIdsFromKey) just call the AppBridge API, and the host is responsible for refreshingcontext('assets')after each mutation.#1819
e3daa30Thanks @ragi96! - refactor: remove already deprecated methodgetDocumentCategoriesByDocumentId#1819
e3daa30Thanks @ragi96! - refactor: remove already deprecatedgetColorsByIds#1819
e3daa30Thanks @ragi96! - refactor: removeuseDocumentGroups,useGroupedDocumentsanduseUngroupedDocumentshook and also remove theDocumentGroupApitype#1819
e3daa30Thanks @ragi96! - feat(usePrivacySettings): read the privacy settings from the host contextusePrivacySettingsnow readsappBridge.context('privacySettings')and re-renders when the host updates it, instead of listening to theAppBridge:PrivacySettingsChangedevent onwindow.emitter. Hosts must provideprivacySettingsin the block context.#1819
e3daa30Thanks @ragi96! - feat: addopenLinkChooser/closeLinkChooserblock commands to open the in-sourced link chooserAdds a
linkChosenevent and auseLinkChooserhook.#1819
e3daa30Thanks @ragi96! - feat: add open/close search dialog commands to AppBridgeTheme#1819
e3daa30Thanks @ragi96! - refactor: remove already deprecated methodgetDocumentGroups#1819
e3daa30Thanks @ragi96! - refactor: remove already deprecated methodgetDocumentPagesByDocumentCategoryId#1819
e3daa30Thanks @ragi96! - feat: addopenPlatformAppDirectblock command to open a marketplace platform app directly#1819
e3daa30Thanks @ragi96! - feat(Asset): added the property alternativeText#1819
e3daa30Thanks @ragi96! - feat: addopenBrandCheckercommandA content block can dispatch
openBrandCheckerto open the Brand Check dialog on a guideline page. The payload usesOpenBrandCheckerPayload({ tab: BrandCheckerTab }).tabis required.#1819
e3daa30Thanks @ragi96! - feat(useEditorState): read the editor state from the host contextuseEditorStatenow readsappBridge.context('isEditing'), likeuseIsEditingin@frontify/app-bridge-theme, instead of every hook call observingdocument.bodyand querying the DOM on each class change. Hosts must provideisEditingin the block context.#1819
e3daa30Thanks @ragi96! - feat(AppBridgeBlockStub): let tests sendassetsChosen,templateChosenandlinkChosenthemselvesgetAppBridgeBlockStubhas a newemitChosenEventsOnSubscribeoption. It defaults totrue, which keeps today's behaviour: subscribing to one of these events immediately calls the callback with a dummy selection. Set it tofalseto send the events when your test needs them, with the newemitAppBridgeBlockStubEvent(appBridge, eventName, payload).Events only reach callbacks that are still subscribed, because each subscription now gets its own unsubscribe function. The
unsubscribeoption is still called whenever a subscription ends.#1819
e3daa30Thanks @ragi96! - feat: add backuseColorPalettesreact hook#1819
e3daa30Thanks @ragi96! - feat(AppBridgeBlock): addisAuthenticatedtoBlockContexttype#1819
e3daa30Thanks @ragi96! - feat(AppBridge): expose block assets viaBlockContextassetstoBlockContext, available synchronously viaappBridge.context('assets').get().useBlockAssetsnow seeds its initial state from the context instead of fetching viagetBlockAssets()on mount, so assets are available on the first render.#1819
e3daa30Thanks @ragi96! - chore(DocumentTargets): remove already deprecatedgetDocumentTargetsandgetDocumentPageTargets#1819
e3daa30Thanks @ragi96! - feat(BlockContext): addsettingsThe block context now declares the block's
settings.getAppBridgeBlockStubanswerscontext('settings')from itsblockSettingsoption and mergesupdateBlockSettings()calls into it:#1819
e3daa30Thanks @ragi96! - feat(AppBridgeBlock): addscreationFormUrito the typetemplate#1819
e3daa30Thanks @ragi96! - chore(AppBridge): remove already deprecatedgetUncategorizedDocumentPagesByDocumentId#1819
e3daa30Thanks @ragi96! - feat(useBlockSettings): read the block settings from the host contextuseBlockSettingsnow readsappBridge.context('settings')and re-renders when the host updates it, instead of readingwindow.blockSettingsand listening to theAppBridge:BlockSettingsUpdatedevent onwindow.emitter. Hosts must providesettingsin the block context and update it afterupdateBlockSettings()saves.#1819
e3daa30Thanks @ragi96! - feat: add navigateToDocumentSection command to AppBridgeTheme#1819
e3daa30Thanks @ragi96! - refactor remove already deprecated methodgetUngroupedDocumentsPatch Changes
#1819
e3daa30Thanks @ragi96! - refactor: remove TemplatePageApi type#1819
e3daa30Thanks @ragi96! - feat(useBlockTemplates): read the block templates from the host contextuseBlockTemplatesnow readsappBridge.context('templates')and re-renders when the host updates it, instead of loading the templates withgetBlockTemplates()and listening to theAppBridge:BlockTemplatesUpdatedevent onwindow.emitter. EveryuseBlockTemplateson the same app bridge re-renders when the templates change. Hosts must providetemplatesin the block context and update it afteraddTemplateIdsToBlockTemplateKey()anddeleteTemplateIdsFromBlockTemplateKey()save.getBlockTemplates()is deprecated. Read the block templates from the block context instead, or use the hook to re-render when they change:With that, nothing in app-bridge uses
window.emitteranymore. TheAppBridge:BlockTemplatesUpdatedevent, theEmitterEventstype and theemitterdeclaration onWindoware removed,getAppBridgeBlockStubno longer setswindow.emitter, and app-bridge no longer depends onmitt.#1819
e3daa30Thanks @ragi96! - refactor: remove AppBridgeCreateAsset, please use@frontify/app-bridge-app#1819
e3daa30Thanks @ragi96! - feat(Asset): added the focal point properties#1819
e3daa30Thanks @ragi96! - refactor: removefilterDocumentSectionsWithUnreadableTitleshelper#1819
e3daa30Thanks @ragi96! - refactor(Asset): removecreatorNameandprojectTypeon theAsset#1819
e3daa30Thanks @ragi96! - chore: update dependencies#1819
e3daa30Thanks @ragi96! - refactor: removeGetBulkDownloadTokenApiandBulkDownloadApitypes#1819
e3daa30Thanks @ragi96! - chore: remove appBridgePlatformApp#1819
e3daa30Thanks @ragi96! - chore: merge main to dev#1819
e3daa30Thanks @ragi96! - build: stop shipping unused CommonJS filesThe package is ES modules only.
require()andimportresolve to the same files as before, and the.cjsfiles that no entry pointed to are gone.#1819
e3daa30Thanks @ragi96! - feat(AppBridgePlatformApp): only one app bridge per iframe#1819
e3daa30Thanks @ragi96! - fix: stopuseAssetChooseranduseTemplateChooserfrom leaking subscriptionsIf the chooser was dismissed without a selection and then opened again, choosing an asset or template ran your callback twice. Each open now replaces the previous subscription, and the hooks unsubscribe when the component unmounts.
openAssetChooser,closeAssetChooser,openTemplateChooserandcloseTemplateChoosernow also keep the same identity across renders.#1819
e3daa30Thanks @ragi96! - refactor(AppBridgeBlock): deprecategetPrivacySettingsRead the privacy settings from the block context instead, or use the
usePrivacySettingshook to re-render when they change:#1819
e3daa30Thanks @ragi96! - refactor: removeDocumentBlockTemplatetypes#1819
e3daa30Thanks @ragi96! - chore: rename brand sdk name#1819
e3daa30Thanks @ragi96! - fix: document page duplication return type#1819
e3daa30Thanks @ragi96! - chore: deprecate the bulk download token and polling methodsappBridge.getBulkDownloadByToken(),appBridge.getBulkDownloadBySignature()and thegetAssetBulkDownloadTokenAPI method are deprecated and will be removed in version 5.0.0. Use theuseAssetBulkDownloadhook, or thecreateAssetBulkDownloadAPI method, which resolves once the download is ready:#1819
e3daa30Thanks @ragi96! - perf: stop bundlinglodash-esand React's JSX runtime into the packageBlocks that don't use
convertObjectCaseno longer ship any lodash code, which saves about 12 KB minified per block.@frontify/app-bridge/testingnow uses your ownreact/jsx-runtimeinstead of a bundled copy.#1819
e3daa30Thanks @ragi96! - refactor: cleanup unused types in DocumentCategory#1819
e3daa30Thanks @ragi96! - feat: mergemainintodev#1819
e3daa30Thanks @ragi96! - feat: (AppBridgeTheme) update appBridgeThemeStub with context and state#1819
e3daa30Thanks @ragi96! - fix(getAppBridgeBlockStub): return the current assets fromcontext('assets').get()After
addAssetIdsToBlockAssetKeyordeleteAssetIdsFromBlockAssetKey,get()still returned the assets the stub was created with, while subscribers received the updated ones. A component that mounted after such a change started with stale assets.#1819
e3daa30Thanks @ragi96! - refactor: clean up target api related things#1819
e3daa30Thanks @ragi96! - chore: Merge main into dev#1819
e3daa30Thanks @ragi96! - chore: merge main to dev#1819
e3daa30Thanks @ragi96! - refactor(Emitter): remove unused typeEmitterAction#1819
e3daa30Thanks @ragi96! - chore: merge branchmaininto dev#1819
e3daa30Thanks @ragi96! - refactor: removegetDatasetByElementandgetDatasetByClassName#1819
e3daa30Thanks @ragi96! - feat: mergemainintodev#1819
e3daa30Thanks @ragi96! - feat: add documentId to GuidelineDocumentCategory events#1819
e3daa30Thanks @ragi96! - chore: update deps#1819
e3daa30Thanks @ragi96! - refactor: remove unusedTopictype#1819
e3daa30Thanks @ragi96! - feat: add context.template to AppBridgeTheme#1819
e3daa30Thanks @ragi96! - refactor: removeDocumentPageRequest,DocumentPageCreate,DocumentPageUpdateandDocumentPageDeletetypes#1819
e3daa30Thanks @ragi96! - Merge main into dev#1819
e3daa30Thanks @ragi96! - feat: switch to platformAppBridge to v4#1819
e3daa30Thanks @ragi96! - feat: add user state variable#1819
e3daa30Thanks @ragi96! - refactor(AppBridgeBlock): deprecategetEditorStateRead the editor state from the block context instead, or use the
useEditorStatehook to re-render when it changes:#1819
e3daa30Thanks @ragi96! - chore: merge main into dev#1819
e3daa30Thanks @ragi96! - fix(useDocumentNavigation): Fixed an issue that prevented debounced callbacks not to be executedfix(usePortalNavigation): Fixed an issue that prevented debounced callbacks not
Configuration
📅 Schedule: (in timezone Europe/Zurich)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.