diff --git "a/val_200.csv" "b/val_200.csv" new file mode 100644--- /dev/null +++ "b/val_200.csv" @@ -0,0 +1,87441 @@ +Repository Name,Git URL,SHA,Author,Commit Date,Description,Body,Full Commit Message,Git Diff +Hippy,https://github.com/Tencent/Hippy,63070b6d77e3b1c95c255b0e40bcfeef1e9243f7,luomy,2022-07-01 12:16:12,refactor(ios): rename compoents files from Hippy prefix to NativeRender prefix (#2165),"* refactor(ios): rename shadow to render object + +* refactor(ios): refactor uiview catagory class + +* refactor(ios): remove unused two uiview catagory class + +* refactor(ios): remove unused codes for legacy touch handler + +* refactor(ios): modify view export macro's name + +* refactor(ios): change hippyconvert macros to uppercase + +* refactor(ios): seperate native render defines from hippy defines + +* refactor(ios): refactor render log system + +* refactor(ios): rename render files from hippy to nativerender + +* refactor(ios): refactor setting measure function for text","refactor(ios): rename compoents files from Hippy prefix to NativeRender prefix (#2165) + +* refactor(ios): rename shadow to render object + +* refactor(ios): refactor uiview catagory class + +* refactor(ios): remove unused two uiview catagory class + +* refactor(ios): remove unused codes for legacy touch handler + +* refactor(ios): modify view export macro's name + +* refactor(ios): change hippyconvert macros to uppercase + +* refactor(ios): seperate native render defines from hippy defines + +* refactor(ios): refactor render log system + +* refactor(ios): rename render files from hippy to nativerender + +* refactor(ios): refactor setting measure function for text","diff --git a/driver/js/examples/ios-demo/HippyDemo.xcodeproj/project.pbxproj b/driver/js/examples/ios-demo/HippyDemo.xcodeproj/project.pbxproj +index 9a4a8d97312..f1dc581b8b8 100644 +--- a/driver/js/examples/ios-demo/HippyDemo.xcodeproj/project.pbxproj ++++ b/driver/js/examples/ios-demo/HippyDemo.xcodeproj/project.pbxproj +@@ -70,86 +70,86 @@ + F419C383274634E9003E242A /* taitank_layout_node.cc in Sources */ = {isa = PBXBuildFile; fileRef = F419C382274634E9003E242A /* taitank_layout_node.cc */; }; + F42EA79A277C354C007874A2 /* TurboConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = F42EA796277C354C007874A2 /* TurboConfig.m */; }; + F42EA79B277C354C007874A2 /* TurboBaseModule.mm in Sources */ = {isa = PBXBuildFile; fileRef = F42EA799277C354C007874A2 /* TurboBaseModule.mm */; }; +- F438B744281248010078435B /* HippyGradientObject.m in Sources */ = {isa = PBXBuildFile; fileRef = F438B73E281248010078435B /* HippyGradientObject.m */; }; ++ F438B744281248010078435B /* NativeRenderGradientObject.m in Sources */ = {isa = PBXBuildFile; fileRef = F438B73E281248010078435B /* NativeRenderGradientObject.m */; }; + F438B745281248010078435B /* OCTypeToDomArgument.mm in Sources */ = {isa = PBXBuildFile; fileRef = F438B73F281248010078435B /* OCTypeToDomArgument.mm */; }; +- F438B746281248010078435B /* HippyDomNodeUtils.mm in Sources */ = {isa = PBXBuildFile; fileRef = F438B741281248010078435B /* HippyDomNodeUtils.mm */; }; +- F438B74928124B200078435B /* HippyI18nUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = F438B74828124B200078435B /* HippyI18nUtils.m */; }; +- F438B754281250CD0078435B /* HippyConvert+Transform.m in Sources */ = {isa = PBXBuildFile; fileRef = F438B74C281250CD0078435B /* HippyConvert+Transform.m */; }; +- F438B755281250CD0078435B /* HippyUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = F438B74D281250CD0078435B /* HippyUtils.m */; }; +- F438B756281250CD0078435B /* HippyConvert.mm in Sources */ = {isa = PBXBuildFile; fileRef = F438B74F281250CD0078435B /* HippyConvert.mm */; }; +- F438B757281250CD0078435B /* HippyParserUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = F438B753281250CD0078435B /* HippyParserUtils.m */; }; +- F438B75A281283550078435B /* RenderErrorHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = F438B759281283550078435B /* RenderErrorHandler.m */; }; ++ F438B746281248010078435B /* NativeRenderDomNodeUtils.mm in Sources */ = {isa = PBXBuildFile; fileRef = F438B741281248010078435B /* NativeRenderDomNodeUtils.mm */; }; ++ F438B74928124B200078435B /* NativeRenderI18nUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = F438B74828124B200078435B /* NativeRenderI18nUtils.m */; }; ++ F438B754281250CD0078435B /* NativeRenderConvert+Transform.m in Sources */ = {isa = PBXBuildFile; fileRef = F438B74C281250CD0078435B /* NativeRenderConvert+Transform.m */; }; ++ F438B755281250CD0078435B /* NativeRenderUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = F438B74D281250CD0078435B /* NativeRenderUtils.m */; }; ++ F438B756281250CD0078435B /* NativeRenderConvert.mm in Sources */ = {isa = PBXBuildFile; fileRef = F438B74F281250CD0078435B /* NativeRenderConvert.mm */; }; ++ F438B757281250CD0078435B /* NativeRenderParserUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = F438B753281250CD0078435B /* NativeRenderParserUtils.m */; }; ++ F438B75A281283550078435B /* NativeRenderErrorHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = F438B759281283550078435B /* NativeRenderErrorHandler.m */; }; + F43A2D09275882650056F36C /* diff_utils.cc in Sources */ = {isa = PBXBuildFile; fileRef = F43A2D08275882650056F36C /* diff_utils.cc */; }; +- F45D265328067B6900CAB185 /* HippyScrollView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25AD28067B6900CAB185 /* HippyScrollView.mm */; }; +- F45D265428067B6900CAB185 /* HippyScrollViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25B028067B6900CAB185 /* HippyScrollViewManager.mm */; }; +- F45D265528067B6900CAB185 /* HippyRefreshWrapperItemView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25B328067B6900CAB185 /* HippyRefreshWrapperItemView.mm */; }; +- F45D265628067B6900CAB185 /* HippyRefreshWrapper.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25B428067B6900CAB185 /* HippyRefreshWrapper.mm */; }; +- F45D265728067B6900CAB185 /* HippyRefreshWrapperViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25B628067B6900CAB185 /* HippyRefreshWrapperViewManager.mm */; }; +- F45D265828067B6900CAB185 /* HippyRefreshWrapperItemViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25B928067B6900CAB185 /* HippyRefreshWrapperItemViewManager.mm */; }; +- F45D265928067B6900CAB185 /* HippyRefresh.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25BC28067B6900CAB185 /* HippyRefresh.mm */; }; +- F45D265A28067B6900CAB185 /* HippyViewPager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25C128067B6900CAB185 /* HippyViewPager.mm */; }; +- F45D265B28067B6900CAB185 /* HippyViewPagerManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25C228067B6900CAB185 /* HippyViewPagerManager.mm */; }; +- F45D265C28067B6900CAB185 /* HippyViewPagerItem.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25C328067B6900CAB185 /* HippyViewPagerItem.mm */; }; +- F45D265D28067B6900CAB185 /* HippyViewPagerItemManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25C528067B6900CAB185 /* HippyViewPagerItemManager.mm */; }; +- F45D265E28067B6900CAB185 /* HippyTextView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25C828067B6900CAB185 /* HippyTextView.mm */; }; +- F45D265F28067B6900CAB185 /* HippyBaseTextInput.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25C928067B6900CAB185 /* HippyBaseTextInput.mm */; }; +- F45D266028067B6900CAB185 /* HippyTextViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25CA28067B6900CAB185 /* HippyTextViewManager.mm */; }; +- F45D266128067B6900CAB185 /* HippyShadowTextView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25CC28067B6900CAB185 /* HippyShadowTextView.mm */; }; +- F45D266228067B6900CAB185 /* HippyTextField.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25D128067B6900CAB185 /* HippyTextField.mm */; }; +- F45D266328067B6900CAB185 /* HippyTextSelection.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D25D228067B6900CAB185 /* HippyTextSelection.m */; }; +- F45D266428067B6900CAB185 /* HippySimpleWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D25D628067B6900CAB185 /* HippySimpleWebView.m */; }; +- F45D266528067B6900CAB185 /* HippySimpleWebViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25D728067B6900CAB185 /* HippySimpleWebViewManager.mm */; }; +- F45D266628067B6900CAB185 /* HippyHeaderRefreshManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25D928067B6900CAB185 /* HippyHeaderRefreshManager.mm */; }; +- F45D266728067B6900CAB185 /* HippyHeaderRefresh.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25DB28067B6900CAB185 /* HippyHeaderRefresh.mm */; }; +- F45D266828067B6900CAB185 /* HippyWaterfallView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25DE28067B6900CAB185 /* HippyWaterfallView.mm */; }; +- F45D266928067B6900CAB185 /* HippyWaterfallViewDataSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25E428067B6900CAB185 /* HippyWaterfallViewDataSource.mm */; }; +- F45D266A28067B6900CAB185 /* HippyWaterfallViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25E528067B6900CAB185 /* HippyWaterfallViewManager.mm */; }; +- F45D266B28067B6900CAB185 /* HippyWaterfallItemView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25E628067B6900CAB185 /* HippyWaterfallItemView.mm */; }; +- F45D266C28067B6900CAB185 /* HippyCollectionViewWaterfallLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D25E728067B6900CAB185 /* HippyCollectionViewWaterfallLayout.m */; }; +- F45D266D28067B6900CAB185 /* HippyWaterfallItemViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25E828067B6900CAB185 /* HippyWaterfallItemViewManager.mm */; }; +- F45D266E28067B6900CAB185 /* HippyImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D25EC28067B6900CAB185 /* HippyImageView.m */; }; +- F45D266F28067B6900CAB185 /* HippyAnimatedImage.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D25F028067B6900CAB185 /* HippyAnimatedImage.m */; }; +- F45D267028067B6900CAB185 /* HippyAnimatedImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D25F128067B6900CAB185 /* HippyAnimatedImageView.m */; }; +- F45D267128067B6900CAB185 /* HippyImageViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25F328067B6900CAB185 /* HippyImageViewManager.mm */; }; +- F45D267228067B6900CAB185 /* HippyImageView+HippyTouchesImplementation.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25F428067B6900CAB185 /* HippyImageView+HippyTouchesImplementation.mm */; }; +- F45D267328067B6900CAB185 /* HippyImageCache.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D25F628067B6900CAB185 /* HippyImageCache.m */; }; +- F45D267428067B6900CAB185 /* HippyBaseListItemShadowView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25F928067B6900CAB185 /* HippyBaseListItemShadowView.mm */; }; +- F45D267528067B6900CAB185 /* HippyBaseListView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25FA28067B6900CAB185 /* HippyBaseListView.mm */; }; +- F45D267628067B6900CAB185 /* HippyBaseListViewCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25FC28067B6900CAB185 /* HippyBaseListViewCell.mm */; }; +- F45D267728067B6900CAB185 /* HippyBaseListItemView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25FF28067B6900CAB185 /* HippyBaseListItemView.mm */; }; +- F45D267828067B6900CAB185 /* HippyBaseListViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D260028067B6900CAB185 /* HippyBaseListViewManager.mm */; }; +- F45D267928067B6900CAB185 /* HippyBaseListItemViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D260128067B6900CAB185 /* HippyBaseListItemViewManager.mm */; }; +- F45D267A28067B6900CAB185 /* HippyCollectionViewFlowLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D260628067B6900CAB185 /* HippyCollectionViewFlowLayout.m */; }; +- F45D267B28067B6900CAB185 /* HippyListTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D260728067B6900CAB185 /* HippyListTableView.m */; }; +- F45D267C28067B6900CAB185 /* HippyBaseListViewDataSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D260928067B6900CAB185 /* HippyBaseListViewDataSource.mm */; }; +- F45D267D28067B6900CAB185 /* UIView+AppearEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D260B28067B6900CAB185 /* UIView+AppearEvent.m */; }; +- F45D267F28067B6900CAB185 /* UIView+Hippy.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D260E28067B6900CAB185 /* UIView+Hippy.mm */; }; +- F45D268028067B6900CAB185 /* HippyViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D261128067B6900CAB185 /* HippyViewManager.mm */; }; ++ F45D265328067B6900CAB185 /* NativeRenderScrollView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25AD28067B6900CAB185 /* NativeRenderScrollView.mm */; }; ++ F45D265428067B6900CAB185 /* NativeRenderScrollViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25B028067B6900CAB185 /* NativeRenderScrollViewManager.mm */; }; ++ F45D265528067B6900CAB185 /* NativeRenderRefreshWrapperItemView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25B328067B6900CAB185 /* NativeRenderRefreshWrapperItemView.mm */; }; ++ F45D265628067B6900CAB185 /* NativeRenderRefreshWrapper.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25B428067B6900CAB185 /* NativeRenderRefreshWrapper.mm */; }; ++ F45D265728067B6900CAB185 /* NativeRenderRefreshWrapperViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25B628067B6900CAB185 /* NativeRenderRefreshWrapperViewManager.mm */; }; ++ F45D265828067B6900CAB185 /* NativeRenderRefreshWrapperItemViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25B928067B6900CAB185 /* NativeRenderRefreshWrapperItemViewManager.mm */; }; ++ F45D265928067B6900CAB185 /* NativeRenderRefresh.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25BC28067B6900CAB185 /* NativeRenderRefresh.mm */; }; ++ F45D265A28067B6900CAB185 /* NativeRenderViewPager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25C128067B6900CAB185 /* NativeRenderViewPager.mm */; }; ++ F45D265B28067B6900CAB185 /* NativeRenderViewPagerManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25C228067B6900CAB185 /* NativeRenderViewPagerManager.mm */; }; ++ F45D265C28067B6900CAB185 /* NativeRenderViewPagerItem.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25C328067B6900CAB185 /* NativeRenderViewPagerItem.mm */; }; ++ F45D265D28067B6900CAB185 /* NativeRenderViewPagerItemManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25C528067B6900CAB185 /* NativeRenderViewPagerItemManager.mm */; }; ++ F45D265E28067B6900CAB185 /* NativeRenderTextView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25C828067B6900CAB185 /* NativeRenderTextView.mm */; }; ++ F45D265F28067B6900CAB185 /* NativeRenderBaseTextInput.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25C928067B6900CAB185 /* NativeRenderBaseTextInput.mm */; }; ++ F45D266028067B6900CAB185 /* NativeRenderTextViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25CA28067B6900CAB185 /* NativeRenderTextViewManager.mm */; }; ++ F45D266128067B6900CAB185 /* NativeRenderObjectTextView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25CC28067B6900CAB185 /* NativeRenderObjectTextView.mm */; }; ++ F45D266228067B6900CAB185 /* NativeRenderTextField.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25D128067B6900CAB185 /* NativeRenderTextField.mm */; }; ++ F45D266328067B6900CAB185 /* NativeRenderTextSelection.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D25D228067B6900CAB185 /* NativeRenderTextSelection.m */; }; ++ F45D266428067B6900CAB185 /* NativeRenderSimpleWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D25D628067B6900CAB185 /* NativeRenderSimpleWebView.m */; }; ++ F45D266528067B6900CAB185 /* NativeRenderSimpleWebViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25D728067B6900CAB185 /* NativeRenderSimpleWebViewManager.mm */; }; ++ F45D266628067B6900CAB185 /* NativeRenderHeaderRefreshManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25D928067B6900CAB185 /* NativeRenderHeaderRefreshManager.mm */; }; ++ F45D266728067B6900CAB185 /* NativeRenderHeaderRefresh.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25DB28067B6900CAB185 /* NativeRenderHeaderRefresh.mm */; }; ++ F45D266828067B6900CAB185 /* NativeRenderWaterfallView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25DE28067B6900CAB185 /* NativeRenderWaterfallView.mm */; }; ++ F45D266928067B6900CAB185 /* NativeRenderWaterfallViewDataSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25E428067B6900CAB185 /* NativeRenderWaterfallViewDataSource.mm */; }; ++ F45D266A28067B6900CAB185 /* NativeRenderWaterfallViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25E528067B6900CAB185 /* NativeRenderWaterfallViewManager.mm */; }; ++ F45D266B28067B6900CAB185 /* NativeRenderWaterfallItemView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25E628067B6900CAB185 /* NativeRenderWaterfallItemView.mm */; }; ++ F45D266C28067B6900CAB185 /* NativeRenderCollectionViewWaterfallLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D25E728067B6900CAB185 /* NativeRenderCollectionViewWaterfallLayout.m */; }; ++ F45D266D28067B6900CAB185 /* NativeRenderWaterfallItemViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25E828067B6900CAB185 /* NativeRenderWaterfallItemViewManager.mm */; }; ++ F45D266E28067B6900CAB185 /* NativeRenderImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D25EC28067B6900CAB185 /* NativeRenderImageView.m */; }; ++ F45D266F28067B6900CAB185 /* NativeRenderAnimatedImage.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D25F028067B6900CAB185 /* NativeRenderAnimatedImage.m */; }; ++ F45D267028067B6900CAB185 /* NativeRenderAnimatedImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D25F128067B6900CAB185 /* NativeRenderAnimatedImageView.m */; }; ++ F45D267128067B6900CAB185 /* NativeRenderImageViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25F328067B6900CAB185 /* NativeRenderImageViewManager.mm */; }; ++ F45D267228067B6900CAB185 /* NativeRenderImageView+NativeRenderTouchesImplementation.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25F428067B6900CAB185 /* NativeRenderImageView+NativeRenderTouchesImplementation.mm */; }; ++ F45D267328067B6900CAB185 /* NativeRenderImageCache.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D25F628067B6900CAB185 /* NativeRenderImageCache.m */; }; ++ F45D267428067B6900CAB185 /* NativeRenderObjectBaseListItem.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25F928067B6900CAB185 /* NativeRenderObjectBaseListItem.mm */; }; ++ F45D267528067B6900CAB185 /* NativeRenderBaseListView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25FA28067B6900CAB185 /* NativeRenderBaseListView.mm */; }; ++ F45D267628067B6900CAB185 /* NativeRenderBaseListViewCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25FC28067B6900CAB185 /* NativeRenderBaseListViewCell.mm */; }; ++ F45D267728067B6900CAB185 /* NativeRenderBaseListItemView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D25FF28067B6900CAB185 /* NativeRenderBaseListItemView.mm */; }; ++ F45D267828067B6900CAB185 /* NativeRenderBaseListViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D260028067B6900CAB185 /* NativeRenderBaseListViewManager.mm */; }; ++ F45D267928067B6900CAB185 /* NativeRenderBaseListItemViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D260128067B6900CAB185 /* NativeRenderBaseListItemViewManager.mm */; }; ++ F45D267A28067B6900CAB185 /* NativeRenderCollectionViewFlowLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D260628067B6900CAB185 /* NativeRenderCollectionViewFlowLayout.m */; }; ++ F45D267B28067B6900CAB185 /* NativeRenderListTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D260728067B6900CAB185 /* NativeRenderListTableView.m */; }; ++ F45D267C28067B6900CAB185 /* NativeRenderBaseListViewDataSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D260928067B6900CAB185 /* NativeRenderBaseListViewDataSource.mm */; }; ++ F45D267D28067B6900CAB185 /* UIView+MountEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D260B28067B6900CAB185 /* UIView+MountEvent.m */; }; ++ F45D267F28067B6900CAB185 /* UIView+NativeRender.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D260E28067B6900CAB185 /* UIView+NativeRender.mm */; }; ++ F45D268028067B6900CAB185 /* NativeRenderViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D261128067B6900CAB185 /* NativeRenderViewManager.mm */; }; + F45D268128067B6900CAB185 /* UIView+DirectionalLayout.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D261228067B6900CAB185 /* UIView+DirectionalLayout.mm */; }; +- F45D268228067B6900CAB185 /* HippyView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D261328067B6900CAB185 /* HippyView.mm */; }; +- F45D268428067B6900CAB185 /* HippyShadowView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D261828067B6900CAB185 /* HippyShadowView.mm */; }; +- F45D268528067B6900CAB185 /* HippyBorderDrawing.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D261A28067B6900CAB185 /* HippyBorderDrawing.m */; }; +- F45D268628067B6900CAB185 /* UIView+HippyEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D261C28067B6900CAB185 /* UIView+HippyEvent.mm */; }; +- F45D268728067B6900CAB185 /* HippyViewEventType.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D262028067B6900CAB185 /* HippyViewEventType.mm */; }; +- F45D268828067B6900CAB185 /* HippyTouchesView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D262228067B6900CAB185 /* HippyTouchesView.mm */; }; +- F45D268928067B6900CAB185 /* HippySmartViewPagerViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D262928067B6900CAB185 /* HippySmartViewPagerViewManager.mm */; }; +- F45D268A28067B6900CAB185 /* HippySmartViewPagerView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D262C28067B6900CAB185 /* HippySmartViewPagerView.mm */; }; +- F45D268B28067B6900CAB185 /* HippyNavigatorRootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D262E28067B6900CAB185 /* HippyNavigatorRootViewController.m */; }; +- F45D268C28067B6900CAB185 /* HippyNavigatorItemViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D262F28067B6900CAB185 /* HippyNavigatorItemViewController.m */; }; +- F45D268D28067B6900CAB185 /* HippyNavigatorHostView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D263028067B6900CAB185 /* HippyNavigatorHostView.mm */; }; +- F45D268E28067B6900CAB185 /* HippyNavigationControllerAnimator.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D263128067B6900CAB185 /* HippyNavigationControllerAnimator.m */; }; +- F45D268F28067B6900CAB185 /* HippyNavigatorViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D263628067B6900CAB185 /* HippyNavigatorViewManager.mm */; }; +- F45D269028067B6900CAB185 /* HippyFooterRefreshManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D263928067B6900CAB185 /* HippyFooterRefreshManager.mm */; }; +- F45D269128067B6900CAB185 /* HippyFooterRefresh.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D263A28067B6900CAB185 /* HippyFooterRefresh.mm */; }; +- F45D269228067B6900CAB185 /* HippyShadowText.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D263E28067B6900CAB185 /* HippyShadowText.mm */; }; +- F45D269328067B6900CAB185 /* HippyText.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D264028067B6900CAB185 /* HippyText.mm */; }; +- F45D269428067B6900CAB185 /* HippyTextManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D264328067B6900CAB185 /* HippyTextManager.mm */; }; +- F45D269528067B6900CAB185 /* HippyModalCustomPresentationController.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D264728067B6900CAB185 /* HippyModalCustomPresentationController.m */; }; +- F45D269628067B6900CAB185 /* HippyModalHostViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D264828067B6900CAB185 /* HippyModalHostViewManager.mm */; }; +- F45D269728067B6900CAB185 /* HippyModalTransitioningDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D264928067B6900CAB185 /* HippyModalTransitioningDelegate.mm */; }; +- F45D269828067B6A00CAB185 /* HippyModalCustomAnimationTransition.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D264C28067B6900CAB185 /* HippyModalCustomAnimationTransition.m */; }; +- F45D269928067B6A00CAB185 /* HippyModalHostViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D264E28067B6900CAB185 /* HippyModalHostViewController.mm */; }; +- F45D269A28067B6A00CAB185 /* HippyModalHostView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D265028067B6900CAB185 /* HippyModalHostView.mm */; }; ++ F45D268228067B6900CAB185 /* NativeRenderView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D261328067B6900CAB185 /* NativeRenderView.mm */; }; ++ F45D268428067B6900CAB185 /* NativeRenderObjectView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D261828067B6900CAB185 /* NativeRenderObjectView.mm */; }; ++ F45D268528067B6900CAB185 /* NativeRenderBorderDrawing.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D261A28067B6900CAB185 /* NativeRenderBorderDrawing.m */; }; ++ F45D268628067B6900CAB185 /* UIView+DomEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D261C28067B6900CAB185 /* UIView+DomEvent.mm */; }; ++ F45D268728067B6900CAB185 /* NativeRenderViewEventType.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D262028067B6900CAB185 /* NativeRenderViewEventType.mm */; }; ++ F45D268828067B6900CAB185 /* NativeRenderTouchesView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D262228067B6900CAB185 /* NativeRenderTouchesView.mm */; }; ++ F45D268928067B6900CAB185 /* NativeRenderSmartViewPagerViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D262928067B6900CAB185 /* NativeRenderSmartViewPagerViewManager.mm */; }; ++ F45D268A28067B6900CAB185 /* NativeRenderSmartViewPagerView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D262C28067B6900CAB185 /* NativeRenderSmartViewPagerView.mm */; }; ++ F45D268B28067B6900CAB185 /* NativeRenderNavigatorRootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D262E28067B6900CAB185 /* NativeRenderNavigatorRootViewController.m */; }; ++ F45D268C28067B6900CAB185 /* NativeRenderNavigatorItemViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D262F28067B6900CAB185 /* NativeRenderNavigatorItemViewController.m */; }; ++ F45D268D28067B6900CAB185 /* NativeRenderNavigatorHostView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D263028067B6900CAB185 /* NativeRenderNavigatorHostView.mm */; }; ++ F45D268E28067B6900CAB185 /* NativeRenderNavigationControllerAnimator.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D263128067B6900CAB185 /* NativeRenderNavigationControllerAnimator.m */; }; ++ F45D268F28067B6900CAB185 /* NativeRenderNavigatorViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D263628067B6900CAB185 /* NativeRenderNavigatorViewManager.mm */; }; ++ F45D269028067B6900CAB185 /* NativeRenderFooterRefreshManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D263928067B6900CAB185 /* NativeRenderFooterRefreshManager.mm */; }; ++ F45D269128067B6900CAB185 /* NativeRenderFooterRefresh.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D263A28067B6900CAB185 /* NativeRenderFooterRefresh.mm */; }; ++ F45D269228067B6900CAB185 /* NativeRenderObjectText.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D263E28067B6900CAB185 /* NativeRenderObjectText.mm */; }; ++ F45D269328067B6900CAB185 /* NativeRenderText.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D264028067B6900CAB185 /* NativeRenderText.mm */; }; ++ F45D269428067B6900CAB185 /* NativeRenderTextManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D264328067B6900CAB185 /* NativeRenderTextManager.mm */; }; ++ F45D269528067B6900CAB185 /* NativeRenderModalCustomPresentationController.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D264728067B6900CAB185 /* NativeRenderModalCustomPresentationController.m */; }; ++ F45D269628067B6900CAB185 /* NativeRenderModalHostViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D264828067B6900CAB185 /* NativeRenderModalHostViewManager.mm */; }; ++ F45D269728067B6900CAB185 /* NativeRenderModalTransitioningDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D264928067B6900CAB185 /* NativeRenderModalTransitioningDelegate.mm */; }; ++ F45D269828067B6A00CAB185 /* NativeRenderModalCustomAnimationTransition.m in Sources */ = {isa = PBXBuildFile; fileRef = F45D264C28067B6900CAB185 /* NativeRenderModalCustomAnimationTransition.m */; }; ++ F45D269928067B6A00CAB185 /* NativeRenderModalHostViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D264E28067B6900CAB185 /* NativeRenderModalHostViewController.mm */; }; ++ F45D269A28067B6A00CAB185 /* NativeRenderModalHostView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45D265028067B6900CAB185 /* NativeRenderModalHostView.mm */; }; + F468DE562812A95200319196 /* HippyOCTurboModule.mm in Sources */ = {isa = PBXBuildFile; fileRef = F468DDBF2812A95100319196 /* HippyOCTurboModule.mm */; }; + F468DE572812A95200319196 /* HippyTurboModuleManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F468DDC02812A95100319196 /* HippyTurboModuleManager.mm */; }; + F468DE582812A95200319196 /* NSObject+HippyTurbo.mm in Sources */ = {isa = PBXBuildFile; fileRef = F468DDC12812A95100319196 /* NSObject+HippyTurbo.mm */; }; +@@ -169,7 +169,6 @@ + F468DE672812A95200319196 /* HippyImageCacheManager.m in Sources */ = {isa = PBXBuildFile; fileRef = F468DDE92812A95100319196 /* HippyImageCacheManager.m */; }; + F468DE682812A95200319196 /* HippyClipboardModule.m in Sources */ = {isa = PBXBuildFile; fileRef = F468DDEC2812A95100319196 /* HippyClipboardModule.m */; }; + F468DE692812A95200319196 /* HippyAssert.m in Sources */ = {isa = PBXBuildFile; fileRef = F468DDF22812A95100319196 /* HippyAssert.m */; }; +- F468DE6A2812A95200319196 /* HippyLogging.mm in Sources */ = {isa = PBXBuildFile; fileRef = F468DDF32812A95100319196 /* HippyLogging.mm */; }; + F468DE6B2812A95200319196 /* HippyErrorInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = F468DDF52812A95100319196 /* HippyErrorInfo.m */; }; + F468DE6C2812A95200319196 /* HippyEventDispatcher.mm in Sources */ = {isa = PBXBuildFile; fileRef = F468DDF92812A95100319196 /* HippyEventDispatcher.mm */; }; + F468DE6E2812A95200319196 /* HippyPerformanceLogger.mm in Sources */ = {isa = PBXBuildFile; fileRef = F468DDFE2812A95100319196 /* HippyPerformanceLogger.mm */; }; +@@ -194,10 +193,10 @@ + F468DE832812A95200319196 /* HippySRSIMDHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = F468DE352812A95200319196 /* HippySRSIMDHelpers.m */; }; + F468DE842812A95200319196 /* HippyWebSocketManager.m in Sources */ = {isa = PBXBuildFile; fileRef = F468DE362812A95200319196 /* HippyWebSocketManager.m */; }; + F468DE8F2812A95200319196 /* HippyDevInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = F468DE522812A95200319196 /* HippyDevInfo.m */; }; +- F468DE9D2812ACEA00319196 /* HippyComponentData.mm in Sources */ = {isa = PBXBuildFile; fileRef = F468DE962812ACEA00319196 /* HippyComponentData.mm */; }; +- F468DE9E2812ACEA00319196 /* HippyRootShadowView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F468DE972812ACEA00319196 /* HippyRootShadowView.mm */; }; +- F468DE9F2812ACEA00319196 /* HippyFont.mm in Sources */ = {isa = PBXBuildFile; fileRef = F468DE992812ACEA00319196 /* HippyFont.mm */; }; +- F473F1452859C37100422C1A /* HippyComponentMap.mm in Sources */ = {isa = PBXBuildFile; fileRef = F473F13F2859C37100422C1A /* HippyComponentMap.mm */; }; ++ F468DE9D2812ACEA00319196 /* NativeRenderComponentData.mm in Sources */ = {isa = PBXBuildFile; fileRef = F468DE962812ACEA00319196 /* NativeRenderComponentData.mm */; }; ++ F468DE9E2812ACEA00319196 /* NativeRenderObjectRootView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F468DE972812ACEA00319196 /* NativeRenderObjectRootView.mm */; }; ++ F468DE9F2812ACEA00319196 /* NativeRenderFont.mm in Sources */ = {isa = PBXBuildFile; fileRef = F468DE992812ACEA00319196 /* NativeRenderFont.mm */; }; ++ F473F1452859C37100422C1A /* NativeRenderComponentMap.mm in Sources */ = {isa = PBXBuildFile; fileRef = F473F13F2859C37100422C1A /* NativeRenderComponentMap.mm */; }; + F4810954277062AD005C221B /* layer_optimized_render_manager.cc in Sources */ = {isa = PBXBuildFile; fileRef = F4810953277062AD005C221B /* layer_optimized_render_manager.cc */; }; + F482919A274E420C00D91128 /* HPStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F482918B274E420C00D91128 /* HPStyle.cpp */; }; + F482919B274E420C00D91128 /* HPConfig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F482918D274E420C00D91128 /* HPConfig.cpp */; }; +@@ -207,19 +206,16 @@ + F482919F274E420D00D91128 /* Hippy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F4829195274E420C00D91128 /* Hippy.cpp */; }; + F48291A0274E420D00D91128 /* HPLayoutCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F4829197274E420C00D91128 /* HPLayoutCache.cpp */; }; + F4A8424227D38CF900AEFC88 /* NativeRenderManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4A8423F27D38CF900AEFC88 /* NativeRenderManager.mm */; }; +- F4A8424327D38CF900AEFC88 /* HippyUIManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4A8424127D38CF900AEFC88 /* HippyUIManager.mm */; }; +- F4B938F82840B58C00187AFA /* HippyWaterfallViewCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4B938F72840B58C00187AFA /* HippyWaterfallViewCell.mm */; }; +- F4B938FB2840C93C00187AFA /* HippyWatefallItemShadowView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4B938FA2840C93C00187AFA /* HippyWatefallItemShadowView.mm */; }; ++ F4A8424327D38CF900AEFC88 /* NativeRenderUIManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4A8424127D38CF900AEFC88 /* NativeRenderUIManager.mm */; }; ++ F4B938F82840B58C00187AFA /* NativeRenderWaterfallViewCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4B938F72840B58C00187AFA /* NativeRenderWaterfallViewCell.mm */; }; ++ F4B938FB2840C93C00187AFA /* NativeRenderObjectWatefallItem.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4B938FA2840C93C00187AFA /* NativeRenderObjectWatefallItem.mm */; }; + F4BD045827D5AE2500339A2C /* UIView+Render.mm in Sources */ = {isa = PBXBuildFile; fileRef = F459C45927D4F355009A7441 /* UIView+Render.mm */; }; + F4C1CE23281131EC00CED4C4 /* NSData+DataType.m in Sources */ = {isa = PBXBuildFile; fileRef = F4C1CE22281131EC00CED4C4 /* NSData+DataType.m */; }; + F4C1CE262811439A00CED4C4 /* UIView+Sequence.m in Sources */ = {isa = PBXBuildFile; fileRef = F4C1CE252811439A00CED4C4 /* UIView+Sequence.m */; }; +- F4C1DAA52811795200CED4C4 /* HippyLog.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4C1DAA42811795200CED4C4 /* HippyLog.mm */; }; +- F4C1DAAD28117C1900CED4C4 /* NSArray+HippyArrayDeepCopy.m in Sources */ = {isa = PBXBuildFile; fileRef = F4C1DAA628117C1800CED4C4 /* NSArray+HippyArrayDeepCopy.m */; }; +- F4C1DAAE28117C1900CED4C4 /* NSDictionary+HippyDictionaryDeepCopy.m in Sources */ = {isa = PBXBuildFile; fileRef = F4C1DAA728117C1800CED4C4 /* NSDictionary+HippyDictionaryDeepCopy.m */; }; +- F4C1DAAF28117C1900CED4C4 /* NSNumber+HippyNumberDeepCopy.m in Sources */ = {isa = PBXBuildFile; fileRef = F4C1DAA828117C1800CED4C4 /* NSNumber+HippyNumberDeepCopy.m */; }; +- F4CEDF9B27D858C700583C9E /* HippyImageDataLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = F4CEDF9427D858C700583C9E /* HippyImageDataLoader.m */; }; +- F4CEDF9C27D858C700583C9E /* HippyDownloadTask.m in Sources */ = {isa = PBXBuildFile; fileRef = F4CEDF9627D858C700583C9E /* HippyDownloadTask.m */; }; +- F4CEDF9D27D858C700583C9E /* HippyDefaultImageProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = F4CEDF9927D858C700583C9E /* HippyDefaultImageProvider.m */; }; ++ F4C1DAA52811795200CED4C4 /* NativeRenderLog.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4C1DAA42811795200CED4C4 /* NativeRenderLog.mm */; }; ++ F4CEDF9B27D858C700583C9E /* NativeRenderImageDataLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = F4CEDF9427D858C700583C9E /* NativeRenderImageDataLoader.m */; }; ++ F4CEDF9C27D858C700583C9E /* NativeRenderDownloadTask.m in Sources */ = {isa = PBXBuildFile; fileRef = F4CEDF9627D858C700583C9E /* NativeRenderDownloadTask.m */; }; ++ F4CEDF9D27D858C700583C9E /* NativeRenderDefaultImageProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = F4CEDF9927D858C700583C9E /* NativeRenderDefaultImageProvider.m */; }; + F4E7B43D276C61EB00F17139 /* dom_argument.cc in Sources */ = {isa = PBXBuildFile; fileRef = F4E7B439276C61EA00F17139 /* dom_argument.cc */; }; + F4E7B43E276C61EB00F17139 /* dom_event.cc in Sources */ = {isa = PBXBuildFile; fileRef = F4E7B43A276C61EB00F17139 /* dom_event.cc */; }; + /* End PBXBuildFile section */ +@@ -371,176 +367,173 @@ + F42EA797277C354C007874A2 /* TurboConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TurboConfig.h; sourceTree = """"; }; + F42EA798277C354C007874A2 /* TurboBaseModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TurboBaseModule.h; sourceTree = """"; }; + F42EA799277C354C007874A2 /* TurboBaseModule.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TurboBaseModule.mm; sourceTree = """"; }; +- F438B73E281248010078435B /* HippyGradientObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HippyGradientObject.m; sourceTree = """"; }; ++ F438B73E281248010078435B /* NativeRenderGradientObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeRenderGradientObject.m; sourceTree = """"; }; + F438B73F281248010078435B /* OCTypeToDomArgument.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = OCTypeToDomArgument.mm; sourceTree = """"; }; + F438B740281248010078435B /* OCTypeToDomArgument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCTypeToDomArgument.h; sourceTree = """"; }; +- F438B741281248010078435B /* HippyDomNodeUtils.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyDomNodeUtils.mm; sourceTree = """"; }; +- F438B742281248010078435B /* HippyGradientObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyGradientObject.h; sourceTree = """"; }; +- F438B743281248010078435B /* HippyDomNodeUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyDomNodeUtils.h; sourceTree = """"; }; +- F438B74728124B200078435B /* HippyI18nUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyI18nUtils.h; sourceTree = """"; }; +- F438B74828124B200078435B /* HippyI18nUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HippyI18nUtils.m; sourceTree = """"; }; +- F438B74B28124E9F0078435B /* HippyDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyDefines.h; sourceTree = """"; }; +- F438B74C281250CD0078435B /* HippyConvert+Transform.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ""HippyConvert+Transform.m""; sourceTree = """"; }; +- F438B74D281250CD0078435B /* HippyUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HippyUtils.m; sourceTree = """"; }; +- F438B74E281250CD0078435B /* HippyParserUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyParserUtils.h; sourceTree = """"; }; +- F438B74F281250CD0078435B /* HippyConvert.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyConvert.mm; sourceTree = """"; }; +- F438B750281250CD0078435B /* HippyConvert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyConvert.h; sourceTree = """"; }; +- F438B751281250CD0078435B /* HippyUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyUtils.h; sourceTree = """"; }; +- F438B752281250CD0078435B /* HippyConvert+Transform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ""HippyConvert+Transform.h""; sourceTree = """"; }; +- F438B753281250CD0078435B /* HippyParserUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HippyParserUtils.m; sourceTree = """"; }; +- F438B758281283550078435B /* RenderErrorHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RenderErrorHandler.h; sourceTree = """"; }; +- F438B759281283550078435B /* RenderErrorHandler.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RenderErrorHandler.m; sourceTree = """"; }; ++ F438B741281248010078435B /* NativeRenderDomNodeUtils.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderDomNodeUtils.mm; sourceTree = """"; }; ++ F438B742281248010078435B /* NativeRenderGradientObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderGradientObject.h; sourceTree = """"; }; ++ F438B743281248010078435B /* NativeRenderDomNodeUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderDomNodeUtils.h; sourceTree = """"; }; ++ F438B74728124B200078435B /* NativeRenderI18nUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderI18nUtils.h; sourceTree = """"; }; ++ F438B74828124B200078435B /* NativeRenderI18nUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeRenderI18nUtils.m; sourceTree = """"; }; ++ F438B74C281250CD0078435B /* NativeRenderConvert+Transform.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ""NativeRenderConvert+Transform.m""; sourceTree = """"; }; ++ F438B74D281250CD0078435B /* NativeRenderUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeRenderUtils.m; sourceTree = """"; }; ++ F438B74E281250CD0078435B /* NativeRenderParserUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderParserUtils.h; sourceTree = """"; }; ++ F438B74F281250CD0078435B /* NativeRenderConvert.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderConvert.mm; sourceTree = """"; }; ++ F438B750281250CD0078435B /* NativeRenderConvert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderConvert.h; sourceTree = """"; }; ++ F438B751281250CD0078435B /* NativeRenderUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderUtils.h; sourceTree = """"; }; ++ F438B752281250CD0078435B /* NativeRenderConvert+Transform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ""NativeRenderConvert+Transform.h""; sourceTree = """"; }; ++ F438B753281250CD0078435B /* NativeRenderParserUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeRenderParserUtils.m; sourceTree = """"; }; ++ F438B758281283550078435B /* NativeRenderErrorHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NativeRenderErrorHandler.h; sourceTree = """"; }; ++ F438B759281283550078435B /* NativeRenderErrorHandler.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NativeRenderErrorHandler.m; sourceTree = """"; }; + F43A2D08275882650056F36C /* diff_utils.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = diff_utils.cc; sourceTree = """"; }; + F459C45827D4F355009A7441 /* UIView+Render.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ""UIView+Render.h""; sourceTree = """"; }; + F459C45927D4F355009A7441 /* UIView+Render.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ""UIView+Render.mm""; sourceTree = """"; }; +- F45D25AC28067B6900CAB185 /* HippyScrollableProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyScrollableProtocol.h; sourceTree = """"; }; +- F45D25AD28067B6900CAB185 /* HippyScrollView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyScrollView.mm; sourceTree = """"; }; +- F45D25AE28067B6900CAB185 /* HippyScrollViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyScrollViewManager.h; sourceTree = """"; }; +- F45D25AF28067B6900CAB185 /* HippyScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyScrollView.h; sourceTree = """"; }; +- F45D25B028067B6900CAB185 /* HippyScrollViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyScrollViewManager.mm; sourceTree = """"; }; +- F45D25B228067B6900CAB185 /* HippyRefreshWrapperItemViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyRefreshWrapperItemViewManager.h; sourceTree = """"; }; +- F45D25B328067B6900CAB185 /* HippyRefreshWrapperItemView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyRefreshWrapperItemView.mm; sourceTree = """"; }; +- F45D25B428067B6900CAB185 /* HippyRefreshWrapper.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyRefreshWrapper.mm; sourceTree = """"; }; +- F45D25B528067B6900CAB185 /* HippyRefreshWrapperItemView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyRefreshWrapperItemView.h; sourceTree = """"; }; +- F45D25B628067B6900CAB185 /* HippyRefreshWrapperViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyRefreshWrapperViewManager.mm; sourceTree = """"; }; +- F45D25B728067B6900CAB185 /* HippyRefreshWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyRefreshWrapper.h; sourceTree = """"; }; +- F45D25B828067B6900CAB185 /* HippyRefreshWrapperViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyRefreshWrapperViewManager.h; sourceTree = """"; }; +- F45D25B928067B6900CAB185 /* HippyRefreshWrapperItemViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyRefreshWrapperItemViewManager.mm; sourceTree = """"; }; +- F45D25BB28067B6900CAB185 /* HippyRefresh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyRefresh.h; sourceTree = """"; }; +- F45D25BC28067B6900CAB185 /* HippyRefresh.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyRefresh.mm; sourceTree = """"; }; +- F45D25BE28067B6900CAB185 /* HippyViewPagerItemManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyViewPagerItemManager.h; sourceTree = """"; }; +- F45D25BF28067B6900CAB185 /* HippyViewPagerItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyViewPagerItem.h; sourceTree = """"; }; +- F45D25C028067B6900CAB185 /* HippyViewPager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyViewPager.h; sourceTree = """"; }; +- F45D25C128067B6900CAB185 /* HippyViewPager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyViewPager.mm; sourceTree = """"; }; +- F45D25C228067B6900CAB185 /* HippyViewPagerManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyViewPagerManager.mm; sourceTree = """"; }; +- F45D25C328067B6900CAB185 /* HippyViewPagerItem.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyViewPagerItem.mm; sourceTree = """"; }; +- F45D25C428067B6900CAB185 /* HippyViewPagerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyViewPagerManager.h; sourceTree = """"; }; +- F45D25C528067B6900CAB185 /* HippyViewPagerItemManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyViewPagerItemManager.mm; sourceTree = """"; }; +- F45D25C728067B6900CAB185 /* HippyBaseTextInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyBaseTextInput.h; sourceTree = """"; }; +- F45D25C828067B6900CAB185 /* HippyTextView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyTextView.mm; sourceTree = """"; }; +- F45D25C928067B6900CAB185 /* HippyBaseTextInput.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyBaseTextInput.mm; sourceTree = """"; }; +- F45D25CA28067B6900CAB185 /* HippyTextViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyTextViewManager.mm; sourceTree = """"; }; +- F45D25CB28067B6900CAB185 /* HippyTextField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyTextField.h; sourceTree = """"; }; +- F45D25CC28067B6900CAB185 /* HippyShadowTextView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyShadowTextView.mm; sourceTree = """"; }; +- F45D25CD28067B6900CAB185 /* HippyTextSelection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyTextSelection.h; sourceTree = """"; }; +- F45D25CE28067B6900CAB185 /* HippyTextViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyTextViewManager.h; sourceTree = """"; }; +- F45D25CF28067B6900CAB185 /* HippyShadowTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyShadowTextView.h; sourceTree = """"; }; +- F45D25D028067B6900CAB185 /* HippyTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyTextView.h; sourceTree = """"; }; +- F45D25D128067B6900CAB185 /* HippyTextField.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyTextField.mm; sourceTree = """"; }; +- F45D25D228067B6900CAB185 /* HippyTextSelection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HippyTextSelection.m; sourceTree = """"; }; +- F45D25D428067B6900CAB185 /* HippySimpleWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippySimpleWebView.h; sourceTree = """"; }; +- F45D25D528067B6900CAB185 /* HippySimpleWebViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippySimpleWebViewManager.h; sourceTree = """"; }; +- F45D25D628067B6900CAB185 /* HippySimpleWebView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HippySimpleWebView.m; sourceTree = """"; }; +- F45D25D728067B6900CAB185 /* HippySimpleWebViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippySimpleWebViewManager.mm; sourceTree = """"; }; +- F45D25D928067B6900CAB185 /* HippyHeaderRefreshManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyHeaderRefreshManager.mm; sourceTree = """"; }; +- F45D25DA28067B6900CAB185 /* HippyHeaderRefreshManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyHeaderRefreshManager.h; sourceTree = """"; }; +- F45D25DB28067B6900CAB185 /* HippyHeaderRefresh.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyHeaderRefresh.mm; sourceTree = """"; }; +- F45D25DC28067B6900CAB185 /* HippyHeaderRefresh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyHeaderRefresh.h; sourceTree = """"; }; +- F45D25DE28067B6900CAB185 /* HippyWaterfallView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyWaterfallView.mm; sourceTree = """"; }; +- F45D25DF28067B6900CAB185 /* HippyWaterfallViewDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyWaterfallViewDataSource.h; sourceTree = """"; }; +- F45D25E028067B6900CAB185 /* HippyWaterfallItemViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyWaterfallItemViewManager.h; sourceTree = """"; }; +- F45D25E128067B6900CAB185 /* HippyCollectionViewWaterfallLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyCollectionViewWaterfallLayout.h; sourceTree = """"; }; +- F45D25E228067B6900CAB185 /* HippyWaterfallItemView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyWaterfallItemView.h; sourceTree = """"; }; +- F45D25E328067B6900CAB185 /* HippyWaterfallViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyWaterfallViewManager.h; sourceTree = """"; }; +- F45D25E428067B6900CAB185 /* HippyWaterfallViewDataSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyWaterfallViewDataSource.mm; sourceTree = """"; }; +- F45D25E528067B6900CAB185 /* HippyWaterfallViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyWaterfallViewManager.mm; sourceTree = """"; }; +- F45D25E628067B6900CAB185 /* HippyWaterfallItemView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyWaterfallItemView.mm; sourceTree = """"; }; +- F45D25E728067B6900CAB185 /* HippyCollectionViewWaterfallLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HippyCollectionViewWaterfallLayout.m; sourceTree = """"; }; +- F45D25E828067B6900CAB185 /* HippyWaterfallItemViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyWaterfallItemViewManager.mm; sourceTree = """"; }; +- F45D25E928067B6900CAB185 /* HippyWaterfallView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyWaterfallView.h; sourceTree = """"; }; +- F45D25EB28067B6900CAB185 /* HippyImageViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyImageViewManager.h; sourceTree = """"; }; +- F45D25EC28067B6900CAB185 /* HippyImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HippyImageView.m; sourceTree = """"; }; +- F45D25ED28067B6900CAB185 /* HippyAnimatedImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyAnimatedImageView.h; sourceTree = """"; }; +- F45D25EE28067B6900CAB185 /* HippyImageCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyImageCache.h; sourceTree = """"; }; +- F45D25EF28067B6900CAB185 /* HippyImageView+HippyTouchesImplementation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ""HippyImageView+HippyTouchesImplementation.h""; sourceTree = """"; }; +- F45D25F028067B6900CAB185 /* HippyAnimatedImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HippyAnimatedImage.m; sourceTree = """"; }; +- F45D25F128067B6900CAB185 /* HippyAnimatedImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HippyAnimatedImageView.m; sourceTree = """"; }; +- F45D25F228067B6900CAB185 /* HippyImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyImageView.h; sourceTree = """"; }; +- F45D25F328067B6900CAB185 /* HippyImageViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyImageViewManager.mm; sourceTree = """"; }; +- F45D25F428067B6900CAB185 /* HippyImageView+HippyTouchesImplementation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ""HippyImageView+HippyTouchesImplementation.mm""; sourceTree = """"; }; +- F45D25F528067B6900CAB185 /* HippyAnimatedImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyAnimatedImage.h; sourceTree = """"; }; +- F45D25F628067B6900CAB185 /* HippyImageCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HippyImageCache.m; sourceTree = """"; }; +- F45D25F828067B6900CAB185 /* HippyBaseListItemView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyBaseListItemView.h; sourceTree = """"; }; +- F45D25F928067B6900CAB185 /* HippyBaseListItemShadowView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyBaseListItemShadowView.mm; sourceTree = """"; }; +- F45D25FA28067B6900CAB185 /* HippyBaseListView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyBaseListView.mm; sourceTree = """"; }; +- F45D25FB28067B6900CAB185 /* HippyListTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyListTableView.h; sourceTree = """"; }; +- F45D25FC28067B6900CAB185 /* HippyBaseListViewCell.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyBaseListViewCell.mm; sourceTree = """"; }; +- F45D25FD28067B6900CAB185 /* HippyCollectionViewFlowLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyCollectionViewFlowLayout.h; sourceTree = """"; }; +- F45D25FE28067B6900CAB185 /* HippyBaseListViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyBaseListViewManager.h; sourceTree = """"; }; +- F45D25FF28067B6900CAB185 /* HippyBaseListItemView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyBaseListItemView.mm; sourceTree = """"; }; +- F45D260028067B6900CAB185 /* HippyBaseListViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyBaseListViewManager.mm; sourceTree = """"; }; +- F45D260128067B6900CAB185 /* HippyBaseListItemViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyBaseListItemViewManager.mm; sourceTree = """"; }; +- F45D260228067B6900CAB185 /* HippyBaseListView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyBaseListView.h; sourceTree = """"; }; +- F45D260328067B6900CAB185 /* HippyBaseListViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyBaseListViewCell.h; sourceTree = """"; }; +- F45D260428067B6900CAB185 /* HippyBaseListItemViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyBaseListItemViewManager.h; sourceTree = """"; }; +- F45D260528067B6900CAB185 /* HippyBaseListItemShadowView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyBaseListItemShadowView.h; sourceTree = """"; }; +- F45D260628067B6900CAB185 /* HippyCollectionViewFlowLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HippyCollectionViewFlowLayout.m; sourceTree = """"; }; +- F45D260728067B6900CAB185 /* HippyListTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HippyListTableView.m; sourceTree = """"; }; +- F45D260828067B6900CAB185 /* HippyBaseListViewDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyBaseListViewDataSource.h; sourceTree = """"; }; +- F45D260928067B6900CAB185 /* HippyBaseListViewDataSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyBaseListViewDataSource.mm; sourceTree = """"; }; +- F45D260B28067B6900CAB185 /* UIView+AppearEvent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ""UIView+AppearEvent.m""; sourceTree = """"; }; +- F45D260C28067B6900CAB185 /* UIView+HippyEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ""UIView+HippyEvent.h""; sourceTree = """"; }; +- F45D260E28067B6900CAB185 /* UIView+Hippy.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ""UIView+Hippy.mm""; sourceTree = """"; }; +- F45D260F28067B6900CAB185 /* HippyShadowView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyShadowView.h; sourceTree = """"; }; +- F45D261028067B6900CAB185 /* HippyPointerEvents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyPointerEvents.h; sourceTree = """"; }; +- F45D261128067B6900CAB185 /* HippyViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyViewManager.mm; sourceTree = """"; }; ++ F45D25AC28067B6900CAB185 /* NativeRenderScrollableProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderScrollableProtocol.h; sourceTree = """"; }; ++ F45D25AD28067B6900CAB185 /* NativeRenderScrollView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderScrollView.mm; sourceTree = """"; }; ++ F45D25AE28067B6900CAB185 /* NativeRenderScrollViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderScrollViewManager.h; sourceTree = """"; }; ++ F45D25AF28067B6900CAB185 /* NativeRenderScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderScrollView.h; sourceTree = """"; }; ++ F45D25B028067B6900CAB185 /* NativeRenderScrollViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderScrollViewManager.mm; sourceTree = """"; }; ++ F45D25B228067B6900CAB185 /* NativeRenderRefreshWrapperItemViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderRefreshWrapperItemViewManager.h; sourceTree = """"; }; ++ F45D25B328067B6900CAB185 /* NativeRenderRefreshWrapperItemView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderRefreshWrapperItemView.mm; sourceTree = """"; }; ++ F45D25B428067B6900CAB185 /* NativeRenderRefreshWrapper.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderRefreshWrapper.mm; sourceTree = """"; }; ++ F45D25B528067B6900CAB185 /* NativeRenderRefreshWrapperItemView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderRefreshWrapperItemView.h; sourceTree = """"; }; ++ F45D25B628067B6900CAB185 /* NativeRenderRefreshWrapperViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderRefreshWrapperViewManager.mm; sourceTree = """"; }; ++ F45D25B728067B6900CAB185 /* NativeRenderRefreshWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderRefreshWrapper.h; sourceTree = """"; }; ++ F45D25B828067B6900CAB185 /* NativeRenderRefreshWrapperViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderRefreshWrapperViewManager.h; sourceTree = """"; }; ++ F45D25B928067B6900CAB185 /* NativeRenderRefreshWrapperItemViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderRefreshWrapperItemViewManager.mm; sourceTree = """"; }; ++ F45D25BB28067B6900CAB185 /* NativeRenderRefresh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderRefresh.h; sourceTree = """"; }; ++ F45D25BC28067B6900CAB185 /* NativeRenderRefresh.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderRefresh.mm; sourceTree = """"; }; ++ F45D25BE28067B6900CAB185 /* NativeRenderViewPagerItemManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderViewPagerItemManager.h; sourceTree = """"; }; ++ F45D25BF28067B6900CAB185 /* NativeRenderViewPagerItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderViewPagerItem.h; sourceTree = """"; }; ++ F45D25C028067B6900CAB185 /* NativeRenderViewPager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderViewPager.h; sourceTree = """"; }; ++ F45D25C128067B6900CAB185 /* NativeRenderViewPager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderViewPager.mm; sourceTree = """"; }; ++ F45D25C228067B6900CAB185 /* NativeRenderViewPagerManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderViewPagerManager.mm; sourceTree = """"; }; ++ F45D25C328067B6900CAB185 /* NativeRenderViewPagerItem.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderViewPagerItem.mm; sourceTree = """"; }; ++ F45D25C428067B6900CAB185 /* NativeRenderViewPagerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderViewPagerManager.h; sourceTree = """"; }; ++ F45D25C528067B6900CAB185 /* NativeRenderViewPagerItemManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderViewPagerItemManager.mm; sourceTree = """"; }; ++ F45D25C728067B6900CAB185 /* NativeRenderBaseTextInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderBaseTextInput.h; sourceTree = """"; }; ++ F45D25C828067B6900CAB185 /* NativeRenderTextView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderTextView.mm; sourceTree = """"; }; ++ F45D25C928067B6900CAB185 /* NativeRenderBaseTextInput.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderBaseTextInput.mm; sourceTree = """"; }; ++ F45D25CA28067B6900CAB185 /* NativeRenderTextViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderTextViewManager.mm; sourceTree = """"; }; ++ F45D25CB28067B6900CAB185 /* NativeRenderTextField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderTextField.h; sourceTree = """"; }; ++ F45D25CC28067B6900CAB185 /* NativeRenderObjectTextView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderObjectTextView.mm; sourceTree = """"; }; ++ F45D25CD28067B6900CAB185 /* NativeRenderTextSelection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderTextSelection.h; sourceTree = """"; }; ++ F45D25CE28067B6900CAB185 /* NativeRenderTextViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderTextViewManager.h; sourceTree = """"; }; ++ F45D25CF28067B6900CAB185 /* NativeRenderObjectTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderObjectTextView.h; sourceTree = """"; }; ++ F45D25D028067B6900CAB185 /* NativeRenderTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderTextView.h; sourceTree = """"; }; ++ F45D25D128067B6900CAB185 /* NativeRenderTextField.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderTextField.mm; sourceTree = """"; }; ++ F45D25D228067B6900CAB185 /* NativeRenderTextSelection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeRenderTextSelection.m; sourceTree = """"; }; ++ F45D25D428067B6900CAB185 /* NativeRenderSimpleWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderSimpleWebView.h; sourceTree = """"; }; ++ F45D25D528067B6900CAB185 /* NativeRenderSimpleWebViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderSimpleWebViewManager.h; sourceTree = """"; }; ++ F45D25D628067B6900CAB185 /* NativeRenderSimpleWebView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeRenderSimpleWebView.m; sourceTree = """"; }; ++ F45D25D728067B6900CAB185 /* NativeRenderSimpleWebViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderSimpleWebViewManager.mm; sourceTree = """"; }; ++ F45D25D928067B6900CAB185 /* NativeRenderHeaderRefreshManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderHeaderRefreshManager.mm; sourceTree = """"; }; ++ F45D25DA28067B6900CAB185 /* NativeRenderHeaderRefreshManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderHeaderRefreshManager.h; sourceTree = """"; }; ++ F45D25DB28067B6900CAB185 /* NativeRenderHeaderRefresh.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderHeaderRefresh.mm; sourceTree = """"; }; ++ F45D25DC28067B6900CAB185 /* NativeRenderHeaderRefresh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderHeaderRefresh.h; sourceTree = """"; }; ++ F45D25DE28067B6900CAB185 /* NativeRenderWaterfallView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderWaterfallView.mm; sourceTree = """"; }; ++ F45D25DF28067B6900CAB185 /* NativeRenderWaterfallViewDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderWaterfallViewDataSource.h; sourceTree = """"; }; ++ F45D25E028067B6900CAB185 /* NativeRenderWaterfallItemViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderWaterfallItemViewManager.h; sourceTree = """"; }; ++ F45D25E128067B6900CAB185 /* NativeRenderCollectionViewWaterfallLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderCollectionViewWaterfallLayout.h; sourceTree = """"; }; ++ F45D25E228067B6900CAB185 /* NativeRenderWaterfallItemView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderWaterfallItemView.h; sourceTree = """"; }; ++ F45D25E328067B6900CAB185 /* NativeRenderWaterfallViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderWaterfallViewManager.h; sourceTree = """"; }; ++ F45D25E428067B6900CAB185 /* NativeRenderWaterfallViewDataSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderWaterfallViewDataSource.mm; sourceTree = """"; }; ++ F45D25E528067B6900CAB185 /* NativeRenderWaterfallViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderWaterfallViewManager.mm; sourceTree = """"; }; ++ F45D25E628067B6900CAB185 /* NativeRenderWaterfallItemView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderWaterfallItemView.mm; sourceTree = """"; }; ++ F45D25E728067B6900CAB185 /* NativeRenderCollectionViewWaterfallLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeRenderCollectionViewWaterfallLayout.m; sourceTree = """"; }; ++ F45D25E828067B6900CAB185 /* NativeRenderWaterfallItemViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderWaterfallItemViewManager.mm; sourceTree = """"; }; ++ F45D25E928067B6900CAB185 /* NativeRenderWaterfallView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderWaterfallView.h; sourceTree = """"; }; ++ F45D25EB28067B6900CAB185 /* NativeRenderImageViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderImageViewManager.h; sourceTree = """"; }; ++ F45D25EC28067B6900CAB185 /* NativeRenderImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeRenderImageView.m; sourceTree = """"; }; ++ F45D25ED28067B6900CAB185 /* NativeRenderAnimatedImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderAnimatedImageView.h; sourceTree = """"; }; ++ F45D25EE28067B6900CAB185 /* NativeRenderImageCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderImageCache.h; sourceTree = """"; }; ++ F45D25EF28067B6900CAB185 /* NativeRenderImageView+NativeRenderTouchesImplementation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ""NativeRenderImageView+NativeRenderTouchesImplementation.h""; sourceTree = """"; }; ++ F45D25F028067B6900CAB185 /* NativeRenderAnimatedImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeRenderAnimatedImage.m; sourceTree = """"; }; ++ F45D25F128067B6900CAB185 /* NativeRenderAnimatedImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeRenderAnimatedImageView.m; sourceTree = """"; }; ++ F45D25F228067B6900CAB185 /* NativeRenderImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderImageView.h; sourceTree = """"; }; ++ F45D25F328067B6900CAB185 /* NativeRenderImageViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderImageViewManager.mm; sourceTree = """"; }; ++ F45D25F428067B6900CAB185 /* NativeRenderImageView+NativeRenderTouchesImplementation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ""NativeRenderImageView+NativeRenderTouchesImplementation.mm""; sourceTree = """"; }; ++ F45D25F528067B6900CAB185 /* NativeRenderAnimatedImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderAnimatedImage.h; sourceTree = """"; }; ++ F45D25F628067B6900CAB185 /* NativeRenderImageCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeRenderImageCache.m; sourceTree = """"; }; ++ F45D25F828067B6900CAB185 /* NativeRenderBaseListItemView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderBaseListItemView.h; sourceTree = """"; }; ++ F45D25F928067B6900CAB185 /* NativeRenderObjectBaseListItem.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderObjectBaseListItem.mm; sourceTree = """"; }; ++ F45D25FA28067B6900CAB185 /* NativeRenderBaseListView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderBaseListView.mm; sourceTree = """"; }; ++ F45D25FB28067B6900CAB185 /* NativeRenderListTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderListTableView.h; sourceTree = """"; }; ++ F45D25FC28067B6900CAB185 /* NativeRenderBaseListViewCell.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderBaseListViewCell.mm; sourceTree = """"; }; ++ F45D25FD28067B6900CAB185 /* NativeRenderCollectionViewFlowLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderCollectionViewFlowLayout.h; sourceTree = """"; }; ++ F45D25FE28067B6900CAB185 /* NativeRenderBaseListViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderBaseListViewManager.h; sourceTree = """"; }; ++ F45D25FF28067B6900CAB185 /* NativeRenderBaseListItemView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderBaseListItemView.mm; sourceTree = """"; }; ++ F45D260028067B6900CAB185 /* NativeRenderBaseListViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderBaseListViewManager.mm; sourceTree = """"; }; ++ F45D260128067B6900CAB185 /* NativeRenderBaseListItemViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderBaseListItemViewManager.mm; sourceTree = """"; }; ++ F45D260228067B6900CAB185 /* NativeRenderBaseListView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderBaseListView.h; sourceTree = """"; }; ++ F45D260328067B6900CAB185 /* NativeRenderBaseListViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderBaseListViewCell.h; sourceTree = """"; }; ++ F45D260428067B6900CAB185 /* NativeRenderBaseListItemViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderBaseListItemViewManager.h; sourceTree = """"; }; ++ F45D260528067B6900CAB185 /* NativeRenderObjectBaseListItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderObjectBaseListItem.h; sourceTree = """"; }; ++ F45D260628067B6900CAB185 /* NativeRenderCollectionViewFlowLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeRenderCollectionViewFlowLayout.m; sourceTree = """"; }; ++ F45D260728067B6900CAB185 /* NativeRenderListTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeRenderListTableView.m; sourceTree = """"; }; ++ F45D260828067B6900CAB185 /* NativeRenderBaseListViewDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderBaseListViewDataSource.h; sourceTree = """"; }; ++ F45D260928067B6900CAB185 /* NativeRenderBaseListViewDataSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderBaseListViewDataSource.mm; sourceTree = """"; }; ++ F45D260B28067B6900CAB185 /* UIView+MountEvent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ""UIView+MountEvent.m""; sourceTree = """"; }; ++ F45D260C28067B6900CAB185 /* UIView+DomEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ""UIView+DomEvent.h""; sourceTree = """"; }; ++ F45D260E28067B6900CAB185 /* UIView+NativeRender.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ""UIView+NativeRender.mm""; sourceTree = """"; }; ++ F45D260F28067B6900CAB185 /* NativeRenderObjectView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderObjectView.h; sourceTree = """"; }; ++ F45D261028067B6900CAB185 /* NativeRenderPointerEvents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderPointerEvents.h; sourceTree = """"; }; ++ F45D261128067B6900CAB185 /* NativeRenderViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderViewManager.mm; sourceTree = """"; }; + F45D261228067B6900CAB185 /* UIView+DirectionalLayout.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ""UIView+DirectionalLayout.mm""; sourceTree = """"; }; +- F45D261328067B6900CAB185 /* HippyView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyView.mm; sourceTree = """"; }; +- F45D261428067B6900CAB185 /* HippyViewEventProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyViewEventProtocol.h; sourceTree = """"; }; +- F45D261528067B6900CAB185 /* HippyBorderStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyBorderStyle.h; sourceTree = """"; }; +- F45D261628067B6900CAB185 /* HippyTouchesView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyTouchesView.h; sourceTree = """"; }; +- F45D261828067B6900CAB185 /* HippyShadowView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyShadowView.mm; sourceTree = """"; }; +- F45D261928067B6900CAB185 /* HippyViewEventType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyViewEventType.h; sourceTree = """"; }; +- F45D261A28067B6900CAB185 /* HippyBorderDrawing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HippyBorderDrawing.m; sourceTree = """"; }; +- F45D261C28067B6900CAB185 /* UIView+HippyEvent.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ""UIView+HippyEvent.mm""; sourceTree = """"; }; +- F45D261E28067B6900CAB185 /* UIView+AppearEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ""UIView+AppearEvent.h""; sourceTree = """"; }; ++ F45D261328067B6900CAB185 /* NativeRenderView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderView.mm; sourceTree = """"; }; ++ F45D261528067B6900CAB185 /* NativeRenderBorderStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderBorderStyle.h; sourceTree = """"; }; ++ F45D261628067B6900CAB185 /* NativeRenderTouchesView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderTouchesView.h; sourceTree = """"; }; ++ F45D261828067B6900CAB185 /* NativeRenderObjectView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderObjectView.mm; sourceTree = """"; }; ++ F45D261928067B6900CAB185 /* NativeRenderViewEventType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderViewEventType.h; sourceTree = """"; }; ++ F45D261A28067B6900CAB185 /* NativeRenderBorderDrawing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeRenderBorderDrawing.m; sourceTree = """"; }; ++ F45D261C28067B6900CAB185 /* UIView+DomEvent.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ""UIView+DomEvent.mm""; sourceTree = """"; }; ++ F45D261E28067B6900CAB185 /* UIView+MountEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ""UIView+MountEvent.h""; sourceTree = """"; }; + F45D261F28067B6900CAB185 /* UIView+DirectionalLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ""UIView+DirectionalLayout.h""; sourceTree = """"; }; +- F45D262028067B6900CAB185 /* HippyViewEventType.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyViewEventType.mm; sourceTree = """"; }; +- F45D262128067B6900CAB185 /* HippyTouchesProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyTouchesProtocol.h; sourceTree = """"; }; +- F45D262228067B6900CAB185 /* HippyTouchesView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyTouchesView.mm; sourceTree = """"; }; +- F45D262328067B6900CAB185 /* HippyViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyViewManager.h; sourceTree = """"; }; +- F45D262428067B6900CAB185 /* UIView+Hippy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ""UIView+Hippy.h""; sourceTree = """"; }; +- F45D262528067B6900CAB185 /* UIView+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ""UIView+Private.h""; sourceTree = """"; }; +- F45D262628067B6900CAB185 /* HippyBorderDrawing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyBorderDrawing.h; sourceTree = """"; }; +- F45D262728067B6900CAB185 /* HippyView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyView.h; sourceTree = """"; }; +- F45D262928067B6900CAB185 /* HippySmartViewPagerViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippySmartViewPagerViewManager.mm; sourceTree = """"; }; +- F45D262A28067B6900CAB185 /* HippySmartViewPagerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippySmartViewPagerView.h; sourceTree = """"; }; +- F45D262B28067B6900CAB185 /* HippySmartViewPagerViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippySmartViewPagerViewManager.h; sourceTree = """"; }; +- F45D262C28067B6900CAB185 /* HippySmartViewPagerView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippySmartViewPagerView.mm; sourceTree = """"; }; +- F45D262E28067B6900CAB185 /* HippyNavigatorRootViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HippyNavigatorRootViewController.m; sourceTree = """"; }; +- F45D262F28067B6900CAB185 /* HippyNavigatorItemViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HippyNavigatorItemViewController.m; sourceTree = """"; }; +- F45D263028067B6900CAB185 /* HippyNavigatorHostView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyNavigatorHostView.mm; sourceTree = """"; }; +- F45D263128067B6900CAB185 /* HippyNavigationControllerAnimator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HippyNavigationControllerAnimator.m; sourceTree = """"; }; +- F45D263228067B6900CAB185 /* HippyNavigatorViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyNavigatorViewManager.h; sourceTree = """"; }; +- F45D263328067B6900CAB185 /* HippyNavigatorItemViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyNavigatorItemViewController.h; sourceTree = """"; }; +- F45D263428067B6900CAB185 /* HippyNavigatorRootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyNavigatorRootViewController.h; sourceTree = """"; }; +- F45D263528067B6900CAB185 /* HippyNavigationControllerAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyNavigationControllerAnimator.h; sourceTree = """"; }; +- F45D263628067B6900CAB185 /* HippyNavigatorViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyNavigatorViewManager.mm; sourceTree = """"; }; +- F45D263728067B6900CAB185 /* HippyNavigatorHostView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyNavigatorHostView.h; sourceTree = """"; }; +- F45D263928067B6900CAB185 /* HippyFooterRefreshManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyFooterRefreshManager.mm; sourceTree = """"; }; +- F45D263A28067B6900CAB185 /* HippyFooterRefresh.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyFooterRefresh.mm; sourceTree = """"; }; +- F45D263B28067B6900CAB185 /* HippyFooterRefreshManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyFooterRefreshManager.h; sourceTree = """"; }; +- F45D263C28067B6900CAB185 /* HippyFooterRefresh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyFooterRefresh.h; sourceTree = """"; }; +- F45D263E28067B6900CAB185 /* HippyShadowText.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyShadowText.mm; sourceTree = """"; }; +- F45D263F28067B6900CAB185 /* HippyShadowText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyShadowText.h; sourceTree = """"; }; +- F45D264028067B6900CAB185 /* HippyText.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyText.mm; sourceTree = """"; }; +- F45D264128067B6900CAB185 /* HippyText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyText.h; sourceTree = """"; }; +- F45D264228067B6900CAB185 /* HippyTextDecorationLineType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyTextDecorationLineType.h; sourceTree = """"; }; +- F45D264328067B6900CAB185 /* HippyTextManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyTextManager.mm; sourceTree = """"; }; +- F45D264428067B6900CAB185 /* HippyTextManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyTextManager.h; sourceTree = """"; }; +- F45D264628067B6900CAB185 /* HippyModalCustomAnimationTransition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyModalCustomAnimationTransition.h; sourceTree = """"; }; +- F45D264728067B6900CAB185 /* HippyModalCustomPresentationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HippyModalCustomPresentationController.m; sourceTree = """"; }; +- F45D264828067B6900CAB185 /* HippyModalHostViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyModalHostViewManager.mm; sourceTree = """"; }; +- F45D264928067B6900CAB185 /* HippyModalTransitioningDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyModalTransitioningDelegate.mm; sourceTree = """"; }; +- F45D264A28067B6900CAB185 /* HippyModalHostViewInteractor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyModalHostViewInteractor.h; sourceTree = """"; }; +- F45D264B28067B6900CAB185 /* HippyModalCustomPresentationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyModalCustomPresentationController.h; sourceTree = """"; }; +- F45D264C28067B6900CAB185 /* HippyModalCustomAnimationTransition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HippyModalCustomAnimationTransition.m; sourceTree = """"; }; +- F45D264D28067B6900CAB185 /* HippyModalHostViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyModalHostViewManager.h; sourceTree = """"; }; +- F45D264E28067B6900CAB185 /* HippyModalHostViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyModalHostViewController.mm; sourceTree = """"; }; +- F45D264F28067B6900CAB185 /* HippyModalHostViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyModalHostViewController.h; sourceTree = """"; }; +- F45D265028067B6900CAB185 /* HippyModalHostView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyModalHostView.mm; sourceTree = """"; }; +- F45D265128067B6900CAB185 /* HippyModalTransitioningDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyModalTransitioningDelegate.h; sourceTree = """"; }; +- F45D265228067B6900CAB185 /* HippyModalHostView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyModalHostView.h; sourceTree = """"; }; ++ F45D262028067B6900CAB185 /* NativeRenderViewEventType.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderViewEventType.mm; sourceTree = """"; }; ++ F45D262128067B6900CAB185 /* NativeRenderTouchesProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderTouchesProtocol.h; sourceTree = """"; }; ++ F45D262228067B6900CAB185 /* NativeRenderTouchesView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderTouchesView.mm; sourceTree = """"; }; ++ F45D262328067B6900CAB185 /* NativeRenderViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderViewManager.h; sourceTree = """"; }; ++ F45D262428067B6900CAB185 /* UIView+NativeRender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ""UIView+NativeRender.h""; sourceTree = """"; }; ++ F45D262628067B6900CAB185 /* NativeRenderBorderDrawing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderBorderDrawing.h; sourceTree = """"; }; ++ F45D262728067B6900CAB185 /* NativeRenderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderView.h; sourceTree = """"; }; ++ F45D262928067B6900CAB185 /* NativeRenderSmartViewPagerViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderSmartViewPagerViewManager.mm; sourceTree = """"; }; ++ F45D262A28067B6900CAB185 /* NativeRenderSmartViewPagerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderSmartViewPagerView.h; sourceTree = """"; }; ++ F45D262B28067B6900CAB185 /* NativeRenderSmartViewPagerViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderSmartViewPagerViewManager.h; sourceTree = """"; }; ++ F45D262C28067B6900CAB185 /* NativeRenderSmartViewPagerView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderSmartViewPagerView.mm; sourceTree = """"; }; ++ F45D262E28067B6900CAB185 /* NativeRenderNavigatorRootViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeRenderNavigatorRootViewController.m; sourceTree = """"; }; ++ F45D262F28067B6900CAB185 /* NativeRenderNavigatorItemViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeRenderNavigatorItemViewController.m; sourceTree = """"; }; ++ F45D263028067B6900CAB185 /* NativeRenderNavigatorHostView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderNavigatorHostView.mm; sourceTree = """"; }; ++ F45D263128067B6900CAB185 /* NativeRenderNavigationControllerAnimator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeRenderNavigationControllerAnimator.m; sourceTree = """"; }; ++ F45D263228067B6900CAB185 /* NativeRenderNavigatorViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderNavigatorViewManager.h; sourceTree = """"; }; ++ F45D263328067B6900CAB185 /* NativeRenderNavigatorItemViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderNavigatorItemViewController.h; sourceTree = """"; }; ++ F45D263428067B6900CAB185 /* NativeRenderNavigatorRootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderNavigatorRootViewController.h; sourceTree = """"; }; ++ F45D263528067B6900CAB185 /* NativeRenderNavigationControllerAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderNavigationControllerAnimator.h; sourceTree = """"; }; ++ F45D263628067B6900CAB185 /* NativeRenderNavigatorViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderNavigatorViewManager.mm; sourceTree = """"; }; ++ F45D263728067B6900CAB185 /* NativeRenderNavigatorHostView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderNavigatorHostView.h; sourceTree = """"; }; ++ F45D263928067B6900CAB185 /* NativeRenderFooterRefreshManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderFooterRefreshManager.mm; sourceTree = """"; }; ++ F45D263A28067B6900CAB185 /* NativeRenderFooterRefresh.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderFooterRefresh.mm; sourceTree = """"; }; ++ F45D263B28067B6900CAB185 /* NativeRenderFooterRefreshManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderFooterRefreshManager.h; sourceTree = """"; }; ++ F45D263C28067B6900CAB185 /* NativeRenderFooterRefresh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderFooterRefresh.h; sourceTree = """"; }; ++ F45D263E28067B6900CAB185 /* NativeRenderObjectText.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderObjectText.mm; sourceTree = """"; }; ++ F45D263F28067B6900CAB185 /* NativeRenderObjectText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderObjectText.h; sourceTree = """"; }; ++ F45D264028067B6900CAB185 /* NativeRenderText.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderText.mm; sourceTree = """"; }; ++ F45D264128067B6900CAB185 /* NativeRenderText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderText.h; sourceTree = """"; }; ++ F45D264228067B6900CAB185 /* NativeRenderTextDecorationLineType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderTextDecorationLineType.h; sourceTree = """"; }; ++ F45D264328067B6900CAB185 /* NativeRenderTextManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderTextManager.mm; sourceTree = """"; }; ++ F45D264428067B6900CAB185 /* NativeRenderTextManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderTextManager.h; sourceTree = """"; }; ++ F45D264628067B6900CAB185 /* NativeRenderModalCustomAnimationTransition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderModalCustomAnimationTransition.h; sourceTree = """"; }; ++ F45D264728067B6900CAB185 /* NativeRenderModalCustomPresentationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeRenderModalCustomPresentationController.m; sourceTree = """"; }; ++ F45D264828067B6900CAB185 /* NativeRenderModalHostViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderModalHostViewManager.mm; sourceTree = """"; }; ++ F45D264928067B6900CAB185 /* NativeRenderModalTransitioningDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderModalTransitioningDelegate.mm; sourceTree = """"; }; ++ F45D264A28067B6900CAB185 /* NativeRenderModalHostViewInteractor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderModalHostViewInteractor.h; sourceTree = """"; }; ++ F45D264B28067B6900CAB185 /* NativeRenderModalCustomPresentationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderModalCustomPresentationController.h; sourceTree = """"; }; ++ F45D264C28067B6900CAB185 /* NativeRenderModalCustomAnimationTransition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeRenderModalCustomAnimationTransition.m; sourceTree = """"; }; ++ F45D264D28067B6900CAB185 /* NativeRenderModalHostViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderModalHostViewManager.h; sourceTree = """"; }; ++ F45D264E28067B6900CAB185 /* NativeRenderModalHostViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderModalHostViewController.mm; sourceTree = """"; }; ++ F45D264F28067B6900CAB185 /* NativeRenderModalHostViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderModalHostViewController.h; sourceTree = """"; }; ++ F45D265028067B6900CAB185 /* NativeRenderModalHostView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderModalHostView.mm; sourceTree = """"; }; ++ F45D265128067B6900CAB185 /* NativeRenderModalTransitioningDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderModalTransitioningDelegate.h; sourceTree = """"; }; ++ F45D265228067B6900CAB185 /* NativeRenderModalHostView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderModalHostView.h; sourceTree = """"; }; + F468DDBA2812A95100319196 /* HippyOCTurboModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyOCTurboModule.h; sourceTree = """"; }; + F468DDBB2812A95100319196 /* HippyTurboModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyTurboModule.h; sourceTree = """"; }; + F468DDBC2812A95100319196 /* HippyTurboModuleManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyTurboModuleManager.h; sourceTree = """"; }; +@@ -581,9 +574,7 @@ + F468DDEC2812A95100319196 /* HippyClipboardModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HippyClipboardModule.m; sourceTree = """"; }; + F468DDEF2812A95100319196 /* HippyErrorCustomizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyErrorCustomizer.h; sourceTree = """"; }; + F468DDF02812A95100319196 /* HippyErrorInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyErrorInfo.h; sourceTree = """"; }; +- F468DDF12812A95100319196 /* HippyLogging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyLogging.h; sourceTree = """"; }; + F468DDF22812A95100319196 /* HippyAssert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HippyAssert.m; sourceTree = """"; }; +- F468DDF32812A95100319196 /* HippyLogging.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyLogging.mm; sourceTree = """"; }; + F468DDF42812A95100319196 /* HippyNullability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyNullability.h; sourceTree = """"; }; + F468DDF52812A95100319196 /* HippyErrorInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HippyErrorInfo.m; sourceTree = """"; }; + F468DDF62812A95100319196 /* HippyAssert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyAssert.h; sourceTree = """"; }; +@@ -638,19 +629,18 @@ + F468DE372812A95200319196 /* HippySRWebSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippySRWebSocket.h; sourceTree = """"; }; + F468DE3A2812A95200319196 /* HippyDevInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyDevInfo.h; sourceTree = """"; }; + F468DE522812A95200319196 /* HippyDevInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HippyDevInfo.m; sourceTree = """"; }; +- F468DE922812ACE900319196 /* HippyAnimationType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyAnimationType.h; sourceTree = """"; }; +- F468DE932812ACE900319196 /* HippyComponentData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyComponentData.h; sourceTree = """"; }; +- F468DE942812ACE900319196 /* HippyComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyComponent.h; sourceTree = """"; }; +- F468DE952812ACE900319196 /* HippyAutoInsetsProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyAutoInsetsProtocol.h; sourceTree = """"; }; +- F468DE962812ACEA00319196 /* HippyComponentData.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyComponentData.mm; sourceTree = """"; }; +- F468DE972812ACEA00319196 /* HippyRootShadowView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyRootShadowView.mm; sourceTree = """"; }; +- F468DE982812ACEA00319196 /* HippyScrollProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyScrollProtocol.h; sourceTree = """"; }; +- F468DE992812ACEA00319196 /* HippyFont.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyFont.mm; sourceTree = """"; }; +- F468DE9A2812ACEA00319196 /* HippyMemoryOpt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyMemoryOpt.h; sourceTree = """"; }; +- F468DE9B2812ACEA00319196 /* HippyFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyFont.h; sourceTree = """"; }; +- F468DE9C2812ACEA00319196 /* HippyRootShadowView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyRootShadowView.h; sourceTree = """"; }; +- F473F13F2859C37100422C1A /* HippyComponentMap.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyComponentMap.mm; sourceTree = """"; }; +- F473F1442859C37100422C1A /* HippyComponentMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyComponentMap.h; sourceTree = """"; }; ++ F468DE922812ACE900319196 /* NativeRenderAnimationType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderAnimationType.h; sourceTree = """"; }; ++ F468DE932812ACE900319196 /* NativeRenderComponentData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderComponentData.h; sourceTree = """"; }; ++ F468DE942812ACE900319196 /* NativeRenderComponentProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderComponentProtocol.h; sourceTree = """"; }; ++ F468DE952812ACE900319196 /* NativeRenderAutoInsetsProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderAutoInsetsProtocol.h; sourceTree = """"; }; ++ F468DE962812ACEA00319196 /* NativeRenderComponentData.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderComponentData.mm; sourceTree = """"; }; ++ F468DE972812ACEA00319196 /* NativeRenderObjectRootView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderObjectRootView.mm; sourceTree = """"; }; ++ F468DE982812ACEA00319196 /* NativeRenderScrollProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderScrollProtocol.h; sourceTree = """"; }; ++ F468DE992812ACEA00319196 /* NativeRenderFont.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderFont.mm; sourceTree = """"; }; ++ F468DE9B2812ACEA00319196 /* NativeRenderFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderFont.h; sourceTree = """"; }; ++ F468DE9C2812ACEA00319196 /* NativeRenderObjectRootView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderObjectRootView.h; sourceTree = """"; }; ++ F473F13F2859C37100422C1A /* NativeRenderComponentMap.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderComponentMap.mm; sourceTree = """"; }; ++ F473F1442859C37100422C1A /* NativeRenderComponentMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderComponentMap.h; sourceTree = """"; }; + F4810952277062A1005C221B /* layer_optimized_render_manager.h */ = {isa = PBXFileReference; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = layer_optimized_render_manager.h; sourceTree = """"; tabWidth = 2; }; + F4810953277062AD005C221B /* layer_optimized_render_manager.cc */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = layer_optimized_render_manager.cc; sourceTree = """"; tabWidth = 2; }; + F482918B274E420C00D91128 /* HPStyle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HPStyle.cpp; sourceTree = """"; }; +@@ -668,43 +658,39 @@ + F4829197274E420C00D91128 /* HPLayoutCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HPLayoutCache.cpp; sourceTree = """"; }; + F4829198274E420C00D91128 /* HPUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HPUtil.h; sourceTree = """"; }; + F4829199274E420C00D91128 /* HPStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HPStyle.h; sourceTree = """"; }; +- F487A001284E28AA0068A9F6 /* HippyInvalidating.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyInvalidating.h; sourceTree = """"; }; +- F4A8423E27D38CF900AEFC88 /* HippyUIManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyUIManager.h; sourceTree = """"; }; ++ F487A001284E28AA0068A9F6 /* NativeRenderInvalidating.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderInvalidating.h; sourceTree = """"; }; ++ F4A8423E27D38CF900AEFC88 /* NativeRenderUIManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderUIManager.h; sourceTree = """"; }; + F4A8423F27D38CF900AEFC88 /* NativeRenderManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderManager.mm; sourceTree = """"; }; + F4A8424027D38CF900AEFC88 /* NativeRenderManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderManager.h; sourceTree = """"; }; +- F4A8424127D38CF900AEFC88 /* HippyUIManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyUIManager.mm; sourceTree = """"; }; +- F4A8424427D38D7900AEFC88 /* HippyRenderContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HippyRenderContext.h; sourceTree = """"; }; +- F4B938F62840B58C00187AFA /* HippyWaterfallViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HippyWaterfallViewCell.h; sourceTree = """"; }; +- F4B938F72840B58C00187AFA /* HippyWaterfallViewCell.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyWaterfallViewCell.mm; sourceTree = """"; }; +- F4B938F92840C93C00187AFA /* HippyWatefallItemShadowView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HippyWatefallItemShadowView.h; sourceTree = """"; }; +- F4B938FA2840C93C00187AFA /* HippyWatefallItemShadowView.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyWatefallItemShadowView.mm; sourceTree = """"; }; +- F4BD045927D5E39F00339A2C /* HippyFrameworkProxy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HippyFrameworkProxy.h; sourceTree = """"; }; ++ F4A8424127D38CF900AEFC88 /* NativeRenderUIManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderUIManager.mm; sourceTree = """"; }; ++ F4A8424427D38D7900AEFC88 /* NativeRenderContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NativeRenderContext.h; sourceTree = """"; }; ++ F4B938F62840B58C00187AFA /* NativeRenderWaterfallViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NativeRenderWaterfallViewCell.h; sourceTree = """"; }; ++ F4B938F72840B58C00187AFA /* NativeRenderWaterfallViewCell.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderWaterfallViewCell.mm; sourceTree = """"; }; ++ F4B938F92840C93C00187AFA /* NativeRenderObjectWatefallItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NativeRenderObjectWatefallItem.h; sourceTree = """"; }; ++ F4B938FA2840C93C00187AFA /* NativeRenderObjectWatefallItem.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderObjectWatefallItem.mm; sourceTree = """"; }; ++ F4BD045927D5E39F00339A2C /* NativeRenderFrameworkProxy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NativeRenderFrameworkProxy.h; sourceTree = """"; }; + F4C1CE21281131EB00CED4C4 /* NSData+DataType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ""NSData+DataType.h""; sourceTree = """"; }; + F4C1CE22281131EC00CED4C4 /* NSData+DataType.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ""NSData+DataType.m""; sourceTree = """"; }; + F4C1CE242811439A00CED4C4 /* UIView+Sequence.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ""UIView+Sequence.h""; sourceTree = """"; }; + F4C1CE252811439A00CED4C4 /* UIView+Sequence.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ""UIView+Sequence.m""; sourceTree = """"; }; +- F4C1DAA32811795200CED4C4 /* HippyLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyLog.h; sourceTree = """"; }; +- F4C1DAA42811795200CED4C4 /* HippyLog.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyLog.mm; sourceTree = """"; }; +- F4C1DAA628117C1800CED4C4 /* NSArray+HippyArrayDeepCopy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ""NSArray+HippyArrayDeepCopy.m""; sourceTree = """"; }; +- F4C1DAA728117C1800CED4C4 /* NSDictionary+HippyDictionaryDeepCopy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ""NSDictionary+HippyDictionaryDeepCopy.m""; sourceTree = """"; }; +- F4C1DAA828117C1800CED4C4 /* NSNumber+HippyNumberDeepCopy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ""NSNumber+HippyNumberDeepCopy.m""; sourceTree = """"; }; +- F4C1DAA928117C1800CED4C4 /* NSNumber+HippyNumberDeepCopy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ""NSNumber+HippyNumberDeepCopy.h""; sourceTree = """"; }; +- F4C1DAAA28117C1800CED4C4 /* NSArray+HippyArrayDeepCopy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ""NSArray+HippyArrayDeepCopy.h""; sourceTree = """"; }; +- F4C1DAAB28117C1900CED4C4 /* NSDictionary+HippyDictionaryDeepCopy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ""NSDictionary+HippyDictionaryDeepCopy.h""; sourceTree = """"; }; +- F4C1DAAC28117C1900CED4C4 /* HippyDeepCopyProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyDeepCopyProtocol.h; sourceTree = """"; }; +- F4CEDF9327D858C700583C9E /* HippyDefaultImageProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyDefaultImageProvider.h; sourceTree = """"; }; +- F4CEDF9427D858C700583C9E /* HippyImageDataLoader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HippyImageDataLoader.m; sourceTree = """"; }; +- F4CEDF9527D858C700583C9E /* HippyImageDataLoaderProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyImageDataLoaderProtocol.h; sourceTree = """"; }; +- F4CEDF9627D858C700583C9E /* HippyDownloadTask.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HippyDownloadTask.m; sourceTree = """"; }; +- F4CEDF9727D858C700583C9E /* HippyDownloadTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyDownloadTask.h; sourceTree = """"; }; +- F4CEDF9827D858C700583C9E /* HippyImageDataLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyImageDataLoader.h; sourceTree = """"; }; +- F4CEDF9927D858C700583C9E /* HippyDefaultImageProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HippyDefaultImageProvider.m; sourceTree = """"; }; +- F4CEDF9A27D858C700583C9E /* HippyImageProviderProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyImageProviderProtocol.h; sourceTree = """"; }; ++ F4C1DAA32811795200CED4C4 /* NativeRenderLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderLog.h; sourceTree = """"; }; ++ F4C1DAA42811795200CED4C4 /* NativeRenderLog.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeRenderLog.mm; sourceTree = """"; }; ++ F4C1DAAC28117C1900CED4C4 /* NativeRenderDeepCopyProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderDeepCopyProtocol.h; sourceTree = """"; }; ++ F4CEDF9327D858C700583C9E /* NativeRenderDefaultImageProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderDefaultImageProvider.h; sourceTree = """"; }; ++ F4CEDF9427D858C700583C9E /* NativeRenderImageDataLoader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeRenderImageDataLoader.m; sourceTree = """"; }; ++ F4CEDF9527D858C700583C9E /* NativeRenderImageDataLoaderProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderImageDataLoaderProtocol.h; sourceTree = """"; }; ++ F4CEDF9627D858C700583C9E /* NativeRenderDownloadTask.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeRenderDownloadTask.m; sourceTree = """"; }; ++ F4CEDF9727D858C700583C9E /* NativeRenderDownloadTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderDownloadTask.h; sourceTree = """"; }; ++ F4CEDF9827D858C700583C9E /* NativeRenderImageDataLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderImageDataLoader.h; sourceTree = """"; }; ++ F4CEDF9927D858C700583C9E /* NativeRenderDefaultImageProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeRenderDefaultImageProvider.m; sourceTree = """"; }; ++ F4CEDF9A27D858C700583C9E /* NativeRenderImageProviderProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderImageProviderProtocol.h; sourceTree = """"; }; + F4E7B434276C61DC00F17139 /* dom_argument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dom_argument.h; sourceTree = """"; }; + F4E7B437276C61DC00F17139 /* diff_utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = diff_utils.h; sourceTree = """"; }; + F4E7B438276C61DC00F17139 /* dom_event.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dom_event.h; sourceTree = """"; }; + F4E7B439276C61EA00F17139 /* dom_argument.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dom_argument.cc; sourceTree = """"; }; + F4E7B43A276C61EB00F17139 /* dom_event.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dom_event.cc; sourceTree = """"; }; ++ F4F1FCB0286C44BE005B39D4 /* HippyDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippyDefines.h; sourceTree = """"; }; ++ F4F1FCB1286C4A0C005B39D4 /* NativeRenderDefines.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NativeRenderDefines.h; sourceTree = """"; }; + /* End PBXFileReference section */ + + /* Begin PBXFrameworksBuildPhase section */ +@@ -872,7 +858,6 @@ + isa = PBXGroup; + children = ( + D84AB921273A618B00987D03 /* include */, +- D84AB949273A618B00987D03 /* third_party */, + D84AB966273A618B00987D03 /* src */, + ); + name = core; +@@ -952,13 +937,6 @@ + path = jsc; + sourceTree = """"; + }; +- D84AB949273A618B00987D03 /* third_party */ = { +- isa = PBXGroup; +- children = ( +- ); +- path = third_party; +- sourceTree = """"; +- }; + D84AB966273A618B00987D03 /* src */ = { + isa = PBXGroup; + children = ( +@@ -1212,11 +1190,11 @@ + F45D25AB28067B6900CAB185 /* scrollview */ = { + isa = PBXGroup; + children = ( +- F45D25AC28067B6900CAB185 /* HippyScrollableProtocol.h */, +- F45D25AD28067B6900CAB185 /* HippyScrollView.mm */, +- F45D25AE28067B6900CAB185 /* HippyScrollViewManager.h */, +- F45D25AF28067B6900CAB185 /* HippyScrollView.h */, +- F45D25B028067B6900CAB185 /* HippyScrollViewManager.mm */, ++ F45D25AC28067B6900CAB185 /* NativeRenderScrollableProtocol.h */, ++ F45D25AD28067B6900CAB185 /* NativeRenderScrollView.mm */, ++ F45D25AE28067B6900CAB185 /* NativeRenderScrollViewManager.h */, ++ F45D25AF28067B6900CAB185 /* NativeRenderScrollView.h */, ++ F45D25B028067B6900CAB185 /* NativeRenderScrollViewManager.mm */, + ); + path = scrollview; + sourceTree = """"; +@@ -1224,14 +1202,14 @@ + F45D25B128067B6900CAB185 /* refreshview */ = { + isa = PBXGroup; + children = ( +- F45D25B228067B6900CAB185 /* HippyRefreshWrapperItemViewManager.h */, +- F45D25B328067B6900CAB185 /* HippyRefreshWrapperItemView.mm */, +- F45D25B428067B6900CAB185 /* HippyRefreshWrapper.mm */, +- F45D25B528067B6900CAB185 /* HippyRefreshWrapperItemView.h */, +- F45D25B628067B6900CAB185 /* HippyRefreshWrapperViewManager.mm */, +- F45D25B728067B6900CAB185 /* HippyRefreshWrapper.h */, +- F45D25B828067B6900CAB185 /* HippyRefreshWrapperViewManager.h */, +- F45D25B928067B6900CAB185 /* HippyRefreshWrapperItemViewManager.mm */, ++ F45D25B228067B6900CAB185 /* NativeRenderRefreshWrapperItemViewManager.h */, ++ F45D25B328067B6900CAB185 /* NativeRenderRefreshWrapperItemView.mm */, ++ F45D25B428067B6900CAB185 /* NativeRenderRefreshWrapper.mm */, ++ F45D25B528067B6900CAB185 /* NativeRenderRefreshWrapperItemView.h */, ++ F45D25B628067B6900CAB185 /* NativeRenderRefreshWrapperViewManager.mm */, ++ F45D25B728067B6900CAB185 /* NativeRenderRefreshWrapper.h */, ++ F45D25B828067B6900CAB185 /* NativeRenderRefreshWrapperViewManager.h */, ++ F45D25B928067B6900CAB185 /* NativeRenderRefreshWrapperItemViewManager.mm */, + ); + path = refreshview; + sourceTree = """"; +@@ -1239,8 +1217,8 @@ + F45D25BA28067B6900CAB185 /* refresh */ = { + isa = PBXGroup; + children = ( +- F45D25BB28067B6900CAB185 /* HippyRefresh.h */, +- F45D25BC28067B6900CAB185 /* HippyRefresh.mm */, ++ F45D25BB28067B6900CAB185 /* NativeRenderRefresh.h */, ++ F45D25BC28067B6900CAB185 /* NativeRenderRefresh.mm */, + ); + path = refresh; + sourceTree = """"; +@@ -1248,14 +1226,14 @@ + F45D25BD28067B6900CAB185 /* viewPager */ = { + isa = PBXGroup; + children = ( +- F45D25BE28067B6900CAB185 /* HippyViewPagerItemManager.h */, +- F45D25BF28067B6900CAB185 /* HippyViewPagerItem.h */, +- F45D25C028067B6900CAB185 /* HippyViewPager.h */, +- F45D25C128067B6900CAB185 /* HippyViewPager.mm */, +- F45D25C228067B6900CAB185 /* HippyViewPagerManager.mm */, +- F45D25C328067B6900CAB185 /* HippyViewPagerItem.mm */, +- F45D25C428067B6900CAB185 /* HippyViewPagerManager.h */, +- F45D25C528067B6900CAB185 /* HippyViewPagerItemManager.mm */, ++ F45D25BE28067B6900CAB185 /* NativeRenderViewPagerItemManager.h */, ++ F45D25BF28067B6900CAB185 /* NativeRenderViewPagerItem.h */, ++ F45D25C028067B6900CAB185 /* NativeRenderViewPager.h */, ++ F45D25C128067B6900CAB185 /* NativeRenderViewPager.mm */, ++ F45D25C228067B6900CAB185 /* NativeRenderViewPagerManager.mm */, ++ F45D25C328067B6900CAB185 /* NativeRenderViewPagerItem.mm */, ++ F45D25C428067B6900CAB185 /* NativeRenderViewPagerManager.h */, ++ F45D25C528067B6900CAB185 /* NativeRenderViewPagerItemManager.mm */, + ); + path = viewPager; + sourceTree = """"; +@@ -1263,18 +1241,18 @@ + F45D25C628067B6900CAB185 /* textinput */ = { + isa = PBXGroup; + children = ( +- F45D25C728067B6900CAB185 /* HippyBaseTextInput.h */, +- F45D25C828067B6900CAB185 /* HippyTextView.mm */, +- F45D25C928067B6900CAB185 /* HippyBaseTextInput.mm */, +- F45D25CA28067B6900CAB185 /* HippyTextViewManager.mm */, +- F45D25CB28067B6900CAB185 /* HippyTextField.h */, +- F45D25CC28067B6900CAB185 /* HippyShadowTextView.mm */, +- F45D25CD28067B6900CAB185 /* HippyTextSelection.h */, +- F45D25CE28067B6900CAB185 /* HippyTextViewManager.h */, +- F45D25CF28067B6900CAB185 /* HippyShadowTextView.h */, +- F45D25D028067B6900CAB185 /* HippyTextView.h */, +- F45D25D128067B6900CAB185 /* HippyTextField.mm */, +- F45D25D228067B6900CAB185 /* HippyTextSelection.m */, ++ F45D25C728067B6900CAB185 /* NativeRenderBaseTextInput.h */, ++ F45D25C828067B6900CAB185 /* NativeRenderTextView.mm */, ++ F45D25C928067B6900CAB185 /* NativeRenderBaseTextInput.mm */, ++ F45D25CA28067B6900CAB185 /* NativeRenderTextViewManager.mm */, ++ F45D25CB28067B6900CAB185 /* NativeRenderTextField.h */, ++ F45D25CC28067B6900CAB185 /* NativeRenderObjectTextView.mm */, ++ F45D25CD28067B6900CAB185 /* NativeRenderTextSelection.h */, ++ F45D25CE28067B6900CAB185 /* NativeRenderTextViewManager.h */, ++ F45D25CF28067B6900CAB185 /* NativeRenderObjectTextView.h */, ++ F45D25D028067B6900CAB185 /* NativeRenderTextView.h */, ++ F45D25D128067B6900CAB185 /* NativeRenderTextField.mm */, ++ F45D25D228067B6900CAB185 /* NativeRenderTextSelection.m */, + ); + path = textinput; + sourceTree = """"; +@@ -1282,10 +1260,10 @@ + F45D25D328067B6900CAB185 /* webview */ = { + isa = PBXGroup; + children = ( +- F45D25D428067B6900CAB185 /* HippySimpleWebView.h */, +- F45D25D528067B6900CAB185 /* HippySimpleWebViewManager.h */, +- F45D25D628067B6900CAB185 /* HippySimpleWebView.m */, +- F45D25D728067B6900CAB185 /* HippySimpleWebViewManager.mm */, ++ F45D25D428067B6900CAB185 /* NativeRenderSimpleWebView.h */, ++ F45D25D528067B6900CAB185 /* NativeRenderSimpleWebViewManager.h */, ++ F45D25D628067B6900CAB185 /* NativeRenderSimpleWebView.m */, ++ F45D25D728067B6900CAB185 /* NativeRenderSimpleWebViewManager.mm */, + ); + path = webview; + sourceTree = """"; +@@ -1293,10 +1271,10 @@ + F45D25D828067B6900CAB185 /* headerrefresh */ = { + isa = PBXGroup; + children = ( +- F45D25D928067B6900CAB185 /* HippyHeaderRefreshManager.mm */, +- F45D25DA28067B6900CAB185 /* HippyHeaderRefreshManager.h */, +- F45D25DB28067B6900CAB185 /* HippyHeaderRefresh.mm */, +- F45D25DC28067B6900CAB185 /* HippyHeaderRefresh.h */, ++ F45D25D928067B6900CAB185 /* NativeRenderHeaderRefreshManager.mm */, ++ F45D25DA28067B6900CAB185 /* NativeRenderHeaderRefreshManager.h */, ++ F45D25DB28067B6900CAB185 /* NativeRenderHeaderRefresh.mm */, ++ F45D25DC28067B6900CAB185 /* NativeRenderHeaderRefresh.h */, + ); + path = headerrefresh; + sourceTree = """"; +@@ -1304,22 +1282,22 @@ + F45D25DD28067B6900CAB185 /* waterfalllist */ = { + isa = PBXGroup; + children = ( +- F45D25DE28067B6900CAB185 /* HippyWaterfallView.mm */, +- F45D25DF28067B6900CAB185 /* HippyWaterfallViewDataSource.h */, +- F45D25E028067B6900CAB185 /* HippyWaterfallItemViewManager.h */, +- F45D25E128067B6900CAB185 /* HippyCollectionViewWaterfallLayout.h */, +- F45D25E228067B6900CAB185 /* HippyWaterfallItemView.h */, +- F45D25E328067B6900CAB185 /* HippyWaterfallViewManager.h */, +- F45D25E428067B6900CAB185 /* HippyWaterfallViewDataSource.mm */, +- F45D25E528067B6900CAB185 /* HippyWaterfallViewManager.mm */, +- F45D25E628067B6900CAB185 /* HippyWaterfallItemView.mm */, +- F45D25E728067B6900CAB185 /* HippyCollectionViewWaterfallLayout.m */, +- F45D25E828067B6900CAB185 /* HippyWaterfallItemViewManager.mm */, +- F45D25E928067B6900CAB185 /* HippyWaterfallView.h */, +- F4B938F62840B58C00187AFA /* HippyWaterfallViewCell.h */, +- F4B938F72840B58C00187AFA /* HippyWaterfallViewCell.mm */, +- F4B938F92840C93C00187AFA /* HippyWatefallItemShadowView.h */, +- F4B938FA2840C93C00187AFA /* HippyWatefallItemShadowView.mm */, ++ F45D25DE28067B6900CAB185 /* NativeRenderWaterfallView.mm */, ++ F45D25DF28067B6900CAB185 /* NativeRenderWaterfallViewDataSource.h */, ++ F45D25E028067B6900CAB185 /* NativeRenderWaterfallItemViewManager.h */, ++ F45D25E128067B6900CAB185 /* NativeRenderCollectionViewWaterfallLayout.h */, ++ F45D25E228067B6900CAB185 /* NativeRenderWaterfallItemView.h */, ++ F45D25E328067B6900CAB185 /* NativeRenderWaterfallViewManager.h */, ++ F45D25E428067B6900CAB185 /* NativeRenderWaterfallViewDataSource.mm */, ++ F45D25E528067B6900CAB185 /* NativeRenderWaterfallViewManager.mm */, ++ F45D25E628067B6900CAB185 /* NativeRenderWaterfallItemView.mm */, ++ F45D25E728067B6900CAB185 /* NativeRenderCollectionViewWaterfallLayout.m */, ++ F45D25E828067B6900CAB185 /* NativeRenderWaterfallItemViewManager.mm */, ++ F45D25E928067B6900CAB185 /* NativeRenderWaterfallView.h */, ++ F4B938F62840B58C00187AFA /* NativeRenderWaterfallViewCell.h */, ++ F4B938F72840B58C00187AFA /* NativeRenderWaterfallViewCell.mm */, ++ F4B938F92840C93C00187AFA /* NativeRenderObjectWatefallItem.h */, ++ F4B938FA2840C93C00187AFA /* NativeRenderObjectWatefallItem.mm */, + ); + path = waterfalllist; + sourceTree = """"; +@@ -1329,18 +1307,18 @@ + children = ( + F4C1CE242811439A00CED4C4 /* UIView+Sequence.h */, + F4C1CE252811439A00CED4C4 /* UIView+Sequence.m */, +- F45D25EB28067B6900CAB185 /* HippyImageViewManager.h */, +- F45D25EC28067B6900CAB185 /* HippyImageView.m */, +- F45D25ED28067B6900CAB185 /* HippyAnimatedImageView.h */, +- F45D25EE28067B6900CAB185 /* HippyImageCache.h */, +- F45D25EF28067B6900CAB185 /* HippyImageView+HippyTouchesImplementation.h */, +- F45D25F028067B6900CAB185 /* HippyAnimatedImage.m */, +- F45D25F128067B6900CAB185 /* HippyAnimatedImageView.m */, +- F45D25F228067B6900CAB185 /* HippyImageView.h */, +- F45D25F328067B6900CAB185 /* HippyImageViewManager.mm */, +- F45D25F428067B6900CAB185 /* HippyImageView+HippyTouchesImplementation.mm */, +- F45D25F528067B6900CAB185 /* HippyAnimatedImage.h */, +- F45D25F628067B6900CAB185 /* HippyImageCache.m */, ++ F45D25EB28067B6900CAB185 /* NativeRenderImageViewManager.h */, ++ F45D25EC28067B6900CAB185 /* NativeRenderImageView.m */, ++ F45D25ED28067B6900CAB185 /* NativeRenderAnimatedImageView.h */, ++ F45D25EE28067B6900CAB185 /* NativeRenderImageCache.h */, ++ F45D25EF28067B6900CAB185 /* NativeRenderImageView+NativeRenderTouchesImplementation.h */, ++ F45D25F028067B6900CAB185 /* NativeRenderAnimatedImage.m */, ++ F45D25F128067B6900CAB185 /* NativeRenderAnimatedImageView.m */, ++ F45D25F228067B6900CAB185 /* NativeRenderImageView.h */, ++ F45D25F328067B6900CAB185 /* NativeRenderImageViewManager.mm */, ++ F45D25F428067B6900CAB185 /* NativeRenderImageView+NativeRenderTouchesImplementation.mm */, ++ F45D25F528067B6900CAB185 /* NativeRenderAnimatedImage.h */, ++ F45D25F628067B6900CAB185 /* NativeRenderImageCache.m */, + ); + path = image; + sourceTree = """"; +@@ -1348,24 +1326,24 @@ + F45D25F728067B6900CAB185 /* listview */ = { + isa = PBXGroup; + children = ( +- F45D25F828067B6900CAB185 /* HippyBaseListItemView.h */, +- F45D25F928067B6900CAB185 /* HippyBaseListItemShadowView.mm */, +- F45D25FA28067B6900CAB185 /* HippyBaseListView.mm */, +- F45D25FB28067B6900CAB185 /* HippyListTableView.h */, +- F45D25FC28067B6900CAB185 /* HippyBaseListViewCell.mm */, +- F45D25FD28067B6900CAB185 /* HippyCollectionViewFlowLayout.h */, +- F45D25FE28067B6900CAB185 /* HippyBaseListViewManager.h */, +- F45D25FF28067B6900CAB185 /* HippyBaseListItemView.mm */, +- F45D260028067B6900CAB185 /* HippyBaseListViewManager.mm */, +- F45D260128067B6900CAB185 /* HippyBaseListItemViewManager.mm */, +- F45D260228067B6900CAB185 /* HippyBaseListView.h */, +- F45D260328067B6900CAB185 /* HippyBaseListViewCell.h */, +- F45D260428067B6900CAB185 /* HippyBaseListItemViewManager.h */, +- F45D260528067B6900CAB185 /* HippyBaseListItemShadowView.h */, +- F45D260628067B6900CAB185 /* HippyCollectionViewFlowLayout.m */, +- F45D260728067B6900CAB185 /* HippyListTableView.m */, +- F45D260828067B6900CAB185 /* HippyBaseListViewDataSource.h */, +- F45D260928067B6900CAB185 /* HippyBaseListViewDataSource.mm */, ++ F45D25F828067B6900CAB185 /* NativeRenderBaseListItemView.h */, ++ F45D25F928067B6900CAB185 /* NativeRenderObjectBaseListItem.mm */, ++ F45D25FA28067B6900CAB185 /* NativeRenderBaseListView.mm */, ++ F45D25FB28067B6900CAB185 /* NativeRenderListTableView.h */, ++ F45D25FC28067B6900CAB185 /* NativeRenderBaseListViewCell.mm */, ++ F45D25FD28067B6900CAB185 /* NativeRenderCollectionViewFlowLayout.h */, ++ F45D25FE28067B6900CAB185 /* NativeRenderBaseListViewManager.h */, ++ F45D25FF28067B6900CAB185 /* NativeRenderBaseListItemView.mm */, ++ F45D260028067B6900CAB185 /* NativeRenderBaseListViewManager.mm */, ++ F45D260128067B6900CAB185 /* NativeRenderBaseListItemViewManager.mm */, ++ F45D260228067B6900CAB185 /* NativeRenderBaseListView.h */, ++ F45D260328067B6900CAB185 /* NativeRenderBaseListViewCell.h */, ++ F45D260428067B6900CAB185 /* NativeRenderBaseListItemViewManager.h */, ++ F45D260528067B6900CAB185 /* NativeRenderObjectBaseListItem.h */, ++ F45D260628067B6900CAB185 /* NativeRenderCollectionViewFlowLayout.m */, ++ F45D260728067B6900CAB185 /* NativeRenderListTableView.m */, ++ F45D260828067B6900CAB185 /* NativeRenderBaseListViewDataSource.h */, ++ F45D260928067B6900CAB185 /* NativeRenderBaseListViewDataSource.mm */, + ); + path = listview; + sourceTree = """"; +@@ -1373,31 +1351,29 @@ + F45D260A28067B6900CAB185 /* view */ = { + isa = PBXGroup; + children = ( +- F45D260B28067B6900CAB185 /* UIView+AppearEvent.m */, +- F45D260C28067B6900CAB185 /* UIView+HippyEvent.h */, +- F45D260E28067B6900CAB185 /* UIView+Hippy.mm */, +- F45D260F28067B6900CAB185 /* HippyShadowView.h */, +- F45D261028067B6900CAB185 /* HippyPointerEvents.h */, +- F45D261128067B6900CAB185 /* HippyViewManager.mm */, ++ F45D260B28067B6900CAB185 /* UIView+MountEvent.m */, ++ F45D260C28067B6900CAB185 /* UIView+DomEvent.h */, ++ F45D260E28067B6900CAB185 /* UIView+NativeRender.mm */, ++ F45D260F28067B6900CAB185 /* NativeRenderObjectView.h */, ++ F45D261028067B6900CAB185 /* NativeRenderPointerEvents.h */, ++ F45D261128067B6900CAB185 /* NativeRenderViewManager.mm */, + F45D261228067B6900CAB185 /* UIView+DirectionalLayout.mm */, +- F45D261328067B6900CAB185 /* HippyView.mm */, +- F45D261428067B6900CAB185 /* HippyViewEventProtocol.h */, +- F45D261528067B6900CAB185 /* HippyBorderStyle.h */, +- F45D261628067B6900CAB185 /* HippyTouchesView.h */, +- F45D261828067B6900CAB185 /* HippyShadowView.mm */, +- F45D261928067B6900CAB185 /* HippyViewEventType.h */, +- F45D261A28067B6900CAB185 /* HippyBorderDrawing.m */, +- F45D261C28067B6900CAB185 /* UIView+HippyEvent.mm */, +- F45D261E28067B6900CAB185 /* UIView+AppearEvent.h */, ++ F45D261328067B6900CAB185 /* NativeRenderView.mm */, ++ F45D261528067B6900CAB185 /* NativeRenderBorderStyle.h */, ++ F45D261628067B6900CAB185 /* NativeRenderTouchesView.h */, ++ F45D261828067B6900CAB185 /* NativeRenderObjectView.mm */, ++ F45D261928067B6900CAB185 /* NativeRenderViewEventType.h */, ++ F45D261A28067B6900CAB185 /* NativeRenderBorderDrawing.m */, ++ F45D261C28067B6900CAB185 /* UIView+DomEvent.mm */, ++ F45D261E28067B6900CAB185 /* UIView+MountEvent.h */, + F45D261F28067B6900CAB185 /* UIView+DirectionalLayout.h */, +- F45D262028067B6900CAB185 /* HippyViewEventType.mm */, +- F45D262128067B6900CAB185 /* HippyTouchesProtocol.h */, +- F45D262228067B6900CAB185 /* HippyTouchesView.mm */, +- F45D262328067B6900CAB185 /* HippyViewManager.h */, +- F45D262428067B6900CAB185 /* UIView+Hippy.h */, +- F45D262528067B6900CAB185 /* UIView+Private.h */, +- F45D262628067B6900CAB185 /* HippyBorderDrawing.h */, +- F45D262728067B6900CAB185 /* HippyView.h */, ++ F45D262028067B6900CAB185 /* NativeRenderViewEventType.mm */, ++ F45D262128067B6900CAB185 /* NativeRenderTouchesProtocol.h */, ++ F45D262228067B6900CAB185 /* NativeRenderTouchesView.mm */, ++ F45D262328067B6900CAB185 /* NativeRenderViewManager.h */, ++ F45D262428067B6900CAB185 /* UIView+NativeRender.h */, ++ F45D262628067B6900CAB185 /* NativeRenderBorderDrawing.h */, ++ F45D262728067B6900CAB185 /* NativeRenderView.h */, + ); + path = view; + sourceTree = """"; +@@ -1405,10 +1381,10 @@ + F45D262828067B6900CAB185 /* smartViewPager */ = { + isa = PBXGroup; + children = ( +- F45D262928067B6900CAB185 /* HippySmartViewPagerViewManager.mm */, +- F45D262A28067B6900CAB185 /* HippySmartViewPagerView.h */, +- F45D262B28067B6900CAB185 /* HippySmartViewPagerViewManager.h */, +- F45D262C28067B6900CAB185 /* HippySmartViewPagerView.mm */, ++ F45D262928067B6900CAB185 /* NativeRenderSmartViewPagerViewManager.mm */, ++ F45D262A28067B6900CAB185 /* NativeRenderSmartViewPagerView.h */, ++ F45D262B28067B6900CAB185 /* NativeRenderSmartViewPagerViewManager.h */, ++ F45D262C28067B6900CAB185 /* NativeRenderSmartViewPagerView.mm */, + ); + path = smartViewPager; + sourceTree = """"; +@@ -1416,16 +1392,16 @@ + F45D262D28067B6900CAB185 /* navigator */ = { + isa = PBXGroup; + children = ( +- F45D262E28067B6900CAB185 /* HippyNavigatorRootViewController.m */, +- F45D262F28067B6900CAB185 /* HippyNavigatorItemViewController.m */, +- F45D263028067B6900CAB185 /* HippyNavigatorHostView.mm */, +- F45D263128067B6900CAB185 /* HippyNavigationControllerAnimator.m */, +- F45D263228067B6900CAB185 /* HippyNavigatorViewManager.h */, +- F45D263328067B6900CAB185 /* HippyNavigatorItemViewController.h */, +- F45D263428067B6900CAB185 /* HippyNavigatorRootViewController.h */, +- F45D263528067B6900CAB185 /* HippyNavigationControllerAnimator.h */, +- F45D263628067B6900CAB185 /* HippyNavigatorViewManager.mm */, +- F45D263728067B6900CAB185 /* HippyNavigatorHostView.h */, ++ F45D262E28067B6900CAB185 /* NativeRenderNavigatorRootViewController.m */, ++ F45D262F28067B6900CAB185 /* NativeRenderNavigatorItemViewController.m */, ++ F45D263028067B6900CAB185 /* NativeRenderNavigatorHostView.mm */, ++ F45D263128067B6900CAB185 /* NativeRenderNavigationControllerAnimator.m */, ++ F45D263228067B6900CAB185 /* NativeRenderNavigatorViewManager.h */, ++ F45D263328067B6900CAB185 /* NativeRenderNavigatorItemViewController.h */, ++ F45D263428067B6900CAB185 /* NativeRenderNavigatorRootViewController.h */, ++ F45D263528067B6900CAB185 /* NativeRenderNavigationControllerAnimator.h */, ++ F45D263628067B6900CAB185 /* NativeRenderNavigatorViewManager.mm */, ++ F45D263728067B6900CAB185 /* NativeRenderNavigatorHostView.h */, + ); + path = navigator; + sourceTree = """"; +@@ -1433,10 +1409,10 @@ + F45D263828067B6900CAB185 /* footerrefresh */ = { + isa = PBXGroup; + children = ( +- F45D263928067B6900CAB185 /* HippyFooterRefreshManager.mm */, +- F45D263A28067B6900CAB185 /* HippyFooterRefresh.mm */, +- F45D263B28067B6900CAB185 /* HippyFooterRefreshManager.h */, +- F45D263C28067B6900CAB185 /* HippyFooterRefresh.h */, ++ F45D263928067B6900CAB185 /* NativeRenderFooterRefreshManager.mm */, ++ F45D263A28067B6900CAB185 /* NativeRenderFooterRefresh.mm */, ++ F45D263B28067B6900CAB185 /* NativeRenderFooterRefreshManager.h */, ++ F45D263C28067B6900CAB185 /* NativeRenderFooterRefresh.h */, + ); + path = footerrefresh; + sourceTree = """"; +@@ -1444,13 +1420,13 @@ + F45D263D28067B6900CAB185 /* text */ = { + isa = PBXGroup; + children = ( +- F45D263E28067B6900CAB185 /* HippyShadowText.mm */, +- F45D263F28067B6900CAB185 /* HippyShadowText.h */, +- F45D264028067B6900CAB185 /* HippyText.mm */, +- F45D264128067B6900CAB185 /* HippyText.h */, +- F45D264228067B6900CAB185 /* HippyTextDecorationLineType.h */, +- F45D264328067B6900CAB185 /* HippyTextManager.mm */, +- F45D264428067B6900CAB185 /* HippyTextManager.h */, ++ F45D263E28067B6900CAB185 /* NativeRenderObjectText.mm */, ++ F45D263F28067B6900CAB185 /* NativeRenderObjectText.h */, ++ F45D264028067B6900CAB185 /* NativeRenderText.mm */, ++ F45D264128067B6900CAB185 /* NativeRenderText.h */, ++ F45D264228067B6900CAB185 /* NativeRenderTextDecorationLineType.h */, ++ F45D264328067B6900CAB185 /* NativeRenderTextManager.mm */, ++ F45D264428067B6900CAB185 /* NativeRenderTextManager.h */, + ); + path = text; + sourceTree = """"; +@@ -1458,19 +1434,19 @@ + F45D264528067B6900CAB185 /* modal */ = { + isa = PBXGroup; + children = ( +- F45D264628067B6900CAB185 /* HippyModalCustomAnimationTransition.h */, +- F45D264728067B6900CAB185 /* HippyModalCustomPresentationController.m */, +- F45D264828067B6900CAB185 /* HippyModalHostViewManager.mm */, +- F45D264928067B6900CAB185 /* HippyModalTransitioningDelegate.mm */, +- F45D264A28067B6900CAB185 /* HippyModalHostViewInteractor.h */, +- F45D264B28067B6900CAB185 /* HippyModalCustomPresentationController.h */, +- F45D264C28067B6900CAB185 /* HippyModalCustomAnimationTransition.m */, +- F45D264D28067B6900CAB185 /* HippyModalHostViewManager.h */, +- F45D264E28067B6900CAB185 /* HippyModalHostViewController.mm */, +- F45D264F28067B6900CAB185 /* HippyModalHostViewController.h */, +- F45D265028067B6900CAB185 /* HippyModalHostView.mm */, +- F45D265128067B6900CAB185 /* HippyModalTransitioningDelegate.h */, +- F45D265228067B6900CAB185 /* HippyModalHostView.h */, ++ F45D264628067B6900CAB185 /* NativeRenderModalCustomAnimationTransition.h */, ++ F45D264728067B6900CAB185 /* NativeRenderModalCustomPresentationController.m */, ++ F45D264828067B6900CAB185 /* NativeRenderModalHostViewManager.mm */, ++ F45D264928067B6900CAB185 /* NativeRenderModalTransitioningDelegate.mm */, ++ F45D264A28067B6900CAB185 /* NativeRenderModalHostViewInteractor.h */, ++ F45D264B28067B6900CAB185 /* NativeRenderModalCustomPresentationController.h */, ++ F45D264C28067B6900CAB185 /* NativeRenderModalCustomAnimationTransition.m */, ++ F45D264D28067B6900CAB185 /* NativeRenderModalHostViewManager.h */, ++ F45D264E28067B6900CAB185 /* NativeRenderModalHostViewController.mm */, ++ F45D264F28067B6900CAB185 /* NativeRenderModalHostViewController.h */, ++ F45D265028067B6900CAB185 /* NativeRenderModalHostView.mm */, ++ F45D265128067B6900CAB185 /* NativeRenderModalTransitioningDelegate.h */, ++ F45D265228067B6900CAB185 /* NativeRenderModalHostView.h */, + ); + path = modal; + sourceTree = """"; +@@ -1623,11 +1599,10 @@ + F468DDEE2812A95100319196 /* utils */ = { + isa = PBXGroup; + children = ( ++ F4F1FCB0286C44BE005B39D4 /* HippyDefines.h */, + F468DDEF2812A95100319196 /* HippyErrorCustomizer.h */, + F468DDF02812A95100319196 /* HippyErrorInfo.h */, +- F468DDF12812A95100319196 /* HippyLogging.h */, + F468DDF22812A95100319196 /* HippyAssert.m */, +- F468DDF32812A95100319196 /* HippyLogging.mm */, + F468DDF42812A95100319196 /* HippyNullability.h */, + F468DDF52812A95100319196 /* HippyErrorInfo.m */, + F468DDF62812A95100319196 /* HippyAssert.h */, +@@ -1753,28 +1728,27 @@ + isa = PBXGroup; + children = ( + F45D25AA28067B6900CAB185 /* component */, +- F473F1442859C37100422C1A /* HippyComponentMap.h */, +- F473F13F2859C37100422C1A /* HippyComponentMap.mm */, +- F468DE922812ACE900319196 /* HippyAnimationType.h */, +- F487A001284E28AA0068A9F6 /* HippyInvalidating.h */, +- F468DE952812ACE900319196 /* HippyAutoInsetsProtocol.h */, +- F468DE942812ACE900319196 /* HippyComponent.h */, +- F468DE932812ACE900319196 /* HippyComponentData.h */, +- F468DE962812ACEA00319196 /* HippyComponentData.mm */, +- F468DE9B2812ACEA00319196 /* HippyFont.h */, +- F468DE992812ACEA00319196 /* HippyFont.mm */, +- F468DE9A2812ACEA00319196 /* HippyMemoryOpt.h */, +- F468DE9C2812ACEA00319196 /* HippyRootShadowView.h */, +- F468DE972812ACEA00319196 /* HippyRootShadowView.mm */, +- F468DE982812ACEA00319196 /* HippyScrollProtocol.h */, +- F4A8423E27D38CF900AEFC88 /* HippyUIManager.h */, ++ F473F1442859C37100422C1A /* NativeRenderComponentMap.h */, ++ F473F13F2859C37100422C1A /* NativeRenderComponentMap.mm */, ++ F468DE922812ACE900319196 /* NativeRenderAnimationType.h */, ++ F487A001284E28AA0068A9F6 /* NativeRenderInvalidating.h */, ++ F468DE952812ACE900319196 /* NativeRenderAutoInsetsProtocol.h */, ++ F468DE942812ACE900319196 /* NativeRenderComponentProtocol.h */, ++ F468DE932812ACE900319196 /* NativeRenderComponentData.h */, ++ F468DE962812ACEA00319196 /* NativeRenderComponentData.mm */, ++ F468DE9B2812ACEA00319196 /* NativeRenderFont.h */, ++ F468DE992812ACEA00319196 /* NativeRenderFont.mm */, ++ F468DE9C2812ACEA00319196 /* NativeRenderObjectRootView.h */, ++ F468DE972812ACEA00319196 /* NativeRenderObjectRootView.mm */, ++ F468DE982812ACEA00319196 /* NativeRenderScrollProtocol.h */, ++ F4A8423E27D38CF900AEFC88 /* NativeRenderUIManager.h */, + F4A8423F27D38CF900AEFC88 /* NativeRenderManager.mm */, + F4A8424027D38CF900AEFC88 /* NativeRenderManager.h */, +- F4A8424127D38CF900AEFC88 /* HippyUIManager.mm */, +- F4A8424427D38D7900AEFC88 /* HippyRenderContext.h */, ++ F4A8424127D38CF900AEFC88 /* NativeRenderUIManager.mm */, ++ F4A8424427D38D7900AEFC88 /* NativeRenderContext.h */, + F459C45827D4F355009A7441 /* UIView+Render.h */, + F459C45927D4F355009A7441 /* UIView+Render.mm */, +- F4BD045927D5E39F00339A2C /* HippyFrameworkProxy.h */, ++ F4BD045927D5E39F00339A2C /* NativeRenderFrameworkProxy.h */, + F4079542281ABA4100DD084A /* RenderVsyncManager.h */, + F4079543281ABA4100DD084A /* RenderVsyncManager.mm */, + ); +@@ -1785,44 +1759,38 @@ + F4CEDF9227D8587900583C9E /* utils */ = { + isa = PBXGroup; + children = ( +- F438B750281250CD0078435B /* HippyConvert.h */, +- F438B74F281250CD0078435B /* HippyConvert.mm */, +- F438B752281250CD0078435B /* HippyConvert+Transform.h */, +- F438B74C281250CD0078435B /* HippyConvert+Transform.m */, +- F438B74E281250CD0078435B /* HippyParserUtils.h */, +- F438B753281250CD0078435B /* HippyParserUtils.m */, +- F438B751281250CD0078435B /* HippyUtils.h */, +- F438B74D281250CD0078435B /* HippyUtils.m */, +- F438B74B28124E9F0078435B /* HippyDefines.h */, +- F438B74728124B200078435B /* HippyI18nUtils.h */, +- F438B74828124B200078435B /* HippyI18nUtils.m */, +- F438B743281248010078435B /* HippyDomNodeUtils.h */, +- F438B741281248010078435B /* HippyDomNodeUtils.mm */, +- F438B742281248010078435B /* HippyGradientObject.h */, +- F438B73E281248010078435B /* HippyGradientObject.m */, ++ F438B750281250CD0078435B /* NativeRenderConvert.h */, ++ F438B74F281250CD0078435B /* NativeRenderConvert.mm */, ++ F438B752281250CD0078435B /* NativeRenderConvert+Transform.h */, ++ F438B74C281250CD0078435B /* NativeRenderConvert+Transform.m */, ++ F438B74E281250CD0078435B /* NativeRenderParserUtils.h */, ++ F438B753281250CD0078435B /* NativeRenderParserUtils.m */, ++ F438B751281250CD0078435B /* NativeRenderUtils.h */, ++ F438B74D281250CD0078435B /* NativeRenderUtils.m */, ++ F438B74728124B200078435B /* NativeRenderI18nUtils.h */, ++ F438B74828124B200078435B /* NativeRenderI18nUtils.m */, ++ F438B743281248010078435B /* NativeRenderDomNodeUtils.h */, ++ F438B741281248010078435B /* NativeRenderDomNodeUtils.mm */, ++ F438B742281248010078435B /* NativeRenderGradientObject.h */, ++ F438B73E281248010078435B /* NativeRenderGradientObject.m */, + F438B740281248010078435B /* OCTypeToDomArgument.h */, + F438B73F281248010078435B /* OCTypeToDomArgument.mm */, +- F4C1DAAC28117C1900CED4C4 /* HippyDeepCopyProtocol.h */, +- F4C1DAAA28117C1800CED4C4 /* NSArray+HippyArrayDeepCopy.h */, +- F4C1DAA628117C1800CED4C4 /* NSArray+HippyArrayDeepCopy.m */, +- F4C1DAAB28117C1900CED4C4 /* NSDictionary+HippyDictionaryDeepCopy.h */, +- F4C1DAA728117C1800CED4C4 /* NSDictionary+HippyDictionaryDeepCopy.m */, +- F4C1DAA928117C1800CED4C4 /* NSNumber+HippyNumberDeepCopy.h */, +- F4C1DAA828117C1800CED4C4 /* NSNumber+HippyNumberDeepCopy.m */, +- F4C1DAA32811795200CED4C4 /* HippyLog.h */, +- F4C1DAA42811795200CED4C4 /* HippyLog.mm */, ++ F4C1DAAC28117C1900CED4C4 /* NativeRenderDeepCopyProtocol.h */, ++ F4C1DAA32811795200CED4C4 /* NativeRenderLog.h */, ++ F4C1DAA42811795200CED4C4 /* NativeRenderLog.mm */, + F4C1CE21281131EB00CED4C4 /* NSData+DataType.h */, + F4C1CE22281131EC00CED4C4 /* NSData+DataType.m */, +- F4CEDF9327D858C700583C9E /* HippyDefaultImageProvider.h */, +- F4CEDF9927D858C700583C9E /* HippyDefaultImageProvider.m */, +- F4CEDF9727D858C700583C9E /* HippyDownloadTask.h */, +- F4CEDF9627D858C700583C9E /* HippyDownloadTask.m */, +- F4CEDF9827D858C700583C9E /* HippyImageDataLoader.h */, +- F4CEDF9427D858C700583C9E /* HippyImageDataLoader.m */, +- F4CEDF9527D858C700583C9E /* HippyImageDataLoaderProtocol.h */, +- F4CEDF9A27D858C700583C9E /* HippyImageProviderProtocol.h */, +- F438B758281283550078435B /* RenderErrorHandler.h */, +- F438B759281283550078435B /* RenderErrorHandler.m */, ++ F4CEDF9327D858C700583C9E /* NativeRenderDefaultImageProvider.h */, ++ F4CEDF9927D858C700583C9E /* NativeRenderDefaultImageProvider.m */, ++ F4CEDF9727D858C700583C9E /* NativeRenderDownloadTask.h */, ++ F4CEDF9627D858C700583C9E /* NativeRenderDownloadTask.m */, ++ F4CEDF9827D858C700583C9E /* NativeRenderImageDataLoader.h */, ++ F4CEDF9427D858C700583C9E /* NativeRenderImageDataLoader.m */, ++ F4CEDF9527D858C700583C9E /* NativeRenderImageDataLoaderProtocol.h */, ++ F4CEDF9A27D858C700583C9E /* NativeRenderImageProviderProtocol.h */, ++ F438B758281283550078435B /* NativeRenderErrorHandler.h */, ++ F438B759281283550078435B /* NativeRenderErrorHandler.m */, ++ F4F1FCB1286C4A0C005B39D4 /* NativeRenderDefines.h */, + ); + name = utils; + path = ../../../../renderer/native/ios/utils; +@@ -1924,43 +1892,43 @@ + buildActionMask = 2147483647; + files = ( + F468DE772812A95200319196 /* HippyJSCExecutor.mm in Sources */, +- F4CEDF9C27D858C700583C9E /* HippyDownloadTask.m in Sources */, ++ F4CEDF9C27D858C700583C9E /* NativeRenderDownloadTask.m in Sources */, + F4BD045827D5AE2500339A2C /* UIView+Render.mm in Sources */, + D88F2A85286AA6AD008D1439 /* thread_worker_impl.cc in Sources */, + F468DE562812A95200319196 /* HippyOCTurboModule.mm in Sources */, + D4B09E392750D2C000643CDF /* Flex.cpp in Sources */, +- F45D266E28067B6900CAB185 /* HippyImageView.m in Sources */, ++ F45D266E28067B6900CAB185 /* NativeRenderImageView.m in Sources */, + D88F2A92286AA6AD008D1439 /* base_timer.cc in Sources */, + D42D2C7B2833C84D0079B47B /* dom_listener.cc in Sources */, +- F4C1DAA52811795200CED4C4 /* HippyLog.mm in Sources */, ++ F4C1DAA52811795200CED4C4 /* NativeRenderLog.mm in Sources */, + F468DE5F2812A95200319196 /* ios_loader.cc in Sources */, + 067AB97623B5F309009D5EE2 /* MyView.m in Sources */, + F468DE602812A95200319196 /* HippyEventObserverModule.mm in Sources */, + D88F2A87286AA6AD008D1439 /* logging.cc in Sources */, +- F45D265728067B6900CAB185 /* HippyRefreshWrapperViewManager.mm in Sources */, +- F45D265628067B6900CAB185 /* HippyRefreshWrapper.mm in Sources */, ++ F45D265728067B6900CAB185 /* NativeRenderRefreshWrapperViewManager.mm in Sources */, ++ F45D265628067B6900CAB185 /* NativeRenderRefreshWrapper.mm in Sources */, + F468DE672812A95200319196 /* HippyImageCacheManager.m in Sources */, + D88F2A91286AA6AD008D1439 /* worker_manager.cc in Sources */, +- F45D268428067B6900CAB185 /* HippyShadowView.mm in Sources */, ++ F45D268428067B6900CAB185 /* NativeRenderObjectView.mm in Sources */, + 0612F02923A8BE320079E622 /* ViewController.mm in Sources */, + 0612F02323A8BE320079E622 /* AppDelegate.m in Sources */, +- F438B74928124B200078435B /* HippyI18nUtils.m in Sources */, +- F45D266428067B6900CAB185 /* HippySimpleWebView.m in Sources */, +- F45D269428067B6900CAB185 /* HippyTextManager.mm in Sources */, +- F45D266228067B6900CAB185 /* HippyTextField.mm in Sources */, +- F45D265D28067B6900CAB185 /* HippyViewPagerItemManager.mm in Sources */, ++ F438B74928124B200078435B /* NativeRenderI18nUtils.m in Sources */, ++ F45D266428067B6900CAB185 /* NativeRenderSimpleWebView.m in Sources */, ++ F45D269428067B6900CAB185 /* NativeRenderTextManager.mm in Sources */, ++ F45D266228067B6900CAB185 /* NativeRenderTextField.mm in Sources */, ++ F45D265D28067B6900CAB185 /* NativeRenderViewPagerItemManager.mm in Sources */, + F4079544281ABD7A00DD084A /* RenderVsyncManager.mm in Sources */, + F468DE802812A95200319196 /* HippyDisplayLink.m in Sources */, + F468DE6E2812A95200319196 /* HippyPerformanceLogger.mm in Sources */, +- F45D269228067B6900CAB185 /* HippyShadowText.mm in Sources */, ++ F45D269228067B6900CAB185 /* NativeRenderObjectText.mm in Sources */, + F400C2E3274F65FA008BD74B /* js_native_turbo_jsc.cc in Sources */, +- F45D268828067B6900CAB185 /* HippyTouchesView.mm in Sources */, +- F45D268F28067B6900CAB185 /* HippyNavigatorViewManager.mm in Sources */, +- F45D269028067B6900CAB185 /* HippyFooterRefreshManager.mm in Sources */, ++ F45D268828067B6900CAB185 /* NativeRenderTouchesView.mm in Sources */, ++ F45D268F28067B6900CAB185 /* NativeRenderNavigatorViewManager.mm in Sources */, ++ F45D269028067B6900CAB185 /* NativeRenderFooterRefreshManager.mm in Sources */, + F482919B274E420C00D91128 /* HPConfig.cpp in Sources */, +- F45D268B28067B6900CAB185 /* HippyNavigatorRootViewController.m in Sources */, ++ F45D268B28067B6900CAB185 /* NativeRenderNavigatorRootViewController.m in Sources */, + F468DE8F2812A95200319196 /* HippyDevInfo.m in Sources */, +- F438B75A281283550078435B /* RenderErrorHandler.m in Sources */, ++ F438B75A281283550078435B /* NativeRenderErrorHandler.m in Sources */, + D84AB9BD273A618B00987D03 /* ui_manager_module.cc in Sources */, + F438B745281248010078435B /* OCTypeToDomArgument.mm in Sources */, + F468DE612812A95200319196 /* HippyAsyncLocalStorage.mm in Sources */, +@@ -1972,169 +1940,165 @@ + 067AB97523B5F309009D5EE2 /* MyViewManager.mm in Sources */, + D4B5A0862816641600ABBD9C /* event_module.cc in Sources */, + F4810954277062AD005C221B /* layer_optimized_render_manager.cc in Sources */, +- F4B938F82840B58C00187AFA /* HippyWaterfallViewCell.mm in Sources */, ++ F4B938F82840B58C00187AFA /* NativeRenderWaterfallViewCell.mm in Sources */, + D88F2A98286AA6AD008D1439 /* task.cc in Sources */, +- F4C1DAAF28117C1900CED4C4 /* NSNumber+HippyNumberDeepCopy.m in Sources */, + F48291A0274E420D00D91128 /* HPLayoutCache.cpp in Sources */, + D8A8889D286D416300D60489 /* deserializer.cc in Sources */, +- F45D268C28067B6900CAB185 /* HippyNavigatorItemViewController.m in Sources */, +- F45D268A28067B6900CAB185 /* HippySmartViewPagerView.mm in Sources */, ++ F45D268C28067B6900CAB185 /* NativeRenderNavigatorItemViewController.m in Sources */, ++ F45D268A28067B6900CAB185 /* NativeRenderSmartViewPagerView.mm in Sources */, + F4C1CE23281131EC00CED4C4 /* NSData+DataType.m in Sources */, + F468DE632812A95200319196 /* HippyRedBox.mm in Sources */, + D84AB9BE273A618B00987D03 /* console_module.cc in Sources */, +- F45D267C28067B6900CAB185 /* HippyBaseListViewDataSource.mm in Sources */, +- F45D269528067B6900CAB185 /* HippyModalCustomPresentationController.m in Sources */, ++ F45D267C28067B6900CAB185 /* NativeRenderBaseListViewDataSource.mm in Sources */, ++ F45D269528067B6900CAB185 /* NativeRenderModalCustomPresentationController.m in Sources */, + D84AB9C1273A618B00987D03 /* js_value_wrapper.cc in Sources */, + D86B3E61284E31EB007E729B /* animation_math.cc in Sources */, + D88F2A90286AA6AD008D1439 /* one_shot_timer.cc in Sources */, + F468DE832812A95200319196 /* HippySRSIMDHelpers.m in Sources */, +- F4B938FB2840C93C00187AFA /* HippyWatefallItemShadowView.mm in Sources */, ++ F4B938FB2840C93C00187AFA /* NativeRenderObjectWatefallItem.mm in Sources */, + F468DE782812A95200319196 /* HippyJSCErrorHandling.m in Sources */, +- F45D266328067B6900CAB185 /* HippyTextSelection.m in Sources */, ++ F45D266328067B6900CAB185 /* NativeRenderTextSelection.m in Sources */, + D88F2A9A286AA6AD008D1439 /* idle_timer.cc in Sources */, +- F45D266C28067B6900CAB185 /* HippyCollectionViewWaterfallLayout.m in Sources */, +- F45D268528067B6900CAB185 /* HippyBorderDrawing.m in Sources */, ++ F45D266C28067B6900CAB185 /* NativeRenderCollectionViewWaterfallLayout.m in Sources */, ++ F45D268528067B6900CAB185 /* NativeRenderBorderDrawing.m in Sources */, + D84AB9CD273A618B00987D03 /* js_native_api_jsc.cc in Sources */, + D88F2A8E286AA6AD008D1439 /* log_settings_state.cc in Sources */, + F468DE642812A95200319196 /* HippyDevLoadingView.mm in Sources */, +- F45D266A28067B6900CAB185 /* HippyWaterfallViewManager.mm in Sources */, ++ F45D266A28067B6900CAB185 /* NativeRenderWaterfallViewManager.mm in Sources */, + D88F2A8F286AA6AD008D1439 /* log_settings.cc in Sources */, +- F473F1452859C37100422C1A /* HippyComponentMap.mm in Sources */, ++ F473F1452859C37100422C1A /* NativeRenderComponentMap.mm in Sources */, + F468DE582812A95200319196 /* NSObject+HippyTurbo.mm in Sources */, +- F438B744281248010078435B /* HippyGradientObject.m in Sources */, +- F468DE9E2812ACEA00319196 /* HippyRootShadowView.mm in Sources */, +- F468DE9D2812ACEA00319196 /* HippyComponentData.mm in Sources */, +- F45D269828067B6A00CAB185 /* HippyModalCustomAnimationTransition.m in Sources */, +- F45D267028067B6900CAB185 /* HippyAnimatedImageView.m in Sources */, ++ F438B744281248010078435B /* NativeRenderGradientObject.m in Sources */, ++ F468DE9E2812ACEA00319196 /* NativeRenderObjectRootView.mm in Sources */, ++ F468DE9D2812ACEA00319196 /* NativeRenderComponentData.mm in Sources */, ++ F45D269828067B6A00CAB185 /* NativeRenderModalCustomAnimationTransition.m in Sources */, ++ F45D267028067B6900CAB185 /* NativeRenderAnimatedImageView.m in Sources */, + D84AB9B6273A618B00987D03 /* scope.cc in Sources */, +- F45D265B28067B6900CAB185 /* HippyViewPagerManager.mm in Sources */, ++ F45D265B28067B6900CAB185 /* NativeRenderViewPagerManager.mm in Sources */, + F468DE792812A95200319196 /* HippyKeyCommands.m in Sources */, + D84AB9CA273A618B00987D03 /* js_native_jsc_helper.cc in Sources */, +- F45D266928067B6900CAB185 /* HippyWaterfallViewDataSource.mm in Sources */, +- F45D265C28067B6900CAB185 /* HippyViewPagerItem.mm in Sources */, +- F45D265528067B6900CAB185 /* HippyRefreshWrapperItemView.mm in Sources */, ++ F45D266928067B6900CAB185 /* NativeRenderWaterfallViewDataSource.mm in Sources */, ++ F45D265C28067B6900CAB185 /* NativeRenderViewPagerItem.mm in Sources */, ++ F45D265528067B6900CAB185 /* NativeRenderRefreshWrapperItemView.mm in Sources */, + D88F2A96286AA6AD008D1439 /* repeating_timer.cc in Sources */, + D84AB9B7273A618B00987D03 /* engine.cc in Sources */, + F400C2E7274F66ED008BD74B /* js_native_turbo.cc in Sources */, + F468DE662812A95200319196 /* HippyImageLoaderModule.mm in Sources */, + D84AB9C9273A618B00987D03 /* callback_info.cc in Sources */, + F4E7B43E276C61EB00F17139 /* dom_event.cc in Sources */, +- F45D265A28067B6900CAB185 /* HippyViewPager.mm in Sources */, ++ F45D265A28067B6900CAB185 /* NativeRenderViewPager.mm in Sources */, + F468DE5A2812A95200319196 /* HippyFetchInfo.m in Sources */, + D84AB9BF273A618B00987D03 /* timer_module.cc in Sources */, +- F45D267228067B6900CAB185 /* HippyImageView+HippyTouchesImplementation.mm in Sources */, ++ F45D267228067B6900CAB185 /* NativeRenderImageView+NativeRenderTouchesImplementation.mm in Sources */, + F468DE5C2812A95200319196 /* HippyNetInfo.mm in Sources */, + F468DE7C2812A95200319196 /* HippyBridge.mm in Sources */, + D84AB8EF273A5AAD00987D03 /* layout_node.cc in Sources */, + F468DE572812A95200319196 /* HippyTurboModuleManager.mm in Sources */, + D4B5A080281663F400ABBD9C /* scene_builder.cc in Sources */, +- F438B746281248010078435B /* HippyDomNodeUtils.mm in Sources */, ++ F438B746281248010078435B /* NativeRenderDomNodeUtils.mm in Sources */, + F468DE5E2812A95200319196 /* HippyTiming.mm in Sources */, + F42EA79B277C354C007874A2 /* TurboBaseModule.mm in Sources */, +- F45D266728067B6900CAB185 /* HippyHeaderRefresh.mm in Sources */, +- F45D269128067B6900CAB185 /* HippyFooterRefresh.mm in Sources */, ++ F45D266728067B6900CAB185 /* NativeRenderHeaderRefresh.mm in Sources */, ++ F45D269128067B6900CAB185 /* NativeRenderFooterRefresh.mm in Sources */, + F468DE6C2812A95200319196 /* HippyEventDispatcher.mm in Sources */, + F468DE682812A95200319196 /* HippyClipboardModule.m in Sources */, +- F45D268D28067B6900CAB185 /* HippyNavigatorHostView.mm in Sources */, ++ F45D268D28067B6900CAB185 /* NativeRenderNavigatorHostView.mm in Sources */, + D88F2A94286AA6AD008D1439 /* thread_worker.cc in Sources */, +- F4C1DAAE28117C1900CED4C4 /* NSDictionary+HippyDictionaryDeepCopy.m in Sources */, +- F45D267728067B6900CAB185 /* HippyBaseListItemView.mm in Sources */, +- F4CEDF9D27D858C700583C9E /* HippyDefaultImageProvider.m in Sources */, ++ F45D267728067B6900CAB185 /* NativeRenderBaseListItemView.mm in Sources */, ++ F4CEDF9D27D858C700583C9E /* NativeRenderDefaultImageProvider.m in Sources */, + F468DE592812A95200319196 /* HippyNetWork.m in Sources */, +- F45D269A28067B6A00CAB185 /* HippyModalHostView.mm in Sources */, +- F45D265428067B6900CAB185 /* HippyScrollViewManager.mm in Sources */, +- F45D266628067B6900CAB185 /* HippyHeaderRefreshManager.mm in Sources */, ++ F45D269A28067B6A00CAB185 /* NativeRenderModalHostView.mm in Sources */, ++ F45D265428067B6900CAB185 /* NativeRenderScrollViewManager.mm in Sources */, ++ F45D266628067B6900CAB185 /* NativeRenderHeaderRefreshManager.mm in Sources */, + D88F2A93286AA6AD008D1439 /* unicode_string_view.cc in Sources */, + F468DE702812A95200319196 /* HippyModuleMethod.mm in Sources */, +- F438B757281250CD0078435B /* HippyParserUtils.m in Sources */, ++ F438B757281250CD0078435B /* NativeRenderParserUtils.m in Sources */, + 0612F03423A8BE330079E622 /* main.m in Sources */, + F4E7B43D276C61EB00F17139 /* dom_argument.cc in Sources */, +- F45D267B28067B6900CAB185 /* HippyListTableView.m in Sources */, ++ F45D267B28067B6900CAB185 /* NativeRenderListTableView.m in Sources */, + F468DE6B2812A95200319196 /* HippyErrorInfo.m in Sources */, +- F45D269928067B6A00CAB185 /* HippyModalHostViewController.mm in Sources */, ++ F45D269928067B6A00CAB185 /* NativeRenderModalHostViewController.mm in Sources */, + D88F2A99286AA6AD008D1439 /* worker.cc in Sources */, +- F45D266F28067B6900CAB185 /* HippyAnimatedImage.m in Sources */, +- F45D267128067B6900CAB185 /* HippyImageViewManager.mm in Sources */, +- F438B754281250CD0078435B /* HippyConvert+Transform.m in Sources */, ++ F45D266F28067B6900CAB185 /* NativeRenderAnimatedImage.m in Sources */, ++ F45D267128067B6900CAB185 /* NativeRenderImageViewManager.mm in Sources */, ++ F438B754281250CD0078435B /* NativeRenderConvert+Transform.m in Sources */, + F482919F274E420D00D91128 /* Hippy.cpp in Sources */, + F468DE732812A95200319196 /* HippyBundleURLProvider.m in Sources */, +- F45D268E28067B6900CAB185 /* HippyNavigationControllerAnimator.m in Sources */, ++ F45D268E28067B6900CAB185 /* NativeRenderNavigationControllerAnimator.m in Sources */, + D86B3E60284E31EB007E729B /* animation_manager.cc in Sources */, +- F45D267428067B6900CAB185 /* HippyBaseListItemShadowView.mm in Sources */, ++ F45D267428067B6900CAB185 /* NativeRenderObjectBaseListItem.mm in Sources */, + D84AB8EC273A5AAD00987D03 /* dom_manager.cc in Sources */, +- F45D268028067B6900CAB185 /* HippyViewManager.mm in Sources */, +- F45D266528067B6900CAB185 /* HippySimpleWebViewManager.mm in Sources */, ++ F45D268028067B6900CAB185 /* NativeRenderViewManager.mm in Sources */, ++ F45D266528067B6900CAB185 /* NativeRenderSimpleWebViewManager.mm in Sources */, + F43A2D09275882650056F36C /* diff_utils.cc in Sources */, + D4B5A0872816641600ABBD9C /* scene_builder.cc in Sources */, +- F45D267D28067B6900CAB185 /* UIView+AppearEvent.m in Sources */, ++ F45D267D28067B6900CAB185 /* UIView+MountEvent.m in Sources */, + D4B5A081281663F400ABBD9C /* scene.cc in Sources */, +- F4A8424327D38CF900AEFC88 /* HippyUIManager.mm in Sources */, +- F45D266B28067B6900CAB185 /* HippyWaterfallItemView.mm in Sources */, +- F45D266028067B6900CAB185 /* HippyTextViewManager.mm in Sources */, +- F45D269328067B6900CAB185 /* HippyText.mm in Sources */, +- F438B755281250CD0078435B /* HippyUtils.m in Sources */, ++ F4A8424327D38CF900AEFC88 /* NativeRenderUIManager.mm in Sources */, ++ F45D266B28067B6900CAB185 /* NativeRenderWaterfallItemView.mm in Sources */, ++ F45D266028067B6900CAB185 /* NativeRenderTextViewManager.mm in Sources */, ++ F45D269328067B6900CAB185 /* NativeRenderText.mm in Sources */, ++ F438B755281250CD0078435B /* NativeRenderUtils.m in Sources */, + D84AB9CC273A618B00987D03 /* js_native_api_value_jsc.cc in Sources */, + F468DE712812A95200319196 /* HippyDeviceBaseInfo.mm in Sources */, + F468DE5D2812A95200319196 /* HippyNetInfoIntenal.m in Sources */, + F42EA79A277C354C007874A2 /* TurboConfig.m in Sources */, + D86B3E64284E31EB007E729B /* animation_set.cc in Sources */, + F468DE742812A95200319196 /* HippyJSEnginesMapper.mm in Sources */, +- F45D267F28067B6900CAB185 /* UIView+Hippy.mm in Sources */, +- F45D267528067B6900CAB185 /* HippyBaseListView.mm in Sources */, +- F45D268628067B6900CAB185 /* UIView+HippyEvent.mm in Sources */, +- F468DE6A2812A95200319196 /* HippyLogging.mm in Sources */, +- F468DE9F2812ACEA00319196 /* HippyFont.mm in Sources */, ++ F45D267F28067B6900CAB185 /* UIView+NativeRender.mm in Sources */, ++ F45D267528067B6900CAB185 /* NativeRenderBaseListView.mm in Sources */, ++ F45D268628067B6900CAB185 /* UIView+DomEvent.mm in Sources */, ++ F468DE9F2812ACEA00319196 /* NativeRenderFont.mm in Sources */, + D88F440B28470C3E00989F01 /* animation_module.cc in Sources */, +- F45D268228067B6900CAB185 /* HippyView.mm in Sources */, ++ F45D268228067B6900CAB185 /* NativeRenderView.mm in Sources */, + D84AB9C0273A618B00987D03 /* contextify_module.cc in Sources */, +- F45D265328067B6900CAB185 /* HippyScrollView.mm in Sources */, +- F45D265F28067B6900CAB185 /* HippyBaseTextInput.mm in Sources */, ++ F45D265328067B6900CAB185 /* NativeRenderScrollView.mm in Sources */, ++ F45D265F28067B6900CAB185 /* NativeRenderBaseTextInput.mm in Sources */, + F482919D274E420C00D91128 /* HPNode.cpp in Sources */, +- F45D268928067B6900CAB185 /* HippySmartViewPagerViewManager.mm in Sources */, +- F45D265828067B6900CAB185 /* HippyRefreshWrapperItemViewManager.mm in Sources */, ++ F45D268928067B6900CAB185 /* NativeRenderSmartViewPagerViewManager.mm in Sources */, ++ F45D265828067B6900CAB185 /* NativeRenderRefreshWrapperItemViewManager.mm in Sources */, + F468DE622812A95200319196 /* HippyDevMenu.mm in Sources */, + D84AB9BC273A618B00987D03 /* module_register.cc in Sources */, + D84AB9C2273A618B00987D03 /* file.cc in Sources */, +- F4CEDF9B27D858C700583C9E /* HippyImageDataLoader.m in Sources */, ++ F4CEDF9B27D858C700583C9E /* NativeRenderImageDataLoader.m in Sources */, + D88F2A97286AA6AD008D1439 /* task_runner.cc in Sources */, +- F45D269728067B6900CAB185 /* HippyModalTransitioningDelegate.mm in Sources */, +- F45D266D28067B6900CAB185 /* HippyWaterfallItemViewManager.mm in Sources */, ++ F45D269728067B6900CAB185 /* NativeRenderModalTransitioningDelegate.mm in Sources */, ++ F45D266D28067B6900CAB185 /* NativeRenderWaterfallItemViewManager.mm in Sources */, + F4A8424227D38CF900AEFC88 /* NativeRenderManager.mm in Sources */, +- F45D265E28067B6900CAB185 /* HippyTextView.mm in Sources */, ++ F45D265E28067B6900CAB185 /* NativeRenderTextView.mm in Sources */, + F468DE842812A95200319196 /* HippyWebSocketManager.m in Sources */, + D86B3E62284E31EB007E729B /* animation.cc in Sources */, + F468DE752812A95200319196 /* HippyJavaScriptLoader.mm in Sources */, + F468DE6F2812A95200319196 /* HippyJSStackFrame.m in Sources */, + F45D268128067B6900CAB185 /* UIView+DirectionalLayout.mm in Sources */, + F468DE692812A95200319196 /* HippyAssert.m in Sources */, +- F45D265928067B6900CAB185 /* HippyRefresh.mm in Sources */, ++ F45D265928067B6900CAB185 /* NativeRenderRefresh.mm in Sources */, + F4C1CE262811439A00CED4C4 /* UIView+Sequence.m in Sources */, + F468DE7B2812A95200319196 /* native_source_code_ios.cc in Sources */, + D8A888A0286D417000D60489 /* serializer.cc in Sources */, +- F438B756281250CD0078435B /* HippyConvert.mm in Sources */, ++ F438B756281250CD0078435B /* NativeRenderConvert.mm in Sources */, + F468DE762812A95200319196 /* HippyBatchedBridge.mm in Sources */, + F468DE822812A95200319196 /* HippySRWebSocket.m in Sources */, +- F45D266128067B6900CAB185 /* HippyShadowTextView.mm in Sources */, ++ F45D266128067B6900CAB185 /* NativeRenderObjectTextView.mm in Sources */, + 9252AE8B2809532F00B27E50 /* root_node.cc in Sources */, +- F45D266828067B6900CAB185 /* HippyWaterfallView.mm in Sources */, ++ F45D266828067B6900CAB185 /* NativeRenderWaterfallView.mm in Sources */, + D86B3E63284E31EB007E729B /* cubic_bezier_animation.cc in Sources */, + F482919C274E420C00D91128 /* HPUtil.cpp in Sources */, +- F45D269628067B6900CAB185 /* HippyModalHostViewManager.mm in Sources */, +- F45D267A28067B6900CAB185 /* HippyCollectionViewFlowLayout.m in Sources */, ++ F45D269628067B6900CAB185 /* NativeRenderModalHostViewManager.mm in Sources */, ++ F45D267A28067B6900CAB185 /* NativeRenderCollectionViewFlowLayout.m in Sources */, + F468DE722812A95200319196 /* HippyRootView.mm in Sources */, +- F45D267328067B6900CAB185 /* HippyImageCache.m in Sources */, +- F45D267828067B6900CAB185 /* HippyBaseListViewManager.mm in Sources */, +- F4C1DAAD28117C1900CED4C4 /* NSArray+HippyArrayDeepCopy.m in Sources */, ++ F45D267328067B6900CAB185 /* NativeRenderImageCache.m in Sources */, ++ F45D267828067B6900CAB185 /* NativeRenderBaseListViewManager.mm in Sources */, + F419C383274634E9003E242A /* taitank_layout_node.cc in Sources */, + F468DE7F2812A95200319196 /* HippyFrameUpdate.m in Sources */, + D88F2A95286AA6AD008D1439 /* idle_task.cc in Sources */, +- F45D267628067B6900CAB185 /* HippyBaseListViewCell.mm in Sources */, ++ F45D267628067B6900CAB185 /* NativeRenderBaseListViewCell.mm in Sources */, + 067AB96F23B5EEF4009D5EE2 /* TestModule.mm in Sources */, + F468DE7E2812A95200319196 /* HippyModuleData.mm in Sources */, + F468DE652812A95200319196 /* HippyExceptionModule.mm in Sources */, +- F45D267928067B6900CAB185 /* HippyBaseListItemViewManager.mm in Sources */, ++ F45D267928067B6900CAB185 /* NativeRenderBaseListItemViewManager.mm in Sources */, + F468DE7D2812A95200319196 /* HippyBridge+LocalFileSource.mm in Sources */, +- F45D268728067B6900CAB185 /* HippyViewEventType.mm in Sources */, ++ F45D268728067B6900CAB185 /* NativeRenderViewEventType.mm in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +diff --git a/driver/js/examples/ios-demo/HippyDemo/TestModule.mm b/driver/js/examples/ios-demo/HippyDemo/TestModule.mm +index 1b73eba1361..c3345b7bf21 100644 +--- a/driver/js/examples/ios-demo/HippyDemo/TestModule.mm ++++ b/driver/js/examples/ios-demo/HippyDemo/TestModule.mm +@@ -25,7 +25,7 @@ + #import ""AppDelegate.h"" + #import ""HippyBundleURLProvider.h"" + #import ""DemoConfigs.h"" +-#import ""UIView+Hippy.h"" ++#import ""UIView+NativeRender.h"" + + @interface TestModule () + +diff --git a/driver/js/examples/ios-demo/HippyDemo/ViewController.mm b/driver/js/examples/ios-demo/HippyDemo/ViewController.mm +index 7d79b186b56..69ace3fdb54 100644 +--- a/driver/js/examples/ios-demo/HippyDemo/ViewController.mm ++++ b/driver/js/examples/ios-demo/HippyDemo/ViewController.mm +@@ -23,24 +23,23 @@ + #import ""ViewController.h"" + #import ""HippyRootView.h"" + #import ""HippyBridge+LocalFileSource.h"" +-#import ""HippyLogging.h"" + #import ""HippyBundleURLProvider.h"" +-#import ""UIView+Hippy.h"" ++#import ""UIView+NativeRender.h"" + #include ""dom/dom_manager.h"" + #include ""NativeRenderManager.h"" + #include ""dom/dom_node.h"" + #include ""footstone/hippy_value.h"" + #import ""DemoConfigs.h"" + #import ""HippyBridge+Private.h"" +-#import ""HippyFrameworkProxy.h"" +-#import ""HippyDomNodeUtils.h"" +-#import ""HippyImageDataLoader.h"" +-#import ""HippyDefaultImageProvider.h"" ++#import ""NativeRenderFrameworkProxy.h"" ++#import ""NativeRenderDomNodeUtils.h"" ++#import ""NativeRenderImageDataLoader.h"" ++#import ""NativeRenderDefaultImageProvider.h"" + #import ""HippyRedBox.h"" + #import ""HippyAssert.h"" + #import ""MyViewManager.h"" + +-@interface ViewController () { ++@interface ViewController () { + std::shared_ptr _domManager; + std::shared_ptr _nativeRenderManager; + std::shared_ptr _rootNode; +@@ -54,7 +53,13 @@ @implementation ViewController + - (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. +- HippySetLogMessageFunction(^(HippyLogLevel level, HippyLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { ++ NativeRenderSetLogFunction(^(NativeRenderLogLevel level, NSString *fileName, NSNumber *lineNumber, ++ NSString *message, NSArray *stack) { ++ if (NativeRenderLogLevelError <= level) { ++ dispatch_async(dispatch_get_main_queue(), ^{ ++ [[HippyBridge currentBridge].redBox showErrorMessage:message withStack:stack]; ++ }); ++ } + NSLog(@""hippy says:%@ in file %@ at line %@"", message, fileName, lineNumber); + }); + [self runCommonDemo]; +@@ -92,11 +97,6 @@ - (void)runCommonDemo { + moduleName:@""Demo"" initialProperties: @{@""isSimulator"": @(isSimulator)} + launchOptions:nil delegate:nil]; + #endif +- HippySetErrorLogShowAction(^(NSString *message, NSArray *stacks) { +- dispatch_async(dispatch_get_main_queue(), ^{ +- [[HippyBridge currentBridge].redBox showErrorMessage:message withStack:stacks]; +- }); +- }); + bridge.methodInterceptor = self; + + rootView.frame = self.view.bounds; +@@ -314,23 +314,23 @@ - (NSURL *)inspectorSourceURLForBridge:(HippyBridge *)bridge { + return bridge.bundleURL; + } + +-#pragma mark HippyFrameworkProxy Delegate Implementation +-- (NSString *)standardizeAssetUrlString:(NSString *)UrlString forRenderContext:(nonnull id)renderContext { ++#pragma mark NativeRenderFrameworkProxy Delegate Implementation ++- (NSString *)standardizeAssetUrlString:(NSString *)UrlString forRenderContext:(nonnull id)renderContext { + //这里将对应的URL转换为标准URL + //比如将相对地址根据沙盒路径为转换绝对地址 + return UrlString; + } + +-- (id)imageDataLoaderForRenderContext:(id)renderContext { +- //设置自定义的图片加载实例,负责图片加载。默认使用HippyImageDataLoader +- return [HippyImageDataLoader new]; ++- (id)imageDataLoaderForRenderContext:(id)renderContext { ++ //设置自定义的图片加载实例,负责图片加载。默认使用NativeRenderImageDataLoader ++ return [NativeRenderImageDataLoader new]; + } + +-- (Class)imageProviderClassForRenderContext:(id)renderContext { +- //设置HippyImageProviderProtocol类。 +- //HippyImageProviderProtocol负责将NSData转换为UIImage,用于处理ios系统无法处理的图片格式数据 +- //默认使用HippyDefaultImageProvider +- return [HippyDefaultImageProvider class]; ++- (Class)imageProviderClassForRenderContext:(id)renderContext { ++ //设置NativeRenderImageProviderProtocol类。 ++ //NativeRenderImageProviderProtocol负责将NSData转换为UIImage,用于处理ios系统无法处理的图片格式数据 ++ //默认使用NativeRenderDefaultImageProvider ++ return [NativeRenderDefaultImageProvider class]; + } + + - (BOOL)shouldInvokeWithModuleName:(NSString *)moduleName methodName:(NSString *)methodName arguments:(NSArray> *)arguments argumentsValues:(NSArray *)argumentsValue containCallback:(BOOL)containCallback { +diff --git a/driver/js/examples/ios-demo/HippyDemo/myview/MyViewManager.h b/driver/js/examples/ios-demo/HippyDemo/myview/MyViewManager.h +index 51bea5610dc..94d32ac8f93 100644 +--- a/driver/js/examples/ios-demo/HippyDemo/myview/MyViewManager.h ++++ b/driver/js/examples/ios-demo/HippyDemo/myview/MyViewManager.h +@@ -20,12 +20,11 @@ + * limitations under the License. + */ + +-#import ""HippyViewManager.h"" +- ++#import ""NativeRenderViewManager.h"" + + NS_ASSUME_NONNULL_BEGIN + +-@interface MyViewManager : HippyViewManager ++@interface MyViewManager : NativeRenderViewManager + + @end + +diff --git a/driver/js/examples/ios-demo/HippyDemo/myview/MyViewManager.mm b/driver/js/examples/ios-demo/HippyDemo/myview/MyViewManager.mm +index e47564305b0..850ad3ac9d9 100644 +--- a/driver/js/examples/ios-demo/HippyDemo/myview/MyViewManager.mm ++++ b/driver/js/examples/ios-demo/HippyDemo/myview/MyViewManager.mm +@@ -22,19 +22,19 @@ + + #import ""MyViewManager.h"" + #import ""MyView.h"" +-#import ""UIView+Hippy.h"" +-#import ""HippyUIManager.h"" ++#import ""UIView+NativeRender.h"" ++#import ""NativeRenderUIManager.h"" + + @implementation MyViewManager + +-HIPPY_EXPORT_VIEW_PROPERTY(text, NSString) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(text, NSString) + +-RENDER_COMPONENT_EXPORT_METHOD(changeColor:(nonnull NSNumber *)reactTag ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(changeColor:(nonnull NSNumber *)reactTag + color:(NSString *)color) { +- [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry){ ++ [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry){ + UIView *view = viewRegistry[reactTag]; + if (view == nil || ![view isKindOfClass:[MyView class]]) { +- HippyLogError(@""tried to setPage: on an error viewPager %@ "" ++ NativeRenderLogError(@""tried to setPage: on an error viewPager %@ "" + ""with tag #%@"", view, reactTag); + } + [(MyView *)view setBackgroundColor:[self colorWithHexString:color alpha:1] ]; +diff --git a/driver/js/ios/base/HippyBatchedBridge.mm b/driver/js/ios/base/HippyBatchedBridge.mm +index 385f1544565..cff5416c78f 100644 +--- a/driver/js/ios/base/HippyBatchedBridge.mm ++++ b/driver/js/ios/base/HippyBatchedBridge.mm +@@ -26,26 +26,26 @@ + #import ""HippyBridge.h"" + #import ""HippyBridge+Private.h"" + #import ""HippyBridgeMethod.h"" +-#import ""HippyConvert.h"" ++#import ""NativeRenderConvert.h"" + #import ""HippyDisplayLink.h"" + #import ""HippyJSCExecutor.h"" + #import ""HippyJavaScriptLoader.h"" +-#import ""HippyLog.h"" ++#import ""NativeRenderLog.h"" + #import ""HippyModuleData.h"" + #import ""HippyPerformanceLogger.h"" +-#import ""HippyUtils.h"" ++#import ""NativeRenderUtils.h"" + #import ""HippyRedBox.h"" + #import ""HippyDevLoadingView.h"" + #import ""HippyDeviceBaseInfo.h"" +-#import ""HippyI18nUtils.h"" ++#import ""NativeRenderI18nUtils.h"" + #import ""HippyBundleURLProvider.h"" + #include ""core/scope.h"" + #import ""HippyTurboModuleManager.h"" + #import + #include ""NativeRenderManager.h"" + #include ""dom/dom_manager.h"" +-#import ""UIView+Hippy.h"" +-#import ""HippyUIManager.h"" ++#import ""UIView+NativeRender.h"" ++#import ""NativeRenderUIManager.h"" + + #define HippyAssertJSThread() + // +@@ -97,7 +97,7 @@ - (instancetype)initWithParentBridge:(HippyBridge *)bridge { + if (self = [super initWithDelegate:bridge.delegate bundleURL:bridge.bundleURL moduleProvider:bridge.moduleProvider + launchOptions:bridge.launchOptions + executorKey:bridge.executorKey]) { +- HippyExecuteOnMainThread( ++ NativeRenderExecuteOnMainThread( + ^{ + self->_dimDic = hippyExportedDimensions(); + }, YES); +@@ -112,9 +112,9 @@ - (instancetype)initWithParentBridge:(HippyBridge *)bridge { + _displayLink = [HippyDisplayLink new]; + + [HippyBridge setCurrentBridge:self]; +- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveCreationOfRootView:) name:HippyUIManagerDidRegisterRootViewNotification object:nil]; ++ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveCreationOfRootView:) name:NativeRenderUIManagerDidRegisterRootViewNotification object:nil]; + +- HippyLogInfo(@""[Hippy_OC_Log][Life_Circle],HippyBatchedBridge Init %p"", self); ++ NativeRenderLogInfo(@""[Hippy_OC_Log][Life_Circle],HippyBatchedBridge Init %p"", self); + } + return self; + } +@@ -126,7 +126,7 @@ - (instancetype)initWithParentBridge:(HippyBridge *)bridge { + : (NSDictionary *)launchOptions) + + - (void)start { +- HippyLogInfo(@""[Hippy_OC_Log][Life_Circle],HippyBatchedBridge start %p"", self); ++ NativeRenderLogInfo(@""[Hippy_OC_Log][Life_Circle],HippyBatchedBridge start %p"", self); + + self.semaphore = dispatch_semaphore_create(0); + self.moduleSemaphore = dispatch_semaphore_create(1); +@@ -146,7 +146,7 @@ - (void)start { + if (self.bundleURL) { + [self loadSource:^(NSError *error, NSData *source, __unused int64_t sourceLength) { + if (error) { +- HippyLogWarn(@""Failed to load source: %@"", error); ++ NativeRenderLogWarn(@""Failed to load source: %@"", error); + dispatch_async(dispatch_get_main_queue(), ^{ + [weakSelf stopLoadingWithError:error]; + }); +@@ -197,7 +197,7 @@ - (void)start { + [weakSelf injectJSONConfiguration:config onComplete:^(NSError *error) { + [performanceLogger markStopForTag:HippyPLNativeModuleInjectConfig]; + if (error) { +- HippyLogWarn(@""Failed to inject config: %@"", error); ++ NativeRenderLogWarn(@""Failed to inject config: %@"", error); + dispatch_async(dispatch_get_main_queue(), ^{ + [weakSelf stopLoadingWithError:error]; + }); +@@ -241,7 +241,7 @@ - (void)loadSource:(HippySourceLoadBlock)_onSourceLoad onProgress:(HippySourceLo + if (error && [self.delegate respondsToSelector:@selector(fallbackSourceURLForBridge:)]) { + NSURL *fallbackURL = [self.delegate fallbackSourceURLForBridge:self->_parentBridge]; + if (fallbackURL && ![fallbackURL isEqual:self.bundleURL]) { +- HippyLogError(@""Failed to load bundle(%@) with error:(%@)"", self.bundleURL, error.localizedDescription); ++ NativeRenderLogError(@""Failed to load bundle(%@) with error:(%@)"", self.bundleURL, error.localizedDescription); + self.bundleURL = fallbackURL; + [HippyJavaScriptLoader loadBundleAtURL:self.bundleURL onProgress:onProgress onComplete:onSourceLoad]; + return; +@@ -254,14 +254,14 @@ - (void)loadSource:(HippySourceLoadBlock)_onSourceLoad onProgress:(HippySourceLo + + - (NSArray *)moduleClasses { + if (HIPPY_DEBUG && _valid && _moduleClassesByID == nil) { +- HippyLogError(@""Bridge modules have not yet been initialized. You may be "" ++ NativeRenderLogError(@""Bridge modules have not yet been initialized. You may be "" + ""trying to access a module too early in the startup procedure.""); + } + return _moduleClassesByID; + } + + /** +- * Used by HippyUIManager ++ * Used by NativeRenderUIManager + */ + - (HippyModuleData *)moduleDataForName:(NSString *)moduleName { + return _moduleDataByName[moduleName]; +@@ -323,7 +323,7 @@ - (void)initModulesWithDispatchGroup:(__unused dispatch_group_t)dispatchGroup { + // Check for name collisions between preregistered modules + HippyModuleData *moduleData = moduleDataByName[moduleName]; + if (moduleData) { +- HippyLogError(@""Attempted to register HippyBridgeModule class %@ for the "" ++ NativeRenderLogError(@""Attempted to register HippyBridgeModule class %@ for the "" + ""name '%@', but name was already registered by class %@"", + moduleClass, moduleName, moduleData.moduleClass); + continue; +@@ -376,7 +376,7 @@ - (void)initModulesWithDispatchGroup:(__unused dispatch_group_t)dispatchGroup { + continue; + } else if ([moduleData.moduleClass new] != nil) { + // Both modules were non-nil, so it's unclear which should take precedence +- HippyLogError(@""Attempted to register HippyBridgeModule class %@ for the "" ++ NativeRenderLogError(@""Attempted to register HippyBridgeModule class %@ for the "" + ""name '%@', but name was already registered by class %@"", + moduleClass, moduleName, moduleData.moduleClass); + } +@@ -399,7 +399,7 @@ - (void)initModulesWithDispatchGroup:(__unused dispatch_group_t)dispatchGroup { + // Synchronously set up the pre-initialized modules + // HIPPY_PROFILE_BEGIN_EVENT(0, @""extraModules"", nil); + for (HippyModuleData *moduleData in _moduleDataByID) { +- if (moduleData.hasInstance && (!moduleData.requiresMainQueueSetup || HippyIsMainQueue())) { ++ if (moduleData.hasInstance && (!moduleData.requiresMainQueueSetup || NativeRenderIsMainQueue())) { + // Modules that were pre-initialized should ideally be set up before + // bridge init has finished, otherwise the caller may try to access the + // module directly rather than via `[bridge moduleForClass:]`, which won't +@@ -433,7 +433,7 @@ - (void)prepareModulesWithDispatchGroup:(dispatch_group_t)dispatchGroup { + if (dispatchGroup == NULL) { + // If no dispatchGroup is passed in, we must prepare everything immediately. + // We better be on the right thread too. +- HippyAssertMainQueue(); ++ NativeRenderAssertMainQueue(); + initializeImmediately = YES; + } else if ([self.delegate respondsToSelector:@selector(shouldBridgeInitializeNativeModulesSynchronously:)]) { + initializeImmediately = [self.delegate shouldBridgeInitializeNativeModulesSynchronously:self]; +@@ -460,7 +460,7 @@ - (void)prepareModulesWithDispatchGroup:(dispatch_group_t)dispatchGroup { + } + }; + +- if (initializeImmediately && HippyIsMainQueue()) { ++ if (initializeImmediately && NativeRenderIsMainQueue()) { + block(); + } else { + // We've already checked that dispatchGroup is non-null, but this satisifies the +@@ -478,7 +478,7 @@ - (void)prepareModulesWithDispatchGroup:(dispatch_group_t)dispatchGroup { + } + + - (void)whitelistedModulesDidChange { +- HippyAssertMainQueue(); ++ NativeRenderAssertMainQueue(); + [self prepareModulesWithDispatchGroup:NULL]; + } + +@@ -515,11 +515,11 @@ - (NSString *)moduleConfig { + if (self.executorClass == [HippyJSCExecutor class]) { + [config addObject:@[moduleData.name]]; + } else { +- [config addObject:HippyNullIfNil(moduleData.config)]; ++ [config addObject:NativeRenderNullIfNil(moduleData.config)]; + } + } + dispatch_semaphore_signal(self.moduleSemaphore); +- return HippyJSONStringify(@{ ++ return NativeRenderJSONStringify(@{ + @""remoteModuleConfig"": config, + }, + NULL); +@@ -545,7 +545,7 @@ - (void)executeSourceCode:(NSData *)sourceCode { + } + + if (loadError) { +- HippyLogWarn(@""Failed to execute source code: %@"", [loadError localizedDescription]); ++ NativeRenderLogWarn(@""Failed to execute source code: %@"", [loadError localizedDescription]); + dispatch_async(dispatch_get_main_queue(), ^{ + [self stopLoadingWithError:loadError]; + }); +@@ -594,11 +594,11 @@ - (void)executeSourceCode:(NSData *)sourceCode { + }]; + + #if HIPPY_DEV +- if ([HippyGetURLQueryParam(self.bundleURL, @""hot"") boolValue]) { ++ if ([NativeRenderGetURLQueryParam(self.bundleURL, @""hot"") boolValue]) { + NSString *path = [self.bundleURL.path substringFromIndex:1]; // strip initial slash + NSString *host = self.bundleURL.host; + NSNumber *port = self.bundleURL.port; +- [self enqueueJSCall:@""HMRClient"" method:@""enable"" args:@[@""ios"", path, host, HippyNullIfNil(port)] completion:NULL]; ++ [self enqueueJSCall:@""HMRClient"" method:@""enable"" args:@[@""ios"", path, host, NativeRenderNullIfNil(port)] completion:NULL]; + } + #endif + } +@@ -618,9 +618,9 @@ - (NSDictionary *)deviceInfo { + if (_dimDic) { + [deviceInfo setValue:_dimDic forKey:@""Dimensions""]; + } +- NSString *countryCode = [[HippyI18nUtils sharedInstance] currentCountryCode]; +- NSString *lanCode = [[HippyI18nUtils sharedInstance] currentAppLanguageCode]; +- NSWritingDirection direction = [[HippyI18nUtils sharedInstance] writingDirectionForCurrentAppLanguage]; ++ NSString *countryCode = [[NativeRenderI18nUtils sharedInstance] currentCountryCode]; ++ NSString *lanCode = [[NativeRenderI18nUtils sharedInstance] currentAppLanguageCode]; ++ NSWritingDirection direction = [[NativeRenderI18nUtils sharedInstance] writingDirectionForCurrentAppLanguage]; + NSDictionary *local = @{@""country"": countryCode?:@""unknown"", @""language"": lanCode?:@""unknown"", @""direction"": @(direction)}; + [deviceInfo setValue:local forKey:@""Localization""]; + return [NSDictionary dictionaryWithDictionary:deviceInfo]; +@@ -640,7 +640,7 @@ - (void)_flushPendingCalls { + } + + - (void)stopLoadingWithError:(NSError *)error { +- HippyAssertMainQueue(); ++ NativeRenderAssertMainQueue(); + + if (!_valid || !_loading) { + return; +@@ -657,7 +657,7 @@ - (void)stopLoadingWithError:(NSError *)error { + if ([error userInfo][HippyJSStackTraceKey]) { + [self.redBox showErrorMessage:[error localizedDescription] withStack:[error userInfo][HippyJSStackTraceKey]]; + } +- NSError *retError = HippyErrorFromErrorAndModuleName(error, self.moduleName); ++ NSError *retError = NativeRenderErrorFromErrorAndModuleName(error, self.moduleName); + HippyFatal(retError); + } + +@@ -695,7 +695,7 @@ - (BOOL)enableTurbo { + } + + - (void)setExecutorClass:(Class)executorClass { +- HippyAssertMainQueue(); ++ NativeRenderAssertMainQueue(); + _parentBridge.executorClass = executorClass; + } + +@@ -723,7 +723,7 @@ - (BOOL)isValid { + return _valid; + } + +-- (id)renderContext { ++- (id)renderContext { + return self.parentBridge.renderContext; + } + +@@ -759,10 +759,10 @@ - (void)dispatchBlock:(dispatch_block_t)block queue:(dispatch_queue_t)queue { + + - (void)didReceiveCreationOfRootView:(NSNotification *)notification { + //TODO delete codes +-// id manager = [[notification userInfo] objectForKey:HippyUIManagerKey]; +-// HippyUIManager *uiManager = (HippyUIManager *)self.renderContext; ++// id manager = [[notification userInfo] objectForKey:NativeRenderUIManagerKey]; ++// NativeRenderUIManager *uiManager = (NativeRenderUIManager *)self.renderContext; + // if (self.isValid && manager == uiManager) { +-// UIView *rootView = [[notification userInfo] objectForKey:HippyUIManagerRootViewKey]; ++// UIView *rootView = [[notification userInfo] objectForKey:NativeRenderUIManagerRootViewKey]; + // int32_t rootTag = [[rootView hippyTag] intValue]; + // _domManager = std::make_shared(rootTag); + // _domManager->StartTaskRunner(); +@@ -775,7 +775,7 @@ - (void)didReceiveCreationOfRootView:(NSNotification *)notification { + // } + } + +-#pragma mark - HippyInvalidating ++#pragma mark - NativeRenderInvalidating + + - (void)invalidate { + if (!_valid) { +@@ -784,7 +784,7 @@ - (void)invalidate { + // if (_domManager) { + // _domManager->TerminateTaskRunner(); + // } +- HippyAssertMainQueue(); ++ NativeRenderAssertMainQueue(); + HippyAssert(_javaScriptExecutor != nil, @""Can't complete invalidation without a JS executor""); + + _loading = NO; +@@ -810,7 +810,7 @@ - (void)invalidate { + if ([instance respondsToSelector:@selector(invalidate)]) { + dispatch_group_enter(group); + [self dispatchBlock:^{ +- [(id)instance invalidate]; ++ [(id)instance invalidate]; + dispatch_group_leave(group); + } queue:moduleData.methodQueue]; + } +@@ -887,7 +887,7 @@ - (JSValue *)callFunctionOnModule:(NSString *)module + error:(NSError *__autoreleasing *)error { + HippyJSCExecutor *jsExecutor = (HippyJSCExecutor *)_javaScriptExecutor; + if (![jsExecutor isKindOfClass:[HippyJSCExecutor class]]) { +- HippyLogWarn(@""FBHippyBridgeJSExecutor is only supported when running in JSC""); ++ NativeRenderLogWarn(@""FBHippyBridgeJSExecutor is only supported when running in JSC""); + return nil; + } + +@@ -999,7 +999,7 @@ - (void)processResponse:(id)json error:(NSError *)error { + withStack:[error userInfo][HippyJSStackTraceKey]]; + } + } +- NSError *retError = HippyErrorFromErrorAndModuleName(error, self.moduleName); ++ NSError *retError = NativeRenderErrorFromErrorAndModuleName(error, self.moduleName); + HippyFatal(retError); + } + +@@ -1030,16 +1030,16 @@ - (void)handleBuffer:(id)buffer batchEnded:(BOOL)batchEnded { + } + + - (void)handleBuffer:(NSArray *)buffer { +- NSArray *requestsArray = [HippyConvert NSArray:buffer]; ++ NSArray *requestsArray = [NativeRenderConvert NSArray:buffer]; + + if (HIPPY_DEBUG && requestsArray.count <= HippyBridgeFieldParams) { +- HippyLogError(@""Buffer should contain at least %tu sub-arrays. Only found %tu"", HippyBridgeFieldParams + 1, requestsArray.count); ++ NativeRenderLogError(@""Buffer should contain at least %tu sub-arrays. Only found %tu"", HippyBridgeFieldParams + 1, requestsArray.count); + return; + } + +- NSArray *moduleIDs = [HippyConvert NSNumberArray:requestsArray[HippyBridgeFieldRequestModuleIDs]]; +- NSArray *methodIDs = [HippyConvert NSNumberArray:requestsArray[HippyBridgeFieldMethodIDs]]; +- NSArray *paramsArrays = [HippyConvert NSArrayArray:requestsArray[HippyBridgeFieldParams]]; ++ NSArray *moduleIDs = [NativeRenderConvert NSNumberArray:requestsArray[HippyBridgeFieldRequestModuleIDs]]; ++ NSArray *methodIDs = [NativeRenderConvert NSNumberArray:requestsArray[HippyBridgeFieldMethodIDs]]; ++ NSArray *paramsArrays = [NativeRenderConvert NSArrayArray:requestsArray[HippyBridgeFieldParams]]; + + int64_t callID = -1; + +@@ -1048,7 +1048,7 @@ - (void)handleBuffer:(NSArray *)buffer { + } + + if (HIPPY_DEBUG && (moduleIDs.count != methodIDs.count || moduleIDs.count != paramsArrays.count)) { +- HippyLogError(@""Invalid data message - all must be length: %lu"", (unsigned long)moduleIDs.count); ++ NativeRenderLogError(@""Invalid data message - all must be length: %lu"", (unsigned long)moduleIDs.count); + return; + } + +@@ -1134,14 +1134,14 @@ - (id)callNativeModule:(NSUInteger)moduleID method:(NSUInteger)methodID params:( + NSArray *moduleDataByID = [_moduleDataByID copy]; + if (moduleID >= [moduleDataByID count]) { + if (_valid) { +- HippyLogError(@""moduleID %lu exceed range of moduleDataByID %lu, bridge is valid %ld"", moduleID, [moduleDataByID count], (long)_valid); ++ NativeRenderLogError(@""moduleID %lu exceed range of moduleDataByID %lu, bridge is valid %ld"", moduleID, [moduleDataByID count], (long)_valid); + } + return nil; + } + HippyModuleData *moduleData = moduleDataByID[moduleID]; + if (HIPPY_DEBUG && !moduleData) { + if (_valid) { +- HippyLogError(@""No module found for id '%lu'"", (unsigned long)moduleID); ++ NativeRenderLogError(@""No module found for id '%lu'"", (unsigned long)moduleID); + } + return nil; + } +@@ -1154,14 +1154,14 @@ - (id)callNativeModule:(NSUInteger)moduleID method:(NSUInteger)methodID params:( + NSArray> *methods = [moduleData.methods copy]; + if (methodID >= [methods count]) { + if (_valid) { +- HippyLogError(@""methodID %lu exceed range of moduleData.methods %lu, bridge is valid %ld"", moduleID, [methods count], (long)_valid); ++ NativeRenderLogError(@""methodID %lu exceed range of moduleData.methods %lu, bridge is valid %ld"", moduleID, [methods count], (long)_valid); + } + return nil; + } + id method = methods[methodID]; + if (HIPPY_DEBUG && !method) { + if (_valid) { +- HippyLogError(@""Unknown methodID: %lu for module: %lu (%@)"", (unsigned long)methodID, (unsigned long)moduleID, moduleData.name); ++ NativeRenderLogError(@""Unknown methodID: %lu for module: %lu (%@)"", (unsigned long)methodID, (unsigned long)moduleID, moduleData.name); + } + return nil; + } +@@ -1191,7 +1191,7 @@ - (id)callNativeModule:(NSUInteger)moduleID method:(NSUInteger)methodID params:( + } + + NSString *message = [NSString stringWithFormat:@""Exception '%@' was thrown while invoking %@ on target %@ with params %@"", exception, method.JSMethodName, moduleData.name, params]; +- NSError *error = HippyErrorWithMessageAndModuleName(message, self.moduleName); ++ NSError *error = NativeRenderErrorWithMessageAndModuleName(message, self.moduleName); + if (self.parentBridge.useCommonBridge) { + NSDictionary *errorInfo = @{ NSLocalizedDescriptionKey: message, @""module"": self.parentBridge.moduleName ?: @"""" }; + error = [[NSError alloc] initWithDomain:HippyErrorDomain code:0 userInfo:errorInfo]; +@@ -1219,7 +1219,7 @@ - (id)callNativeModuleName:(NSString *)moduleName methodName:(NSString *)methodN + } + + NSString *message = [NSString stringWithFormat:@""Exception '%@' was thrown while invoking %@ on target %@ with params %@"", exception, method.JSMethodName, module.name, params]; +- NSError *error = HippyErrorWithMessageAndModuleName(message, self.moduleName); ++ NSError *error = NativeRenderErrorWithMessageAndModuleName(message, self.moduleName); + if (self.parentBridge.useCommonBridge) { + NSDictionary *errorInfo = @{ NSLocalizedDescriptionKey: message, @""module"": self.parentBridge.moduleName ?: @"""" }; + error = [[NSError alloc] initWithDomain:HippyErrorDomain code:0 userInfo:errorInfo]; +diff --git a/driver/js/ios/base/HippyBridge+Private.h b/driver/js/ios/base/HippyBridge+Private.h +index e6ac56baf7d..a49cdac6724 100644 +--- a/driver/js/ios/base/HippyBridge+Private.h ++++ b/driver/js/ios/base/HippyBridge+Private.h +@@ -147,7 +147,7 @@ HIPPY_EXTERN void HippyVerifyAllModulesExported(NSArray *extraModules); + + @end + +-@interface HippyBatchedBridge : HippyBridge ++@interface HippyBatchedBridge : HippyBridge + + @property (nonatomic, weak, readonly) HippyBridge *parentBridge; + @property (nonatomic, weak, readonly) HippyJSCExecutor *javaScriptExecutor; +diff --git a/driver/js/ios/base/HippyBridge.h b/driver/js/ios/base/HippyBridge.h +index 6016c3a7bd5..ea6740b0551 100644 +--- a/driver/js/ios/base/HippyBridge.h ++++ b/driver/js/ios/base/HippyBridge.h +@@ -26,10 +26,10 @@ + #import ""HippyBridgeModule.h"" + #import ""HippyDefines.h"" + #import ""HippyFrameUpdate.h"" +-#import ""HippyInvalidating.h"" +-#import ""HippyImageProviderProtocol.h"" +-#import ""HippyFrameworkProxy.h"" +-#import ""HippyRenderContext.h"" ++#import ""NativeRenderInvalidating.h"" ++#import ""NativeRenderImageProviderProtocol.h"" ++#import ""NativeRenderFrameworkProxy.h"" ++#import ""NativeRenderContext.h"" + #import + #import ""dom/dom_manager.h"" + #import ""footstone/worker_manager.h"" +@@ -41,7 +41,7 @@ + @class HippyBridge; + @class HippyEventDispatcher; + @class HippyPerformanceLogger; +-@class HippyUIManager; ++@class NativeRenderUIManager; + + //class DomManager; + +@@ -99,7 +99,7 @@ HIPPY_EXTERN NSString *HippyBridgeModuleNameForClass(Class bridgeModuleClass); + /** + * Async batched bridge used to communicate with the JavaScript application. + */ +-@interface HippyBridge : NSObject ++@interface HippyBridge : NSObject + + - (instancetype)initWithmoduleProviderWithoutRuntime:(HippyBridgeModuleProviderBlock)block; + +@@ -137,7 +137,7 @@ HIPPY_EXTERN NSString *HippyBridgeModuleNameForClass(Class bridgeModuleClass); + + //TODO 可能有更好的方法设置。最好能将HippyRootView与bridge加载bundle的行为剥离。HippyRootView就是view,和bridge没关系 + - (void)setUpWithRootTag:(NSNumber *)tag rootSize:(CGSize)size +- frameworkProxy:(id) proxy rootView:(UIView *)view screenScale:(CGFloat)scale; ++ frameworkProxy:(id) proxy rootView:(UIView *)view screenScale:(CGFloat)scale; + + /** + * This method is used to call functions in the JavaScript application context +@@ -212,9 +212,9 @@ HIPPY_EXTERN NSString *HippyBridgeModuleNameForClass(Class bridgeModuleClass); + */ + @property (nonatomic, weak, readonly) id delegate; + +-@property (nonatomic, weak) id frameworkProxy; ++@property (nonatomic, weak) id frameworkProxy; + +-@property (nonatomic, weak) id renderContext; ++@property (nonatomic, weak) id renderContext; + + @property (nonatomic, readonly) std::shared_ptr domManager; + @property (nonatomic, readonly) std::shared_ptr renderManager; +@@ -268,7 +268,7 @@ HIPPY_EXTERN NSString *HippyBridgeModuleNameForClass(Class bridgeModuleClass); + + @property (nonatomic, strong) NSString *appVerson; // + +-@property (nonatomic, assign) HippyInvalidateReason invalidateReason; ++@property (nonatomic, assign) NativeRenderInvalidateReason invalidateReason; + + @property (nonatomic, weak) id methodInterceptor; + +diff --git a/driver/js/ios/base/HippyBridge.mm b/driver/js/ios/base/HippyBridge.mm +index d99b7fada89..89445548445 100644 +--- a/driver/js/ios/base/HippyBridge.mm ++++ b/driver/js/ios/base/HippyBridge.mm +@@ -25,20 +25,20 @@ + + #import + +-#import ""HippyConvert.h"" ++#import ""NativeRenderConvert.h"" + #import ""HippyEventDispatcher.h"" + #import ""HippyKeyCommands.h"" +-#import ""HippyLog.h"" ++#import ""NativeRenderLog.h"" + #import ""HippyModuleData.h"" + #import ""HippyPerformanceLogger.h"" +-#import ""HippyUtils.h"" +-#import ""HippyUIManager.h"" ++#import ""NativeRenderUtils.h"" ++#import ""NativeRenderUIManager.h"" + #import ""HippyRedBox.h"" + #import ""HippyTurboModule.h"" + #import ""HippyBridge+LocalFileSource.h"" + #import ""HippyBridge+Private.h"" +-#import ""HippyImageDataLoader.h"" +-#import ""HippyDefaultImageProvider.h"" ++#import ""NativeRenderImageDataLoader.h"" ++#import ""NativeRenderDefaultImageProvider.h"" + #import ""HippyAssert.h"" + #import ""scene.h"" + #import ""scope.h"" +@@ -134,7 +134,7 @@ void HippyVerifyAllModulesExported(NSArray *extraModules) { + break; + } + +- HippyLogWarn(@""Class %@ was not exported. Did you forget to use HIPPY_EXPORT_MODULE()?"", cls); ++ NativeRenderLogWarn(@""Class %@ was not exported. Did you forget to use HIPPY_EXPORT_MODULE()?"", cls); + break; + } + superclass = class_getSuperclass(superclass); +@@ -147,7 +147,7 @@ void HippyVerifyAllModulesExported(NSArray *extraModules) { + + @interface HippyBridge() { + NSURL *_delegateBundleURL; +- NSSet> *_imageProviders; ++ NSSet> *_imageProviders; + BOOL _isInitImageLoader; + dispatch_block_t _nativeSetUpBlock; + id _methodInterceptor; +@@ -205,12 +205,12 @@ - (instancetype)initWithDelegate:(id)delegate + _enableTurbo = !!launchOptions[@""EnableTurbo""] ? [launchOptions[@""EnableTurbo""] boolValue] : YES; + _appVerson = @""""; + _executorKey = executorKey; +- _invalidateReason = HippyInvalidateReasonDealloc; ++ _invalidateReason = NativeRenderInvalidateReasonDealloc; + [self setUp]; +- HippyExecuteOnMainQueue(^{ ++ NativeRenderExecuteOnMainQueue(^{ + [self bindKeys]; + }); +- HippyLogInfo(@""[Hippy_OC_Log][Life_Circle],%@ Init %p"", NSStringFromClass([self class]), self); ++ NativeRenderLogInfo(@""[Hippy_OC_Log][Life_Circle],%@ Init %p"", NSStringFromClass([self class]), self); + } + return self; + } +@@ -221,7 +221,7 @@ - (instancetype)initWithmoduleProviderWithoutRuntime:(HippyBridgeModuleProviderB + _moduleProvider = block; + [self setUp]; + } +- HippyExecuteOnMainQueue(^{ ++ NativeRenderExecuteOnMainQueue(^{ + [self bindKeys]; + }); + return self; +@@ -232,17 +232,17 @@ - (instancetype)initWithmoduleProviderWithoutRuntime:(HippyBridgeModuleProviderB + - (void)dealloc { + /** + * This runs only on the main thread, but crashes the subclass +- * HippyAssertMainQueue(); ++ * NativeRenderAssertMainQueue(); + */ +- HippyLogInfo(@""[Hippy_OC_Log][Life_Circle],%@ dealloc %p"", NSStringFromClass([self class]), self); ++ NativeRenderLogInfo(@""[Hippy_OC_Log][Life_Circle],%@ dealloc %p"", NSStringFromClass([self class]), self); + [[NSNotificationCenter defaultCenter] removeObserver:self]; +- self.invalidateReason = HippyInvalidateReasonDealloc; +- self.batchedBridge.invalidateReason = HippyInvalidateReasonDealloc; ++ self.invalidateReason = NativeRenderInvalidateReasonDealloc; ++ self.batchedBridge.invalidateReason = NativeRenderInvalidateReasonDealloc; + [self invalidate]; + } + + - (void)bindKeys { +- HippyAssertMainQueue(); ++ NativeRenderAssertMainQueue(); + + #if TARGET_IPHONE_SIMULATOR + HippyKeyCommands *commands = [HippyKeyCommands sharedInstance]; +@@ -271,11 +271,11 @@ - (id)moduleForClass:(Class)moduleClass { + return [self moduleForName:HippyBridgeModuleNameForClass(moduleClass)]; + } + +-- (NSSet> *)imageProviders { ++- (NSSet> *)imageProviders { + if (!_imageProviders) { + NSMutableSet *set = [NSMutableSet setWithCapacity:8]; + for (Class moduleClass in self.moduleClasses) { +- if ([moduleClass conformsToProtocol:@protocol(HippyImageProviderProtocol)]) { ++ if ([moduleClass conformsToProtocol:@protocol(NativeRenderImageProviderProtocol)]) { + [set addObject:moduleClass]; + } + } +@@ -284,7 +284,7 @@ - (id)moduleForClass:(Class)moduleClass { + return _imageProviders; + } + +-- (id)frameworkProxy { ++- (id)frameworkProxy { + return _frameworkProxy ?: self; + } + +@@ -314,8 +314,8 @@ - (void)reload { + * Any thread + */ + dispatch_async(dispatch_get_main_queue(), ^{ +- self.invalidateReason = HippyInvalidateReasonReload; +- self.batchedBridge.invalidateReason = HippyInvalidateReasonReload; ++ self.invalidateReason = NativeRenderInvalidateReasonReload; ++ self.batchedBridge.invalidateReason = NativeRenderInvalidateReasonReload; + [self invalidate]; + [self setUp]; + }); +@@ -329,7 +329,7 @@ - (void)requestReload { + } + + - (void)setUp { +- HippyLogInfo(@""[Hippy_OC_Log][Life_Circle],%@ setUp %p"", NSStringFromClass([self class]), self); ++ NativeRenderLogInfo(@""[Hippy_OC_Log][Life_Circle],%@ setUp %p"", NSStringFromClass([self class]), self); + _performanceLogger = [HippyPerformanceLogger new]; + [_performanceLogger markStartForTag:HippyPLBridgeStartup]; + // [_performanceLogger markStartForTag:HippyPLTTI]; +@@ -344,7 +344,7 @@ - (void)setUp { + } + + // Sanitize the bundle URL +- _bundleURL = [HippyConvert NSURL:_bundleURL.absoluteString]; ++ _bundleURL = [NativeRenderConvert NSURL:_bundleURL.absoluteString]; + @try { + [self createBatchedBridge]; + [self.batchedBridge start]; +@@ -387,9 +387,9 @@ - (void)setUpWorkerManager:(std::shared_ptr)workerMana + } + + - (void)setUpWithRootTag:(NSNumber *)tag rootSize:(CGSize)size +- frameworkProxy:(id) proxy rootView:(UIView *)view screenScale:(CGFloat)scale { ++ frameworkProxy:(id) proxy rootView:(UIView *)view screenScale:(CGFloat)scale { + __weak HippyBridge *weakBridge = self; +- __weak id weakProxy = proxy; ++ __weak id weakProxy = proxy; + __weak UIView *weakView = view; + _nativeSetUpBlock = ^(){ + HippyBridge *strongSelf = weakBridge; +@@ -460,13 +460,13 @@ - (BOOL)isBatchActive { + } + + - (void)invalidate { +- HippyLogInfo(@""[Hippy_OC_Log][Life_Circle],%@ invalide %p"", NSStringFromClass([self class]), self); ++ NativeRenderLogInfo(@""[Hippy_OC_Log][Life_Circle],%@ invalide %p"", NSStringFromClass([self class]), self); + HippyBridge *batchedBridge = self.batchedBridge; + self.batchedBridge = nil; + _domManager = nullptr; + _renderManager = nullptr; + if (batchedBridge) { +- HippyExecuteOnMainQueue(^{ ++ NativeRenderExecuteOnMainQueue(^{ + [batchedBridge invalidate]; + }); + } +@@ -498,26 +498,26 @@ - (void)setRedBoxShowEnabled:(BOOL)enabled { + #endif // HIPPY_DEBUG + } + +-#pragma mark HippyFrameworkProxy Delegate Implementation +-- (NSString *)standardizeAssetUrlString:(NSString *)UrlString forRenderContext:(nonnull id)renderContext { ++#pragma mark NativeRenderFrameworkProxy Delegate Implementation ++- (NSString *)standardizeAssetUrlString:(NSString *)UrlString forRenderContext:(nonnull id)renderContext { + if ([HippyBridge isHippyLocalFileURLString:UrlString]) { + return [self absoluteStringFromHippyLocalFileURLString:UrlString]; + } + return UrlString; + } + +-- (id)imageDataLoaderForRenderContext:(id)renderContext { ++- (id)imageDataLoaderForRenderContext:(id)renderContext { + if (self.frameworkProxy != self && [self.frameworkProxy respondsToSelector:@selector(imageDataLoaderForRenderContext:)]) { + return [self.frameworkProxy imageDataLoaderForRenderContext:renderContext]; + } +- return [HippyImageDataLoader new]; ++ return [NativeRenderImageDataLoader new]; + } + +-- (Class)imageProviderClassForRenderContext:(id)renderContext { ++- (Class)imageProviderClassForRenderContext:(id)renderContext { + if (self.frameworkProxy != self && [self.frameworkProxy respondsToSelector:@selector(imageProviderClassForRenderContext:)]) { + return [self.frameworkProxy imageProviderClassForRenderContext:renderContext]; + } +- return [HippyDefaultImageProvider class]; ++ return [NativeRenderDefaultImageProvider class]; + } + + @end +diff --git a/driver/js/ios/base/HippyBridgeDelegate.h b/driver/js/ios/base/HippyBridgeDelegate.h +index 20193e92a2a..ee29a4d95ab 100644 +--- a/driver/js/ios/base/HippyBridgeDelegate.h ++++ b/driver/js/ios/base/HippyBridgeDelegate.h +@@ -21,7 +21,7 @@ + */ + + #import ""HippyJavaScriptLoader.h"" +-#import ""HippyComponent.h"" ++#import ""NativeRenderComponentProtocol.h"" + + @class HippyBridge; + @protocol HippyBridgeModule; +@@ -38,7 +38,7 @@ + */ + - (NSURL *)sourceURLForBridge:(HippyBridge *)bridge; + +-- (void)componentWillBePurged:(id)component; ++- (void)componentWillBePurged:(id)component; + + /** + * Called and inject Object before Hippy execute JS source code +diff --git a/driver/js/ios/base/HippyDeviceBaseInfo.mm b/driver/js/ios/base/HippyDeviceBaseInfo.mm +index f50e28649b7..09c605f5ca8 100644 +--- a/driver/js/ios/base/HippyDeviceBaseInfo.mm ++++ b/driver/js/ios/base/HippyDeviceBaseInfo.mm +@@ -24,7 +24,7 @@ + #import + #import ""HippyEventDispatcher.h"" + #import ""HippyAssert.h"" +-#import ""HippyUtils.h"" ++#import ""NativeRenderUtils.h"" + + static BOOL isiPhoneX() { + if (@available(iOS 11.0, *)) { +@@ -38,7 +38,7 @@ static BOOL isiPhoneX() { + NSDictionary *hippyExportedDimensions() { + NSCAssert([NSThread mainThread], @""this function can only be called in main thread""); + CGSize screenSize = [UIScreen mainScreen].bounds.size; +- CGSize windowSize = HippyKeyWindow() ? HippyKeyWindow().bounds.size : screenSize; ++ CGSize windowSize = NativeRenderKeyWindow() ? NativeRenderKeyWindow().bounds.size : screenSize; + CGFloat statusBarHeight = [[UIApplication sharedApplication] statusBarFrame].size.height; + if (statusBarHeight == 0) { + statusBarHeight = isiPhoneX() ? 44 : 20; +diff --git a/driver/js/ios/base/HippyEventDispatcher.mm b/driver/js/ios/base/HippyEventDispatcher.mm +index a397b34dddd..6973117dd91 100644 +--- a/driver/js/ios/base/HippyEventDispatcher.mm ++++ b/driver/js/ios/base/HippyEventDispatcher.mm +@@ -21,9 +21,9 @@ + */ + + #import ""HippyEventDispatcher.h"" +-#import ""UIView+Hippy.h"" ++#import ""UIView+NativeRender.h"" + #import ""HippyAssert.h"" +-#import ""HippyUtils.h"" ++#import ""NativeRenderUtils.h"" + + const NSInteger HippyTextUpdateLagWarningThreshold = 3; + +diff --git a/driver/js/ios/base/HippyFrameUpdate.m b/driver/js/ios/base/HippyFrameUpdate.m +index 5febb670df4..c8a142599c6 100644 +--- a/driver/js/ios/base/HippyFrameUpdate.m ++++ b/driver/js/ios/base/HippyFrameUpdate.m +@@ -21,10 +21,9 @@ + */ + + #import +- + #import ""HippyFrameUpdate.h"" +- +-#import ""HippyUtils.h"" ++#import ""NativeRenderUtils.h"" ++#import ""HippyDefines.h"" + + @implementation HippyFrameUpdate + +diff --git a/driver/js/ios/base/HippyJSEnginesMapper.mm b/driver/js/ios/base/HippyJSEnginesMapper.mm +index 5275fb08431..2236222b525 100644 +--- a/driver/js/ios/base/HippyJSEnginesMapper.mm ++++ b/driver/js/ios/base/HippyJSEnginesMapper.mm +@@ -21,7 +21,7 @@ + */ + + #import ""HippyJSEnginesMapper.h"" +-#import ""HippyLog.h"" ++#import ""NativeRenderLog.h"" + + using EngineRef = std::pair, NSUInteger>; + using EngineMapper = std::unordered_map; +@@ -86,7 +86,7 @@ - (void)removeEngineForKey:(NSString *)key { + EngineRef &ref = it->second; + ref.second--; + if (0 == ref.second) { +- HippyLogInfo(@""[Hippy_OC_Log][Life_Circle],HippyJSCExecutor destroy engine %@"", key); ++ NativeRenderLogInfo(@""[Hippy_OC_Log][Life_Circle],HippyJSCExecutor destroy engine %@"", key); + std::shared_ptr engine = ref.first; + engine->TerminateRunner(); + _engineMapper.erase(it); +diff --git a/driver/js/ios/base/HippyJSStackFrame.m b/driver/js/ios/base/HippyJSStackFrame.m +index de97f3109c0..0d21d24c1ea 100644 +--- a/driver/js/ios/base/HippyJSStackFrame.m ++++ b/driver/js/ios/base/HippyJSStackFrame.m +@@ -21,8 +21,8 @@ + */ + + #import ""HippyJSStackFrame.h"" +-#import ""HippyLog.h"" +-#import ""HippyUtils.h"" ++#import ""NativeRenderLog.h"" ++#import ""NativeRenderUtils.h"" + + static NSRegularExpression *HippyJSStackFrameRegex() { + static dispatch_once_t onceToken; +@@ -31,7 +31,7 @@ + NSError *regexError; + _regex = [NSRegularExpression regularExpressionWithPattern:@""^([^@]+)@(.*):(\\d+):(\\d+)$"" options:0 error:®exError]; + if (regexError) { +- HippyLogError(@""Failed to build regex: %@"", [regexError localizedDescription]); ++ NativeRenderLogError(@""Failed to build regex: %@"", [regexError localizedDescription]); + } + }); + return _regex; +@@ -51,8 +51,8 @@ - (instancetype)initWithMethodName:(NSString *)methodName file:(NSString *)file + + - (NSDictionary *)toDictionary { + return @{ +- @""methodName"": HippyNullIfNil(self.methodName), +- @""file"": HippyNullIfNil(self.file), ++ @""methodName"": NativeRenderNullIfNil(self.methodName), ++ @""file"": NativeRenderNullIfNil(self.file), + @""lineNumber"": @(self.lineNumber), + @""column"": @(self.column) + }; +diff --git a/driver/js/ios/base/HippyJavaScriptLoader.mm b/driver/js/ios/base/HippyJavaScriptLoader.mm +index 241193dfc8d..7432621a21e 100644 +--- a/driver/js/ios/base/HippyJavaScriptLoader.mm ++++ b/driver/js/ios/base/HippyJavaScriptLoader.mm +@@ -23,8 +23,8 @@ + #import ""HippyJavaScriptLoader.h"" + + #import ""HippyBridge.h"" +-#import ""HippyConvert.h"" +-#import ""HippyUtils.h"" ++#import ""NativeRenderConvert.h"" ++#import ""NativeRenderUtils.h"" + #import ""HippyPerformanceLogger.h"" + + #include +@@ -108,11 +108,11 @@ static void attemptAsynchronousLoadOfBundleAtURL( + + static NSURL *sanitizeURL(NSURL *url) { + // Why we do this is lost to time. We probably shouldn't; passing a valid URL is the caller's responsibility not ours. +- return [HippyConvert NSURL:url.absoluteString]; ++ return [NativeRenderConvert NSURL:url.absoluteString]; + } + + static NSDictionary *userInfoForRawResponse(NSString *rawText) { +- NSDictionary *parsedResponse = HippyJSONParse(rawText, nil); ++ NSDictionary *parsedResponse = NativeRenderJSONParse(rawText, nil); + if (![parsedResponse isKindOfClass:[NSDictionary class]]) { + return @ { NSLocalizedDescriptionKey: rawText ?: @"""" }; + } +diff --git a/driver/js/ios/base/HippyKeyCommands.m b/driver/js/ios/base/HippyKeyCommands.m +index b0b00ed0558..cd4e0486c79 100644 +--- a/driver/js/ios/base/HippyKeyCommands.m ++++ b/driver/js/ios/base/HippyKeyCommands.m +@@ -24,7 +24,7 @@ + #import + #import ""HippyAssert.h"" + #import ""HippyDefines.h"" +-#import ""HippyUtils.h"" ++#import ""NativeRenderUtils.h"" + + #if HIPPY_DEV + +@@ -200,12 +200,12 @@ @implementation HippyKeyCommands + + (void)initialize { + if (HippyIsIOS8OrEarlier()) { + // swizzle UIApplication +- HippySwapInstanceMethods([UIApplication class], @selector(keyCommands), @selector(hippy_keyCommands)); ++ NativeRenderSwapInstanceMethods([UIApplication class], @selector(keyCommands), @selector(hippy_keyCommands)); + +- HippySwapInstanceMethods([UIApplication class], @selector(sendAction:to:from:forEvent:), @selector(hippy_sendAction:to:from:forEvent:)); ++ NativeRenderSwapInstanceMethods([UIApplication class], @selector(sendAction:to:from:forEvent:), @selector(hippy_sendAction:to:from:forEvent:)); + } else { + // swizzle UIResponder +- HippySwapInstanceMethods([UIResponder class], @selector(keyCommands), @selector(hippy_keyCommands)); ++ NativeRenderSwapInstanceMethods([UIResponder class], @selector(keyCommands), @selector(hippy_keyCommands)); + } + } + +@@ -227,7 +227,7 @@ - (instancetype)init { + } + + - (void)registerKeyCommandWithInput:(NSString *)input modifierFlags:(UIKeyModifierFlags)flags action:(void (^)(UIKeyCommand *))block { +- HippyAssertMainQueue(); ++ NativeRenderAssertMainQueue(); + + if (input.length && flags && HippyIsIOS8OrEarlier()) { + // Workaround around the first cmd not working: http://openradar.appspot.com/19613391 +@@ -245,7 +245,7 @@ - (void)registerKeyCommandWithInput:(NSString *)input modifierFlags:(UIKeyModifi + } + + - (void)unregisterKeyCommandWithInput:(NSString *)input modifierFlags:(UIKeyModifierFlags)flags { +- HippyAssertMainQueue(); ++ NativeRenderAssertMainQueue(); + + for (HippyKeyCommand *command in _commands.allObjects) { + if ([command matchesInput:input flags:flags]) { +@@ -256,7 +256,7 @@ - (void)unregisterKeyCommandWithInput:(NSString *)input modifierFlags:(UIKeyModi + } + + - (BOOL)isKeyCommandRegisteredForInput:(NSString *)input modifierFlags:(UIKeyModifierFlags)flags { +- HippyAssertMainQueue(); ++ NativeRenderAssertMainQueue(); + + for (HippyKeyCommand *command in _commands.allObjects) { // add by stockGroup + if ([command matchesInput:input flags:flags]) { +@@ -267,7 +267,7 @@ - (BOOL)isKeyCommandRegisteredForInput:(NSString *)input modifierFlags:(UIKeyMod + } + + - (void)registerDoublePressKeyCommandWithInput:(NSString *)input modifierFlags:(UIKeyModifierFlags)flags action:(void (^)(UIKeyCommand *))block { +- HippyAssertMainQueue(); ++ NativeRenderAssertMainQueue(); + + if (input.length && flags && HippyIsIOS8OrEarlier()) { + // Workaround around the first cmd not working: http://openradar.appspot.com/19613391 +@@ -285,7 +285,7 @@ - (void)registerDoublePressKeyCommandWithInput:(NSString *)input modifierFlags:( + } + + - (void)unregisterDoublePressKeyCommandWithInput:(NSString *)input modifierFlags:(UIKeyModifierFlags)flags { +- HippyAssertMainQueue(); ++ NativeRenderAssertMainQueue(); + + for (HippyKeyCommand *command in _commands.allObjects) { + if ([command matchesInput:input flags:flags]) { +@@ -296,7 +296,7 @@ - (void)unregisterDoublePressKeyCommandWithInput:(NSString *)input modifierFlags + } + + - (BOOL)isDoublePressKeyCommandRegisteredForInput:(NSString *)input modifierFlags:(UIKeyModifierFlags)flags { +- HippyAssertMainQueue(); ++ NativeRenderAssertMainQueue(); + + for (HippyKeyCommand *command in _commands.allObjects) { // add by stockGroup + if ([command matchesInput:input flags:flags]) { +diff --git a/driver/js/ios/base/HippyModuleData.h b/driver/js/ios/base/HippyModuleData.h +index cf2607aba22..be95fea1603 100644 +--- a/driver/js/ios/base/HippyModuleData.h ++++ b/driver/js/ios/base/HippyModuleData.h +@@ -22,13 +22,13 @@ + + #import + +-#import ""HippyInvalidating.h"" ++#import ""NativeRenderInvalidating.h"" + + @protocol HippyBridgeMethod; + @protocol HippyBridgeModule; + @class HippyBridge; + +-@interface HippyModuleData : NSObject ++@interface HippyModuleData : NSObject + + - (instancetype)initWithModuleClass:(Class)moduleClass bridge:(HippyBridge *)bridge NS_DESIGNATED_INITIALIZER; + +diff --git a/driver/js/ios/base/HippyModuleData.mm b/driver/js/ios/base/HippyModuleData.mm +index 71d669ce163..6f0416259d4 100644 +--- a/driver/js/ios/base/HippyModuleData.mm ++++ b/driver/js/ios/base/HippyModuleData.mm +@@ -29,8 +29,8 @@ + #import ""HippyBridge.h"" + #import ""HippyBridge+Private.h"" + #import ""HippyModuleMethod.h"" +-#import ""HippyLog.h"" +-#import ""HippyUtils.h"" ++#import ""NativeRenderLog.h"" ++#import ""NativeRenderUtils.h"" + #import ""HippyAssert.h"" + + @implementation HippyModuleData { +@@ -62,7 +62,7 @@ - (void)setUp { + + // If a module overrides `constantsToExport` then we must assume that it + // must be called on the main thread, because it may need to access UIKit. +- _hasConstantsToExport = HippyClassOverridesInstanceMethod(_moduleClass, @selector(constantsToExport)); ++ _hasConstantsToExport = NativeRenderClassOverridesInstanceMethod(_moduleClass, @selector(constantsToExport)); + } + + - (instancetype)initWithModuleClass:(Class)moduleClass bridge:(HippyBridge *)bridge { +@@ -99,7 +99,7 @@ - (void)setUpInstanceAndBridge { + if (!_setupComplete) { + if (!_instance) { + if (HIPPY_DEBUG && _requiresMainQueueSetup) { +- HippyAssertMainQueue(); ++ NativeRenderAssertMainQueue(); + } + // HIPPY_PROFILE_BEGIN_EVENT(HippyProfileTagAlways, @""[HippyModuleData setUpInstanceAndBridge] [_moduleClass new]"", @{ + // @""moduleClass"": NSStringFromClass(_moduleClass) }); +@@ -110,7 +110,7 @@ - (void)setUpInstanceAndBridge { + // of the module is not supported, and it is supposed to be passed in to + // the bridge constructor. Mark setup complete to avoid doing more work. + _setupComplete = YES; +- HippyLogWarn(@""The module %@ is returning nil from its constructor. You "" ++ NativeRenderLogWarn(@""The module %@ is returning nil from its constructor. You "" + ""may need to instantiate it yourself and pass it into the "" + ""bridge."", + _moduleClass); +@@ -152,7 +152,7 @@ - (void)setBridgeForInstance { + @try { + [(id)_instance setValue:_bridge forKey:@""bridge""]; + } @catch (NSException *exception) { +- HippyLogError(@""%@ has no setter or ivar for its bridge, which is not "" ++ NativeRenderLogError(@""%@ has no setter or ivar for its bridge, which is not "" + ""permitted. You must either @synthesize the bridge property, "" + ""or provide your own setter method."", + self.name); +@@ -192,7 +192,7 @@ - (void)setUpMethodQueue { + @try { + [(id)_instance setValue:[self methodQueueWithoutInstance] forKey:@""methodQueue""]; + } @catch (NSException *exception) { +- HippyLogError(@""%@ is returning nil for its methodQueue, which is not "" ++ NativeRenderLogError(@""%@ is returning nil for its methodQueue, which is not "" + ""permitted. You must either return a pre-initialized "" + ""queue, or @synthesize the methodQueue to let the bridge "" + ""create a queue for you."", +@@ -221,12 +221,12 @@ - (BOOL)hasInstance { + // deadlock is better than a fairly high risk of an assertion being thrown. + // HIPPY_PROFILE_BEGIN_EVENT(HippyProfileTagAlways, @""[HippyModuleData instance] main thread setup"", nil); + +- if (!HippyIsMainQueue()) { +- HippyLogWarn(@""HippyBridge required dispatch_sync to load %@. This may lead to deadlocks"", _moduleClass); ++ if (!NativeRenderIsMainQueue()) { ++ NativeRenderLogWarn(@""HippyBridge required dispatch_sync to load %@. This may lead to deadlocks"", _moduleClass); + } + #pragma clang diagnostic push + #pragma clang diagnostic ignored ""-Wdeprecated-declarations"" +- HippyExecuteOnMainThread( ++ NativeRenderExecuteOnMainThread( + ^{ + [self setUpInstanceAndBridge]; + }, YES); +@@ -290,12 +290,12 @@ - (void)gatherConstants { + if (_hasConstantsToExport && !_constantsToExport) { + // HIPPY_PROFILE_BEGIN_EVENT(HippyProfileTagAlways, ([NSString stringWithFormat:@""[HippyModuleData gatherConstants] %@"", _moduleClass]), nil); + (void)[self instance]; +- if (!HippyIsMainQueue()) { +- HippyLogWarn(@""Required dispatch_sync to load constants for %@. This may lead to deadlocks"", _moduleClass); ++ if (!NativeRenderIsMainQueue()) { ++ NativeRenderLogWarn(@""Required dispatch_sync to load constants for %@. This may lead to deadlocks"", _moduleClass); + } + #pragma clang diagnostic push + #pragma clang diagnostic ignored ""-Wdeprecated-declarations"" +- HippyExecuteOnMainThread( ++ NativeRenderExecuteOnMainThread( + ^{ + self->_constantsToExport = [self->_instance constantsToExport] ?: @ {}; + }, YES); +@@ -334,7 +334,7 @@ - (NSArray *)config { + [methods addObject:method.JSMethodName]; + } + +- NSArray *config = @[self.name, HippyNullIfNil(constants), HippyNullIfNil(methods), HippyNullIfNil(promiseMethods), HippyNullIfNil(syncMethods)]; ++ NSArray *config = @[self.name, NativeRenderNullIfNil(constants), NativeRenderNullIfNil(methods), NativeRenderNullIfNil(promiseMethods), NativeRenderNullIfNil(syncMethods)]; + // HIPPY_PROFILE_END_EVENT(HippyProfileTagAlways, ([NSString stringWithFormat:@""[HippyModuleData config] %@"", _moduleClass])); + return config; + } +diff --git a/driver/js/ios/base/HippyModuleMethod.mm b/driver/js/ios/base/HippyModuleMethod.mm +index f1fa96c14f7..ca2e6884327 100644 +--- a/driver/js/ios/base/HippyModuleMethod.mm ++++ b/driver/js/ios/base/HippyModuleMethod.mm +@@ -27,10 +27,10 @@ + #import ""HippyAssert.h"" + #import ""HippyBridge.h"" + #import ""HippyBridge+Private.h"" +-#import ""HippyConvert.h"" +-#import ""HippyLog.h"" +-#import ""HippyParserUtils.h"" +-#import ""HippyUtils.h"" ++#import ""NativeRenderConvert.h"" ++#import ""NativeRenderLog.h"" ++#import ""NativeRenderParserUtils.h"" ++#import ""NativeRenderUtils.h"" + #import ""HippyTurboModuleManager.h"" + + typedef BOOL (^HippyArgumentBlock)(HippyBridge *, NSUInteger, id); +@@ -63,9 +63,9 @@ @implementation HippyModuleMethod { + + @synthesize arguments = _arguments; + +-static void HippyLogArgumentError( ++static void NativeRenderLogArgumentError( + __unused HippyModuleMethod *method, __unused NSUInteger index, __unused id valueOrType, __unused const char *issue) { +- HippyLogError( ++ NativeRenderLogError( + @""Argument %tu (%@) of %@.%@ %s"", index, valueOrType, HippyBridgeModuleNameForClass(method->_moduleClass), method.JSMethodName, issue); + } + +@@ -75,36 +75,36 @@ static void HippyLogArgumentError( + // least one argument, and maybe more selector parts) or NO if it doesn't. + static BOOL HippyParseSelectorPart(const char **input, NSMutableString *selector) { + NSString *selectorPart; +- if (HippyParseIdentifier(input, &selectorPart)) { ++ if (NativeRenderParseIdentifier(input, &selectorPart)) { + [selector appendString:selectorPart]; + } +- HippySkipWhitespace(input); +- if (HippyReadChar(input, ':')) { ++ NativeRenderSkipWhitespace(input); ++ if (NativeRenderReadChar(input, ':')) { + [selector appendString:@"":""]; +- HippySkipWhitespace(input); ++ NativeRenderSkipWhitespace(input); + return YES; + } + return NO; + } + + static BOOL HippyParseUnused(const char **input) { +- return HippyReadString(input, ""__unused"") || HippyReadString(input, ""__attribute__((unused))"") +- || HippyReadString(input, ""__attribute__((__unused__))""); ++ return NativeRenderReadString(input, ""__unused"") || NativeRenderReadString(input, ""__attribute__((unused))"") ++ || NativeRenderReadString(input, ""__attribute__((__unused__))""); + } + + static HippyNullability HippyParseNullability(const char **input) { +- if (HippyReadString(input, ""nullable"")) { ++ if (NativeRenderReadString(input, ""nullable"")) { + return HippyNullable; +- } else if (HippyReadString(input, ""nonnull"")) { ++ } else if (NativeRenderReadString(input, ""nonnull"")) { + return HippyNonnullable; + } + return HippyNullabilityUnspecified; + } + + static HippyNullability HippyParseNullabilityPostfix(const char **input) { +- if (HippyReadString(input, ""_Nullable"")) { ++ if (NativeRenderReadString(input, ""_Nullable"")) { + return HippyNullable; +- } else if (HippyReadString(input, ""_Nonnull"")) { ++ } else if (NativeRenderReadString(input, ""_Nonnull"")) { + return HippyNonnullable; + } + return HippyNullabilityUnspecified; +@@ -113,7 +113,7 @@ static HippyNullability HippyParseNullabilityPostfix(const char **input) { + SEL HippyParseMethodSignature(NSString *, NSArray **); + SEL HippyParseMethodSignature(NSString *methodSignature, NSArray **arguments) { + const char *input = methodSignature.UTF8String; +- HippySkipWhitespace(&input); ++ NativeRenderSkipWhitespace(&input); + + NSMutableArray *args; + NSMutableString *selector = [NSMutableString new]; +@@ -123,32 +123,32 @@ SEL HippyParseMethodSignature(NSString *methodSignature, NSArray_moduleClass); +@@ -321,7 +321,7 @@ - (void)processMethodSignature { + } else if ([typeName isEqualToString:@""HippyPromiseResolveBlock""]) { + HippyAssert(i == numberOfArguments - 2, @""The HippyPromiseResolveBlock must be the second to last parameter in -[%@ %@]"", _moduleClass, _methodSignature); + HIPPY_ARG_BLOCK(if (HIPPY_DEBUG && ![json isKindOfClass:[NSNumber class]]) { +- HippyLogArgumentError(weakSelf, index, json, ""should be a promise resolver function""); ++ NativeRenderLogArgumentError(weakSelf, index, json, ""should be a promise resolver function""); + return NO; + } + Hippy_BLOCK_ARGUMENT(^(id result) { +@@ -343,11 +343,11 @@ - (void)processMethodSignature { + HippyAssert( + i == numberOfArguments - 1, @""The HippyPromiseRejectBlock must be the last parameter in -[%@ %@]"", _moduleClass, _methodSignature); + HIPPY_ARG_BLOCK(if (HIPPY_DEBUG && ![json isKindOfClass:[NSNumber class]]) { +- HippyLogArgumentError(weakSelf, index, json, ""should be a promise rejecter function""); ++ NativeRenderLogArgumentError(weakSelf, index, json, ""should be a promise rejecter function""); + return NO; + } + Hippy_BLOCK_ARGUMENT(^(NSString *code, NSString *message, NSError *error) { +- NSDictionary *errorJSON = HippyJSErrorFromCodeMessageAndNSError(code, message, error); ++ NSDictionary *errorJSON = NativeRenderJSErrorFromCodeMessageAndNSError(code, message, error); + NSArray *args = @[errorJSON]; + BOOL shouldEnqueueCallback = YES; + if ([[bridge methodInterceptor] respondsToSelector:@selector(shouldCallbackBeInvokedWithModuleName:methodName:callbackId:arguments:)]) { +@@ -369,7 +369,7 @@ - (void)processMethodSignature { + }]; + } else { + // Unknown argument type +- HippyLogError(@""Unknown argument type '%@' in method %@. Extend HippyConvert"" ++ NativeRenderLogError(@""Unknown argument type '%@' in method %@. Extend HippyConvert"" + "" to support this type."", + typeName, [self methodName]); + } +@@ -378,7 +378,7 @@ - (void)processMethodSignature { + HippyNullability nullability = argument.nullability; + if (!isNullableType) { + if (nullability == HippyNullable) { +- HippyLogArgumentError(weakSelf, i - 2, typeName, ++ NativeRenderLogArgumentError(weakSelf, i - 2, typeName, + ""is marked as "" + ""nullable, but is not a nullable type.""); + } +@@ -392,7 +392,7 @@ - (void)processMethodSignature { + if ([typeName isEqualToString:@""NSNumber""]) { + BOOL unspecified = (nullability == HippyNullabilityUnspecified); + if (!argument.unused && (nullability == HippyNullable || unspecified)) { +- HippyLogArgumentError(weakSelf, i - 2, typeName, ++ NativeRenderLogArgumentError(weakSelf, i - 2, typeName, + [unspecified ? @""has unspecified nullability"" : @""is marked as nullable"" + stringByAppendingString:@"" but Hippy requires that all NSNumber "" + ""arguments are explicitly marked as `nonnull` to ensure "" +@@ -420,7 +420,7 @@ - (void)processMethodSignature { + } + return YES; + } +- HippyLogArgumentError(weakSelf, index, typeName, ""must not be null""); ++ NativeRenderLogArgumentError(weakSelf, index, typeName, ""must not be null""); + return NO; + }; + } +@@ -491,7 +491,7 @@ - (id)invokeWithBridge:(HippyBridge *)bridge module:(id)module arguments:(NSArra + expectedCount -= 2; + } + +- HippyLogError(@""%@.%@ was called with %ld arguments, but expects %ld. \ ++ NativeRenderLogError(@""%@.%@ was called with %ld arguments, but expects %ld. \ + If you haven\'t changed this method "" + @""yourself, this usually means that \ + your versions of the native code and JavaScript code are out "" +@@ -511,9 +511,9 @@ - (id)invokeWithBridge:(HippyBridge *)bridge module:(id)module arguments:(NSArra + break; + } + HippyArgumentBlock block = _argumentBlocks[index]; +- if (!block(bridge, index, HippyNilIfNull(json))) { ++ if (!block(bridge, index, NativeRenderNilIfNull(json))) { + // Invalid argument, abort +- HippyLogArgumentError(self, index, json, ""could not be processed. Aborting method call.""); ++ NativeRenderLogArgumentError(self, index, json, ""could not be processed. Aborting method call.""); + return nil; + } + index++; +diff --git a/driver/js/ios/base/HippyPerformanceLogger.mm b/driver/js/ios/base/HippyPerformanceLogger.mm +index eee9222c094..255b3edd440 100644 +--- a/driver/js/ios/base/HippyPerformanceLogger.mm ++++ b/driver/js/ios/base/HippyPerformanceLogger.mm +@@ -24,7 +24,7 @@ + + #import ""HippyPerformanceLogger.h"" + #import ""HippyRootView.h"" +-#import ""HippyLog.h"" ++#import ""NativeRenderLog.h"" + + @interface HippyPerformanceLogger () { + int64_t _data[HippyPLSize][2]; +@@ -71,7 +71,7 @@ - (void)markStopForTag:(HippyPLTag)tag { + if (_data[tag][0] != 0 && _data[tag][1] == 0) { + _data[tag][1] = CACurrentMediaTime() * 1000; + } else { +- HippyLogInfo(@""[Hippy_OC_Log][Performance],Unbalanced calls start/end for tag %li"", (unsigned long)tag); ++ NativeRenderLogInfo(@""[Hippy_OC_Log][Performance],Unbalanced calls start/end for tag %li"", (unsigned long)tag); + } + } + +@@ -94,7 +94,7 @@ - (void)appendStopForTag:(HippyPLTag)tag { + _data[tag][1] += CACurrentMediaTime() * 1000 - _data[tag][0]; + _data[tag][0] = 0; + } else { +- HippyLogInfo(@""[Hippy_OC_Log][Performance],Unbalanced calls start/end for tag %li"", (unsigned long)tag); ++ NativeRenderLogInfo(@""[Hippy_OC_Log][Performance],Unbalanced calls start/end for tag %li"", (unsigned long)tag); + } + } + +diff --git a/driver/js/ios/base/HippyRootView.mm b/driver/js/ios/base/HippyRootView.mm +index 4c6ea3a32c9..9a57cac330f 100644 +--- a/driver/js/ios/base/HippyRootView.mm ++++ b/driver/js/ios/base/HippyRootView.mm +@@ -30,16 +30,16 @@ + #import ""HippyBridge+Private.h"" + #import ""HippyEventDispatcher.h"" + #import ""HippyKeyCommands.h"" +-#import ""HippyLog.h"" ++#import ""NativeRenderLog.h"" + #import ""HippyPerformanceLogger.h"" +-#import ""HippyUIManager.h"" +-#import ""HippyUtils.h"" +-#import ""HippyView.h"" +-#import ""UIView+Hippy.h"" ++#import ""NativeRenderUIManager.h"" ++#import ""NativeRenderUtils.h"" ++#import ""NativeRenderView.h"" ++#import ""UIView+NativeRender.h"" + #import ""HippyBundleURLProvider.h"" + #include ""scope.h"" + #include ""footstone/hippy_value.h"" +-#include ""HippyDomNodeUtils.h"" ++#include ""NativeRenderDomNodeUtils.h"" + + NSString *const HippyContentDidAppearNotification = @""HippyContentDidAppearNotification""; + +@@ -51,7 +51,7 @@ + } + } + +-@interface HippyRootContentView : HippyView ++@interface HippyRootContentView : NativeRenderView + + @property (nonatomic, readonly) BOOL contentHasAppeared; + @property (nonatomic, assign) int64_t startTimpStamp; +@@ -80,7 +80,7 @@ - (instancetype)initWithBridge:(HippyBridge *)bridge + moduleName:(NSString *)moduleName + initialProperties:(NSDictionary *)initialProperties + delegate:(id)delegate { +- HippyAssertMainQueue(); ++ NativeRenderAssertMainQueue(); + HippyAssert(bridge, @""A bridge instance is required to create an HippyRootView""); + HippyAssert(moduleName, @""A moduleName is required to create an HippyRootView""); + +@@ -123,7 +123,7 @@ - (instancetype)initWithBridge:(HippyBridge *)bridge + + [self showLoadingView]; + [_bridge.performanceLogger markStartForTag:HippyPLTTI]; +- HippyLogInfo(@""[Hippy_OC_Log][Life_Circle],HippyRootView Init %p"", self); ++ NativeRenderLogInfo(@""[Hippy_OC_Log][Life_Circle],HippyRootView Init %p"", self); + } + + return self; +@@ -240,7 +240,7 @@ - (void)_contentDidAppear:(NSNotification *)n { + } + + - (NSNumber *)hippyTag { +- HippyAssertMainQueue(); ++ NativeRenderAssertMainQueue(); + if (!super.hippyTag) { + self.hippyTag = AllocRootViewTag(); + } +@@ -248,13 +248,13 @@ - (NSNumber *)hippyTag { + } + + - (void)bridgeDidReload { +- HippyAssertMainQueue(); ++ NativeRenderAssertMainQueue(); + // Clear the hippyTag so it can be re-assigned + self.hippyTag = nil; + } + + - (void)javaScriptDidLoad:(NSNotification *)notification { +- HippyAssertMainQueue(); ++ NativeRenderAssertMainQueue(); + + // Use the (batched) bridge that's sent in the notification payload, so the + // HippyRootContentView is scoped to the right bridge +@@ -268,7 +268,7 @@ - (void)javaScriptDidFailToLoad:(NSNotification *)notification { + HippyBridge *bridge = notification.userInfo[@""bridge""]; + NSError *error = notification.userInfo[@""error""]; + if (bridge == self.bridge && error) { +- NSError *retError = HippyErrorFromErrorAndModuleName(error, self.bridge.moduleName); ++ NSError *retError = NativeRenderErrorFromErrorAndModuleName(error, self.bridge.moduleName); + HippyFatal(retError); + } + } +@@ -297,14 +297,14 @@ - (void)contentDidAppear:(__unused int64_t)cost { + + - (void)secondaryBundleDidLoadSourceCode:(NSError *)error { + if (error) { +- NSError *retError = HippyErrorFromErrorAndModuleName(error, self.bridge.moduleName); ++ NSError *retError = NativeRenderErrorFromErrorAndModuleName(error, self.bridge.moduleName); + HippyFatal(retError); + } + } + + - (void)secondayBundleDidFinishLoad:(NSError *)error { + if (error) { +- NSError *retError = HippyErrorFromErrorAndModuleName(error, self.bridge.moduleName); ++ NSError *retError = NativeRenderErrorFromErrorAndModuleName(error, self.bridge.moduleName); + HippyFatal(retError); + } + } +@@ -328,7 +328,7 @@ - (void)runApplication:(HippyBridge *)bridge { + return; + } + NSString *moduleName = _moduleName ?: @""""; +- HippyLogInfo(@""[Hippy_OC_Log][Life_Circle],Running application %@ (%@)"", moduleName, _appProperties); ++ NativeRenderLogInfo(@""[Hippy_OC_Log][Life_Circle],Running application %@ (%@)"", moduleName, _appProperties); + NSDictionary *param = @{@""name"": moduleName, + @""id"": _contentView.hippyTag, + @""params"": _appProperties ?: @{}, +@@ -345,7 +345,7 @@ - (void)layoutSubviews { + } + + - (void)setAppProperties:(NSDictionary *)appProperties { +- HippyAssertMainQueue(); ++ NativeRenderAssertMainQueue(); + + if ([_appProperties isEqualToDictionary:appProperties]) { + return; +@@ -388,7 +388,7 @@ - (void)dealloc + if ([_delegate respondsToSelector:@selector(rootViewWillBePurged:)]) { + [_delegate rootViewWillBePurged:self]; + } +- HippyLogInfo(@""[Hippy_OC_Log][Life_Circle],HippyRootView dealloc %p"", self); ++ NativeRenderLogInfo(@""[Hippy_OC_Log][Life_Circle],HippyRootView dealloc %p"", self); + } + + @end +diff --git a/driver/js/ios/base/executors/HippyJSCExecutor.h b/driver/js/ios/base/executors/HippyJSCExecutor.h +index e927bab6029..501fa48f501 100644 +--- a/driver/js/ios/base/executors/HippyJSCExecutor.h ++++ b/driver/js/ios/base/executors/HippyJSCExecutor.h +@@ -23,7 +23,7 @@ + #import + #import ""HippyDefines.h"" + #import ""HippyBridgeModule.h"" +-#import ""HippyInvalidating.h"" ++#import ""NativeRenderInvalidating.h"" + #import + + typedef void (^HippyJavaScriptValueCallback)(JSValue *result, NSError *error); +@@ -55,7 +55,7 @@ HIPPY_EXTERN NSString *const HippyJavaScriptContextCreatedNotificationBridgeKey; + /** + * Uses a JavaScriptCore context as the execution engine. + */ +-@interface HippyJSCExecutor : NSObject ++@interface HippyJSCExecutor : NSObject + + @property (nonatomic, strong) HippyBridge *bridge; + /** +diff --git a/driver/js/ios/base/executors/HippyJSCExecutor.mm b/driver/js/ios/base/executors/HippyJSCExecutor.mm +index 489a2773517..2397628df7d 100644 +--- a/driver/js/ios/base/executors/HippyJSCExecutor.mm ++++ b/driver/js/ios/base/executors/HippyJSCExecutor.mm +@@ -35,9 +35,9 @@ + #import ""HippyDefines.h"" + #import ""HippyDevMenu.h"" + #import ""HippyJavaScriptLoader.h"" +-#import ""HippyLog.h"" ++#import ""NativeRenderLog.h"" + #import ""HippyPerformanceLogger.h"" +-#import ""HippyUtils.h"" ++#import ""NativeRenderUtils.h"" + #import ""HippyRedBox.h"" + #import ""HippyJSCErrorHandling.h"" + #import ""HippyJSEnginesMapper.h"" +@@ -82,9 +82,9 @@ struct __attribute__((packed)) ModuleData { + + static bool defaultDynamicLoadAction(const unicode_string_view& uri, std::function cb) { + std::u16string u16Uri = StringViewUtils::Convert(uri, unicode_string_view::Encoding::Utf16).utf16_value(); +- HippyLogInfo(@""[Hippy_OC_Log][Dynamic_Load], to default dynamic load action:%S"", (const unichar*)u16Uri.c_str()); ++ NativeRenderLogInfo(@""[Hippy_OC_Log][Dynamic_Load], to default dynamic load action:%S"", (const unichar*)u16Uri.c_str()); + NSString *URIString = [NSString stringWithCharacters:(const unichar*)u16Uri.c_str() length:(u16Uri.length())]; +- NSURL *url = HippyURLWithString(URIString, NULL); ++ NSURL *url = NativeRenderURLWithString(URIString, NULL); + if ([url isFileURL]) { + NSString *result = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:nil]; + u8string content(reinterpret_cast([result UTF8String]?[result UTF8String]:"""")); +@@ -94,7 +94,7 @@ static bool defaultDynamicLoadAction(const unicode_string_view& uri, std::functi + NSURLRequest *req = [NSURLRequest requestWithURL:url]; + [[[NSURLSession sharedSession] dataTaskWithRequest:req completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { + if (error) { +- HippyLogInfo(@""[Hippy_OC_Log][Dynamic_Load], error:%@"", [error description]); ++ NativeRenderLogInfo(@""[Hippy_OC_Log][Dynamic_Load], error:%@"", [error description]); + } + else { + NSString *result = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; +@@ -108,7 +108,7 @@ static bool defaultDynamicLoadAction(const unicode_string_view& uri, std::functi + + static bool loadFunc(const unicode_string_view& uri, std::function cb, CFTypeRef userData) { + std::u16string u16Uri = StringViewUtils::Convert(uri, unicode_string_view::Encoding::Utf16).utf16_value(); +- HippyLogInfo(@""[Hippy_OC_Log][Dynamic_Load], start load function:%S"", (const unichar*)u16Uri.c_str()); ++ NativeRenderLogInfo(@""[Hippy_OC_Log][Dynamic_Load], start load function:%S"", (const unichar*)u16Uri.c_str()); + HippyBridge *strongBridge = (__bridge HippyBridge *)userData; + if ([strongBridge.delegate respondsToSelector:@selector(dynamicLoad:URI:completion:)]) { + NSString *URIString = [NSString stringWithCharacters:(const unichar *)u16Uri.c_str() length:u16Uri.length()]; +@@ -165,7 +165,7 @@ - (instancetype)initWithExecurotKey:(NSString *)execurotkey bridge:(HippyBridge + std::shared_ptr scope = engine->CreateScope(pName, std::move(map)); + self.pScope = scope; + [self initURILoader]; +- HippyLogInfo(@""[Hippy_OC_Log][Life_Circle],HippyJSCExecutor Init %p, execurotkey:%@"", self, execurotkey); ++ NativeRenderLogInfo(@""[Hippy_OC_Log][Life_Circle],HippyJSCExecutor Init %p, execurotkey:%@"", self, execurotkey); + #ifdef ENABLE_INSPECTOR + if (bridge.debugMode) { + NSString *wsURL = [self completeWSURLWithBridge:bridge]; +@@ -225,7 +225,7 @@ static unicode_string_view NSStringToU8(NSString* str) { + if ([strongSelf.bridge isKindOfClass:[HippyBatchedBridge class]]) { + HippyBridge *clientBridge = [(HippyBatchedBridge *)strongSelf.bridge parentBridge]; + NSString *deviceName = [[UIDevice currentDevice] name]; +- NSString *clientId = HippyMD5Hash([NSString stringWithFormat:@""%@%p"", deviceName, clientBridge]); ++ NSString *clientId = NativeRenderMD5Hash([NSString stringWithFormat:@""%@%p"", deviceName, clientBridge]); + NSDictionary *debugInfo = @{@""Debug"" : @{@""debugClientId"" : clientId}}; + [deviceInfo addEntriesFromDictionary:debugInfo]; + } +@@ -234,7 +234,7 @@ static unicode_string_view NSStringToU8(NSString* str) { + if (JSONSerializationError) { + NSString *errorString = + [NSString stringWithFormat:@""device parse error:%@, deviceInfo:%@"", [JSONSerializationError localizedFailureReason], deviceInfo]; +- NSError *error = HippyErrorWithMessageAndModuleName(errorString, strongSelf.bridge.moduleName); ++ NSError *error = NativeRenderErrorWithMessageAndModuleName(errorString, strongSelf.bridge.moduleName); + HippyFatal(error); + } + NSString *string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; +@@ -247,7 +247,6 @@ static unicode_string_view NSStringToU8(NSString* str) { + else { + context->SetGlobalStrVar(""__HIPPYCURDIR__"", NSStringToU8(@"""")); + } +- installBasicSynchronousHooksOnContext(jsContext); + jsContext[@""nativeRequireModuleConfig""] = ^NSArray *(NSString *moduleName) { + HippyJSCExecutor *strongSelf = weakSelf; + if (!strongSelf.valid) { +@@ -255,7 +254,7 @@ static unicode_string_view NSStringToU8(NSString* str) { + } + + NSArray *result = [strongSelf->_bridge configForModuleName:moduleName]; +- return HippyNullIfNil(result); ++ return NativeRenderNullIfNil(result); + }; + + jsContext[@""nativeFlushQueueImmediate""] = ^(NSArray *calls) { +@@ -397,21 +396,6 @@ - (BOOL)_synchronouslyExecuteApplicationScript:(NSData *)script sourceURL:(NSURL + - (void)setUp { + } + +-/** Installs synchronous hooks that don't require a weak reference back to the HippyJSCExecutor. */ +-static void installBasicSynchronousHooksOnContext(JSContext *context) { +- context[@""nativeLoggingHook""] = ^(NSString *message, NSNumber *logLevel) { +- HippyLogLevel level = HippyLogLevelInfo; +- if (logLevel) { +- level = MAX(level, (HippyLogLevel)logLevel.integerValue); +- } +- +- _HippyLogJavaScriptInternal(level, message); +- }; +- context[@""nativePerformanceNow""] = ^{ +- return @(CACurrentMediaTime() * 1000); +- }; +-} +- + - (void)invalidate { + if (!self.isValid) { + return; +@@ -419,11 +403,11 @@ - (void)invalidate { + #ifdef ENABLE_INSPECTOR + auto devtools_data_source = self.pScope->GetDevtoolsDataSource(); + if (devtools_data_source) { +- bool reload = self.bridge.invalidateReason == HippyInvalidateReasonReload ? true : false; ++ bool reload = self.bridge.invalidateReason == NativeRenderInvalidateReasonReload ? true : false; + devtools_data_source->Destroy(reload); + } + #endif +- HippyLogInfo(@""[Hippy_OC_Log][Life_Circle],HippyJSCExecutor invalide %p"", self); ++ NativeRenderLogInfo(@""[Hippy_OC_Log][Life_Circle],HippyJSCExecutor invalide %p"", self); + _valid = NO; + self.pScope->WillExit(); + self.pScope = nullptr; +@@ -431,7 +415,7 @@ - (void)invalidate { + _JSContext = nil; + _JSGlobalContextRef = NULL; + dispatch_async(dispatch_get_main_queue(), ^{ +- HippyLogInfo(@""[Hippy_OC_Log][Life_Circle],HippyJSCExecutor remove engine %@"", [self executorkey]); ++ NativeRenderLogInfo(@""[Hippy_OC_Log][Life_Circle],HippyJSCExecutor remove engine %@"", [self executorkey]); + [[HippyJSEnginesMapper defaultInstance] removeEngineForKey:[self executorkey]]; + }); + } +@@ -453,7 +437,7 @@ - (NSString *)executorkey { + // clang-format on + + - (void)dealloc { +- HippyLogInfo(@""[Hippy_OC_Log][Life_Circle],HippyJSCExecutor dealloc %p"", self); ++ NativeRenderLogInfo(@""[Hippy_OC_Log][Life_Circle],HippyJSCExecutor dealloc %p"", self); + [self invalidate]; + _randomAccessBundle.bundle.reset(); + _randomAccessBundle.table.reset(); +@@ -586,19 +570,19 @@ - (void)_executeJSCall:(NSString *)method + jsc_resultValue = std::static_pointer_cast(resultValue); + } else { + executeError +- = HippyErrorWithMessageAndModuleName([NSString stringWithFormat:@""%@ is not a function"", method], moduleName); ++ = NativeRenderErrorWithMessageAndModuleName([NSString stringWithFormat:@""%@ is not a function"", method], moduleName); + } + } else { +- executeError = HippyErrorWithMessageAndModuleName( ++ executeError = NativeRenderErrorWithMessageAndModuleName( + [NSString stringWithFormat:@""property/function %@ not found in __fbBatchedBridge"", method], moduleName); + } + } else { +- executeError = HippyErrorWithMessageAndModuleName(@""__fbBatchedBridge not found"", moduleName); ++ executeError = NativeRenderErrorWithMessageAndModuleName(@""__fbBatchedBridge not found"", moduleName); + } + if (!exception.empty() || executeError) { + if (!exception.empty()) { + NSString *string = [NSString stringWithCharacters: reinterpret_cast(exception.c_str()) length:exception.length()]; +- executeError = HippyErrorWithMessageAndModuleName(string, moduleName); ++ executeError = NativeRenderErrorWithMessageAndModuleName(string, moduleName); + } + } else if (jsc_resultValue) { + JSValueRef resutlRef = jsc_resultValue->value_; +@@ -664,7 +648,7 @@ static void handleJsExcepiton(std::shared_ptr scope) { + } + std::u16string exceptionStr = StringViewUtils::Convert(context->GetExceptionMsg(exception), unicode_string_view::Encoding::Utf16).utf16_value(); + NSString *err = [NSString stringWithCharacters:(const unichar *)exceptionStr.c_str() length:(exceptionStr.length())]; +- NSError *error = HippyErrorWithMessage(err); ++ NSError *error = NativeRenderErrorWithMessage(err); + // NSError *error = RCTErrorWithMessageAndModule(err, strongSelf.bridge.moduleName); + HippyFatal(error); + context->SetException(nullptr); +@@ -755,7 +739,7 @@ - (void)injectJSONText:(NSString *)script asGlobalObjectNamed:(NSString *)object + return; + } + if (HIPPY_DEBUG) { +- HippyAssert(HippyJSONParse(script, NULL) != nil, @""%@ wasn't valid JSON!"", script); ++ HippyAssert(NativeRenderJSONParse(script, NULL) != nil, @""%@ wasn't valid JSON!"", script); + } + + __weak HippyJSCExecutor *weakSelf = self; +@@ -778,7 +762,7 @@ - (void)injectJSONText:(NSString *)script asGlobalObjectNamed:(NSString *)object + if (!valueToInject) { + NSString *errorMessage = [NSString stringWithFormat:@""Can't make JSON value from script '%@'"", script]; + error = [NSError errorWithDomain:HippyErrorDomain code:2 userInfo:@ { NSLocalizedDescriptionKey: errorMessage }]; +- HippyLogError(@""%@"", errorMessage); ++ NativeRenderLogError(@""%@"", errorMessage); + } else { + JSObjectRef globalObject = JSContextGetGlobalObject(ctx); + JSStringRef JSName = JSStringCreateWithCFString((__bridge CFStringRef)objectName); +@@ -805,7 +789,7 @@ static bool readRandomAccessModule(const RandomAccessBundleData &bundleData, siz + static void executeRandomAccessModule(HippyJSCExecutor *executor, uint32_t moduleID, size_t offset, size_t size) { + auto data = std::make_unique(size); + if (!readRandomAccessModule(executor->_randomAccessBundle, offset, size, data.get())) { +- HippyFatal(HippyErrorWithMessage(@""Error loading RAM module"")); ++ HippyFatal(NativeRenderErrorWithMessage(@""Error loading RAM module"")); + return; + } + +@@ -882,7 +866,7 @@ - (NSString *)completeWSURLWithBridge:(HippyBridge *)bridge { + devInfo.wsURL = bundleURLProvider.wsURL; + } + NSString *deviceName = [[UIDevice currentDevice] name]; +- NSString *clientId = HippyMD5Hash([NSString stringWithFormat:@""%@%p"", deviceName, [(HippyBatchedBridge *)bridge parentBridge]]); ++ NSString *clientId = NativeRenderMD5Hash([NSString stringWithFormat:@""%@%p"", deviceName, [(HippyBatchedBridge *)bridge parentBridge]]); + return [devInfo assembleFullWSURLWithClientId:clientId]; + } + +diff --git a/driver/js/ios/debug/websocket/HippySRWebSocket.m b/driver/js/ios/debug/websocket/HippySRWebSocket.m +index 961ee570ecb..b22aa68e74d 100644 +--- a/driver/js/ios/debug/websocket/HippySRWebSocket.m ++++ b/driver/js/ios/debug/websocket/HippySRWebSocket.m +@@ -23,7 +23,7 @@ + #import + + #import ""HippyAssert.h"" +-#import ""HippyLog.h"" ++#import ""NativeRenderLog.h"" + #import ""HippySRSIMDHelpers.h"" + + typedef NS_ENUM(NSInteger, HippySROpCode) { +@@ -50,7 +50,7 @@ typedef NS_ENUM(NSInteger, HippySROpCode) { + + //#define HippySR_ENABLE_LOG + #ifdef HippySR_ENABLE_LOG +-#define HippySRLog(format...) HippyLogInfo(format) ++#define HippySRLog(format...) NativeRenderLogInfo(format) + #else + #define HippySRLog(...) \ + do { \ +diff --git a/driver/js/ios/debug/websocket/HippyWebSocketManager.m b/driver/js/ios/debug/websocket/HippyWebSocketManager.m +index 437ab8716bc..2bdb3f40109 100644 +--- a/driver/js/ios/debug/websocket/HippyWebSocketManager.m ++++ b/driver/js/ios/debug/websocket/HippyWebSocketManager.m +@@ -22,9 +22,9 @@ + + #import ""HippyDefines.h"" + #import ""HippyWebSocketManager.h"" +-#import ""HippyConvert.h"" +-#import ""HippyLog.h"" +-#import ""HippyUtils.h"" ++#import ""NativeRenderConvert.h"" ++#import ""NativeRenderLog.h"" ++#import ""NativeRenderUtils.h"" + #import ""HippySRWebSocket.h"" + + static NSUInteger socketIndex = 0; +diff --git a/driver/js/ios/module/dev/HippyDevLoadingView.mm b/driver/js/ios/module/dev/HippyDevLoadingView.mm +index bdfe575e309..6446ae91a31 100644 +--- a/driver/js/ios/module/dev/HippyDevLoadingView.mm ++++ b/driver/js/ios/module/dev/HippyDevLoadingView.mm +@@ -25,8 +25,8 @@ + #import ""HippyBridge.h"" + #import ""HippyDevLoadingView.h"" + #import ""HippyDefines.h"" +-#import ""HippyUtils.h"" +-#import ""HippyModalHostViewController.h"" ++#import ""NativeRenderUtils.h"" ++#import ""NativeRenderModalHostViewController.h"" + + #if HIPPY_DEV + +@@ -76,11 +76,11 @@ - (void)setBridge:(HippyBridge *)bridge { + + dispatch_async(dispatch_get_main_queue(), ^{ + self->_showDate = [NSDate date]; +- if (!self->_window && !HippyRunningInTestEnvironment()) { ++ if (!self->_window && !NativeRenderRunningInTestEnvironment()) { + CGFloat screenWidth = [UIScreen mainScreen].bounds.size.width; + CGFloat viewHeight = HippyDevMsgViewHeight; + if (@available(iOS 11.0, *)) { +- UIEdgeInsets safeAreaInsets = HippyKeyWindow().safeAreaInsets; ++ UIEdgeInsets safeAreaInsets = NativeRenderKeyWindow().safeAreaInsets; + if (safeAreaInsets.bottom > 0) { + //is iPhoneX + viewHeight += safeAreaInsets.top; +diff --git a/driver/js/ios/module/dev/HippyDevMenu.mm b/driver/js/ios/module/dev/HippyDevMenu.mm +index d197683c453..6ffa0a29b09 100644 +--- a/driver/js/ios/module/dev/HippyDevMenu.mm ++++ b/driver/js/ios/module/dev/HippyDevMenu.mm +@@ -29,9 +29,9 @@ + #import ""HippyDefines.h"" + #import ""HippyEventDispatcher.h"" + #import ""HippyKeyCommands.h"" +-#import ""HippyLog.h"" ++#import ""NativeRenderLog.h"" + #import ""HippyRootView.h"" +-#import ""HippyUtils.h"" ++#import ""NativeRenderUtils.h"" + #import ""HippyWebSocketProxy.h"" + + #if HIPPY_DEV +@@ -113,7 +113,7 @@ - (void)callHandler { + + @end + +-@interface HippyDevMenu () ++@interface HippyDevMenu () + + @property (nonatomic, strong) Class executorClass; + +@@ -132,7 +132,7 @@ + (void)initialize { + // We're swizzling here because it's poor form to override methods in a category, + // however UIWindow doesn't actually implement motionEnded:withEvent:, so there's + // no need to call the original implementation. +- HippySwapInstanceMethods([UIWindow class], @selector(motionEnded:withEvent:), @selector(hippy_motionEnded:withEvent:)); ++ NativeRenderSwapInstanceMethods([UIWindow class], @selector(motionEnded:withEvent:), @selector(hippy_motionEnded:withEvent:)); + } + + - (instancetype)init { +@@ -241,7 +241,7 @@ - (void)addItem:(__unused HippyDevMenuItem *)item { + + // clang-format off + HIPPY_EXPORT_METHOD(show) { +- if (_actionSheet || !_bridge || HippyRunningInAppExtension()) { ++ if (_actionSheet || !_bridge || NativeRenderRunningInAppExtension()) { + return; + } + +@@ -275,7 +275,7 @@ - (void)addItem:(__unused HippyDevMenuItem *)item { + handler:^(__unused UIAlertAction *action) { + }]]; + +- [HippyPresentedViewController() presentViewController:_actionSheet animated:YES completion:^(void){}]; ++ [NativeRenderPresentedViewController() presentViewController:_actionSheet animated:YES completion:^(void){}]; + } + // clang-format on + +diff --git a/driver/js/ios/module/dev/HippyRedBox.mm b/driver/js/ios/module/dev/HippyRedBox.mm +index f75f5857d39..d0fa8b35f21 100644 +--- a/driver/js/ios/module/dev/HippyRedBox.mm ++++ b/driver/js/ios/module/dev/HippyRedBox.mm +@@ -23,10 +23,10 @@ + #import ""HippyRedBox.h"" + + #import ""HippyBridge.h"" +-#import ""HippyConvert.h"" ++#import ""NativeRenderConvert.h"" + #import ""HippyDefines.h"" + #import ""HippyErrorInfo.h"" +-#import ""HippyUtils.h"" ++#import ""NativeRenderUtils.h"" + #import ""HippyJSStackFrame.h"" + #import ""HippyAssert.h"" + +@@ -150,7 +150,7 @@ - (void)showErrorMessage:(NSString *)message withStack:(NSArray ++@interface HippyRedBox () + @end + + @implementation HippyRedBox { +@@ -343,7 +343,7 @@ - (void)registerErrorCustomizer:(id)errorCustomizer { + + // WARNING: Should only be called from the main thread/dispatch queue. + - (HippyErrorInfo *)_customizeError:(HippyErrorInfo *)error { +- HippyAssertMainQueue(); ++ NativeRenderAssertMainQueue(); + + if (!self->_errorCustomizers) { + return error; +@@ -419,11 +419,11 @@ - (void)invalidate { + + - (void)redBoxWindow:(__unused HippyRedBoxWindow *)redBoxWindow openStackFrameInEditor:(HippyJSStackFrame *)stackFrame { + if (![_bridge.bundleURL.scheme hasPrefix:@""http""]) { +- HippyLogWarn(@""Cannot open stack frame in editor because you're not connected to the packager.""); ++ NativeRenderLogWarn(@""Cannot open stack frame in editor because you're not connected to the packager.""); + return; + } + +- NSData *stackFrameJSON = [HippyJSONStringify([stackFrame toDictionary], NULL) dataUsingEncoding:NSUTF8StringEncoding]; ++ NSData *stackFrameJSON = [NativeRenderJSONStringify([stackFrame toDictionary], NULL) dataUsingEncoding:NSUTF8StringEncoding]; + NSString *postLength = [NSString stringWithFormat:@""%tu"", stackFrameJSON.length]; + NSMutableURLRequest *request = [NSMutableURLRequest new]; + request.URL = [NSURL URLWithString:@""/open-stack-frame"" relativeToURL:_bridge.bundleURL]; +diff --git a/driver/js/ios/module/exception/HippyExceptionModule.mm b/driver/js/ios/module/exception/HippyExceptionModule.mm +index 98be2962d28..aec8d3a7415 100644 +--- a/driver/js/ios/module/exception/HippyExceptionModule.mm ++++ b/driver/js/ios/module/exception/HippyExceptionModule.mm +@@ -21,7 +21,7 @@ + */ + + #import ""HippyExceptionModule.h"" +-#import ""HippyLog.h"" ++#import ""NativeRenderLog.h"" + #import ""HippyAssert.h"" + #import ""HippyBridge.h"" + +diff --git a/driver/js/ios/module/image loader/HippyImageCacheManager.m b/driver/js/ios/module/image loader/HippyImageCacheManager.m +index 250bec6ada1..04bf39c4df2 100644 +--- a/driver/js/ios/module/image loader/HippyImageCacheManager.m ++++ b/driver/js/ios/module/image loader/HippyImageCacheManager.m +@@ -21,7 +21,7 @@ + */ + + #import ""HippyImageCacheManager.h"" +-#import ""HippyLog.h"" ++#import ""NativeRenderLog.h"" + #import + @interface HippyImageCacheManager() { + NSCache *_cache; +diff --git a/driver/js/ios/module/image loader/HippyImageLoaderModule.mm b/driver/js/ios/module/image loader/HippyImageLoaderModule.mm +index 9ed6bd34515..b89c56cde51 100644 +--- a/driver/js/ios/module/image loader/HippyImageLoaderModule.mm ++++ b/driver/js/ios/module/image loader/HippyImageLoaderModule.mm +@@ -24,19 +24,19 @@ + #import ""HippyBridge.h"" + #import ""HippyImageLoaderModule.h"" + #import ""HippyImageCacheManager.h"" +-#import ""HippyFrameworkProxy.h"" +-#import ""HippyImageDataLoaderProtocol.h"" +-#import ""HippyImageDataLoader.h"" +-#import ""HippyUtils.h"" +-#import ""HippyDefaultImageProvider.h"" ++#import ""NativeRenderFrameworkProxy.h"" ++#import ""NativeRenderImageDataLoaderProtocol.h"" ++#import ""NativeRenderImageDataLoader.h"" ++#import ""NativeRenderUtils.h"" ++#import ""NativeRenderDefaultImageProvider.h"" + + static NSString *const kImageLoaderModuleErrorDomain = @""kImageLoaderModuleErrorDomain""; + static NSUInteger const ImageLoaderErrorParseError = 2; + static NSUInteger const ImageLoaderErrorRequestError = 3; + + @interface HippyImageLoaderModule () { +- id _imageDataLoader; +- Class _imageProviderClass; ++ id _imageDataLoader; ++ Class _imageProviderClass; + NSUInteger _sequence; + } + +@@ -50,8 +50,8 @@ @implementation HippyImageLoaderModule + + // clang-format off + HIPPY_EXPORT_METHOD(getSize:(NSString *)urlString resolver:(HippyPromiseResolveBlock)resolve rejecter:(HippyPromiseRejectBlock)reject) { +- id imageDataLoader = [self imageDataLoader]; +- NSURL *url = HippyURLWithString(urlString, nil); ++ id imageDataLoader = [self imageDataLoader]; ++ NSURL *url = NativeRenderURLWithString(urlString, nil); + NSUInteger sequence = _sequence++; + [imageDataLoader loadImageAtUrl:url sequence:sequence progress:^(NSUInteger current, NSUInteger total) { + +@@ -62,9 +62,9 @@ @implementation HippyImageLoaderModule + retImage = result; + } + else if ([result isKindOfClass:[NSData class]]) { +- Class imageProviderClass = [self imageProviderClass]; ++ Class imageProviderClass = [self imageProviderClass]; + if ([imageProviderClass canHandleData:(NSData *)result]) { +- id imageProvider = [[(Class)imageProviderClass alloc] init]; ++ id imageProvider = [[(Class)imageProviderClass alloc] init]; + imageProvider.scale = [[UIScreen mainScreen] scale]; + imageProvider.imageDataPath = [retURL absoluteString]; + [imageProvider setImageData:(NSData *)result]; +@@ -92,8 +92,8 @@ @implementation HippyImageLoaderModule + + // clang-format off + HIPPY_EXPORT_METHOD(prefetch:(NSString *)urlString) { +- id imageDataLoader = [self imageDataLoader]; +- NSURL *url = HippyURLWithString(urlString, nil); ++ id imageDataLoader = [self imageDataLoader]; ++ NSURL *url = NativeRenderURLWithString(urlString, nil); + NSUInteger sequence = _sequence++; + [imageDataLoader loadImageAtUrl:url sequence:sequence progress:^(NSUInteger current, NSUInteger total) { + +@@ -103,25 +103,25 @@ @implementation HippyImageLoaderModule + } + // clang-format on + +-- (id)imageDataLoader { ++- (id)imageDataLoader { + if (!_imageDataLoader) { + if ([self.bridge.frameworkProxy respondsToSelector:@selector(imageDataLoaderForRenderContext:)]) { + _imageDataLoader = [self.bridge.frameworkProxy imageDataLoaderForRenderContext:self.bridge.renderContext]; + } + if (!_imageDataLoader) { +- _imageDataLoader = [[HippyImageDataLoader alloc] init]; ++ _imageDataLoader = [[NativeRenderImageDataLoader alloc] init]; + } + } + return _imageDataLoader; + } + +-- (Class)imageProviderClass { ++- (Class)imageProviderClass { + if (!_imageProviderClass) { + if ([self.bridge.frameworkProxy respondsToSelector:@selector(imageProviderClassForRenderContext:)]) { + _imageProviderClass = [self.bridge.frameworkProxy imageProviderClassForRenderContext:self.bridge.renderContext]; + } + if (!_imageProviderClass) { +- _imageProviderClass = [HippyDefaultImageProvider class]; ++ _imageProviderClass = [NativeRenderDefaultImageProvider class]; + } + } + return _imageProviderClass; +diff --git a/driver/js/ios/module/localstorage/HippyAsyncLocalStorage.h b/driver/js/ios/module/localstorage/HippyAsyncLocalStorage.h +index 7924a86e380..f2ef4c30093 100644 +--- a/driver/js/ios/module/localstorage/HippyAsyncLocalStorage.h ++++ b/driver/js/ios/module/localstorage/HippyAsyncLocalStorage.h +@@ -21,7 +21,7 @@ + */ + + #import ""HippyBridgeModule.h"" +-#import ""HippyInvalidating.h"" ++#import ""NativeRenderInvalidating.h"" + + /** + * A simple, asynchronous, persistent, key-value storage system designed as a +@@ -40,7 +40,7 @@ extern NSUInteger HPLOCALSTORAGEIOTYPEREAD; + + extern NSUInteger HPLOCALSTORAGEIOTYPEWRITE; + +-@interface HippyAsyncLocalStorage : NSObject ++@interface HippyAsyncLocalStorage : NSObject + + @property (nonatomic, assign) BOOL clearOnInvalidate; + +diff --git a/driver/js/ios/module/localstorage/HippyAsyncLocalStorage.mm b/driver/js/ios/module/localstorage/HippyAsyncLocalStorage.mm +index 8694cf6f0a2..cbcf34b59f0 100644 +--- a/driver/js/ios/module/localstorage/HippyAsyncLocalStorage.mm ++++ b/driver/js/ios/module/localstorage/HippyAsyncLocalStorage.mm +@@ -27,9 +27,9 @@ + #import + #import + #import ""HippyBridge.h"" +-#import ""HippyConvert.h"" +-#import ""HippyLog.h"" +-#import ""HippyUtils.h"" ++#import ""NativeRenderConvert.h"" ++#import ""NativeRenderLog.h"" ++#import ""NativeRenderUtils.h"" + #import ""HippyAssert.h"" + + NSString *const HippyStorageDirectory = @""HippyAsyncLocalStorage_V1""; +@@ -44,9 +44,9 @@ + + static NSDictionary *HippyErrorForKey(NSString *key) { + if (![key isKindOfClass:[NSString class]]) { +- return HippyMakeAndLogError(@""Invalid key - must be a string. Key: "", key, @ { @""key"": key }); ++ return NativeRenderMakeAndLogError(@""Invalid key - must be a string. Key: "", key, @ { @""key"": key }); + } else if (key.length < 1) { +- return HippyMakeAndLogError(@""Invalid key - must be at least one character. Key: "", key, @ { @""key"": key }); ++ return NativeRenderMakeAndLogError(@""Invalid key - must be at least one character. Key: "", key, @ { @""key"": key }); + } else { + return nil; + } +@@ -175,7 +175,7 @@ - (NSDictionary *)HippyDeleteStorageDirectory { + NSError *error; + [[NSFileManager defaultManager] removeItemAtPath:[self HippyGetStorageDirectory] error:&error]; + _HippyHasCreatedStorageDirectory = NO; +- return error ? HippyMakeError(@""Failed to delete storage directory."", error, nil) : nil; ++ return error ? NativeRenderMakeError(@""Failed to delete storage directory."", error, nil) : nil; + } + + - (NSString *)HippyGetManifestFilePath { +@@ -204,7 +204,7 @@ - (void)dealloc { + } + + - (NSString *)_filePathForKey:(NSString *)key { +- NSString *safeFileName = HippyMD5Hash(key); ++ NSString *safeFileName = NativeRenderMD5Hash(key); + return [[self HippyGetStorageDirectory] stringByAppendingPathComponent:safeFileName]; + } + +@@ -216,7 +216,7 @@ - (NSDictionary *)_ensureSetup { + [[NSFileManager defaultManager] createDirectoryAtPath:[self HippyGetStorageDirectory] withIntermediateDirectories:YES attributes:nil + error:&error]; + if (error) { +- return HippyMakeError(@""Failed to create storage directory."", error, nil); ++ return NativeRenderMakeError(@""Failed to create storage directory."", error, nil); + } + _HippyHasCreatedStorageDirectory = YES; + } +@@ -226,9 +226,9 @@ - (NSDictionary *)_ensureSetup { + if (created) { + NSDictionary *errorOut; + NSString *serialized = [self _readFileFromPath:[self HippyGetManifestFilePath] key:nil error:&errorOut]; +- NSMutableDictionary *tmpDic = serialized ? HippyJSONParseMutable(serialized, &error) : [NSMutableDictionary new]; ++ NSMutableDictionary *tmpDic = serialized ? NativeRenderJSONParseMutable(serialized, &error) : [NSMutableDictionary new]; + if (error) { +- HippyLogWarn(@""Failed to parse manifest - creating new one.\n\n%@"", error); ++ NativeRenderLogWarn(@""Failed to parse manifest - creating new one.\n\n%@"", error); + tmpDic = [NSMutableDictionary new]; + } + [_manifest addEntriesFromDictionary:tmpDic]; +@@ -240,11 +240,11 @@ - (NSDictionary *)_ensureSetup { + + - (NSDictionary *)_writeManifest:(NSMutableArray **)errors { + NSError *error; +- NSString *serialized = HippyJSONStringify(_manifest, &error); ++ NSString *serialized = NativeRenderJSONStringify(_manifest, &error); + [serialized writeToFile:[self HippyGetManifestFilePath] atomically:YES encoding:NSUTF8StringEncoding error:&error]; + NSDictionary *errorOut; + if (error) { +- errorOut = HippyMakeError(@""Failed to write manifest file."", error, nil); ++ errorOut = NativeRenderMakeError(@""Failed to write manifest file."", error, nil); + HippyAppendError(errorOut, errors); + } + return errorOut; +@@ -271,7 +271,7 @@ - (NSString *)_getValueForKey:(NSString *)key errorOut:(NSDictionary **)errorOut + + - (NSDictionary *)_writeEntry:(NSArray *)entry changedManifest:(BOOL *)changedManifest { + if (entry.count != 2) { +- return HippyMakeAndLogError(@""Entries must be arrays of the form [key: string, value: string], got: "", entry, nil); ++ return NativeRenderMakeAndLogError(@""Entries must be arrays of the form [key: string, value: string], got: "", entry, nil); + } + NSString *key = entry[0]; + NSDictionary *errorOut = HippyErrorForKey(key); +@@ -294,13 +294,13 @@ - (NSDictionary *)_writeEntry:(NSArray *)entry changedManifest:(BOOL + NSInteger maxLimit = [self maxWriteDataSize]; + if ([value length] > maxLimit) { + if (![self handleDataSizeExceedForIOType:HPLOCALSTORAGEIOTYPEWRITE moduleName:self.bridge.moduleName key:key dataLength:[value length]]) { +- return HippyMakeError(@""write data length exceed range"", error, @{ @""key"": key?:@""nilkey"" , @""length"": @([value length])});; ++ return NativeRenderMakeError(@""write data length exceed range"", error, @{ @""key"": key?:@""nilkey"" , @""length"": @([value length])});; + } + } + [value writeToFile:filePath atomically:YES encoding:NSUTF8StringEncoding error:&error]; + [HippyGetCache() setObject:value forKey:key cost:value.length]; + if (error) { +- errorOut = HippyMakeError(@""Failed to write value."", error, @{ @""key"": key }); ++ errorOut = NativeRenderMakeError(@""Failed to write value."", error, @{ @""key"": key }); + } else if (_manifest[key] != (id)kCFNull) { + *changedManifest = YES; + _manifest[key] = (id)kCFNull; +@@ -318,7 +318,7 @@ - (NSString *)_readFileFromPath:(NSString *)filePath key:(NSString *)key error:( + if (fileSize > maxReadFileSize) { + if (![self handleDataSizeExceedForIOType:HPLOCALSTORAGEIOTYPEREAD moduleName:self.bridge.moduleName + key:key dataLength:fileSize]) { +- *errorOut = HippyMakeError(@""read data length exceed range"", nil, @{ @""key"": key?:@""nilkey"" , @""length"": @(fileSize)});; ++ *errorOut = NativeRenderMakeError(@""read data length exceed range"", nil, @{ @""key"": key?:@""nilkey"" , @""length"": @(fileSize)});; + return nil; + } + } +@@ -326,9 +326,9 @@ - (NSString *)_readFileFromPath:(NSString *)filePath key:(NSString *)key error:( + NSStringEncoding encoding; + NSString *entryString = [NSString stringWithContentsOfFile:filePath usedEncoding:&encoding error:&error]; + if (error) { +- *errorOut = HippyMakeError(@""Failed to read storage file."", error, @ { @""key"": key }); ++ *errorOut = NativeRenderMakeError(@""Failed to read storage file."", error, @ { @""key"": key }); + } else if (encoding != NSUTF8StringEncoding) { +- *errorOut = HippyMakeError(@""Incorrect encoding of storage file: "", @(encoding), @ { @""key"": key }); ++ *errorOut = NativeRenderMakeError(@""Incorrect encoding of storage file: "", @(encoding), @ { @""key"": key }); + } else { + return entryString; + } +@@ -379,10 +379,10 @@ - (BOOL)handleDataSizeExceedForIOType:(NSUInteger)IOType moduleName:(NSString *) + for (NSString *key in keys) { + id keyError; + id value = [self _getValueForKey:key errorOut:&keyError]; +- [result addObject:@[key, HippyNullIfNil(value)]]; ++ [result addObject:@[key, NativeRenderNullIfNil(value)]]; + HippyAppendError(keyError, &errors); + } +- callback(@[HippyNullIfNil(errors), result]); ++ callback(@[NativeRenderNullIfNil(errors), result]); + } + // clang-format on + +@@ -403,7 +403,7 @@ - (BOOL)handleDataSizeExceedForIOType:(NSUInteger)IOType moduleName:(NSString *) + if (changedManifest) { + [self _writeManifest:&errors]; + } +- callback(@[HippyNullIfNil(errors)]); ++ callback(@[NativeRenderNullIfNil(errors)]); + } + // clang-format on + +@@ -423,12 +423,12 @@ - (BOOL)handleDataSizeExceedForIOType:(NSUInteger)IOType moduleName:(NSString *) + if (!keyError) { + if (value) { + NSError *jsonError; +- NSMutableDictionary *mergedVal = HippyJSONParseMutable(value, &jsonError); +- if (HippyMergeRecursive(mergedVal, HippyJSONParse(entry[1], &jsonError))) { +- entry = @[entry[0], HippyNullIfNil(HippyJSONStringify(mergedVal, NULL))]; ++ NSMutableDictionary *mergedVal = NativeRenderJSONParseMutable(value, &jsonError); ++ if (HippyMergeRecursive(mergedVal, NativeRenderJSONParse(entry[1], &jsonError))) { ++ entry = @[entry[0], NativeRenderNullIfNil(NativeRenderJSONStringify(mergedVal, NULL))]; + } + if (jsonError) { +- keyError = HippyJSErrorFromNSError(jsonError); ++ keyError = NativeRenderJSErrorFromNSError(jsonError); + } + } + if (!keyError) { +@@ -440,7 +440,7 @@ - (BOOL)handleDataSizeExceedForIOType:(NSUInteger)IOType moduleName:(NSString *) + if (changedManifest) { + [self _writeManifest:&errors]; + } +- callback(@[HippyNullIfNil(errors)]); ++ callback(@[NativeRenderNullIfNil(errors)]); + } + // clang-format on + +@@ -474,7 +474,7 @@ - (BOOL)handleDataSizeExceedForIOType:(NSUInteger)IOType moduleName:(NSString *) + if (changedManifest) { + [self _writeManifest:&errors]; + } +- callback(@[HippyNullIfNil(errors)]); ++ callback(@[NativeRenderNullIfNil(errors)]); + } + // clang-format on + +@@ -483,7 +483,7 @@ - (BOOL)handleDataSizeExceedForIOType:(NSUInteger)IOType moduleName:(NSString *) + [_manifest removeAllObjects]; + [HippyGetCache() removeAllObjects]; + NSDictionary *error = [self HippyDeleteStorageDirectory]; +- callback(@[HippyNullIfNil(error)]); ++ callback(@[NativeRenderNullIfNil(error)]); + } + // clang-format on + +diff --git a/driver/js/ios/module/netinfo/HippyNetInfo.h b/driver/js/ios/module/netinfo/HippyNetInfo.h +index a1da3614fef..b278f8e5c7f 100644 +--- a/driver/js/ios/module/netinfo/HippyNetInfo.h ++++ b/driver/js/ios/module/netinfo/HippyNetInfo.h +@@ -23,8 +23,8 @@ + #import + + #import ""HippyEventObserverModule.h"" +-#import ""HippyInvalidating.h"" ++#import ""NativeRenderInvalidating.h"" + +-@interface HippyNetInfo : HippyEventObserverModule ++@interface HippyNetInfo : HippyEventObserverModule + + @end +diff --git a/driver/js/ios/module/network/HippyNetWork.m b/driver/js/ios/module/network/HippyNetWork.m +index a2a6ce21d84..7310c9cac51 100644 +--- a/driver/js/ios/module/network/HippyNetWork.m ++++ b/driver/js/ios/module/network/HippyNetWork.m +@@ -22,13 +22,13 @@ + + #import ""HippyNetWork.h"" + #import ""HippyAssert.h"" +-#import ""HippyLog.h"" ++#import ""NativeRenderLog.h"" + #import + #import +-#import ""HippyUtils.h"" ++#import ""NativeRenderUtils.h"" + #import ""HippyFetchInfo.h"" + #import ""objc/runtime.h"" +-#import ""HippyUtils.h"" ++#import ""NativeRenderUtils.h"" + + static char fetchInfoKey; + +@@ -59,7 +59,7 @@ @implementation HippyNetWork + header = @{}; + } + +- NSURL *requestURL = HippyURLWithString(url, NULL); ++ NSURL *requestURL = NativeRenderURLWithString(url, NULL); + NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:requestURL]; + [request setHTTPMethod: method]; + +@@ -133,7 +133,7 @@ - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didComp + } else { + HippyPromiseResolveBlock resolver = fetchInfo.resolveBlock; + NSData *data = fetchInfo.fetchData; +- NSStringEncoding dataEncoding = HippyGetStringEncodingFromURLResponse(task.response); ++ NSStringEncoding dataEncoding = NativeRenderGetStringEncodingFromURLResponse(task.response); + NSString *dataStr = [[NSString alloc] initWithData:data encoding:dataEncoding]; + NSHTTPURLResponse *resp = (NSHTTPURLResponse *)task.response; + NSDictionary *result = +diff --git a/driver/js/ios/module/timing/HippyTiming.h b/driver/js/ios/module/timing/HippyTiming.h +index f6949c11427..f3d0af04454 100644 +--- a/driver/js/ios/module/timing/HippyTiming.h ++++ b/driver/js/ios/module/timing/HippyTiming.h +@@ -24,8 +24,8 @@ + + #import ""HippyBridgeModule.h"" + #import ""HippyFrameUpdate.h"" +-#import ""HippyInvalidating.h"" ++#import ""NativeRenderInvalidating.h"" + +-@interface HippyTiming : NSObject ++@interface HippyTiming : NSObject + + @end +diff --git a/driver/js/ios/module/timing/HippyTiming.mm b/driver/js/ios/module/timing/HippyTiming.mm +index de094932168..56654b16182 100644 +--- a/driver/js/ios/module/timing/HippyTiming.mm ++++ b/driver/js/ios/module/timing/HippyTiming.mm +@@ -25,8 +25,8 @@ + #import ""HippyAssert.h"" + #import ""HippyBridge.h"" + #import ""HippyBridge+Private.h"" +-#import ""HippyLog.h"" +-#import ""HippyUtils.h"" ++#import ""NativeRenderLog.h"" ++#import ""NativeRenderUtils.h"" + + static const NSTimeInterval kMinimumSleepInterval = 1; + +diff --git a/driver/js/ios/module/turbo/HippyOCTurboModule.mm b/driver/js/ios/module/turbo/HippyOCTurboModule.mm +index c35def4967b..6036c57edd2 100644 +--- a/driver/js/ios/module/turbo/HippyOCTurboModule.mm ++++ b/driver/js/ios/module/turbo/HippyOCTurboModule.mm +@@ -24,8 +24,8 @@ + #import + #import ""HippyBridgeMethod.h"" + #import ""HippyAssert.h"" +-#import ""HippyUtils.h"" +-#import ""HippyLog.h"" ++#import ""NativeRenderUtils.h"" ++#import ""NativeRenderLog.h"" + #import ""HippyModuleMethod.h"" + #include + #include ""core/napi/jsc/js_native_jsc_helper.h"" +@@ -33,7 +33,7 @@ + #include + #include + #import ""NSObject+HippyTurbo.h"" +-#import ""HippyLog.h"" ++#import ""NativeRenderLog.h"" + #include ""footstone/string_view_utils.h"" + #import ""HippyBridge+Private.h"" + #import ""HippyJSCExecutor.h"" +@@ -125,7 +125,7 @@ - (id)invokeObjCMethodWithName:(NSString *)methodName + } + + if (HIPPY_DEBUG && !method) { +- HippyLogError(@""Unknown methodID: %@ for module:%@"", methodName, obj); ++ NativeRenderLogError(@""Unknown methodID: %@ for module:%@"", methodName, obj); + return nil; + } + +@@ -140,7 +140,7 @@ - (id)invokeObjCMethodWithName:(NSString *)methodName + + NSString *message = [NSString stringWithFormat:@""Exception '%@' was thrown while invoking %@ on target %@ with params %@"", exception, + method.JSMethodName, NSStringFromClass([self class]) ,argumentArray]; +- NSError *error = HippyErrorWithMessageAndModuleName(message, self.bridge.moduleName); ++ NSError *error = NativeRenderErrorWithMessageAndModuleName(message, self.bridge.moduleName); + HippyFatal(error); + return nil; + } +@@ -183,7 +183,7 @@ - (id)invokeObjCMethodWithName:(NSString *)methodName + options:NSJSONWritingFragmentsAllowed + error:&error]; + if (error) { +- HippyLogError(@""convert dict to data failed:%@"", error); ++ NativeRenderLogError(@""convert dict to data failed:%@"", error); + } + + // 直接使用下面这个类型转换,有时候后面会补\xa3\xa3\xa3....,怀疑是字节对齐问题 +@@ -332,7 +332,7 @@ static id convertJSIObjectToNSObject(const std::shared_ptr &contex + NSError *error; + id objcObject = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error]; + if (error) { +- HippyLogError(@""JSONObjectWithData error:%@"", error); ++ NativeRenderLogError(@""JSONObjectWithData error:%@"", error); + } + return objcObject; + } +@@ -371,12 +371,12 @@ static id convertJSIObjectToNSObject(const std::shared_ptr &contex + JSValueRef exception = nullptr; + JSObjectRef object = JSValueToObject(context->context_, value->value_, &exception); + if (exception) { +- HippyLogInfo(@""JSValueToObject throw exception:%@"", exception); ++ NativeRenderLogInfo(@""JSValueToObject throw exception:%@"", exception); + id jsonObj = convertJSIObjectToNSObject(context, value); + if (jsonObj && [jsonObj isKindOfClass:[NSDictionary class]]) { + return (NSDictionary *)jsonObj; + } +- HippyLogError(@""convertJSIJsonToDict failed:%@"", jsonObj); ++ NativeRenderLogError(@""convertJSIJsonToDict failed:%@"", jsonObj); + return nil; + } + +diff --git a/driver/js/ios/module/turbo/NSObject+HippyTurbo.mm b/driver/js/ios/module/turbo/NSObject+HippyTurbo.mm +index 9c25731b4c1..7b1c0272736 100644 +--- a/driver/js/ios/module/turbo/NSObject+HippyTurbo.mm ++++ b/driver/js/ios/module/turbo/NSObject+HippyTurbo.mm +@@ -24,8 +24,8 @@ + #import + #import ""HippyBridgeMethod.h"" + #import ""HippyAssert.h"" +-#import ""HippyUtils.h"" +-#import ""HippyLog.h"" ++#import ""NativeRenderUtils.h"" ++#import ""NativeRenderLog.h"" + #import ""HippyModuleMethod.h"" + + @implementation NSObject (HippyTurbo) +diff --git a/driver/js/ios/utils/HippyAssert.h b/driver/js/ios/utils/HippyAssert.h +index 4da8b1d8daf..40d23a0d611 100644 +--- a/driver/js/ios/utils/HippyAssert.h ++++ b/driver/js/ios/utils/HippyAssert.h +@@ -27,7 +27,7 @@ + /* + * Defined in HippyUtils.m + */ +-HIPPY_EXTERN BOOL HippyIsMainQueue(void); ++HIPPY_EXTERN BOOL NativeRenderIsMainQueue(void); + + /** + * This is the main assert macro that you should use. Asserts should be compiled out +@@ -103,17 +103,17 @@ typedef void (^MttHippyExceptionHandler)(NSException *e); + /** + * Convenience macro for asserting that we're running on main queue. + */ +-#define HippyAssertMainQueue() HippyAssert(HippyIsMainQueue(), @""This function must be called on the main thread"") ++#define NativeRenderAssertMainQueue() HippyAssert(NativeRenderIsMainQueue(), @""This function must be called on the main thread"") + + /** + * Convenience macro for asserting that we're running off the main queue. + */ +-#define HippyAssertNotMainQueue() HippyAssert(!HippyIsMainQueue(), @""This function must not be called on the main thread"") ++#define HippyAssertNotMainQueue() HippyAssert(!NativeRenderIsMainQueue(), @""This function must not be called on the main thread"") + + /** + * Deprecated, do not use + */ +-#define HippyAssertMainThread() HippyAssertMainQueue() ++#define HippyAssertMainThread() NativeRenderAssertMainQueue() + #define HippyAssertNotMainThread() HippyAssertNotMainQueue() + + /** +diff --git a/driver/js/ios/utils/HippyAssert.m b/driver/js/ios/utils/HippyAssert.m +index 554523e89c5..6aac2cb1fa7 100644 +--- a/driver/js/ios/utils/HippyAssert.m ++++ b/driver/js/ios/utils/HippyAssert.m +@@ -21,7 +21,7 @@ + */ + + #import ""HippyAssert.h"" +-#import ""HippyLog.h"" ++#import ""NativeRenderLog.h"" + #import ""HippyJSStackFrame.h"" + + NSString *const HippyErrorDomain = @""HippyErrorDomain""; +@@ -92,7 +92,7 @@ void HippyPerformBlockWithAssertFunction(void (^block)(void), HippyAssertFunctio + + NSString *HippyCurrentThreadName(void) { + NSThread *thread = [NSThread currentThread]; +- NSString *threadName = HippyIsMainQueue() || thread.isMainThread ? @""main"" : thread.name; ++ NSString *threadName = NativeRenderIsMainQueue() || thread.isMainThread ? @""main"" : thread.name; + if (threadName.length == 0) { + const char *label = dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL); + if (label && strlen(label) > 0) { +@@ -128,7 +128,7 @@ void HippyFatal(NSError *error) { + } else { + fatalMessage = [NSString stringWithFormat:@""%@,%@"", moduleDescription, error.localizedDescription]; + } +- _HippyLogNativeInternal(HippyLogLevelFatal, NULL, 0, @""%@"", fatalMessage); ++ NativeRenderLogNativeInternal(NativeRenderLogLevelFatal, NULL, 0, @""%@"", fatalMessage); + + HippyFatalHandler fatalHandler = HippyGetFatalHandler(); + if (fatalHandler) { +@@ -149,7 +149,7 @@ void HippyFatal(NSError *error) { + } + + void MttHippyException(NSException *exception) { +- _HippyLogNativeInternal(HippyLogLevelFatal, NULL, 0, @""%@"", exception.description); ++ NativeRenderLogNativeInternal(NativeRenderLogLevelFatal, NULL, 0, @""%@"", exception.description); + MttHippyExceptionHandler exceptionHandler = MttHippyGetExceptionHandler(); + if (exceptionHandler) { + exceptionHandler(exception); +diff --git a/renderer/native/ios/utils/HippyDefines.h b/driver/js/ios/utils/HippyDefines.h +similarity index 96% +rename from renderer/native/ios/utils/HippyDefines.h +rename to driver/js/ios/utils/HippyDefines.h +index d5f95ba3c98..071ccd37090 100644 +--- a/renderer/native/ios/utils/HippyDefines.h ++++ b/driver/js/ios/utils/HippyDefines.h +@@ -97,11 +97,8 @@ + * The type of a block that is capable of sending a response to a bridged + * operation. Use this for returning callback methods to JS. + */ +-//TODO 剥离这两种block,hippy的归hippy,render的归render + typedef void (^HippyResponseSenderBlock)(NSArray *response); + +-typedef void (^RenderUIResponseSenderBlock)(id response); +- + /** + * The type of a block that is capable of sending an error response to a + * bridged operation. Use this for returning error information to JS. +diff --git a/driver/js/ios/utils/HippyLogging.h b/driver/js/ios/utils/HippyLogging.h +deleted file mode 100644 +index 42fe2446eda..00000000000 +--- a/driver/js/ios/utils/HippyLogging.h ++++ /dev/null +@@ -1,31 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import +-#import ""HippyDefines.h"" +-#import ""HippyLog.h"" +- +-NS_ASSUME_NONNULL_BEGIN +- +-HIPPY_EXTERN void HippySetLogMessageFunction(HippyLogFunction logFunction); +- +-NS_ASSUME_NONNULL_END +diff --git a/driver/js/ios/utils/HippyLogging.mm b/driver/js/ios/utils/HippyLogging.mm +deleted file mode 100644 +index 4f41e9ef937..00000000000 +--- a/driver/js/ios/utils/HippyLogging.mm ++++ /dev/null +@@ -1,75 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import ""HippyLogging.h"" +-#include +-#include +-#include ""footstone/logging.h"" +- +-static BOOL GetFileNameAndLineNumberFromLogMessage(NSString *message, NSString **fileName, int *lineNumber) { +- //[INFO:cubic_bezier_animation.cc(146)] animation exec_time_ = 514, delay = 500, duration = 1000 +- NSUInteger locationOfColon = [message rangeOfString:@"":""].location; +- if (NSNotFound == locationOfColon) { +- return NO; +- } +- NSUInteger locationOfLeftBracket = [message rangeOfString:@""(""].location; +- if (NSNotFound == locationOfLeftBracket) { +- return NO; +- } +- if (locationOfLeftBracket <= locationOfColon) { +- return NO; +- } +- NSString *name = [message substringWithRange:NSMakeRange(locationOfColon + 1, locationOfLeftBracket - locationOfColon - 1)]; +- *fileName = [name copy]; +- NSUInteger locationOfRightBracket = [message rangeOfString:@"")""].location; +- if (NSNotFound == locationOfRightBracket || locationOfRightBracket <= locationOfLeftBracket) { +- return YES; +- } +- NSString *number = [message substringWithRange:NSMakeRange(locationOfLeftBracket + 1, locationOfRightBracket - locationOfLeftBracket - 1)]; +- *lineNumber = [number intValue]; +- return YES; +-} +- +-static void registerTDFLogHandler() { +- static std::once_flag flag; +- std::call_once(flag, [](){ +- std::function logFunction = [](const std::ostringstream &stream, footstone::log::LogSeverity serverity) { +- @autoreleasepool { +- std::string string = stream.str(); +- if (string.length()) { +- NSString *message = [NSString stringWithUTF8String:string.c_str()]; +- NSString *fileName = nil; +- int lineNumber = 0; +- if (GetFileNameAndLineNumberFromLogMessage(message, &fileName, &lineNumber)) { +- _HippyLogNativeInternal(HippyLogLevelInfo, [fileName UTF8String], lineNumber, @""%@"", message); +- } +- } +- } +- }; +- footstone::log::LogMessage::InitializeDelegate(logFunction); +- }); +-} +- +-void HippySetLogMessageFunction(HippyLogFunction logFunction) { +- HippySetLogFunction(logFunction); +- registerTDFLogHandler(); +-} +diff --git a/renderer/native/ios/renderer/HippyMemoryOpt.h b/renderer/native/ios/renderer/HippyMemoryOpt.h +deleted file mode 100644 +index d142420cbcd..00000000000 +--- a/renderer/native/ios/renderer/HippyMemoryOpt.h ++++ /dev/null +@@ -1,41 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import +- +-NS_ASSUME_NONNULL_BEGIN +- +-/// A protocol for memory optimization +-/// +-@protocol HippyMemoryOpt +-@required +-/// invoked when memory warning received +-- (void)didReceiveMemoryWarning; +- +-/// invoked when application enter background +-- (void)appDidEnterBackground; +- +-/// invoked when application enter foreground +-- (void)appWillEnterForeground; +-@end +- +-NS_ASSUME_NONNULL_END +diff --git a/renderer/native/ios/renderer/HippyAnimationType.h b/renderer/native/ios/renderer/NativeRenderAnimationType.h +similarity index 70% +rename from renderer/native/ios/renderer/HippyAnimationType.h +rename to renderer/native/ios/renderer/NativeRenderAnimationType.h +index 66cb6ffc0da..14c8efa0c3a 100644 +--- a/renderer/native/ios/renderer/HippyAnimationType.h ++++ b/renderer/native/ios/renderer/NativeRenderAnimationType.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -22,11 +22,11 @@ + + #import + +-typedef NS_ENUM(NSInteger, HippyAnimationType) { +- HippyAnimationTypeSpring = 0, +- HippyAnimationTypeLinear, +- HippyAnimationTypeEaseIn, +- HippyAnimationTypeEaseOut, +- HippyAnimationTypeEaseInEaseOut, +- HippyAnimationTypeKeyboard, ++typedef NS_ENUM(NSInteger, NativeRenderAnimationType) { ++ NativeRenderAnimationTypeSpring = 0, ++ NativeRenderAnimationTypeLinear, ++ NativeRenderAnimationTypeEaseIn, ++ NativeRenderAnimationTypeEaseOut, ++ NativeRenderAnimationTypeEaseInEaseOut, ++ NativeRenderAnimationTypeKeyboard, + }; +diff --git a/renderer/native/ios/renderer/HippyAutoInsetsProtocol.h b/renderer/native/ios/renderer/NativeRenderAutoInsetsProtocol.h +similarity index 95% +rename from renderer/native/ios/renderer/HippyAutoInsetsProtocol.h +rename to renderer/native/ios/renderer/NativeRenderAutoInsetsProtocol.h +index eaf15f35f4e..6ba45502630 100644 +--- a/renderer/native/ios/renderer/HippyAutoInsetsProtocol.h ++++ b/renderer/native/ios/renderer/NativeRenderAutoInsetsProtocol.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -25,7 +25,7 @@ + /** + * Defines a View that wants to support auto insets adjustment + */ +-@protocol HippyAutoInsetsProtocol ++@protocol NativeRenderAutoInsetsProtocol + + @property (nonatomic, assign, readwrite) UIEdgeInsets contentInset; + @property (nonatomic, assign, readwrite) BOOL automaticallyAdjustContentInsets; +diff --git a/renderer/native/ios/renderer/HippyComponentData.h b/renderer/native/ios/renderer/NativeRenderComponentData.h +similarity index 61% +rename from renderer/native/ios/renderer/HippyComponentData.h +rename to renderer/native/ios/renderer/NativeRenderComponentData.h +index 10886a2738a..c8425dc938e 100644 +--- a/renderer/native/ios/renderer/HippyComponentData.h ++++ b/renderer/native/ios/renderer/NativeRenderComponentData.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,33 +21,32 @@ + */ + + #import +-#import ""HippyComponent.h"" +-#import ""HippyDefines.h"" +-#import ""HippyViewManager.h"" ++#import ""NativeRenderComponentProtocol.h"" ++#import ""NativeRenderViewManager.h"" + +-@class HippyShadowView; ++@class NativeRenderObjectView; + @class UIView; + +-@interface HippyComponentData : NSObject ++@interface NativeRenderComponentData : NSObject + + @property (nonatomic, readonly) Class managerClass; + @property (nonatomic, copy, readonly) NSString *name; +-@property (nonatomic, weak, readonly) HippyViewManager *manager; ++@property (nonatomic, weak, readonly) NativeRenderViewManager *manager; + +-- (instancetype)initWithViewManager:(HippyViewManager *)viewManager viewName:(NSString *)viewName NS_DESIGNATED_INITIALIZER; ++- (instancetype)initWithViewManager:(NativeRenderViewManager *)viewManager viewName:(NSString *)viewName NS_DESIGNATED_INITIALIZER; + + - (UIView *)createViewWithTag:(NSNumber *)tag; + + - (UIView *)createViewWithTag:(NSNumber *)tag initProps:(NSDictionary *)props; + +-- (HippyShadowView *)createShadowViewWithTag:(NSNumber *)tag; +-- (void)setProps:(NSDictionary *)props forView:(id)view; +-- (void)setProps:(NSDictionary *)props forShadowView:(HippyShadowView *)shadowView; ++- (NativeRenderObjectView *)createRenderObjectViewWithTag:(NSNumber *)tag; ++- (void)setProps:(NSDictionary *)props forView:(id)view; ++- (void)setProps:(NSDictionary *)props forRenderObjectView:(NativeRenderObjectView *)renderObject; + + - (NSDictionary *)eventNameMap; + + - (NSDictionary *)methodsByName; + +-- (HippyRenderUIBlock)uiBlockToAmendWithShadowViewRegistry:(NSDictionary *)registry; ++- (NativeRenderRenderUIBlock)uiBlockToAmendWithRenderObjectViewRegistry:(NSDictionary *)registry; + + @end +diff --git a/renderer/native/ios/renderer/HippyComponentData.mm b/renderer/native/ios/renderer/NativeRenderComponentData.mm +similarity index 78% +rename from renderer/native/ios/renderer/HippyComponentData.mm +rename to renderer/native/ios/renderer/NativeRenderComponentData.mm +index 0892952e92c..e2675507a0f 100644 +--- a/renderer/native/ios/renderer/HippyComponentData.mm ++++ b/renderer/native/ios/renderer/NativeRenderComponentData.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,28 +20,27 @@ + * limitations under the License. + */ + +-#import ""HippyComponentData.h"" ++#import ""NativeRenderComponentData.h"" + + #import + + #import ""HippyBridge.h"" +-#import ""HippyConvert.h"" +-#import ""HippyShadowView.h"" +-#import ""HippyUtils.h"" +-#import ""UIView+Hippy.h"" +-#import ""HippyModuleMethod.h"" ++#import ""NativeRenderConvert.h"" ++#import ""NativeRenderObjectView.h"" ++#import ""NativeRenderUtils.h"" ++#import ""UIView+NativeRender.h"" + +-typedef void (^HippyPropBlock)(id view, id json); ++typedef void (^NativeRenderPropBlock)(id view, id json); + +-@interface HippyComponentProp : NSObject { ++@interface NativeRenderComponentProp : NSObject { + } + + @property (nonatomic, copy, readonly) NSString *type; +-@property (nonatomic, copy) HippyPropBlock propBlock; ++@property (nonatomic, copy) NativeRenderPropBlock propBlock; + + @end + +-@implementation HippyComponentProp ++@implementation NativeRenderComponentProp + + - (instancetype)initWithType:(NSString *)type { + if ((self = [super init])) { +@@ -52,33 +51,33 @@ - (instancetype)initWithType:(NSString *)type { + + @end + +-@interface HippyComponentData () { +- id _defaultView; // Only needed for HIPPY_CUSTOM_VIEW_PROPERTY +- NSMutableDictionary *_viewPropBlocks; +- NSMutableDictionary *_shadowPropBlocks; ++@interface NativeRenderComponentData () { ++ id _defaultView; // Only needed for NATIVE_RENDER_CUSTOM_VIEW_PROPERTY ++ NSMutableDictionary *_viewPropBlocks; ++ NSMutableDictionary *_renderObjectPropBlocks; + NSMutableDictionary *_eventNameMap; +- BOOL _implementsUIBlockToAmendWithShadowViewRegistry; +- __weak HippyViewManager *_manager; ++ BOOL _implementsUIBlockToAmendWithRenderObjectRegistry; ++ __weak NativeRenderViewManager *_manager; + NSDictionary *_methodsByName; + } + + @end + +-@implementation HippyComponentData ++@implementation NativeRenderComponentData + +-//HippyViewManager is base class of all ViewManager class +-//we use a variable to cache HippyViewManager's event name map ++//NativeRenderViewManager is base class of all ViewManager class ++//we use a variable to cache NativeRenderViewManager's event name map + static NSDictionary *gBaseViewManagerDic = nil; + +-- (instancetype)initWithViewManager:(HippyViewManager *)viewManager viewName:(NSString *)viewName { ++- (instancetype)initWithViewManager:(NativeRenderViewManager *)viewManager viewName:(NSString *)viewName { + self = [super init]; + if (self) { + _managerClass = [viewManager class]; + _manager = viewManager; + _viewPropBlocks = [NSMutableDictionary new]; +- _shadowPropBlocks = [NSMutableDictionary new]; ++ _renderObjectPropBlocks = [NSMutableDictionary new]; + // Hackety hack, this partially re-implements HippyBridgeModuleNameForClass +- // We want to get rid of Hippy and RK prefixes, but a lot of JS code still references ++ // We want to get rid of NativeRender and RK prefixes, but a lot of JS code still references + // view names by prefix. So, while HippyBridgeModuleNameForClass now drops these + // prefixes by default, we'll still keep them around here. + NSString *name = viewName; +@@ -86,7 +85,7 @@ - (instancetype)initWithViewManager:(HippyViewManager *)viewManager viewName:(NS + name = NSStringFromClass(_managerClass); + } + if ([name hasPrefix:@""RK""]) { +- name = [name stringByReplacingCharactersInRange:(NSRange) { 0, @""RK"".length } withString:@""Hippy""]; ++ name = [name stringByReplacingCharactersInRange:(NSRange) { 0, @""RK"".length } withString:@""NativeRender""]; + } + if ([name hasSuffix:@""Manager""]) { + name = [name substringToIndex:name.length - @""Manager"".length]; +@@ -95,22 +94,20 @@ - (instancetype)initWithViewManager:(HippyViewManager *)viewManager viewName:(NS + NSAssert(name.length, @""Invalid moduleName '%@'"", name); + _name = name; + +- _implementsUIBlockToAmendWithShadowViewRegistry = NO; ++ _implementsUIBlockToAmendWithRenderObjectRegistry = NO; + Class cls = _managerClass; +- while (cls != [HippyViewManager class]) { +- _implementsUIBlockToAmendWithShadowViewRegistry +- = _implementsUIBlockToAmendWithShadowViewRegistry +- || HippyClassOverridesInstanceMethod(cls, @selector(uiBlockToAmendWithShadowViewRegistry:)); ++ while (cls != [NativeRenderViewManager class]) { ++ _implementsUIBlockToAmendWithRenderObjectRegistry ++ = _implementsUIBlockToAmendWithRenderObjectRegistry ++ || NativeRenderClassOverridesInstanceMethod(cls, @selector(uiBlockToAmendWithRenderObjectRegistryuiBlockToAmendWithRenderObjectRegistry:)); + cls = [cls superclass]; + } + } + return self; + } + +-HIPPY_NOT_IMPLEMENTED(-(instancetype)init) +- + - (UIView *)createViewWithTag:(NSNumber *)tag { +- NSAssert(HippyIsMainQueue(), @""This function must be called on the main thread""); ++ NSAssert(NativeRenderIsMainQueue(), @""This function must be called on the main thread""); + UIView *view = [self.manager view]; + view.hippyTag = tag; + view.multipleTouchEnabled = YES; +@@ -120,7 +117,7 @@ - (UIView *)createViewWithTag:(NSNumber *)tag { + } + + - (UIView *)createViewWithTag:(NSNumber *)tag initProps:(NSDictionary *)props { +- NSAssert(HippyIsMainQueue(), @""This function must be called on the main thread""); ++ NSAssert(NativeRenderIsMainQueue(), @""This function must be called on the main thread""); + self.manager.props = props; + UIView *view = [self.manager view]; + view.hippyTag = tag; +@@ -131,26 +128,27 @@ - (UIView *)createViewWithTag:(NSNumber *)tag initProps:(NSDictionary *)props { + return view; + } + +-- (HippyShadowView *)createShadowViewWithTag:(NSNumber *)tag { +- HippyShadowView *shadowView = [self.manager shadowView]; +- shadowView.hippyTag = tag; +- shadowView.viewName = _name; +- return shadowView; ++- (NativeRenderObjectView *)createRenderObjectViewWithTag:(NSNumber *)tag { ++ NativeRenderObjectView *renderObject = [self.manager nativeRenderObjectView]; ++ renderObject.hippyTag = tag; ++ renderObject.viewName = _name; ++ return renderObject; + } + +-- (HippyPropBlock)propBlockForKey:(NSString *)name inDictionary:(NSMutableDictionary *)propBlocks { +- BOOL shadowView = (propBlocks == _shadowPropBlocks); +- HippyPropBlock propBlock = propBlocks[name]; ++- (NativeRenderPropBlock)propBlockForKey:(NSString *)name inDictionary:(NSMutableDictionary *)propBlocks { ++ BOOL renderObject = (propBlocks == _renderObjectPropBlocks); ++ NativeRenderPropBlock propBlock = propBlocks[name]; + if (!propBlock) { +- __weak HippyComponentData *weakSelf = self; ++ __weak NativeRenderComponentData *weakSelf = self; + + // Get type + SEL type = NULL; + NSString *keyPath = nil; +- SEL selector = NSSelectorFromString([NSString stringWithFormat:@""propConfig%@_%@"", shadowView ? @""Shadow"" : @"""", name]); ++ SEL selector = NSSelectorFromString([NSString stringWithFormat:@""propConfig%@_%@"", renderObject ? @""RenderObject"" : @"""", name]); ++ NSAssert(selector, @""no propConfig setter selector found for property %@"", name); + if ([_managerClass respondsToSelector:selector]) { + NSArray *typeAndKeyPath = ((NSArray * (*)(id, SEL)) objc_msgSend)(_managerClass, selector); +- type = HippyConvertSelectorForType(typeAndKeyPath[0]); ++ type = NativeRenderConvertSelectorForType(typeAndKeyPath[0]); + keyPath = typeAndKeyPath.count > 1 ? typeAndKeyPath[1] : nil; + } else { + propBlock = ^(__unused id view, __unused id json) { +@@ -163,20 +161,20 @@ - (HippyPropBlock)propBlockForKey:(NSString *)name inDictionary:(NSMutableDictio + if ([keyPath isEqualToString:@""__custom__""]) { + // Get custom setter. There is no default view in the shadow case, so the selector is different. + NSString *selectorString; +- if (!shadowView) { +- selectorString = [NSString stringWithFormat:@""set_%@:for%@View:withDefaultView:"", name, shadowView ? @""Shadow"" : @""""]; ++ if (!renderObject) { ++ selectorString = [NSString stringWithFormat:@""set_%@:for%@View:withDefaultView:"", name, renderObject ? @""Render"" : @""""]; + } else { +- selectorString = [NSString stringWithFormat:@""set_%@:forShadowView:"", name]; ++ selectorString = [NSString stringWithFormat:@""set_%@:forRenderObject:"", name]; + } + SEL customSetter = NSSelectorFromString(selectorString); +- +- propBlock = ^(id view, id json) { +- HippyComponentData *strongSelf = weakSelf; ++ NSAssert(customSetter, @""no __custom__ setter selector found for property %@"", name); ++ propBlock = ^(id view, id json) { ++ NativeRenderComponentData *strongSelf = weakSelf; + if (!strongSelf) { + return; + } +- json = HippyNilIfNull(json); +- if (!shadowView) { ++ json = NativeRenderNilIfNull(json); ++ if (!renderObject) { + if (!json && !strongSelf->_defaultView) { + // Only create default view if json is null + strongSelf->_defaultView = [strongSelf createViewWithTag:nil]; +@@ -205,15 +203,15 @@ - (HippyPropBlock)propBlockForKey:(NSString *)name inDictionary:(NSMutableDictio + + // Build setter block + void (^setterBlock)(id target, id json) = nil; +- if (type == NSSelectorFromString(@""HippyDirectEventBlock:"")) { ++ if (type == NSSelectorFromString(@""NativeRenderDirectEventBlock:"")) { + //TODO + //The component event response logic no longer executes this code + } else { + // Ordinary property handlers +- NSMethodSignature *typeSignature = [[HippyConvert class] methodSignatureForSelector:type]; ++ NSMethodSignature *typeSignature = [[NativeRenderConvert class] methodSignatureForSelector:type]; + if (!typeSignature) { +- HippyLogError(@""No +[HippyConvert %@] function found."", NSStringFromSelector(type)); +- return ^(__unused id view, __unused id json) { ++ NativeRenderLogError(@""No +[NativeRenderConvert %@] function found."", NSStringFromSelector(type)); ++ return ^(__unused id view, __unused id json) { + }; + } + switch (typeSignature.methodReturnType[0]) { +@@ -233,7 +231,7 @@ - (HippyPropBlock)propBlockForKey:(NSString *)name inDictionary:(NSMutableDictio + setDefaultValue = YES; \ + } \ + if ([target respondsToSelector:setter]) { \ +- set(target, setter, convert([HippyConvert class], type, json)); \ ++ set(target, setter, convert([NativeRenderConvert class], type, json)); \ + } \ + } else if (setDefaultValue) { \ + if ([target respondsToSelector:setter]) { \ +@@ -266,7 +264,7 @@ - (HippyPropBlock)propBlockForKey:(NSString *)name inDictionary:(NSMutableDictio + default: { + NSInvocation *typeInvocation = [NSInvocation invocationWithMethodSignature:typeSignature]; + typeInvocation.selector = type; +- typeInvocation.target = [HippyConvert class]; ++ typeInvocation.target = [NativeRenderConvert class]; + + __block NSInvocation *targetInvocation = nil; + __block NSMutableData *defaultValue = nil; +@@ -335,19 +333,19 @@ - (HippyPropBlock)propBlockForKey:(NSString *)name inDictionary:(NSMutableDictio + } + // Set property with json + if (setterBlock) { +- setterBlock(target, HippyNilIfNull(json)); ++ setterBlock(target, NativeRenderNilIfNull(json)); + } + }; + } + +- if (HIPPY_DEBUG) { ++ if (NATIVE_RENDER_DEBUG) { + // Provide more useful log feedback if there's an error +- HippyPropBlock unwrappedBlock = propBlock; +- propBlock = ^(id view, id json) { ++ NativeRenderPropBlock unwrappedBlock = propBlock; ++ propBlock = ^(id view, id json) { + NSString *logPrefix = + [NSString stringWithFormat:@""Error setting property '%@' of %@ with tag #%@: "", name, weakSelf.name, view.hippyTag]; + +- HippyPerformBlockWithLogPrefix( ++ NativeRenderPerformBlockWithLogPrefix( + ^{ + unwrappedBlock(view, json); + }, logPrefix); +@@ -359,13 +357,13 @@ - (HippyPropBlock)propBlockForKey:(NSString *)name inDictionary:(NSMutableDictio + return propBlock; + } + +-- (void)setProps:(NSDictionary *)props forView:(id)view { ++- (void)setProps:(NSDictionary *)props forView:(id)view { + if (!view) { + return; + } + + [props enumerateKeysAndObjectsUsingBlock:^(NSString *key, id json, __unused BOOL *stop) { +- HippyPropBlock block = [self propBlockForKey:key inDictionary:self->_viewPropBlocks]; ++ NativeRenderPropBlock block = [self propBlockForKey:key inDictionary:self->_viewPropBlocks]; + block(view, json); + }]; + +@@ -374,17 +372,18 @@ - (void)setProps:(NSDictionary *)props forView:(id *)props forShadowView:(HippyShadowView *)shadowView { +- if (!shadowView) { ++- (void)setProps:(NSDictionary *)props forRenderObjectView:(NativeRenderObjectView *)renderObject { ++ if (!renderObject) { + return; + } + + [props enumerateKeysAndObjectsUsingBlock:^(NSString *key, id json, __unused BOOL *stop) { +- [self propBlockForKey:key inDictionary:self->_shadowPropBlocks](shadowView, json); ++ NativeRenderPropBlock propBlock = [self propBlockForKey:key inDictionary:_renderObjectPropBlocks]; ++ propBlock(renderObject, json); + }]; + +- if ([shadowView respondsToSelector:@selector(didSetProps:)]) { +- [shadowView didSetProps:[props allKeys]]; ++ if ([renderObject respondsToSelector:@selector(didSetProps:)]) { ++ [renderObject didSetProps:[props allKeys]]; + } + } + +@@ -396,10 +395,10 @@ - (void)setProps:(NSDictionary *)props forShadowView:(HippyShado + static dispatch_once_t onceToken; + static Class viewManagerMetaClass = nil; + dispatch_once(&onceToken, ^{ +- viewManagerMetaClass = object_getClass([HippyViewManager class]); ++ viewManagerMetaClass = object_getClass([NativeRenderViewManager class]); + }); + while ([metaClass isSubclassOfClass:viewManagerMetaClass]) { +- //if metaclass is HippyViewManager's meta class,we try to get event name map from cache if exists ++ //if metaclass is NativeRenderViewManager's meta class,we try to get event name map from cache if exists + if (metaClass == viewManagerMetaClass && gBaseViewManagerDic) { + [_eventNameMap addEntriesFromDictionary:gBaseViewManagerDic]; + } +@@ -414,7 +413,7 @@ - (void)setProps:(NSDictionary *)props forShadowView:(HippyShado + if (nameRange.length) { + NSString *name = [methodName substringFromIndex:nameRange.location + 1]; + NSString *type = ((NSArray * (*)(id, SEL)) objc_msgSend)(_managerClass, selector)[0]; +- if ([type isEqualToString:@""HippyDirectEventBlock""]) { ++ if ([type isEqualToString:@""NativeRenderDirectEventBlock""]) { + //remove 'on' prefix if exists + NSString *nameNoOn = name; + if ([nameNoOn hasPrefix:@""on""]) { +@@ -428,7 +427,7 @@ - (void)setProps:(NSDictionary *)props forShadowView:(HippyShado + } + free(methods); + if (metaClass == viewManagerMetaClass) { +- //if metaclass is HippyViewManager's meta class,we try to save event name map from cache ++ //if metaclass is NativeRenderViewManager's meta class,we try to save event name map from cache + gBaseViewManagerDic = [_eventNameMap copy]; + } + } +@@ -521,9 +520,9 @@ - (NSString *)selectorStringFromSignature:(NSString *)signature { + return [selString copy]; + } + +-- (HippyRenderUIBlock)uiBlockToAmendWithShadowViewRegistry:(NSDictionary *)registry { +- if (_implementsUIBlockToAmendWithShadowViewRegistry) { +- return [[self manager] uiBlockToAmendWithShadowViewRegistry:registry]; ++- (NativeRenderRenderUIBlock)uiBlockToAmendWithRenderObjectViewRegistry:(NSDictionary *)registry { ++ if (_implementsUIBlockToAmendWithRenderObjectRegistry) { ++ return [[self manager] uiBlockToAmendWithRenderObjectRegistry:registry]; + } + return nil; + } +diff --git a/renderer/native/ios/renderer/HippyComponentMap.h b/renderer/native/ios/renderer/NativeRenderComponentMap.h +similarity index 67% +rename from renderer/native/ios/renderer/HippyComponentMap.h +rename to renderer/native/ios/renderer/NativeRenderComponentMap.h +index 2efaf556b00..8a1fe2ebed3 100644 +--- a/renderer/native/ios/renderer/HippyComponentMap.h ++++ b/renderer/native/ios/renderer/NativeRenderComponentMap.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,15 +21,15 @@ + */ + + #import +-#import ""HippyComponent.h"" ++#import ""NativeRenderComponentProtocol.h"" + #include ""dom/root_node.h"" + #include + + NS_ASSUME_NONNULL_BEGIN + +-@interface HippyComponentMap : NSObject ++@interface NativeRenderComponentMap : NSObject + +-- (void)addRootComponent:(id)component ++- (void)addRootComponent:(id)component + rootNode:(std::weak_ptr)rootNode + forTag:(NSNumber *)tag; + +@@ -37,19 +37,19 @@ NS_ASSUME_NONNULL_BEGIN + + - (BOOL)containRootComponentWithTag:(NSNumber *)tag; + +-- (__kindof id)rootComponentForTag:(NSNumber *)tag; ++- (__kindof id)rootComponentForTag:(NSNumber *)tag; + + - (std::weak_ptr)rootNodeForTag:(NSNumber *)tag; + +-- (void)addComponent:(__kindof id)component ++- (void)addComponent:(__kindof id)component + forRootTag:(NSNumber *)tag; + +-- (void)removeComponent:(__kindof id)component ++- (void)removeComponent:(__kindof id)component + forRootTag:(NSNumber *)tag; + +-- (NSMutableDictionary> *)componentsForRootTag:(NSNumber *)tag; ++- (NSMutableDictionary> *)componentsForRootTag:(NSNumber *)tag; + +-- (__kindof id)componentForTag:(NSNumber *)componentTag ++- (__kindof id)componentForTag:(NSNumber *)componentTag + onRootTag:(NSNumber *)tag; + + @end +diff --git a/renderer/native/ios/renderer/HippyComponentMap.mm b/renderer/native/ios/renderer/NativeRenderComponentMap.mm +similarity index 81% +rename from renderer/native/ios/renderer/HippyComponentMap.mm +rename to renderer/native/ios/renderer/NativeRenderComponentMap.mm +index 3f3d5089878..f8a935fc996 100644 +--- a/renderer/native/ios/renderer/HippyComponentMap.mm ++++ b/renderer/native/ios/renderer/NativeRenderComponentMap.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,19 +20,19 @@ + * limitations under the License. + */ + +-#import ""HippyComponentMap.h"" ++#import ""NativeRenderComponentMap.h"" + + using RootNode = hippy::RootNode; + +-@interface HippyComponentMap () { +- NSMutableDictionary> *> *_componentsMap; +- NSMutableDictionary> *_rootComponentsMap; ++@interface NativeRenderComponentMap () { ++ NSMutableDictionary> *> *_componentsMap; ++ NSMutableDictionary> *_rootComponentsMap; + std::unordered_map> _rootNodesMap; + } + + @end + +-@implementation HippyComponentMap ++@implementation NativeRenderComponentMap + + - (instancetype)init { + self = [super init]; +@@ -44,7 +44,7 @@ - (instancetype)init { + return self; + } + +-- (void)addRootComponent:(id)component ++- (void)addRootComponent:(id)component + rootNode:(std::weak_ptr)rootNode + forTag:(NSNumber *)tag { + NSAssert(component && tag, @""component &&tag must not be null in method %@"", NSStringFromSelector(_cmd)); +@@ -70,7 +70,7 @@ - (BOOL)containRootComponentWithTag:(NSNumber *)tag { + return nil != rootComponent; + } + +-- (__kindof id)rootComponentForTag:(NSNumber *)tag { ++- (__kindof id)rootComponentForTag:(NSNumber *)tag { + NSAssert(tag, @""tag must not be null in method %@"", NSStringFromSelector(_cmd)); + return [_rootComponentsMap objectForKey:tag]; + } +@@ -79,7 +79,7 @@ - (BOOL)containRootComponentWithTag:(NSNumber *)tag { + return _rootNodesMap[[tag intValue]]; + } + +-- (void)addComponent:(__kindof id)component forRootTag:(NSNumber *)tag { ++- (void)addComponent:(__kindof id)component forRootTag:(NSNumber *)tag { + NSAssert(tag, @""component and tag must not be null in method %@"", NSStringFromSelector(_cmd)); + NSAssert([self containRootComponentWithTag:tag], @""no root component for tag:%@"", tag); + NSAssert([component hippyTag], @""component's tag must not be null in %@"", NSStringFromSelector(_cmd)); +@@ -89,7 +89,7 @@ - (void)addComponent:(__kindof id)component forRootTag:(NSNumber + } + } + +-- (void)removeComponent:(__kindof id)component forRootTag:(NSNumber *)tag { ++- (void)removeComponent:(__kindof id)component forRootTag:(NSNumber *)tag { + NSAssert(tag, @""component and tag must not be null in method %@"", NSStringFromSelector(_cmd)); + NSAssert([component hippyTag], @""component's tag must not be null in %@"", NSStringFromSelector(_cmd)); + if (component && tag) { +@@ -98,7 +98,7 @@ - (void)removeComponent:(__kindof id)component forRootTag:(NSNum + } + } + +-- (NSMutableDictionary> *)componentsForRootTag:(NSNumber *)tag { ++- (NSMutableDictionary> *)componentsForRootTag:(NSNumber *)tag { + NSAssert(tag, @""tag must not be null in method %@"", NSStringFromSelector(_cmd)); + if (tag) { + id map = [_componentsMap objectForKey:tag]; +@@ -107,7 +107,7 @@ - (void)removeComponent:(__kindof id)component forRootTag:(NSNum + return nil; + } + +-- (__kindof id)componentForTag:(NSNumber *)componentTag ++- (__kindof id)componentForTag:(NSNumber *)componentTag + onRootTag:(NSNumber *)tag { + NSAssert(componentTag && tag, @""componentTag && tag must not be null in method %@"", NSStringFromSelector(_cmd)); + if (componentTag && tag) { +diff --git a/renderer/native/ios/renderer/HippyComponent.h b/renderer/native/ios/renderer/NativeRenderComponentProtocol.h +similarity index 71% +rename from renderer/native/ios/renderer/HippyComponent.h +rename to renderer/native/ios/renderer/NativeRenderComponentProtocol.h +index c7876e3b307..79687c46930 100644 +--- a/renderer/native/ios/renderer/HippyComponent.h ++++ b/renderer/native/ios/renderer/NativeRenderComponentProtocol.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -27,14 +27,14 @@ + * These block types can be used for mapping input event handlers from JS to view + * properties. Unlike JS method callbacks, these can be called multiple times. + */ +-typedef void (^HippyDirectEventBlock)(NSDictionary *body); ++typedef void (^NativeRenderDirectEventBlock)(NSDictionary *body); + + /** +- * Logical node in a tree of application components. Both `ShadowView` and ++ * Logical node in a tree of application components. Both `NativeRenderObject` and + * `UIView` conforms to this. Allows us to write utilities that reason about + * trees generally. + */ +-@protocol HippyComponent ++@protocol NativeRenderComponentProtocol + + @property (nonatomic, copy) NSNumber *hippyTag; + @property (nonatomic, copy) NSNumber *rootTag; +@@ -42,24 +42,24 @@ typedef void (^HippyDirectEventBlock)(NSDictionary *body); + @property (nonatomic, copy) NSString *tagName; + @property (nonatomic, copy) NSDictionary *props; + @property (nonatomic, assign) CGRect frame; +-@property (nonatomic, weak) id parent; ++@property (nonatomic, weak) id parent; + +-- (void)insertHippySubview:(id)subview atIndex:(NSInteger)atIndex; +-- (void)removeHippySubview:(id)subview; ++- (void)insertHippySubview:(id)subview atIndex:(NSInteger)atIndex; ++- (void)removeHippySubview:(id)subview; + - (void)removeFromHippySuperview; + - (void)hippySetFrame:(CGRect)frame; +-- (NSArray> *)hippySubviews; +-- (id)hippySuperview; ++- (NSArray> *)hippySubviews; ++- (id)hippySuperview; + - (NSNumber *)hippyTagAtPoint:(CGPoint)point; + +-// View/ShadowView is a root view ++// View/NativeRenderObjectView is a root view + - (BOOL)isHippyRootView; + + @optional + + /** + * Called each time props have been set. +- * Not all props have to be set - Hippy can set only changed ones. ++ * Not all props have to be set - NativeRender can set only changed ones. + * @param changedProps String names of all set props. + */ + - (void)didSetProps:(NSArray *)changedProps; +@@ -74,6 +74,6 @@ typedef void (^HippyDirectEventBlock)(NSDictionary *body); + @end + + // hippy use multiple of 10 as tag of root view +-static inline BOOL HippyIsHippyRootView(NSNumber *hippyTag) { ++static inline BOOL NativeRenderIsHippyRootView(NSNumber *hippyTag) { + return hippyTag.integerValue % 10 == 0; + } +diff --git a/renderer/native/ios/renderer/HippyRenderContext.h b/renderer/native/ios/renderer/NativeRenderContext.h +similarity index 71% +rename from renderer/native/ios/renderer/HippyRenderContext.h +rename to renderer/native/ios/renderer/NativeRenderContext.h +index f0c8c28ee68..ec2ea0f4d67 100644 +--- a/renderer/native/ios/renderer/HippyRenderContext.h ++++ b/renderer/native/ios/renderer/NativeRenderContext.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,39 +21,39 @@ + */ + + #import +-#import ""HippyFrameworkProxy.h"" ++#import ""NativeRenderFrameworkProxy.h"" + #import ""UIView+Render.h"" + #import ""dom/dom_manager.h"" + #import ""dom/root_node.h"" + + NS_ASSUME_NONNULL_BEGIN + +-@class HippyViewManager; +-@class HippyShadowView; ++@class NativeRenderViewManager; ++@class NativeRenderObjectView; + +-@protocol HippyRenderContext; ++@protocol NativeRenderContext; + +-typedef void (^HippyRenderUIBlock)(id renderContext, NSDictionary *viewRegistry); ++typedef void (^NativeRenderRenderUIBlock)(id renderContext, NSDictionary *viewRegistry); + +-@protocol HippyRenderContext ++@protocol NativeRenderContext + + @property(nonatomic, readonly) NSDictionary *viewRegistry; + + @property(nonatomic, readonly) std::weak_ptr domManager; + +-@property(nonatomic, weak) id frameworkProxy; ++@property(nonatomic, weak) id frameworkProxy; + + - (void)registerRootView:(UIView *)rootView asRootNode:(std::weak_ptr)rootNode; + +-- (__kindof HippyViewManager *)renderViewManagerForViewName:(NSString *)viewName; ++- (__kindof NativeRenderViewManager *)renderViewManagerForViewName:(NSString *)viewName; + + - (__kindof UIView *)viewFromRenderViewTag:(NSNumber *)hippyTag onRootTag:(NSNumber *)rootTag; + +-- (__kindof UIView *)createViewRecursivelyFromShadowView:(HippyShadowView *)shadowView; ++- (__kindof UIView *)createViewRecursivelyFromRenderObject:(NativeRenderObjectView *)renderObject; + + - (void)purgeViewsFromHippyTags:(NSArray *)hippyTag onRootTag:(NSNumber *)rootTag; + +-- (void)addUIBlock:(HippyRenderUIBlock)block; ++- (void)addUIBlock:(NativeRenderRenderUIBlock)block; + + - (void)executeBlockOnRenderQueue:(dispatch_block_t)block; + +diff --git a/renderer/native/ios/renderer/HippyFont.h b/renderer/native/ios/renderer/NativeRenderFont.h +similarity index 91% +rename from renderer/native/ios/renderer/HippyFont.h +rename to renderer/native/ios/renderer/NativeRenderFont.h +index 60683010a47..b5e192d50de 100644 +--- a/renderer/native/ios/renderer/HippyFont.h ++++ b/renderer/native/ios/renderer/NativeRenderFont.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -22,9 +22,9 @@ + + #import + +-#import ""HippyConvert.h"" ++#import ""NativeRenderConvert.h"" + +-@interface HippyFont : NSObject ++@interface NativeRenderFont : NSObject + + /** + * Update a font with a given font-family, size, weight and style. +@@ -46,7 +46,7 @@ + + @end + +-@interface HippyConvert (HippyFont) ++@interface NativeRenderConvert (NativeRenderFont) + + + (UIFont *)UIFont:(id)json; + +diff --git a/renderer/native/ios/renderer/HippyFont.mm b/renderer/native/ios/renderer/NativeRenderFont.mm +similarity index 83% +rename from renderer/native/ios/renderer/HippyFont.mm +rename to renderer/native/ios/renderer/NativeRenderFont.mm +index 45365a5e539..8cabbfd10e9 100644 +--- a/renderer/native/ios/renderer/HippyFont.mm ++++ b/renderer/native/ios/renderer/NativeRenderFont.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,8 +20,8 @@ + * limitations under the License. + */ + +-#import ""HippyFont.h"" +-#import ""HippyLog.h"" ++#import ""NativeRenderFont.h"" ++#import ""NativeRenderLog.h"" + + #import + +@@ -32,7 +32,7 @@ + // These constants are defined in iPhone SDK 8.2, but the app cannot run on + // iOS < 8.2 unless we redefine them here. If you target iOS 8.2 or above + // as a base target, the standard constants will be used instead. +-// These constants can only be removed when Hippy Native drops iOS8 support. ++// These constants can only be removed when NativeRender Native drops iOS8 support. + + #define UIFontWeightUltraLight -0.8 + #define UIFontWeightThin -0.6 +@@ -48,8 +48,8 @@ + + static NSCache *fontCache; + +-typedef CGFloat HippyFontWeight; +-static HippyFontWeight weightOfFont(UIFont *font) { ++typedef CGFloat NativeRenderFontWeight; ++static NativeRenderFontWeight weightOfFont(UIFont *font) { + static NSDictionary *nameToWeight; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ +@@ -69,7 +69,7 @@ static HippyFontWeight weightOfFont(UIFont *font) { + }); + + NSDictionary *traits = [font.fontDescriptor objectForKey:UIFontDescriptorTraitsAttribute]; +- HippyFontWeight weight = [traits[UIFontWeightTrait] doubleValue]; ++ NativeRenderFontWeight weight = [traits[UIFontWeightTrait] doubleValue]; + if (weight == 0.0) { + @autoreleasepool { + for (NSString *name in nameToWeight) { +@@ -94,7 +94,7 @@ static BOOL isCondensedFont(UIFont *font) { + return (symbolicTraits & UIFontDescriptorTraitCondensed) != 0; + } + +-static UIFont *cachedSystemFont(CGFloat size, HippyFontWeight weight) { ++static UIFont *cachedSystemFont(CGFloat size, NativeRenderFontWeight weight) { + // static std::mutex fontCacheMutex; + + NSString *cacheKey = [NSString stringWithFormat:@""%.1f/%.2f"", size, weight]; +@@ -122,18 +122,18 @@ static BOOL isCondensedFont(UIFont *font) { + return font; + } + +-@implementation HippyConvert (HippyFont) ++@implementation NativeRenderConvert (NativeRenderFont) + + + (UIFont *)UIFont:(id)json { + json = [self NSDictionary:json]; +- return [HippyFont updateFont:nil withFamily:[HippyConvert NSString:json[@""fontFamily""]] size:[HippyConvert NSNumber:json[@""fontSize""]] +- weight:[HippyConvert NSString:json[@""fontWeight""]] +- style:[HippyConvert NSString:json[@""fontStyle""]] +- variant:[HippyConvert NSStringArray:json[@""fontVariant""]] ++ return [NativeRenderFont updateFont:nil withFamily:[NativeRenderConvert NSString:json[@""fontFamily""]] size:[NativeRenderConvert NSNumber:json[@""fontSize""]] ++ weight:[NativeRenderConvert NSString:json[@""fontWeight""]] ++ style:[NativeRenderConvert NSString:json[@""fontStyle""]] ++ variant:[NativeRenderConvert NSStringArray:json[@""fontVariant""]] + scaleMultiplier:1]; + } + +-HIPPY_ENUM_CONVERTER(HippyFontWeight, (@{ ++HIPPY_ENUM_CONVERTER(NativeRenderFontWeight, (@{ + @""normal"": @(UIFontWeightRegular), + @""bold"": @(UIFontWeightBold), + @""100"": @(UIFontWeightUltraLight), +@@ -148,16 +148,16 @@ + (UIFont *)UIFont:(id)json { + }), + UIFontWeightRegular, doubleValue) + +-typedef BOOL HippyFontStyle; +-HIPPY_ENUM_CONVERTER(HippyFontStyle, (@{ ++typedef BOOL NativeRenderFontStyle; ++HIPPY_ENUM_CONVERTER(NativeRenderFontStyle, (@{ + @""normal"": @NO, + @""italic"": @YES, + @""oblique"": @YES, + }), + NO, boolValue) + +-typedef NSDictionary HippyFontVariantDescriptor; +-+ (HippyFontVariantDescriptor *)HippyFontVariantDescriptor:(id)json { ++typedef NSDictionary NativeRenderFontVariantDescriptor; +++ (NativeRenderFontVariantDescriptor *)NativeRenderFontVariantDescriptor:(id)json { + static NSDictionary *mapping; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ +@@ -184,22 +184,22 @@ + (HippyFontVariantDescriptor *)HippyFontVariantDescriptor:(id)json { + }, + }; + }); +- HippyFontVariantDescriptor *value = mapping[json]; +- if (HIPPY_DEBUG && !value && [json description].length > 0) { +- HippyLogError(@""Invalid HippyFontVariantDescriptor '%@'. should be one of: %@"", json, ++ NativeRenderFontVariantDescriptor *value = mapping[json]; ++ if (NATIVE_RENDER_DEBUG && !value && [json description].length > 0) { ++ NativeRenderLogError(@""Invalid NativeRenderFontVariantDescriptor '%@'. should be one of: %@"", json, + [[mapping allKeys] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)]); + } + return value; + } + +-Hippy_ARRAY_CONVERTER(HippyFontVariantDescriptor) ++HIPPY_ARRAY_CONVERTER(NativeRenderFontVariantDescriptor) + + @end + +-@implementation HippyFont ++@implementation NativeRenderFont + + + (void)initialize { +- if (self == [HippyFont class]) { ++ if (self == [NativeRenderFont class]) { + fontCache = [NSCache new]; + } + } +@@ -209,7 +209,7 @@ + (UIFont *)updateFont:(UIFont *)font + size:(NSNumber *)size + weight:(NSString *)weight + style:(NSString *)style +- variant:(NSArray *)variant ++ variant:(NSArray *)variant + scaleMultiplier:(CGFloat)scaleMultiplier { + // Defaults + static NSString *defaultFontFamily; +@@ -217,12 +217,12 @@ + (UIFont *)updateFont:(UIFont *)font + dispatch_once(&onceToken, ^{ + defaultFontFamily = [UIFont systemFontOfSize:14].familyName; + }); +- const HippyFontWeight defaultFontWeight = UIFontWeightRegular; ++ const NativeRenderFontWeight defaultFontWeight = UIFontWeightRegular; + const CGFloat defaultFontSize = 14; + + // Initialize properties to defaults + CGFloat fontSize = defaultFontSize; +- HippyFontWeight fontWeight = defaultFontWeight; ++ NativeRenderFontWeight fontWeight = defaultFontWeight; + NSString *familyName = defaultFontFamily; + BOOL isItalic = NO; + BOOL isCondensed = NO; +@@ -236,13 +236,13 @@ + (UIFont *)updateFont:(UIFont *)font + } + + // Get font attributes +- fontSize = [HippyConvert CGFloat:size] ?: fontSize; ++ fontSize = [NativeRenderConvert CGFloat:size] ?: fontSize; + if (scaleMultiplier > 0.0 && scaleMultiplier != 1.0) { + fontSize = round(fontSize * scaleMultiplier); + } +- familyName = [HippyConvert NSString:family] ?: familyName; +- isItalic = style ? [HippyConvert HippyFontStyle:style] : isItalic; +- fontWeight = weight ? [HippyConvert HippyFontWeight:weight] : fontWeight; ++ familyName = [NativeRenderConvert NSString:family] ?: familyName; ++ isItalic = style ? [NativeRenderConvert NativeRenderFontStyle:style] : isItalic; ++ fontWeight = weight ? [NativeRenderConvert NativeRenderFontWeight:weight] : fontWeight; + + BOOL didFindFont = NO; + +@@ -295,7 +295,7 @@ + (UIFont *)updateFont:(UIFont *)font + + } else { + // Not a valid font or family +- HippyLogError(@""Unrecognized font family '%@'"", familyName); ++ NativeRenderLogError(@""Unrecognized font family '%@'"", familyName); + if (@available(iOS 8.2, *)) { + font = [UIFont systemFontOfSize:fontSize weight:fontWeight]; + } else if (fontWeight > UIFontWeightRegular) { +@@ -322,7 +322,7 @@ + (UIFont *)updateFont:(UIFont *)font + } + // Apply font variants to font object + if (variant) { +- NSArray *fontFeatures = [HippyConvert HippyFontVariantDescriptorArray:variant]; ++ NSArray *fontFeatures = [NativeRenderConvert NativeRenderFontVariantDescriptorArray:variant]; + UIFontDescriptor *fontDescriptor = + [font.fontDescriptor fontDescriptorByAddingAttributes:@{ UIFontDescriptorFeatureSettingsAttribute: fontFeatures }]; + font = [UIFont fontWithDescriptor:fontDescriptor size:fontSize]; +diff --git a/renderer/native/ios/renderer/HippyFrameworkProxy.h b/renderer/native/ios/renderer/NativeRenderFrameworkProxy.h +similarity index 60% +rename from renderer/native/ios/renderer/HippyFrameworkProxy.h +rename to renderer/native/ios/renderer/NativeRenderFrameworkProxy.h +index eff268dbf07..43c9e0b9466 100644 +--- a/renderer/native/ios/renderer/HippyFrameworkProxy.h ++++ b/renderer/native/ios/renderer/NativeRenderFrameworkProxy.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,23 +21,23 @@ + */ + + #import +-#import ""HippyImageDataLoaderProtocol.h"" +-#import ""HippyImageProviderProtocol.h"" ++#import ""NativeRenderImageDataLoaderProtocol.h"" ++#import ""NativeRenderImageProviderProtocol.h"" + + NS_ASSUME_NONNULL_BEGIN + +-@protocol HippyRenderContext; ++@protocol NativeRenderContext; + + /** +- * HippyFrameworkDelegate is used to pass necessary data or implementation to render or ui object ++ * NativeRenderFrameworkDelegate is used to pass necessary data or implementation to render or ui object + */ +-@protocol HippyFrameworkProxy ++@protocol NativeRenderFrameworkProxy + +-- (NSString *)standardizeAssetUrlString:(NSString *)UrlString forRenderContext:(id)renderContext; ++- (NSString *)standardizeAssetUrlString:(NSString *)UrlString forRenderContext:(id)renderContext; + +-- (id)imageDataLoaderForRenderContext:(id)renderContext; ++- (id)imageDataLoaderForRenderContext:(id)renderContext; + +-- (Class)imageProviderClassForRenderContext:(id)renderContext; ++- (Class)imageProviderClassForRenderContext:(id)renderContext; + + @end + +diff --git a/renderer/native/ios/renderer/HippyInvalidating.h b/renderer/native/ios/renderer/NativeRenderInvalidating.h +similarity index 78% +rename from renderer/native/ios/renderer/HippyInvalidating.h +rename to renderer/native/ios/renderer/NativeRenderInvalidating.h +index 19432ba622d..838fe030ce2 100644 +--- a/renderer/native/ios/renderer/HippyInvalidating.h ++++ b/renderer/native/ios/renderer/NativeRenderInvalidating.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -22,12 +22,12 @@ + + #import + +-typedef NS_ENUM(NSUInteger, HippyInvalidateReason) { +- HippyInvalidateReasonDealloc = 0, +- HippyInvalidateReasonReload ++typedef NS_ENUM(NSUInteger, NativeRenderInvalidateReason) { ++ NativeRenderInvalidateReasonDealloc = 0, ++ NativeRenderInvalidateReasonReload + }; + +-@protocol HippyInvalidating ++@protocol NativeRenderInvalidating + + - (void)invalidate; + +diff --git a/renderer/native/ios/renderer/NativeRenderManager.h b/renderer/native/ios/renderer/NativeRenderManager.h +index efaab46b798..e75dd32f348 100644 +--- a/renderer/native/ios/renderer/NativeRenderManager.h ++++ b/renderer/native/ios/renderer/NativeRenderManager.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -27,10 +27,10 @@ + #include + #include ""dom/render_manager.h"" + #include ""dom/root_node.h"" +-#import ""HippyFrameworkProxy.h"" +-#import ""HippyRenderContext.h"" ++#import ""NativeRenderFrameworkProxy.h"" ++#import ""NativeRenderContext.h"" + +-@class UIView, HippyUIManager; ++@class UIView, NativeRenderUIManager; + + /** + * NativeRenderManager is used to manager view creation, update and delete for Native UI +@@ -39,7 +39,7 @@ class NativeRenderManager : public hippy::RenderManager { + + public: + NativeRenderManager(); +- NativeRenderManager(HippyUIManager *uiManager):uiManager_(uiManager){} ++ NativeRenderManager(NativeRenderUIManager *uiManager):uiManager_(uiManager){} + + ~NativeRenderManager(); + +@@ -137,16 +137,16 @@ class NativeRenderManager : public hippy::RenderManager { + + void SetDomManager(std::weak_ptr dom_manager); + +- void SetFrameworkProxy(id proxy); ++ void SetFrameworkProxy(id proxy); + +- id GetFrameworkProxy(); ++ id GetFrameworkProxy(); + + void SetUICreationLazilyEnabled(bool enabled); + +- id GetRenderContext(); ++ id GetRenderContext(); + + private: +- HippyUIManager *uiManager_; ++ NativeRenderUIManager *uiManager_; + }; + + #endif /* NativeRenderManager_h */ +diff --git a/renderer/native/ios/renderer/NativeRenderManager.mm b/renderer/native/ios/renderer/NativeRenderManager.mm +index 7331ee51ee9..8d199d2ef20 100644 +--- a/renderer/native/ios/renderer/NativeRenderManager.mm ++++ b/renderer/native/ios/renderer/NativeRenderManager.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,8 +21,8 @@ + */ + + #import ""NativeRenderManager.h"" +-#import ""HippyShadowText.h"" +-#import ""HippyUIManager.h"" ++#import ""NativeRenderObjectText.h"" ++#import ""NativeRenderUIManager.h"" + #import ""dom/layout_node.h"" + #import ""dom/dom_manager.h"" + #import ""RenderVsyncManager.h"" +@@ -37,7 +37,7 @@ + using RootNode = hippy::RootNode; + + NativeRenderManager::NativeRenderManager() { +- uiManager_ = [[HippyUIManager alloc] init]; ++ uiManager_ = [[NativeRenderUIManager alloc] init]; + } + + void NativeRenderManager::CreateRenderNode(std::weak_ptr root_node, +@@ -164,11 +164,11 @@ + } + } + +-void NativeRenderManager::SetFrameworkProxy(id proxy) { ++void NativeRenderManager::SetFrameworkProxy(id proxy) { + uiManager_.frameworkProxy = proxy; + } + +-id NativeRenderManager::GetFrameworkProxy() { ++id NativeRenderManager::GetFrameworkProxy() { + return uiManager_.frameworkProxy; + } + +@@ -176,7 +176,7 @@ + uiManager_.uiCreationLazilyEnabled = enabled; + } + +-id NativeRenderManager::GetRenderContext() { ++id NativeRenderManager::GetRenderContext() { + return uiManager_; + } + +diff --git a/renderer/native/ios/renderer/HippyRootShadowView.h b/renderer/native/ios/renderer/NativeRenderObjectRootView.h +similarity index 87% +rename from renderer/native/ios/renderer/HippyRootShadowView.h +rename to renderer/native/ios/renderer/NativeRenderObjectRootView.h +index 5d46ad61cf3..0d937759ec3 100644 +--- a/renderer/native/ios/renderer/HippyRootShadowView.h ++++ b/renderer/native/ios/renderer/NativeRenderObjectRootView.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,9 +20,9 @@ + * limitations under the License. + */ + +-#import ""HippyShadowView.h"" ++#import ""NativeRenderObjectView.h"" + +-@interface HippyRootShadowView : HippyShadowView ++@interface NativeRenderObjectRootView : NativeRenderObjectView + + /** + * Calculate all views whose frame needs updating after layout has been calculated. +diff --git a/renderer/native/ios/renderer/HippyRootShadowView.mm b/renderer/native/ios/renderer/NativeRenderObjectRootView.mm +similarity index 76% +rename from renderer/native/ios/renderer/HippyRootShadowView.mm +rename to renderer/native/ios/renderer/NativeRenderObjectRootView.mm +index 015a5daf092..2169d380e60 100644 +--- a/renderer/native/ios/renderer/HippyRootShadowView.mm ++++ b/renderer/native/ios/renderer/NativeRenderObjectRootView.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,18 +20,18 @@ + * limitations under the License. + */ + +-#import ""HippyRootShadowView.h"" +-#import ""HippyUtils.h"" +-#import ""HippyI18nUtils.h"" ++#import ""NativeRenderObjectRootView.h"" ++#import ""NativeRenderUtils.h"" ++#import ""NativeRenderI18nUtils.h"" + +-@implementation HippyRootShadowView ++@implementation NativeRenderObjectRootView + + - (void)applySizeConstraints { + } + + - (void)amendLayoutBeforeMount { +- for (HippyShadowView *shadowView in self.hippySubviews) { +- [shadowView amendLayoutBeforeMount]; ++ for (NativeRenderObjectView *renderObject in self.hippySubviews) { ++ [renderObject amendLayoutBeforeMount]; + } + } + +diff --git a/renderer/native/ios/renderer/HippyScrollProtocol.h b/renderer/native/ios/renderer/NativeRenderScrollProtocol.h +similarity index 91% +rename from renderer/native/ios/renderer/HippyScrollProtocol.h +rename to renderer/native/ios/renderer/NativeRenderScrollProtocol.h +index 68a1ae93b85..1f5b99e9e99 100644 +--- a/renderer/native/ios/renderer/HippyScrollProtocol.h ++++ b/renderer/native/ios/renderer/NativeRenderScrollProtocol.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -22,7 +22,7 @@ + + #import + +-@protocol HippyScrollProtocol ++@protocol NativeRenderScrollProtocol + + @required + +diff --git a/renderer/native/ios/renderer/HippyUIManager.h b/renderer/native/ios/renderer/NativeRenderUIManager.h +similarity index 72% +rename from renderer/native/ios/renderer/HippyUIManager.h +rename to renderer/native/ios/renderer/NativeRenderUIManager.h +index 32fe624982e..c240f8a3afe 100644 +--- a/renderer/native/ios/renderer/HippyUIManager.h ++++ b/renderer/native/ios/renderer/NativeRenderUIManager.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -22,53 +22,53 @@ + + #import + +-#import ""HippyInvalidating.h"" +-#import ""HippyViewManager.h"" ++#import ""NativeRenderInvalidating.h"" ++#import ""NativeRenderViewManager.h"" + #include + #include +-#import ""HippyDomNodeUtils.h"" ++#import ""NativeRenderDomNodeUtils.h"" + #include ""footstone/hippy_value.h"" + #include ""dom/dom_listener.h"" + #include ""dom/dom_manager.h"" + #include ""dom/dom_node.h"" +-#import ""HippyDomNodeUtils.h"" +-#import ""HippyRenderContext.h"" ++#import ""NativeRenderDomNodeUtils.h"" ++#import ""NativeRenderContext.h"" + +-@class HippyAnimationViewParams, HippyShadowView; ++@class NativeRenderAnimationViewParams, NativeRenderObjectView; + + /** + * UIManager queue + */ +-HIPPY_EXTERN dispatch_queue_t HippyGetUIManagerQueue(void); ++NATIVE_RENDER_EXTERN dispatch_queue_t NativeRenderGetUIManagerQueue(void); + + /** + * Default name for the UIManager queue + */ +-HIPPY_EXTERN const char *HippyUIManagerQueueName; ++NATIVE_RENDER_EXTERN const char *NativeRenderUIManagerQueueName; + + /** +- * Posted whenever a new root view is registered with HippyUIManager. The userInfo property +- * will contain a HippyUIManagerRootViewKey with the registered root view. ++ * Posted whenever a new root view is registered with NativeRenderUIManager. The userInfo property ++ * will contain a NativeRenderUIManagerRootViewKey with the registered root view. + */ +-HIPPY_EXTERN NSString *const HippyUIManagerDidRegisterRootViewNotification; ++NATIVE_RENDER_EXTERN NSString *const NativeRenderUIManagerDidRegisterRootViewNotification; + + /** + * Key for the root view property in the above notifications + */ +-HIPPY_EXTERN NSString *const HippyUIManagerRootViewKey; ++NATIVE_RENDER_EXTERN NSString *const NativeRenderUIManagerRootViewKey; + + //TODO delete it +-HIPPY_EXTERN NSString *const HippyUIManagerKey; ++NATIVE_RENDER_EXTERN NSString *const NativeRenderUIManagerKey; + + /** + * Posted whenever endBatch is called + */ +-HIPPY_EXTERN NSString *const HippyUIManagerDidEndBatchNotification; ++NATIVE_RENDER_EXTERN NSString *const NativeRenderUIManagerDidEndBatchNotification; + + /** +- * The HippyUIManager is the module responsible for updating the view hierarchy. ++ * The NativeRenderUIManager is the module responsible for updating the view hierarchy. + */ +-@interface HippyUIManager : NSObject ++@interface NativeRenderUIManager : NSObject + + @property(nonatomic, assign) BOOL uiCreationLazilyEnabled; + +@@ -82,12 +82,12 @@ HIPPY_EXTERN NSString *const HippyUIManagerDidEndBatchNotification; + /** + * Get the shadow view associated with a hippyTag + */ +-- (HippyShadowView *)shadowViewForHippyTag:(NSNumber *)hippyTag +- onRootTag:(NSNumber *)rootTag; ++- (NativeRenderObjectView *)renderObjectForHippyTag:(NSNumber *)hippyTag ++ onRootTag:(NSNumber *)rootTag; + + /** + * Update the frame of a view. This might be in response to a screen rotation +- * or some other layout event outside of the Hippy-managed view hierarchy. ++ * or some other layout event outside of the NativeRender-managed view hierarchy. + */ + - (void)setFrame:(CGRect)frame forRootView:(UIView *)view; + +@@ -95,7 +95,7 @@ HIPPY_EXTERN NSString *const HippyUIManagerDidEndBatchNotification; + * Schedule a block to be executed on the UI thread. Useful if you need to execute + * view logic after all currently queued view updates have completed. + */ +-- (void)addUIBlock:(HippyRenderUIBlock)block; ++- (void)addUIBlock:(NativeRenderRenderUIBlock)block; + + /** + * Schedule a block to be executed on the UIManager queue. +@@ -104,7 +104,7 @@ HIPPY_EXTERN NSString *const HippyUIManagerDidEndBatchNotification; + + /** + * In some cases we might want to trigger layout from native side. +- * Hippy won't be aware of this, so we need to make sure it happens. ++ * NativeRender won't be aware of this, so we need to make sure it happens. + */ + - (void)setNeedsLayoutForRootNodeTag:(NSNumber *)tag; + +@@ -118,15 +118,15 @@ HIPPY_EXTERN NSString *const HippyUIManagerDidEndBatchNotification; + onRootTag:(NSNumber *)rootTag; + + /** +- * Manully create views recursively from shadowView ++ * Manully create views recursively from renderObject + * +- * @param shadowView HippyShadowView corresponding to UIView +- * @return view created by HippyShadowView ++ * @param renderObject NativeRenderObjectView corresponding to UIView ++ * @return view created by NativeRenderObjectView + */ +-- (UIView *)createViewRecursivelyFromShadowView:(HippyShadowView *)shadowView; ++- (UIView *)createViewRecursivelyFromRenderObject:(NativeRenderObjectView *)renderObject; + + /** +- * set dom manager for HippyUIManager which holds a weak reference to domManager ++ * set dom manager for NativeRenderUIManager which holds a weak reference to domManager + */ + - (void)setDomManager:(std::weak_ptr)domManager; + +@@ -216,23 +216,6 @@ HIPPY_EXTERN NSString *const HippyUIManagerDidEndBatchNotification; + forDomNodeId:(int32_t)node_id + onRootNode:(std::weak_ptr)rootNode; + +-/** +- * unregister event for specific view. +- * +- * @param name event name +- * @param node_id id of node for the event +- * @discussion this function will handle any event but gesture event, like touch, press, click, longclick, etc... +- */ +-- (void)addRenderEvent:(const std::string &)name forDomNode:(int32_t)node_id; +- +-/** +- * unregister event for specific view +- * +- * @param name event name +- * @param node_id node id for the event +- */ +-- (void)removeRenderEvent:(const std::string &)name forDomNodeId:(int32_t)node_id; +- + /** + * clear all memories + */ +diff --git a/renderer/native/ios/renderer/HippyUIManager.mm b/renderer/native/ios/renderer/NativeRenderUIManager.mm +similarity index 65% +rename from renderer/native/ios/renderer/HippyUIManager.mm +rename to renderer/native/ios/renderer/NativeRenderUIManager.mm +index 23da104fca0..6e1114348ef 100644 +--- a/renderer/native/ios/renderer/HippyUIManager.mm ++++ b/renderer/native/ios/renderer/NativeRenderUIManager.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,30 +20,28 @@ + * limitations under the License. + */ + +-#import ""HippyUIManager.h"" ++#import ""NativeRenderUIManager.h"" + + #import +-#import ""HippyAnimationType.h"" +-#import ""HippyComponent.h"" +-#import ""HippyComponentData.h"" +-#import ""HippyConvert.h"" +-#import ""HippyRootShadowView.h"" +-#import ""HippyShadowView.h"" +-#import ""HippyUtils.h"" +-#import ""HippyView.h"" +-#import ""HippyViewManager.h"" +-#import ""UIView+Hippy.h"" +-#import ""UIView+Private.h"" +-#import ""HippyMemoryOpt.h"" ++#import ""NativeRenderAnimationType.h"" ++#import ""NativeRenderComponentProtocol.h"" ++#import ""NativeRenderComponentData.h"" ++#import ""NativeRenderConvert.h"" ++#import ""NativeRenderObjectRootView.h"" ++#import ""NativeRenderObjectView.h"" ++#import ""NativeRenderUtils.h"" ++#import ""NativeRenderView.h"" ++#import ""NativeRenderViewManager.h"" ++#import ""UIView+NativeRender.h"" + #import ""HippyDeviceBaseInfo.h"" + #import ""OCTypeToDomArgument.h"" +-#import ""UIView+HippyEvent.h"" ++#import ""UIView+DomEvent.h"" + #import ""objc/runtime.h"" + #import ""UIView+Render.h"" +-#import ""RenderErrorHandler.h"" ++#import ""NativeRenderErrorHandler.h"" + #import ""RenderVsyncManager.h"" + #include +-#import ""HippyComponentMap.h"" ++#import ""NativeRenderComponentMap.h"" + #import ""dom/root_node.h"" + + using HippyValue = footstone::value::HippyValue; +@@ -63,7 +61,7 @@ + + constexpr char kVSyncKey[] = ""frameupdate""; + +-@interface HippyViewsRelation : NSObject { ++@interface NativeRenderViewsRelation : NSObject { + HPViewBinding _viewRelation; + + } +@@ -76,7 +74,7 @@ - (void)removeAllObjects; + + @end + +-@implementation HippyViewsRelation ++@implementation NativeRenderViewsRelation + + - (void)addViewTag:(int32_t)viewTag forSuperViewTag:(int32_t)superviewTag atIndex:(int32_t)index { + if (superviewTag) { +@@ -123,43 +121,43 @@ - (void)removeAllObjects { + + @end + +-static void HippyTraverseViewNodes(id view, void (^block)(id)) { ++static void NativeRenderTraverseViewNodes(id view, void (^block)(id)) { + if (view.hippyTag) { + block(view); +- for (id subview in view.hippySubviews) { +- HippyTraverseViewNodes(subview, block); ++ for (id subview in view.hippySubviews) { ++ NativeRenderTraverseViewNodes(subview, block); + } + } + } + +-#define AssertMainQueue() NSAssert(HippyIsMainQueue(), @""This function must be called on the main thread"") ++#define AssertMainQueue() NSAssert(NativeRenderIsMainQueue(), @""This function must be called on the main thread"") + +-const char *HippyUIManagerQueueName = ""com.tencent.hippy.ShadowQueue""; +-NSString *const HippyUIManagerDidRegisterRootViewNotification = @""HippyUIManagerDidRegisterRootViewNotification""; +-NSString *const HippyUIManagerRootViewKey = @""HippyUIManagerRootViewKey""; +-NSString *const HippyUIManagerKey = @""HippyUIManagerKey""; +-NSString *const HippyUIManagerDidEndBatchNotification = @""HippyUIManagerDidEndBatchNotification""; ++const char *NativeRenderUIManagerQueueName = ""com.tencent.hippy.ShadowQueue""; ++NSString *const NativeRenderUIManagerDidRegisterRootViewNotification = @""NativeRenderUIManagerDidRegisterRootViewNotification""; ++NSString *const NativeRenderUIManagerRootViewKey = @""NativeRenderUIManagerRootViewKey""; ++NSString *const NativeRenderUIManagerKey = @""NativeRenderUIManagerKey""; ++NSString *const NativeRenderUIManagerDidEndBatchNotification = @""NativeRenderUIManagerDidEndBatchNotification""; + +-@interface HippyUIManager() { +- NSMutableArray *_pendingUIBlocks; ++@interface NativeRenderUIManager() { ++ NSMutableArray *_pendingUIBlocks; + +- HippyComponentMap *_shadowViewRegistry; +- HippyComponentMap *_viewRegistry; ++ NativeRenderComponentMap *_renderObjectRegistry; ++ NativeRenderComponentMap *_viewRegistry; + + // Keyed by viewName +- NSMutableDictionary *_componentDataByName; ++ NSMutableDictionary *_componentDataByName; + +- NSMutableSet> *_componentTransactionListeners; ++ NSMutableSet> *_componentTransactionListeners; + + std::weak_ptr _domManager; +- std::mutex _shadowQueueLock; ++ std::mutex _renderQueueLock; + NSMutableDictionary *_viewManagers; + NSDictionary *_extraComponent; + } + + @end + +-@implementation HippyUIManager ++@implementation NativeRenderUIManager + + @synthesize frameworkProxy = _frameworkProxy; + @synthesize domManager = _domManager; +@@ -169,10 +167,6 @@ @implementation HippyUIManager + - (instancetype)init { + self = [super init]; + if (self) { +- NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; +- [center addObserver:self selector:@selector(didReceiveMemoryWarning) name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; +- [center addObserver:self selector:@selector(appDidEnterBackground) name:UIApplicationDidEnterBackgroundNotification object:nil]; +- [center addObserver:self selector:@selector(appWillEnterForeground) name:UIApplicationWillEnterForegroundNotification object:nil]; + [self initContext]; + } + return self; +@@ -182,26 +176,18 @@ - (void)dealloc { + } + + - (void)initContext { +- _shadowViewRegistry = [[HippyComponentMap alloc] init]; +- _viewRegistry = [[HippyComponentMap alloc] init]; ++ _renderObjectRegistry = [[NativeRenderComponentMap alloc] init]; ++ _viewRegistry = [[NativeRenderComponentMap alloc] init]; + _pendingUIBlocks = [NSMutableArray new]; + _componentTransactionListeners = [NSMutableSet new]; + _componentDataByName = [NSMutableDictionary dictionaryWithCapacity:64]; + } + +-- (void)didReceiveMemoryWarning { +-} +- +-- (void)appDidEnterBackground { +-} +-- (void)appWillEnterForeground { +-} +- + - (void)invalidate { + _pendingUIBlocks = nil; + __weak __typeof(self) weakSelf = self; + dispatch_async(dispatch_get_main_queue(), ^{ +- HippyUIManager *strongSelf = weakSelf; ++ NativeRenderUIManager *strongSelf = weakSelf; + if (strongSelf) { + strongSelf->_viewRegistry = nil; + strongSelf->_componentTransactionListeners = nil; +@@ -237,16 +223,16 @@ - (void)domNodeForHippyTag:(int32_t)hippyTag + } + } + +-- (HippyComponentMap *)shadowViewRegistry { +- if (!_shadowViewRegistry) { +- _shadowViewRegistry = [[HippyComponentMap alloc] init]; ++- (NativeRenderComponentMap *)renderObjectRegistry { ++ if (!_renderObjectRegistry) { ++ _renderObjectRegistry = [[NativeRenderComponentMap alloc] init]; + } +- return _shadowViewRegistry; ++ return _renderObjectRegistry; + } + +-- (HippyComponentMap *)viewRegistry { ++- (NativeRenderComponentMap *)viewRegistry { + if (!_viewRegistry) { +- _viewRegistry = [[HippyComponentMap alloc] init]; ++ _viewRegistry = [[NativeRenderComponentMap alloc] init]; + } + return _viewRegistry; + } +@@ -262,24 +248,24 @@ - (UIView *)viewForHippyTag:(NSNumber *)hippyTag + return [_viewRegistry componentForTag:hippyTag onRootTag:rootTag]; + } + +-- (HippyShadowView *)shadowViewForHippyTag:(NSNumber *)hippyTag +- onRootTag:(NSNumber *)rootTag { +- return [_shadowViewRegistry componentForTag:hippyTag onRootTag:rootTag]; ++- (NativeRenderObjectView *)renderObjectForHippyTag:(NSNumber *)hippyTag ++ onRootTag:(NSNumber *)rootTag { ++ return [_renderObjectRegistry componentForTag:hippyTag onRootTag:rootTag]; + } + +-- (std::mutex &)shadowQueueLock { +- return _shadowQueueLock; ++- (std::mutex &)renderQueueLock { ++ return _renderQueueLock; + } + +-dispatch_queue_t HippyGetUIManagerQueue(void) { ++dispatch_queue_t NativeRenderGetUIManagerQueue(void) { + static dispatch_queue_t shadowQueue; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + if ([NSOperation instancesRespondToSelector:@selector(qualityOfService)]) { + dispatch_queue_attr_t attr = dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, QOS_CLASS_USER_INTERACTIVE, 0); +- shadowQueue = dispatch_queue_create(HippyUIManagerQueueName, attr); ++ shadowQueue = dispatch_queue_create(NativeRenderUIManagerQueueName, attr); + } else { +- shadowQueue = dispatch_queue_create(HippyUIManagerQueueName, DISPATCH_QUEUE_SERIAL); ++ shadowQueue = dispatch_queue_create(NativeRenderUIManagerQueueName, DISPATCH_QUEUE_SERIAL); + dispatch_set_target_queue(shadowQueue, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0)); + } + }); +@@ -287,18 +273,18 @@ dispatch_queue_t HippyGetUIManagerQueue(void) { + } + + - (dispatch_queue_t)methodQueue { +- return HippyGetUIManagerQueue(); ++ return NativeRenderGetUIManagerQueue(); + } + #pragma mark - + #pragma mark View Manager +-- (HippyComponentData *)componentDataForViewName:(NSString *)viewName { ++- (NativeRenderComponentData *)componentDataForViewName:(NSString *)viewName { + if (viewName) { +- HippyComponentData *componentData = _componentDataByName[viewName]; ++ NativeRenderComponentData *componentData = _componentDataByName[viewName]; + if (!componentData) { +- HippyViewManager *viewManager = [self renderViewManagerForViewName:viewName]; ++ NativeRenderViewManager *viewManager = [self renderViewManagerForViewName:viewName]; + NSAssert(viewManager, @""No view manager found for %@"", viewName); + if (viewManager) { +- componentData = [[HippyComponentData alloc] initWithViewManager:viewManager viewName:viewName]; ++ componentData = [[NativeRenderComponentData alloc] initWithViewManager:viewManager viewName:viewName]; + _componentDataByName[viewName] = componentData; + } + } +@@ -311,9 +297,9 @@ - (void)registerRootView:(UIView *)rootView asRootNode:(std::weak_ptr) + AssertMainQueue(); + + NSNumber *hippyTag = rootView.hippyTag; +- NSAssert(HippyIsHippyRootView(hippyTag), @""View %@ with tag #%@ is not a root view"", rootView, hippyTag); ++ NSAssert(NativeRenderIsHippyRootView(hippyTag), @""View %@ with tag #%@ is not a root view"", rootView, hippyTag); + +-#if HIPPY_DEBUG ++#if NATIVE_RENDER_DEBUG + NSAssert(![_viewRegistry containRootComponentWithTag:hippyTag], @""RootView Tag already exists. Added %@ twice"", hippyTag); + #endif + // Register view +@@ -323,24 +309,24 @@ - (void)registerRootView:(UIView *)rootView asRootNode:(std::weak_ptr) + + UIColor *backgroundColor = [rootView backgroundColor]; + // Register shadow view +- __weak HippyUIManager *weakSelf = self; ++ __weak NativeRenderUIManager *weakSelf = self; + __weak id vr = _viewRegistry; +- dispatch_async(HippyGetUIManagerQueue(), ^{ ++ dispatch_async(NativeRenderGetUIManagerQueue(), ^{ + if (!vr && !weakSelf) { + return; + } +- __strong HippyUIManager *strongSelf = weakSelf; +- std::lock_guard lock([self shadowQueueLock]); +- HippyRootShadowView *shadowView = [HippyRootShadowView new]; +- shadowView.hippyTag = hippyTag; +- shadowView.frame = frame; +- shadowView.backgroundColor = backgroundColor; +- shadowView.viewName = NSStringFromClass([rootView class]); +- [strongSelf->_shadowViewRegistry addRootComponent:shadowView rootNode:rootNode forTag:hippyTag]; ++ __strong NativeRenderUIManager *strongSelf = weakSelf; ++ std::lock_guard lock([self renderQueueLock]); ++ NativeRenderObjectRootView *renderObject = [[NativeRenderObjectRootView alloc] init]; ++ renderObject.hippyTag = hippyTag; ++ renderObject.frame = frame; ++ renderObject.backgroundColor = backgroundColor; ++ renderObject.viewName = NSStringFromClass([rootView class]); ++ [strongSelf->_renderObjectRegistry addRootComponent:renderObject rootNode:rootNode forTag:hippyTag]; + }); + +- [[NSNotificationCenter defaultCenter] postNotificationName:HippyUIManagerDidRegisterRootViewNotification object:self +- userInfo:@{ HippyUIManagerRootViewKey: rootView, HippyUIManagerKey: self}]; ++ [[NSNotificationCenter defaultCenter] postNotificationName:NativeRenderUIManagerDidRegisterRootViewNotification object:self ++ userInfo:@{ NativeRenderUIManagerRootViewKey: rootView, NativeRenderUIManagerKey: self}]; + } + + +@@ -356,14 +342,14 @@ - (void)setFrame:(CGRect)frame forRootView:(UIView *)view { + if (!weakSelf) { + return; + } +- HippyUIManager *strongSelf = weakSelf; +- HippyShadowView *shadowView = [strongSelf->_shadowViewRegistry rootComponentForTag:hippyTag]; +- if (shadowView == nil) { ++ NativeRenderUIManager *strongSelf = weakSelf; ++ NativeRenderObjectView *renderObject = [strongSelf->_renderObjectRegistry rootComponentForTag:hippyTag]; ++ if (renderObject == nil) { + return; + } +- if (!CGRectEqualToRect(frame, shadowView.frame)) { +- shadowView.frame = frame; +- std::weak_ptr rootNode = [strongSelf->_shadowViewRegistry rootNodeForTag:hippyTag]; ++ if (!CGRectEqualToRect(frame, renderObject.frame)) { ++ renderObject.frame = frame; ++ std::weak_ptr rootNode = [strongSelf->_renderObjectRegistry rootNodeForTag:hippyTag]; + [strongSelf batchOnRootNode:rootNode]; + } + }}; +@@ -373,18 +359,18 @@ - (void)setFrame:(CGRect)frame forRootView:(UIView *)view { + /** + * Unregisters views from registries + */ +-- (void)purgeChildren:(NSArray> *)children ++- (void)purgeChildren:(NSArray> *)children + onRootTag:(NSNumber *)rootTag +- fromRegistry:(HippyComponentMap *)componentMap { +- NSMutableDictionary> *registry = [componentMap componentsForRootTag:rootTag]; +- for (id child in children) { +- HippyTraverseViewNodes(registry[child.hippyTag], ^(id subview) { ++ fromRegistry:(NativeRenderComponentMap *)componentMap { ++ NSMutableDictionary> *registry = [componentMap componentsForRootTag:rootTag]; ++ for (id child in children) { ++ NativeRenderTraverseViewNodes(registry[child.hippyTag], ^(id subview) { + NSAssert(![subview isHippyRootView], @""Root views should not be unregistered""); +- if ([subview conformsToProtocol:@protocol(HippyInvalidating)]) { +- [(id)subview invalidate]; ++ if ([subview conformsToProtocol:@protocol(NativeRenderInvalidating)]) { ++ [(id)subview invalidate]; + } + [registry removeObjectForKey:subview.hippyTag]; +- if (registry == (NSMutableDictionary> *)self->_viewRegistry) { ++ if (registry == (NSMutableDictionary> *)self->_viewRegistry) { + [self->_componentTransactionListeners removeObject:subview]; + } + }); +@@ -394,88 +380,94 @@ - (void)purgeChildren:(NSArray> *)children + - (void)purgeViewsFromHippyTags:(NSArray *)hippyTags onRootTag:(NSNumber *)rootTag { + for (NSNumber *hippyTag in hippyTags) { + UIView *view = [self viewForHippyTag:hippyTag onRootTag:rootTag]; +- HippyComponentMap *componentMap = _viewRegistry; +- HippyTraverseViewNodes(view, ^(id subview) { ++ NativeRenderComponentMap *componentMap = _viewRegistry; ++ NativeRenderTraverseViewNodes(view, ^(id subview) { + NSAssert(![subview isHippyRootView], @""Root views should not be unregistered""); + [componentMap removeComponent:subview forRootTag:rootTag]; + }); + } + } + +-- (void)purgeChildren:(NSArray> *)children fromRegistry:(NSMutableDictionary> *)registry { +- for (id child in children) { +- HippyTraverseViewNodes(registry[child.hippyTag], ^(id subview) { ++- (void)purgeChildren:(NSArray> *)children fromRegistry:(NSMutableDictionary> *)registry { ++ for (id child in children) { ++ NativeRenderTraverseViewNodes(registry[child.hippyTag], ^(id subview) { + NSAssert(![subview isHippyRootView], @""Root views should not be unregistered""); +- if ([subview conformsToProtocol:@protocol(HippyInvalidating)]) { +- //TODO HippyInvalidating belong to hippy, remove it +- [(id)subview invalidate]; ++ if ([subview conformsToProtocol:@protocol(NativeRenderInvalidating)]) { ++ //TODO NativeRenderInvalidating belong to hippy, remove it ++ [(id)subview invalidate]; + } + [registry removeObjectForKey:subview.hippyTag]; +- if (registry == (NSMutableDictionary> *)self->_viewRegistry) { ++ if (registry == (NSMutableDictionary> *)self->_viewRegistry) { + [self->_componentTransactionListeners removeObject:subview]; + } + }); + } + } + +-- (void)removeChildren:(NSArray> *)children fromContainer:(id)container { +- for (id removedChild in children) { ++- (void)removeChildren:(NSArray> *)children fromContainer:(id)container { ++ for (id removedChild in children) { + [container removeHippySubview:removedChild]; + } + } + + - (UIView *)createViewRecursivelyFromHippyTag:(NSNumber *)hippyTag + onRootTag:(NSNumber *)rootTag { +- HippyShadowView *shadowView = [_shadowViewRegistry componentForTag:hippyTag onRootTag:rootTag]; +- return [self createViewRecursivelyFromShadowView:shadowView]; ++ NativeRenderObjectView *renderObject = [_renderObjectRegistry componentForTag:hippyTag onRootTag:rootTag]; ++ return [self createViewRecursivelyFromRenderObject:renderObject]; + } + +-- (UIView *)createViewFromShadowView:(HippyShadowView *)shadowView { ++- (UIView *)createViewFromRenderObject:(NativeRenderObjectView *)renderObject { + AssertMainQueue(); +- HippyComponentData *componentData = [self componentDataForViewName:shadowView.viewName]; +- UIView *view = [self createViewByComponentData:componentData hippyTag:shadowView.hippyTag rootTag:shadowView.rootTag properties:shadowView.props viewName:shadowView.viewName]; ++ NativeRenderComponentData *componentData = [self componentDataForViewName:renderObject.viewName]; ++ UIView *view = [self createViewByComponentData:componentData ++ hippyTag:renderObject.hippyTag ++ rootTag:renderObject.rootTag ++ properties:renderObject.props ++ viewName:renderObject.viewName]; + view.renderContext = self; +- [view hippySetFrame:shadowView.frame]; +- const std::vector &eventNames = [shadowView allEventNames]; ++ [view hippySetFrame:renderObject.frame]; ++ const std::vector &eventNames = [renderObject allEventNames]; + for (auto &event : eventNames) { +- [self addEventNameInMainThread:event forDomNodeId:[shadowView.hippyTag intValue] onRootNode:shadowView.rootNode]; ++ [self addEventNameInMainThread:event ++ forDomNodeId:[renderObject.hippyTag intValue] ++ onRootNode:renderObject.rootNode]; + } + return view; + } + +-- (UIView *)createViewRecursivelyFromShadowView:(HippyShadowView *)shadowView { ++- (UIView *)createViewRecursivelyFromRenderObject:(NativeRenderObjectView *)renderObject { + AssertMainQueue(); +- std::lock_guard lock([self shadowQueueLock]); +- [shadowView dirtyDescendantPropagation]; +- return [self createViewRecursiveFromShadowViewWithNOLock:shadowView]; ++ std::lock_guard lock([self renderQueueLock]); ++ [renderObject dirtyDescendantPropagation]; ++ return [self createViewRecursiveFromRenderObjectWithNOLock:renderObject]; + } + +-- (UIView *)createViewRecursiveFromShadowViewWithNOLock:(HippyShadowView *)shadowView { +- UIView *view = [self createViewFromShadowView:shadowView]; ++- (UIView *)createViewRecursiveFromRenderObjectWithNOLock:(NativeRenderObjectView *)renderObject { ++ UIView *view = [self createViewFromRenderObject:renderObject]; + NSUInteger index = 0; +- for (HippyShadowView *subShadowView in shadowView.hippySubviews) { +- UIView *subview = [self createViewRecursiveFromShadowViewWithNOLock:subShadowView]; ++ for (NativeRenderObjectView *subRenderObject in renderObject.hippySubviews) { ++ UIView *subview = [self createViewRecursiveFromRenderObjectWithNOLock:subRenderObject]; + [view insertHippySubview:subview atIndex:index]; + index++; + } +- view.hippyShadowView = shadowView; ++ view.nativeRenderObjectView = renderObject; + view.renderContext = self; + [view clearSortedSubviews]; + [view didUpdateHippySubviews]; +- NSMutableSet *applierBlocks = [NSMutableSet setWithCapacity:1]; +- [shadowView collectUpdatedProperties:applierBlocks parentProperties:@{}]; ++ NSMutableSet *applierBlocks = [NSMutableSet setWithCapacity:1]; ++ [renderObject collectUpdatedProperties:applierBlocks parentProperties:@{}]; + if (applierBlocks.count) { + NSDictionary *viewRegistry = +- [_viewRegistry componentsForRootTag:shadowView.rootTag]; +- for (HippyApplierBlock block in applierBlocks) { ++ [_viewRegistry componentsForRootTag:renderObject.rootTag]; ++ for (NativeRenderApplierBlock block in applierBlocks) { + block(viewRegistry); + } + } + return view; + } + +-- (NSDictionary *)createShadowViewFromNode:(const std::shared_ptr &)domNode +- onRootNode:(std::weak_ptr)rootNode { ++- (NSDictionary *)createRenderObjectFromNode:(const std::shared_ptr &)domNode ++ onRootNode:(std::weak_ptr)rootNode { + auto strongRootNode = rootNode.lock(); + if (!strongRootNode || !domNode) { + return @{}; +@@ -486,28 +478,28 @@ - (NSDictionary *)createShadowViewFromNode:(const std::shared_ptrGetViewName().c_str()]; + NSString *tagName = [NSString stringWithUTF8String:domNode->GetTagName().c_str()]; + NSMutableDictionary *props = [stylesFromDomNode(domNode) mutableCopy]; +- HippyComponentData *componentData = [self componentDataForViewName:viewName]; +- HippyShadowView *shadowView = [componentData createShadowViewWithTag:hippyTag]; +- shadowView.rootNode = rootNode; +- NSAssert(componentData && shadowView, @""componentData and shadowView must not be nil""); ++ NativeRenderComponentData *componentData = [self componentDataForViewName:viewName]; ++ NativeRenderObjectView *renderObject = [componentData createRenderObjectViewWithTag:hippyTag]; ++ renderObject.rootNode = rootNode; ++ NSAssert(componentData && renderObject, @""componentData and renderObject must not be nil""); + [props setValue: rootTag forKey: @""rootTag""]; + // Register shadow view +- if (shadowView) { +- shadowView.hippyTag = hippyTag; +- shadowView.rootTag = rootTag; +- shadowView.viewName = viewName; +- shadowView.tagName = tagName; +- shadowView.props = props; +- shadowView.domManager = _domManager; +- shadowView.nodeLayoutResult = domNode->GetLayoutResult(); +- shadowView.frame = CGRectMakeFromLayoutResult(domNode->GetLayoutResult()); +- [componentData setProps:props forShadowView:shadowView]; +- [_shadowViewRegistry addComponent:shadowView forRootTag:rootTag]; ++ if (renderObject) { ++ renderObject.hippyTag = hippyTag; ++ renderObject.rootTag = rootTag; ++ renderObject.viewName = viewName; ++ renderObject.tagName = tagName; ++ renderObject.props = props; ++ renderObject.domManager = _domManager; ++ renderObject.nodeLayoutResult = domNode->GetLayoutResult(); ++ renderObject.frame = CGRectMakeFromLayoutResult(domNode->GetLayoutResult()); ++ [componentData setProps:props forRenderObjectView:renderObject]; ++ [_renderObjectRegistry addComponent:renderObject forRootTag:rootTag]; + } + return props; + } + +-- (UIView *)createViewByComponentData:(HippyComponentData *)componentData ++- (UIView *)createViewByComponentData:(NativeRenderComponentData *)componentData + hippyTag:(NSNumber *)hippyTag + rootTag:(NSNumber *)rootTag + properties:(NSDictionary *)props +@@ -545,20 +537,20 @@ - (UIView *)createViewByComponentData:(HippyComponentData *)componentData + - (void)updateView:(nonnull NSNumber *)hippyTag + onRootTag:(NSNumber *)rootTag + props:(NSDictionary *)props { +- HippyShadowView *shadowView = [_shadowViewRegistry componentForTag:hippyTag onRootTag:rootTag]; +- if (!shadowView) { ++ NativeRenderObjectView *renderObject = [_renderObjectRegistry componentForTag:hippyTag onRootTag:rootTag]; ++ if (!renderObject) { + return; + } +- HippyComponentData *componentData = [self componentDataForViewName:shadowView.viewName]; ++ NativeRenderComponentData *componentData = [self componentDataForViewName:renderObject.viewName]; + NSDictionary *newProps = props; + NSDictionary *virtualProps = props; +- if (shadowView) { +- newProps = [shadowView mergeProps: props]; +- virtualProps = shadowView.props; +- [componentData setProps:newProps forShadowView:shadowView]; +- [shadowView dirtyPropagation]; ++ if (renderObject) { ++ newProps = [renderObject mergeProps: props]; ++ virtualProps = renderObject.props; ++ [componentData setProps:newProps forRenderObjectView:renderObject]; ++ [renderObject dirtyPropagation]; + } +- [self addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { ++ [self addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { + UIView *view = viewRegistry[hippyTag]; + [componentData setProps:newProps forView:view]; + }]; +@@ -566,27 +558,27 @@ - (void)updateView:(nonnull NSNumber *)hippyTag + + #pragma mark Render Context Implementation + #define Init(Component) NSClassFromString(@#Component) +-- (__kindof HippyViewManager *)renderViewManagerForViewName:(NSString *)viewName { ++- (__kindof NativeRenderViewManager *)renderViewManagerForViewName:(NSString *)viewName { + if (!_viewManagers) { +- _viewManagers = [@{@""View"": Init(HippyViewManager), +- @""WaterfallItem"": Init(HippyWaterfallItemViewManager), +- @""WaterfallView"": Init(HippyWaterfallViewManager), +- @""PullFooterView"": Init(HippyFooterRefreshManager), +- @""PullHeaderView"": Init(HippyHeaderRefreshManager), +- @""ScrollView"": Init(HippyScrollViewManager), +- @""RefreshWrapperItemView"": Init(HippyRefreshWrapperItemViewManager), +- @""RefreshWrapper"": Init(HippyRefreshWrapperViewManager), +- @""ViewPager"": Init(HippyViewPagerManager), +- @""ViewPagerItem"": Init(HippyViewPagerItemManager), +- @""TextInput"": Init(HippyTextViewManager), +- @""WebView"": Init(HippySimpleWebViewManager), +- @""Image"": Init(HippyImageViewManager), +- @""ListViewItem"": Init(HippyBaseListItemViewManager), +- @""ListView"": Init(HippyBaseListViewManager), +- @""SmartViewPager"": Init(HippySmartViewPagerViewManager), +- @""Navigator"": Init(HippyNavigatorViewManager), +- @""Text"": Init(HippyTextManager), +- @""Modal"": Init(HippyModalHostViewManager) ++ _viewManagers = [@{@""View"": Init(NativeRenderViewManager), ++ @""WaterfallItem"": Init(NativeRenderWaterfallItemViewManager), ++ @""WaterfallView"": Init(NativeRenderWaterfallViewManager), ++ @""PullFooterView"": Init(NativeRenderFooterRefreshManager), ++ @""PullHeaderView"": Init(NativeRenderHeaderRefreshManager), ++ @""ScrollView"": Init(NativeRenderScrollViewManager), ++ @""RefreshWrapperItemView"": Init(NativeRenderRefreshWrapperItemViewManager), ++ @""RefreshWrapper"": Init(NativeRenderRefreshWrapperViewManager), ++ @""ViewPager"": Init(NativeRenderViewPagerManager), ++ @""ViewPagerItem"": Init(NativeRenderViewPagerItemManager), ++ @""TextInput"": Init(NativeRenderTextViewManager), ++ @""WebView"": Init(NativeRenderSimpleWebViewManager), ++ @""Image"": Init(NativeRenderImageViewManager), ++ @""ListViewItem"": Init(NativeRenderBaseListItemViewManager), ++ @""ListView"": Init(NativeRenderBaseListViewManager), ++ @""SmartViewPager"": Init(NativeRenderSmartViewPagerViewManager), ++ @""Navigator"": Init(NativeRenderNavigatorViewManager), ++ @""Text"": Init(NativeRenderTextManager), ++ @""Modal"": Init(NativeRenderModalHostViewManager) + } mutableCopy]; + if (_extraComponent) { + [_viewManagers addEntriesFromDictionary:_extraComponent]; +@@ -595,9 +587,9 @@ - (__kindof HippyViewManager *)renderViewManagerForViewName:(NSString *)viewName + } + id object = [_viewManagers objectForKey:viewName]; + if (object_isClass(object)) { +- HippyViewManager *viewManager = [object new]; ++ NativeRenderViewManager *viewManager = [object new]; + viewManager.renderContext = self; +- NSAssert([viewManager isKindOfClass:[HippyViewManager class]], @""It must be a HippyViewManager instance""); ++ NSAssert([viewManager isKindOfClass:[NativeRenderViewManager class]], @""It must be a NativeRenderViewManager instance""); + [_viewManagers setObject:viewManager forKey:viewName]; + object = viewManager; + } +@@ -606,7 +598,7 @@ - (__kindof HippyViewManager *)renderViewManagerForViewName:(NSString *)viewName + + #pragma mark Schedule Block + +-- (void)addUIBlock:(HippyRenderUIBlock)block { ++- (void)addUIBlock:(NativeRenderRenderUIBlock)block { + if (!block || !_viewRegistry) { + return; + } +@@ -619,20 +611,20 @@ - (void)executeBlockOnRenderQueue:(dispatch_block_t)block { + } + + - (void)executeBlockOnUIManagerQueue:(dispatch_block_t)block { +- dispatch_async(HippyGetUIManagerQueue(), ^{ ++ dispatch_async(NativeRenderGetUIManagerQueue(), ^{ + if (block) { + block(); + } + }); + } + +-- (void)amendPendingUIBlocksWithStylePropagationUpdateForShadowView:(HippyShadowView *)topView { +- NSMutableSet *applierBlocks = [NSMutableSet setWithCapacity:1]; ++- (void)amendPendingUIBlocksWithStylePropagationUpdateForRenderObject:(NativeRenderObjectView *)topView { ++ NSMutableSet *applierBlocks = [NSMutableSet setWithCapacity:1]; + + [topView collectUpdatedProperties:applierBlocks parentProperties:@{}]; + if (applierBlocks.count) { +- [self addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { +- for (HippyApplierBlock block in applierBlocks) { ++ [self addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { ++ for (NativeRenderApplierBlock block in applierBlocks) { + block(viewRegistry); + } + }]; +@@ -648,18 +640,18 @@ - (void)flushUIBlocksOnRootNode:(std::weak_ptr)rootNode { + return; + } + int32_t rootTag = strongRootNode->GetId(); +- NSArray *previousPendingUIBlocks = _pendingUIBlocks; ++ NSArray *previousPendingUIBlocks = _pendingUIBlocks; + _pendingUIBlocks = [NSMutableArray new]; +- __weak HippyUIManager *weakManager = self; ++ __weak NativeRenderUIManager *weakManager = self; + if (previousPendingUIBlocks.count) { + // Execute the previously queued UI blocks + dispatch_async(dispatch_get_main_queue(), ^{ + if (weakManager) { +- HippyUIManager *strongSelf = weakManager; ++ NativeRenderUIManager *strongSelf = weakManager; + NSDictionary *viewReg = + [strongSelf->_viewRegistry componentsForRootTag:@(rootTag)]; + @try { +- for (HippyRenderUIBlock block in previousPendingUIBlocks) { ++ for (NativeRenderRenderUIBlock block in previousPendingUIBlocks) { + block(strongSelf, viewReg); + } + } @catch (NSException *exception) { +@@ -673,7 +665,7 @@ - (void)flushUIBlocksOnRootNode:(std::weak_ptr)rootNode { + #pragma mark View Render Manager + + /** +- * When HippyUIManager received command to create view by node, HippyUIManager must get all new created view ordered by index, set frames, ++ * When NativeRenderUIManager received command to create view by node, NativeRenderUIManager must get all new created view ordered by index, set frames, + * then insert them into superview one by one. + * Step: + * 1.create shadow views; +@@ -688,34 +680,34 @@ - (void)createRenderNodes:(std::vector> &&)nodes + return; + } + NSNumber *rootNodeTag = @(strongRootNode->GetId()); +- std::lock_guard lock([self shadowQueueLock]); +- HippyViewsRelation *manager = [[HippyViewsRelation alloc] init]; ++ std::lock_guard lock([self renderQueueLock]); ++ NativeRenderViewsRelation *manager = [[NativeRenderViewsRelation alloc] init]; + NSMutableDictionary *dicProps = [NSMutableDictionary dictionaryWithCapacity:nodes.size()]; + for (const std::shared_ptr &node : nodes) { + const auto& render_info = node->GetRenderInfo(); + [manager addViewTag:render_info.id forSuperViewTag:render_info.pid atIndex:render_info.index]; +- NSDictionary *nodeProps = [self createShadowViewFromNode:node onRootNode:rootNode]; ++ NSDictionary *nodeProps = [self createRenderObjectFromNode:node onRootNode:rootNode]; + [dicProps setObject:nodeProps forKey:@(node->GetId())]; + } + [manager enumerateViewsHierarchy:^(int32_t tag, const std::vector &subviewTags, const std::vector &subviewIndices) { + NSAssert(subviewTags.size() == subviewIndices.size(), @""subviewTags count must be equal to subviewIndices count""); +- HippyShadowView *superShadowView = [self->_shadowViewRegistry componentForTag:@(tag) onRootTag:rootNodeTag]; ++ NativeRenderObjectView *superRenderObject = [self->_renderObjectRegistry componentForTag:@(tag) onRootTag:rootNodeTag]; + for (NSUInteger index = 0; index < subviewTags.size(); index++) { +- HippyShadowView *subShadowView = [self->_shadowViewRegistry componentForTag:@(subviewTags[index]) onRootTag:rootNodeTag]; +- [superShadowView insertHippySubview:subShadowView atIndex:subviewIndices[index]]; ++ NativeRenderObjectView *subRenderObject = [self->_renderObjectRegistry componentForTag:@(subviewTags[index]) onRootTag:rootNodeTag]; ++ [superRenderObject insertHippySubview:subRenderObject atIndex:subviewIndices[index]]; + } + }]; + for (const std::shared_ptr &node : nodes) { + NSNumber *hippyTag = @(node->GetId()); +- HippyShadowView *shadowView = [_shadowViewRegistry componentForTag:hippyTag onRootTag:rootNodeTag]; +- if (HippyCreationTypeInstantly == [shadowView creationType] && !_uiCreationLazilyEnabled) { ++ NativeRenderObjectView *renderObject = [_renderObjectRegistry componentForTag:hippyTag onRootTag:rootNodeTag]; ++ if (NativeRenderCreationTypeInstantly == [renderObject creationType] && !_uiCreationLazilyEnabled) { + NSString *viewName = [NSString stringWithUTF8String:node->GetViewName().c_str()]; + NSDictionary *props = [dicProps objectForKey:@(node->GetId())]; +- HippyComponentData *componentData = [self componentDataForViewName:viewName]; +- [self addUIBlock:^(id renderContext, __unused NSDictionary *viewRegistry) { +- HippyUIManager *uiManager = (HippyUIManager *)renderContext; ++ NativeRenderComponentData *componentData = [self componentDataForViewName:viewName]; ++ [self addUIBlock:^(id renderContext, __unused NSDictionary *viewRegistry) { ++ NativeRenderUIManager *uiManager = (NativeRenderUIManager *)renderContext; + UIView *view = [uiManager createViewByComponentData:componentData hippyTag:hippyTag rootTag:rootNodeTag properties:props viewName:viewName]; +- view.hippyShadowView = shadowView; ++ view.nativeRenderObjectView = renderObject; + view.renderContext = renderContext; + }]; + } +@@ -723,9 +715,9 @@ - (void)createRenderNodes:(std::vector> &&)nodes + [manager enumerateViewsHierarchy:^(int32_t tag, const std::vector &subviewTags, const std::vector &subviewIndices) { + auto subViewTags_ = subviewTags; + auto subViewIndices_ = subviewIndices; +- HippyShadowView *shadowView = [self->_shadowViewRegistry componentForTag:@(tag) onRootTag:rootNodeTag]; +- if (HippyCreationTypeInstantly == [shadowView creationType] && !self->_uiCreationLazilyEnabled) { +- [self addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderObjectView *renderObject = [self->_renderObjectRegistry componentForTag:@(tag) onRootTag:rootNodeTag]; ++ if (NativeRenderCreationTypeInstantly == [renderObject creationType] && !self->_uiCreationLazilyEnabled) { ++ [self addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { + UIView *superView = viewRegistry[@(tag)]; + for (NSUInteger index = 0; index < subViewTags_.size(); index++) { + UIView *subview = viewRegistry[@(subViewTags_[index])]; +@@ -743,7 +735,7 @@ - (void)updateRenderNodes:(std::vector>&&)nodes + if (!strongRootNode) { + return; + } +- std::lock_guard lock([self shadowQueueLock]); ++ std::lock_guard lock([self renderQueueLock]); + NSNumber *rootTag = @(strongRootNode->GetId()); + for (const auto &node : nodes) { + NSNumber *hippyTag = @(node->GetRenderInfo().id); +@@ -761,17 +753,17 @@ - (void)deleteRenderNodesIds:(std::vector> &&)no + if (!strongRootNode) { + return; + } +- std::lock_guard lock([self shadowQueueLock]); ++ std::lock_guard lock([self renderQueueLock]); + NSNumber *rootTag = @(strongRootNode->GetId()); + for (auto dom_node : nodes) { + int32_t tag = dom_node->GetRenderInfo().id; +- HippyShadowView *shadowView = [_shadowViewRegistry componentForTag:@(tag) onRootTag:rootTag]; +- if (shadowView) { +- [shadowView removeFromHippySuperview]; +- [self purgeChildren:@[shadowView] onRootTag:rootTag fromRegistry:_shadowViewRegistry]; ++ NativeRenderObjectView *renderObject = [_renderObjectRegistry componentForTag:@(tag) onRootTag:rootTag]; ++ if (renderObject) { ++ [renderObject removeFromHippySuperview]; ++ [self purgeChildren:@[renderObject] onRootTag:rootTag fromRegistry:_renderObjectRegistry]; + } + __weak auto weakSelf = self; +- [self addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { ++ [self addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { + UIView *view = viewRegistry[@(tag)]; + if (view) { + [view removeFromHippySuperview]; +@@ -797,24 +789,24 @@ - (void)updateNodesLayout:(const std::vector lock([self shadowQueueLock]); ++ std::lock_guard lock([self renderQueueLock]); + NSNumber *rootTag = @(strongRootNode->GetId()); + for (auto &layoutInfoTuple : layoutInfos) { + int32_t tag = std::get<0>(layoutInfoTuple); + NSNumber *hippyTag = @(tag); + hippy::LayoutResult layoutResult = std::get<1>(layoutInfoTuple); + CGRect frame = CGRectMakeFromLayoutResult(layoutResult); +- HippyShadowView *shadowView = [_shadowViewRegistry componentForTag:hippyTag onRootTag:rootTag]; +- if (shadowView) { +- shadowView.frame = frame; +- [self addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderObjectView *renderObject = [_renderObjectRegistry componentForTag:hippyTag onRootTag:rootTag]; ++ if (renderObject) { ++ renderObject.frame = frame; ++ [self addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { + UIView *view = viewRegistry[hippyTag]; + /* do not use frame directly, because shadow view's frame possibly changed manually in +- * [HippyShadowView collectShadowViewsHaveNewLayoutResults] ++ * [NativeRenderObjectView collectRenderObjectHaveNewLayoutResults] + * This is a Wrong example: + * [view hippySetFrame:frame] + */ +- [view hippySetFrame:shadowView.frame]; ++ [view hippySetFrame:renderObject.frame]; + }]; + } + } +@@ -822,7 +814,7 @@ - (void)updateNodesLayout:(const std::vector)rootNode { + [self layoutAndMountOnRootNode:rootNode]; +- [[NSNotificationCenter defaultCenter] postNotificationName:HippyUIManagerDidEndBatchNotification ++ [[NSNotificationCenter defaultCenter] postNotificationName:NativeRenderUIManagerDidEndBatchNotification + object:self]; + } + +@@ -862,8 +854,8 @@ - (id)dispatchFunction:(const std::string &)functionName + } + NSString *nativeModuleName = [NSString stringWithUTF8String:viewName.c_str()]; + +- HippyViewManager *viewManager = [self renderViewManagerForViewName:nativeModuleName]; +- HippyComponentData *componentData = [self componentDataForViewName:nativeModuleName]; ++ NativeRenderViewManager *viewManager = [self renderViewManagerForViewName:nativeModuleName]; ++ NativeRenderComponentData *componentData = [self componentDataForViewName:nativeModuleName]; + NSValue *selectorPointer = [componentData.methodsByName objectForKey:name]; + SEL selector = (SEL)[selectorPointer pointerValue]; + if (!selector) { +@@ -887,8 +879,8 @@ - (id)dispatchFunction:(const std::string &)functionName + return nil; + } @catch (NSException *exception) { + NSString *message = [NSString stringWithFormat:@""Exception '%@' was thrown while invoking %@ on component target %@ with params %@"", exception, name, nativeModuleName, finalParams]; +- NSError *error = HippyErrorWithMessage(message); +- RenderFatal(error); ++ NSError *error = NativeRenderErrorWithMessage(message); ++ NativeRenderFatal(error); + return nil; + } + } +@@ -900,43 +892,42 @@ - (void)registerExtraComponent:(NSDictionary *)extraComponent + #pragma mark - + #pragma mark Event Handler + +-- (void)addEventName:(const std::string &)name +- forDomNodeId:(int32_t)node_id ++- (void)addEventName:(const std::string &)name forDomNodeId:(int32_t)node_id + onRootNode:(std::weak_ptr)rootNode { + auto strongRootNode = rootNode.lock(); + if (!strongRootNode) { + return; + } + int32_t root_id = strongRootNode->GetId(); +- HippyShadowView *shadowView = [self shadowViewForHippyTag:@(node_id) onRootTag:@(root_id)]; +- [shadowView addEventName:name]; ++ NativeRenderObjectView *renderObject = [self renderObjectForHippyTag:@(node_id) onRootTag:@(root_id)]; ++ [renderObject addEventName:name]; + if (name == hippy::kClickEvent) { +- [self addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { +- HippyUIManager *uiManager = (HippyUIManager *)renderContext; ++ [self addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderUIManager *uiManager = (NativeRenderUIManager *)renderContext; + [uiManager addClickEventListenerForView:node_id onRootNode:rootNode]; + }]; + } else if (name == hippy::kLongClickEvent) { +- [self addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { +- HippyUIManager *uiManager = (HippyUIManager *)renderContext; ++ [self addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderUIManager *uiManager = (NativeRenderUIManager *)renderContext; + [uiManager addLongClickEventListenerForView:node_id onRootNode:rootNode]; + }]; + } else if (name == hippy::kTouchStartEvent || name == hippy::kTouchMoveEvent + || name == hippy::kTouchEndEvent || name == hippy::kTouchCancelEvent) { + std::string name_ = name; +- [self addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { +- HippyUIManager *uiManager = (HippyUIManager *)renderContext; ++ [self addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderUIManager *uiManager = (NativeRenderUIManager *)renderContext; + [uiManager addTouchEventListenerForType:name_ forView:node_id onRootNode:rootNode]; + }]; + } else if (name == hippy::kShowEvent || name == hippy::kDismissEvent) { + std::string name_ = name; +- [self addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { +- HippyUIManager *uiManager = (HippyUIManager *)renderContext; ++ [self addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderUIManager *uiManager = (NativeRenderUIManager *)renderContext; + [uiManager addShowEventListenerForType:name_ forView:node_id onRootNode:rootNode]; + }]; + } else if (name == hippy::kPressIn || name == hippy::kPressOut) { + std::string name_ = name; +- [self addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { +- HippyUIManager *uiManager = (HippyUIManager *)renderContext; ++ [self addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderUIManager *uiManager = (NativeRenderUIManager *)renderContext; + [uiManager addPressEventListenerForType:name_ forView:node_id onRootNode:rootNode]; + }]; + } else if (name == kVSyncKey) { +@@ -960,9 +951,9 @@ - (void)addEventName:(const std::string &)name + } + else { + std::string name_ = name; +- [self addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { +- HippyUIManager *uiManager = (HippyUIManager *)renderContext; +- [uiManager addRenderEvent:name_ forDomNode:node_id onRootNode:rootNode]; ++ [self addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderUIManager *uiManager = (NativeRenderUIManager *)renderContext; ++ [uiManager addPropertyEvent:name_ forDomNode:node_id onRootNode:rootNode]; + }]; + } + } +@@ -983,7 +974,7 @@ - (void)addEventNameInMainThread:(const std::string &)name + } else if (name == hippy::kPressIn || name == hippy::kPressOut) { + [self addPressEventListenerForType:name forView:node_id onRootNode:rootNode]; + } else { +- [self addRenderEvent:name forDomNode:node_id onRootNode:rootNode]; ++ [self addPropertyEvent:name forDomNode:node_id onRootNode:rootNode]; + } + } + +@@ -999,7 +990,7 @@ - (void)addClickEventListenerForView:(int32_t)hippyTag onRootNode:(std::weak_ptr + BOOL canBePreventedInCapturing = [view canBePreventedByInCapturing:hippy::kClickEvent]; + BOOL canBePreventedInBubbling = [view canBePreventInBubbling:hippy::kClickEvent]; + __weak id weakSelf = self; +- [view addViewEvent:HippyViewEventTypeClick eventListener:^(CGPoint) { ++ [view addViewEvent:NativeRenderViewEventTypeClick eventListener:^(CGPoint) { + id strongSelf = weakSelf; + if (strongSelf) { + [strongSelf domNodeForHippyTag:hippyTag onRootNode:rootNode resultNode:^(std::shared_ptr node) { +@@ -1029,7 +1020,7 @@ - (void)addLongClickEventListenerForView:(int32_t)hippyTag onRootNode:(std::weak + BOOL canBePreventedInCapturing = [view canBePreventedByInCapturing:hippy::kLongClickEvent]; + BOOL canBePreventedInBubbling = [view canBePreventInBubbling:hippy::kLongClickEvent]; + __weak id weakSelf = self; +- [view addViewEvent:HippyViewEventTypeLongClick eventListener:^(CGPoint) { ++ [view addViewEvent:NativeRenderViewEventTypeLongClick eventListener:^(CGPoint) { + id strongSelf = weakSelf; + if (strongSelf) { + [strongSelf domNodeForHippyTag:hippyTag onRootNode:rootNode resultNode:^(std::shared_ptr node) { +@@ -1057,7 +1048,7 @@ - (void)addPressEventListenerForType:(const std::string &)type + int32_t root_id = strongRootNode->GetId(); + AssertMainQueue(); + UIView *view = [self viewForHippyTag:@(hippyTag) onRootTag:@(root_id)]; +- HippyViewEventType eventType = hippy::kPressIn == type ? HippyViewEventType::HippyViewEventTypePressIn : HippyViewEventType::HippyViewEventTypePressOut; ++ NativeRenderViewEventType eventType = hippy::kPressIn == type ? NativeRenderViewEventType::NativeRenderViewEventTypePressIn : NativeRenderViewEventType::NativeRenderViewEventTypePressOut; + if (view) { + BOOL canBePreventedInCapturing = [view canBePreventedByInCapturing:type]; + BOOL canBePreventedInBubbling = [view canBePreventInBubbling:type]; +@@ -1093,15 +1084,15 @@ - (void)addTouchEventListenerForType:(const std::string &)type + UIView *view = [self viewForHippyTag:@(hippyTag) onRootTag:@(root_id)]; + if (view) { + // todo 默认值应该有个值代表未知 +- HippyViewEventType event_type = HippyViewEventType::HippyViewEventTypeTouchStart; ++ NativeRenderViewEventType event_type = NativeRenderViewEventType::NativeRenderViewEventTypeTouchStart; + if (type == hippy::kTouchStartEvent) { +- event_type = HippyViewEventType::HippyViewEventTypeTouchStart; ++ event_type = NativeRenderViewEventType::NativeRenderViewEventTypeTouchStart; + } else if (type == hippy::kTouchMoveEvent) { +- event_type = HippyViewEventType::HippyViewEventTypeTouchMove; ++ event_type = NativeRenderViewEventType::NativeRenderViewEventTypeTouchMove; + } else if (type == hippy::kTouchEndEvent) { +- event_type = HippyViewEventType::HippyViewEventTypeTouchEnd; ++ event_type = NativeRenderViewEventType::NativeRenderViewEventTypeTouchEnd; + } else if (type == hippy::kTouchCancelEvent) { +- event_type = HippyViewEventType::HippyViewEventTypeTouchCancel; ++ event_type = NativeRenderViewEventType::NativeRenderViewEventTypeTouchCancel; + } + BOOL canBePreventedInCapturing = [view canBePreventedByInCapturing:type]; + BOOL canBePreventedInBubbling = [view canBePreventInBubbling:type]; +@@ -1141,7 +1132,7 @@ - (void)addShowEventListenerForType:(const std::string &)type + int32_t root_id = strongRootNode->GetId(); + UIView *view = [self viewForHippyTag:@(hippyTag) onRootTag:@(root_id)]; + if (view) { +- HippyViewEventType event_type = hippy::kShowEvent == type ? HippyViewEventTypeShow : HippyViewEventTypeDismiss; ++ NativeRenderViewEventType event_type = hippy::kShowEvent == type ? NativeRenderViewEventTypeShow : NativeRenderViewEventTypeDismiss; + BOOL canBePreventedInCapturing = [view canBePreventedByInCapturing:type]; + BOOL canBePreventedInBubbling = [view canBePreventInBubbling:type]; + __weak id weakSelf = self; +@@ -1179,8 +1170,8 @@ - (void)removeEventName:(const std::string &)eventName + eventName == hippy::kShowEvent || eventName == hippy::kDismissEvent || + eventName == hippy::kPressIn || eventName == hippy::kPressOut) { + std::string name_ = eventName; +- [self addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { +- HippyUIManager *uiManager = (HippyUIManager *)renderContext; ++ [self addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderUIManager *uiManager = (NativeRenderUIManager *)renderContext; + UIView *view = [uiManager viewForHippyTag:@(hippyTag) onRootTag:@(root_id)]; + [view removeViewEvent:viewEventTypeFromName(name_)]; + }]; +@@ -1194,16 +1185,15 @@ - (void)removeEventName:(const std::string &)eventName + }]; + } else { + std::string name_ = eventName; +- [self addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { ++ [self addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { + UIView *view = [viewRegistry objectForKey:@(hippyTag)]; +- [view removeStatusChangeEvent:name_]; ++ [view removePropertyEvent:name_]; + }]; + } + } + +-- (void)addRenderEvent:(const std::string &)name +- forDomNode:(int32_t)node_id +- onRootNode:(std::weak_ptr)rootNode { ++- (void)addPropertyEvent:(const std::string &)name forDomNode:(int32_t)node_id ++ onRootNode:(std::weak_ptr)rootNode { + AssertMainQueue(); + auto strongRootNode = rootNode.lock(); + if (!strongRootNode) { +@@ -1215,14 +1205,14 @@ - (void)addRenderEvent:(const std::string &)name + std::string name_ = name; + NSDictionary *componentDataByName = [_componentDataByName copy]; + NSString *viewName = view.viewName; +- HippyComponentData *component = componentDataByName[viewName]; ++ NativeRenderComponentData *component = componentDataByName[viewName]; + NSDictionary *eventMap = [component eventNameMap]; + NSString *mapToEventName = [eventMap objectForKey:[NSString stringWithUTF8String:name_.c_str()]]; + if (mapToEventName) { + BOOL canBePreventedInCapturing = [view canBePreventedByInCapturing:name_]; + BOOL canBePreventedInBubbling = [view canBePreventInBubbling:name_]; + __weak id weakSelf = self; +- [view addStatusChangeEvent:[mapToEventName UTF8String] eventCallback:^(NSDictionary *body) { ++ [view addPropertyEvent:[mapToEventName UTF8String] eventCallback:^(NSDictionary *body) { + id strongSelf = weakSelf; + if (strongSelf) { + [strongSelf domNodeForHippyTag:node_id onRootNode:rootNode resultNode:^(std::shared_ptr domNode) { +@@ -1242,22 +1232,6 @@ - (void)addRenderEvent:(const std::string &)name + } + } + +-- (void)removeRenderEvent:(const std::string &)name +- forDomNodeId:(int32_t)node_id +- onRootNode:(std::weak_ptr)rootNode { +- auto strongRootNode = rootNode.lock(); +- if (!strongRootNode) { +- return; +- } +- int32_t root_id = strongRootNode->GetId(); +- std::string name_ = name; +- [self addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { +- HippyUIManager *uiManager = (HippyUIManager *)renderContext; +- UIView *view = [uiManager viewForHippyTag:@(node_id) onRootTag:@(root_id)]; +- [view removeStatusChangeEvent:name_]; +- }]; +-} +- + #pragma mark - + #pragma mark Other + +@@ -1266,26 +1240,26 @@ - (void)removeRenderEvent:(const std::string &)name + * runs these blocks and all other already existing blocks. + */ + - (void)layoutAndMountOnRootNode:(std::weak_ptr)rootNode { +- std::lock_guard lock([self shadowQueueLock]); ++ std::lock_guard lock([self renderQueueLock]); + auto strongRootNode = rootNode.lock(); + if (!strongRootNode) { + return; + } + int32_t root_id = strongRootNode->GetId(); +- HippyShadowView *rootView = [_shadowViewRegistry rootComponentForTag:@(root_id)]; ++ NativeRenderObjectView *rootView = [_renderObjectRegistry rootComponentForTag:@(root_id)]; + // Gather blocks to be executed now that all view hierarchy manipulations have + // been completed (note that these may still take place before layout has finished) +- NSDictionary *shadowViewMap = [_shadowViewRegistry componentsForRootTag:@(root_id)]; +- for (HippyComponentData *componentData in _componentDataByName.allValues) { +- HippyRenderUIBlock uiBlock = [componentData uiBlockToAmendWithShadowViewRegistry:shadowViewMap]; ++ NSDictionary *renderObjectsMap = [_renderObjectRegistry componentsForRootTag:@(root_id)]; ++ for (NativeRenderComponentData *componentData in _componentDataByName.allValues) { ++ NativeRenderRenderUIBlock uiBlock = [componentData uiBlockToAmendWithRenderObjectViewRegistry:renderObjectsMap]; + [self addUIBlock:uiBlock]; + } + [rootView amendLayoutBeforeMount]; +- [self amendPendingUIBlocksWithStylePropagationUpdateForShadowView:rootView]; ++ [self amendPendingUIBlocksWithStylePropagationUpdateForRenderObject:rootView]; + +- [self addUIBlock:^(id renderContext, __unused NSDictionary *viewRegistry) { +- HippyUIManager *uiManager = (HippyUIManager *)renderContext; +- for (id node in uiManager->_componentTransactionListeners) { ++ [self addUIBlock:^(id renderContext, __unused NSDictionary *viewRegistry) { ++ NativeRenderUIManager *uiManager = (NativeRenderUIManager *)renderContext; ++ for (id node in uiManager->_componentTransactionListeners) { + [node hippyComponentDidFinishTransaction]; + } + }]; +@@ -1295,7 +1269,7 @@ - (void)layoutAndMountOnRootNode:(std::weak_ptr)rootNode { + - (void)setNeedsLayoutForRootNodeTag:(NSNumber *)tag { + // If there is an active batch layout will happen when batch finished, so we will wait for that. + // Otherwise we immidiately trigger layout. +- auto rootNode = [_shadowViewRegistry rootNodeForTag:tag]; ++ auto rootNode = [_renderObjectRegistry rootNodeForTag:tag]; + [self layoutAndMountOnRootNode:rootNode]; + } + +diff --git a/renderer/native/ios/renderer/RenderVsyncManager.h b/renderer/native/ios/renderer/RenderVsyncManager.h +index 2c299c20d85..7c5f7cf1fe4 100644 +--- a/renderer/native/ios/renderer/RenderVsyncManager.h ++++ b/renderer/native/ios/renderer/RenderVsyncManager.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +diff --git a/renderer/native/ios/renderer/RenderVsyncManager.mm b/renderer/native/ios/renderer/RenderVsyncManager.mm +index 4e0aad49ccf..4509b3c6604 100644 +--- a/renderer/native/ios/renderer/RenderVsyncManager.mm ++++ b/renderer/native/ios/renderer/RenderVsyncManager.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +diff --git a/renderer/native/ios/renderer/UIView+Render.h b/renderer/native/ios/renderer/UIView+Render.h +index d64903c540f..f3e76b8bb38 100644 +--- a/renderer/native/ios/renderer/UIView+Render.h ++++ b/renderer/native/ios/renderer/UIView+Render.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -24,11 +24,11 @@ + + NS_ASSUME_NONNULL_BEGIN + +-@protocol HippyRenderContext; ++@protocol NativeRenderContext; + + @interface UIView (Render) + +-@property(nonatomic, weak)id renderContext; ++@property(nonatomic, weak)id renderContext; + + @end + +diff --git a/renderer/native/ios/renderer/UIView+Render.mm b/renderer/native/ios/renderer/UIView+Render.mm +index 1de69767764..3f6c3f08e98 100644 +--- a/renderer/native/ios/renderer/UIView+Render.mm ++++ b/renderer/native/ios/renderer/UIView+Render.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -22,11 +22,11 @@ + + #import ""UIView+Render.h"" + #import ""objc/runtime.h"" +-#import ""HippyRenderContext.h"" ++#import ""NativeRenderContext.h"" + + @implementation UIView (Render) + +-- (void)setRenderContext:(id)renderContext { ++- (void)setRenderContext:(id)renderContext { + if (renderContext) { + NSHashTable *weakContainer = [NSHashTable weakObjectsHashTable]; + [weakContainer addObject:renderContext]; +@@ -37,7 +37,7 @@ - (void)setRenderContext:(id)renderContext { + } + } + +-- (id)renderContext { ++- (id)renderContext { + NSHashTable *hashTable = objc_getAssociatedObject(self, _cmd); + return [hashTable anyObject]; + } +diff --git a/renderer/native/ios/renderer/component/footerrefresh/HippyFooterRefreshManager.mm b/renderer/native/ios/renderer/component/footerrefresh/HippyFooterRefreshManager.mm +deleted file mode 100644 +index 1758c9228f6..00000000000 +--- a/renderer/native/ios/renderer/component/footerrefresh/HippyFooterRefreshManager.mm ++++ /dev/null +@@ -1,63 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import ""HippyFooterRefreshManager.h"" +-#import ""HippyFooterRefresh.h"" +- +-@implementation HippyFooterRefreshManager +- +-HIPPY_EXPORT_VIEW_PROPERTY(refreshStick, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(onFooterReleased, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onFooterPulling, HippyDirectEventBlock) +- +-// clang-format off +-RENDER_COMPONENT_EXPORT_METHOD(collapsePullFooter:(nonnull NSNumber *)reactTag) { +- [self.renderContext addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { +- HippyRefresh *refreshView = viewRegistry[reactTag]; +- [refreshView refreshFinish]; +- }]; +-} +-// clang-format on +- +-// clang-format off +-RENDER_COMPONENT_EXPORT_METHOD(collapsePullFooterWithOptions:(nonnull NSNumber *)reactTag options:(NSDictionary *)options) { +- [self.renderContext addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { +- HippyRefresh *refreshView = viewRegistry[reactTag]; +- [refreshView refreshFinishWithOption:options]; +- }]; +-} +-// clang-format on +- +-// clang-format off +-RENDER_COMPONENT_EXPORT_METHOD(expandPullFooter:(nonnull NSNumber *)reactTag) { +- [self.renderContext addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { +- HippyRefresh *refreshView = viewRegistry[reactTag]; +- [refreshView refresh]; +- }]; +-} +-// clang-format on +- +-- (UIView *)view { +- return [[HippyFooterRefresh alloc] init]; +-} +- +-@end +diff --git a/renderer/native/ios/renderer/component/footerrefresh/HippyFooterRefresh.h b/renderer/native/ios/renderer/component/footerrefresh/NativeRenderFooterRefresh.h +similarity index 71% +rename from renderer/native/ios/renderer/component/footerrefresh/HippyFooterRefresh.h +rename to renderer/native/ios/renderer/component/footerrefresh/NativeRenderFooterRefresh.h +index f09ea7b68ec..c7c9a258fdb 100644 +--- a/renderer/native/ios/renderer/component/footerrefresh/HippyFooterRefresh.h ++++ b/renderer/native/ios/renderer/component/footerrefresh/NativeRenderFooterRefresh.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,13 +20,13 @@ + * limitations under the License. + */ + +-#import ""HippyRefresh.h"" +-#import ""HippyComponent.h"" ++#import ""NativeRenderRefresh.h"" ++#import ""NativeRenderComponentProtocol.h"" + +-@interface HippyFooterRefresh : HippyRefresh ++@interface NativeRenderFooterRefresh : NativeRenderRefresh + + @property (nonatomic, assign) BOOL refreshStick; +-@property (nonatomic, copy) HippyDirectEventBlock onFooterReleased; +-@property (nonatomic, copy) HippyDirectEventBlock onFooterPulling; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onFooterReleased; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onFooterPulling; + + @end +diff --git a/renderer/native/ios/renderer/component/footerrefresh/HippyFooterRefresh.mm b/renderer/native/ios/renderer/component/footerrefresh/NativeRenderFooterRefresh.mm +similarity index 87% +rename from renderer/native/ios/renderer/component/footerrefresh/HippyFooterRefresh.mm +rename to renderer/native/ios/renderer/component/footerrefresh/NativeRenderFooterRefresh.mm +index cb3d0435a13..f3d3d19fb34 100644 +--- a/renderer/native/ios/renderer/component/footerrefresh/HippyFooterRefresh.mm ++++ b/renderer/native/ios/renderer/component/footerrefresh/NativeRenderFooterRefresh.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,9 +20,9 @@ + * limitations under the License. + */ + +-#import ""HippyFooterRefresh.h"" ++#import ""NativeRenderFooterRefresh.h"" + +-@implementation HippyFooterRefresh ++@implementation NativeRenderFooterRefresh + + - (void)setScrollView:(UIScrollView *)scrollView { + [super setScrollView:scrollView]; +@@ -47,7 +47,7 @@ - (void)observeValueForKeyPath:(NSString *)keyPath + + - (void)scrollViewDidScroll { + if (_scrollView && _scrollView.contentSize.height > 0) { +- if (self.onFooterPulling && HippyRefreshStatusStartLoading != [self status] && HippyRefreshStatusFinishLoading != [self status]) { ++ if (self.onFooterPulling && NativeRenderRefreshStatusStartLoading != [self status] && NativeRenderRefreshStatusFinishLoading != [self status]) { + CGFloat offset = _scrollView.contentOffset.y; + if (offset >= 0) { + self.onFooterPulling(@{ @""contentOffset"": @(offset) }); +@@ -60,24 +60,24 @@ - (void)scrollViewDidEndDragging { + if (_scrollView) { + CGFloat offset = _scrollView.contentOffset.y; + if (offset > _scrollView.contentSize.height - CGRectGetHeight(_scrollView.bounds) + CGRectGetHeight(self.bounds)) { +- self.status = HippyRefreshStatusStartLoading; ++ self.status = NativeRenderRefreshStatusStartLoading; + } + } + } + +-- (void)setStatus:(HippyRefreshStatus)status { ++- (void)setStatus:(NativeRenderRefreshStatus)status { + if (_status == status) { + return; + } + switch (status) { +- case HippyRefreshStatusIdle: { ++ case NativeRenderRefreshStatusIdle: { + [UIView animateWithDuration:.2f animations:^{ + UIEdgeInsets insets = self.scrollView.contentInset; + self.scrollView.contentInset = UIEdgeInsetsMake(insets.top, insets.left, 0, insets.right); + } completion:^(BOOL finished) { + }]; + } break; +- case HippyRefreshStatusStartLoading: { ++ case NativeRenderRefreshStatusStartLoading: { + CGFloat height = CGRectGetHeight(self.bounds); + if (_refreshStick) { + CGFloat currentOffset = _scrollView.contentOffset.y; +@@ -94,7 +94,7 @@ - (void)setStatus:(HippyRefreshStatus)status { + } + }]; + } break; +- case HippyRefreshStatusFinishLoading: { ++ case NativeRenderRefreshStatusFinishLoading: { + } break; + default: + break; +@@ -111,7 +111,7 @@ - (void)refresh { + = CGPointMake(0, self.scrollView.contentSize.height - self.scrollView.bounds.size.height + self.scrollView.contentInset.bottom); + [self.scrollView setContentOffset:bottomOffset animated:YES]; + } completion:^(BOOL finished) { +- self.status = HippyRefreshStatusStartLoading; ++ self.status = NativeRenderRefreshStatusStartLoading; + }]; + } + +diff --git a/renderer/native/ios/renderer/component/footerrefresh/NativeRenderFooterRefreshManager.h b/renderer/native/ios/renderer/component/footerrefresh/NativeRenderFooterRefreshManager.h +new file mode 100644 +index 00000000000..1f9c70131c6 +--- /dev/null ++++ b/renderer/native/ios/renderer/component/footerrefresh/NativeRenderFooterRefreshManager.h +@@ -0,0 +1,27 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * NativeRender available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ""NativeRenderViewManager.h"" ++ ++@interface NativeRenderFooterRefreshManager : NativeRenderViewManager ++ ++@end +diff --git a/renderer/native/ios/renderer/component/footerrefresh/NativeRenderFooterRefreshManager.mm b/renderer/native/ios/renderer/component/footerrefresh/NativeRenderFooterRefreshManager.mm +new file mode 100644 +index 00000000000..7f0898ecdf0 +--- /dev/null ++++ b/renderer/native/ios/renderer/component/footerrefresh/NativeRenderFooterRefreshManager.mm +@@ -0,0 +1,63 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * NativeRender available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ""NativeRenderFooterRefreshManager.h"" ++#import ""NativeRenderFooterRefresh.h"" ++ ++@implementation NativeRenderFooterRefreshManager ++ ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(refreshStick, BOOL) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onFooterReleased, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onFooterPulling, NativeRenderDirectEventBlock) ++ ++// clang-format off ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(collapsePullFooter:(nonnull NSNumber *)reactTag) { ++ [self.renderContext addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderRefresh *refreshView = viewRegistry[reactTag]; ++ [refreshView refreshFinish]; ++ }]; ++} ++// clang-format on ++ ++// clang-format off ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(collapsePullFooterWithOptions:(nonnull NSNumber *)reactTag options:(NSDictionary *)options) { ++ [self.renderContext addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderRefresh *refreshView = viewRegistry[reactTag]; ++ [refreshView refreshFinishWithOption:options]; ++ }]; ++} ++// clang-format on ++ ++// clang-format off ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(expandPullFooter:(nonnull NSNumber *)reactTag) { ++ [self.renderContext addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderRefresh *refreshView = viewRegistry[reactTag]; ++ [refreshView refresh]; ++ }]; ++} ++// clang-format on ++ ++- (UIView *)view { ++ return [[NativeRenderFooterRefresh alloc] init]; ++} ++ ++@end +diff --git a/renderer/native/ios/renderer/component/headerrefresh/HippyHeaderRefreshManager.mm b/renderer/native/ios/renderer/component/headerrefresh/HippyHeaderRefreshManager.mm +deleted file mode 100644 +index 32c2ca8886e..00000000000 +--- a/renderer/native/ios/renderer/component/headerrefresh/HippyHeaderRefreshManager.mm ++++ /dev/null +@@ -1,62 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import ""HippyHeaderRefreshManager.h"" +-#import ""HippyHeaderRefresh.h"" +- +-@implementation HippyHeaderRefreshManager +- +-HIPPY_EXPORT_VIEW_PROPERTY(onHeaderReleased, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onHeaderPulling, HippyDirectEventBlock) +- +-// clang-format off +-RENDER_COMPONENT_EXPORT_METHOD(expandPullHeader:(nonnull NSNumber *)reactTag) { +- [self.renderContext addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { +- HippyRefresh *refreshView = viewRegistry[reactTag]; +- [refreshView refresh]; +- }]; +-} +-// clang-format on +- +-// clang-format off +-RENDER_COMPONENT_EXPORT_METHOD(collapsePullHeader:(nonnull NSNumber *)reactTag) { +- [self.renderContext addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { +- HippyRefresh *refreshView = viewRegistry[reactTag]; +- [refreshView refreshFinish]; +- }]; +-} +-// clang-format on +- +-// clang-format off +-RENDER_COMPONENT_EXPORT_METHOD(collapsePullHeaderWithOptions:(nonnull NSNumber *)reactTag options:(NSDictionary *)options) { +- [self.renderContext addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { +- HippyRefresh *refreshView = viewRegistry[reactTag]; +- [refreshView refreshFinishWithOption:options]; +- }]; +-} +-// clang-format on +- +-- (UIView *)view { +- return [[HippyHeaderRefresh alloc] init]; +-} +- +-@end +diff --git a/renderer/native/ios/renderer/component/headerrefresh/HippyHeaderRefresh.h b/renderer/native/ios/renderer/component/headerrefresh/NativeRenderHeaderRefresh.h +similarity index 71% +rename from renderer/native/ios/renderer/component/headerrefresh/HippyHeaderRefresh.h +rename to renderer/native/ios/renderer/component/headerrefresh/NativeRenderHeaderRefresh.h +index 40eb8151eb7..641c79c126f 100644 +--- a/renderer/native/ios/renderer/component/headerrefresh/HippyHeaderRefresh.h ++++ b/renderer/native/ios/renderer/component/headerrefresh/NativeRenderHeaderRefresh.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,12 +21,12 @@ + */ + + #import +-#import ""HippyRefresh.h"" +-#import ""HippyComponent.h"" ++#import ""NativeRenderRefresh.h"" ++#import ""NativeRenderComponentProtocol.h"" + +-@interface HippyHeaderRefresh : HippyRefresh ++@interface NativeRenderHeaderRefresh : NativeRenderRefresh + +-@property (nonatomic, copy) HippyDirectEventBlock onHeaderReleased; +-@property (nonatomic, copy) HippyDirectEventBlock onHeaderPulling; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onHeaderReleased; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onHeaderPulling; + + @end +diff --git a/renderer/native/ios/renderer/component/headerrefresh/HippyHeaderRefresh.mm b/renderer/native/ios/renderer/component/headerrefresh/NativeRenderHeaderRefresh.mm +similarity index 84% +rename from renderer/native/ios/renderer/component/headerrefresh/HippyHeaderRefresh.mm +rename to renderer/native/ios/renderer/component/headerrefresh/NativeRenderHeaderRefresh.mm +index e7b2e8c6d8e..e14ef3edc51 100644 +--- a/renderer/native/ios/renderer/component/headerrefresh/HippyHeaderRefresh.mm ++++ b/renderer/native/ios/renderer/component/headerrefresh/NativeRenderHeaderRefresh.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,9 +20,9 @@ + * limitations under the License. + */ + +-#import ""HippyHeaderRefresh.h"" ++#import ""NativeRenderHeaderRefresh.h"" + +-@implementation HippyHeaderRefresh ++@implementation NativeRenderHeaderRefresh + + - (void)setFrame:(CGRect)frame { + CGRect properFrame = frame; +@@ -36,7 +36,7 @@ - (void)setFrame:(CGRect)frame { + + - (void)scrollViewDidScroll { + if (_scrollView) { +- if (self.onHeaderPulling && HippyRefreshStatusStartLoading != [self status] && HippyRefreshStatusFinishLoading != [self status]) { ++ if (self.onHeaderPulling && NativeRenderRefreshStatusStartLoading != [self status] && NativeRenderRefreshStatusFinishLoading != [self status]) { + CGFloat offset = _scrollView.contentOffset.y; + if (offset <= 0) { + self.onHeaderPulling(@{ @""contentOffset"": @(-offset) }); +@@ -47,23 +47,23 @@ - (void)scrollViewDidScroll { + + - (void)scrollViewDidEndDragging { + if (_scrollView && -_scrollView.contentOffset.y > CGRectGetHeight(self.bounds)) { +- self.status = HippyRefreshStatusStartLoading; ++ self.status = NativeRenderRefreshStatusStartLoading; + } + } + +-- (void)setStatus:(HippyRefreshStatus)status { ++- (void)setStatus:(NativeRenderRefreshStatus)status { + if (_status == status) { + return; + } + switch (status) { +- case HippyRefreshStatusIdle: { ++ case NativeRenderRefreshStatusIdle: { + [UIView animateWithDuration:.2f animations:^{ + UIEdgeInsets insets = self.scrollView.contentInset; + self.scrollView.contentInset = UIEdgeInsetsMake(0, insets.left, insets.bottom, insets.right); + } completion:^(BOOL finished) { + }]; + } break; +- case HippyRefreshStatusStartLoading: { ++ case NativeRenderRefreshStatusStartLoading: { + CGFloat height = CGRectGetHeight(self.bounds); + [UIView animateWithDuration:.2f animations:^{ + UIEdgeInsets insets = self.scrollView.contentInset; +diff --git a/renderer/native/ios/renderer/component/headerrefresh/NativeRenderHeaderRefreshManager.h b/renderer/native/ios/renderer/component/headerrefresh/NativeRenderHeaderRefreshManager.h +new file mode 100644 +index 00000000000..5aa9b921b99 +--- /dev/null ++++ b/renderer/native/ios/renderer/component/headerrefresh/NativeRenderHeaderRefreshManager.h +@@ -0,0 +1,27 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * NativeRender available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ""NativeRenderViewManager.h"" ++ ++@interface NativeRenderHeaderRefreshManager : NativeRenderViewManager ++ ++@end +diff --git a/renderer/native/ios/renderer/component/headerrefresh/NativeRenderHeaderRefreshManager.mm b/renderer/native/ios/renderer/component/headerrefresh/NativeRenderHeaderRefreshManager.mm +new file mode 100644 +index 00000000000..1350d8354ef +--- /dev/null ++++ b/renderer/native/ios/renderer/component/headerrefresh/NativeRenderHeaderRefreshManager.mm +@@ -0,0 +1,62 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * NativeRender available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ""NativeRenderHeaderRefreshManager.h"" ++#import ""NativeRenderHeaderRefresh.h"" ++ ++@implementation NativeRenderHeaderRefreshManager ++ ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onHeaderReleased, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onHeaderPulling, NativeRenderDirectEventBlock) ++ ++// clang-format off ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(expandPullHeader:(nonnull NSNumber *)reactTag) { ++ [self.renderContext addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderRefresh *refreshView = viewRegistry[reactTag]; ++ [refreshView refresh]; ++ }]; ++} ++// clang-format on ++ ++// clang-format off ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(collapsePullHeader:(nonnull NSNumber *)reactTag) { ++ [self.renderContext addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderRefresh *refreshView = viewRegistry[reactTag]; ++ [refreshView refreshFinish]; ++ }]; ++} ++// clang-format on ++ ++// clang-format off ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(collapsePullHeaderWithOptions:(nonnull NSNumber *)reactTag options:(NSDictionary *)options) { ++ [self.renderContext addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderRefresh *refreshView = viewRegistry[reactTag]; ++ [refreshView refreshFinishWithOption:options]; ++ }]; ++} ++// clang-format on ++ ++- (UIView *)view { ++ return [[NativeRenderHeaderRefresh alloc] init]; ++} ++ ++@end +diff --git a/renderer/native/ios/renderer/component/image/HippyImageView.h b/renderer/native/ios/renderer/component/image/HippyImageView.h +deleted file mode 100644 +index 7725433034f..00000000000 +--- a/renderer/native/ios/renderer/component/image/HippyImageView.h ++++ /dev/null +@@ -1,95 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import +-#import ""HippyComponent.h"" +-#import ""HippyConvert.h"" +-#import ""HippyAnimatedImageView.h"" +-#import ""HippyMemoryOpt.h"" +-#import ""HippyImageProviderProtocol.h"" +- +-@class HippyImageView; +- +-@interface HippyAnimatedImageOperation : NSOperation { +- NSData *_animatedImageData; +- NSString *_url; +- __weak HippyImageView *_imageView; +- id _imageProvider; +-} +- +-- (id)initWithAnimatedImageData:(NSData *)data imageView:(HippyImageView *)imageView imageURL:(NSString *)url; +-- (id)initWithAnimatedImageProvider:(id)imageProvider imageView:(HippyImageView *)imageView imageURL:(NSString *)url; +- +-@end +- +-typedef NS_ENUM(NSInteger, HippyResizeMode) { +- HippyResizeModeCover = UIViewContentModeScaleAspectFill, +- HippyResizeModeContain = UIViewContentModeScaleAspectFit, +- HippyResizeModeStretch = UIViewContentModeScaleToFill, +- HippyResizeModeCenter = UIViewContentModeCenter, +- HippyResizeModeRepeat = -1, // Use negative values to avoid conflicts with iOS enum values. +-}; +- +-typedef NS_ENUM(NSInteger, HippyShapeMode) { +- HippyResizeModeDefalt = 0, +- HippyResizeModeCircle, +-}; +- +-@interface HippyImageView : HippyAnimatedImageView +- +-@property (nonatomic, assign) CGFloat blurRadius; +-@property (nonatomic, assign) UIEdgeInsets capInsets; +-@property (nonatomic, assign) HippyResizeMode resizeMode; +-@property (nonatomic, copy) NSArray *source; +-@property (nonatomic, strong) UIImage *defaultImage; +-@property (nonatomic, assign) UIImageRenderingMode renderingMode; +-@property (nonatomic, assign) BOOL downSample; +-@property (nonatomic, assign) CGFloat borderTopLeftRadius; +-@property (nonatomic, assign) CGFloat borderTopRightRadius; +-@property (nonatomic, assign) CGFloat borderBottomLeftRadius; +-@property (nonatomic, assign) CGFloat borderBottomRightRadius; +-@property (nonatomic, assign) CGFloat borderRadius; +-@property (nonatomic, assign) HippyShapeMode shape; +- +-@property (nonatomic, copy) HippyDirectEventBlock onLoadStart; +-@property (nonatomic, copy) HippyDirectEventBlock onProgress; +-@property (nonatomic, copy) HippyDirectEventBlock onError; +-@property (nonatomic, copy) HippyDirectEventBlock onLoad; +-@property (nonatomic, copy) HippyDirectEventBlock onLoadEnd; +- +-- (void)reloadImage; +- +-- (void)updateImage:(UIImage *)image; +- +-- (void)setImageProvider:(id)imageProvider; +- +-- (void)clearImageIfDetached; +- +-- (BOOL)needsUpdateCornerRadiusManully; +-@end +- +-@interface HippyConvert (HippyResizeMode) +- +-+ (HippyResizeMode)HippyResizeMode:(id)json; +-+ (HippyShapeMode)HippyShapeMode:(id)json; +- +-@end +diff --git a/renderer/native/ios/renderer/component/image/HippyAnimatedImage.h b/renderer/native/ios/renderer/component/image/NativeRenderAnimatedImage.h +similarity index 77% +rename from renderer/native/ios/renderer/component/image/HippyAnimatedImage.h +rename to renderer/native/ios/renderer/component/image/NativeRenderAnimatedImage.h +index ba01f369031..86c36d9acf0 100644 +--- a/renderer/native/ios/renderer/component/image/HippyAnimatedImage.h ++++ b/renderer/native/ios/renderer/component/image/NativeRenderAnimatedImage.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,8 +21,8 @@ + */ + + #import +-#import ""HippyImageProviderProtocol.h"" +-#import ""HippyAnimatedImageView.h"" ++#import ""NativeRenderImageProviderProtocol.h"" ++#import ""NativeRenderAnimatedImageView.h"" + + #ifndef NS_DESIGNATED_INITIALIZER + #if __has_attribute(objc_designated_initializer) +@@ -35,13 +35,13 @@ + extern const NSTimeInterval kHippyAnimatedImageDelayTimeIntervalMinimum; + + // +-// An `HippyAnimatedImage`'s job is to deliver frames in a highly performant way and works in conjunction with `HippyAnimatedImageView`. ++// An `NativeRenderAnimatedImage`'s job is to deliver frames in a highly performant way and works in conjunction with `NativeRenderAnimatedImageView`. + // It subclasses `NSObject` and not `UIImage` because it's only an ""image"" in the sense that a sea lion is a lion. + // It tries to intelligently choose the frame cache size depending on the image and memory situation with the goal to lower CPU usage for smaller + // ones, lower memory usage for larger ones and always deliver frames for high performant play-back. Note: `posterImage`, `size`, `loopCount`, + // `delayTimes` and `frameCount` don't change after successful initialization. + // +-@interface HippyAnimatedImage : NSObject ++@interface NativeRenderAnimatedImage : NSObject + + @property (nonatomic, strong, readonly) UIImage *posterImage; // Guaranteed to be loaded; usually equivalent to `-imageLazilyCachedAtIndex:0` + @property (nonatomic, assign, readonly) CGSize size; // The `.posterImage`'s `.size` +@@ -59,18 +59,18 @@ extern const NSTimeInterval kHippyAnimatedImageDelayTimeIntervalMinimum; + // After an initial loading time, depending on `frameCacheSize`, frames should be available immediately from the cache. + - (UIImage *)imageLazilyCachedAtIndex:(NSUInteger)index; + +-// Pass either a `UIImage` or an `HippyAnimatedImage` and get back its size ++// Pass either a `UIImage` or an `NativeRenderAnimatedImage` and get back its size + + (CGSize)sizeForImage:(id)image; + + - (UIImage *)imageAtIndex:(NSUInteger)index; + +-- (instancetype)initWithAnimatedImageProvider:(id)imageProvider; +-- (instancetype)initWithAnimatedImageProvider:(id)imageProvider ++- (instancetype)initWithAnimatedImageProvider:(id)imageProvider; ++- (instancetype)initWithAnimatedImageProvider:(id)imageProvider + optimalFrameCacheSize:(NSUInteger)optimalFrameCacheSize + predrawingEnabled:(BOOL)isPredrawingEnabled; +-+ (instancetype)animatedImageWithAnimatedImageProvider:(id)imageProvider; +++ (instancetype)animatedImageWithAnimatedImageProvider:(id)imageProvider; + +-// On success, the initializers return an `HippyAnimatedImage` with all fields initialized, on failure they return `nil` and an error will be logged. ++// On success, the initializers return an `NativeRenderAnimatedImage` with all fields initialized, on failure they return `nil` and an error will be logged. + - (instancetype)initWithAnimatedGIFData:(NSData *)data; + // Pass 0 for optimalFrameCacheSize to get the default, predrawing is enabled by default. + - (instancetype)initWithAnimatedGIFData:(NSData *)data +@@ -79,7 +79,7 @@ extern const NSTimeInterval kHippyAnimatedImageDelayTimeIntervalMinimum; + + (instancetype)animatedImageWithGIFData:(NSData *)data; + + @property (nonatomic, strong, readonly) NSData *data; // The data the receiver was initialized with; read-only +-@property (nonatomic, strong, readonly) id imageProvider; ++@property (nonatomic, strong, readonly) id imageProvider; + + @end + +@@ -92,7 +92,7 @@ typedef NS_ENUM(NSUInteger, RAILogLevel) { + RAILogLevelVerbose + }; + +-@interface HippyAnimatedImage (Logging) ++@interface NativeRenderAnimatedImage (Logging) + + + (void)setLogBlock:(void (^)(NSString *logString, RAILogLevel logLevel))logBlock logLevel:(RAILogLevel)logLevel; + + (void)logStringFromBlock:(NSString * (^)(void))stringBlock withLevel:(RAILogLevel)level; +@@ -100,9 +100,9 @@ typedef NS_ENUM(NSUInteger, RAILogLevel) { + @end + + #define RAILog(logLevel, format, ...) +-//[HippyAnimatedImage logStringFromBlock:^NSString *{ return [NSString stringWithFormat:(format), ## __VA_ARGS__]; } withLevel:(logLevel)] ++//[NativeRenderAnimatedImage logStringFromBlock:^NSString *{ return [NSString stringWithFormat:(format), ## __VA_ARGS__]; } withLevel:(logLevel)] + +-@interface HippyWeakProxy : NSProxy ++@interface NativeRenderWeakProxy : NSProxy + + + (instancetype)weakProxyForObject:(id)targetObject; + +diff --git a/renderer/native/ios/renderer/component/image/HippyAnimatedImage.m b/renderer/native/ios/renderer/component/image/NativeRenderAnimatedImage.m +similarity index 90% +rename from renderer/native/ios/renderer/component/image/HippyAnimatedImage.m +rename to renderer/native/ios/renderer/component/image/NativeRenderAnimatedImage.m +index 83c9fa44208..ed933dfcc93 100644 +--- a/renderer/native/ios/renderer/component/image/HippyAnimatedImage.m ++++ b/renderer/native/ios/renderer/component/image/NativeRenderAnimatedImage.m +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,7 +20,7 @@ + * limitations under the License. + */ + +-#import ""HippyAnimatedImage.h"" ++#import ""NativeRenderAnimatedImage.h"" + #import + #import + +@@ -36,24 +36,24 @@ + const NSTimeInterval kHippyAnimatedImageDelayTimeIntervalMinimum = 0.02; + + // An animated image's data size (dimensions * frameCount) category; its value is the max allowed memory (in MB). +-// E.g.: A 100x200px GIF with 30 frames is ~2.3MB in our pixel format and would fall into the `HippyAnimatedImageDataSizeCategoryAll` category. +-typedef NS_ENUM(NSUInteger, HippyAnimatedImageDataSizeCategory) { +- HippyAnimatedImageDataSizeCategoryAll = 10, // All frames permanently in memory (be nice to the CPU) +- HippyAnimatedImageDataSizeCategoryDefault ++// E.g.: A 100x200px GIF with 30 frames is ~2.3MB in our pixel format and would fall into the `NativeRenderAnimatedImageDataSizeCategoryAll` category. ++typedef NS_ENUM(NSUInteger, NativeRenderAnimatedImageDataSizeCategory) { ++ NativeRenderAnimatedImageDataSizeCategoryAll = 10, // All frames permanently in memory (be nice to the CPU) ++ NativeRenderAnimatedImageDataSizeCategoryDefault + = 75, // A frame cache of default size in memory (usually real-time performance and keeping low memory profile) +- HippyAnimatedImageDataSizeCategoryOnDemand = 250, // Only keep one frame at the time in memory (easier on memory, slowest performance) +- HippyAnimatedImageDataSizeCategoryUnsupported // Even for one frame too large, computer says no. ++ NativeRenderAnimatedImageDataSizeCategoryOnDemand = 250, // Only keep one frame at the time in memory (easier on memory, slowest performance) ++ NativeRenderAnimatedImageDataSizeCategoryUnsupported // Even for one frame too large, computer says no. + }; + +-typedef NS_ENUM(NSUInteger, HippyAnimatedImageFrameCacheSize) { +- HippyAnimatedImageFrameCacheSizeNoLimit = 0, // 0 means no specific limit +- HippyAnimatedImageFrameCacheSizeLowMemory = 1, // The minimum frame cache size; this will produce frames on-demand. +- HippyAnimatedImageFrameCacheSizeGrowAfterMemoryWarning ++typedef NS_ENUM(NSUInteger, NativeRenderAnimatedImageFrameCacheSize) { ++ NativeRenderAnimatedImageFrameCacheSizeNoLimit = 0, // 0 means no specific limit ++ NativeRenderAnimatedImageFrameCacheSizeLowMemory = 1, // The minimum frame cache size; this will produce frames on-demand. ++ NativeRenderAnimatedImageFrameCacheSizeGrowAfterMemoryWarning + = 2, // If we can produce the frames faster than we consume, one frame ahead will already result in a stutter-free playback. +- HippyAnimatedImageFrameCacheSizeDefault = 5 // Build up a comfy buffer window to cope with CPU hiccups etc. ++ NativeRenderAnimatedImageFrameCacheSizeDefault = 5 // Build up a comfy buffer window to cope with CPU hiccups etc. + }; + +-@interface HippyAnimatedImage () ++@interface NativeRenderAnimatedImage () + @property (nonatomic, assign, readonly) + NSUInteger frameCacheSizeOptimal; // The optimal number of frames to cache based on image size & number of frames; never changes + @property (nonatomic, assign, readonly, getter=isPredrawingEnabled) BOOL predrawingEnabled; // Enables predrawing of images to improve performance. +@@ -71,16 +71,16 @@ @interface HippyAnimatedImage () + + // The weak proxy is used to break retain cycles with delayed actions from memory warnings. + // We are lying about the actual type here to gain static type checking and eliminate casts. +-// The actual type of the object is `HippyWeakProxy`. +-@property (nonatomic, strong, readonly) HippyAnimatedImage *weakProxy; +-@property (nonatomic, strong) id imageProvider; ++// The actual type of the object is `NativeRenderWeakProxy`. ++@property (nonatomic, strong, readonly) NativeRenderAnimatedImage *weakProxy; ++@property (nonatomic, strong) id imageProvider; + + @end + + // For custom dispatching of memory warnings to avoid deallocation races since NSNotificationCenter doesn't retain objects it is notifying. + static NSHashTable *allAnimatedImagesWeak; + +-@implementation HippyAnimatedImage ++@implementation NativeRenderAnimatedImage + + #pragma mark - Accessors + #pragma mark Public +@@ -90,11 +90,11 @@ - (NSUInteger)frameCacheSizeCurrent { + NSUInteger frameCacheSizeCurrent = self.frameCacheSizeOptimal; + + // If set, respect the caps. +- if (self.frameCacheSizeMax > HippyAnimatedImageFrameCacheSizeNoLimit) { ++ if (self.frameCacheSizeMax > NativeRenderAnimatedImageFrameCacheSizeNoLimit) { + frameCacheSizeCurrent = MIN(frameCacheSizeCurrent, self.frameCacheSizeMax); + } + +- if (self.frameCacheSizeMaxInternal > HippyAnimatedImageFrameCacheSizeNoLimit) { ++ if (self.frameCacheSizeMaxInternal > NativeRenderAnimatedImageFrameCacheSizeNoLimit) { + frameCacheSizeCurrent = MIN(frameCacheSizeCurrent, self.frameCacheSizeMaxInternal); + } + +@@ -134,7 +134,7 @@ - (void)setFrameCacheSizeMaxInternal:(NSUInteger)frameCacheSizeMaxInternal { + #pragma mark - Life Cycle + + + (void)initialize { +- if (self == [HippyAnimatedImage class]) { ++ if (self == [NativeRenderAnimatedImage class]) { + // UIKit memory warning notification handler shared by all of the instances + allAnimatedImagesWeak = [NSHashTable weakObjectsHashTable]; + +@@ -144,7 +144,7 @@ + (void)initialize { + // the main run loop, and we don't lock on allAnimatedImagesWeak + NSAssert([NSThread isMainThread], @""Received memory warning on non-main thread""); + // Get a strong reference to all of the images. If an instance is returned in this array, it +- // is still live and has not entered dealloc. Note that HippyAnimatedImages can be created ++ // is still live and has not entered dealloc. Note that NativeRenderAnimatedImages can be created + // on any thread, so the hash table must be locked. + NSArray *images = nil; + @synchronized(allAnimatedImagesWeak) { +@@ -157,19 +157,19 @@ + (void)initialize { + } + + - (instancetype)init { +- HippyAnimatedImage *animatedImage = [self initWithAnimatedGIFData:nil]; ++ NativeRenderAnimatedImage *animatedImage = [self initWithAnimatedGIFData:nil]; + if (!animatedImage) { + RAILog(RAILogLevelError, +- @""Use `-initWithAnimatedGIFData:` and supply the animated GIF data as an argument to initialize an object of type `HippyAnimatedImage`.""); ++ @""Use `-initWithAnimatedGIFData:` and supply the animated GIF data as an argument to initialize an object of type `NativeRenderAnimatedImage`.""); + } + return animatedImage; + } + +-- (instancetype)initWithAnimatedImageProvider:(id)imageProvider { ++- (instancetype)initWithAnimatedImageProvider:(id)imageProvider { + return [self initWithAnimatedImageProvider:imageProvider optimalFrameCacheSize:9 predrawingEnabled:NO]; + } + +-- (instancetype)initWithAnimatedImageProvider:(id)imageProvider ++- (instancetype)initWithAnimatedImageProvider:(id)imageProvider + optimalFrameCacheSize:(NSUInteger)optimalFrameCacheSize + predrawingEnabled:(BOOL)isPredrawingEnabled { + if (nil == imageProvider) { +@@ -269,16 +269,16 @@ - (instancetype)initWithAnimatedImageProvider:(id)im + // It's only dependent on the image size & number of frames and never changes. + CGFloat animatedImageDataSize + = CGImageGetBytesPerRow(self.posterImage.CGImage) * self.size.height * (self.frameCount - skippedFrameCount) / MEGABYTE; +- if (animatedImageDataSize <= HippyAnimatedImageDataSizeCategoryAll) { ++ if (animatedImageDataSize <= NativeRenderAnimatedImageDataSizeCategoryAll) { + _frameCacheSizeOptimal = self.frameCount; +- } else if (animatedImageDataSize <= HippyAnimatedImageDataSizeCategoryDefault) { ++ } else if (animatedImageDataSize <= NativeRenderAnimatedImageDataSizeCategoryDefault) { + // This value doesn't depend on device memory much because if we're not keeping all frames in memory we will always be decoding 1 + // frame up ahead per 1 frame that gets played and at this point we might as well just keep a small buffer just large enough to keep + // from running out of frames. +- _frameCacheSizeOptimal = HippyAnimatedImageFrameCacheSizeDefault; ++ _frameCacheSizeOptimal = NativeRenderAnimatedImageFrameCacheSizeDefault; + } else { + // The predicted size exceeds the limits to build up a cache and we go into low memory mode from the beginning. +- _frameCacheSizeOptimal = HippyAnimatedImageFrameCacheSizeLowMemory; ++ _frameCacheSizeOptimal = NativeRenderAnimatedImageFrameCacheSizeLowMemory; + } + } else { + // Use the provided value. +@@ -291,10 +291,10 @@ - (instancetype)initWithAnimatedImageProvider:(id)im + _allFramesIndexSet = [[NSIndexSet alloc] initWithIndexesInRange:NSMakeRange(0, self.frameCount)]; + + // See the property declarations for descriptions. +- _weakProxy = (id)[HippyWeakProxy weakProxyForObject:self]; ++ _weakProxy = (id)[NativeRenderWeakProxy weakProxyForObject:self]; + + // Register this instance in the weak table for memory notifications. The NSHashTable will clean up after itself when we're gone. +- // Note that HippyAnimatedImages can be created on any thread, so the hash table must be locked. ++ // Note that NativeRenderAnimatedImages can be created on any thread, so the hash table must be locked. + @synchronized(allAnimatedImagesWeak) { + [allAnimatedImagesWeak addObject:self]; + } +@@ -302,8 +302,8 @@ - (instancetype)initWithAnimatedImageProvider:(id)im + return self; + } + +-+ (instancetype)animatedImageWithAnimatedImageProvider:(id)imageProvider { +- HippyAnimatedImage *animatedImage = [[HippyAnimatedImage alloc] initWithAnimatedImageProvider:imageProvider]; +++ (instancetype)animatedImageWithAnimatedImageProvider:(id)imageProvider { ++ NativeRenderAnimatedImage *animatedImage = [[NativeRenderAnimatedImage alloc] initWithAnimatedImageProvider:imageProvider]; + return animatedImage; + } + +@@ -452,16 +452,16 @@ - (instancetype)initWithAnimatedGIFData:(NSData *)data + // It's only dependent on the image size & number of frames and never changes. + CGFloat animatedImageDataSize + = CGImageGetBytesPerRow(self.posterImage.CGImage) * self.size.height * (self.frameCount - skippedFrameCount) / MEGABYTE; +- if (animatedImageDataSize <= HippyAnimatedImageDataSizeCategoryAll) { ++ if (animatedImageDataSize <= NativeRenderAnimatedImageDataSizeCategoryAll) { + _frameCacheSizeOptimal = self.frameCount; +- } else if (animatedImageDataSize <= HippyAnimatedImageDataSizeCategoryDefault) { ++ } else if (animatedImageDataSize <= NativeRenderAnimatedImageDataSizeCategoryDefault) { + // This value doesn't depend on device memory much because if we're not keeping all frames in memory we will always be decoding 1 + // frame up ahead per 1 frame that gets played and at this point we might as well just keep a small buffer just large enough to keep + // from running out of frames. +- _frameCacheSizeOptimal = HippyAnimatedImageFrameCacheSizeDefault; ++ _frameCacheSizeOptimal = NativeRenderAnimatedImageFrameCacheSizeDefault; + } else { + // The predicted size exceeds the limits to build up a cache and we go into low memory mode from the beginning. +- _frameCacheSizeOptimal = HippyAnimatedImageFrameCacheSizeLowMemory; ++ _frameCacheSizeOptimal = NativeRenderAnimatedImageFrameCacheSizeLowMemory; + } + } else { + // Use the provided value. +@@ -474,10 +474,10 @@ - (instancetype)initWithAnimatedGIFData:(NSData *)data + _allFramesIndexSet = [[NSIndexSet alloc] initWithIndexesInRange:NSMakeRange(0, self.frameCount)]; + + // See the property declarations for descriptions. +- _weakProxy = (id)[HippyWeakProxy weakProxyForObject:self]; ++ _weakProxy = (id)[NativeRenderWeakProxy weakProxyForObject:self]; + + // Register this instance in the weak table for memory notifications. The NSHashTable will clean up after itself when we're gone. +- // Note that HippyAnimatedImages can be created on any thread, so the hash table must be locked. ++ // Note that NativeRenderAnimatedImages can be created on any thread, so the hash table must be locked. + @synchronized(allAnimatedImagesWeak) { + [allAnimatedImagesWeak addObject:self]; + } +@@ -486,7 +486,7 @@ - (instancetype)initWithAnimatedGIFData:(NSData *)data + } + + + (instancetype)animatedImageWithGIFData:(NSData *)data { +- HippyAnimatedImage *animatedImage = [[HippyAnimatedImage alloc] initWithAnimatedGIFData:data]; ++ NativeRenderAnimatedImage *animatedImage = [[NativeRenderAnimatedImage alloc] initWithAnimatedGIFData:data]; + return animatedImage; + } + +@@ -560,7 +560,7 @@ - (void)addFrameIndexesToCache:(NSIndexSet *)frameIndexesToAddToCache { + + // Start streaming requested frames in the background into the cache. + // Avoid capturing self in the block as there's no reason to keep doing work if the animated image went away. +- HippyAnimatedImage *__weak weakSelf = self; ++ NativeRenderAnimatedImage *__weak weakSelf = self; + dispatch_async(self.serialQueue, ^{ + // Produce and cache next needed frame. + void (^frameRangeBlock)(NSRange, BOOL *) = ^(NSRange range, BOOL *stop) { +@@ -627,12 +627,12 @@ + (CGSize)sizeForImage:(id)image { + if ([image isKindOfClass:[UIImage class]]) { + UIImage *uiImage = (UIImage *)image; + imageSize = uiImage.size; +- } else if ([image isKindOfClass:[HippyAnimatedImage class]]) { +- HippyAnimatedImage *animatedImage = (HippyAnimatedImage *)image; ++ } else if ([image isKindOfClass:[NativeRenderAnimatedImage class]]) { ++ NativeRenderAnimatedImage *animatedImage = (NativeRenderAnimatedImage *)image; + imageSize = animatedImage.size; + } else { + // Bear trap to capture bad images; we have seen crashers cropping up on iOS 7. +- RAILog(RAILogLevelError, @""`image` isn't of expected types `UIImage` or `HippyAnimatedImage`: %@"", image); ++ RAILog(RAILogLevelError, @""`image` isn't of expected types `UIImage` or `NativeRenderAnimatedImage`: %@"", image); + } + + return imageSize; +@@ -728,7 +728,7 @@ - (void)growFrameCacheSizeAfterMemoryWarning:(NSNumber *)frameCacheSize { + } + + - (void)resetFrameCacheSizeMaxInternal { +- self.frameCacheSizeMaxInternal = HippyAnimatedImageFrameCacheSizeNoLimit; ++ self.frameCacheSizeMaxInternal = NativeRenderAnimatedImageFrameCacheSizeNoLimit; + RAILog(RAILogLevelDebug, @""Reset frame cache size max (current frame cache size: %lu) for animated image: %@"", + (unsigned long)self.frameCacheSizeCurrent, self); + } +@@ -740,15 +740,15 @@ - (void)didReceiveMemoryWarning:(NSNotification *)notification { + + // If we were about to grow larger, but got rapped on our knuckles by the system again, cancel. + [NSObject cancelPreviousPerformRequestsWithTarget:self.weakProxy selector:@selector(growFrameCacheSizeAfterMemoryWarning:) +- object:@(HippyAnimatedImageFrameCacheSizeGrowAfterMemoryWarning)]; ++ object:@(NativeRenderAnimatedImageFrameCacheSizeGrowAfterMemoryWarning)]; + [NSObject cancelPreviousPerformRequestsWithTarget:self.weakProxy selector:@selector(resetFrameCacheSizeMaxInternal) object:nil]; + + // Go down to the minimum and by that implicitly immediately purge from the cache if needed to not get jettisoned by the system and start + // producing frames on-demand. + RAILog(RAILogLevelDebug, @""Attempt setting frame cache size max to %lu (previous was %lu) after memory warning #%lu for animated image: %@"", +- (unsigned long)HippyAnimatedImageFrameCacheSizeLowMemory, (unsigned long)self.frameCacheSizeMaxInternal, ++ (unsigned long)NativeRenderAnimatedImageFrameCacheSizeLowMemory, (unsigned long)self.frameCacheSizeMaxInternal, + (unsigned long)self.memoryWarningCount, self); +- self.frameCacheSizeMaxInternal = HippyAnimatedImageFrameCacheSizeLowMemory; ++ self.frameCacheSizeMaxInternal = NativeRenderAnimatedImageFrameCacheSizeLowMemory; + + // Schedule growing larger again after a while, but cap our attempts to prevent a periodic sawtooth wave (ramps upward and then sharply drops) of + // memory usage. +@@ -767,7 +767,7 @@ - (void)didReceiveMemoryWarning:(NSNotification *)notification { + const NSTimeInterval kGrowDelay = 2.0; + if ((self.memoryWarningCount - 1) <= kGrowAttemptsMax) { + [self.weakProxy performSelector:@selector(growFrameCacheSizeAfterMemoryWarning:) +- withObject:@(HippyAnimatedImageFrameCacheSizeGrowAfterMemoryWarning) ++ withObject:@(NativeRenderAnimatedImageFrameCacheSizeGrowAfterMemoryWarning) + afterDelay:kGrowDelay]; + } + +@@ -870,7 +870,7 @@ - (NSString *)description { + + #pragma mark - Logging + +-@implementation HippyAnimatedImage (Logging) ++@implementation NativeRenderAnimatedImage (Logging) + + static void (^_logBlock)(NSString *logString, RAILogLevel logLevel) = nil; + static RAILogLevel _logLevel; +@@ -888,22 +888,22 @@ + (void)logStringFromBlock:(NSString * (^)(void))stringBlock withLevel:(RAILogLe + + @end + +-#pragma mark - HippyWeakProxy ++#pragma mark - NativeRenderWeakProxy + +-@interface HippyWeakProxy () ++@interface NativeRenderWeakProxy () + + @property (nonatomic, weak) id target; + + @end + +-@implementation HippyWeakProxy ++@implementation NativeRenderWeakProxy + + #pragma mark Life Cycle + +-// This is the designated creation method of an `HippyWeakProxy` and ++// This is the designated creation method of an `NativeRenderWeakProxy` and + // as a subclass of `NSProxy` it doesn't respond to or need `-init`. + + (instancetype)weakProxyForObject:(id)targetObject { +- HippyWeakProxy *weakProxy = [HippyWeakProxy alloc]; ++ NativeRenderWeakProxy *weakProxy = [NativeRenderWeakProxy alloc]; + weakProxy.target = targetObject; + return weakProxy; + } +diff --git a/renderer/native/ios/renderer/component/image/HippyAnimatedImageView.h b/renderer/native/ios/renderer/component/image/NativeRenderAnimatedImageView.h +similarity index 85% +rename from renderer/native/ios/renderer/component/image/HippyAnimatedImageView.h +rename to renderer/native/ios/renderer/component/image/NativeRenderAnimatedImageView.h +index 69771815e52..e945cd5097a 100644 +--- a/renderer/native/ios/renderer/component/image/HippyAnimatedImageView.h ++++ b/renderer/native/ios/renderer/component/image/NativeRenderAnimatedImageView.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -22,19 +22,19 @@ + + #import + +-@class HippyAnimatedImage; ++@class NativeRenderAnimatedImage; + // +-// An `HippyAnimatedImageView` can take an `HippyAnimatedImage` and plays it automatically when in view hierarchy and stops when removed. ++// An `NativeRenderAnimatedImageView` can take an `NativeRenderAnimatedImage` and plays it automatically when in view hierarchy and stops when removed. + // The animation can also be controlled with the `UIImageView` methods `-start/stop/isAnimating`. + // It is a fully compatible `UIImageView` subclass and can be used as a drop-in component to work with existing code paths expecting to display a + // `UIImage`. Under the hood it uses a `CADisplayLink` for playback, which can be inspected with `currentFrame` & `currentFrameIndex`. + // +-@interface HippyAnimatedImageView : UIImageView ++@interface NativeRenderAnimatedImageView : UIImageView + + // Setting `[UIImageView.image]` to a non-`nil` value clears out existing `animatedImage`. + // And vice versa, setting `animatedImage` will initially populate the `[UIImageView.image]` to its `posterImage` and then start animating and hold + // `currentFrame`. +-@property (nonatomic, strong) HippyAnimatedImage *animatedImage; ++@property (nonatomic, strong) NativeRenderAnimatedImage *animatedImage; + @property (nonatomic, copy) void (^loopCompletionBlock)(NSUInteger loopCountRemaining); + + @property (nonatomic, strong, readonly) UIImage *currentFrame; +diff --git a/renderer/native/ios/renderer/component/image/HippyAnimatedImageView.m b/renderer/native/ios/renderer/component/image/NativeRenderAnimatedImageView.m +similarity index 97% +rename from renderer/native/ios/renderer/component/image/HippyAnimatedImageView.m +rename to renderer/native/ios/renderer/component/image/NativeRenderAnimatedImageView.m +index aacf3aa0eef..00f2b0320e6 100644 +--- a/renderer/native/ios/renderer/component/image/HippyAnimatedImageView.m ++++ b/renderer/native/ios/renderer/component/image/NativeRenderAnimatedImageView.m +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,10 +20,10 @@ + * limitations under the License. + */ + +-#import ""HippyAnimatedImageView.h"" +-#import ""HippyAnimatedImage.h"" ++#import ""NativeRenderAnimatedImageView.h"" ++#import ""NativeRenderAnimatedImage.h"" + +-@interface HippyAnimatedImageView () ++@interface NativeRenderAnimatedImageView () + + // Override of public `readonly` properties as private `readwrite` + @property (nonatomic, strong, readwrite) UIImage *currentFrame; +@@ -39,7 +39,7 @@ @interface HippyAnimatedImageView () + + @end + +-@implementation HippyAnimatedImageView ++@implementation NativeRenderAnimatedImageView + @synthesize runLoopMode = _runLoopMode; + + #pragma mark - Initializers +@@ -90,7 +90,7 @@ - (void)commonInit { + #pragma mark - Accessors + #pragma mark Public + +-- (void)setAnimatedImage:(HippyAnimatedImage *)animatedImage { ++- (void)setAnimatedImage:(NativeRenderAnimatedImage *)animatedImage { + if (![_animatedImage isEqual:animatedImage]) { + if (animatedImage) { + // Clear out the image. +@@ -268,7 +268,7 @@ - (void)startAnimating { + // will retain its target until it is invalidated. We use a weak proxy so that the image view will get deallocated + // independent of the display link's lifetime. Upon image view deallocation, we invalidate the display + // link which will lead to the deallocation of both the display link and the weak proxy. +- HippyWeakProxy *weakProxy = [HippyWeakProxy weakProxyForObject:self]; ++ NativeRenderWeakProxy *weakProxy = [NativeRenderWeakProxy weakProxyForObject:self]; + self.displayLink = [CADisplayLink displayLinkWithTarget:weakProxy selector:@selector(displayDidRefresh:)]; + + [self.displayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:self.runLoopMode]; +diff --git a/renderer/native/ios/renderer/component/image/HippyImageCache.h b/renderer/native/ios/renderer/component/image/NativeRenderImageCache.h +similarity index 92% +rename from renderer/native/ios/renderer/component/image/HippyImageCache.h +rename to renderer/native/ios/renderer/component/image/NativeRenderImageCache.h +index cf1dc6f8cd3..52cf3b18d72 100644 +--- a/renderer/native/ios/renderer/component/image/HippyImageCache.h ++++ b/renderer/native/ios/renderer/component/image/NativeRenderImageCache.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -24,7 +24,7 @@ + + NS_ASSUME_NONNULL_BEGIN + +-@interface HippyImageCache : NSObject ++@interface NativeRenderImageCache : NSObject + + + (instancetype)sharedInstance; + +diff --git a/renderer/native/ios/renderer/component/image/HippyImageCache.m b/renderer/native/ios/renderer/component/image/NativeRenderImageCache.m +similarity index 86% +rename from renderer/native/ios/renderer/component/image/HippyImageCache.m +rename to renderer/native/ios/renderer/component/image/NativeRenderImageCache.m +index 33d2b3f6fa9..94fc99998f3 100644 +--- a/renderer/native/ios/renderer/component/image/HippyImageCache.m ++++ b/renderer/native/ios/renderer/component/image/NativeRenderImageCache.m +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,16 +20,16 @@ + * limitations under the License. + */ + +-#import ""HippyImageCache.h"" ++#import ""NativeRenderImageCache.h"" + +-@interface HippyImageCache () ++@interface NativeRenderImageCache () + @property (nonatomic, strong) NSCache *imageCache; + @end + +-@implementation HippyImageCache ++@implementation NativeRenderImageCache + + + (instancetype)sharedInstance { +- static HippyImageCache *cache = nil; ++ static NativeRenderImageCache *cache = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + cache = [[[self class] alloc] init]; +diff --git a/renderer/native/ios/renderer/component/image/HippyImageView+HippyTouchesImplementation.h b/renderer/native/ios/renderer/component/image/NativeRenderImageView+NativeRenderTouchesImplementation.h +similarity index 74% +rename from renderer/native/ios/renderer/component/image/HippyImageView+HippyTouchesImplementation.h +rename to renderer/native/ios/renderer/component/image/NativeRenderImageView+NativeRenderTouchesImplementation.h +index b0235c36c4b..c025e5b1e6a 100644 +--- a/renderer/native/ios/renderer/component/image/HippyImageView+HippyTouchesImplementation.h ++++ b/renderer/native/ios/renderer/component/image/NativeRenderImageView+NativeRenderTouchesImplementation.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,14 +20,14 @@ + * limitations under the License. + */ + +-#import ""HippyImageView.h"" +-#import ""HippyTouchesProtocol.h"" ++#import ""NativeRenderImageView.h"" ++#import ""NativeRenderTouchesProtocol.h"" + + NS_ASSUME_NONNULL_BEGIN + +-/** This catagory is used to handle touches event for HippyImageView ++/** This catagory is used to handle touches event for NativeRenderImageView + */ +-@interface HippyImageView (HippyTouchesImplementation) ++@interface NativeRenderImageView (NativeRenderTouchesImplementation) + + @end + +diff --git a/renderer/native/ios/renderer/component/image/HippyImageView+HippyTouchesImplementation.mm b/renderer/native/ios/renderer/component/image/NativeRenderImageView+NativeRenderTouchesImplementation.mm +similarity index 82% +rename from renderer/native/ios/renderer/component/image/HippyImageView+HippyTouchesImplementation.mm +rename to renderer/native/ios/renderer/component/image/NativeRenderImageView+NativeRenderTouchesImplementation.mm +index af4fed52379..40179895cc7 100644 +--- a/renderer/native/ios/renderer/component/image/HippyImageView+HippyTouchesImplementation.mm ++++ b/renderer/native/ios/renderer/component/image/NativeRenderImageView+NativeRenderTouchesImplementation.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,12 +20,12 @@ + * limitations under the License. + */ + +-#import ""HippyImageView+HippyTouchesImplementation.h"" +-#import ""UIView+Hippy.h"" +-#import ""UIView+HippyEvent.h"" ++#import ""NativeRenderImageView+NativeRenderTouchesImplementation.h"" ++#import ""UIView+NativeRender.h"" ++#import ""UIView+DomEvent.h"" + #import ""objc/runtime.h"" + +-@implementation HippyImageView (HippyTouchesImplementation) ++@implementation NativeRenderImageView (NativeRenderTouchesImplementation) + + #pragma mark Setter & Getter + - (NSMutableDictionary *)touchesEvents { +@@ -95,26 +95,26 @@ - (void)disablePressInTimer { + objc_setAssociatedObject(self, @selector(enablePressInTimer), nil, OBJC_ASSOCIATION_RETAIN_NONATOMIC); + } + +-#pragma mark HippyTouchesProtol Implementation +-- (void)addViewEvent:(HippyViewEventType)touchEvent eventListener:(OnTouchEventHandler)listener { ++#pragma mark NativeRenderTouchesProtol Implementation ++- (void)addViewEvent:(NativeRenderViewEventType)touchEvent eventListener:(OnTouchEventHandler)listener { + self.userInteractionEnabled = YES; + switch (touchEvent) { +- case HippyViewEventTypeTouchStart: +- case HippyViewEventTypeTouchMove: +- case HippyViewEventTypeTouchEnd: +- case HippyViewEventTypeTouchCancel: ++ case NativeRenderViewEventTypeTouchStart: ++ case NativeRenderViewEventTypeTouchMove: ++ case NativeRenderViewEventTypeTouchEnd: ++ case NativeRenderViewEventTypeTouchCancel: + [self setTouchEventListener:listener forEvent:touchEvent]; + break; +- case HippyViewEventTypeClick: ++ case NativeRenderViewEventTypeClick: + [self addClickEventListener:listener]; + break; +- case HippyViewEventTypeLongClick: ++ case NativeRenderViewEventTypeLongClick: + [self addLongClickEventListener:listener]; + break; +- case HippyViewEventTypePressIn: ++ case NativeRenderViewEventTypePressIn: + [self addPressInEventListener:listener]; + break; +- case HippyViewEventTypePressOut: ++ case NativeRenderViewEventTypePressOut: + [self addPressOutEventListener:listener]; + break; + default: +@@ -122,19 +122,19 @@ - (void)addViewEvent:(HippyViewEventType)touchEvent eventListener:(OnTouchEventH + } + } + +-- (OnTouchEventHandler)eventListenerForEventType:(HippyViewEventType)eventType { ++- (OnTouchEventHandler)eventListenerForEventType:(NativeRenderViewEventType)eventType { + return [[self touchesEvents] objectForKey:@(eventType)]; + } + +-- (void)removeViewEvent:(HippyViewEventType)touchEvent { ++- (void)removeViewEvent:(NativeRenderViewEventType)touchEvent { + [[self touchesEvents] removeObjectForKey:@(touchEvent)]; +- if (HippyViewEventTypeClick == touchEvent) { ++ if (NativeRenderViewEventTypeClick == touchEvent) { + [self removeTapGestureRecognizerIfExists]; + } +- else if (HippyViewEventTypeLongClick == touchEvent) { ++ else if (NativeRenderViewEventTypeLongClick == touchEvent) { + [self removeLongGestureRecognizerIfExists]; + } +- else if (HippyViewEventTypePressIn == touchEvent) { ++ else if (NativeRenderViewEventTypePressIn == touchEvent) { + if ([self pressInEventEnabled]) { + [self disablePressInTimer]; + [self setPressInEventEnabled:NO]; +@@ -143,7 +143,7 @@ - (void)removeViewEvent:(HippyViewEventType)touchEvent { + } + + #pragma mark Touch Event Listener Add Methods +-- (void)setTouchEventListener:(OnTouchEventHandler)eventListener forEvent:(HippyViewEventType)event { ++- (void)setTouchEventListener:(OnTouchEventHandler)eventListener forEvent:(NativeRenderViewEventType)event { + if (eventListener) { + [[self touchesEvents] setObject:eventListener forKey:@(event)]; + } +@@ -153,24 +153,24 @@ - (void)addClickEventListener:(OnTouchEventHandler)eventListener { + [self removeTapGestureRecognizerIfExists]; + UITapGestureRecognizer *tap = [self tapGestureRecognizer]; + [self addGestureRecognizer:tap]; +- [[self touchesEvents] setObject:eventListener forKey:@(HippyViewEventTypeClick)]; ++ [[self touchesEvents] setObject:eventListener forKey:@(NativeRenderViewEventTypeClick)]; + } + + - (void)addLongClickEventListener:(OnTouchEventHandler)eventListener { + [self removeLongGestureRecognizerIfExists]; + UILongPressGestureRecognizer *longPress = [self longGestureRecognizer]; + [self addGestureRecognizer:longPress]; +- [[self touchesEvents] setObject:eventListener forKey:@(HippyViewEventTypeLongClick)]; ++ [[self touchesEvents] setObject:eventListener forKey:@(NativeRenderViewEventTypeLongClick)]; + } + + - (void)addPressInEventListener:(OnTouchEventHandler)eventListener { + [self disablePressInTimer]; + [self setPressInEventEnabled:YES]; +- [[self touchesEvents] setObject:eventListener forKey:@(HippyViewEventTypePressIn)]; ++ [[self touchesEvents] setObject:eventListener forKey:@(NativeRenderViewEventTypePressIn)]; + } + + - (void)addPressOutEventListener:(OnTouchEventHandler)eventListener { +- [[self touchesEvents] setObject:eventListener forKey:@(HippyViewEventTypePressOut)]; ++ [[self touchesEvents] setObject:eventListener forKey:@(NativeRenderViewEventTypePressOut)]; + } + + #pragma mark Touches Event Handler +@@ -178,7 +178,7 @@ - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { + if ([self pressInEventEnabled]) { + [self enablePressInTimer]; + } +- OnTouchEventHandler listener = [self eventListenerForEventType:HippyViewEventTypeTouchStart]; ++ OnTouchEventHandler listener = [self eventListenerForEventType:NativeRenderViewEventTypeTouchStart]; + if (listener) { + UITouch *touch = [touches anyObject]; + CGPoint point = [touch locationInView:[self hippyRootView]]; +@@ -194,7 +194,7 @@ - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { + [self disablePressInTimer]; + } + [self handlePressOutEvent]; +- OnTouchEventHandler listener = [self eventListenerForEventType:HippyViewEventTypeTouchEnd]; ++ OnTouchEventHandler listener = [self eventListenerForEventType:NativeRenderViewEventTypeTouchEnd]; + if (listener) { + UITouch *touch = [touches anyObject]; + CGPoint point = [touch locationInView:[self hippyRootView]]; +@@ -206,7 +206,7 @@ - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { + } + + - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { +- OnTouchEventHandler listener = [self eventListenerForEventType:HippyViewEventTypeTouchMove]; ++ OnTouchEventHandler listener = [self eventListenerForEventType:NativeRenderViewEventTypeTouchMove]; + if (listener) { + UITouch *touch = [touches anyObject]; + CGPoint point = [touch locationInView:[self hippyRootView]]; +@@ -222,7 +222,7 @@ - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event + if ([self pressInEventEnabled]) { + [self disablePressInTimer]; + } +- OnTouchEventHandler listener = [self eventListenerForEventType:HippyViewEventTypeTouchCancel]; ++ OnTouchEventHandler listener = [self eventListenerForEventType:NativeRenderViewEventTypeTouchCancel]; + if (listener) { + UITouch *touch = [touches anyObject]; + CGPoint point = [touch locationInView:[self hippyRootView]]; +@@ -234,7 +234,7 @@ - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event + } + + - (void)handleClickEvent { +- OnTouchEventHandler listener = [self eventListenerForEventType:HippyViewEventTypeClick]; ++ OnTouchEventHandler listener = [self eventListenerForEventType:NativeRenderViewEventTypeClick]; + if (listener) { + UITapGestureRecognizer *tap = objc_getAssociatedObject(self, @selector(tapGestureRecognizer)); + CGPoint point = [tap locationInView:[self hippyRootView]]; +@@ -243,7 +243,7 @@ - (void)handleClickEvent { + } + + - (void)handleLongClickEvent { +- OnTouchEventHandler listener = [self eventListenerForEventType:HippyViewEventTypeLongClick]; ++ OnTouchEventHandler listener = [self eventListenerForEventType:NativeRenderViewEventTypeLongClick]; + if (listener) { + UILongPressGestureRecognizer *longPress = objc_getAssociatedObject(self, @selector(longGestureRecognizer)); + if (longPress.state == UIGestureRecognizerStateBegan) { +@@ -255,14 +255,14 @@ - (void)handleLongClickEvent { + + - (void)handlePressInEvent { + [self disablePressInTimer]; +- OnTouchEventHandler listener = [self eventListenerForEventType:HippyViewEventTypePressIn]; ++ OnTouchEventHandler listener = [self eventListenerForEventType:NativeRenderViewEventTypePressIn]; + if (listener) { + listener(CGPointZero); + } + } + + - (void)handlePressOutEvent { +- OnTouchEventHandler listener = [self eventListenerForEventType:HippyViewEventTypePressOut]; ++ OnTouchEventHandler listener = [self eventListenerForEventType:NativeRenderViewEventTypePressOut]; + if (listener) { + listener(CGPointZero); + } +diff --git a/renderer/native/ios/renderer/component/image/NativeRenderImageView.h b/renderer/native/ios/renderer/component/image/NativeRenderImageView.h +new file mode 100644 +index 00000000000..e9d5d8e908d +--- /dev/null ++++ b/renderer/native/ios/renderer/component/image/NativeRenderImageView.h +@@ -0,0 +1,94 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * NativeRender available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ++#import ""NativeRenderComponentProtocol.h"" ++#import ""NativeRenderConvert.h"" ++#import ""NativeRenderAnimatedImageView.h"" ++#import ""NativeRenderImageProviderProtocol.h"" ++ ++@class NativeRenderImageView; ++ ++@interface NativeRenderAnimatedImageOperation : NSOperation { ++ NSData *_animatedImageData; ++ NSString *_url; ++ __weak NativeRenderImageView *_imageView; ++ id _imageProvider; ++} ++ ++- (id)initWithAnimatedImageData:(NSData *)data imageView:(NativeRenderImageView *)imageView imageURL:(NSString *)url; ++- (id)initWithAnimatedImageProvider:(id)imageProvider imageView:(NativeRenderImageView *)imageView imageURL:(NSString *)url; ++ ++@end ++ ++typedef NS_ENUM(NSInteger, NativeRenderResizeMode) { ++ NativeRenderResizeModeCover = UIViewContentModeScaleAspectFill, ++ NativeRenderResizeModeContain = UIViewContentModeScaleAspectFit, ++ NativeRenderResizeModeStretch = UIViewContentModeScaleToFill, ++ NativeRenderResizeModeCenter = UIViewContentModeCenter, ++ NativeRenderResizeModeRepeat = -1, // Use negative values to avoid conflicts with iOS enum values. ++}; ++ ++typedef NS_ENUM(NSInteger, NativeRenderShapeMode) { ++ NativeRenderResizeModeDefalt = 0, ++ NativeRenderResizeModeCircle, ++}; ++ ++@interface NativeRenderImageView : NativeRenderAnimatedImageView ++ ++@property (nonatomic, assign) CGFloat blurRadius; ++@property (nonatomic, assign) UIEdgeInsets capInsets; ++@property (nonatomic, assign) NativeRenderResizeMode resizeMode; ++@property (nonatomic, copy) NSArray *source; ++@property (nonatomic, strong) UIImage *defaultImage; ++@property (nonatomic, assign) UIImageRenderingMode renderingMode; ++@property (nonatomic, assign) BOOL downSample; ++@property (nonatomic, assign) CGFloat borderTopLeftRadius; ++@property (nonatomic, assign) CGFloat borderTopRightRadius; ++@property (nonatomic, assign) CGFloat borderBottomLeftRadius; ++@property (nonatomic, assign) CGFloat borderBottomRightRadius; ++@property (nonatomic, assign) CGFloat borderRadius; ++@property (nonatomic, assign) NativeRenderShapeMode shape; ++ ++@property (nonatomic, copy) NativeRenderDirectEventBlock onLoadStart; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onProgress; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onError; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onLoad; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onLoadEnd; ++ ++- (void)reloadImage; ++ ++- (void)updateImage:(UIImage *)image; ++ ++- (void)setImageProvider:(id)imageProvider; ++ ++- (void)clearImageIfDetached; ++ ++- (BOOL)needsUpdateCornerRadiusManully; ++@end ++ ++@interface NativeRenderConvert (NativeRenderResizeMode) ++ +++ (NativeRenderResizeMode)NativeRenderResizeMode:(id)json; +++ (NativeRenderShapeMode)NativeRenderShapeMode:(id)json; ++ ++@end +diff --git a/renderer/native/ios/renderer/component/image/HippyImageView.m b/renderer/native/ios/renderer/component/image/NativeRenderImageView.m +similarity index 85% +rename from renderer/native/ios/renderer/component/image/HippyImageView.m +rename to renderer/native/ios/renderer/component/image/NativeRenderImageView.m +index 2e72d3157e2..36031735a05 100644 +--- a/renderer/native/ios/renderer/component/image/HippyImageView.m ++++ b/renderer/native/ios/renderer/component/image/NativeRenderImageView.m +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,14 +20,14 @@ + * limitations under the License. + */ + +-#import ""HippyImageView.h"" +-#import ""HippyUtils.h"" +-#import ""HippyAnimatedImage.h"" ++#import ""NativeRenderImageView.h"" ++#import ""NativeRenderUtils.h"" ++#import ""NativeRenderAnimatedImage.h"" + #import +-#import ""UIView+AppearEvent.h"" +-#import ""RenderErrorHandler.h"" ++#import ""UIView+MountEvent.h"" ++#import ""NativeRenderErrorHandler.h"" + +-NSString *const HippyImageErrorDomain = @""HippyImageErrorDomain""; ++NSString *const NativeRenderImageErrorDomain = @""NativeRenderImageErrorDomain""; + + typedef NS_ENUM(NSUInteger, ImageDataError) { + ImageDataUnavailable = 10001, +@@ -52,7 +52,7 @@ typedef NS_ENUM(NSUInteger, ImageDataError) { + return _animatedImageOQ; + } + +-static BOOL HippyImageNeedsShrinkForSize(UIImage *inputImage, CGSize size) { ++static BOOL NativeRenderImageNeedsShrinkForSize(UIImage *inputImage, CGSize size) { + CGSize inputImageSize = inputImage.size; + if (inputImageSize.width > size.width || inputImageSize.height > size.height) { + return YES; +@@ -60,7 +60,7 @@ static BOOL HippyImageNeedsShrinkForSize(UIImage *inputImage, CGSize size) { + return NO; + } + +-UIImage *HippyBlurredImageWithRadiusv(UIImage *inputImage, CGFloat radius, NSError **error) { ++UIImage *NativeRenderBlurredImageWithRadiusv(UIImage *inputImage, CGFloat radius, NSError **error) { + CGImageRef imageRef = inputImage.CGImage; + CGFloat imageScale = inputImage.scale; + UIImageOrientation imageOrientation = inputImage.imageOrientation; +@@ -185,32 +185,32 @@ static BOOL HippyImageNeedsShrinkForSize(UIImage *inputImage, CGSize size) { + } + if (error) { + NSDictionary *useInfo = @{NSLocalizedDescriptionKey: exception.reason ?: @""""}; +- *error = [NSError errorWithDomain:HippyImageErrorDomain code:ImageDataBlurredError userInfo:useInfo]; ++ *error = [NSError errorWithDomain:NativeRenderImageErrorDomain code:ImageDataBlurredError userInfo:useInfo]; + } + return inputImage; + } + } + + NSError *imageErrorFromParams(NSInteger errorCode, NSString *errorDescription) { +- return [NSError errorWithDomain:HippyImageErrorDomain code:errorCode userInfo:@ { NSLocalizedDescriptionKey: errorDescription ?: @"""" }]; ++ return [NSError errorWithDomain:NativeRenderImageErrorDomain code:errorCode userInfo:@ { NSLocalizedDescriptionKey: errorDescription ?: @"""" }]; + } + +-@interface HippyImageView () { ++@interface NativeRenderImageView () { + __weak CALayer *_borderWidthLayer; + BOOL _needsUpdateBorderRadiusManully; + CGSize _size; + BOOL _needsReloadImage; + BOOL _needsUpdateImage; +- id _imageProvider; ++ id _imageProvider; + } + +-@property (nonatomic) HippyAnimatedImageOperation *animatedImageOperation; ++@property (nonatomic) NativeRenderAnimatedImageOperation *animatedImageOperation; + @property (atomic, strong) NSString *pendingImageSourceUri; // The image source that's being loaded from the network + @property (atomic, strong) NSString *imageSourceUri; // The image source that's currently displayed + + @end + +-@implementation HippyImageView ++@implementation NativeRenderImageView + + - (instancetype)initWithFrame:(CGRect)frame { + if (self = [super initWithFrame:frame]) { +@@ -220,6 +220,7 @@ - (instancetype)initWithFrame:(CGRect)frame { + _borderTopRightRadius = CGFLOAT_MAX; + _borderBottomLeftRadius = CGFLOAT_MAX; + _borderBottomRightRadius = CGFLOAT_MAX; ++ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveMemoryWarning) name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; + } + return self; + } +@@ -310,19 +311,19 @@ - (void)setFrame:(CGRect)frame { + [self updateCornerRadius]; + } + +-- (void)setShape:(HippyShapeMode)shape { ++- (void)setShape:(NativeRenderShapeMode)shape { + if (shape != _shape) { + _shape = shape; +- if (shape == HippyResizeModeCircle) { ++ if (shape == NativeRenderResizeModeCircle) { + self.contentMode = UIViewContentModeScaleAspectFit; + } + } + } + +-- (void)setResizeMode:(HippyResizeMode)resizeMode { ++- (void)setResizeMode:(NativeRenderResizeMode)resizeMode { + if (_resizeMode != resizeMode) { + _resizeMode = resizeMode; +- if (_resizeMode == HippyResizeModeRepeat) { ++ if (_resizeMode == NativeRenderResizeModeRepeat) { + self.contentMode = UIViewContentModeScaleToFill; + } else { + self.contentMode = (UIViewContentMode)resizeMode; +@@ -340,7 +341,7 @@ - (void)setRenderingMode:(UIImageRenderingMode)renderingMode { + } + } + +-- (void)setImageProvider:(id)imageProvider { ++- (void)setImageProvider:(id)imageProvider { + if (_imageProvider != imageProvider) { + _imageProvider = imageProvider; + } +@@ -380,7 +381,7 @@ - (void)reloadImage { + [_animatedImageOperation cancel]; + } + _animatedImageOperation = +- [[HippyAnimatedImageOperation alloc] initWithAnimatedImageProvider:_imageProvider ++ [[NativeRenderAnimatedImageOperation alloc] initWithAnimatedImageProvider:_imageProvider + imageView:self + imageURL:imagePath]; + [animated_image_queue() addOperation:_animatedImageOperation]; +@@ -422,7 +423,7 @@ - (void)loadImage:(UIImage *)image url:(NSString *)url error:(NSError *)error ne + } + __weak __typeof(self) weakSelf = self; + void (^setImageBlock)(UIImage *) = ^(UIImage *image) { +- HippyImageView *strongSelf = weakSelf; ++ NativeRenderImageView *strongSelf = weakSelf; + if (!strongSelf) { + return; + } +@@ -445,17 +446,17 @@ - (void)loadImage:(UIImage *)image url:(NSString *)url error:(NSError *)error ne + // Blur on a background thread to avoid blocking interaction + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + NSError *error = nil; +- UIImage *blurredImage = HippyBlurredImageWithRadiusv(image, br, &error); ++ UIImage *blurredImage = NativeRenderBlurredImageWithRadiusv(image, br, &error); + if (error) { +- NSError *finalError = HippyErrorFromErrorAndModuleName(error, @""unknown""); +- RenderFatal(finalError); ++ NSError *finalError = NativeRenderErrorFromErrorAndModuleName(error, @""unknown""); ++ NativeRenderFatal(finalError); + } +- HippyExecuteOnMainQueue(^{ ++ NativeRenderExecuteOnMainQueue(^{ + setImageBlock(blurredImage); + }); + }); + } else { +- HippyExecuteOnMainQueue(^{ ++ NativeRenderExecuteOnMainQueue(^{ + setImageBlock(image); + }); + } +@@ -473,11 +474,11 @@ - (void)updateImage:(UIImage *)image { + image = [image imageWithRenderingMode:_renderingMode]; + } + +- if (HippyResizeModeRepeat == _resizeMode) { ++ if (NativeRenderResizeModeRepeat == _resizeMode) { + image = [image resizableImageWithCapInsets:_capInsets resizingMode:UIImageResizingModeTile]; + } +- else if (HippyResizeModeCenter == _resizeMode) { +- if (HippyImageNeedsShrinkForSize(image, self.bounds.size)) { ++ else if (NativeRenderResizeModeCenter == _resizeMode) { ++ if (NativeRenderImageNeedsShrinkForSize(image, self.bounds.size)) { + self.contentMode = UIViewContentModeScaleAspectFit; + } + } +@@ -486,7 +487,7 @@ - (void)updateImage:(UIImage *)image { + image = [image resizableImageWithCapInsets:_capInsets resizingMode:UIImageResizingModeStretch]; + } + +- if (_shape == HippyResizeModeCircle) { ++ if (_shape == NativeRenderResizeModeCircle) { + image = [self circleImage:image]; + } + +@@ -528,24 +529,24 @@ - (void)updateCornerRadius { + } + if ([self needsUpdateCornerRadiusManully] && ![self isAllCornerRadiussEqualToCornerRadius]) { + CGRect contentRect = self.bounds; +-#ifdef HippyLog ++#ifdef NativeRenderLog + CGFloat width = CGRectGetWidth(contentRect); + CGFloat height = CGRectGetHeight(contentRect); + BOOL flag1 = _borderTopLeftRadius <= MIN(width, height) / 2; + if (!flag1) { +- //HippyLog(@""[warning] _borderTopLeftRadius must be shorter than width / 2""); ++ //NativeRenderLog(@""[warning] _borderTopLeftRadius must be shorter than width / 2""); + } + BOOL flag2 = _borderTopRightRadius <= MIN(width, height) / 2; + if (!flag2) { +- //HippyLog(@""[warning] _borderTopRightRadius must be shorter than width / 2""); ++ //NativeRenderLog(@""[warning] _borderTopRightRadius must be shorter than width / 2""); + } + BOOL flag3 = _borderBottomLeftRadius <= MIN(width, height) / 2; + if (!flag3) { +- //HippyLog(@""[warning] _borderBottomLeftRadius must be shorter than width / 2""); ++ //NativeRenderLog(@""[warning] _borderBottomLeftRadius must be shorter than width / 2""); + } + BOOL flag4 = _borderBottomRightRadius <= MIN(width, height) / 2; + if (!flag4) { +- //HippyLog(@""[warning] _borderBottomRightRadius must be shorter than width / 2""); ++ //NativeRenderLog(@""[warning] _borderBottomRightRadius must be shorter than width / 2""); + } + #endif + +@@ -664,27 +665,27 @@ - (BorderRadiusStruct)properBorderRadius { + + @end + +-@implementation HippyConvert (HippyResizeMode) ++@implementation NativeRenderConvert (NativeRenderResizeMode) + +-HIPPY_ENUM_CONVERTER(HippyResizeMode, (@{ +- @""cover"": @(HippyResizeModeCover), +- @""contain"": @(HippyResizeModeContain), +- @""stretch"": @(HippyResizeModeStretch), +- @""center"": @(HippyResizeModeCenter), +- @""repeat"": @(HippyResizeModeRepeat), ++HIPPY_ENUM_CONVERTER(NativeRenderResizeMode, (@{ ++ @""cover"": @(NativeRenderResizeModeCover), ++ @""contain"": @(NativeRenderResizeModeContain), ++ @""stretch"": @(NativeRenderResizeModeStretch), ++ @""center"": @(NativeRenderResizeModeCenter), ++ @""repeat"": @(NativeRenderResizeModeRepeat), + }), +- HippyResizeModeStretch, integerValue) ++ NativeRenderResizeModeStretch, integerValue) + +-HIPPY_ENUM_CONVERTER(HippyShapeMode, (@{ +- @""normal"": @(HippyResizeModeDefalt), +- @""circle"": @(HippyResizeModeCircle) +-}), HippyResizeModeDefalt, integerValue) ++HIPPY_ENUM_CONVERTER(NativeRenderShapeMode, (@{ ++ @""normal"": @(NativeRenderResizeModeDefalt), ++ @""circle"": @(NativeRenderResizeModeCircle) ++}), NativeRenderResizeModeDefalt, integerValue) + + @end + +-@implementation HippyAnimatedImageOperation ++@implementation NativeRenderAnimatedImageOperation + +-- (id)initWithAnimatedImageProvider:(id)imageProvider imageView:(HippyImageView *)imageView imageURL:(NSString *)url { ++- (id)initWithAnimatedImageProvider:(id)imageProvider imageView:(NativeRenderImageView *)imageView imageURL:(NSString *)url { + self = [super init]; + if (self) { + _imageProvider = imageProvider; +@@ -694,7 +695,7 @@ - (id)initWithAnimatedImageProvider:(id)imageProvide + return self; + } + +-- (id)initWithAnimatedImageData:(NSData *)data imageView:(HippyImageView *)imageView imageURL:(NSString *)url { ++- (id)initWithAnimatedImageData:(NSData *)data imageView:(NativeRenderImageView *)imageView imageURL:(NSString *)url { + self = [super init]; + if (self) { + _animatedImageData = data; +@@ -706,17 +707,17 @@ - (id)initWithAnimatedImageData:(NSData *)data imageView:(HippyImageView *)image + + - (void)main { + if (![self isCancelled] && (_animatedImageData || _imageProvider) && _imageView) { +- HippyAnimatedImage *animatedImage = nil; ++ NativeRenderAnimatedImage *animatedImage = nil; + if (_imageProvider) { +- animatedImage = [HippyAnimatedImage animatedImageWithAnimatedImageProvider:_imageProvider]; ++ animatedImage = [NativeRenderAnimatedImage animatedImageWithAnimatedImageProvider:_imageProvider]; + } else if (_animatedImageData) { +- animatedImage = [HippyAnimatedImage animatedImageWithGIFData:_animatedImageData]; ++ animatedImage = [NativeRenderAnimatedImage animatedImageWithGIFData:_animatedImageData]; + } + if (![self isCancelled] && _imageView) { +- __weak HippyImageView *wIV = _imageView; ++ __weak NativeRenderImageView *wIV = _imageView; + __weak NSString *wURL = _url; + dispatch_async(dispatch_get_main_queue(), ^{ +- HippyImageView *sIV = wIV; ++ NativeRenderImageView *sIV = wIV; + NSString *sURL = wURL; + if (sIV && sURL) { + [sIV loadImage:animatedImage.posterImage url:sURL error:nil needBlur:YES]; +diff --git a/renderer/native/ios/renderer/component/listview/HippyBaseListItemViewManager.h b/renderer/native/ios/renderer/component/image/NativeRenderImageViewManager.h +similarity index 85% +rename from renderer/native/ios/renderer/component/listview/HippyBaseListItemViewManager.h +rename to renderer/native/ios/renderer/component/image/NativeRenderImageViewManager.h +index 1b0af562930..bb939db60aa 100644 +--- a/renderer/native/ios/renderer/component/listview/HippyBaseListItemViewManager.h ++++ b/renderer/native/ios/renderer/component/image/NativeRenderImageViewManager.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,8 +20,8 @@ + * limitations under the License. + */ + +-#import ""HippyViewManager.h"" ++#import ""NativeRenderViewManager.h"" + +-@interface HippyBaseListItemViewManager : HippyViewManager ++@interface NativeRenderImageViewManager : NativeRenderViewManager + + @end +diff --git a/renderer/native/ios/renderer/component/image/HippyImageViewManager.mm b/renderer/native/ios/renderer/component/image/NativeRenderImageViewManager.mm +similarity index 61% +rename from renderer/native/ios/renderer/component/image/HippyImageViewManager.mm +rename to renderer/native/ios/renderer/component/image/NativeRenderImageViewManager.mm +index f605fc2cfe5..95ba2f36b33 100644 +--- a/renderer/native/ios/renderer/component/image/HippyImageViewManager.mm ++++ b/renderer/native/ios/renderer/component/image/NativeRenderImageViewManager.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,41 +20,41 @@ + * limitations under the License. + */ + +-#import ""HippyImageViewManager.h"" +-#import ""HippyImageView.h"" +-#import ""HippyImageDataLoader.h"" +-#import ""HippyDefaultImageProvider.h"" +-#import ""HippyUtils.h"" ++#import ""NativeRenderImageViewManager.h"" ++#import ""NativeRenderImageView.h"" ++#import ""NativeRenderImageDataLoader.h"" ++#import ""NativeRenderDefaultImageProvider.h"" ++#import ""NativeRenderUtils.h"" + #import ""UIView+Sequence.h"" + +-@interface HippyImageViewManager () { +- id _imageDataLoader; +- Class _imageProviderClass; ++@interface NativeRenderImageViewManager () { ++ id _imageDataLoader; ++ Class _imageProviderClass; + NSUInteger _sequence; + } + + @end + +-@implementation HippyImageViewManager +- +-HIPPY_EXPORT_VIEW_PROPERTY(blurRadius, CGFloat) +-HIPPY_EXPORT_VIEW_PROPERTY(capInsets, UIEdgeInsets) +-HIPPY_EXPORT_VIEW_PROPERTY(resizeMode, HippyResizeMode) +-HIPPY_EXPORT_VIEW_PROPERTY(onLoadStart, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onProgress, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onError, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onPartialLoad, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onLoad, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onLoadEnd, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(downSample, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(shape, HippyShapeMode) +-HIPPY_CUSTOM_VIEW_PROPERTY(src, NSString, HippyImageView) { +- NSString *path = [HippyConvert NSString:json]; ++@implementation NativeRenderImageViewManager ++ ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(blurRadius, CGFloat) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(capInsets, UIEdgeInsets) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(resizeMode, NativeRenderResizeMode) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onLoadStart, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onProgress, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onError, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onPartialLoad, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onLoad, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onLoadEnd, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(downSample, BOOL) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(shape, NativeRenderShapeMode) ++NATIVE_RENDER_CUSTOM_VIEW_PROPERTY(src, NSString, NativeRenderImageView) { ++ NSString *path = [NativeRenderConvert NSString:json]; + [self loadImageSource:path forView:view]; + } + +-HIPPY_CUSTOM_VIEW_PROPERTY(source, NSArray, HippyImageView) { +- NSArray *pathSources = [HippyConvert NSArray:json]; ++NATIVE_RENDER_CUSTOM_VIEW_PROPERTY(source, NSArray, NativeRenderImageView) { ++ NSArray *pathSources = [NativeRenderConvert NSArray:json]; + if ([pathSources isKindOfClass:[NSArray class]]) { + NSDictionary *dicSource = [pathSources firstObject]; + NSString *path = dicSource[@""uri""]; +@@ -62,13 +62,13 @@ @implementation HippyImageViewManager + } + } + +-- (void)loadImageSource:(NSString *)path forView:(HippyImageView *)view { ++- (void)loadImageSource:(NSString *)path forView:(NativeRenderImageView *)view { + if ([self.renderContext.frameworkProxy respondsToSelector:@selector(standardizeAssetUrlString:forRenderContext:)]) { + path = [self.renderContext.frameworkProxy standardizeAssetUrlString:path forRenderContext:self.renderContext]; + } +- id imageDataLoader = [self imageDataLoader]; +- __weak HippyImageView *weakView = view; +- NSURL *url = HippyURLWithString(path, nil); ++ id imageDataLoader = [self imageDataLoader]; ++ __weak NativeRenderImageView *weakView = view; ++ NSURL *url = NativeRenderURLWithString(path, nil); + NSUInteger sequence = _sequence++; + weakView.sequence = sequence; + [imageDataLoader loadImageAtUrl:url sequence:sequence progress:^(NSUInteger current, NSUInteger total) { +@@ -76,7 +76,7 @@ - (void)loadImageSource:(NSString *)path forView:(HippyImageView *)view { + if (!error && weakView) { + dispatch_async(dispatch_get_main_queue(), ^{ + if (weakView) { +- HippyImageView *strongView = weakView; ++ NativeRenderImageView *strongView = weakView; + NSUInteger viewSeq = strongView.sequence; + if (seq == viewSeq) { + if ([result isKindOfClass:[UIImage class]]) { +@@ -84,7 +84,7 @@ - (void)loadImageSource:(NSString *)path forView:(HippyImageView *)view { + } + else if ([result isKindOfClass:[NSData class]]) { + Class cls = [self imageProviderClass]; +- id imageProvider = [[cls alloc] init]; ++ id imageProvider = [[cls alloc] init]; + imageProvider.scale = [[UIScreen mainScreen] scale]; + imageProvider.imageDataPath = path; + [imageProvider setImageData:(NSData *)result]; +@@ -99,29 +99,29 @@ - (void)loadImageSource:(NSString *)path forView:(HippyImageView *)view { + + } + +-HIPPY_CUSTOM_VIEW_PROPERTY(tintColor, UIColor, HippyImageView) { +- view.tintColor = [HippyConvert UIColor:json] ?: defaultView.tintColor; ++NATIVE_RENDER_CUSTOM_VIEW_PROPERTY(tintColor, UIColor, NativeRenderImageView) { ++ view.tintColor = [NativeRenderConvert UIColor:json] ?: defaultView.tintColor; + view.renderingMode = json ? UIImageRenderingModeAlwaysTemplate : defaultView.renderingMode; + } + +-HIPPY_CUSTOM_VIEW_PROPERTY(defaultSource, NSString, HippyImageView) { +- NSString *source = [HippyConvert NSString:json]; ++NATIVE_RENDER_CUSTOM_VIEW_PROPERTY(defaultSource, NSString, NativeRenderImageView) { ++ NSString *source = [NativeRenderConvert NSString:json]; + if ([self.renderContext.frameworkProxy respondsToSelector:@selector(standardizeAssetUrlString:forRenderContext:)]) { + source = [self.renderContext.frameworkProxy standardizeAssetUrlString:source forRenderContext:self.renderContext]; + } +- id imageDataLoader = [self imageDataLoader]; +- __weak HippyImageView *weakView = view; +- NSURL *url = HippyURLWithString(source, nil); ++ id imageDataLoader = [self imageDataLoader]; ++ __weak NativeRenderImageView *weakView = view; ++ NSURL *url = NativeRenderURLWithString(source, nil); + NSUInteger sequence = _sequence++; + [imageDataLoader loadImageAtUrl:url sequence:sequence progress:^(NSUInteger current, NSUInteger total) { + } completion:^(NSUInteger seq, id result, NSURL *url, NSError *error) { + if (!error && weakView) { + dispatch_async(dispatch_get_main_queue(), ^{ + if (weakView) { +- HippyImageView *strongView = weakView; ++ NativeRenderImageView *strongView = weakView; + if ([result isKindOfClass:[NSData class]]) { + Class cls = [self imageProviderClass]; +- id imageProvider = [[cls alloc] init]; ++ id imageProvider = [[cls alloc] init]; + imageProvider.scale = [UIScreen mainScreen].scale; + [imageProvider setImageData:(NSData *)result]; + strongView.defaultImage = [imageProvider image]; +@@ -136,9 +136,9 @@ - (void)loadImageSource:(NSString *)path forView:(HippyImageView *)view { + } + + #define HIPPY_VIEW_BORDER_RADIUS_PROPERTY(SIDE) \ +- HIPPY_CUSTOM_VIEW_PROPERTY(border##SIDE##Radius, CGFloat, HippyImageView) { \ ++ NATIVE_RENDER_CUSTOM_VIEW_PROPERTY(border##SIDE##Radius, CGFloat, NativeRenderImageView) { \ + if ([view respondsToSelector:@selector(setBorder##SIDE##Radius:)]) { \ +- view.border##SIDE##Radius = json ? [HippyConvert CGFloat:json] : defaultView.border##SIDE##Radius; \ ++ view.border##SIDE##Radius = json ? [NativeRenderConvert CGFloat:json] : defaultView.border##SIDE##Radius; \ + } \ + } + +@@ -148,33 +148,33 @@ - (void)loadImageSource:(NSString *)path forView:(HippyImageView *)view { + HIPPY_VIEW_BORDER_RADIUS_PROPERTY(BottomRight) + + - (UIView *)view { +- return [[HippyImageView alloc] init]; ++ return [[NativeRenderImageView alloc] init]; + } + +-- (Class)imageProviderClass { ++- (Class)imageProviderClass { + if (!_imageProviderClass) { + if ([self.renderContext.frameworkProxy respondsToSelector:@selector(imageProviderClassForRenderContext:)]) { + _imageProviderClass = [self.renderContext.frameworkProxy imageProviderClassForRenderContext:self.renderContext]; + } + else { +- _imageProviderClass = [HippyDefaultImageProvider class]; ++ _imageProviderClass = [NativeRenderDefaultImageProvider class]; + } + } + return _imageProviderClass; + } + +-- (id)getNewImageProviderInstance { ++- (id)getNewImageProviderInstance { + Class cls = [self imageProviderClass]; + return [[cls alloc] init]; + } + +-- (id)imageDataLoader { ++- (id)imageDataLoader { + if (!_imageDataLoader) { + if ([self.renderContext.frameworkProxy respondsToSelector:@selector(imageDataLoaderForRenderContext:)]) { + _imageDataLoader = [self.renderContext.frameworkProxy imageDataLoaderForRenderContext:self.renderContext]; + } + if (!_imageDataLoader) { +- _imageDataLoader = [[HippyImageDataLoader alloc] init]; ++ _imageDataLoader = [[NativeRenderImageDataLoader alloc] init]; + } + } + return _imageDataLoader; +diff --git a/renderer/native/ios/renderer/component/image/UIView+Sequence.h b/renderer/native/ios/renderer/component/image/UIView+Sequence.h +index 264684bbbee..3b94f15aeac 100644 +--- a/renderer/native/ios/renderer/component/image/UIView+Sequence.h ++++ b/renderer/native/ios/renderer/component/image/UIView+Sequence.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +diff --git a/renderer/native/ios/renderer/component/image/UIView+Sequence.m b/renderer/native/ios/renderer/component/image/UIView+Sequence.m +index 3b0d4ef6ef1..86c0499584c 100644 +--- a/renderer/native/ios/renderer/component/image/UIView+Sequence.m ++++ b/renderer/native/ios/renderer/component/image/UIView+Sequence.m +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +diff --git a/renderer/native/ios/renderer/component/listview/HippyBaseListItemViewManager.mm b/renderer/native/ios/renderer/component/listview/HippyBaseListItemViewManager.mm +deleted file mode 100644 +index b63bd35439a..00000000000 +--- a/renderer/native/ios/renderer/component/listview/HippyBaseListItemViewManager.mm ++++ /dev/null +@@ -1,44 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import ""HippyBaseListItemViewManager.h"" +-#import ""HippyBaseListItemView.h"" +-#import ""HippyBaseListItemShadowView.h"" +- +-@implementation HippyBaseListItemViewManager +- +-HIPPY_EXPORT_VIEW_PROPERTY(type, id) +-HIPPY_EXPORT_VIEW_PROPERTY(isSticky, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(onAppear, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onDisappear, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onWillAppear, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onWillDisappear, HippyDirectEventBlock) +- +-- (UIView *)view { +- return [HippyBaseListItemView new]; +-} +- +-- (HippyShadowView *)shadowView { +- return [HippyBaseListItemShadowView new]; +-} +- +-@end +diff --git a/renderer/native/ios/renderer/component/listview/HippyBaseListViewDataSource.h b/renderer/native/ios/renderer/component/listview/HippyBaseListViewDataSource.h +deleted file mode 100644 +index f0fa0b8057a..00000000000 +--- a/renderer/native/ios/renderer/component/listview/HippyBaseListViewDataSource.h ++++ /dev/null +@@ -1,27 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import ""HippyWaterfallViewDataSource.h"" +- +-@interface HippyBaseListViewDataSource : HippyWaterfallViewDataSource +- +-@end +diff --git a/renderer/native/ios/renderer/component/listview/HippyBaseListViewDataSource.mm b/renderer/native/ios/renderer/component/listview/HippyBaseListViewDataSource.mm +deleted file mode 100644 +index 8c0497d0a53..00000000000 +--- a/renderer/native/ios/renderer/component/listview/HippyBaseListViewDataSource.mm ++++ /dev/null +@@ -1,157 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import +-#import ""HippyBaseListViewDataSource.h"" +-#import ""HippyShadowView.h"" +- +-@interface HippyBaseListViewDataSource () { +- NSMutableArray *_headerShadowViews; +- NSMutableArray *> *_cellShadowViews; +-} +- +-@end +- +-@implementation HippyBaseListViewDataSource +- +-- (void)setDataSource:(NSArray *)dataSource containBannerView:(BOOL)containBannerView { +- NSMutableArray *headerShadowViews = [NSMutableArray array]; +- NSMutableArray *> *cellShadowViews = [NSMutableArray array]; +- NSMutableArray *sectionCellShadowViews = nil; +- BOOL isFirstIndex = YES; +- for (HippyShadowView *shadowView in dataSource) { +- NSString *viewName = [shadowView viewName]; +- if ([self.itemViewName isEqualToString:viewName]) { +- NSNumber *sticky = shadowView.props[@""sticky""]; +- if ([sticky boolValue]) { +- [headerShadowViews addObject:shadowView]; +- if (sectionCellShadowViews) { +- [cellShadowViews addObject:sectionCellShadowViews]; +- sectionCellShadowViews = nil; +- } +- } +- else { +- if (nil == sectionCellShadowViews) { +- sectionCellShadowViews = [NSMutableArray array]; +- } +- [sectionCellShadowViews addObject:shadowView]; +- } +- if (isFirstIndex && 0 == [headerShadowViews count]) { +- [headerShadowViews addObject:[NSNull null]]; +- isFirstIndex = NO; +- } +- } +- } +- if (sectionCellShadowViews) { +- [cellShadowViews addObject:sectionCellShadowViews]; +- } +- _headerShadowViews = headerShadowViews; +- _cellShadowViews = cellShadowViews; +-} +- +-- (HippyShadowView *)cellForIndexPath:(NSIndexPath *)indexPath { +- if (_cellShadowViews.count > indexPath.section) { +- NSArray *sectionCellShadowViews = [_cellShadowViews objectAtIndex:indexPath.section]; +- if (sectionCellShadowViews.count > indexPath.row) { +- return [sectionCellShadowViews objectAtIndex:indexPath.row]; +- } +- } +- return nil; +-} +- +-- (NSIndexPath *)indexPathOfCell:(HippyShadowView *)cell { +- NSInteger section = 0; +- NSInteger row = 0; +- for (NSInteger sec = 0; sec < [_cellShadowViews count]; sec++) { +- NSArray *sectionCellShadowViews = [_cellShadowViews objectAtIndex:sec]; +- for (NSUInteger r = 0; r < [sectionCellShadowViews count]; r++) { +- HippyShadowView *cellShadowView = [sectionCellShadowViews objectAtIndex:r]; +- if (cellShadowView == cell) { +- section = sec; +- row = r; +- } +- } +- } +- return [NSIndexPath indexPathForRow:row inSection:section]; +-} +- +-- (HippyShadowView *)headerForSection:(NSInteger)section { +- if (_headerShadowViews.count > section) { +- return [_headerShadowViews objectAtIndex:section]; +- } +- return nil; +-} +- +-- (NSInteger)numberOfSection { +- return _cellShadowViews.count; +-} +- +-- (NSInteger)numberOfCellForSection:(NSInteger)section { +- if (_cellShadowViews.count > section) { +- return [[_cellShadowViews objectAtIndex:section] count]; +- } +- return 0; +-} +- +-- (NSIndexPath *)indexPathForFlatIndex:(NSInteger)index { +- NSInteger sectionIndex = 0; +- NSInteger rowIndex = 0; +- NSInteger selfIncreaseIndex = 0; +- for (NSInteger sec = 0; sec < [_cellShadowViews count]; sec++) { +- NSArray *sectionCellShadowViews = [_cellShadowViews objectAtIndex:sec]; +- for (NSUInteger r = 0; r < [sectionCellShadowViews count]; r++) { +- if (index == selfIncreaseIndex) { +- sectionIndex = sec; +- rowIndex = r; +- break; +- } +- selfIncreaseIndex++; +- } +- } +- return [NSIndexPath indexPathForRow:rowIndex inSection:sectionIndex]; +-} +- +-- (NSInteger)flatIndexForIndexPath:(NSIndexPath *)indexPath { +- NSInteger section = [indexPath section]; +- NSInteger row = [indexPath row]; +- NSInteger flatIndex = 0; +- for (NSInteger sec = 0; sec <= section; sec++) { +- if (sec == section) { +- flatIndex += row; +- } +- else { +- NSArray *sectionCellShadowViews = [_cellShadowViews objectAtIndex:sec]; +- flatIndex += [sectionCellShadowViews count]; +- } +- } +- return flatIndex; +-} +- +-- (BOOL)containBannerView { +- return NO; +-} +- +-- (UIView *)bannerView { +- return nil; +-} +- +-@end +diff --git a/renderer/native/ios/renderer/component/listview/HippyBaseListViewManager.h b/renderer/native/ios/renderer/component/listview/HippyBaseListViewManager.h +deleted file mode 100644 +index d46e6e3c2ef..00000000000 +--- a/renderer/native/ios/renderer/component/listview/HippyBaseListViewManager.h ++++ /dev/null +@@ -1,27 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import ""HippyViewManager.h"" +- +-@interface HippyBaseListViewManager : HippyViewManager +- +-@end +diff --git a/renderer/native/ios/renderer/component/listview/HippyBaseListViewManager.mm b/renderer/native/ios/renderer/component/listview/HippyBaseListViewManager.mm +deleted file mode 100644 +index e05ec52d435..00000000000 +--- a/renderer/native/ios/renderer/component/listview/HippyBaseListViewManager.mm ++++ /dev/null +@@ -1,84 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import ""HippyBaseListViewManager.h"" +-#import ""HippyBaseListView.h"" +- +-@implementation HippyBaseListViewManager +- +-HIPPY_EXPORT_VIEW_PROPERTY(scrollEventThrottle, double) +-HIPPY_EXPORT_VIEW_PROPERTY(initialListReady, HippyDirectEventBlock); +-HIPPY_EXPORT_VIEW_PROPERTY(onScrollBeginDrag, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onScroll, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onScrollEndDrag, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onMomentumScrollBegin, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onMomentumScrollEnd, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onRowWillDisplay, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onEndReached, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onDelete, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(preloadItemNumber, NSUInteger) +-HIPPY_EXPORT_VIEW_PROPERTY(bounces, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(initialContentOffset, CGFloat) +-HIPPY_EXPORT_VIEW_PROPERTY(editable, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(showScrollIndicator, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(scrollEnabled, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(horizontal, BOOL) +- +-- (UIView *)view { +- return [[HippyBaseListView alloc] init]; +-} +- +-// clang-format off +-RENDER_COMPONENT_EXPORT_METHOD(scrollToIndex:(nonnull NSNumber *)hippyTag +- xIndex:(__unused NSNumber *)xIndex +- yIndex:(NSNumber *)yIndex +- animation:(nonnull NSNumber *)animation) { +- [self.renderContext addUIBlock: +- ^(__unused id renderContext, NSDictionary *viewRegistry){ +- HippyBaseListView *view = (HippyBaseListView *)viewRegistry[hippyTag]; +- if (view == nil) return ; +- if (![view isKindOfClass:[HippyBaseListView class]]) { +- //HippyLogError(@""Invalid view returned from registry, expecting HippyBaseListView, got: %@"", view); +- } +- [view scrollToIndex: yIndex.integerValue animated: [animation boolValue]]; +- }]; +-} +-// clang-format on +- +-// clang-format off +-RENDER_COMPONENT_EXPORT_METHOD(scrollToContentOffset:(nonnull NSNumber *)hippyTag +- x:(nonnull NSNumber *)x +- y:(nonnull NSNumber *)y +- animation:(nonnull NSNumber *)animation) { +- [self.renderContext addUIBlock: +- ^(__unused id renderContext, NSDictionary *viewRegistry){ +- HippyBaseListView *view = (HippyBaseListView *)viewRegistry[hippyTag]; +- if (view == nil) return ; +- if (![view isKindOfClass:[HippyBaseListView class]]) { +- //HippyLogError(@""Invalid view returned from registry, expecting HippyBaseListView, got: %@"", view); +- } +- [view scrollToContentOffset:CGPointMake([x floatValue], [y floatValue]) animated: [animation boolValue]]; +- }]; +-} +-// clang-format on +- +-@end +diff --git a/renderer/native/ios/renderer/component/listview/HippyBaseListItemView.h b/renderer/native/ios/renderer/component/listview/NativeRenderBaseListItemView.h +similarity index 82% +rename from renderer/native/ios/renderer/component/listview/HippyBaseListItemView.h +rename to renderer/native/ios/renderer/component/listview/NativeRenderBaseListItemView.h +index 98c63e50aaf..6904615c552 100644 +--- a/renderer/native/ios/renderer/component/listview/HippyBaseListItemView.h ++++ b/renderer/native/ios/renderer/component/listview/NativeRenderBaseListItemView.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,10 +21,10 @@ + */ + + #import +-#import ""HippyBaseListViewCell.h"" +-#import ""HippyView.h"" ++#import ""NativeRenderBaseListViewCell.h"" ++#import ""NativeRenderView.h"" + +-@interface HippyBaseListItemView : HippyView ++@interface NativeRenderBaseListItemView : NativeRenderView + + @property (nonatomic, strong) id type; + @property (nonatomic, assign) BOOL isSticky; +diff --git a/renderer/native/ios/renderer/component/listview/HippyBaseListItemView.mm b/renderer/native/ios/renderer/component/listview/NativeRenderBaseListItemView.mm +similarity index 89% +rename from renderer/native/ios/renderer/component/listview/HippyBaseListItemView.mm +rename to renderer/native/ios/renderer/component/listview/NativeRenderBaseListItemView.mm +index 2d839907452..6991e9440f0 100644 +--- a/renderer/native/ios/renderer/component/listview/HippyBaseListItemView.mm ++++ b/renderer/native/ios/renderer/component/listview/NativeRenderBaseListItemView.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,11 +20,11 @@ + * limitations under the License. + */ + +-#import ""HippyBaseListItemView.h"" +-#import ""UIView+Hippy.h"" +-#import ""UIView+AppearEvent.h"" ++#import ""NativeRenderBaseListItemView.h"" ++#import ""UIView+NativeRender.h"" ++#import ""UIView+MountEvent.h"" + +-@implementation HippyBaseListItemView ++@implementation NativeRenderBaseListItemView + + - (void)hippySetFrame:(CGRect)frame { + [super hippySetFrame:frame]; +diff --git a/renderer/native/ios/renderer/component/listview/NativeRenderBaseListItemViewManager.h b/renderer/native/ios/renderer/component/listview/NativeRenderBaseListItemViewManager.h +new file mode 100644 +index 00000000000..94555767c28 +--- /dev/null ++++ b/renderer/native/ios/renderer/component/listview/NativeRenderBaseListItemViewManager.h +@@ -0,0 +1,27 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * NativeRender available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ""NativeRenderViewManager.h"" ++ ++@interface NativeRenderBaseListItemViewManager : NativeRenderViewManager ++ ++@end +diff --git a/renderer/native/ios/renderer/component/listview/NativeRenderBaseListItemViewManager.mm b/renderer/native/ios/renderer/component/listview/NativeRenderBaseListItemViewManager.mm +new file mode 100644 +index 00000000000..55ead2bebc1 +--- /dev/null ++++ b/renderer/native/ios/renderer/component/listview/NativeRenderBaseListItemViewManager.mm +@@ -0,0 +1,44 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * NativeRender available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ""NativeRenderBaseListItemViewManager.h"" ++#import ""NativeRenderBaseListItemView.h"" ++#import ""NativeRenderObjectBaseListItem.h"" ++ ++@implementation NativeRenderBaseListItemViewManager ++ ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(type, id) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(isSticky, BOOL) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onAppear, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onDisappear, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onWillAppear, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onWillDisappear, NativeRenderDirectEventBlock) ++ ++- (UIView *)view { ++ return [NativeRenderBaseListItemView new]; ++} ++ ++- (NativeRenderObjectView *)nativeRenderObjectView { ++ return [NativeRenderObjectBaseListItem new]; ++} ++ ++@end +diff --git a/renderer/native/ios/renderer/component/listview/HippyBaseListView.h b/renderer/native/ios/renderer/component/listview/NativeRenderBaseListView.h +similarity index 63% +rename from renderer/native/ios/renderer/component/listview/HippyBaseListView.h +rename to renderer/native/ios/renderer/component/listview/NativeRenderBaseListView.h +index eca054a1f90..f4828a6dd95 100644 +--- a/renderer/native/ios/renderer/component/listview/HippyBaseListView.h ++++ b/renderer/native/ios/renderer/component/listview/NativeRenderBaseListView.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,30 +21,30 @@ + */ + + #import +-#import ""HippyScrollView.h"" +-#import ""HippyListTableView.h"" +-#import ""HippyTouchesView.h"" +-#import ""HippyWaterfallView.h"" ++#import ""NativeRenderScrollView.h"" ++#import ""NativeRenderListTableView.h"" ++#import ""NativeRenderTouchesView.h"" ++#import ""NativeRenderWaterfallView.h"" + +-@class HippyBaseListViewCell; ++@class NativeRenderBaseListViewCell; + +-@interface HippyBaseListView : HippyWaterfallView ++@interface NativeRenderBaseListView : NativeRenderWaterfallView + + /** +- * Hippy events ++ * NativeRender events + */ +-@property(nonatomic, copy) HippyDirectEventBlock initialListReady; +-@property(nonatomic, copy) HippyDirectEventBlock onScrollBeginDrag; +-@property(nonatomic, copy) HippyDirectEventBlock onScrollEndDrag; +-@property(nonatomic, copy) HippyDirectEventBlock onMomentumScrollBegin; +-@property(nonatomic, copy) HippyDirectEventBlock onMomentumScrollEnd; +-@property(nonatomic, copy) HippyDirectEventBlock onRowWillDisplay; +-@property(nonatomic, copy) HippyDirectEventBlock onDelete; ++@property(nonatomic, copy) NativeRenderDirectEventBlock initialListReady; ++@property(nonatomic, copy) NativeRenderDirectEventBlock onScrollBeginDrag; ++@property(nonatomic, copy) NativeRenderDirectEventBlock onScrollEndDrag; ++@property(nonatomic, copy) NativeRenderDirectEventBlock onMomentumScrollBegin; ++@property(nonatomic, copy) NativeRenderDirectEventBlock onMomentumScrollEnd; ++@property(nonatomic, copy) NativeRenderDirectEventBlock onRowWillDisplay; ++@property(nonatomic, copy) NativeRenderDirectEventBlock onDelete; + + /** +- * Indication initial content offset when HippyBaseListView finish loading data ++ * Indication initial content offset when NativeRenderBaseListView finish loading data + * +- * @discuss This variable will be set to 0 after HippyBaseListView finish loading data ++ * @discuss This variable will be set to 0 after NativeRenderBaseListView finish loading data + */ + @property(nonatomic, assign) CGFloat initialContentOffset; + +diff --git a/renderer/native/ios/renderer/component/listview/HippyBaseListView.mm b/renderer/native/ios/renderer/component/listview/NativeRenderBaseListView.mm +similarity index 82% +rename from renderer/native/ios/renderer/component/listview/HippyBaseListView.mm +rename to renderer/native/ios/renderer/component/listview/NativeRenderBaseListView.mm +index 7f4f9dc9e1a..4d1ff1daeef 100644 +--- a/renderer/native/ios/renderer/component/listview/HippyBaseListView.mm ++++ b/renderer/native/ios/renderer/component/listview/NativeRenderBaseListView.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,22 +20,22 @@ + * limitations under the License. + */ + +-#import ""HippyBaseListView.h"" +-#import ""UIView+Hippy.h"" +-#import ""HippyShadowView.h"" +-#import ""HippyHeaderRefresh.h"" +-#import ""HippyFooterRefresh.h"" +-#import ""HippyBaseListViewCell.h"" +-#import ""HippyBaseListViewDataSource.h"" +-#import ""HippyCollectionViewFlowLayout.h"" +-#import ""HippyRenderContext.h"" ++#import ""NativeRenderBaseListView.h"" ++#import ""UIView+NativeRender.h"" ++#import ""NativeRenderObjectView.h"" ++#import ""NativeRenderHeaderRefresh.h"" ++#import ""NativeRenderFooterRefresh.h"" ++#import ""NativeRenderBaseListViewCell.h"" ++#import ""NativeRenderBaseListViewDataSource.h"" ++#import ""NativeRenderCollectionViewFlowLayout.h"" ++#import ""NativeRenderContext.h"" + #import ""UIView+DirectionalLayout.h"" + + static NSString *const kCellIdentifier = @""cellIdentifier""; + static NSString *const kSupplementaryIdentifier = @""SupplementaryIdentifier""; + static NSString *const kListViewItem = @""ListViewItem""; + +-@interface HippyBaseListView () { ++@interface NativeRenderBaseListView () { + __weak UIView *_rootView; + BOOL _isInitialListReady; + NSArray *_previousVisibleCells; +@@ -44,14 +44,14 @@ @interface HippyBaseListView () { + + @end + +-@implementation HippyBaseListView ++@implementation NativeRenderBaseListView + + #pragma mark Life Cycle + - (instancetype)initWithFrame:(CGRect)frame { + if (self = [super initWithFrame:frame]) { + _isInitialListReady = NO; + self.preloadItemNumber = 1; +- _dataSource = [[HippyBaseListViewDataSource alloc] init]; ++ _dataSource = [[NativeRenderBaseListViewDataSource alloc] init]; + self.dataSource.itemViewName = [self compoentItemName]; + } + +@@ -70,13 +70,13 @@ - (NSString *)compoentItemName { + } + + - (Class)listItemClass { +- return [HippyBaseListViewCell class]; ++ return [NativeRenderBaseListViewCell class]; + } + + - (__kindof UICollectionViewLayout *)collectionViewLayout { + BOOL layoutDirectionRTL = [self isLayoutSubviewsRTL]; +- [[HippyCollectionViewFlowLayoutRTLStack sharedInstance] pushRTLConfig:layoutDirectionRTL]; +- HippyCollectionViewFlowLayout *layout = [[HippyCollectionViewFlowLayout alloc] init]; ++ [[NativeRenderCollectionViewFlowLayoutRTLStack sharedInstance] pushRTLConfig:layoutDirectionRTL]; ++ NativeRenderCollectionViewFlowLayout *layout = [[NativeRenderCollectionViewFlowLayout alloc] init]; + layout.minimumLineSpacing = .0f; + layout.minimumInteritemSpacing = .0f; + layout.sectionHeadersPinToVisibleBounds = YES; +@@ -92,7 +92,7 @@ - (void)applyLayoutDirectionFromParent:(HPDirection)direction { + + - (void)registerCells { + Class cls = [self listItemClass]; +- NSAssert([cls isSubclassOfClass:[HippyBaseListViewCell class]], @""list item class must be a subclass of HippyBaseListViewCell""); ++ NSAssert([cls isSubclassOfClass:[NativeRenderBaseListViewCell class]], @""list item class must be a subclass of NativeRenderBaseListViewCell""); + [self.collectionView registerClass:cls forCellWithReuseIdentifier:kCellIdentifier]; + } + +@@ -111,7 +111,7 @@ - (void)hippySetFrame:(CGRect)frame { + self.collectionView.frame = self.bounds; + } + +-- (void)setInitialListReady:(HippyDirectEventBlock)initialListReady { ++- (void)setInitialListReady:(NativeRenderDirectEventBlock)initialListReady { + _initialListReady = initialListReady; + _isInitialListReady = NO; + } +@@ -138,19 +138,19 @@ - (void)reloadData { + } + + - (void)insertHippySubview:(UIView *)subview atIndex:(NSInteger)atIndex { +- if ([subview isKindOfClass:[HippyHeaderRefresh class]]) { ++ if ([subview isKindOfClass:[NativeRenderHeaderRefresh class]]) { + if (_headerRefreshView) { + [_headerRefreshView unsetFromScrollView]; + } +- _headerRefreshView = (HippyHeaderRefresh *)subview; ++ _headerRefreshView = (NativeRenderHeaderRefresh *)subview; + [_headerRefreshView setScrollView:self.collectionView]; + _headerRefreshView.delegate = self; + [_weakItemMap setObject:subview forKey:[subview hippyTag]]; +- } else if ([subview isKindOfClass:[HippyFooterRefresh class]]) { ++ } else if ([subview isKindOfClass:[NativeRenderFooterRefresh class]]) { + if (_footerRefreshView) { + [_footerRefreshView unsetFromScrollView]; + } +- _footerRefreshView = (HippyFooterRefresh *)subview; ++ _footerRefreshView = (NativeRenderFooterRefresh *)subview; + [_footerRefreshView setScrollView:self.collectionView]; + _footerRefreshView.delegate = self; + [_weakItemMap setObject:subview forKey:[subview hippyTag]]; +@@ -163,7 +163,7 @@ - (void)didUpdateHippySubviews { + } + + - (void)refreshItemNodes { +- [self.dataSource setDataSource:self.hippyShadowView.hippySubviews containBannerView:NO]; ++ [self.dataSource setDataSource:self.nativeRenderObjectView.hippySubviews containBannerView:NO]; + } + + #pragma mark -Scrollable +@@ -214,7 +214,7 @@ - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView + + - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout + heightForHeaderInSection:(NSInteger)section { +- HippyShadowView *header = [self.dataSource headerForSection:section]; ++ NativeRenderObjectView *header = [self.dataSource headerForSection:section]; + if (header) { + return CGRectGetHeight(header.frame); + } else { +@@ -225,9 +225,9 @@ - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectio + - (CGSize)collectionView:(UICollectionView *)collectionView + layout:(UICollectionViewLayout*)collectionViewLayout + referenceSizeForHeaderInSection:(NSInteger)section { +- HippyShadowView *headerShadowView = [self.dataSource headerForSection:section]; +- if ([headerShadowView isKindOfClass:[HippyShadowView class]]) { +- return headerShadowView.frame.size; ++ NativeRenderObjectView *headerObjectView = [self.dataSource headerForSection:section]; ++ if ([headerObjectView isKindOfClass:[NativeRenderObjectView class]]) { ++ return headerObjectView.frame.size; + } + return CGSizeZero; + } +@@ -239,11 +239,11 @@ - (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView + UICollectionReusableView *view = [collectionView dequeueReusableSupplementaryViewOfKind:kind + withReuseIdentifier:kSupplementaryIdentifier + forIndexPath:indexPath]; +- HippyShadowView *headerShadowView = [self.dataSource headerForSection:section]; +- if (headerShadowView && [headerShadowView isKindOfClass:[HippyShadowView class]]) { +- UIView *headerView = [self.renderContext viewFromRenderViewTag:headerShadowView.hippyTag onRootTag:headerShadowView.rootTag]; ++ NativeRenderObjectView *headerRenderObject = [self.dataSource headerForSection:section]; ++ if (headerRenderObject && [headerRenderObject isKindOfClass:[NativeRenderObjectView class]]) { ++ UIView *headerView = [self.renderContext viewFromRenderViewTag:headerRenderObject.hippyTag onRootTag:headerRenderObject.rootTag]; + if (!headerView) { +- headerView = [self.renderContext createViewRecursivelyFromShadowView:headerShadowView]; ++ headerView = [self.renderContext createViewRecursivelyFromRenderObject:headerRenderObject]; + } + CGRect frame = headerView.frame; + frame.origin = CGPointZero; +@@ -260,18 +260,18 @@ - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSe + + - (void)collectionView:(UICollectionView *)collectionView + willDisplayCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath { +- HippyShadowView *cellShadowView = [self.dataSource cellForIndexPath:indexPath]; +- [cellShadowView recusivelySetCreationTypeToInstant]; ++ NativeRenderObjectView *cellRenderObjectView = [self.dataSource cellForIndexPath:indexPath]; ++ [cellRenderObjectView recusivelySetCreationTypeToInstant]; + [self itemViewForCollectionViewCell:cell indexPath:indexPath]; + NSInteger index = [self.dataSource flatIndexForIndexPath:indexPath]; + if (self.onRowWillDisplay) { + self.onRowWillDisplay(@{ + @""index"": @(index), + @""frame"": @ { +- @""x"": @(CGRectGetMinX(cellShadowView.frame)), +- @""y"": @(CGRectGetMinY(cellShadowView.frame)), +- @""width"": @(CGRectGetWidth(cellShadowView.frame)), +- @""height"": @(CGRectGetHeight(cellShadowView.frame)) ++ @""x"": @(CGRectGetMinX(cellRenderObjectView.frame)), ++ @""y"": @(CGRectGetMinY(cellRenderObjectView.frame)), ++ @""width"": @(CGRectGetWidth(cellRenderObjectView.frame)), ++ @""height"": @(CGRectGetHeight(cellRenderObjectView.frame)) + } + }); + } +@@ -289,8 +289,8 @@ - (void)collectionView:(UICollectionView *)collectionView + } + + - (void)collectionView:(UICollectionView *)collectionView didEndDisplayingCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath { +- if ([cell isKindOfClass:[HippyBaseListViewCell class]]) { +- HippyBaseListViewCell *hpCell = (HippyBaseListViewCell *)cell; ++ if ([cell isKindOfClass:[NativeRenderBaseListViewCell class]]) { ++ NativeRenderBaseListViewCell *hpCell = (NativeRenderBaseListViewCell *)cell; + [_cachedItems setObject:[hpCell.cellView hippyTag] forKey:indexPath]; + hpCell.cellView = nil; + } +@@ -301,25 +301,25 @@ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cell + } + + - (void)itemViewForCollectionViewCell:(UICollectionViewCell *)cell indexPath:(NSIndexPath *)indexPath { +- HippyShadowView *cellShadowView = [self.dataSource cellForIndexPath:indexPath]; +- HippyBaseListViewCell *hpCell = (HippyBaseListViewCell *)cell; +- UIView *cellView = [self.renderContext viewFromRenderViewTag:cellShadowView.hippyTag onRootTag:cellShadowView.rootTag]; ++ NativeRenderObjectView *cellRenderObject = [self.dataSource cellForIndexPath:indexPath]; ++ NativeRenderBaseListViewCell *hpCell = (NativeRenderBaseListViewCell *)cell; ++ UIView *cellView = [self.renderContext viewFromRenderViewTag:cellRenderObject.hippyTag onRootTag:cellRenderObject.rootTag]; + if (cellView) { + [_cachedItems removeObjectForKey:indexPath]; + } + else { +- cellView = [self.renderContext createViewRecursivelyFromShadowView:cellShadowView]; ++ cellView = [self.renderContext createViewRecursivelyFromRenderObject:cellRenderObject]; + } + NSAssert([cellView conformsToProtocol:@protocol(ViewAppearStateProtocol)], +- @""subviews of HippyBaseListViewCell must conform to protocol ViewAppearStateProtocol""); +- //TODO HippyBaseListViewCell.shadow and HippyShadowView.cell can remove ++ @""subviews of NativeRenderBaseListViewCell must conform to protocol ViewAppearStateProtocol""); ++ //TODO NativeRenderBaseListViewCell.shadow and NativeRenderShadowView.cell can remove + hpCell.cellView = cellView; + [_weakItemMap setObject:cellView forKey:[cellView hippyTag]]; + } + +-- (void)tableViewDidLayoutSubviews:(HippyListTableView *)tableView { ++- (void)tableViewDidLayoutSubviews:(NativeRenderListTableView *)tableView { + NSArray *visibleCells = [self.collectionView visibleCells]; +- for (HippyBaseListViewCell *cell in visibleCells) { ++ for (NativeRenderBaseListViewCell *cell in visibleCells) { + CGRect cellRectInTableView = [self.collectionView convertRect:[cell bounds] fromView:cell]; + CGRect intersection = CGRectIntersection(cellRectInTableView, [self.collectionView bounds]); + if (CGRectEqualToRect(cellRectInTableView, intersection)) { +@@ -331,7 +331,7 @@ - (void)tableViewDidLayoutSubviews:(HippyListTableView *)tableView { + if (_previousVisibleCells && ![_previousVisibleCells isEqualToArray:visibleCells]) { + NSMutableArray *diff = [_previousVisibleCells mutableCopy]; + [diff removeObjectsInArray:visibleCells]; +- for (HippyBaseListViewCell *cell in diff) { ++ for (NativeRenderBaseListViewCell *cell in diff) { + [cell setCellShowState:CellNotShowState]; + } + } +@@ -443,7 +443,7 @@ - (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView { + } + } + +-- (NSDictionary *)scrollEventDataWithState:(HippyScrollState)state { ++- (NSDictionary *)scrollEventDataWithState:(NativeRenderScrollState)state { + return @{ @""contentOffset"": @ { @""x"": @(self.collectionView.contentOffset.x), @""y"": @(self.collectionView.contentOffset.y) } }; + } + +@@ -504,7 +504,7 @@ - (void)setHorizontal:(BOOL)horizontal { + } + } + +-#pragma mark HippyRefresh Delegate +-- (void)refreshView:(HippyRefresh *)refreshView statusChanged:(HippyRefreshStatus)status { ++#pragma mark NativeRenderRefresh Delegate ++- (void)refreshView:(NativeRenderRefresh *)refreshView statusChanged:(NativeRenderRefreshStatus)status { + } + @end +diff --git a/renderer/native/ios/renderer/component/listview/HippyBaseListViewCell.h b/renderer/native/ios/renderer/component/listview/NativeRenderBaseListViewCell.h +similarity index 87% +rename from renderer/native/ios/renderer/component/listview/HippyBaseListViewCell.h +rename to renderer/native/ios/renderer/component/listview/NativeRenderBaseListViewCell.h +index f9f0c434afa..079a4b47cb3 100644 +--- a/renderer/native/ios/renderer/component/listview/HippyBaseListViewCell.h ++++ b/renderer/native/ios/renderer/component/listview/NativeRenderBaseListViewCell.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,8 +21,8 @@ + */ + + #import +-#import ""HippyWaterfallView.h"" +-#import ""HippyWaterfallViewCell.h"" ++#import ""NativeRenderWaterfallView.h"" ++#import ""NativeRenderWaterfallViewCell.h"" + + NS_ASSUME_NONNULL_BEGIN + +@@ -42,7 +42,7 @@ typedef NS_ENUM(NSUInteger, CellShowState) { CellNotShowState, CellHalfShowState + + @end + +-@interface HippyBaseListViewCell : HippyWaterfallViewCell ++@interface NativeRenderBaseListViewCell : NativeRenderWaterfallViewCell + + - (void)setCellShowState:(CellShowState)cellShowState NS_REQUIRES_SUPER; + +diff --git a/renderer/native/ios/renderer/component/listview/HippyBaseListViewCell.mm b/renderer/native/ios/renderer/component/listview/NativeRenderBaseListViewCell.mm +similarity index 94% +rename from renderer/native/ios/renderer/component/listview/HippyBaseListViewCell.mm +rename to renderer/native/ios/renderer/component/listview/NativeRenderBaseListViewCell.mm +index 808af61d7a9..d44c8a66b08 100644 +--- a/renderer/native/ios/renderer/component/listview/HippyBaseListViewCell.mm ++++ b/renderer/native/ios/renderer/component/listview/NativeRenderBaseListViewCell.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,16 +20,16 @@ + * limitations under the License. + */ + +-#import ""HippyBaseListViewCell.h"" ++#import ""NativeRenderBaseListViewCell.h"" + +-@interface HippyBaseListViewCell () { ++@interface NativeRenderBaseListViewCell () { + CellShowState _cellShowState; + CellShowState _previousShowState; + } + + @end + +-@implementation HippyBaseListViewCell ++@implementation NativeRenderBaseListViewCell + + - (instancetype)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; +diff --git a/renderer/native/ios/renderer/component/listview/NativeRenderBaseListViewDataSource.h b/renderer/native/ios/renderer/component/listview/NativeRenderBaseListViewDataSource.h +new file mode 100644 +index 00000000000..6eba8e353fb +--- /dev/null ++++ b/renderer/native/ios/renderer/component/listview/NativeRenderBaseListViewDataSource.h +@@ -0,0 +1,27 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * NativeRender available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ""NativeRenderWaterfallViewDataSource.h"" ++ ++@interface NativeRenderBaseListViewDataSource : NativeRenderWaterfallViewDataSource ++ ++@end +diff --git a/renderer/native/ios/renderer/component/listview/NativeRenderBaseListViewDataSource.mm b/renderer/native/ios/renderer/component/listview/NativeRenderBaseListViewDataSource.mm +new file mode 100644 +index 00000000000..73175f0db09 +--- /dev/null ++++ b/renderer/native/ios/renderer/component/listview/NativeRenderBaseListViewDataSource.mm +@@ -0,0 +1,157 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * NativeRender available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ++#import ""NativeRenderBaseListViewDataSource.h"" ++#import ""NativeRenderObjectView.h"" ++ ++@interface NativeRenderBaseListViewDataSource () { ++ NSMutableArray *_headerRenderObjects; ++ NSMutableArray *> *_cellRenderObjects; ++} ++ ++@end ++ ++@implementation NativeRenderBaseListViewDataSource ++ ++- (void)setDataSource:(NSArray *)dataSource containBannerView:(BOOL)containBannerView { ++ NSMutableArray *headerRenderObjects = [NSMutableArray array]; ++ NSMutableArray *> *cellRenderObjects = [NSMutableArray array]; ++ NSMutableArray *sectionCellRenderObject = nil; ++ BOOL isFirstIndex = YES; ++ for (NativeRenderObjectView *renderObject in dataSource) { ++ NSString *viewName = [renderObject viewName]; ++ if ([self.itemViewName isEqualToString:viewName]) { ++ NSNumber *sticky = renderObject.props[@""sticky""]; ++ if ([sticky boolValue]) { ++ [headerRenderObjects addObject:renderObject]; ++ if (sectionCellRenderObject) { ++ [cellRenderObjects addObject:sectionCellRenderObject]; ++ sectionCellRenderObject = nil; ++ } ++ } ++ else { ++ if (nil == sectionCellRenderObject) { ++ sectionCellRenderObject = [NSMutableArray array]; ++ } ++ [sectionCellRenderObject addObject:renderObject]; ++ } ++ if (isFirstIndex && 0 == [headerRenderObjects count]) { ++ [headerRenderObjects addObject:[NSNull null]]; ++ isFirstIndex = NO; ++ } ++ } ++ } ++ if (sectionCellRenderObject) { ++ [cellRenderObjects addObject:sectionCellRenderObject]; ++ } ++ _headerRenderObjects = headerRenderObjects; ++ _cellRenderObjects = cellRenderObjects; ++} ++ ++- (NativeRenderObjectView *)cellForIndexPath:(NSIndexPath *)indexPath { ++ if (_cellRenderObjects.count > indexPath.section) { ++ NSArray *sectionCellRenderObject = [_cellRenderObjects objectAtIndex:indexPath.section]; ++ if (sectionCellRenderObject.count > indexPath.row) { ++ return [sectionCellRenderObject objectAtIndex:indexPath.row]; ++ } ++ } ++ return nil; ++} ++ ++- (NSIndexPath *)indexPathOfCell:(NativeRenderObjectView *)cell { ++ NSInteger section = 0; ++ NSInteger row = 0; ++ for (NSInteger sec = 0; sec < [_cellRenderObjects count]; sec++) { ++ NSArray *sectionCellRenderObjects = [_cellRenderObjects objectAtIndex:sec]; ++ for (NSUInteger r = 0; r < [sectionCellRenderObjects count]; r++) { ++ NativeRenderObjectView *cellRenderObject = [sectionCellRenderObjects objectAtIndex:r]; ++ if (cellRenderObject == cell) { ++ section = sec; ++ row = r; ++ } ++ } ++ } ++ return [NSIndexPath indexPathForRow:row inSection:section]; ++} ++ ++- (NativeRenderObjectView *)headerForSection:(NSInteger)section { ++ if (_headerRenderObjects.count > section) { ++ return [_headerRenderObjects objectAtIndex:section]; ++ } ++ return nil; ++} ++ ++- (NSInteger)numberOfSection { ++ return _cellRenderObjects.count; ++} ++ ++- (NSInteger)numberOfCellForSection:(NSInteger)section { ++ if (_cellRenderObjects.count > section) { ++ return [[_cellRenderObjects objectAtIndex:section] count]; ++ } ++ return 0; ++} ++ ++- (NSIndexPath *)indexPathForFlatIndex:(NSInteger)index { ++ NSInteger sectionIndex = 0; ++ NSInteger rowIndex = 0; ++ NSInteger selfIncreaseIndex = 0; ++ for (NSInteger sec = 0; sec < [_cellRenderObjects count]; sec++) { ++ NSArray *sectionCellRenderObjects = [_cellRenderObjects objectAtIndex:sec]; ++ for (NSUInteger r = 0; r < [sectionCellRenderObjects count]; r++) { ++ if (index == selfIncreaseIndex) { ++ sectionIndex = sec; ++ rowIndex = r; ++ break; ++ } ++ selfIncreaseIndex++; ++ } ++ } ++ return [NSIndexPath indexPathForRow:rowIndex inSection:sectionIndex]; ++} ++ ++- (NSInteger)flatIndexForIndexPath:(NSIndexPath *)indexPath { ++ NSInteger section = [indexPath section]; ++ NSInteger row = [indexPath row]; ++ NSInteger flatIndex = 0; ++ for (NSInteger sec = 0; sec <= section; sec++) { ++ if (sec == section) { ++ flatIndex += row; ++ } ++ else { ++ NSArray *sectionCellRenderObjects = [_cellRenderObjects objectAtIndex:sec]; ++ flatIndex += [sectionCellRenderObjects count]; ++ } ++ } ++ return flatIndex; ++} ++ ++- (BOOL)containBannerView { ++ return NO; ++} ++ ++- (UIView *)bannerView { ++ return nil; ++} ++ ++@end +diff --git a/renderer/native/ios/renderer/component/footerrefresh/HippyFooterRefreshManager.h b/renderer/native/ios/renderer/component/listview/NativeRenderBaseListViewManager.h +similarity index 84% +rename from renderer/native/ios/renderer/component/footerrefresh/HippyFooterRefreshManager.h +rename to renderer/native/ios/renderer/component/listview/NativeRenderBaseListViewManager.h +index 0f599259574..aedd9b54fbb 100644 +--- a/renderer/native/ios/renderer/component/footerrefresh/HippyFooterRefreshManager.h ++++ b/renderer/native/ios/renderer/component/listview/NativeRenderBaseListViewManager.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,8 +20,8 @@ + * limitations under the License. + */ + +-#import ""HippyViewManager.h"" ++#import ""NativeRenderViewManager.h"" + +-@interface HippyFooterRefreshManager : HippyViewManager ++@interface NativeRenderBaseListViewManager : NativeRenderViewManager + + @end +diff --git a/renderer/native/ios/renderer/component/listview/NativeRenderBaseListViewManager.mm b/renderer/native/ios/renderer/component/listview/NativeRenderBaseListViewManager.mm +new file mode 100644 +index 00000000000..0fcf688446e +--- /dev/null ++++ b/renderer/native/ios/renderer/component/listview/NativeRenderBaseListViewManager.mm +@@ -0,0 +1,84 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * NativeRender available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ""NativeRenderBaseListViewManager.h"" ++#import ""NativeRenderBaseListView.h"" ++ ++@implementation NativeRenderBaseListViewManager ++ ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(scrollEventThrottle, double) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(initialListReady, NativeRenderDirectEventBlock); ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onScrollBeginDrag, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onScroll, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onScrollEndDrag, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onMomentumScrollBegin, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onMomentumScrollEnd, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onRowWillDisplay, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onEndReached, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onDelete, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(preloadItemNumber, NSUInteger) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(bounces, BOOL) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(initialContentOffset, CGFloat) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(editable, BOOL) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(showScrollIndicator, BOOL) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(scrollEnabled, BOOL) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(horizontal, BOOL) ++ ++- (UIView *)view { ++ return [[NativeRenderBaseListView alloc] init]; ++} ++ ++// clang-format off ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(scrollToIndex:(nonnull NSNumber *)hippyTag ++ xIndex:(__unused NSNumber *)xIndex ++ yIndex:(NSNumber *)yIndex ++ animation:(nonnull NSNumber *)animation) { ++ [self.renderContext addUIBlock: ++ ^(__unused id renderContext, NSDictionary *viewRegistry){ ++ NativeRenderBaseListView *view = (NativeRenderBaseListView *)viewRegistry[hippyTag]; ++ if (view == nil) return ; ++ if (![view isKindOfClass:[NativeRenderBaseListView class]]) { ++ //NativeRenderLogError(@""Invalid view returned from registry, expecting NativeRenderBaseListView, got: %@"", view); ++ } ++ [view scrollToIndex: yIndex.integerValue animated: [animation boolValue]]; ++ }]; ++} ++// clang-format on ++ ++// clang-format off ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(scrollToContentOffset:(nonnull NSNumber *)hippyTag ++ x:(nonnull NSNumber *)x ++ y:(nonnull NSNumber *)y ++ animation:(nonnull NSNumber *)animation) { ++ [self.renderContext addUIBlock: ++ ^(__unused id renderContext, NSDictionary *viewRegistry){ ++ NativeRenderBaseListView *view = (NativeRenderBaseListView *)viewRegistry[hippyTag]; ++ if (view == nil) return ; ++ if (![view isKindOfClass:[NativeRenderBaseListView class]]) { ++ //NativeRenderLogError(@""Invalid view returned from registry, expecting NativeRenderBaseListView, got: %@"", view); ++ } ++ [view scrollToContentOffset:CGPointMake([x floatValue], [y floatValue]) animated: [animation boolValue]]; ++ }]; ++} ++// clang-format on ++ ++@end +diff --git a/renderer/native/ios/renderer/component/listview/HippyCollectionViewFlowLayout.h b/renderer/native/ios/renderer/component/listview/NativeRenderCollectionViewFlowLayout.h +similarity index 81% +rename from renderer/native/ios/renderer/component/listview/HippyCollectionViewFlowLayout.h +rename to renderer/native/ios/renderer/component/listview/NativeRenderCollectionViewFlowLayout.h +index 50474a3ecf1..1029e49f28d 100644 +--- a/renderer/native/ios/renderer/component/listview/HippyCollectionViewFlowLayout.h ++++ b/renderer/native/ios/renderer/component/listview/NativeRenderCollectionViewFlowLayout.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -24,16 +24,16 @@ + + NS_ASSUME_NONNULL_BEGIN + +-@interface HippyCollectionViewFlowLayoutRTLStack : NSObject ++@interface NativeRenderCollectionViewFlowLayoutRTLStack : NSObject + +-+ (HippyCollectionViewFlowLayoutRTLStack *)sharedInstance; +++ (NativeRenderCollectionViewFlowLayoutRTLStack *)sharedInstance; + + - (void)pushRTLConfig:(BOOL)isRTL; + - (BOOL)popRTLConfig; + + @end + +-@interface HippyCollectionViewFlowLayout : UICollectionViewFlowLayout ++@interface NativeRenderCollectionViewFlowLayout : UICollectionViewFlowLayout + + @property(nonatomic, assign) BOOL layoutDirectionRTL; + @property(nonatomic, assign) BOOL flipsHorizontallyInOppositeLayoutDirection; +diff --git a/renderer/native/ios/renderer/component/listview/HippyCollectionViewFlowLayout.m b/renderer/native/ios/renderer/component/listview/NativeRenderCollectionViewFlowLayout.m +similarity index 71% +rename from renderer/native/ios/renderer/component/listview/HippyCollectionViewFlowLayout.m +rename to renderer/native/ios/renderer/component/listview/NativeRenderCollectionViewFlowLayout.m +index 0d0c6d71c79..f4e52c6b6f2 100644 +--- a/renderer/native/ios/renderer/component/listview/HippyCollectionViewFlowLayout.m ++++ b/renderer/native/ios/renderer/component/listview/NativeRenderCollectionViewFlowLayout.m +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,21 +20,21 @@ + * limitations under the License. + */ + +-#import ""HippyCollectionViewFlowLayout.h"" ++#import ""NativeRenderCollectionViewFlowLayout.h"" + +-@interface HippyCollectionViewFlowLayoutRTLStack () { ++@interface NativeRenderCollectionViewFlowLayoutRTLStack () { + NSMutableArray *_stack; + } + + @end + +-@implementation HippyCollectionViewFlowLayoutRTLStack ++@implementation NativeRenderCollectionViewFlowLayoutRTLStack + +-+ (HippyCollectionViewFlowLayoutRTLStack *)sharedInstance { +++ (NativeRenderCollectionViewFlowLayoutRTLStack *)sharedInstance { + static dispatch_once_t onceToken; +- static HippyCollectionViewFlowLayoutRTLStack *stack = nil; ++ static NativeRenderCollectionViewFlowLayoutRTLStack *stack = nil; + dispatch_once(&onceToken, ^{ +- stack = [[HippyCollectionViewFlowLayoutRTLStack alloc] init]; ++ stack = [[NativeRenderCollectionViewFlowLayoutRTLStack alloc] init]; + }); + return stack; + } +@@ -47,7 +47,7 @@ - (instancetype)init { + return self; + } + +-- (HippyCollectionViewFlowLayoutRTLStack *)copy { ++- (NativeRenderCollectionViewFlowLayoutRTLStack *)copy { + return self; + } + +@@ -65,10 +65,10 @@ - (BOOL)popRTLConfig { + + @end + +-@implementation HippyCollectionViewFlowLayout ++@implementation NativeRenderCollectionViewFlowLayout + + - (BOOL)flipsHorizontallyInOppositeLayoutDirection { +- _layoutDirectionRTL = [[HippyCollectionViewFlowLayoutRTLStack sharedInstance] popRTLConfig]; ++ _layoutDirectionRTL = [[NativeRenderCollectionViewFlowLayoutRTLStack sharedInstance] popRTLConfig]; + return _layoutDirectionRTL; + } + +diff --git a/renderer/native/ios/renderer/component/listview/HippyListTableView.h b/renderer/native/ios/renderer/component/listview/NativeRenderListTableView.h +similarity index 67% +rename from renderer/native/ios/renderer/component/listview/HippyListTableView.h +rename to renderer/native/ios/renderer/component/listview/NativeRenderListTableView.h +index 1fe885457c3..03a5f1b09bf 100644 +--- a/renderer/native/ios/renderer/component/listview/HippyListTableView.h ++++ b/renderer/native/ios/renderer/component/listview/NativeRenderListTableView.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -24,20 +24,20 @@ + + NS_ASSUME_NONNULL_BEGIN + +-@class HippyListTableView; ++@class NativeRenderListTableView; + +-@protocol HippyListTableViewLayoutProtocol ++@protocol NativeRenderListTableViewLayoutProtocol + + /** +- * Invoke when HippyListTableView layout its subviews ++ * Invoke when NativeRenderListTableView layout its subviews + */ +-- (void)tableViewDidLayoutSubviews:(HippyListTableView *)tableView; ++- (void)tableViewDidLayoutSubviews:(NativeRenderListTableView *)tableView; + + @end + +-@interface HippyListTableView : UICollectionView ++@interface NativeRenderListTableView : UICollectionView + +-@property (nonatomic, weak) id layoutDelegate; ++@property (nonatomic, weak) id layoutDelegate; + + @end + +diff --git a/renderer/native/ios/renderer/component/listview/HippyListTableView.m b/renderer/native/ios/renderer/component/listview/NativeRenderListTableView.m +similarity index 93% +rename from renderer/native/ios/renderer/component/listview/HippyListTableView.m +rename to renderer/native/ios/renderer/component/listview/NativeRenderListTableView.m +index c3c120d154d..bfad186cea5 100644 +--- a/renderer/native/ios/renderer/component/listview/HippyListTableView.m ++++ b/renderer/native/ios/renderer/component/listview/NativeRenderListTableView.m +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,9 +20,9 @@ + * limitations under the License. + */ + +-#import ""HippyListTableView.h"" ++#import ""NativeRenderListTableView.h"" + +-@implementation HippyListTableView ++@implementation NativeRenderListTableView + + /** + * we need scroll indicator to be at top +diff --git a/renderer/native/ios/renderer/component/refreshview/HippyRefreshWrapperItemViewManager.h b/renderer/native/ios/renderer/component/listview/NativeRenderObjectBaseListItem.h +similarity index 85% +rename from renderer/native/ios/renderer/component/refreshview/HippyRefreshWrapperItemViewManager.h +rename to renderer/native/ios/renderer/component/listview/NativeRenderObjectBaseListItem.h +index 72ae423e988..cd66a969d9d 100644 +--- a/renderer/native/ios/renderer/component/refreshview/HippyRefreshWrapperItemViewManager.h ++++ b/renderer/native/ios/renderer/component/listview/NativeRenderObjectBaseListItem.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,11 +20,11 @@ + * limitations under the License. + */ + +-#import ""HippyViewManager.h"" ++#import ""NativeRenderObjectView.h"" + + NS_ASSUME_NONNULL_BEGIN + +-@interface HippyRefreshWrapperItemViewManager : HippyViewManager ++@interface NativeRenderObjectBaseListItem : NativeRenderObjectView + + @end + +diff --git a/renderer/native/ios/renderer/component/listview/HippyBaseListItemShadowView.mm b/renderer/native/ios/renderer/component/listview/NativeRenderObjectBaseListItem.mm +similarity index 82% +rename from renderer/native/ios/renderer/component/listview/HippyBaseListItemShadowView.mm +rename to renderer/native/ios/renderer/component/listview/NativeRenderObjectBaseListItem.mm +index f6b6a6fb7ba..9e013943f4e 100644 +--- a/renderer/native/ios/renderer/component/listview/HippyBaseListItemShadowView.mm ++++ b/renderer/native/ios/renderer/component/listview/NativeRenderObjectBaseListItem.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,14 +20,14 @@ + * limitations under the License. + */ + +-#import ""HippyBaseListItemShadowView.h"" ++#import ""NativeRenderObjectBaseListItem.h"" + +-@implementation HippyBaseListItemShadowView ++@implementation NativeRenderObjectBaseListItem + + - (instancetype)init { + self = [super init]; + if (self) { +- self.creationType = HippyCreationTypeLazily; ++ self.creationType = NativeRenderCreationTypeLazily; + } + return self; + } +diff --git a/renderer/native/ios/renderer/component/modal/HippyModalHostViewManager.mm b/renderer/native/ios/renderer/component/modal/HippyModalHostViewManager.mm +deleted file mode 100644 +index 0c1df1f5456..00000000000 +--- a/renderer/native/ios/renderer/component/modal/HippyModalHostViewManager.mm ++++ /dev/null +@@ -1,76 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import ""HippyModalHostViewManager.h"" +-#import ""HippyModalHostViewController.h"" +-#import ""HippyShadowView.h"" +-#import ""HippyUtils.h"" +-#import ""HippyModalTransitioningDelegate.h"" +- +-@interface HippyModalHostShadowView : HippyShadowView +- +-@end +- +-@implementation HippyModalHostShadowView +- +-- (void)setDomManager:(const std::weak_ptr)domManager { +- [super setDomManager:domManager]; +- CGRect frame = { .origin = CGPointZero, .size = HippyScreenSize() }; +- [self setLayoutFrame:frame]; +-} +- +-@end +- +-@implementation HippyModalHostViewManager +- +-HIPPY_EXPORT_VIEW_PROPERTY(animationType, NSString) +-HIPPY_EXPORT_VIEW_PROPERTY(transparent, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(darkStatusBarText, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(onShow, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onRequestClose, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(supportedOrientations, NSArray) +-HIPPY_EXPORT_VIEW_PROPERTY(onOrientationChange, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(primaryKey, NSString) +-HIPPY_EXPORT_VIEW_PROPERTY(hideStatusBar, NSNumber) +- +-- (UIView *)view { +- HippyModalHostView *view = [[HippyModalHostView alloc] init]; +- view.delegate = self.transitioningDelegate; +- if (!_hostViews) { +- _hostViews = [NSHashTable weakObjectsHashTable]; +- } +- [_hostViews addObject:view]; +- return view; +-} +- +-- (id)transitioningDelegate { +- if (!_transitioningDelegate) { +- _transitioningDelegate = [HippyModalTransitioningDelegate new]; +- } +- return _transitioningDelegate; +-} +- +-- (HippyShadowView *)shadowView { +- return [HippyModalHostShadowView new]; +-} +- +-@end +diff --git a/renderer/native/ios/renderer/component/modal/HippyModalCustomAnimationTransition.h b/renderer/native/ios/renderer/component/modal/NativeRenderModalCustomAnimationTransition.h +similarity index 86% +rename from renderer/native/ios/renderer/component/modal/HippyModalCustomAnimationTransition.h +rename to renderer/native/ios/renderer/component/modal/NativeRenderModalCustomAnimationTransition.h +index 962990c87bd..f8eb9265da0 100644 +--- a/renderer/native/ios/renderer/component/modal/HippyModalCustomAnimationTransition.h ++++ b/renderer/native/ios/renderer/component/modal/NativeRenderModalCustomAnimationTransition.h +@@ -1,8 +1,9 @@ ++ + /*! + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -23,6 +24,6 @@ + #import + #import + +-@interface HippyModalCustomAnimationTransition : NSObject ++@interface NativeRenderModalCustomAnimationTransition : NSObject + @property (nonatomic, assign) BOOL isPresent; + @end +diff --git a/renderer/native/ios/renderer/component/modal/HippyModalCustomAnimationTransition.m b/renderer/native/ios/renderer/component/modal/NativeRenderModalCustomAnimationTransition.m +similarity index 93% +rename from renderer/native/ios/renderer/component/modal/HippyModalCustomAnimationTransition.m +rename to renderer/native/ios/renderer/component/modal/NativeRenderModalCustomAnimationTransition.m +index 975ec751d4e..3f596d16202 100644 +--- a/renderer/native/ios/renderer/component/modal/HippyModalCustomAnimationTransition.m ++++ b/renderer/native/ios/renderer/component/modal/NativeRenderModalCustomAnimationTransition.m +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,11 +20,11 @@ + * limitations under the License. + */ + +-#import ""HippyModalCustomAnimationTransition.h"" ++#import ""NativeRenderModalCustomAnimationTransition.h"" + + #define DURATION .2f + +-@implementation HippyModalCustomAnimationTransition ++@implementation NativeRenderModalCustomAnimationTransition + + - (NSTimeInterval)transitionDuration:(__unused id)transitionContext { + return DURATION; +diff --git a/renderer/native/ios/renderer/component/modal/HippyModalCustomPresentationController.h b/renderer/native/ios/renderer/component/modal/NativeRenderModalCustomPresentationController.h +similarity index 87% +rename from renderer/native/ios/renderer/component/modal/HippyModalCustomPresentationController.h +rename to renderer/native/ios/renderer/component/modal/NativeRenderModalCustomPresentationController.h +index ee02e5f805e..513667756d7 100644 +--- a/renderer/native/ios/renderer/component/modal/HippyModalCustomPresentationController.h ++++ b/renderer/native/ios/renderer/component/modal/NativeRenderModalCustomPresentationController.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -22,6 +22,6 @@ + + #import + +-@interface HippyModalCustomPresentationController : UIPresentationController ++@interface NativeRenderModalCustomPresentationController : UIPresentationController + + @end +diff --git a/renderer/native/ios/renderer/component/modal/HippyModalCustomPresentationController.m b/renderer/native/ios/renderer/component/modal/NativeRenderModalCustomPresentationController.m +similarity index 87% +rename from renderer/native/ios/renderer/component/modal/HippyModalCustomPresentationController.m +rename to renderer/native/ios/renderer/component/modal/NativeRenderModalCustomPresentationController.m +index 5c6dfb86b22..fc102e0d20f 100644 +--- a/renderer/native/ios/renderer/component/modal/HippyModalCustomPresentationController.m ++++ b/renderer/native/ios/renderer/component/modal/NativeRenderModalCustomPresentationController.m +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,9 +20,9 @@ + * limitations under the License. + */ + +-#import ""HippyModalCustomPresentationController.h"" ++#import ""NativeRenderModalCustomPresentationController.h"" + +-@implementation HippyModalCustomPresentationController { ++@implementation NativeRenderModalCustomPresentationController { + } + + - (void)presentationTransitionWillBegin { +diff --git a/renderer/native/ios/renderer/component/modal/HippyModalHostView.h b/renderer/native/ios/renderer/component/modal/NativeRenderModalHostView.h +similarity index 65% +rename from renderer/native/ios/renderer/component/modal/HippyModalHostView.h +rename to renderer/native/ios/renderer/component/modal/NativeRenderModalHostView.h +index 5bcf667b858..c44c7ab3d8a 100644 +--- a/renderer/native/ios/renderer/component/modal/HippyModalHostView.h ++++ b/renderer/native/ios/renderer/component/modal/NativeRenderModalHostView.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,30 +21,30 @@ + */ + + #import +-#import ""HippyModalHostViewManager.h"" +-#import ""HippyView.h"" ++#import ""NativeRenderModalHostViewManager.h"" ++#import ""NativeRenderView.h"" + +-@class HippyModalHostViewController; ++@class NativeRenderModalHostViewController; + +-@protocol HippyModalHostViewInteractor; ++@protocol NativeRenderModalHostViewInteractor; + +-@interface HippyModalHostView : UIView ++@interface NativeRenderModalHostView : UIView + + @property (nonatomic, copy) NSString *animationType; + @property (nonatomic, copy) NSString *primaryKey; + @property (nonatomic, assign, getter=isTransparent) BOOL transparent; + @property (nonatomic, assign) BOOL darkStatusBarText; + +-@property (nonatomic, copy) HippyDirectEventBlock onShow; +-@property (nonatomic, copy) HippyDirectEventBlock onRequestClose; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onShow; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onRequestClose; + +-@property (nonatomic, weak) id delegate; ++@property (nonatomic, weak) id delegate; + + @property (nonatomic, strong) NSArray *supportedOrientations; +-@property (nonatomic, copy) HippyDirectEventBlock onOrientationChange; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onOrientationChange; + @property (nonatomic, strong) NSNumber *hideStatusBar; + @property (nonatomic, readonly) BOOL isPresented; +-@property (nonatomic, strong) HippyModalHostViewController *modalViewController; ++@property (nonatomic, strong) NativeRenderModalHostViewController *modalViewController; + + - (void)notifyForBoundsChange:(CGRect)newBounds; + +diff --git a/renderer/native/ios/renderer/component/modal/HippyModalHostView.mm b/renderer/native/ios/renderer/component/modal/NativeRenderModalHostView.mm +similarity index 93% +rename from renderer/native/ios/renderer/component/modal/HippyModalHostView.mm +rename to renderer/native/ios/renderer/component/modal/NativeRenderModalHostView.mm +index c20d9bee2d8..ed115ffe434 100644 +--- a/renderer/native/ios/renderer/component/modal/HippyModalHostView.mm ++++ b/renderer/native/ios/renderer/component/modal/NativeRenderModalHostView.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,24 +20,22 @@ + * limitations under the License. + */ + +-#import ""HippyModalHostView.h"" ++#import ""NativeRenderModalHostView.h"" ++#import ""NativeRenderModalHostViewController.h"" ++#import ""UIView+NativeRender.h"" ++#import ""UIView+MountEvent.h"" ++#import ""NativeRenderModalHostViewInteractor.h"" + +-#import ""HippyModalHostViewController.h"" +-#import ""UIView+Hippy.h"" +-#import ""HippyModalHostViewInteractor.h"" +- +-@implementation HippyModalHostView { ++@implementation NativeRenderModalHostView { + BOOL _isPresented; +- HippyModalHostViewController *_modalViewController; ++ NativeRenderModalHostViewController *_modalViewController; + UIStatusBarStyle originStyle; + UIInterfaceOrientation _lastKnownOrientation; + } + +-HIPPY_NOT_IMPLEMENTED(-(instancetype)initWithCoder : coder) +- + - (instancetype)initWithFrame:(CGRect)frame { + if ((self = [super initWithFrame:frame])) { +- _modalViewController = [HippyModalHostViewController new]; ++ _modalViewController = [NativeRenderModalHostViewController new]; + _isPresented = NO; + __weak __typeof(self) weakSelf = self; + _modalViewController.boundsDidChangeBlock = ^(CGRect newBounds) { +diff --git a/renderer/native/ios/renderer/component/modal/HippyModalHostViewController.h b/renderer/native/ios/renderer/component/modal/NativeRenderModalHostViewController.h +similarity index 91% +rename from renderer/native/ios/renderer/component/modal/HippyModalHostViewController.h +rename to renderer/native/ios/renderer/component/modal/NativeRenderModalHostViewController.h +index ff94fc7f05e..de7af70d9df 100644 +--- a/renderer/native/ios/renderer/component/modal/HippyModalHostViewController.h ++++ b/renderer/native/ios/renderer/component/modal/NativeRenderModalHostViewController.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -22,7 +22,7 @@ + + #import + +-@interface HippyModalHostViewController : UIViewController ++@interface NativeRenderModalHostViewController : UIViewController + + @property (nonatomic, copy) void (^boundsDidChangeBlock)(CGRect newBounds); + @property (nonatomic, strong) NSNumber *hideStatusBar; +diff --git a/renderer/native/ios/renderer/component/modal/HippyModalHostViewController.mm b/renderer/native/ios/renderer/component/modal/NativeRenderModalHostViewController.mm +similarity index 81% +rename from renderer/native/ios/renderer/component/modal/HippyModalHostViewController.mm +rename to renderer/native/ios/renderer/component/modal/NativeRenderModalHostViewController.mm +index 1ccb818eeeb..5dd9fd2f518 100644 +--- a/renderer/native/ios/renderer/component/modal/HippyModalHostViewController.mm ++++ b/renderer/native/ios/renderer/component/modal/NativeRenderModalHostViewController.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,10 +20,10 @@ + * limitations under the License. + */ + +-#import ""HippyModalHostViewController.h"" +-#import ""HippyUtils.h"" ++#import ""NativeRenderModalHostViewController.h"" ++#import ""NativeRenderUtils.h"" + +-@implementation HippyModalHostViewController { ++@implementation NativeRenderModalHostViewController { + CGRect _lastViewFrame; + UIStatusBarStyle _preferredStatusBarStyle; + } +@@ -55,16 +55,16 @@ - (BOOL)prefersStatusBarHidden { + if (_hideStatusBar) { + return [_hideStatusBar boolValue]; + } +- BOOL hidden = [HippyKeyWindow().rootViewController prefersStatusBarHidden]; ++ BOOL hidden = [NativeRenderKeyWindow().rootViewController prefersStatusBarHidden]; + return hidden; + } + +-#if HIPPY_DEV ++#if NATIVE_RENDER_DEBUG + - (UIInterfaceOrientationMask)supportedInterfaceOrientations { +- UIWindow *keyWindow = HippyKeyWindow(); ++ UIWindow *keyWindow = NativeRenderKeyWindow(); + UIInterfaceOrientationMask appSupportedOrientationsMask = [[UIApplication sharedApplication] supportedInterfaceOrientationsForWindow:keyWindow]; + if (!(_supportedInterfaceOrientations & appSupportedOrientationsMask)) { +-// HippyLogError(@""Modal was presented with 0x%x orientations mask but the application only supports 0x%x."" ++// NativeRenderLogError(@""Modal was presented with 0x%x orientations mask but the application only supports 0x%x."" + // @""Add more interface orientations to your app's Info.plist to fix this."" + // @""NOTE: This will crash in non-dev mode."", + // (unsigned)_supportedInterfaceOrientations, (unsigned)appSupportedOrientationsMask); +@@ -73,6 +73,6 @@ - (UIInterfaceOrientationMask)supportedInterfaceOrientations { + + return _supportedInterfaceOrientations; + } +-#endif // HIPPY_DEV ++#endif // NATIVE_RENDER_DEBUG + + @end +diff --git a/renderer/native/ios/renderer/component/modal/HippyModalHostViewInteractor.h b/renderer/native/ios/renderer/component/modal/NativeRenderModalHostViewInteractor.h +similarity index 64% +rename from renderer/native/ios/renderer/component/modal/HippyModalHostViewInteractor.h +rename to renderer/native/ios/renderer/component/modal/NativeRenderModalHostViewInteractor.h +index 258de5e3f28..8f8164ceef9 100644 +--- a/renderer/native/ios/renderer/component/modal/HippyModalHostViewInteractor.h ++++ b/renderer/native/ios/renderer/component/modal/NativeRenderModalHostViewInteractor.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,16 +21,16 @@ + */ + + #import +-#import ""HippyModalHostView.h"" +-#import ""HippyModalHostViewController.h"" ++#import ""NativeRenderModalHostView.h"" ++#import ""NativeRenderModalHostViewController.h"" + +-@protocol HippyModalHostViewInteractor ++@protocol NativeRenderModalHostViewInteractor + +-- (void)presentModalHostView:(HippyModalHostView *)modalHostView +- withViewController:(HippyModalHostViewController *)viewController ++- (void)presentModalHostView:(NativeRenderModalHostView *)modalHostView ++ withViewController:(NativeRenderModalHostViewController *)viewController + animated:(BOOL)animated; +-- (void)dismissModalHostView:(HippyModalHostView *)modalHostView +- withViewController:(HippyModalHostViewController *)viewController ++- (void)dismissModalHostView:(NativeRenderModalHostView *)modalHostView ++ withViewController:(NativeRenderModalHostViewController *)viewController + animated:(BOOL)animated; + + @end +diff --git a/renderer/native/ios/renderer/component/modal/HippyModalHostViewManager.h b/renderer/native/ios/renderer/component/modal/NativeRenderModalHostViewManager.h +similarity index 64% +rename from renderer/native/ios/renderer/component/modal/HippyModalHostViewManager.h +rename to renderer/native/ios/renderer/component/modal/NativeRenderModalHostViewManager.h +index 4d8a39b9abb..33cab15c08c 100644 +--- a/renderer/native/ios/renderer/component/modal/HippyModalHostViewManager.h ++++ b/renderer/native/ios/renderer/component/modal/NativeRenderModalHostViewManager.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,19 +20,19 @@ + * limitations under the License. + */ + +-#import ""HippyViewManager.h"" +-#import ""HippyModalHostView.h"" ++#import ""NativeRenderViewManager.h"" ++#import ""NativeRenderModalHostView.h"" + +-#define HippyModalHostViewDismissNotification @""HippyModalHostViewDismissNotification"" ++#define NativeRenderModalHostViewDismissNotification @""NativeRenderModalHostViewDismissNotification"" + +-@protocol HippyModalHostViewInteractor; ++@protocol NativeRenderModalHostViewInteractor; + +-typedef void (^HippyModalViewInteractionBlock)( ++typedef void (^NativeRenderModalViewInteractionBlock)( + UIViewController *reactViewController, UIViewController *viewController, BOOL animated, dispatch_block_t completionBlock); + +-@interface HippyModalHostViewManager : HippyViewManager ++@interface NativeRenderModalHostViewManager : NativeRenderViewManager + + @property (nonatomic, strong) NSHashTable *hostViews; +-@property (nonatomic, strong) id transitioningDelegate; ++@property (nonatomic, strong) id transitioningDelegate; + + @end +diff --git a/renderer/native/ios/renderer/component/modal/NativeRenderModalHostViewManager.mm b/renderer/native/ios/renderer/component/modal/NativeRenderModalHostViewManager.mm +new file mode 100644 +index 00000000000..c26fe1c3e1c +--- /dev/null ++++ b/renderer/native/ios/renderer/component/modal/NativeRenderModalHostViewManager.mm +@@ -0,0 +1,76 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * NativeRender available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ""NativeRenderModalHostViewManager.h"" ++#import ""NativeRenderModalHostViewController.h"" ++#import ""NativeRenderObjectView.h"" ++#import ""NativeRenderUtils.h"" ++#import ""NativeRenderModalTransitioningDelegate.h"" ++ ++@interface NativeRenderObjectModalHost : NativeRenderObjectView ++ ++@end ++ ++@implementation NativeRenderObjectModalHost ++ ++- (void)setDomManager:(const std::weak_ptr)domManager { ++ [super setDomManager:domManager]; ++ CGRect frame = { .origin = CGPointZero, .size = NativeRenderScreenSize() }; ++ [self setLayoutFrame:frame]; ++} ++ ++@end ++ ++@implementation NativeRenderModalHostViewManager ++ ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(animationType, NSString) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(transparent, BOOL) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(darkStatusBarText, BOOL) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onShow, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onRequestClose, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(supportedOrientations, NSArray) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onOrientationChange, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(primaryKey, NSString) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(hideStatusBar, NSNumber) ++ ++- (UIView *)view { ++ NativeRenderModalHostView *view = [[NativeRenderModalHostView alloc] init]; ++ view.delegate = self.transitioningDelegate; ++ if (!_hostViews) { ++ _hostViews = [NSHashTable weakObjectsHashTable]; ++ } ++ [_hostViews addObject:view]; ++ return view; ++} ++ ++- (id)transitioningDelegate { ++ if (!_transitioningDelegate) { ++ _transitioningDelegate = [NativeRenderModalTransitioningDelegate new]; ++ } ++ return _transitioningDelegate; ++} ++ ++- (NativeRenderObjectView *)nativeRenderObjectView { ++ return [NativeRenderObjectModalHost new]; ++} ++ ++@end +diff --git a/renderer/native/ios/renderer/component/modal/HippyModalTransitioningDelegate.h b/renderer/native/ios/renderer/component/modal/NativeRenderModalTransitioningDelegate.h +similarity index 59% +rename from renderer/native/ios/renderer/component/modal/HippyModalTransitioningDelegate.h +rename to renderer/native/ios/renderer/component/modal/NativeRenderModalTransitioningDelegate.h +index b3770241b90..11d37d683b1 100644 +--- a/renderer/native/ios/renderer/component/modal/HippyModalTransitioningDelegate.h ++++ b/renderer/native/ios/renderer/component/modal/NativeRenderModalTransitioningDelegate.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,29 +21,29 @@ + */ + + #import +-#import ""HippyModalHostViewInteractor.h"" ++#import ""NativeRenderModalHostViewInteractor.h"" + +-@class HippyModalHostView; +-@class HippyModalHostViewController; ++@class NativeRenderModalHostView; ++@class NativeRenderModalHostViewController; + +-@protocol HippyModalHostViewInteractor; +-typedef void (^HippyModalViewInteractionBlock)( ++@protocol NativeRenderModalHostViewInteractor; ++typedef void (^NativeRenderModalViewInteractionBlock)( + UIViewController *hippyViewController, UIViewController *viewController, BOOL animated, dispatch_block_t completionBlock); + +-@interface HippyModalTransitioningDelegate : NSObject ++@interface NativeRenderModalTransitioningDelegate : NSObject + /** + * `presentationBlock` and `dismissalBlock` allow you to control how a Modal interacts with your case, + * e.g. in case you have a native navigator that has its own way to display a modal. + * If these are not specified, it falls back to the UIViewController standard way of presenting. + */ +-@property (nonatomic, strong) HippyModalViewInteractionBlock presentationBlock; +-@property (nonatomic, strong) HippyModalViewInteractionBlock dismissalBlock; ++@property (nonatomic, strong) NativeRenderModalViewInteractionBlock presentationBlock; ++@property (nonatomic, strong) NativeRenderModalViewInteractionBlock dismissalBlock; + +-- (void)presentModalHostView:(HippyModalHostView *)modalHostView +- withViewController:(HippyModalHostViewController *)viewController ++- (void)presentModalHostView:(NativeRenderModalHostView *)modalHostView ++ withViewController:(NativeRenderModalHostViewController *)viewController + animated:(BOOL)animated; +-- (void)dismissModalHostView:(HippyModalHostView *)modalHostView +- withViewController:(HippyModalHostViewController *)viewController ++- (void)dismissModalHostView:(NativeRenderModalHostView *)modalHostView ++ withViewController:(NativeRenderModalHostViewController *)viewController + animated:(BOOL)animated; + + @end +diff --git a/renderer/native/ios/renderer/component/modal/HippyModalTransitioningDelegate.mm b/renderer/native/ios/renderer/component/modal/NativeRenderModalTransitioningDelegate.mm +similarity index 75% +rename from renderer/native/ios/renderer/component/modal/HippyModalTransitioningDelegate.mm +rename to renderer/native/ios/renderer/component/modal/NativeRenderModalTransitioningDelegate.mm +index f9c82fe0e90..08e753d7eba 100644 +--- a/renderer/native/ios/renderer/component/modal/HippyModalTransitioningDelegate.mm ++++ b/renderer/native/ios/renderer/component/modal/NativeRenderModalTransitioningDelegate.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,17 +20,17 @@ + * limitations under the License. + */ + +-#import ""HippyModalTransitioningDelegate.h"" +-#import ""HippyModalCustomPresentationController.h"" +-#import ""HippyModalCustomAnimationTransition.h"" +-#import ""UIView+Hippy.h"" ++#import ""NativeRenderModalTransitioningDelegate.h"" ++#import ""NativeRenderModalCustomPresentationController.h"" ++#import ""NativeRenderModalCustomAnimationTransition.h"" ++#import ""UIView+NativeRender.h"" + +-@implementation HippyModalTransitioningDelegate ++@implementation NativeRenderModalTransitioningDelegate + + - (nullable UIPresentationController *)presentationControllerForPresentedViewController:(UIViewController *)presented + presentingViewController:(__unused UIViewController *)presenting + sourceViewController:(__unused UIViewController *)source NS_AVAILABLE_IOS(8_0) { +- HippyModalCustomPresentationController *controller = [[HippyModalCustomPresentationController alloc] initWithPresentedViewController:presented ++ NativeRenderModalCustomPresentationController *controller = [[NativeRenderModalCustomPresentationController alloc] initWithPresentedViewController:presented + presentingViewController:presenting]; + return controller; + } +@@ -38,19 +38,19 @@ - (nullable UIPresentationController *)presentationControllerForPresentedViewCon + - (nullable id)animationControllerForPresentedController:(__unused UIViewController *)presented + presentingController:(__unused UIViewController *)presenting + sourceController:(__unused UIViewController *)source { +- HippyModalCustomAnimationTransition *transition = [HippyModalCustomAnimationTransition new]; ++ NativeRenderModalCustomAnimationTransition *transition = [NativeRenderModalCustomAnimationTransition new]; + transition.isPresent = YES; + return transition; + } + + - (nullable id)animationControllerForDismissedController:(__unused UIViewController *)dismissed { +- HippyModalCustomAnimationTransition *transition = [HippyModalCustomAnimationTransition new]; ++ NativeRenderModalCustomAnimationTransition *transition = [NativeRenderModalCustomAnimationTransition new]; + transition.isPresent = NO; + return transition; + } + +-- (void)presentModalHostView:(HippyModalHostView *)modalHostView +- withViewController:(HippyModalHostViewController *)viewController ++- (void)presentModalHostView:(NativeRenderModalHostView *)modalHostView ++ withViewController:(NativeRenderModalHostViewController *)viewController + animated:(BOOL)animated { + dispatch_block_t completionBlock = ^{ + if (modalHostView.onShow) { +@@ -68,15 +68,15 @@ - (void)presentModalHostView:(HippyModalHostView *)modalHostView + } + } + +-- (void)dismissModalHostView:(HippyModalHostView *)modalHostView +- withViewController:(HippyModalHostViewController *)viewController ++- (void)dismissModalHostView:(NativeRenderModalHostView *)modalHostView ++ withViewController:(NativeRenderModalHostViewController *)viewController + animated:(BOOL)animated { + dispatch_block_t completionBlock = ^{ + NSDictionary *userInfo = nil; + if (modalHostView.primaryKey.length != 0) { + userInfo = @{ @""primaryKey"": modalHostView.primaryKey }; + } +- [[NSNotificationCenter defaultCenter] postNotificationName:HippyModalHostViewDismissNotification object:self userInfo:userInfo]; ++ [[NSNotificationCenter defaultCenter] postNotificationName:NativeRenderModalHostViewDismissNotification object:self userInfo:userInfo]; + if (modalHostView.onRequestClose) { + modalHostView.onRequestClose(nil); + } +diff --git a/renderer/native/ios/renderer/component/navigator/HippyNavigationControllerAnimator.h b/renderer/native/ios/renderer/component/navigator/NativeRenderNavigationControllerAnimator.h +similarity index 69% +rename from renderer/native/ios/renderer/component/navigator/HippyNavigationControllerAnimator.h +rename to renderer/native/ios/renderer/component/navigator/NativeRenderNavigationControllerAnimator.h +index d75163deac4..459b8b6b485 100644 +--- a/renderer/native/ios/renderer/component/navigator/HippyNavigationControllerAnimator.h ++++ b/renderer/native/ios/renderer/component/navigator/NativeRenderNavigationControllerAnimator.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -22,15 +22,15 @@ + + #import + +-typedef NS_ENUM(NSInteger, HippyNavigatorDirection) { +- HippyNavigatorDirectionTypeRight = 0, +- HippyNavigatorDirectionTypeLeft, +- HippyNavigatorDirectionTypeTop, +- HippyNavigatorDirectionTypeBottom, ++typedef NS_ENUM(NSInteger, NativeRenderNavigatorDirection) { ++ NativeRenderNavigatorDirectionTypeRight = 0, ++ NativeRenderNavigatorDirectionTypeLeft, ++ NativeRenderNavigatorDirectionTypeTop, ++ NativeRenderNavigatorDirectionTypeBottom, + }; + +-@interface HippyNavigationControllerAnimator : NSObject ++@interface NativeRenderNavigationControllerAnimator : NSObject + + + (NSObject *)animatorWithAction:(UINavigationControllerOperation)action +- diretion:(HippyNavigatorDirection)direction; ++ diretion:(NativeRenderNavigatorDirection)direction; + @end +diff --git a/renderer/native/ios/renderer/component/navigator/HippyNavigationControllerAnimator.m b/renderer/native/ios/renderer/component/navigator/NativeRenderNavigationControllerAnimator.m +similarity index 84% +rename from renderer/native/ios/renderer/component/navigator/HippyNavigationControllerAnimator.m +rename to renderer/native/ios/renderer/component/navigator/NativeRenderNavigationControllerAnimator.m +index 1e16503eea3..415fbb496ad 100644 +--- a/renderer/native/ios/renderer/component/navigator/HippyNavigationControllerAnimator.m ++++ b/renderer/native/ios/renderer/component/navigator/NativeRenderNavigationControllerAnimator.m +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,7 +20,7 @@ + * limitations under the License. + */ + +-#import ""HippyNavigationControllerAnimator.h"" ++#import ""NativeRenderNavigationControllerAnimator.h"" + + const NSTimeInterval kTrainsitionDurationDefault = 0.4; + +@@ -29,20 +29,20 @@ + const CGPoint topPageOrigin = { 0, -1 }; + const CGPoint bottomPageOrigin = { 0, 1 }; + +-@interface HippyNavigationControllerAnimator () +-@property (assign, nonatomic) HippyNavigatorDirection direction; ++@interface NativeRenderNavigationControllerAnimator () ++@property (assign, nonatomic) NativeRenderNavigatorDirection direction; + @property (assign, nonatomic) UINavigationControllerOperation action; + + @end + +-@implementation HippyNavigationControllerAnimator ++@implementation NativeRenderNavigationControllerAnimator + + + (NSObject *)animatorWithAction:(UINavigationControllerOperation)action +- diretion:(HippyNavigatorDirection)direction { ++ diretion:(NativeRenderNavigatorDirection)direction { + if (action == UINavigationControllerOperationNone) { + return nil; + } +- HippyNavigationControllerAnimator *animator = [HippyNavigationControllerAnimator new]; ++ NativeRenderNavigationControllerAnimator *animator = [NativeRenderNavigationControllerAnimator new]; + animator.action = action; + animator.direction = direction; + return animator; +@@ -80,22 +80,22 @@ - (void)animateTransition:(id)transitionCo + } + } + +-- (CGRect)pageFrameWithDirection:(HippyNavigatorDirection)direction { ++- (CGRect)pageFrameWithDirection:(NativeRenderNavigatorDirection)direction { + CGPoint pageOrigin = CGPointZero; + switch (direction) { +- case HippyNavigatorDirectionTypeLeft: ++ case NativeRenderNavigatorDirectionTypeLeft: + pageOrigin.x = leftPageOrigin.x; + pageOrigin.y = leftPageOrigin.y; + break; +- case HippyNavigatorDirectionTypeTop: ++ case NativeRenderNavigatorDirectionTypeTop: + pageOrigin.x = topPageOrigin.x; + pageOrigin.y = topPageOrigin.y; + break; +- case HippyNavigatorDirectionTypeBottom: ++ case NativeRenderNavigatorDirectionTypeBottom: + pageOrigin.x = bottomPageOrigin.x; + pageOrigin.y = bottomPageOrigin.y; + break; +- case HippyNavigatorDirectionTypeRight: ++ case NativeRenderNavigatorDirectionTypeRight: + default: + pageOrigin.x = rightPageOrigin.x; + pageOrigin.y = rightPageOrigin.y; +diff --git a/renderer/native/ios/renderer/component/navigator/HippyNavigatorHostView.h b/renderer/native/ios/renderer/component/navigator/NativeRenderNavigatorHostView.h +similarity index 90% +rename from renderer/native/ios/renderer/component/navigator/HippyNavigatorHostView.h +rename to renderer/native/ios/renderer/component/navigator/NativeRenderNavigatorHostView.h +index 42750b8ca99..1d152847e94 100644 +--- a/renderer/native/ios/renderer/component/navigator/HippyNavigatorHostView.h ++++ b/renderer/native/ios/renderer/component/navigator/NativeRenderNavigatorHostView.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -27,7 +27,7 @@ NS_ASSUME_NONNULL_BEGIN + @protocol NavigatorHostViewDelegate + @end + +-@interface HippyNavigatorHostView : UIView ++@interface NativeRenderNavigatorHostView : UIView + + @property (nonatomic, weak) id delegate; + +diff --git a/renderer/native/ios/renderer/component/navigator/HippyNavigatorHostView.mm b/renderer/native/ios/renderer/component/navigator/NativeRenderNavigatorHostView.mm +similarity index 67% +rename from renderer/native/ios/renderer/component/navigator/HippyNavigatorHostView.mm +rename to renderer/native/ios/renderer/component/navigator/NativeRenderNavigatorHostView.mm +index 46208bfebba..1ef5a755285 100644 +--- a/renderer/native/ios/renderer/component/navigator/HippyNavigatorHostView.mm ++++ b/renderer/native/ios/renderer/component/navigator/NativeRenderNavigatorHostView.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,24 +20,23 @@ + * limitations under the License. + */ + +-#import ""HippyNavigatorHostView.h"" +-#import ""HippyNavigationControllerAnimator.h"" +-#import ""HippyRootView.h"" +-#import ""UIView+Hippy.h"" +-#import ""HippyNavigatorItemViewController.h"" +-#import ""HippyNavigatorRootViewController.h"" +-#import ""UIView+AppearEvent.h"" ++#import ""NativeRenderNavigatorHostView.h"" ++#import ""NativeRenderNavigationControllerAnimator.h"" ++#import ""UIView+NativeRender.h"" ++#import ""NativeRenderNavigatorItemViewController.h"" ++#import ""NativeRenderNavigatorRootViewController.h"" ++#import ""UIView+MountEvent.h"" + +-@interface HippyNavigatorHostView () { ++@interface NativeRenderNavigatorHostView () { + NSDictionary *_initProps; + NSString *_appName; +- HippyNavigatorRootViewController *_navigatorRootViewController; ++ NativeRenderNavigatorRootViewController *_navigatorRootViewController; + BOOL _isPresented; + } +-@property (nonatomic, assign) HippyNavigatorDirection nowDirection; ++@property (nonatomic, assign) NativeRenderNavigatorDirection nowDirection; + @end + +-@implementation HippyNavigatorHostView ++@implementation NativeRenderNavigatorHostView + + - (instancetype)initWithProps:(nonnull NSDictionary *)props { + self = [super init]; +@@ -45,7 +44,7 @@ - (instancetype)initWithProps:(nonnull NSDictionary *)props { + _initProps = props[@""initialRoute""][@""initProps""]; + _appName = props[@""initialRoute""][@""routeName""]; + _isPresented = NO; +- _nowDirection = HippyNavigatorDirectionTypeRight; ++ _nowDirection = NativeRenderNavigatorDirectionTypeRight; + } + return self; + } +@@ -57,10 +56,10 @@ - (void)didMoveToWindow { + - (UIView *)createRootViewForModuleName:(NSString *)moduleName initProperties:(NSDictionary *)props { + //TODO need create root view + // HippyBridge *tempBridge = _bridge; +-// if ([tempBridge isKindOfClass:[HippyBatchedBridge class]]) { +-// tempBridge = [(HippyBatchedBridge *)tempBridge parentBridge]; ++// if ([tempBridge isKindOfClass:[NativeRenderBatchedBridge class]]) { ++// tempBridge = [(NativeRenderBatchedBridge *)tempBridge parentBridge]; + // } +-// HippyRootView *rootView = [[HippyRootView alloc] initWithBridge:tempBridge moduleName:moduleName ++// NativeRenderRootView *rootView = [[NativeRenderRootView alloc] initWithBridge:tempBridge moduleName:moduleName + // initialProperties:props + // delegate:nil]; + // rootView.backgroundColor = [UIColor whiteColor]; +@@ -72,10 +71,10 @@ - (void)presentRootView { + if (!_isPresented && self.window) { + _isPresented = YES; + UIView *rootView = [self createRootViewForModuleName:_appName initProperties:_initProps]; +- HippyNavigatorItemViewController *itemViewController = [[HippyNavigatorItemViewController alloc] initWithView:rootView]; ++ NativeRenderNavigatorItemViewController *itemViewController = [[NativeRenderNavigatorItemViewController alloc] initWithView:rootView]; + UIViewController *presentingViewController = [self hippyViewController]; + NSAssert(presentingViewController, @""no presenting view controller for navigator module""); +- _navigatorRootViewController = [[HippyNavigatorRootViewController alloc] initWithRootViewController:itemViewController]; ++ _navigatorRootViewController = [[NativeRenderNavigatorRootViewController alloc] initWithRootViewController:itemViewController]; + _navigatorRootViewController.navigationBar.hidden = YES; + _navigatorRootViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; + _navigatorRootViewController.delegate = self; +@@ -105,9 +104,8 @@ - (void)push:(NSDictionary *)params { + NSDictionary *initProps = params[@""initProps""]; + NSString *direction = params[@""fromDirection""]; + self.nowDirection = [self findDirection:direction]; +- +- HippyRootView *rootView = [self createRootViewForModuleName:appName initProperties:initProps]; +- HippyNavigatorItemViewController *itemViewController = [[HippyNavigatorItemViewController alloc] initWithView:rootView]; ++ UIView *rootView = [self createRootViewForModuleName:appName initProperties:initProps]; ++ NativeRenderNavigatorItemViewController *itemViewController = [[NativeRenderNavigatorItemViewController alloc] initWithView:rootView]; + [_navigatorRootViewController pushViewController:itemViewController animated:animated]; + } + +@@ -119,20 +117,20 @@ - (void)pop:(NSDictionary *)params { + [_navigatorRootViewController popViewControllerAnimated:animated]; + } + +-- (HippyNavigatorDirection)findDirection:(NSString *)directionString { ++- (NativeRenderNavigatorDirection)findDirection:(NSString *)directionString { + //默认方向 + if (!directionString || [directionString isEqualToString:@""""]) { +- return HippyNavigatorDirectionTypeRight; ++ return NativeRenderNavigatorDirectionTypeRight; + } +- HippyNavigatorDirection result = HippyNavigatorDirectionTypeRight; ++ NativeRenderNavigatorDirection result = NativeRenderNavigatorDirectionTypeRight; + if ([directionString isEqualToString:@""left""]) { +- result = HippyNavigatorDirectionTypeLeft; ++ result = NativeRenderNavigatorDirectionTypeLeft; + } else if ([directionString isEqualToString:@""bottom""]) { +- result = HippyNavigatorDirectionTypeBottom; ++ result = NativeRenderNavigatorDirectionTypeBottom; + } else if ([directionString isEqualToString:@""top""]) { +- result = HippyNavigatorDirectionTypeTop; ++ result = NativeRenderNavigatorDirectionTypeTop; + } else if ([directionString isEqualToString:@""right""]) { +- result = HippyNavigatorDirectionTypeRight; ++ result = NativeRenderNavigatorDirectionTypeRight; + } + return result; + } +@@ -141,11 +139,11 @@ - (HippyNavigatorDirection)findDirection:(NSString *)directionString { + animationControllerForOperation:(UINavigationControllerOperation)operation + fromViewController:(UIViewController *)fromVC + toViewController:(UIViewController *)toVC { +- if (self.nowDirection == HippyNavigatorDirectionTypeRight) { ++ if (self.nowDirection == NativeRenderNavigatorDirectionTypeRight) { + //用系统默认的 + return nil; + } +- return [HippyNavigationControllerAnimator animatorWithAction:operation diretion:self.nowDirection]; ++ return [NativeRenderNavigationControllerAnimator animatorWithAction:operation diretion:self.nowDirection]; + } + + - (void)dealloc { +diff --git a/renderer/native/ios/renderer/component/navigator/HippyNavigatorItemViewController.h b/renderer/native/ios/renderer/component/navigator/NativeRenderNavigatorItemViewController.h +similarity index 89% +rename from renderer/native/ios/renderer/component/navigator/HippyNavigatorItemViewController.h +rename to renderer/native/ios/renderer/component/navigator/NativeRenderNavigatorItemViewController.h +index 88016d3954a..b15945b3902 100644 +--- a/renderer/native/ios/renderer/component/navigator/HippyNavigatorItemViewController.h ++++ b/renderer/native/ios/renderer/component/navigator/NativeRenderNavigatorItemViewController.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -24,7 +24,7 @@ + + NS_ASSUME_NONNULL_BEGIN + +-@interface HippyNavigatorItemViewController : UIViewController ++@interface NativeRenderNavigatorItemViewController : UIViewController + - (instancetype)initWithView:(UIView *)view; + @end + +diff --git a/renderer/native/ios/renderer/component/navigator/HippyNavigatorItemViewController.m b/renderer/native/ios/renderer/component/navigator/NativeRenderNavigatorItemViewController.m +similarity index 83% +rename from renderer/native/ios/renderer/component/navigator/HippyNavigatorItemViewController.m +rename to renderer/native/ios/renderer/component/navigator/NativeRenderNavigatorItemViewController.m +index bc7fd36c5ce..8c7320e00a3 100644 +--- a/renderer/native/ios/renderer/component/navigator/HippyNavigatorItemViewController.m ++++ b/renderer/native/ios/renderer/component/navigator/NativeRenderNavigatorItemViewController.m +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,13 +20,13 @@ + * limitations under the License. + */ + +-#import ""HippyNavigatorItemViewController.h"" ++#import ""NativeRenderNavigatorItemViewController.h"" + +-@interface HippyNavigatorItemViewController () ++@interface NativeRenderNavigatorItemViewController () + + @end + +-@implementation HippyNavigatorItemViewController ++@implementation NativeRenderNavigatorItemViewController + + - (instancetype)initWithView:(UIView *)view { + self = [super init]; +diff --git a/renderer/native/ios/renderer/component/navigator/HippyNavigatorRootViewController.h b/renderer/native/ios/renderer/component/navigator/NativeRenderNavigatorRootViewController.h +similarity index 88% +rename from renderer/native/ios/renderer/component/navigator/HippyNavigatorRootViewController.h +rename to renderer/native/ios/renderer/component/navigator/NativeRenderNavigatorRootViewController.h +index c855667cdd8..4aaee73af9a 100644 +--- a/renderer/native/ios/renderer/component/navigator/HippyNavigatorRootViewController.h ++++ b/renderer/native/ios/renderer/component/navigator/NativeRenderNavigatorRootViewController.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -24,7 +24,7 @@ + + NS_ASSUME_NONNULL_BEGIN + +-@interface HippyNavigatorRootViewController : UINavigationController ++@interface NativeRenderNavigatorRootViewController : UINavigationController + + @end + +diff --git a/renderer/native/ios/renderer/component/navigator/HippyNavigatorRootViewController.m b/renderer/native/ios/renderer/component/navigator/NativeRenderNavigatorRootViewController.m +similarity index 86% +rename from renderer/native/ios/renderer/component/navigator/HippyNavigatorRootViewController.m +rename to renderer/native/ios/renderer/component/navigator/NativeRenderNavigatorRootViewController.m +index aa63b078454..7ddce0a6eb5 100644 +--- a/renderer/native/ios/renderer/component/navigator/HippyNavigatorRootViewController.m ++++ b/renderer/native/ios/renderer/component/navigator/NativeRenderNavigatorRootViewController.m +@@ -1,8 +1,9 @@ ++ + /*! + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,13 +21,13 @@ + * limitations under the License. + */ + +-#import ""HippyNavigatorRootViewController.h"" ++#import ""NativeRenderNavigatorRootViewController.h"" + +-@interface HippyNavigatorRootViewController () ++@interface NativeRenderNavigatorRootViewController () + + @end + +-@implementation HippyNavigatorRootViewController ++@implementation NativeRenderNavigatorRootViewController + + - (void)viewDidLoad { + [super viewDidLoad]; +diff --git a/renderer/native/ios/renderer/component/navigator/NativeRenderNavigatorViewManager.h b/renderer/native/ios/renderer/component/navigator/NativeRenderNavigatorViewManager.h +new file mode 100644 +index 00000000000..d17a29d4949 +--- /dev/null ++++ b/renderer/native/ios/renderer/component/navigator/NativeRenderNavigatorViewManager.h +@@ -0,0 +1,32 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * NativeRender available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ""NativeRenderViewManager.h"" ++#import ""NativeRenderNavigatorHostView.h"" ++ ++NS_ASSUME_NONNULL_BEGIN ++ ++@interface NativeRenderNavigatorViewManager : NativeRenderViewManager ++ ++@end ++ ++NS_ASSUME_NONNULL_END +diff --git a/renderer/native/ios/renderer/component/navigator/HippyNavigatorViewManager.mm b/renderer/native/ios/renderer/component/navigator/NativeRenderNavigatorViewManager.mm +similarity index 51% +rename from renderer/native/ios/renderer/component/navigator/HippyNavigatorViewManager.mm +rename to renderer/native/ios/renderer/component/navigator/NativeRenderNavigatorViewManager.mm +index e61cb231c33..cb642a3760c 100644 +--- a/renderer/native/ios/renderer/component/navigator/HippyNavigatorViewManager.mm ++++ b/renderer/native/ios/renderer/component/navigator/NativeRenderNavigatorViewManager.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,33 +20,33 @@ + * limitations under the License. + */ + +-#import ""HippyNavigatorViewManager.h"" ++#import ""NativeRenderNavigatorViewManager.h"" + +-@interface HippyNavigatorViewManager () ++@interface NativeRenderNavigatorViewManager () + + @end + +-@implementation HippyNavigatorViewManager ++@implementation NativeRenderNavigatorViewManager + + - (UIView *)view { +- HippyNavigatorHostView *hostView = [[HippyNavigatorHostView alloc] initWithProps:self.props]; ++ NativeRenderNavigatorHostView *hostView = [[NativeRenderNavigatorHostView alloc] initWithProps:self.props]; + hostView.delegate = self; + return hostView; + } + + // clang-format off +-RENDER_COMPONENT_EXPORT_METHOD(push:(NSNumber *__nonnull)hippyTag parms:(NSDictionary *__nonnull)params) { +- [self.renderContext addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { +- HippyNavigatorHostView *navigatorHostView = viewRegistry[hippyTag]; ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(push:(NSNumber *__nonnull)hippyTag parms:(NSDictionary *__nonnull)params) { ++ [self.renderContext addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderNavigatorHostView *navigatorHostView = viewRegistry[hippyTag]; + [navigatorHostView push:params]; + }]; + } + // clang-format on + + // clang-format off +-RENDER_COMPONENT_EXPORT_METHOD(pop:(NSNumber *__nonnull)hippyTag parms:(NSDictionary *__nonnull)params) { +- [self.renderContext addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { +- HippyNavigatorHostView *navigatorHostView = viewRegistry[hippyTag]; ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(pop:(NSNumber *__nonnull)hippyTag parms:(NSDictionary *__nonnull)params) { ++ [self.renderContext addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderNavigatorHostView *navigatorHostView = viewRegistry[hippyTag]; + [navigatorHostView pop:params]; + }]; + } +diff --git a/renderer/native/ios/renderer/component/refresh/HippyRefresh.h b/renderer/native/ios/renderer/component/refresh/NativeRenderRefresh.h +similarity index 59% +rename from renderer/native/ios/renderer/component/refresh/HippyRefresh.h +rename to renderer/native/ios/renderer/component/refresh/NativeRenderRefresh.h +index 80f1df8f173..72b02965916 100644 +--- a/renderer/native/ios/renderer/component/refresh/HippyRefresh.h ++++ b/renderer/native/ios/renderer/component/refresh/NativeRenderRefresh.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,33 +21,33 @@ + */ + + #import +-#import ""HippyTouchesView.h"" ++#import ""NativeRenderTouchesView.h"" + +-typedef NS_ENUM(NSUInteger, HippyRefreshStatus) { +- HippyRefreshStatusIdle, +- HippyRefreshStatusPulling, +- HippyRefreshStatusStartLoading, +- HippyRefreshStatusFinishLoading, ++typedef NS_ENUM(NSUInteger, NativeRenderRefreshStatus) { ++ NativeRenderRefreshStatusIdle, ++ NativeRenderRefreshStatusPulling, ++ NativeRenderRefreshStatusStartLoading, ++ NativeRenderRefreshStatusFinishLoading, + }; + +-@class HippyRefresh; +-@protocol HippyRefreshDelegate ++@class NativeRenderRefresh; ++@protocol NativeRenderRefreshDelegate + + @optional +-- (void)refreshView:(HippyRefresh *)refreshView statusChanged:(HippyRefreshStatus)status; ++- (void)refreshView:(NativeRenderRefresh *)refreshView statusChanged:(NativeRenderRefreshStatus)status; + + @end + +-@interface HippyRefresh : HippyTouchesView { ++@interface NativeRenderRefresh : NativeRenderTouchesView { + @protected + __weak UIScrollView *_scrollView; +- HippyRefreshStatus _status; +- __weak id _delegate; ++ NativeRenderRefreshStatus _status; ++ __weak id _delegate; + } + + @property (nonatomic, weak) UIScrollView *scrollView; +-@property (nonatomic, readonly) HippyRefreshStatus status; +-@property (nonatomic, weak) id delegate; ++@property (nonatomic, readonly) NativeRenderRefreshStatus status; ++@property (nonatomic, weak) id delegate; + + - (void)unsetFromScrollView; + +diff --git a/renderer/native/ios/renderer/component/refresh/HippyRefresh.mm b/renderer/native/ios/renderer/component/refresh/NativeRenderRefresh.mm +similarity index 85% +rename from renderer/native/ios/renderer/component/refresh/HippyRefresh.mm +rename to renderer/native/ios/renderer/component/refresh/NativeRenderRefresh.mm +index 4ef82a0d994..992fcf40eb1 100644 +--- a/renderer/native/ios/renderer/component/refresh/HippyRefresh.mm ++++ b/renderer/native/ios/renderer/component/refresh/NativeRenderRefresh.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,9 +20,9 @@ + * limitations under the License. + */ + +-#import ""HippyRefresh.h"" ++#import ""NativeRenderRefresh.h"" + +-@implementation HippyRefresh ++@implementation NativeRenderRefresh + + - (void)setScrollView:(UIScrollView *)scrollView { + _scrollView = scrollView; +@@ -40,7 +40,7 @@ - (void)scrollViewDidScroll { + - (void)scrollViewDidEndDragging { + } + +-- (void)setStatus:(HippyRefreshStatus)status { ++- (void)setStatus:(NativeRenderRefreshStatus)status { + if (_status == status) { + return; + } +@@ -54,7 +54,7 @@ - (void)refresh { + [UIView animateWithDuration:.2f animations:^{ + self.scrollView.contentOffset = CGPointZero; + } completion:^(BOOL finished) { +- self.status = HippyRefreshStatusStartLoading; ++ self.status = NativeRenderRefreshStatusStartLoading; + }]; + } + +@@ -63,11 +63,11 @@ - (void)refreshFinish { + } + + - (void)setRefreshStatusToIdle { +- self.status = HippyRefreshStatusIdle; ++ self.status = NativeRenderRefreshStatusIdle; + } + + - (void)refreshFinishWithOption:(NSDictionary *)options { +- self.status = HippyRefreshStatusFinishLoading; ++ self.status = NativeRenderRefreshStatusFinishLoading; + CGFloat time = [options[@""time""] doubleValue] / 1000.f; + [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(setRefreshStatusToIdle) object:nil]; + [self performSelector:@selector(setRefreshStatusToIdle) withObject:nil afterDelay:time]; +diff --git a/renderer/native/ios/renderer/component/refreshview/HippyRefreshWrapperViewManager.h b/renderer/native/ios/renderer/component/refreshview/HippyRefreshWrapperViewManager.h +deleted file mode 100644 +index a7b1a9f58c2..00000000000 +--- a/renderer/native/ios/renderer/component/refreshview/HippyRefreshWrapperViewManager.h ++++ /dev/null +@@ -1,30 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import ""HippyViewManager.h"" +- +-NS_ASSUME_NONNULL_BEGIN +- +-@interface HippyRefreshWrapperViewManager : HippyViewManager +-@end +- +-NS_ASSUME_NONNULL_END +diff --git a/renderer/native/ios/renderer/component/refreshview/HippyRefreshWrapperViewManager.mm b/renderer/native/ios/renderer/component/refreshview/HippyRefreshWrapperViewManager.mm +deleted file mode 100644 +index 492816b2878..00000000000 +--- a/renderer/native/ios/renderer/component/refreshview/HippyRefreshWrapperViewManager.mm ++++ /dev/null +@@ -1,53 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import ""HippyRefreshWrapperViewManager.h"" +-#import ""HippyRefreshWrapper.h"" +- +-@implementation HippyRefreshWrapperViewManager +- +-HIPPY_EXPORT_VIEW_PROPERTY(onRefresh, HippyDirectEventBlock) +- +-HIPPY_EXPORT_VIEW_PROPERTY(bounceTime, CGFloat) +-- (UIView *)view { +- return [HippyRefreshWrapper new]; +-} +- +-// clang-format off +-RENDER_COMPONENT_EXPORT_METHOD(refreshComplected:(NSNumber *__nonnull)hippyTag) { +- [self.renderContext addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { +- HippyRefreshWrapper *wrapperView = viewRegistry[hippyTag]; +- [wrapperView refreshCompleted]; +- }]; +-} +-// clang-format on +- +-// clang-format off +-RENDER_COMPONENT_EXPORT_METHOD(startRefresh:(NSNumber *__nonnull)hippyTag) { +- [self.renderContext addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { +- HippyRefreshWrapper *wrapperView = viewRegistry[hippyTag]; +- [wrapperView startRefresh]; +- }]; +-} +-// clang-format on +- +-@end +diff --git a/renderer/native/ios/renderer/component/refreshview/HippyRefreshWrapper.h b/renderer/native/ios/renderer/component/refreshview/NativeRenderRefreshWrapper.h +similarity index 87% +rename from renderer/native/ios/renderer/component/refreshview/HippyRefreshWrapper.h +rename to renderer/native/ios/renderer/component/refreshview/NativeRenderRefreshWrapper.h +index b0a00ed430d..037d55b4171 100644 +--- a/renderer/native/ios/renderer/component/refreshview/HippyRefreshWrapper.h ++++ b/renderer/native/ios/renderer/component/refreshview/NativeRenderRefreshWrapper.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,11 +21,11 @@ + */ + + #import +-#import ""HippyTouchesView.h"" ++#import ""NativeRenderTouchesView.h"" + + NS_ASSUME_NONNULL_BEGIN + +-@interface HippyRefreshWrapper : HippyTouchesView ++@interface NativeRenderRefreshWrapper : NativeRenderTouchesView + + - (void)refreshCompleted; + - (void)startRefresh; +diff --git a/renderer/native/ios/renderer/component/refreshview/HippyRefreshWrapper.mm b/renderer/native/ios/renderer/component/refreshview/NativeRenderRefreshWrapper.mm +similarity index 77% +rename from renderer/native/ios/renderer/component/refreshview/HippyRefreshWrapper.mm +rename to renderer/native/ios/renderer/component/refreshview/NativeRenderRefreshWrapper.mm +index 70241dbe7d1..091f9d3f500 100644 +--- a/renderer/native/ios/renderer/component/refreshview/HippyRefreshWrapper.mm ++++ b/renderer/native/ios/renderer/component/refreshview/NativeRenderRefreshWrapper.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,21 +20,21 @@ + * limitations under the License. + */ + +-#import ""HippyRefreshWrapper.h"" +-#import ""UIView+Hippy.h"" +-#import ""HippyRefreshWrapperItemView.h"" +-#import ""HippyScrollableProtocol.h"" ++#import ""NativeRenderRefreshWrapper.h"" ++#import ""UIView+NativeRender.h"" ++#import ""NativeRenderRefreshWrapperItemView.h"" ++#import ""NativeRenderScrollableProtocol.h"" + +-@interface HippyRefreshWrapper () ++@interface NativeRenderRefreshWrapper () + +-@property (nonatomic, weak) HippyRefreshWrapperItemView *wrapperItemView; +-@property (nonatomic, weak) id scrollableView; +-@property (nonatomic, copy) HippyDirectEventBlock onRefresh; ++@property (nonatomic, weak) NativeRenderRefreshWrapperItemView *wrapperItemView; ++@property (nonatomic, weak) id scrollableView; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onRefresh; + @property (nonatomic, assign) CGFloat bounceTime; + + @end + +-@implementation HippyRefreshWrapper ++@implementation NativeRenderRefreshWrapper + - (void)addSubview:(UIView *)view { + if (view != _wrapperItemView) { + [super addSubview:view]; +@@ -74,10 +74,10 @@ - (void)startRefresh { + } + + - (void)insertHippySubview:(UIView *)view atIndex:(NSInteger)index { +- if ([view isKindOfClass:[HippyRefreshWrapperItemView class]]) { +- _wrapperItemView = (HippyRefreshWrapperItemView *)view; +- } else if ([view conformsToProtocol:@protocol(HippyScrollableProtocol)]) { +- _scrollableView = (id)view; ++ if ([view isKindOfClass:[NativeRenderRefreshWrapperItemView class]]) { ++ _wrapperItemView = (NativeRenderRefreshWrapperItemView *)view; ++ } else if ([view conformsToProtocol:@protocol(NativeRenderScrollableProtocol)]) { ++ _scrollableView = (id)view; + [_scrollableView addScrollListener:self]; + } + [super insertHippySubview:view atIndex:index]; +diff --git a/renderer/native/ios/renderer/component/refreshview/HippyRefreshWrapperItemView.h b/renderer/native/ios/renderer/component/refreshview/NativeRenderRefreshWrapperItemView.h +similarity index 84% +rename from renderer/native/ios/renderer/component/refreshview/HippyRefreshWrapperItemView.h +rename to renderer/native/ios/renderer/component/refreshview/NativeRenderRefreshWrapperItemView.h +index 278c9de311f..521f0136a79 100644 +--- a/renderer/native/ios/renderer/component/refreshview/HippyRefreshWrapperItemView.h ++++ b/renderer/native/ios/renderer/component/refreshview/NativeRenderRefreshWrapperItemView.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,8 +21,8 @@ + */ + + #import +-#import ""HippyTouchesView.h"" ++#import ""NativeRenderTouchesView.h"" + +-@interface HippyRefreshWrapperItemView : HippyTouchesView ++@interface NativeRenderRefreshWrapperItemView : NativeRenderTouchesView + + @end +diff --git a/renderer/native/ios/renderer/component/refreshview/HippyRefreshWrapperItemView.mm b/renderer/native/ios/renderer/component/refreshview/NativeRenderRefreshWrapperItemView.mm +similarity index 85% +rename from renderer/native/ios/renderer/component/refreshview/HippyRefreshWrapperItemView.mm +rename to renderer/native/ios/renderer/component/refreshview/NativeRenderRefreshWrapperItemView.mm +index 16a44704cc3..488c1966c95 100644 +--- a/renderer/native/ios/renderer/component/refreshview/HippyRefreshWrapperItemView.mm ++++ b/renderer/native/ios/renderer/component/refreshview/NativeRenderRefreshWrapperItemView.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -19,10 +19,10 @@ + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-#import ""HippyRefreshWrapperItemView.h"" +-#import ""UIView+Hippy.h"" ++#import ""NativeRenderRefreshWrapperItemView.h"" ++#import ""UIView+NativeRender.h"" + +-@implementation HippyRefreshWrapperItemView ++@implementation NativeRenderRefreshWrapperItemView + + - (void)setFrame:(CGRect)frame { + if ([self.superview isKindOfClass:[UIScrollView class]]) { +diff --git a/renderer/native/ios/renderer/component/refreshview/NativeRenderRefreshWrapperItemViewManager.h b/renderer/native/ios/renderer/component/refreshview/NativeRenderRefreshWrapperItemViewManager.h +new file mode 100644 +index 00000000000..f89adec573a +--- /dev/null ++++ b/renderer/native/ios/renderer/component/refreshview/NativeRenderRefreshWrapperItemViewManager.h +@@ -0,0 +1,31 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * NativeRender available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ""NativeRenderViewManager.h"" ++ ++NS_ASSUME_NONNULL_BEGIN ++ ++@interface NativeRenderRefreshWrapperItemViewManager : NativeRenderViewManager ++ ++@end ++ ++NS_ASSUME_NONNULL_END +diff --git a/renderer/native/ios/renderer/component/refreshview/HippyRefreshWrapperItemViewManager.mm b/renderer/native/ios/renderer/component/refreshview/NativeRenderRefreshWrapperItemViewManager.mm +similarity index 76% +rename from renderer/native/ios/renderer/component/refreshview/HippyRefreshWrapperItemViewManager.mm +rename to renderer/native/ios/renderer/component/refreshview/NativeRenderRefreshWrapperItemViewManager.mm +index 497dbd7eb09..591f03ae5f4 100644 +--- a/renderer/native/ios/renderer/component/refreshview/HippyRefreshWrapperItemViewManager.mm ++++ b/renderer/native/ios/renderer/component/refreshview/NativeRenderRefreshWrapperItemViewManager.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,12 +20,12 @@ + * limitations under the License. + */ + +-#import ""HippyRefreshWrapperItemViewManager.h"" +-#import ""HippyRefreshWrapperItemView.h"" ++#import ""NativeRenderRefreshWrapperItemViewManager.h"" ++#import ""NativeRenderRefreshWrapperItemView.h"" + +-@implementation HippyRefreshWrapperItemViewManager ++@implementation NativeRenderRefreshWrapperItemViewManager + + - (UIView *)view { +- return [HippyRefreshWrapperItemView new]; ++ return [NativeRenderRefreshWrapperItemView new]; + } + @end +diff --git a/renderer/native/ios/renderer/component/refreshview/NativeRenderRefreshWrapperViewManager.h b/renderer/native/ios/renderer/component/refreshview/NativeRenderRefreshWrapperViewManager.h +new file mode 100644 +index 00000000000..be2759ecc08 +--- /dev/null ++++ b/renderer/native/ios/renderer/component/refreshview/NativeRenderRefreshWrapperViewManager.h +@@ -0,0 +1,30 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * NativeRender available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ""NativeRenderViewManager.h"" ++ ++NS_ASSUME_NONNULL_BEGIN ++ ++@interface NativeRenderRefreshWrapperViewManager : NativeRenderViewManager ++@end ++ ++NS_ASSUME_NONNULL_END +diff --git a/renderer/native/ios/renderer/component/refreshview/NativeRenderRefreshWrapperViewManager.mm b/renderer/native/ios/renderer/component/refreshview/NativeRenderRefreshWrapperViewManager.mm +new file mode 100644 +index 00000000000..b21139d4799 +--- /dev/null ++++ b/renderer/native/ios/renderer/component/refreshview/NativeRenderRefreshWrapperViewManager.mm +@@ -0,0 +1,53 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * NativeRender available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ""NativeRenderRefreshWrapperViewManager.h"" ++#import ""NativeRenderRefreshWrapper.h"" ++ ++@implementation NativeRenderRefreshWrapperViewManager ++ ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onRefresh, NativeRenderDirectEventBlock) ++ ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(bounceTime, CGFloat) ++- (UIView *)view { ++ return [NativeRenderRefreshWrapper new]; ++} ++ ++// clang-format off ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(refreshComplected:(NSNumber *__nonnull)hippyTag) { ++ [self.renderContext addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderRefreshWrapper *wrapperView = viewRegistry[hippyTag]; ++ [wrapperView refreshCompleted]; ++ }]; ++} ++// clang-format on ++ ++// clang-format off ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(startRefresh:(NSNumber *__nonnull)hippyTag) { ++ [self.renderContext addUIBlock:^(id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderRefreshWrapper *wrapperView = viewRegistry[hippyTag]; ++ [wrapperView startRefresh]; ++ }]; ++} ++// clang-format on ++ ++@end +diff --git a/renderer/native/ios/renderer/component/scrollview/HippyScrollViewManager.mm b/renderer/native/ios/renderer/component/scrollview/HippyScrollViewManager.mm +deleted file mode 100644 +index a8517b5f891..00000000000 +--- a/renderer/native/ios/renderer/component/scrollview/HippyScrollViewManager.mm ++++ /dev/null +@@ -1,158 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import ""HippyScrollViewManager.h"" +-#import ""HippyScrollView.h"" +-#import ""HippyShadowView.h"" +- +-@implementation HippyConvert (UIScrollView) +- +-HIPPY_ENUM_CONVERTER(UIScrollViewKeyboardDismissMode, (@{ +- @""none"": @(UIScrollViewKeyboardDismissModeNone), +- @""on-drag"": @(UIScrollViewKeyboardDismissModeOnDrag), +- @""interactive"": @(UIScrollViewKeyboardDismissModeInteractive), +- // Backwards compatibility +- @""onDrag"": @(UIScrollViewKeyboardDismissModeOnDrag), +-}), +- UIScrollViewKeyboardDismissModeNone, integerValue) +- +-HIPPY_ENUM_CONVERTER(UIScrollViewIndicatorStyle, (@{ +- @""default"": @(UIScrollViewIndicatorStyleDefault), +- @""black"": @(UIScrollViewIndicatorStyleBlack), +- @""white"": @(UIScrollViewIndicatorStyleWhite), +-}), +- UIScrollViewIndicatorStyleDefault, integerValue) +- +-@end +- +-@implementation HippyScrollViewManager +- +-- (UIView *)view { +- return [[HippyScrollView alloc] init]; +-} +- +-HIPPY_EXPORT_VIEW_PROPERTY(alwaysBounceHorizontal, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(alwaysBounceVertical, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(horizontal, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(bounces, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(bouncesZoom, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(canCancelContentTouches, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(centerContent, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(automaticallyAdjustContentInsets, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(decelerationRate, CGFloat) +-HIPPY_EXPORT_VIEW_PROPERTY(directionalLockEnabled, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(indicatorStyle, UIScrollViewIndicatorStyle) +-HIPPY_EXPORT_VIEW_PROPERTY(keyboardDismissMode, UIScrollViewKeyboardDismissMode) +-HIPPY_EXPORT_VIEW_PROPERTY(maximumZoomScale, CGFloat) +-HIPPY_EXPORT_VIEW_PROPERTY(minimumZoomScale, CGFloat) +-HIPPY_EXPORT_VIEW_PROPERTY(scrollEnabled, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(pagingEnabled, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(scrollsToTop, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(showsHorizontalScrollIndicator, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(showsVerticalScrollIndicator, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(stickyHeaderIndices, NSIndexSet) +-HIPPY_EXPORT_VIEW_PROPERTY(scrollEventThrottle, NSTimeInterval) +-HIPPY_EXPORT_VIEW_PROPERTY(zoomScale, CGFloat) +-HIPPY_EXPORT_VIEW_PROPERTY(contentInset, UIEdgeInsets) +-HIPPY_EXPORT_VIEW_PROPERTY(scrollIndicatorInsets, UIEdgeInsets) +-HIPPY_EXPORT_VIEW_PROPERTY(snapToInterval, int) +-HIPPY_EXPORT_VIEW_PROPERTY(snapToAlignment, NSString) +-HIPPY_REMAP_VIEW_PROPERTY(contentOffset, scrollView.contentOffset, CGPoint) +-HIPPY_EXPORT_VIEW_PROPERTY(onScrollBeginDrag, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onScroll, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onScrollEndDrag, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onMomentumScrollBegin, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onMomentumScrollEnd, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onScrollAnimationEnd, HippyDirectEventBlock) +- +-// overflow is used both in css-layout as well as by reac-native. In css-layout +-// we always want to treat overflow as scroll but depending on what the overflow +-// is set to from js we want to clip drawing or not. This piece of code ensures +-// that css-layout is always treating the contents of a scroll container as +-// overflow: 'scroll'. +-HIPPY_CUSTOM_SHADOW_PROPERTY(overflow, OverflowType, HippyShadowView) { +- (void)json; +- view.overflow = OverflowScroll; +-} +- +-// clang-format off +-RENDER_COMPONENT_EXPORT_METHOD(getContentSize:(nonnull NSNumber *)hippyTag +- callback:(RenderUIResponseSenderBlock)callback) { +- [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { +- HippyScrollView *view = viewRegistry[hippyTag]; +- CGSize size = view.scrollView.contentSize; +- callback(@{@""width"" : @(size.width),@""height"" : @(size.height)}); +- }]; +-} +-// clang-format on +- +-// clang-format off +-RENDER_COMPONENT_EXPORT_METHOD(scrollTo:(nonnull NSNumber *)hippyTag +- offsetX:(NSNumber *)x +- offsetY:(NSNumber *)y +- animated:(NSNumber *)animated) { +- [self.renderContext addUIBlock: +- ^(__unused id renderContext, NSDictionary *viewRegistry){ +- UIView *view = viewRegistry[hippyTag]; +- if (view == nil) return ; +- if ([view conformsToProtocol:@protocol(HippyScrollableProtocol)]) { +- [(id)view scrollToOffset:(CGPoint){[x floatValue], [y floatValue]} animated:[animated boolValue]]; +- } else { +-// HippyLogError(@""tried to scrollTo: on non-HippyScrollableProtocol view %@ "" +-// ""with tag #%@"", view, hippyTag); +- } +- }]; +-} +-// clang-format on +- +-// clang-format off +-RENDER_COMPONENT_EXPORT_METHOD(scrollToWithOptions:(nonnull NSNumber *)hippyTag +- options:(NSDictionary *)options) { +- [self.renderContext addUIBlock: +- ^(__unused id renderContext, NSDictionary *viewRegistry){ +- UIView *view = viewRegistry[hippyTag]; +- if (view == nil) return ; +- if ([view conformsToProtocol:@protocol(HippyScrollableProtocol)]) { +- CGFloat duration = 1.0; +- CGFloat x = 0; +- CGFloat y = 0; +- if (options && [options[@""duration""] isKindOfClass:[NSNumber class]]) {//毫秒 +- duration = ((NSNumber *)(options[@""duration""])).floatValue / 1000.0; +- } +- if (options && [options[@""x""] isKindOfClass:[NSNumber class]]) { +- x = ((NSNumber *)(options[@""x""])).floatValue; +- } +- if (options && [options[@""y""] isKindOfClass:[NSNumber class]]) { +- y = ((NSNumber *)(options[@""y""])).floatValue; +- } +- [UIView animateWithDuration:duration animations:^{ +- ((HippyScrollView *)view).scrollView.contentOffset = CGPointMake(x, y); +- }]; +- } else { +-// HippyLogError(@""tried to scrollTo: on non-HippyScrollableProtocol view %@ "" +-// ""with tag #%@"", view, hippyTag); +- } +- }]; +-} +-// clang-format on +- +-@end +diff --git a/renderer/native/ios/renderer/component/scrollview/HippyScrollView.h b/renderer/native/ios/renderer/component/scrollview/NativeRenderScrollView.h +similarity index 72% +rename from renderer/native/ios/renderer/component/scrollview/HippyScrollView.h +rename to renderer/native/ios/renderer/component/scrollview/NativeRenderScrollView.h +index 8759757383f..20a47d616a1 100644 +--- a/renderer/native/ios/renderer/component/scrollview/HippyScrollView.h ++++ b/renderer/native/ios/renderer/component/scrollview/NativeRenderScrollView.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,16 +21,16 @@ + */ + + #import +-#import ""HippyAutoInsetsProtocol.h"" +-#import ""HippyScrollableProtocol.h"" +-#import ""HippyView.h"" ++#import ""NativeRenderAutoInsetsProtocol.h"" ++#import ""NativeRenderScrollableProtocol.h"" ++#import ""NativeRenderView.h"" + + @protocol UIScrollViewDelegate; + +-@interface HippyScrollView : HippyView ++@interface NativeRenderScrollView : NativeRenderView + + /** +- * The `HippyScrollView` may have at most one single subview. This will ensure ++ * The `NativeRenderScrollView` may have at most one single subview. This will ensure + * that the scroll view's `contentSize` will be efficiently set to the size of + * the single subview's frame. That frame size will be determined somewhat + * efficiently since it will have already been computed by the off-main-thread +@@ -61,12 +61,12 @@ + // NOTE: currently these event props are only declared so we can export the + // event names to JS - we don't call the blocks directly because scroll events + // need to be coalesced before sending, for performance reasons. +-@property (nonatomic, copy) HippyDirectEventBlock onScrollBeginDrag; +-@property (nonatomic, copy) HippyDirectEventBlock onScroll; +-@property (nonatomic, copy) HippyDirectEventBlock onScrollEndDrag; +-@property (nonatomic, copy) HippyDirectEventBlock onMomentumScrollBegin; +-@property (nonatomic, copy) HippyDirectEventBlock onMomentumScrollEnd; +-@property (nonatomic, copy) HippyDirectEventBlock onScrollAnimationEnd; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onScrollBeginDrag; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onScroll; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onScrollEndDrag; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onMomentumScrollBegin; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onMomentumScrollEnd; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onScrollAnimationEnd; + + @property (nonatomic, assign) CGPoint targetOffset; + +diff --git a/renderer/native/ios/renderer/component/scrollview/HippyScrollView.mm b/renderer/native/ios/renderer/component/scrollview/NativeRenderScrollView.mm +similarity index 91% +rename from renderer/native/ios/renderer/component/scrollview/HippyScrollView.mm +rename to renderer/native/ios/renderer/component/scrollview/NativeRenderScrollView.mm +index da1bdf47364..6a907b42534 100644 +--- a/renderer/native/ios/renderer/component/scrollview/HippyScrollView.mm ++++ b/renderer/native/ios/renderer/component/scrollview/NativeRenderScrollView.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,18 +21,18 @@ + */ + + #import +-#import ""HippyScrollView.h"" +-#import ""UIView+Private.h"" +-#import ""UIView+Hippy.h"" ++#import ""NativeRenderScrollView.h"" ++#import ""UIView+NativeRender.h"" ++#import ""UIView+MountEvent.h"" + #import ""UIView+DirectionalLayout.h"" + +-@interface HippyCustomScrollView : UIScrollView ++@interface NativeRenderCustomScrollView : UIScrollView + + @property (nonatomic, assign) BOOL centerContent; + + @end + +-@implementation HippyCustomScrollView ++@implementation NativeRenderCustomScrollView + + - (instancetype)initWithFrame:(CGRect)frame { + if ((self = [super initWithFrame:frame])) { +@@ -51,7 +51,7 @@ - (void)setTransform:(CGAffineTransform)transform { + } + + - (UIView *)contentView { +- return ((HippyScrollView *)self.superview).contentView; ++ return ((NativeRenderScrollView *)self.superview).contentView; + } + + /** +@@ -97,7 +97,7 @@ - (void)scrollRectToVisible:(__unused CGRect)rect animated:(__unused BOOL)animat + * + * By default this returns NO for all views that are UIControls and YES for + * everything else. What that does is allows scroll views to scroll even when a +- * touch started inside of a `UIControl` (`UIButton` etc). For Hippy scroll ++ * touch started inside of a `UIControl` (`UIButton` etc). For NativeRender scroll + * views, we want the default to be the same behavior as `UIControl`s so we + * return `YES` by default. But there's one case where we want to block the + * scrolling no matter what: When JS believes it has its own responder lock on +@@ -157,8 +157,8 @@ - (void)setContentOffset:(CGPoint)contentOffset { + + @end + +-@implementation HippyScrollView { +- HippyCustomScrollView *_scrollView; ++@implementation NativeRenderScrollView { ++ NativeRenderCustomScrollView *_scrollView; + UIView *_contentView; + NSTimeInterval _lastScrollDispatchTime; + BOOL _allowNextScrollNoMatterWhat; +@@ -177,7 +177,7 @@ @implementation HippyScrollView { + + - (instancetype)initWithFrame:(CGRect)frame { + if ((self = [super initWithFrame:frame])) { +- _scrollView = [[HippyCustomScrollView alloc] initWithFrame:CGRectZero]; ++ _scrollView = [[NativeRenderCustomScrollView alloc] initWithFrame:CGRectZero]; + _scrollView.delegate = self; + _scrollView.delaysContentTouches = NO; + _automaticallyAdjustContentInsets = YES; +@@ -205,15 +205,11 @@ - (void)invalidate { + [_scrollListeners removeAllObjects]; + } + +-- (void)setRemoveClippedSubviews:(__unused BOOL)removeClippedSubviews { +- // Does nothing +-} +- + - (void)insertHippySubview:(UIView *)view atIndex:(NSInteger)atIndex { + if (view == _contentView && 0 == atIndex) { + return; + } +- NSAssert(0 == atIndex, @""HippyScrollView only contain one subview at index 0""); ++ NSAssert(0 == atIndex, @""NativeRenderScrollView only contain one subview at index 0""); + if (_contentView) { + [self removeHippySubview:_contentView]; + } +@@ -302,7 +298,7 @@ - (void)layoutSubviews { + _scrollView.frame = self.bounds; + if (CGRectGetWidth(originFrame) > 0) { + NSInteger currIndex = _scrollView.contentOffset.x / CGRectGetWidth(originFrame); +- //解决HippyScrollView横竖屏切换时 didScrollView没有回调onScroll的问题 ++ //解决NativeRenderScrollView横竖屏切换时 didScrollView没有回调onScroll的问题 + _allowNextScrollNoMatterWhat = YES; + _scrollView.contentOffset = CGPointMake(currIndex * CGRectGetWidth(_scrollView.frame), 0); + } +@@ -323,34 +319,6 @@ - (void)layoutSubviews { + + _scrollView.contentOffset = originalOffset; + } +- +- [self updateClippedSubviews]; +-} +- +-- (void)updateClippedSubviews { +- // Find a suitable view to use for clipping +- UIView *clipView = [self hippy_findClipView]; +- if (!clipView) { +- return; +- } +- +- static const CGFloat leeway = 1.0; +- +- const CGSize contentSize = _scrollView.contentSize; +- const CGRect bounds = _scrollView.bounds; +- const BOOL scrollsHorizontally = contentSize.width > bounds.size.width; +- const BOOL scrollsVertically = contentSize.height > bounds.size.height; +- +- const BOOL shouldClipAgain +- = CGRectIsNull(_lastClippedToRect) || !CGRectEqualToRect(_lastClippedToRect, bounds) +- || (scrollsHorizontally && (bounds.size.width < leeway || fabs(_lastClippedToRect.origin.x - bounds.origin.x) >= leeway)) +- || (scrollsVertically && (bounds.size.height < leeway || fabs(_lastClippedToRect.origin.y - bounds.origin.y) >= leeway)); +- +- if (shouldClipAgain) { +- const CGRect clipRect = CGRectInset(clipView.bounds, -leeway, -leeway); +- [self hippy_updateClippedSubviewsWithClipRect:clipRect relativeToView:clipView]; +- _lastClippedToRect = bounds; +- } + } + + - (void)setContentInset:(UIEdgeInsets)contentInset { +@@ -361,7 +329,7 @@ - (void)setContentInset:(UIEdgeInsets)contentInset { + CGPoint contentOffset = _scrollView.contentOffset; + + _contentInset = contentInset; +- [HippyView autoAdjustInsetsForView:self withScrollView:_scrollView updateOffset:NO]; ++ [NativeRenderView autoAdjustInsetsForView:self withScrollView:_scrollView updateOffset:NO]; + + _scrollView.contentOffset = contentOffset; + } +@@ -390,7 +358,7 @@ - (void)zoomToRect:(CGRect)rect animated:(BOOL)animated { + } + + - (void)refreshContentInset { +- [HippyView autoAdjustInsetsForView:self withScrollView:_scrollView updateOffset:YES]; ++ [NativeRenderView autoAdjustInsetsForView:self withScrollView:_scrollView updateOffset:YES]; + } + + #pragma mark - ScrollView delegate +@@ -429,16 +397,7 @@ - (NSDictionary *)scrollEventBody { + } + + - (void)scrollViewDidScroll:(UIScrollView *)scrollView { +- [self updateClippedSubviews]; +- + NSTimeInterval now = CACurrentMediaTime(); +- +- /** +- * TODO: this logic looks wrong, and it may be because it is. Currently, if _scrollEventThrottle +- * is set to zero (the default), the ""didScroll"" event is only sent once per scroll, instead of repeatedly +- * while scrolling as expected. However, if you ""fix"" that bug, ScrollView will generate repeated +- * warnings, and behave strangely (ListView works fine however), so don't fix it unless you fix that too! +- */ + NSTimeInterval ti = now - _lastScrollDispatchTime; + BOOL flag = (_scrollEventThrottle > 0 && _scrollEventThrottle < ti); + if (_allowNextScrollNoMatterWhat || flag) { +diff --git a/renderer/native/ios/renderer/component/scrollview/HippyScrollViewManager.h b/renderer/native/ios/renderer/component/scrollview/NativeRenderScrollViewManager.h +similarity index 79% +rename from renderer/native/ios/renderer/component/scrollview/HippyScrollViewManager.h +rename to renderer/native/ios/renderer/component/scrollview/NativeRenderScrollViewManager.h +index 05d23b90348..5e3e55c70ef 100644 +--- a/renderer/native/ios/renderer/component/scrollview/HippyScrollViewManager.h ++++ b/renderer/native/ios/renderer/component/scrollview/NativeRenderScrollViewManager.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,15 +20,15 @@ + * limitations under the License. + */ + +-#import ""HippyViewManager.h"" +-#import ""HippyConvert.h"" ++#import ""NativeRenderViewManager.h"" ++#import ""NativeRenderConvert.h"" + +-@interface HippyConvert (UIScrollView) ++@interface NativeRenderConvert (UIScrollView) + + + (UIScrollViewKeyboardDismissMode)UIScrollViewKeyboardDismissMode:(id)json; + + @end + +-@interface HippyScrollViewManager : HippyViewManager ++@interface NativeRenderScrollViewManager : NativeRenderViewManager + + @end +diff --git a/renderer/native/ios/renderer/component/scrollview/NativeRenderScrollViewManager.mm b/renderer/native/ios/renderer/component/scrollview/NativeRenderScrollViewManager.mm +new file mode 100644 +index 00000000000..4bee4730722 +--- /dev/null ++++ b/renderer/native/ios/renderer/component/scrollview/NativeRenderScrollViewManager.mm +@@ -0,0 +1,158 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * NativeRender available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ""NativeRenderScrollViewManager.h"" ++#import ""NativeRenderScrollView.h"" ++#import ""NativeRenderObjectView.h"" ++ ++@implementation NativeRenderConvert (UIScrollView) ++ ++HIPPY_ENUM_CONVERTER(UIScrollViewKeyboardDismissMode, (@{ ++ @""none"": @(UIScrollViewKeyboardDismissModeNone), ++ @""on-drag"": @(UIScrollViewKeyboardDismissModeOnDrag), ++ @""interactive"": @(UIScrollViewKeyboardDismissModeInteractive), ++ // Backwards compatibility ++ @""onDrag"": @(UIScrollViewKeyboardDismissModeOnDrag), ++}), ++ UIScrollViewKeyboardDismissModeNone, integerValue) ++ ++HIPPY_ENUM_CONVERTER(UIScrollViewIndicatorStyle, (@{ ++ @""default"": @(UIScrollViewIndicatorStyleDefault), ++ @""black"": @(UIScrollViewIndicatorStyleBlack), ++ @""white"": @(UIScrollViewIndicatorStyleWhite), ++}), ++ UIScrollViewIndicatorStyleDefault, integerValue) ++ ++@end ++ ++@implementation NativeRenderScrollViewManager ++ ++- (UIView *)view { ++ return [[NativeRenderScrollView alloc] init]; ++} ++ ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(alwaysBounceHorizontal, BOOL) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(alwaysBounceVertical, BOOL) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(horizontal, BOOL) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(bounces, BOOL) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(bouncesZoom, BOOL) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(canCancelContentTouches, BOOL) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(centerContent, BOOL) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(automaticallyAdjustContentInsets, BOOL) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(decelerationRate, CGFloat) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(directionalLockEnabled, BOOL) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(indicatorStyle, UIScrollViewIndicatorStyle) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(keyboardDismissMode, UIScrollViewKeyboardDismissMode) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(maximumZoomScale, CGFloat) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(minimumZoomScale, CGFloat) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(scrollEnabled, BOOL) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(pagingEnabled, BOOL) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(scrollsToTop, BOOL) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(showsHorizontalScrollIndicator, BOOL) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(showsVerticalScrollIndicator, BOOL) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(stickyHeaderIndices, NSIndexSet) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(scrollEventThrottle, NSTimeInterval) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(zoomScale, CGFloat) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(contentInset, UIEdgeInsets) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(scrollIndicatorInsets, UIEdgeInsets) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(snapToInterval, int) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(snapToAlignment, NSString) ++NATIVE_RENDER_REMAP_VIEW_PROPERTY(contentOffset, scrollView.contentOffset, CGPoint) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onScrollBeginDrag, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onScroll, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onScrollEndDrag, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onMomentumScrollBegin, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onMomentumScrollEnd, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onScrollAnimationEnd, NativeRenderDirectEventBlock) ++ ++// overflow is used both in css-layout as well as by reac-native. In css-layout ++// we always want to treat overflow as scroll but depending on what the overflow ++// is set to from js we want to clip drawing or not. This piece of code ensures ++// that css-layout is always treating the contents of a scroll container as ++// overflow: 'scroll'. ++NATIVE_RENDER_CUSTOM_RENDER_OBJECT_PROPERTY(overflow, OverflowType, NativeRenderObjectView) { ++ (void)json; ++ view.overflow = OverflowScroll; ++} ++ ++// clang-format off ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(getContentSize:(nonnull NSNumber *)hippyTag ++ callback:(RenderUIResponseSenderBlock)callback) { ++ [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderScrollView *view = viewRegistry[hippyTag]; ++ CGSize size = view.scrollView.contentSize; ++ callback(@{@""width"" : @(size.width),@""height"" : @(size.height)}); ++ }]; ++} ++// clang-format on ++ ++// clang-format off ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(scrollTo:(nonnull NSNumber *)hippyTag ++ offsetX:(NSNumber *)x ++ offsetY:(NSNumber *)y ++ animated:(NSNumber *)animated) { ++ [self.renderContext addUIBlock: ++ ^(__unused id renderContext, NSDictionary *viewRegistry){ ++ UIView *view = viewRegistry[hippyTag]; ++ if (view == nil) return ; ++ if ([view conformsToProtocol:@protocol(NativeRenderScrollableProtocol)]) { ++ [(id)view scrollToOffset:(CGPoint){[x floatValue], [y floatValue]} animated:[animated boolValue]]; ++ } else { ++// NativeRenderLogError(@""tried to scrollTo: on non-NativeRenderScrollableProtocol view %@ "" ++// ""with tag #%@"", view, hippyTag); ++ } ++ }]; ++} ++// clang-format on ++ ++// clang-format off ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(scrollToWithOptions:(nonnull NSNumber *)hippyTag ++ options:(NSDictionary *)options) { ++ [self.renderContext addUIBlock: ++ ^(__unused id renderContext, NSDictionary *viewRegistry){ ++ UIView *view = viewRegistry[hippyTag]; ++ if (view == nil) return ; ++ if ([view conformsToProtocol:@protocol(NativeRenderScrollableProtocol)]) { ++ CGFloat duration = 1.0; ++ CGFloat x = 0; ++ CGFloat y = 0; ++ if (options && [options[@""duration""] isKindOfClass:[NSNumber class]]) {//毫秒 ++ duration = ((NSNumber *)(options[@""duration""])).floatValue / 1000.0; ++ } ++ if (options && [options[@""x""] isKindOfClass:[NSNumber class]]) { ++ x = ((NSNumber *)(options[@""x""])).floatValue; ++ } ++ if (options && [options[@""y""] isKindOfClass:[NSNumber class]]) { ++ y = ((NSNumber *)(options[@""y""])).floatValue; ++ } ++ [UIView animateWithDuration:duration animations:^{ ++ ((NativeRenderScrollView *)view).scrollView.contentOffset = CGPointMake(x, y); ++ }]; ++ } else { ++// NativeRenderLogError(@""tried to scrollTo: on non-NativeRenderScrollableProtocol view %@ "" ++// ""with tag #%@"", view, hippyTag); ++ } ++ }]; ++} ++// clang-format on ++ ++@end +diff --git a/renderer/native/ios/renderer/component/scrollview/HippyScrollableProtocol.h b/renderer/native/ios/renderer/component/scrollview/NativeRenderScrollableProtocol.h +similarity index 95% +rename from renderer/native/ios/renderer/component/scrollview/HippyScrollableProtocol.h +rename to renderer/native/ios/renderer/component/scrollview/NativeRenderScrollableProtocol.h +index d05c1d04602..c7ccf40e533 100644 +--- a/renderer/native/ios/renderer/component/scrollview/HippyScrollableProtocol.h ++++ b/renderer/native/ios/renderer/component/scrollview/NativeRenderScrollableProtocol.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -25,7 +25,7 @@ + /** + * Protocol for any scrollable components inherit from UIScrollView + */ +-@protocol HippyScrollableProtocol ++@protocol NativeRenderScrollableProtocol + + /** + * Content size for components +diff --git a/renderer/native/ios/renderer/component/smartViewPager/HippySmartViewPagerViewManager.h b/renderer/native/ios/renderer/component/smartViewPager/HippySmartViewPagerViewManager.h +deleted file mode 100644 +index 8fa373c0e3d..00000000000 +--- a/renderer/native/ios/renderer/component/smartViewPager/HippySmartViewPagerViewManager.h ++++ /dev/null +@@ -1,31 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import ""HippyViewManager.h"" +- +-NS_ASSUME_NONNULL_BEGIN +- +-@interface HippySmartViewPagerViewManager : HippyViewManager +- +-@end +- +-NS_ASSUME_NONNULL_END +diff --git a/renderer/native/ios/renderer/component/smartViewPager/HippySmartViewPagerViewManager.mm b/renderer/native/ios/renderer/component/smartViewPager/HippySmartViewPagerViewManager.mm +deleted file mode 100644 +index 35306509833..00000000000 +--- a/renderer/native/ios/renderer/component/smartViewPager/HippySmartViewPagerViewManager.mm ++++ /dev/null +@@ -1,90 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import ""HippySmartViewPagerViewManager.h"" +-#import ""HippySmartViewPagerView.h"" +- +-@implementation HippySmartViewPagerViewManager +- +-HIPPY_EXPORT_VIEW_PROPERTY(scrollEventThrottle, NSTimeInterval) +-HIPPY_EXPORT_VIEW_PROPERTY(initialListReady, HippyDirectEventBlock); +-HIPPY_EXPORT_VIEW_PROPERTY(onScrollBeginDrag, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onPageSelected, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onScroll, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onPageScrollStateChanged, HippyDirectEventBlock) +- +-HIPPY_EXPORT_VIEW_PROPERTY(pageGap, CGFloat) +-HIPPY_EXPORT_VIEW_PROPERTY(previousMargin, CGFloat) +-HIPPY_EXPORT_VIEW_PROPERTY(nextMargin, CGFloat) +-HIPPY_EXPORT_VIEW_PROPERTY(autoplayTimeInterval, CGFloat) +-HIPPY_EXPORT_VIEW_PROPERTY(initialPage, NSInteger) +-HIPPY_EXPORT_VIEW_PROPERTY(circular, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(autoplay, BOOL) +- +-- (UIView *)view { +- return [[HippySmartViewPagerView alloc] init]; +-} +- +-// clang-format off +-RENDER_COMPONENT_EXPORT_METHOD(setPage:(nonnull NSNumber *)hippyTag +- pageNumber:(NSNumber *)pageNumber) { +- [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry){ +- UIView *view = viewRegistry[hippyTag]; +- +- if (view == nil || ![view isKindOfClass:[HippySmartViewPagerView class]]) { +-// HippyLogError(@""tried to setPage: on an error viewPager %@ "" +-// ""with tag #%@"", view, hippyTag); +- } +- NSInteger pageNumberInteger = pageNumber.integerValue; +- [(HippySmartViewPagerView *)view setPage:pageNumberInteger animated:YES]; +- }]; +-} +-// clang-format on +- +-// clang-format off +-RENDER_COMPONENT_EXPORT_METHOD(setPageWithoutAnimation:(nonnull NSNumber *)hippyTag +- pageNumber:(NSNumber *)pageNumber) { +- [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry){ +- UIView *view = viewRegistry[hippyTag]; +- if (view == nil || ![view isKindOfClass:[HippySmartViewPagerView class]]) { +-// HippyLogError(@""tried to setPage: on an error viewPager %@ "" +-// ""with tag #%@"", view, hippyTag); +- } +- NSInteger pageNumberInteger = pageNumber.integerValue; +- [(HippySmartViewPagerView *)view setPage:pageNumberInteger animated:NO]; +- }]; +-} +-// clang-format on +- +-// clang-format off +-RENDER_COMPONENT_EXPORT_METHOD(getPageIndex:(nonnull NSNumber *)hippyTag +- callback:(RenderUIResponseSenderBlock)callback) { +- [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { +- HippySmartViewPagerView *view = viewRegistry[hippyTag]; +- NSInteger currrentPage = [view getCurrentPage]; +- callback(@(currrentPage)); +- }]; +-} +-// clang-format on +- +-@end +- +diff --git a/renderer/native/ios/renderer/component/smartViewPager/HippySmartViewPagerView.h b/renderer/native/ios/renderer/component/smartViewPager/NativeRenderSmartViewPagerView.h +similarity index 71% +rename from renderer/native/ios/renderer/component/smartViewPager/HippySmartViewPagerView.h +rename to renderer/native/ios/renderer/component/smartViewPager/NativeRenderSmartViewPagerView.h +index 8a0d0df0091..98a0bd448bc 100644 +--- a/renderer/native/ios/renderer/component/smartViewPager/HippySmartViewPagerView.h ++++ b/renderer/native/ios/renderer/component/smartViewPager/NativeRenderSmartViewPagerView.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,24 +21,24 @@ + */ + + #import +-#import ""HippyScrollView.h"" +-#import ""HippyListTableView.h"" +-#import ""HippyWaterfallView.h"" ++#import ""NativeRenderScrollView.h"" ++#import ""NativeRenderListTableView.h"" ++#import ""NativeRenderWaterfallView.h"" + + NS_ASSUME_NONNULL_BEGIN + +-@class HippyBaseListViewCell; ++@class NativeRenderBaseListViewCell; + +-@interface HippySmartViewPagerView : HippyWaterfallView ++@interface NativeRenderSmartViewPagerView : NativeRenderWaterfallView + + /** +- * Hippy events ++ * NativeRender events + */ +-@property(nonatomic, copy) HippyDirectEventBlock initialListReady; +-@property(nonatomic, copy) HippyDirectEventBlock onScrollBeginDrag; +-@property(nonatomic, copy) HippyDirectEventBlock onScrollEndDrag; +-@property(nonatomic, strong) HippyDirectEventBlock onPageSelected; +-@property(nonatomic, strong) HippyDirectEventBlock onPageScrollStateChanged; ++@property(nonatomic, copy) NativeRenderDirectEventBlock initialListReady; ++@property(nonatomic, copy) NativeRenderDirectEventBlock onScrollBeginDrag; ++@property(nonatomic, copy) NativeRenderDirectEventBlock onScrollEndDrag; ++@property(nonatomic, strong) NativeRenderDirectEventBlock onPageSelected; ++@property(nonatomic, strong) NativeRenderDirectEventBlock onPageScrollStateChanged; + + /** + * Indicate view pager view scroll circule, default is NO +diff --git a/renderer/native/ios/renderer/component/smartViewPager/HippySmartViewPagerView.mm b/renderer/native/ios/renderer/component/smartViewPager/NativeRenderSmartViewPagerView.mm +similarity index 87% +rename from renderer/native/ios/renderer/component/smartViewPager/HippySmartViewPagerView.mm +rename to renderer/native/ios/renderer/component/smartViewPager/NativeRenderSmartViewPagerView.mm +index 0dce6ac51fb..44dda8b9d05 100644 +--- a/renderer/native/ios/renderer/component/smartViewPager/HippySmartViewPagerView.mm ++++ b/renderer/native/ios/renderer/component/smartViewPager/NativeRenderSmartViewPagerView.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,25 +20,25 @@ + * limitations under the License. + */ + +-#import ""HippySmartViewPagerView.h"" +-#import ""UIView+Hippy.h"" +-#import ""HippyScrollProtocol.h"" +-#import ""HippyHeaderRefresh.h"" +-#import ""HippyFooterRefresh.h"" +-#import ""UIView+AppearEvent.h"" +-#import ""HippyBaseListViewCell.h"" +-#import ""HippyBaseListViewDataSource.h"" ++#import ""NativeRenderSmartViewPagerView.h"" ++#import ""UIView+NativeRender.h"" ++#import ""NativeRenderScrollProtocol.h"" ++#import ""NativeRenderHeaderRefresh.h"" ++#import ""NativeRenderFooterRefresh.h"" ++#import ""UIView+MountEvent.h"" ++#import ""NativeRenderBaseListViewCell.h"" ++#import ""NativeRenderBaseListViewDataSource.h"" + #import ""UIView+Render.h"" + #import ""objc/runtime.h"" +-#import ""HippyRenderContext.h"" +-#import ""HippyShadowView.h"" ++#import ""NativeRenderContext.h"" ++#import ""NativeRenderObjectView.h"" + + static NSInteger kInfiniteLoopBegin = 2; + static NSString *const kCellIdentifier = @""cellIdentifier""; + static NSString *const kSupplementaryIdentifier = @""SupplementaryIdentifier""; + static NSString *const kListViewItem = @""ListViewItem""; + +-@interface HippySmartViewPagerView () { ++@interface NativeRenderSmartViewPagerView () { + __weak UIView *_rootView; + BOOL _isInitialListReady; + NSTimeInterval _lastScrollDispatchTime; +@@ -55,13 +55,13 @@ - (void)setPreviousMargin:(CGFloat)previousMargin nextMargin:(CGFloat)nextMargin + + @end + +-@implementation HippySmartViewPagerView ++@implementation NativeRenderSmartViewPagerView + + #pragma mark Life Cycle + - (instancetype)initWithFrame:(CGRect)frame { + if (self = [super initWithFrame:frame]) { + _isInitialListReady = NO; +- _dataSource = [[HippyBaseListViewDataSource alloc] init]; ++ _dataSource = [[NativeRenderBaseListViewDataSource alloc] init]; + self.dataSource.itemViewName = [self compoentItemName]; + [self initialization]; + self.collectionView.alwaysBounceVertical = NO; +@@ -78,7 +78,7 @@ - (void)initialization + { + _circular = NO; + _autoplay = NO; +- _itemWidth = self.hippyShadowView.frame.size.width; ++ _itemWidth = self.nativeRenderObjectView.frame.size.width; + _previousMargin = 0.0f; + _nextMargin = 0.0f; + _pageGap = 0; +@@ -208,8 +208,8 @@ - (void)setPreviousMargin:(CGFloat)previousMargin nextMargin:(CGFloat)nextMargin + _previousMargin = previousMargin; + _nextMargin = nextMargin; + _pageGap = pageGap; +- _itemWidth = self.hippyShadowView.frame.size.width - (previousMargin + nextMargin + pageGap * 2); +- _viewPagerLayout.itemSize = CGSizeMake(_itemWidth, self.hippyShadowView.frame.size.height); ++ _itemWidth = self.nativeRenderObjectView.frame.size.width - (previousMargin + nextMargin + pageGap * 2); ++ _viewPagerLayout.itemSize = CGSizeMake(_itemWidth, self.nativeRenderObjectView.frame.size.height); + _viewPagerLayout.minimumLineSpacing = pageGap; + _viewPagerLayout.minimumInteritemSpacing = pageGap; + _currentPage = [self adjustInitialPage:_initialPage]; +@@ -237,13 +237,13 @@ - (NSString *)compoentItemName { + } + + - (Class)listItemClass { +- return [HippyBaseListViewCell class]; ++ return [NativeRenderBaseListViewCell class]; + } + + - (__kindof UICollectionViewLayout *)collectionViewLayout { + UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; + layout.minimumLineSpacing = .0f; +- layout.itemSize = CGSizeMake(self.hippyShadowView.frame.size.width, self.hippyShadowView.frame.size.height); ++ layout.itemSize = CGSizeMake(self.nativeRenderObjectView.frame.size.width, self.nativeRenderObjectView.frame.size.height); + layout.scrollDirection = UICollectionViewScrollDirectionHorizontal; + _viewPagerLayout = layout; + return layout; +@@ -251,7 +251,7 @@ - (__kindof UICollectionViewLayout *)collectionViewLayout { + + - (void)registerCells { + Class cls = [self listItemClass]; +- NSAssert([cls isSubclassOfClass:[HippyBaseListViewCell class]], @""list item class must be a subclass of HippyBaseListViewCell""); ++ NSAssert([cls isSubclassOfClass:[NativeRenderBaseListViewCell class]], @""list item class must be a subclass of NativeRenderBaseListViewCell""); + [self.collectionView registerClass:cls forCellWithReuseIdentifier:kCellIdentifier]; + } + +@@ -270,7 +270,7 @@ - (void)hippySetFrame:(CGRect)frame { + self.collectionView.frame = self.bounds; + } + +-- (void)setInitialListReady:(HippyDirectEventBlock)initialListReady { ++- (void)setInitialListReady:(NativeRenderDirectEventBlock)initialListReady { + _initialListReady = initialListReady; + _isInitialListReady = NO; + } +@@ -315,8 +315,8 @@ - (NSArray *)refreshItemIndexArrayWithOldArrayLength:(NSInteger)length { + } + + - (void)refreshItemNodes { +- [self.dataSource setDataSource:self.hippyShadowView.hippySubviews containBannerView:NO]; +- _itemIndexArray = [self refreshItemIndexArrayWithOldArrayLength:self.hippyShadowView.hippySubviews.count]; ++ [self.dataSource setDataSource:self.nativeRenderObjectView.hippySubviews containBannerView:NO]; ++ _itemIndexArray = [self refreshItemIndexArrayWithOldArrayLength:self.nativeRenderObjectView.hippySubviews.count]; + [self setPreviousMargin:_previousMargin nextMargin:_nextMargin pageGap:_pageGap]; + } + +@@ -339,7 +339,7 @@ - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSe + - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { + NSInteger cellIndex = _itemIndexArray[indexPath.row].integerValue; + NSIndexPath *adjustIndexPath = [NSIndexPath indexPathForRow:cellIndex inSection:indexPath.section]; +- HippyBaseListViewCell *cell = (HippyBaseListViewCell *)[collectionView dequeueReusableCellWithReuseIdentifier:kCellIdentifier forIndexPath:adjustIndexPath]; ++ NativeRenderBaseListViewCell *cell = (NativeRenderBaseListViewCell *)[collectionView dequeueReusableCellWithReuseIdentifier:kCellIdentifier forIndexPath:adjustIndexPath]; + return cell; + } + +@@ -348,13 +348,13 @@ - (CGSize)collectionView:(UICollectionView *)collectionView + sizeForItemAtIndexPath:(NSIndexPath *)indexPath { + NSInteger cellIndex = _itemIndexArray[indexPath.row].integerValue; + NSIndexPath *adjustIndexPath = [NSIndexPath indexPathForRow:cellIndex inSection:indexPath.section]; +- HippyShadowView *shadowView = [_dataSource cellForIndexPath:adjustIndexPath]; +- return shadowView.frame.size; ++ NativeRenderObjectView *renderObject = [_dataSource cellForIndexPath:adjustIndexPath]; ++ return renderObject.frame.size; + } + + - (void)collectionView:(UICollectionView *)collectionView didEndDisplayingCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath { +- if ([cell isKindOfClass:[HippyWaterfallViewCell class]]) { +- HippyWaterfallViewCell *hpCell = (HippyWaterfallViewCell *)cell; ++ if ([cell isKindOfClass:[NativeRenderWaterfallViewCell class]]) { ++ NativeRenderWaterfallViewCell *hpCell = (NativeRenderWaterfallViewCell *)cell; + if (hpCell.cellView) { + NSInteger cellIndex = _itemIndexArray[indexPath.row].integerValue; + NSIndexPath *adjustIndexPath = [NSIndexPath indexPathForRow:cellIndex inSection:indexPath.section]; +@@ -369,23 +369,23 @@ - (void)collectionView:(UICollectionView *)collectionView + forItemAtIndexPath:(NSIndexPath *)indexPath { + NSInteger cellIndex = _itemIndexArray[indexPath.row].integerValue; + NSIndexPath *adjustIndexPath = [NSIndexPath indexPathForRow:cellIndex inSection:indexPath.section]; +- HippyWaterfallViewCell *hpCell = (HippyWaterfallViewCell *)cell; +- HippyShadowView *shadowView = [_dataSource cellForIndexPath:adjustIndexPath]; +- [shadowView recusivelySetCreationTypeToInstant]; +- UIView *cellView = [self.renderContext viewFromRenderViewTag:shadowView.hippyTag onRootTag:shadowView.rootTag]; ++ NativeRenderWaterfallViewCell *hpCell = (NativeRenderWaterfallViewCell *)cell; ++ NativeRenderObjectView *renderObject = [_dataSource cellForIndexPath:adjustIndexPath]; ++ [renderObject recusivelySetCreationTypeToInstant]; ++ UIView *cellView = [self.renderContext viewFromRenderViewTag:renderObject.hippyTag onRootTag:renderObject.rootTag]; + if (cellView) { + [_cachedItems removeObjectForKey:adjustIndexPath]; + } + else { +- cellView = [self.renderContext createViewRecursivelyFromShadowView:shadowView]; ++ cellView = [self.renderContext createViewRecursivelyFromRenderObject:renderObject]; + } + hpCell.cellView = cellView; + [_weakItemMap setObject:cellView forKey:[cellView hippyTag]]; + } + +-- (void)tableViewDidLayoutSubviews:(HippyListTableView *)tableView { ++- (void)tableViewDidLayoutSubviews:(NativeRenderListTableView *)tableView { + NSArray *visibleCells = [self.collectionView visibleCells]; +- for (HippyBaseListViewCell *cell in visibleCells) { ++ for (NativeRenderBaseListViewCell *cell in visibleCells) { + CGRect cellRectInTableView = [self.collectionView convertRect:[cell bounds] fromView:cell]; + CGRect intersection = CGRectIntersection(cellRectInTableView, [self.collectionView bounds]); + if (CGRectEqualToRect(cellRectInTableView, intersection)) { +@@ -397,7 +397,7 @@ - (void)tableViewDidLayoutSubviews:(HippyListTableView *)tableView { + if (_previousVisibleCells && ![_previousVisibleCells isEqualToArray:visibleCells]) { + NSMutableArray *diff = [_previousVisibleCells mutableCopy]; + [diff removeObjectsInArray:visibleCells]; +- for (HippyBaseListViewCell *cell in diff) { ++ for (NativeRenderBaseListViewCell *cell in diff) { + [cell setCellShowState:CellNotShowState]; + } + } +@@ -557,7 +557,7 @@ - (NSInteger)collectionView:(UICollectionView *)collectionView + return 1; + } + +-#pragma mark HippyRefresh Delegate +-- (void)refreshView:(HippyRefresh *)refreshView statusChanged:(HippyRefreshStatus)status { ++#pragma mark NativeRenderRefresh Delegate ++- (void)refreshView:(NativeRenderRefresh *)refreshView statusChanged:(NativeRenderRefreshStatus)status { + } + @end +diff --git a/renderer/native/ios/renderer/component/smartViewPager/NativeRenderSmartViewPagerViewManager.h b/renderer/native/ios/renderer/component/smartViewPager/NativeRenderSmartViewPagerViewManager.h +new file mode 100644 +index 00000000000..1d6f830f0b8 +--- /dev/null ++++ b/renderer/native/ios/renderer/component/smartViewPager/NativeRenderSmartViewPagerViewManager.h +@@ -0,0 +1,31 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * NativeRender available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ""NativeRenderViewManager.h"" ++ ++NS_ASSUME_NONNULL_BEGIN ++ ++@interface NativeRenderSmartViewPagerViewManager : NativeRenderViewManager ++ ++@end ++ ++NS_ASSUME_NONNULL_END +diff --git a/renderer/native/ios/renderer/component/smartViewPager/NativeRenderSmartViewPagerViewManager.mm b/renderer/native/ios/renderer/component/smartViewPager/NativeRenderSmartViewPagerViewManager.mm +new file mode 100644 +index 00000000000..646664788ca +--- /dev/null ++++ b/renderer/native/ios/renderer/component/smartViewPager/NativeRenderSmartViewPagerViewManager.mm +@@ -0,0 +1,90 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * NativeRender available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ""NativeRenderSmartViewPagerViewManager.h"" ++#import ""NativeRenderSmartViewPagerView.h"" ++ ++@implementation NativeRenderSmartViewPagerViewManager ++ ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(scrollEventThrottle, NSTimeInterval) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(initialListReady, NativeRenderDirectEventBlock); ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onScrollBeginDrag, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onPageSelected, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onScroll, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onPageScrollStateChanged, NativeRenderDirectEventBlock) ++ ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(pageGap, CGFloat) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(previousMargin, CGFloat) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(nextMargin, CGFloat) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(autoplayTimeInterval, CGFloat) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(initialPage, NSInteger) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(circular, BOOL) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(autoplay, BOOL) ++ ++- (UIView *)view { ++ return [[NativeRenderSmartViewPagerView alloc] init]; ++} ++ ++// clang-format off ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(setPage:(nonnull NSNumber *)hippyTag ++ pageNumber:(NSNumber *)pageNumber) { ++ [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry){ ++ UIView *view = viewRegistry[hippyTag]; ++ ++ if (view == nil || ![view isKindOfClass:[NativeRenderSmartViewPagerView class]]) { ++// NativeRenderLogError(@""tried to setPage: on an error viewPager %@ "" ++// ""with tag #%@"", view, hippyTag); ++ } ++ NSInteger pageNumberInteger = pageNumber.integerValue; ++ [(NativeRenderSmartViewPagerView *)view setPage:pageNumberInteger animated:YES]; ++ }]; ++} ++// clang-format on ++ ++// clang-format off ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(setPageWithoutAnimation:(nonnull NSNumber *)hippyTag ++ pageNumber:(NSNumber *)pageNumber) { ++ [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry){ ++ UIView *view = viewRegistry[hippyTag]; ++ if (view == nil || ![view isKindOfClass:[NativeRenderSmartViewPagerView class]]) { ++// NativeRenderLogError(@""tried to setPage: on an error viewPager %@ "" ++// ""with tag #%@"", view, hippyTag); ++ } ++ NSInteger pageNumberInteger = pageNumber.integerValue; ++ [(NativeRenderSmartViewPagerView *)view setPage:pageNumberInteger animated:NO]; ++ }]; ++} ++// clang-format on ++ ++// clang-format off ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(getPageIndex:(nonnull NSNumber *)hippyTag ++ callback:(RenderUIResponseSenderBlock)callback) { ++ [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderSmartViewPagerView *view = viewRegistry[hippyTag]; ++ NSInteger currrentPage = [view getCurrentPage]; ++ callback(@(currrentPage)); ++ }]; ++} ++// clang-format on ++ ++@end ++ +diff --git a/renderer/native/ios/renderer/component/text/HippyTextManager.h b/renderer/native/ios/renderer/component/text/HippyTextManager.h +deleted file mode 100644 +index edb0227e2ff..00000000000 +--- a/renderer/native/ios/renderer/component/text/HippyTextManager.h ++++ /dev/null +@@ -1,27 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import ""HippyViewManager.h"" +- +-@interface HippyTextManager : HippyViewManager +- +-@end +diff --git a/renderer/native/ios/renderer/component/text/HippyTextManager.mm b/renderer/native/ios/renderer/component/text/HippyTextManager.mm +deleted file mode 100644 +index cf0ca3c14f3..00000000000 +--- a/renderer/native/ios/renderer/component/text/HippyTextManager.mm ++++ /dev/null +@@ -1,137 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import ""HippyTextManager.h"" +-#import ""HippyConvert.h"" +-#import ""HippyShadowText.h"" +-#import ""HippyText.h"" +-#import ""HippyTextView.h"" +-#import ""UIView+Hippy.h"" +- +-//遍历该shadowView(shadowText)的dirty且非shadowText的子view,将之加入到queue +-//子view如果是dirty,说明其子节点可能有dirtyView +-//但现在似乎不存在这种情况,view能嵌套text,text能嵌套text,但text不能嵌套view +-static void collectDirtyNonTextDescendants(HippyShadowText *shadowView, NSMutableArray *nonTextDescendants) { +- for (HippyShadowView *child in shadowView.hippySubviews) { +- if ([child isKindOfClass:[HippyShadowText class]]) { +- collectDirtyNonTextDescendants((HippyShadowText *)child, nonTextDescendants); +- } else if ([child isTextDirty]) { +- [nonTextDescendants addObject:child]; +- } +- } +-} +- +-@interface HippyShadowText (Private) +-// hplayout +-- (NSTextStorage *)buildTextStorageForWidth:(CGFloat)width widthMode:(MeasureMode)widthMode; +-@end +- +-@implementation HippyTextManager +- +-- (UIView *)view { +- return [HippyText new]; +-} +- +-- (HippyShadowView *)shadowView { +- return [HippyShadowText new]; +-} +- +-#pragma mark - Shadow properties +- +-HIPPY_EXPORT_SHADOW_PROPERTY(color, UIColor) +-HIPPY_EXPORT_SHADOW_PROPERTY(fontFamily, NSString) +-HIPPY_EXPORT_SHADOW_PROPERTY(fontSize, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(fontWeight, NSString) +-HIPPY_EXPORT_SHADOW_PROPERTY(fontStyle, NSString) +-HIPPY_EXPORT_SHADOW_PROPERTY(fontVariant, NSArray) +-HIPPY_EXPORT_SHADOW_PROPERTY(isHighlighted, BOOL) +-HIPPY_EXPORT_SHADOW_PROPERTY(letterSpacing, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(lineHeightMultiple, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(lineSpacingMultiplier, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(lineHeight, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(numberOfLines, NSUInteger) +-HIPPY_EXPORT_SHADOW_PROPERTY(ellipsizeMode, NSLineBreakMode) +-HIPPY_EXPORT_SHADOW_PROPERTY(textAlign, NSTextAlignment) +-HIPPY_EXPORT_SHADOW_PROPERTY(textDecorationStyle, NSUnderlineStyle) +-HIPPY_EXPORT_SHADOW_PROPERTY(textDecorationColor, UIColor) +-HIPPY_EXPORT_SHADOW_PROPERTY(textDecorationLine, HippyTextDecorationLineType) +-HIPPY_EXPORT_SHADOW_PROPERTY(allowFontScaling, BOOL) +-HIPPY_EXPORT_SHADOW_PROPERTY(opacity, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(textShadowOffset, CGSize) +-HIPPY_EXPORT_SHADOW_PROPERTY(textShadowRadius, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(textShadowColor, UIColor) +-HIPPY_EXPORT_SHADOW_PROPERTY(adjustsFontSizeToFit, BOOL) +-HIPPY_EXPORT_SHADOW_PROPERTY(minimumFontScale, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(text, NSString) +-HIPPY_EXPORT_SHADOW_PROPERTY(autoLetterSpacing, BOOL) +- +-- (HippyRenderUIBlock)uiBlockToAmendWithShadowViewRegistry:(NSDictionary *)shadowViewRegistry { +- for (HippyShadowView *rootView in shadowViewRegistry.allValues) { +- if (![rootView isHippyRootView]) { +- // This isn't a root view +- continue; +- } +- +- if (![rootView isTextDirty]) { +- // No text processing to be done +- continue; +- } +- +- NSMutableArray *queue = [NSMutableArray arrayWithObject:rootView]; +- for (NSInteger i = 0; i < queue.count; i++) { +- HippyShadowView *shadowView = queue[i]; +- if (!shadowView) { +- //HippyLogWarn(@""shadowView is nil, please remain xcode state and call rainywan""); +- continue; +- } +- NSAssert([shadowView isTextDirty], @""Don't process any nodes that don't have dirty text""); +- +- if ([shadowView isKindOfClass:[HippyShadowText class]]) { +- ((HippyShadowText *)shadowView).fontSizeMultiplier = 1.0; +- [(HippyShadowText *)shadowView recomputeText]; +- collectDirtyNonTextDescendants((HippyShadowText *)shadowView, queue); +- } else { +- for (HippyShadowView *child in [shadowView hippySubviews]) { +- if ([child isTextDirty]) { +- [queue addObject:child]; +- } +- } +- } +- +- [shadowView setTextComputed]; +- } +- } +- +- return nil; +-} +- +-- (HippyRenderUIBlock)uiBlockToAmendWithShadowView:(HippyShadowText *)shadowView { +- NSNumber *hippyTag = shadowView.hippyTag; +- UIEdgeInsets padding = shadowView.paddingAsInsets; +- +- return ^(__unused id renderContext, NSDictionary *viewRegistry) { +- HippyText *text = viewRegistry[hippyTag]; +- text.contentInset = padding; +- }; +-} +- +-@end +diff --git a/renderer/native/ios/renderer/component/text/HippyShadowText.h b/renderer/native/ios/renderer/component/text/NativeRenderObjectText.h +similarity index 81% +rename from renderer/native/ios/renderer/component/text/HippyShadowText.h +rename to renderer/native/ios/renderer/component/text/NativeRenderObjectText.h +index 827591b5740..17242e66cce 100644 +--- a/renderer/native/ios/renderer/component/text/HippyShadowText.h ++++ b/renderer/native/ios/renderer/component/text/NativeRenderObjectText.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,23 +20,23 @@ + * limitations under the License. + */ + +-#import ""HippyShadowView.h"" +-#import ""HippyTextDecorationLineType.h"" ++#import ""NativeRenderObjectView.h"" ++#import ""NativeRenderTextDecorationLineType.h"" + #import ""dom/layout_node.h"" + +-typedef NS_ENUM(NSInteger, HippySizeComparison) { +- HippySizeTooLarge, +- HippySizeTooSmall, +- HippySizeWithinRange, ++typedef NS_ENUM(NSInteger, NativeRenderSizeComparison) { ++ NativeRenderSizeTooLarge, ++ NativeRenderSizeTooSmall, ++ NativeRenderSizeWithinRange, + }; + +-extern NSString *const HippyIsHighlightedAttributeName; +-extern NSString *const HippyHippyTagAttributeName; +-extern NSString *const HippyShadowViewAttributeName; ++extern NSString *const NativeRenderIsHighlightedAttributeName; ++extern NSString *const NativeRenderHippyTagAttributeName; ++extern NSString *const NativeRenderRenderObjectAttributeName; + +-HIPPY_EXTERN hippy::LayoutSize textMeasureFunc(float width, hippy::LayoutMeasureMode widthMeasureMode, __unused float height, __unused hippy::LayoutMeasureMode heightMeasureMode, void *layoutContext); ++NATIVE_RENDER_EXTERN hippy::LayoutSize textMeasureFunc(float width, hippy::LayoutMeasureMode widthMeasureMode, __unused float height, __unused hippy::LayoutMeasureMode heightMeasureMode, void *layoutContext); + +-@interface HippyShadowText : HippyShadowView { ++@interface NativeRenderObjectText : NativeRenderObjectView { + @protected + NSTextStorage *_cachedTextStorage; + CGFloat _cachedTextStorageWidth; +@@ -63,7 +63,7 @@ HIPPY_EXTERN hippy::LayoutSize textMeasureFunc(float width, hippy::LayoutMeasure + @property (nonatomic, assign) NSTextAlignment textAlign; + @property (nonatomic, strong) UIColor *textDecorationColor; + @property (nonatomic, assign) NSUnderlineStyle textDecorationStyle; +-@property (nonatomic, assign) HippyTextDecorationLineType textDecorationLine; ++@property (nonatomic, assign) NativeRenderTextDecorationLineType textDecorationLine; + @property (nonatomic, assign) CGFloat fontSizeMultiplier; + @property (nonatomic, assign) BOOL allowFontScaling; + @property (nonatomic, assign) CGFloat opacity; +diff --git a/renderer/native/ios/renderer/component/text/HippyShadowText.mm b/renderer/native/ios/renderer/component/text/NativeRenderObjectText.mm +similarity index 84% +rename from renderer/native/ios/renderer/component/text/HippyShadowText.mm +rename to renderer/native/ios/renderer/component/text/NativeRenderObjectText.mm +index aaba5cde1fa..52f152318d1 100644 +--- a/renderer/native/ios/renderer/component/text/HippyShadowText.mm ++++ b/renderer/native/ios/renderer/component/text/NativeRenderObjectText.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,35 +20,35 @@ + * limitations under the License. + */ + +-#import ""HippyShadowText.h"" +-#import ""HippyConvert.h"" +-#import ""HippyFont.h"" +-#import ""HippyText.h"" +-#import ""HippyTextView.h"" +-#import ""HippyUtils.h"" +-#import ""HippyI18nUtils.h"" ++#import ""NativeRenderObjectText.h"" ++#import ""NativeRenderConvert.h"" ++#import ""NativeRenderFont.h"" ++#import ""NativeRenderText.h"" ++#import ""NativeRenderTextView.h"" ++#import ""NativeRenderUtils.h"" ++#import ""NativeRenderI18nUtils.h"" + #import ""dom/layout_node.h"" + #include ""dom/taitank_layout_node.h"" + +-NSString *const HippyShadowViewAttributeName = @""HippyShadowViewAttributeName""; +-NSString *const HippyIsHighlightedAttributeName = @""IsHighlightedAttributeName""; +-NSString *const HippyHippyTagAttributeName = @""HippyTagAttributeName""; ++NSString *const NativeRenderRenderObjectAttributeName = @""NativeRenderRenderObjectAttributeName""; ++NSString *const NativeRenderIsHighlightedAttributeName = @""IsHighlightedAttributeName""; ++NSString *const NativeRenderHippyTagAttributeName = @""NativeRenderTagAttributeName""; + +-// CGFloat const HippyTextAutoSizeDefaultMinimumFontScale = 0.5f; +-CGFloat const HippyTextAutoSizeWidthErrorMargin = 0.05f; +-CGFloat const HippyTextAutoSizeHeightErrorMargin = 0.025f; +-CGFloat const HippyTextAutoSizeGranularity = 0.001f; ++// CGFloat const NativeRenderTextAutoSizeDefaultMinimumFontScale = 0.5f; ++CGFloat const NativeRenderTextAutoSizeWidthErrorMargin = 0.05f; ++CGFloat const NativeRenderTextAutoSizeHeightErrorMargin = 0.025f; ++CGFloat const NativeRenderTextAutoSizeGranularity = 0.001f; + + static const CGFloat gDefaultFontSize = 14.f; + +-@implementation HippyShadowText ++@implementation NativeRenderObjectText + + hippy::LayoutSize textMeasureFunc( +- HippyShadowText *weakShadowText, float width,hippy::LayoutMeasureMode widthMeasureMode, ++ NativeRenderObjectText *weakShadowText, float width,hippy::LayoutMeasureMode widthMeasureMode, + float height, hippy::LayoutMeasureMode heightMeasureMode, void *layoutContext) { + hippy::LayoutSize retSize; +- if (weakShadowText) { +- HippyShadowText *strongShadowText = weakShadowText; ++ NativeRenderObjectText *strongShadowText = weakShadowText; ++ if (strongShadowText) { + NSTextStorage *textStorage = [strongShadowText buildTextStorageForWidth:width widthMode:widthMeasureMode]; + [strongShadowText calculateTextFrame:textStorage]; + NSLayoutManager *layoutManager = textStorage.layoutManagers.firstObject; +@@ -112,7 +112,7 @@ - (instancetype)init { + _fontSizeMultiplier = 1.0; + _lineHeightMultiple = 1.0f; + _textAlign = NSTextAlignmentLeft; +- if (NSWritingDirectionRightToLeft == [[HippyI18nUtils sharedInstance] writingDirectionForCurrentAppLanguage]) { ++ if (NSWritingDirectionRightToLeft == [[NativeRenderI18nUtils sharedInstance] writingDirectionForCurrentAppLanguage]) { + self.textAlign = NSTextAlignmentRight; + } + } +@@ -136,9 +136,9 @@ - (void)contentSizeMultiplierDidChange:(__unused NSNotification *)note { + [self dirtyText]; + } + +-- (NSDictionary *)processUpdatedProperties:(NSMutableSet *)applierBlocks ++- (NSDictionary *)processUpdatedProperties:(NSMutableSet *)applierBlocks + parentProperties:(NSDictionary *)parentProperties { +- if ([[self hippySuperview] isKindOfClass:[HippyShadowText class]]) { ++ if ([[self hippySuperview] isKindOfClass:[NativeRenderObjectText class]]) { + return parentProperties; + } + +@@ -153,21 +153,21 @@ - (void)contentSizeMultiplierDidChange:(__unused NSNotification *)note { + CGRect textFrame = [self calculateTextFrame:textStorage]; + UIColor *color = self.color ?: [UIColor blackColor]; + [applierBlocks addObject:^(NSDictionary *viewRegistry) { +- HippyText *view = (HippyText *)viewRegistry[self.hippyTag]; ++ NativeRenderText *view = (NativeRenderText *)viewRegistry[self.hippyTag]; + view.textFrame = textFrame; + view.textStorage = textStorage; + view.textColor = color; + /** + * NOTE: this logic is included to support rich text editing inside multiline + * `` controls. It is required in order to ensure that the +- * textStorage (aka attributed string) is copied over from the HippyShadowText +- * to the HippyText view in time to be used to update the editable text content. +- * TODO: we should establish a delegate relationship betweeen HippyTextView +- * and its contaned HippyText element when they get inserted and get rid of this ++ * textStorage (aka attributed string) is copied over from the NativeRenderShadowText ++ * to the NativeRenderText view in time to be used to update the editable text content. ++ * TODO: we should establish a delegate relationship betweeen NativeRenderTextView ++ * and its contaned NativeRenderText element when they get inserted and get rid of this + */ + UIView *parentView = viewRegistry[parentTag]; + if ([parentView respondsToSelector:@selector(performTextUpdate)]) { +- [(HippyTextView *)parentView performTextUpdate]; ++ [(NativeRenderTextView *)parentView performTextUpdate]; + } + }]; + return parentProperties; +@@ -180,12 +180,12 @@ - (void)amendLayoutBeforeMount { + NSTextContainer *textContainer = layoutManager.textContainers.firstObject; + NSRange glyphRange = [layoutManager glyphRangeForTextContainer:textContainer]; + NSRange characterRange = [layoutManager characterRangeForGlyphRange:glyphRange actualGlyphRange:NULL]; +- [layoutManager.textStorage enumerateAttribute:HippyShadowViewAttributeName inRange:characterRange options:0 usingBlock:^( +- HippyShadowView *child, NSRange range, __unused BOOL *_) { ++ [layoutManager.textStorage enumerateAttribute:NativeRenderRenderObjectAttributeName inRange:characterRange options:0 usingBlock:^( ++ NativeRenderObjectView *child, NSRange range, __unused BOOL *_) { + if (child) { + float width = child.frame.size.width, height = child.frame.size.height; + if (isnan(width) || isnan(height)) { +- //HippyLogError(@""Views nested within a must have a width and height""); ++ //NativeRenderLogError(@""Views nested within a must have a width and height""); + } + + /** +@@ -195,10 +195,10 @@ - (void)amendLayoutBeforeMount { + //rect for attachment at its line fragment + CGRect glyphRect = [layoutManager boundingRectForGlyphRange:range inTextContainer:textContainer]; + CGPoint location = [layoutManager locationForGlyphAtIndex:range.location]; +- CGFloat roundedHeight = HippyRoundPixelValue(height); +- CGFloat roundedWidth = HippyRoundPixelValue(width); ++ CGFloat roundedHeight = NativeRenderRoundPixelValue(height); ++ CGFloat roundedWidth = NativeRenderRoundPixelValue(width); + CGFloat positionY = glyphRect.origin.y + glyphRect.size.height - roundedHeight; +- CGRect childFrameToSet = CGRectMake(HippyRoundPixelValue(location.x), HippyRoundPixelValue(positionY), roundedWidth, roundedHeight); ++ CGRect childFrameToSet = CGRectMake(NativeRenderRoundPixelValue(location.x), NativeRenderRoundPixelValue(positionY), roundedWidth, roundedHeight); + CGRect childFrame = child.frame; + #define ChildFrameParamNearlyEqual(x, y) (fabs((x) - (y)) < 0.00001f) + if (!ChildFrameParamNearlyEqual(childFrame.origin.x, childFrameToSet.origin.x) || +@@ -268,11 +268,11 @@ - (void)dirtyText { + _cachedTextStorage = nil; + auto domManager = self.domManager.lock(); + if (domManager) { +- __weak HippyShadowView *weakSelf = self; ++ __weak NativeRenderObjectView *weakSelf = self; + std::vector> ops_ = {[weakSelf, domManager](){ + @autoreleasepool { + if (weakSelf) { +- HippyShadowView *strongSelf = weakSelf; ++ NativeRenderObjectView *strongSelf = weakSelf; + int32_t hippyTag = [[strongSelf hippyTag] intValue]; + auto domNode = domManager->GetNode(strongSelf.rootNode, hippyTag); + if (domNode) { +@@ -350,14 +350,14 @@ - (NSAttributedString *)_attributedStringWithFontFamily:(NSString *)fontFamily + f = [UIFont fontWithName:fontFamily size:[fontSize floatValue]]; + } + +- UIFont *font = [HippyFont updateFont:f withFamily:fontFamily size:fontSize weight:fontWeight style:fontStyle variant:_fontVariant ++ UIFont *font = [NativeRenderFont updateFont:f withFamily:fontFamily size:fontSize weight:fontWeight style:fontStyle variant:_fontVariant + scaleMultiplier:_allowFontScaling ? _fontSizeMultiplier : 1.0]; + + CGFloat heightOfTallestSubview = 0.0; + NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:self.text ?: @""""]; +- for (HippyShadowView *child in [self hippySubviews]) { +- if ([child isKindOfClass:[HippyShadowText class]]) { +- HippyShadowText *shadowText = (HippyShadowText *)child; ++ for (NativeRenderObjectView *child in [self hippySubviews]) { ++ if ([child isKindOfClass:[NativeRenderObjectText class]]) { ++ NativeRenderObjectText *shadowText = (NativeRenderObjectText *)child; + [attributedString appendAttributedString:[shadowText _attributedStringWithFontFamily:fontFamily fontSize:fontSize fontWeight:fontWeight + fontStyle:fontStyle + letterSpacing:letterSpacing +@@ -382,7 +382,7 @@ - (NSAttributedString *)_attributedStringWithFontFamily:(NSString *)fontFamily + } + } + if (isnan(width) || isnan(height)) { +- //HippyLogError(@""Views nested within a must have a width and height""); ++ //NativeRenderLogError(@""Views nested within a must have a width and height""); + } + static UIImage *placehoderImage = nil; + static dispatch_once_t onceToken; +@@ -394,12 +394,12 @@ - (NSAttributedString *)_attributedStringWithFontFamily:(NSString *)fontFamily + attachment.image = placehoderImage; + NSMutableAttributedString *attachmentString = [NSMutableAttributedString new]; + [attachmentString appendAttributedString:[NSAttributedString attributedStringWithAttachment:attachment]]; +- [attachmentString addAttribute:HippyShadowViewAttributeName value:child range:(NSRange) { 0, attachmentString.length }]; ++ [attachmentString addAttribute:NativeRenderRenderObjectAttributeName value:child range:(NSRange) { 0, attachmentString.length }]; + [attributedString appendAttributedString:attachmentString]; + if (height > heightOfTallestSubview) { + heightOfTallestSubview = height; + } +- // Don't call setTextComputed on this child. HippyTextManager takes care of ++ // Don't call setTextComputed on this child. NativeRenderTextManager takes care of + // processing inline UIViews. + } + } +@@ -409,7 +409,7 @@ - (NSAttributedString *)_attributedStringWithFontFamily:(NSString *)fontFamily + toAttributedString:attributedString]; + + if (_isHighlighted) { +- [self _addAttribute:HippyIsHighlightedAttributeName withValue:@YES toAttributedString:attributedString]; ++ [self _addAttribute:NativeRenderIsHighlightedAttributeName withValue:@YES toAttributedString:attributedString]; + } + if (useBackgroundColor && backgroundColor) { + [self _addAttribute:NSBackgroundColorAttributeName +@@ -419,7 +419,7 @@ - (NSAttributedString *)_attributedStringWithFontFamily:(NSString *)fontFamily + + [self _addAttribute:NSFontAttributeName withValue:font toAttributedString:attributedString]; + [self _addAttribute:NSKernAttributeName withValue:letterSpacing toAttributedString:attributedString]; +- [self _addAttribute:HippyHippyTagAttributeName withValue:self.hippyTag toAttributedString:attributedString]; ++ [self _addAttribute:NativeRenderHippyTagAttributeName withValue:self.hippyTag toAttributedString:attributedString]; + [self _setParagraphStyleOnAttributedString:attributedString fontLineHeight:font.lineHeight heightOfTallestSubview:heightOfTallestSubview]; + if ([self isLayoutSubviewsRTL]) { + NSDictionary *dic = @{NSWritingDirectionAttributeName: @[@(NSWritingDirectionRightToLeft | NSWritingDirectionEmbedding)]}; +@@ -522,10 +522,10 @@ - (void)_setParagraphStyleOnAttributedString:(NSMutableAttributedString *)attrib + } + _maximumFontLineHeight = maximumFontLineHeight; + // Text decoration +- if (_textDecorationLine == HippyTextDecorationLineTypeUnderline || _textDecorationLine == HippyTextDecorationLineTypeUnderlineStrikethrough) { ++ if (_textDecorationLine == NativeRenderTextDecorationLineTypeUnderline || _textDecorationLine == NativeRenderTextDecorationLineTypeUnderlineStrikethrough) { + [self _addAttribute:NSUnderlineStyleAttributeName withValue:@(_textDecorationStyle) toAttributedString:attributedString]; + } +- if (_textDecorationLine == HippyTextDecorationLineTypeStrikethrough || _textDecorationLine == HippyTextDecorationLineTypeUnderlineStrikethrough) { ++ if (_textDecorationLine == NativeRenderTextDecorationLineTypeStrikethrough || _textDecorationLine == NativeRenderTextDecorationLineTypeUnderlineStrikethrough) { + [self _addAttribute:NSStrikethroughStyleAttributeName withValue:@(_textDecorationStyle) toAttributedString:attributedString]; + } + if (_textDecorationColor) { +@@ -572,7 +572,7 @@ - (CGRect)updateStorage:(NSTextStorage *)textStorage toFitFrame:(CGRect)frame { + } + + // Vertically center draw position for new text sizing. +- frame.origin.y = self.paddingAsInsets.top + HippyRoundPixelValue((CGRectGetHeight(frame) - requiredSize.height) / 2.0f); ++ frame.origin.y = self.paddingAsInsets.top + NativeRenderRoundPixelValue((CGRectGetHeight(frame) - requiredSize.height) / 2.0f); + return frame; + } + +@@ -582,24 +582,24 @@ - (CGSize)calculateOptimumScaleInFrame:(CGRect)frame + maxScale:(CGFloat)maxScale + prevMid:(CGFloat)prevMid { + CGFloat midScale = (minScale + maxScale) / 2.0f; +- if (round((prevMid / HippyTextAutoSizeGranularity)) == round((midScale / HippyTextAutoSizeGranularity))) { ++ if (round((prevMid / NativeRenderTextAutoSizeGranularity)) == round((midScale / NativeRenderTextAutoSizeGranularity))) { + // Bail because we can't meet error margin. + return [self calculateSize:textStorage]; + } else { +- HippySizeComparison comparison = [self attemptScale:midScale inStorage:textStorage forFrame:frame]; +- if (comparison == HippySizeWithinRange) { ++ NativeRenderSizeComparison comparison = [self attemptScale:midScale inStorage:textStorage forFrame:frame]; ++ if (comparison == NativeRenderSizeWithinRange) { + return [self calculateSize:textStorage]; +- } else if (comparison == HippySizeTooLarge) { +- return [self calculateOptimumScaleInFrame:frame forStorage:textStorage minScale:minScale maxScale:midScale - HippyTextAutoSizeGranularity ++ } else if (comparison == NativeRenderSizeTooLarge) { ++ return [self calculateOptimumScaleInFrame:frame forStorage:textStorage minScale:minScale maxScale:midScale - NativeRenderTextAutoSizeGranularity + prevMid:midScale]; + } else { +- return [self calculateOptimumScaleInFrame:frame forStorage:textStorage minScale:midScale + HippyTextAutoSizeGranularity maxScale:maxScale ++ return [self calculateOptimumScaleInFrame:frame forStorage:textStorage minScale:midScale + NativeRenderTextAutoSizeGranularity maxScale:maxScale + prevMid:midScale]; + } + } + } + +-- (HippySizeComparison)attemptScale:(CGFloat)scale inStorage:(NSTextStorage *)textStorage forFrame:(CGRect)frame { ++- (NativeRenderSizeComparison)attemptScale:(CGFloat)scale inStorage:(NSTextStorage *)textStorage forFrame:(CGRect)frame { + NSLayoutManager *layoutManager = [textStorage.layoutManagers firstObject]; + NSTextContainer *textContainer = [layoutManager.textContainers firstObject]; + +@@ -624,14 +624,14 @@ - (HippySizeComparison)attemptScale:(CGFloat)scale inStorage:(NSTextStorage *)te + BOOL fitLines = linesRequired <= textContainer.maximumNumberOfLines || textContainer.maximumNumberOfLines == 0; + + if (fitLines && fitSize) { +- if ((requiredSize.width + (CGRectGetWidth(frame) * HippyTextAutoSizeWidthErrorMargin)) > CGRectGetWidth(frame) +- && (requiredSize.height + (CGRectGetHeight(frame) * HippyTextAutoSizeHeightErrorMargin)) > CGRectGetHeight(frame)) { +- return HippySizeWithinRange; ++ if ((requiredSize.width + (CGRectGetWidth(frame) * NativeRenderTextAutoSizeWidthErrorMargin)) > CGRectGetWidth(frame) ++ && (requiredSize.height + (CGRectGetHeight(frame) * NativeRenderTextAutoSizeHeightErrorMargin)) > CGRectGetHeight(frame)) { ++ return NativeRenderSizeWithinRange; + } else { +- return HippySizeTooSmall; ++ return NativeRenderSizeTooSmall; + } + } else { +- return HippySizeTooLarge; ++ return NativeRenderSizeTooLarge; + } + } + +@@ -690,7 +690,7 @@ -(void)set##setProp : (type)value; \ + HIPPY_TEXT_PROPERTY(NumberOfLines, _numberOfLines, NSUInteger) + HIPPY_TEXT_PROPERTY(EllipsizeMode, _ellipsizeMode, NSLineBreakMode) + HIPPY_TEXT_PROPERTY(TextDecorationColor, _textDecorationColor, UIColor *); +-HIPPY_TEXT_PROPERTY(TextDecorationLine, _textDecorationLine, HippyTextDecorationLineType); ++HIPPY_TEXT_PROPERTY(TextDecorationLine, _textDecorationLine, NativeRenderTextDecorationLineType); + HIPPY_TEXT_PROPERTY(TextDecorationStyle, _textDecorationStyle, NSUnderlineStyle); + HIPPY_TEXT_PROPERTY(Opacity, _opacity, CGFloat) + HIPPY_TEXT_PROPERTY(TextShadowOffset, _textShadowOffset, CGSize); +@@ -718,7 +718,7 @@ - (void)setDomManager:(const std::weak_ptr)domManager { + int32_t hippyTag = [self.hippyTag intValue]; + auto node = shared_domNode->GetNode(self.rootNode, hippyTag); + if (node) { +- __weak HippyShadowText *weakSelf = self; ++ __weak NativeRenderObjectText *weakSelf = self; + hippy::MeasureFunction measureFunc = + [weakSelf](float width, hippy::LayoutMeasureMode widthMeasureMode, + float height, hippy::LayoutMeasureMode heightMeasureMode, void *layoutContext){ +@@ -764,9 +764,9 @@ - (void)setText:(NSString *)text { + + - (void)setAllowFontScaling:(BOOL)allowFontScaling { + _allowFontScaling = allowFontScaling; +- for (HippyShadowView *child in [self hippySubviews]) { +- if ([child isKindOfClass:[HippyShadowText class]]) { +- ((HippyShadowText *)child).allowFontScaling = allowFontScaling; ++ for (NativeRenderObjectView *child in [self hippySubviews]) { ++ if ([child isKindOfClass:[NativeRenderObjectText class]]) { ++ ((NativeRenderObjectText *)child).allowFontScaling = allowFontScaling; + } + } + [self dirtyText]; +@@ -775,12 +775,12 @@ - (void)setAllowFontScaling:(BOOL)allowFontScaling { + - (void)setFontSizeMultiplier:(CGFloat)fontSizeMultiplier { + _fontSizeMultiplier = fontSizeMultiplier; + if (_fontSizeMultiplier == 0) { +- //HippyLogError(@""fontSizeMultiplier value must be > zero.""); ++ //NativeRenderLogError(@""fontSizeMultiplier value must be > zero.""); + _fontSizeMultiplier = 1.0; + } +- for (HippyShadowView *child in [self hippySubviews]) { +- if ([child isKindOfClass:[HippyShadowText class]]) { +- ((HippyShadowText *)child).fontSizeMultiplier = fontSizeMultiplier; ++ for (NativeRenderObjectView *child in [self hippySubviews]) { ++ if ([child isKindOfClass:[NativeRenderObjectText class]]) { ++ ((NativeRenderObjectText *)child).fontSizeMultiplier = fontSizeMultiplier; + } + } + [self dirtyText]; +@@ -793,28 +793,22 @@ - (void)setMinimumFontScale:(CGFloat)minimumFontScale { + [self dirtyText]; + } + +-- (void)insertHippySubview:(HippyShadowView *)subview atIndex:(NSInteger)atIndex { ++- (void)insertHippySubview:(NativeRenderObjectView *)subview atIndex:(NSInteger)atIndex { + [super insertHippySubview:subview atIndex:atIndex]; + auto domManager = [self domManager].lock(); + if (domManager) { + int32_t hippyTag = [self.hippyTag intValue]; + auto node = domManager->GetNode(self.rootNode, hippyTag); +- auto layoutNode = std::static_pointer_cast(node->GetLayoutNode()); +- HPNodeRef nodeRef = layoutNode->GetLayoutEngineNodeRef(); +- uint32_t childrenCount = HPNodeChildCount(nodeRef); +- for (int i = childrenCount - 1; i >= 0; i--) { +- HPNodeRef child = HPNodeGetChild(nodeRef, i); +- HPNodeRemoveChild(nodeRef, child); +- } +- +- __weak HippyShadowText *weakSelf = self; ++ __weak NativeRenderObjectText *weakSelf = self; + hippy::MeasureFunction measureFunc = + [weakSelf](float width, hippy::LayoutMeasureMode widthMeasureMode, + float height, hippy::LayoutMeasureMode heightMeasureMode, void *layoutContext){ +- return textMeasureFunc(weakSelf, width, widthMeasureMode, +- height, heightMeasureMode, layoutContext); ++ @autoreleasepool { ++ return textMeasureFunc(weakSelf, width, widthMeasureMode, ++ height, heightMeasureMode, layoutContext); ++ } + }; +- layoutNode->SetMeasureFunction(measureFunc); ++ node->GetLayoutNode()->SetMeasureFunction(measureFunc); + } + } + +diff --git a/renderer/native/ios/renderer/component/text/HippyText.h b/renderer/native/ios/renderer/component/text/NativeRenderText.h +similarity index 91% +rename from renderer/native/ios/renderer/component/text/HippyText.h +rename to renderer/native/ios/renderer/component/text/NativeRenderText.h +index a343ad57f5d..07b5a067d2f 100644 +--- a/renderer/native/ios/renderer/component/text/HippyText.h ++++ b/renderer/native/ios/renderer/component/text/NativeRenderText.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,9 +21,9 @@ + */ + + #import +-#import ""HippyTouchesView.h"" ++#import ""NativeRenderTouchesView.h"" + +-@interface HippyText : HippyTouchesView { ++@interface NativeRenderText : NativeRenderTouchesView { + @protected + NSTextStorage *_textStorage; + CAShapeLayer *_highlightLayer; +diff --git a/renderer/native/ios/renderer/component/text/HippyText.mm b/renderer/native/ios/renderer/component/text/NativeRenderText.mm +similarity index 90% +rename from renderer/native/ios/renderer/component/text/HippyText.mm +rename to renderer/native/ios/renderer/component/text/NativeRenderText.mm +index 839854a5454..249d229ffc5 100644 +--- a/renderer/native/ios/renderer/component/text/HippyText.mm ++++ b/renderer/native/ios/renderer/component/text/NativeRenderText.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,22 +20,22 @@ + * limitations under the License. + */ + +-#import ""HippyText.h"" +-#import ""HippyShadowText.h"" +-#import ""HippyUtils.h"" +-#import ""UIView+Hippy.h"" ++#import ""NativeRenderText.h"" ++#import ""NativeRenderObjectText.h"" ++#import ""NativeRenderUtils.h"" ++#import ""UIView+NativeRender.h"" + +-static void collectNonTextDescendants(HippyText *view, NSMutableArray *nonTextDescendants) { ++static void collectNonTextDescendants(NativeRenderText *view, NSMutableArray *nonTextDescendants) { + for (UIView *child in view.hippySubviews) { +- if ([child isKindOfClass:[HippyText class]]) { +- collectNonTextDescendants((HippyText *)child, nonTextDescendants); ++ if ([child isKindOfClass:[NativeRenderText class]]) { ++ collectNonTextDescendants((NativeRenderText *)child, nonTextDescendants); + } else { + [nonTextDescendants addObject:child]; + } + } + } + +-@implementation HippyText ++@implementation NativeRenderText + + - (instancetype)initWithFrame:(CGRect)frame { + if ((self = [super initWithFrame:frame])) { +@@ -132,7 +132,7 @@ - (void)drawRect:(__unused CGRect)rect { + + __block UIBezierPath *highlightPath = nil; + NSRange characterRange = [layoutManager characterRangeForGlyphRange:glyphRange actualGlyphRange:NULL]; +- [layoutManager.textStorage enumerateAttribute:HippyIsHighlightedAttributeName inRange:characterRange options:0 usingBlock:^( ++ [layoutManager.textStorage enumerateAttribute:NativeRenderIsHighlightedAttributeName inRange:characterRange options:0 usingBlock:^( + NSNumber *value, NSRange range, __unused BOOL *_) { + if (!value.boolValue) { + return; +@@ -176,7 +176,7 @@ - (NSNumber *)hippyTagAtPoint:(CGPoint)point { + // If the point is not before (fraction == 0.0) the first character and not + // after (fraction == 1.0) the last character, then the attribute is valid. + if (_textStorage.length > 0 && (fraction > 0 || characterIndex > 0) && (fraction < 1 || characterIndex < _textStorage.length - 1)) { +- hippyTag = [_textStorage attribute:HippyHippyTagAttributeName atIndex:characterIndex effectiveRange:NULL]; ++ hippyTag = [_textStorage attribute:NativeRenderHippyTagAttributeName atIndex:characterIndex effectiveRange:NULL]; + } + return hippyTag; + } +@@ -222,7 +222,7 @@ - (NSString *)accessibilityLabel { + } + + - (void)setBackgroundImageUrl:(NSString *)backgroundImageUrl { +- //HippyLogWarn(@""Warning: backgroundImage is not available in HippyText.""); ++ //NativeRenderLogWarn(@""Warning: backgroundImage is not available in NativeRenderText.""); + } + + @end +diff --git a/renderer/native/ios/renderer/component/text/HippyTextDecorationLineType.h b/renderer/native/ios/renderer/component/text/NativeRenderTextDecorationLineType.h +similarity index 71% +rename from renderer/native/ios/renderer/component/text/HippyTextDecorationLineType.h +rename to renderer/native/ios/renderer/component/text/NativeRenderTextDecorationLineType.h +index 1bfd712e4c6..795df624261 100644 +--- a/renderer/native/ios/renderer/component/text/HippyTextDecorationLineType.h ++++ b/renderer/native/ios/renderer/component/text/NativeRenderTextDecorationLineType.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -22,9 +22,9 @@ + + #import + +-typedef NS_ENUM(NSInteger, HippyTextDecorationLineType) { +- HippyTextDecorationLineTypeNone = 0, +- HippyTextDecorationLineTypeUnderline, +- HippyTextDecorationLineTypeStrikethrough, +- HippyTextDecorationLineTypeUnderlineStrikethrough, ++typedef NS_ENUM(NSInteger, NativeRenderTextDecorationLineType) { ++ NativeRenderTextDecorationLineTypeNone = 0, ++ NativeRenderTextDecorationLineTypeUnderline, ++ NativeRenderTextDecorationLineTypeStrikethrough, ++ NativeRenderTextDecorationLineTypeUnderlineStrikethrough, + }; +diff --git a/renderer/native/ios/renderer/component/image/HippyImageViewManager.h b/renderer/native/ios/renderer/component/text/NativeRenderTextManager.h +similarity index 85% +rename from renderer/native/ios/renderer/component/image/HippyImageViewManager.h +rename to renderer/native/ios/renderer/component/text/NativeRenderTextManager.h +index 48806f0c6c7..3aad33707b9 100644 +--- a/renderer/native/ios/renderer/component/image/HippyImageViewManager.h ++++ b/renderer/native/ios/renderer/component/text/NativeRenderTextManager.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,8 +20,8 @@ + * limitations under the License. + */ + +-#import ""HippyViewManager.h"" ++#import ""NativeRenderViewManager.h"" + +-@interface HippyImageViewManager : HippyViewManager ++@interface NativeRenderTextManager : NativeRenderViewManager + + @end +diff --git a/renderer/native/ios/renderer/component/text/NativeRenderTextManager.mm b/renderer/native/ios/renderer/component/text/NativeRenderTextManager.mm +new file mode 100644 +index 00000000000..5602d71bd26 +--- /dev/null ++++ b/renderer/native/ios/renderer/component/text/NativeRenderTextManager.mm +@@ -0,0 +1,134 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * NativeRender available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ""NativeRenderTextManager.h"" ++#import ""NativeRenderConvert.h"" ++#import ""NativeRenderObjectText.h"" ++#import ""NativeRenderText.h"" ++#import ""NativeRenderTextView.h"" ++#import ""UIView+NativeRender.h"" ++ ++static void collectDirtyNonTextDescendants(NativeRenderObjectText *renderObject, NSMutableArray *nonTextDescendants) { ++ for (NativeRenderObjectView *child in renderObject.hippySubviews) { ++ if ([child isKindOfClass:[NativeRenderObjectText class]]) { ++ collectDirtyNonTextDescendants((NativeRenderObjectText *)child, nonTextDescendants); ++ } else if ([child isTextDirty]) { ++ [nonTextDescendants addObject:child]; ++ } ++ } ++} ++ ++@interface NativeRenderObjectText (Private) ++// hplayout ++- (NSTextStorage *)buildTextStorageForWidth:(CGFloat)width widthMode:(MeasureMode)widthMode; ++@end ++ ++@implementation NativeRenderTextManager ++ ++- (UIView *)view { ++ return [NativeRenderText new]; ++} ++ ++- (NativeRenderObjectView *)nativeRenderObjectView { ++ return [NativeRenderObjectText new]; ++} ++ ++#pragma mark - Shadow properties ++ ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(color, UIColor) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(fontFamily, NSString) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(fontSize, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(fontWeight, NSString) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(fontStyle, NSString) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(fontVariant, NSArray) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(isHighlighted, BOOL) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(letterSpacing, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(lineHeightMultiple, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(lineSpacingMultiplier, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(lineHeight, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(numberOfLines, NSUInteger) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(ellipsizeMode, NSLineBreakMode) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(textAlign, NSTextAlignment) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(textDecorationStyle, NSUnderlineStyle) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(textDecorationColor, UIColor) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(textDecorationLine, NativeRenderTextDecorationLineType) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(allowFontScaling, BOOL) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(opacity, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(textShadowOffset, CGSize) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(textShadowRadius, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(textShadowColor, UIColor) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(adjustsFontSizeToFit, BOOL) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(minimumFontScale, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(text, NSString) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(autoLetterSpacing, BOOL) ++ ++- (NativeRenderRenderUIBlock)uiBlockToAmendWithRenderObjectRegistry:(NSDictionary *)renderObjectRegistry { ++ for (NativeRenderObjectView *rootView in renderObjectRegistry.allValues) { ++ if (![rootView isHippyRootView]) { ++ // This isn't a root view ++ continue; ++ } ++ ++ if (![rootView isTextDirty]) { ++ // No text processing to be done ++ continue; ++ } ++ ++ NSMutableArray *queue = [NSMutableArray arrayWithObject:rootView]; ++ for (NSInteger i = 0; i < queue.count; i++) { ++ NativeRenderObjectView *renderObject = queue[i]; ++ if (!renderObject) { ++ //NativeRenderLogWarn(@""renderObject is nil, please remain xcode state and call rainywan""); ++ continue; ++ } ++ NSAssert([renderObject isTextDirty], @""Don't process any nodes that don't have dirty text""); ++ ++ if ([renderObject isKindOfClass:[NativeRenderObjectText class]]) { ++ ((NativeRenderObjectText *)renderObject).fontSizeMultiplier = 1.0; ++ [(NativeRenderObjectText *)renderObject recomputeText]; ++ collectDirtyNonTextDescendants((NativeRenderObjectText *)renderObject, queue); ++ } else { ++ for (NativeRenderObjectView *child in [renderObject hippySubviews]) { ++ if ([child isTextDirty]) { ++ [queue addObject:child]; ++ } ++ } ++ } ++ ++ [renderObject setTextComputed]; ++ } ++ } ++ ++ return nil; ++} ++ ++- (NativeRenderRenderUIBlock)uiBlockToAmendWithNativeRenderObjectView:(NativeRenderObjectText *)renderObjectText { ++ NSNumber *hippyTag = renderObjectText.hippyTag; ++ UIEdgeInsets padding = renderObjectText.paddingAsInsets; ++ ++ return ^(__unused id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderText *text = viewRegistry[hippyTag]; ++ text.contentInset = padding; ++ }; ++} ++ ++@end +diff --git a/renderer/native/ios/renderer/component/textinput/HippyTextViewManager.h b/renderer/native/ios/renderer/component/textinput/HippyTextViewManager.h +deleted file mode 100644 +index fb5a10346ba..00000000000 +--- a/renderer/native/ios/renderer/component/textinput/HippyTextViewManager.h ++++ /dev/null +@@ -1,27 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import ""HippyViewManager.h"" +- +-@interface HippyTextViewManager : HippyViewManager +- +-@end +diff --git a/renderer/native/ios/renderer/component/textinput/HippyTextViewManager.mm b/renderer/native/ios/renderer/component/textinput/HippyTextViewManager.mm +deleted file mode 100644 +index dfbcd08e858..00000000000 +--- a/renderer/native/ios/renderer/component/textinput/HippyTextViewManager.mm ++++ /dev/null +@@ -1,206 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import ""HippyTextViewManager.h"" +-#import ""HippyShadowView.h"" +-#import ""HippyTextView.h"" +-#import ""HippyTextField.h"" +-#import ""HippyBaseTextInput.h"" +-#import ""HippyShadowTextView.h"" +-#import ""HippyFont.h"" +-#import ""HippyRenderContext.h"" +- +-@implementation HippyTextViewManager +- +-- (UIView *)view { +- NSNumber *mutiline = self.props[@""multiline""]; +- NSString *keyboardType = self.props[@""keyboardType""]; +- if ([keyboardType isKindOfClass:[NSString class]] && [keyboardType isEqual:@""password""]) { +- mutiline = @(NO); +- } +- HippyBaseTextInput *theView; +- if (mutiline != nil && !mutiline.boolValue) { +- HippyTextField *textField = [[HippyTextField alloc] init]; +- if (self.props[@""onKeyboardWillShow""]) { +- [[NSNotificationCenter defaultCenter] addObserver:textField selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification +- object:nil]; +- } +- theView = textField; +- } else { +- HippyTextView *textView = [[HippyTextView alloc] init]; +- if (self.props[@""onKeyboardWillShow""]) { +- [[NSNotificationCenter defaultCenter] addObserver:textView selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification +- object:nil]; +- } +- theView = textView; +- } +- +- return theView; +-} +- +-- (HippyShadowView *)shadowView { +- return [HippyShadowTextView new]; +-} +- +-HIPPY_EXPORT_VIEW_PROPERTY(value, NSString) +-HIPPY_EXPORT_VIEW_PROPERTY(onChangeText, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onKeyPress, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onBlur, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onFocus, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onKeyboardWillShow, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(defaultValue, NSString) +-HIPPY_EXPORT_VIEW_PROPERTY(isNightMode, BOOL) +- +-// clang-format off +-RENDER_COMPONENT_EXPORT_METHOD(focusTextInput:(nonnull NSNumber *)hippyTag) { +- [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry){ +- HippyBaseTextInput *view = (HippyBaseTextInput *)viewRegistry[hippyTag]; +- if (view == nil) return ; +- if (![view isKindOfClass:[HippyBaseTextInput class]]) { +- //HippyLogError(@""Invalid view returned from registry, expecting HippyBaseTextInput, got: %@"", view); +- } +- [view focus]; +- }]; +-} +-// clang-format on +- +-// clang-format off +-RENDER_COMPONENT_EXPORT_METHOD(blurTextInput:(nonnull NSNumber *)hippyTag) { +- [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry){ +- HippyBaseTextInput *view = (HippyBaseTextInput *)viewRegistry[hippyTag]; +- if (view == nil) return ; +- if (![view isKindOfClass:[HippyBaseTextInput class]]) { +- //HippyLogError(@""Invalid view returned from registry, expecting HippyBaseTextInput, got: %@"", view); +- } +- [view blur]; +- }]; +-} +-// clang-format on +- +-// clang-format off +-RENDER_COMPONENT_EXPORT_METHOD(clear:(nonnull NSNumber *)hippyTag) { +- [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { +- HippyBaseTextInput *view = (HippyBaseTextInput *)viewRegistry[hippyTag]; +- if (view == nil) return ; +- if (![view isKindOfClass:[HippyBaseTextInput class]]) { +- //HippyLogError(@""Invalid view returned from registry, expecting HippyBaseTextInput, got: %@"", view); +- } +- [view clearText]; +- }]; +-} +-// clang-format on +- +-// clang-format off +-RENDER_COMPONENT_EXPORT_METHOD(setValue:(nonnull NSNumber *)hippyTag +- text:(NSString *)text ) { +- [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { +- HippyBaseTextInput *view = (HippyBaseTextInput *)viewRegistry[hippyTag]; +- if (view == nil) return ; +- if (![view isKindOfClass:[HippyBaseTextInput class]]) { +- //HippyLogError(@""Invalid view returned from registry, expecting HippyBaseTextInput, got: %@"", view); +- } +- [view setValue: text]; +- }]; +-} +-// clang-format on +- +-// clang-format off +-RENDER_COMPONENT_EXPORT_METHOD(getValue:(nonnull NSNumber *)hippyTag +- callback:(RenderUIResponseSenderBlock)callback ) { +- [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { +- HippyBaseTextInput *view = (HippyBaseTextInput *)viewRegistry[hippyTag]; +- NSString *stringValue = [view value]; +- if (nil == stringValue) { +- stringValue = @""""; +- } +- callback([NSDictionary dictionaryWithObject:stringValue forKey:@""text""]); +- }]; +-} +-// clang-format on +- +-HIPPY_EXPORT_SHADOW_PROPERTY(text, NSString) +-HIPPY_EXPORT_SHADOW_PROPERTY(placeholder, NSString) +- +-HIPPY_REMAP_VIEW_PROPERTY(autoCapitalize, textView.autocapitalizationType, UITextAutocapitalizationType) +-HIPPY_EXPORT_VIEW_PROPERTY(autoCorrect, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(blurOnSubmit, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(clearTextOnFocus, BOOL) +-HIPPY_REMAP_VIEW_PROPERTY(color, textView.textColor, UIColor) +-HIPPY_REMAP_VIEW_PROPERTY(textAlign, textView.textAlignment, NSTextAlignment) +-HIPPY_REMAP_VIEW_PROPERTY(editable, textView.editable, BOOL) +-HIPPY_REMAP_VIEW_PROPERTY(enablesReturnKeyAutomatically, textView.enablesReturnKeyAutomatically, BOOL) +-HIPPY_REMAP_VIEW_PROPERTY(keyboardType, textView.keyboardType, UIKeyboardType) +-HIPPY_REMAP_VIEW_PROPERTY(keyboardAppearance, textView.keyboardAppearance, UIKeyboardAppearance) +-HIPPY_EXPORT_VIEW_PROPERTY(maxLength, NSNumber) +-HIPPY_EXPORT_VIEW_PROPERTY(onContentSizeChange, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onSelectionChange, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onTextInput, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onEndEditing, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(placeholder, NSString) +-HIPPY_EXPORT_VIEW_PROPERTY(placeholderTextColor, UIColor) +-HIPPY_REMAP_VIEW_PROPERTY(returnKeyType, textView.returnKeyType, UIReturnKeyType) +-HIPPY_REMAP_VIEW_PROPERTY(secureTextEntry, textView.secureTextEntry, BOOL) +-HIPPY_REMAP_VIEW_PROPERTY(selectionColor, tintColor, UIColor) +-HIPPY_EXPORT_VIEW_PROPERTY(selectTextOnFocus, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(selection, HippyTextSelection) +-HIPPY_EXPORT_VIEW_PROPERTY(text, NSString) +- +-HIPPY_CUSTOM_SHADOW_PROPERTY(fontSize, NSNumber, HippyShadowTextView) { +- view.font = [HippyFont updateFont:view.font withSize:json]; +-} +- +-HIPPY_CUSTOM_SHADOW_PROPERTY(fontWeight, NSString, HippyShadowTextView) { +- view.font = [HippyFont updateFont:view.font withWeight:json]; +-} +- +-HIPPY_CUSTOM_SHADOW_PROPERTY(fontStyle, NSString, HippyShadowTextView) { +- view.font = [HippyFont updateFont:view.font withStyle:json]; // defaults to normal +-} +- +-HIPPY_CUSTOM_SHADOW_PROPERTY(fontFamily, NSString, HippyShadowTextView) { +- view.font = [HippyFont updateFont:view.font withFamily:json]; +-} +- +-HIPPY_CUSTOM_VIEW_PROPERTY(fontSize, NSNumber, HippyBaseTextInput) { +- UIFont *theFont = [HippyFont updateFont:view.font withSize:json ?: @(defaultView.font.pointSize)]; +- view.font = theFont; +-} +-HIPPY_CUSTOM_VIEW_PROPERTY(fontWeight, NSString, __unused HippyBaseTextInput) { +- UIFont *theFont = [HippyFont updateFont:view.font withWeight:json]; // defaults to normal +- view.font = theFont; +-} +-HIPPY_CUSTOM_VIEW_PROPERTY(fontStyle, NSString, __unused HippyBaseTextInput) { +- UIFont *theFont = [HippyFont updateFont:view.font withStyle:json]; +- view.font = theFont; // defaults to normal +-} +-HIPPY_CUSTOM_VIEW_PROPERTY(fontFamily, NSString, HippyBaseTextInput) { +- view.font = [HippyFont updateFont:view.font withFamily:json ?: defaultView.font.familyName]; +-} +- +-- (HippyRenderUIBlock)uiBlockToAmendWithShadowView:(HippyShadowView *)shadowView { +- NSNumber *hippyTag = shadowView.hippyTag; +- UIEdgeInsets padding = shadowView.paddingAsInsets; +- return ^(__unused id renderContext, NSDictionary *viewRegistry) { +- viewRegistry[hippyTag].contentInset = padding; +- }; +-} +-@end +diff --git a/renderer/native/ios/renderer/component/textinput/HippyBaseTextInput.h b/renderer/native/ios/renderer/component/textinput/NativeRenderBaseTextInput.h +similarity index 89% +rename from renderer/native/ios/renderer/component/textinput/HippyBaseTextInput.h +rename to renderer/native/ios/renderer/component/textinput/NativeRenderBaseTextInput.h +index 166b9bd81e3..e29fe5f390c 100644 +--- a/renderer/native/ios/renderer/component/textinput/HippyBaseTextInput.h ++++ b/renderer/native/ios/renderer/component/textinput/NativeRenderBaseTextInput.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,9 +20,9 @@ + * limitations under the License. + */ + +-#import ""HippyView.h"" ++#import ""NativeRenderView.h"" + +-@interface HippyBaseTextInput : HippyView ++@interface NativeRenderBaseTextInput : NativeRenderView + @property (nonatomic, strong) UIFont *font; + @property (nonatomic, assign) UIEdgeInsets contentInset; + @property (nonatomic, copy) NSString *value; +diff --git a/renderer/native/ios/renderer/component/textinput/HippyBaseTextInput.mm b/renderer/native/ios/renderer/component/textinput/NativeRenderBaseTextInput.mm +similarity index 90% +rename from renderer/native/ios/renderer/component/textinput/HippyBaseTextInput.mm +rename to renderer/native/ios/renderer/component/textinput/NativeRenderBaseTextInput.mm +index b8c41e4af89..81421a44fe7 100644 +--- a/renderer/native/ios/renderer/component/textinput/HippyBaseTextInput.mm ++++ b/renderer/native/ios/renderer/component/textinput/NativeRenderBaseTextInput.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,9 +20,9 @@ + * limitations under the License. + */ + +-#import ""HippyBaseTextInput.h"" ++#import ""NativeRenderBaseTextInput.h"" + +-@implementation HippyBaseTextInput ++@implementation NativeRenderBaseTextInput + - (void)focus { + // base method, should be override + } +diff --git a/renderer/native/ios/renderer/component/textinput/HippyShadowTextView.h b/renderer/native/ios/renderer/component/textinput/NativeRenderObjectTextView.h +similarity index 87% +rename from renderer/native/ios/renderer/component/textinput/HippyShadowTextView.h +rename to renderer/native/ios/renderer/component/textinput/NativeRenderObjectTextView.h +index 730a0748edb..28528f0d35c 100644 +--- a/renderer/native/ios/renderer/component/textinput/HippyShadowTextView.h ++++ b/renderer/native/ios/renderer/component/textinput/NativeRenderObjectTextView.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,9 +20,9 @@ + * limitations under the License. + */ + +-#import ""HippyShadowView.h"" ++#import ""NativeRenderObjectView.h"" + +-@interface HippyShadowTextView : HippyShadowView ++@interface NativeRenderObjectTextView : NativeRenderObjectView + + @property (nonatomic, copy) NSString *text; + @property (nonatomic, copy) NSString *placeholder; +diff --git a/renderer/native/ios/renderer/component/textinput/HippyShadowTextView.mm b/renderer/native/ios/renderer/component/textinput/NativeRenderObjectTextView.mm +similarity index 89% +rename from renderer/native/ios/renderer/component/textinput/HippyShadowTextView.mm +rename to renderer/native/ios/renderer/component/textinput/NativeRenderObjectTextView.mm +index 08994f25e52..dbae2859b98 100644 +--- a/renderer/native/ios/renderer/component/textinput/HippyShadowTextView.mm ++++ b/renderer/native/ios/renderer/component/textinput/NativeRenderObjectTextView.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,24 +20,23 @@ + * limitations under the License. + */ + +-#import ""HippyShadowTextView.h"" +-#import ""Hippy.h"" +-#import ""HippyUtils.h"" ++#import ""NativeRenderObjectTextView.h"" ++#import ""NativeRenderUtils.h"" + #import ""dom/layout_node.h"" + +-@interface HippyShadowTextView () ++@interface NativeRenderObjectTextView () + + @property (nonatomic, strong) NSDictionary *dicAttributes; + + @end + + static hippy::LayoutSize x5MeasureFunc( +- HippyShadowTextView *weakShadowText, ++ NativeRenderObjectTextView *weakShadowText, + float width, hippy::LayoutMeasureMode widthMeasureMode, float height, + hippy::LayoutMeasureMode heightMeasureMode, void *layoutContext) { + hippy::LayoutSize result; + if (weakShadowText) { +- HippyShadowTextView *strongShadowText = weakShadowText; ++ NativeRenderObjectTextView *strongShadowText = weakShadowText; + NSString *text = strongShadowText.text ?: strongShadowText.placeholder; + if (nil == strongShadowText.dicAttributes) { + if (strongShadowText.font == nil) { +@@ -52,7 +51,7 @@ @interface HippyShadowTextView () + return result; + } + +-@implementation HippyShadowTextView ++@implementation NativeRenderObjectTextView + + - (instancetype)init { + self = [super init]; +@@ -68,7 +67,7 @@ - (void)setDomManager:(const std::weak_ptr)domManager { + int32_t hippyTag = [self.hippyTag intValue]; + auto node = shared_domNode->GetNode(self.rootNode, hippyTag); + if (node) { +- __weak HippyShadowTextView *weakSelf = self; ++ __weak NativeRenderObjectTextView *weakSelf = self; + hippy::MeasureFunction measureFunc = + [weakSelf](float width, hippy::LayoutMeasureMode widthMeasureMode, + float height, hippy::LayoutMeasureMode heightMeasureMode, void *layoutContext){ +diff --git a/renderer/native/ios/renderer/component/textinput/HippyTextField.h b/renderer/native/ios/renderer/component/textinput/NativeRenderTextField.h +similarity index 61% +rename from renderer/native/ios/renderer/component/textinput/HippyTextField.h +rename to renderer/native/ios/renderer/component/textinput/NativeRenderTextField.h +index 647d88b91d2..811706e4486 100644 +--- a/renderer/native/ios/renderer/component/textinput/HippyTextField.h ++++ b/renderer/native/ios/renderer/component/textinput/NativeRenderTextField.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,27 +21,27 @@ + */ + + #import +-#import ""HippyView.h"" +-#import ""HippyComponent.h"" +-#import ""HippyBaseTextInput.h"" ++#import ""NativeRenderView.h"" ++#import ""NativeRenderComponentProtocol.h"" ++#import ""NativeRenderBaseTextInput.h"" + +-@protocol HippyUITextFieldResponseDelegate ++@protocol NativeRenderUITextFieldResponseDelegate + @required + - (void)textview_becomeFirstResponder; + - (void)textview_resignFirstResponder; + @end + +-@interface HippyUITextField : UITextField ++@interface NativeRenderUITextField : UITextField + @property (nonatomic, assign) BOOL textWasPasted; +-@property (nonatomic, weak) id responderDelegate; ++@property (nonatomic, weak) id responderDelegate; + +-@property (nonatomic, copy) HippyDirectEventBlock onBlur; +-@property (nonatomic, copy) HippyDirectEventBlock onFocus; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onBlur; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onFocus; + @property (nonatomic, assign) BOOL editable; + @end + +-@interface HippyTextField : HippyBaseTextInput +-@property (nonatomic, copy) HippyDirectEventBlock onKeyPress; ++@interface NativeRenderTextField : NativeRenderBaseTextInput ++@property (nonatomic, copy) NativeRenderDirectEventBlock onKeyPress; + @property (nonatomic, assign) BOOL autoCorrect; + //@property (nonatomic, assign) UIEdgeInsets contentInset; + @property (nonatomic, strong) UIColor *placeholderTextColor; +@@ -49,21 +49,21 @@ + @property (nonatomic, strong) NSNumber *maxLength; + @property (nonatomic, assign) BOOL textWasPasted; + +-@property (nonatomic, copy) HippyDirectEventBlock onSelectionChange; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onSelectionChange; + + - (void)textFieldDidChange; + +-@property (nonatomic, copy) HippyDirectEventBlock onChangeText; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onChangeText; + + // focus/blur + - (void)focus; + - (void)blur; + - (void)keyboardWillShow:(NSNotification *)aNotification; + +-@property (nonatomic, copy) HippyDirectEventBlock onBlur; +-@property (nonatomic, copy) HippyDirectEventBlock onFocus; +-@property (nonatomic, copy) HippyDirectEventBlock onEndEditing; +-@property (nonatomic, copy) HippyDirectEventBlock onKeyboardWillShow; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onBlur; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onFocus; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onEndEditing; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onKeyboardWillShow; + + @property (nonatomic, copy) NSString *value; + @property (nonatomic, strong) NSNumber *fontSize; +diff --git a/renderer/native/ios/renderer/component/textinput/HippyTextField.mm b/renderer/native/ios/renderer/component/textinput/NativeRenderTextField.mm +similarity index 93% +rename from renderer/native/ios/renderer/component/textinput/HippyTextField.mm +rename to renderer/native/ios/renderer/component/textinput/NativeRenderTextField.mm +index 328414748c3..63f7c73ce60 100644 +--- a/renderer/native/ios/renderer/component/textinput/HippyTextField.mm ++++ b/renderer/native/ios/renderer/component/textinput/NativeRenderTextField.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,16 +20,14 @@ + * limitations under the License. + */ + +-#import ""HippyTextField.h"" ++#import ""NativeRenderTextField.h"" + +-#import ""HippyConvert.h"" +-#import ""HippyUtils.h"" +-#import ""HippyTextSelection.h"" +-#import ""UIView+Hippy.h"" ++#import ""NativeRenderConvert.h"" ++#import ""NativeRenderUtils.h"" ++#import ""NativeRenderTextSelection.h"" ++#import ""UIView+NativeRender.h"" + +-@implementation HippyUITextField { +- BOOL _jsRequestingFirstResponder; +-} ++@implementation NativeRenderUITextField + + - (void)setKeyboardType:(UIKeyboardType)keyboardType { + NSString *tempPwdStr = self.text; +@@ -53,10 +51,6 @@ - (void)paste:(id)sender { + [super paste:sender]; + } + +-- (void)hippyWillMakeFirstResponder { +- _jsRequestingFirstResponder = YES; +-} +- + - (BOOL)canBecomeFirstResponder { + return YES; + } +@@ -88,17 +82,6 @@ - (void)textview_resignFirstResponder { + } + } + +-- (void)hippyDidMakeFirstResponder { +- _jsRequestingFirstResponder = YES; +-} +- +-- (void)didMoveToWindow { +- if (_jsRequestingFirstResponder) { +- [self becomeFirstResponder]; +- [self hippyDidMakeFirstResponder]; +- } +-} +- + - (void)dealloc { + _responderDelegate = nil; + [[NSNotificationCenter defaultCenter] removeObserver:self]; +@@ -106,12 +89,12 @@ - (void)dealloc { + + @end + +-@interface HippyTextField () ++@interface NativeRenderTextField () + @end + +-@implementation HippyTextField { ++@implementation NativeRenderTextField { + UITextRange *_previousSelectionRange; +- HippyUITextField *_textView; ++ NativeRenderUITextField *_textView; + } + + - (void)keyboardWillShow:(NSNotification *)aNotification { +@@ -128,7 +111,7 @@ - (void)keyboardWillShow:(NSNotification *)aNotification { + - (instancetype)initWithFrame:(CGRect)frame { + if ((self = [super initWithFrame:frame])) { + [self setContentInset:UIEdgeInsetsZero]; +- _textView = [[HippyUITextField alloc] initWithFrame:CGRectZero]; ++ _textView = [[NativeRenderUITextField alloc] initWithFrame:CGRectZero]; + _textView.responderDelegate = self; + _textView.backgroundColor = [UIColor clearColor]; + _textView.textColor = [UIColor blackColor]; +@@ -146,8 +129,6 @@ - (void)dealloc { + [_textView removeObserver:self forKeyPath:@""selectedTextRange""]; + } + +-HIPPY_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder) +- + // This method is overridden for `onKeyPress`. The manager + // will not send a keyPress for text that was pasted. + - (void)paste:(id)sender { +@@ -256,7 +237,7 @@ - (void)textFieldBeginEditing { + } + + - (void)observeValueForKeyPath:(NSString *)keyPath +- ofObject:(__unused HippyTextField *)textField ++ ofObject:(__unused NativeRenderTextField *)textField + change:(__unused NSDictionary *)change + context:(__unused void *)context { + if ([keyPath isEqualToString:@""selectedTextRange""]) { +diff --git a/renderer/native/ios/renderer/component/textinput/HippyTextSelection.h b/renderer/native/ios/renderer/component/textinput/NativeRenderTextSelection.h +similarity index 81% +rename from renderer/native/ios/renderer/component/textinput/HippyTextSelection.h +rename to renderer/native/ios/renderer/component/textinput/NativeRenderTextSelection.h +index 0edcb6f1e23..5fb3a080d1a 100644 +--- a/renderer/native/ios/renderer/component/textinput/HippyTextSelection.h ++++ b/renderer/native/ios/renderer/component/textinput/NativeRenderTextSelection.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,12 +20,12 @@ + * limitations under the License. + */ + +-#import ""HippyConvert.h"" ++#import ""NativeRenderConvert.h"" + + /** + * Object containing information about a TextInput's selection. + */ +-@interface HippyTextSelection : NSObject ++@interface NativeRenderTextSelection : NSObject + + @property (nonatomic, assign, readonly) NSInteger start; + @property (nonatomic, assign, readonly) NSInteger end; +@@ -34,8 +34,8 @@ + + @end + +-@interface HippyConvert (HippyTextSelection) ++@interface NativeRenderConvert (NativeRenderTextSelection) + +-+ (HippyTextSelection *)HippyTextSelection:(id)json; +++ (NativeRenderTextSelection *)NativeRenderTextSelection:(id)json; + + @end +diff --git a/renderer/native/ios/renderer/component/textinput/HippyTextSelection.m b/renderer/native/ios/renderer/component/textinput/NativeRenderTextSelection.m +similarity index 77% +rename from renderer/native/ios/renderer/component/textinput/HippyTextSelection.m +rename to renderer/native/ios/renderer/component/textinput/NativeRenderTextSelection.m +index c6fa58725f4..4cafba03fe1 100644 +--- a/renderer/native/ios/renderer/component/textinput/HippyTextSelection.m ++++ b/renderer/native/ios/renderer/component/textinput/NativeRenderTextSelection.m +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,9 +20,9 @@ + * limitations under the License. + */ + +-#import ""HippyTextSelection.h"" ++#import ""NativeRenderTextSelection.h"" + +-@implementation HippyTextSelection ++@implementation NativeRenderTextSelection + + - (instancetype)initWithStart:(NSInteger)start end:(NSInteger)end { + if (self = [super init]) { +@@ -34,13 +34,13 @@ - (instancetype)initWithStart:(NSInteger)start end:(NSInteger)end { + + @end + +-@implementation HippyConvert (HippyTextSelection) ++@implementation NativeRenderConvert (NativeRenderTextSelection) + +-+ (HippyTextSelection *)HippyTextSelection:(id)json { +++ (NativeRenderTextSelection *)NativeRenderTextSelection:(id)json { + if ([json isKindOfClass:[NSDictionary class]]) { + NSInteger start = [self NSInteger:json[@""start""]]; + NSInteger end = [self NSInteger:json[@""end""]]; +- return [[HippyTextSelection alloc] initWithStart:start end:end]; ++ return [[NativeRenderTextSelection alloc] initWithStart:start end:end]; + } + + return nil; +diff --git a/renderer/native/ios/renderer/component/textinput/HippyTextView.h b/renderer/native/ios/renderer/component/textinput/NativeRenderTextView.h +similarity index 63% +rename from renderer/native/ios/renderer/component/textinput/HippyTextView.h +rename to renderer/native/ios/renderer/component/textinput/NativeRenderTextView.h +index 4e5fc61f9e9..7617312d5e3 100644 +--- a/renderer/native/ios/renderer/component/textinput/HippyTextView.h ++++ b/renderer/native/ios/renderer/component/textinput/NativeRenderTextView.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -22,24 +22,24 @@ + + #import + +-#import ""HippyView.h"" +-#import ""HippyBaseTextInput.h"" +-#import ""UIView+Hippy.h"" ++#import ""NativeRenderView.h"" ++#import ""NativeRenderBaseTextInput.h"" ++#import ""UIView+NativeRender.h"" + +-@protocol HippyUITextViewResponseDelegate ++@protocol NativeRenderUITextViewResponseDelegate + @required + - (void)textview_becomeFirstResponder; + - (void)textview_resignFirstResponder; + @end + +-@interface HippyUITextView : UITextView ++@interface NativeRenderUITextView : UITextView + @property (nonatomic, assign) BOOL textWasPasted; +-@property (nonatomic, weak) id responderDelegate; ++@property (nonatomic, weak) id responderDelegate; + @end + +-@interface HippyTextView : HippyBaseTextInput { ++@interface NativeRenderTextView : NativeRenderBaseTextInput { + @protected +- HippyUITextView *_textView; ++ NativeRenderUITextView *_textView; + } + + @property (nonatomic, assign) BOOL autoCorrect; +@@ -53,11 +53,11 @@ + @property (nonatomic, strong) UIFont *font; + @property (nonatomic, assign) NSInteger mostRecentEventCount; + @property (nonatomic, strong) NSNumber *maxLength; +-@property (nonatomic, copy) HippyDirectEventBlock onKeyPress; +-@property (nonatomic, copy) HippyDirectEventBlock onContentSizeChange; +-@property (nonatomic, copy) HippyDirectEventBlock onSelectionChange; +-@property (nonatomic, copy) HippyDirectEventBlock onTextInput; +-@property (nonatomic, copy) HippyDirectEventBlock onEndEditing; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onKeyPress; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onContentSizeChange; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onSelectionChange; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onTextInput; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onEndEditing; + + - (void)performTextUpdate; + +@@ -65,10 +65,10 @@ + @property (nonatomic, strong) NSNumber *fontSize; + @property (nonatomic, strong) NSString *defaultValue; + @property (nonatomic, strong) UIColor *textColor; +-@property (nonatomic, copy) HippyDirectEventBlock onChangeText; +-@property (nonatomic, copy) HippyDirectEventBlock onBlur; +-@property (nonatomic, copy) HippyDirectEventBlock onFocus; +-@property (nonatomic, copy) HippyDirectEventBlock onKeyboardWillShow; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onChangeText; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onBlur; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onFocus; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onKeyboardWillShow; + + - (void)focus; + - (void)blur; +diff --git a/renderer/native/ios/renderer/component/textinput/HippyTextView.mm b/renderer/native/ios/renderer/component/textinput/NativeRenderTextView.mm +similarity index 92% +rename from renderer/native/ios/renderer/component/textinput/HippyTextView.mm +rename to renderer/native/ios/renderer/component/textinput/NativeRenderTextView.mm +index be6ba9b1827..48bd871b8f4 100644 +--- a/renderer/native/ios/renderer/component/textinput/HippyTextView.mm ++++ b/renderer/native/ios/renderer/component/textinput/NativeRenderTextView.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,30 +20,23 @@ + * limitations under the License. + */ + +-#import ""HippyTextView.h"" ++#import ""NativeRenderTextView.h"" + +-#import ""HippyConvert.h"" +-#import ""HippyShadowText.h"" +-#import ""HippyText.h"" +-#import ""HippyUtils.h"" +-#import ""HippyTextSelection.h"" +-#import ""UIView+Hippy.h"" ++#import ""NativeRenderConvert.h"" ++#import ""NativeRenderObjectText.h"" ++#import ""NativeRenderText.h"" ++#import ""NativeRenderUtils.h"" ++#import ""NativeRenderTextSelection.h"" ++#import ""UIView+NativeRender.h"" + +-@implementation HippyUITextView { +- BOOL _jsRequestingFirstResponder; +-} ++@implementation NativeRenderUITextView + + - (void)paste:(id)sender { + _textWasPasted = YES; + [super paste:sender]; + } + +-- (void)hippyWillMakeFirstResponder { +- _jsRequestingFirstResponder = YES; +-} +- + - (BOOL)canBecomeFirstResponder { +- // return _jsRequestingFirstResponder; + return YES; + } + +@@ -62,17 +55,6 @@ - (BOOL)resignFirstResponder { + return [super resignFirstResponder]; + } + +-- (void)hippyDidMakeFirstResponder { +- _jsRequestingFirstResponder = YES; +-} +- +-- (void)didMoveToWindow { +- if (_jsRequestingFirstResponder) { +- [self becomeFirstResponder]; +- [self hippyDidMakeFirstResponder]; +- } +-} +- + - (void)dealloc { + _responderDelegate = nil; + [[NSNotificationCenter defaultCenter] removeObserver:self]; +@@ -80,13 +62,13 @@ - (void)dealloc { + + @end + +-@interface HippyTextView () ++@interface NativeRenderTextView () + @end + +-@implementation HippyTextView { ++@implementation NativeRenderTextView { + NSString *_placeholder; + UITextView *_placeholderView; +- HippyText *_richTextView; ++ NativeRenderText *_richTextView; + NSAttributedString *_pendingAttributedText; + UIScrollView *_scrollView; + +@@ -121,7 +103,7 @@ - (instancetype)initWithFrame:(CGRect)frame { + [self setContentInset:UIEdgeInsetsZero]; + _placeholderTextColor = [self defaultPlaceholderTextColor]; + _blurOnSubmit = NO; +- _textView = [[HippyUITextView alloc] initWithFrame:CGRectZero]; ++ _textView = [[NativeRenderUITextView alloc] initWithFrame:CGRectZero]; + _textView.responderDelegate = self; + _textView.backgroundColor = [UIColor clearColor]; + _textView.textColor = [UIColor blackColor]; +@@ -141,15 +123,13 @@ - (instancetype)initWithFrame:(CGRect)frame { + return self; + } + +-HIPPY_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder) +- + - (void)insertHippySubview:(UIView *)subview atIndex:(NSInteger)index { + [super insertHippySubview:subview atIndex:index]; +- if ([subview isKindOfClass:[HippyText class]]) { ++ if ([subview isKindOfClass:[NativeRenderText class]]) { + if (_richTextView) { +- //HippyLogError(@""Tried to insert a second into - there can only be one.""); ++ //NativeRenderLogError(@""Tried to insert a second into - there can only be one.""); + } +- _richTextView = (HippyText *)subview; ++ _richTextView = (NativeRenderText *)subview; + + if (subview.backgroundColor) { + NSMutableDictionary *attrs = [_textView.typingAttributes mutableCopy]; +@@ -176,7 +156,7 @@ - (void)didUpdateHippySubviews { + - (void)setMostRecentEventCount:(NSInteger)mostRecentEventCount { + _mostRecentEventCount = mostRecentEventCount; + +- // Props are set after uiBlockToAmendWithShadowViewRegistry, which means that ++ // Props are set after uiBlockToAmendWithRenderObjectRegistry, which means that + // at the time performTextUpdate is called, _mostRecentEventCount will be + // behind _eventCount, with the result that performPendingTextUpdate will do + // nothing. For that reason we call it again here after mostRecentEventCount +@@ -198,7 +178,7 @@ - (void)performTextUpdate { + return string; + } else { + NSMutableAttributedString *mutableString = [[NSMutableAttributedString alloc] initWithAttributedString:string]; +- [mutableString removeAttribute:HippyHippyTagAttributeName range:NSMakeRange(0, mutableString.length)]; ++ [mutableString removeAttribute:NativeRenderHippyTagAttributeName range:NSMakeRange(0, mutableString.length)]; + return mutableString; + } + } +@@ -251,7 +231,7 @@ - (void)performPendingTextUpdate { + + - (void)updateFrames { + // Adjust the insets so that they are as close as possible to single-line +- // HippyTextField defaults, using the system defaults of font size 17 and a ++ // NativeRenderTextField defaults, using the system defaults of font size 17 and a + // height of 31 points. + // + // We apply the left inset to the frame since a negative left text-container +@@ -382,7 +362,7 @@ - (void)textFieldEditChanged:(NSNotification *)obj { + } + } + +-- (BOOL)textView:(HippyUITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text { ++- (BOOL)textView:(NativeRenderUITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text { + if (_onKeyPress) { + NSString *resultKey = text; + if ([text isEqualToString:@"" ""]) { +@@ -399,9 +379,9 @@ - (BOOL)textView:(HippyUITextView *)textView shouldChangeTextInRange:(NSRange)ra + textView.textWasPasted = NO; + } else { + if (_blurOnSubmit && [text isEqualToString:@""\n""]) { +- // TODO: the purpose of blurOnSubmit on HippyextField is to decide if the ++ // TODO: the purpose of blurOnSubmit on NativeRenderextField is to decide if the + // field should lose focus when return is pressed or not. We're cheating a +- // bit here by using it on HippyextView to decide if return character should ++ // bit here by using it on NativeRenderextView to decide if return character should + // submit the form, or be entered into the field. + // + // The reason this is cheating is because there's no way to specify that +@@ -452,7 +432,7 @@ - (BOOL)textView:(HippyUITextView *)textView shouldChangeTextInRange:(NSRange)ra + return YES; + } + +-- (void)textViewDidChangeSelection:(HippyUITextView *)textView { ++- (void)textViewDidChangeSelection:(NativeRenderUITextView *)textView { + if (_onSelectionChange && textView.selectedTextRange != _previousSelectionRange + && ![textView.selectedTextRange isEqual:_previousSelectionRange]) { + _previousSelectionRange = textView.selectedTextRange; +@@ -479,7 +459,7 @@ - (NSString *)text { + return _textView.text; + } + +-- (void)setSelection:(HippyTextSelection *)selection { ++- (void)setSelection:(NativeRenderTextSelection *)selection { + if (!selection) { + return; + } +@@ -656,14 +636,6 @@ - (BOOL)canBecomeFirstResponder { + return [_textView canBecomeFirstResponder]; + } + +-- (void)hippyWillMakeFirstResponder { +- [_textView hippyWillMakeFirstResponder]; +-} +- +-- (void)hippyDidMakeFirstResponder { +- [_textView hippyDidMakeFirstResponder]; +-} +- + - (void)layoutSubviews { + [super layoutSubviews]; + +diff --git a/renderer/native/ios/renderer/component/headerrefresh/HippyHeaderRefreshManager.h b/renderer/native/ios/renderer/component/textinput/NativeRenderTextViewManager.h +similarity index 85% +rename from renderer/native/ios/renderer/component/headerrefresh/HippyHeaderRefreshManager.h +rename to renderer/native/ios/renderer/component/textinput/NativeRenderTextViewManager.h +index 302f211c3cc..3c0e3cb7086 100644 +--- a/renderer/native/ios/renderer/component/headerrefresh/HippyHeaderRefreshManager.h ++++ b/renderer/native/ios/renderer/component/textinput/NativeRenderTextViewManager.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,8 +20,8 @@ + * limitations under the License. + */ + +-#import ""HippyViewManager.h"" ++#import ""NativeRenderViewManager.h"" + +-@interface HippyHeaderRefreshManager : HippyViewManager ++@interface NativeRenderTextViewManager : NativeRenderViewManager + + @end +diff --git a/renderer/native/ios/renderer/component/textinput/NativeRenderTextViewManager.mm b/renderer/native/ios/renderer/component/textinput/NativeRenderTextViewManager.mm +new file mode 100644 +index 00000000000..0fa796cda6d +--- /dev/null ++++ b/renderer/native/ios/renderer/component/textinput/NativeRenderTextViewManager.mm +@@ -0,0 +1,206 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * NativeRender available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ""NativeRenderTextViewManager.h"" ++#import ""NativeRenderObjectView.h"" ++#import ""NativeRenderTextView.h"" ++#import ""NativeRenderTextField.h"" ++#import ""NativeRenderBaseTextInput.h"" ++#import ""NativeRenderObjectTextView.h"" ++#import ""NativeRenderFont.h"" ++#import ""NativeRenderContext.h"" ++ ++@implementation NativeRenderTextViewManager ++ ++- (UIView *)view { ++ NSNumber *mutiline = self.props[@""multiline""]; ++ NSString *keyboardType = self.props[@""keyboardType""]; ++ if ([keyboardType isKindOfClass:[NSString class]] && [keyboardType isEqual:@""password""]) { ++ mutiline = @(NO); ++ } ++ NativeRenderBaseTextInput *theView; ++ if (mutiline != nil && !mutiline.boolValue) { ++ NativeRenderTextField *textField = [[NativeRenderTextField alloc] init]; ++ if (self.props[@""onKeyboardWillShow""]) { ++ [[NSNotificationCenter defaultCenter] addObserver:textField selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification ++ object:nil]; ++ } ++ theView = textField; ++ } else { ++ NativeRenderTextView *textView = [[NativeRenderTextView alloc] init]; ++ if (self.props[@""onKeyboardWillShow""]) { ++ [[NSNotificationCenter defaultCenter] addObserver:textView selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification ++ object:nil]; ++ } ++ theView = textView; ++ } ++ ++ return theView; ++} ++ ++- (NativeRenderObjectView *)nativeRenderObjectView { ++ return [NativeRenderObjectTextView new]; ++} ++ ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(value, NSString) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onChangeText, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onKeyPress, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onBlur, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onFocus, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onKeyboardWillShow, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(defaultValue, NSString) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(isNightMode, BOOL) ++ ++// clang-format off ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(focusTextInput:(nonnull NSNumber *)hippyTag) { ++ [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry){ ++ NativeRenderBaseTextInput *view = (NativeRenderBaseTextInput *)viewRegistry[hippyTag]; ++ if (view == nil) return ; ++ if (![view isKindOfClass:[NativeRenderBaseTextInput class]]) { ++ //NativeRenderLogError(@""Invalid view returned from registry, expecting NativeRenderBaseTextInput, got: %@"", view); ++ } ++ [view focus]; ++ }]; ++} ++// clang-format on ++ ++// clang-format off ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(blurTextInput:(nonnull NSNumber *)hippyTag) { ++ [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry){ ++ NativeRenderBaseTextInput *view = (NativeRenderBaseTextInput *)viewRegistry[hippyTag]; ++ if (view == nil) return ; ++ if (![view isKindOfClass:[NativeRenderBaseTextInput class]]) { ++ //NativeRenderLogError(@""Invalid view returned from registry, expecting NativeRenderBaseTextInput, got: %@"", view); ++ } ++ [view blur]; ++ }]; ++} ++// clang-format on ++ ++// clang-format off ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(clear:(nonnull NSNumber *)hippyTag) { ++ [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderBaseTextInput *view = (NativeRenderBaseTextInput *)viewRegistry[hippyTag]; ++ if (view == nil) return ; ++ if (![view isKindOfClass:[NativeRenderBaseTextInput class]]) { ++ //NativeRenderLogError(@""Invalid view returned from registry, expecting NativeRenderBaseTextInput, got: %@"", view); ++ } ++ [view clearText]; ++ }]; ++} ++// clang-format on ++ ++// clang-format off ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(setValue:(nonnull NSNumber *)hippyTag ++ text:(NSString *)text ) { ++ [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderBaseTextInput *view = (NativeRenderBaseTextInput *)viewRegistry[hippyTag]; ++ if (view == nil) return ; ++ if (![view isKindOfClass:[NativeRenderBaseTextInput class]]) { ++ //NativeRenderLogError(@""Invalid view returned from registry, expecting NativeRenderBaseTextInput, got: %@"", view); ++ } ++ [view setValue: text]; ++ }]; ++} ++// clang-format on ++ ++// clang-format off ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(getValue:(nonnull NSNumber *)hippyTag ++ callback:(RenderUIResponseSenderBlock)callback ) { ++ [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderBaseTextInput *view = (NativeRenderBaseTextInput *)viewRegistry[hippyTag]; ++ NSString *stringValue = [view value]; ++ if (nil == stringValue) { ++ stringValue = @""""; ++ } ++ callback([NSDictionary dictionaryWithObject:stringValue forKey:@""text""]); ++ }]; ++} ++// clang-format on ++ ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(text, NSString) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(placeholder, NSString) ++ ++NATIVE_RENDER_REMAP_VIEW_PROPERTY(autoCapitalize, textView.autocapitalizationType, UITextAutocapitalizationType) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(autoCorrect, BOOL) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(blurOnSubmit, BOOL) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(clearTextOnFocus, BOOL) ++NATIVE_RENDER_REMAP_VIEW_PROPERTY(color, textView.textColor, UIColor) ++NATIVE_RENDER_REMAP_VIEW_PROPERTY(textAlign, textView.textAlignment, NSTextAlignment) ++NATIVE_RENDER_REMAP_VIEW_PROPERTY(editable, textView.editable, BOOL) ++NATIVE_RENDER_REMAP_VIEW_PROPERTY(enablesReturnKeyAutomatically, textView.enablesReturnKeyAutomatically, BOOL) ++NATIVE_RENDER_REMAP_VIEW_PROPERTY(keyboardType, textView.keyboardType, UIKeyboardType) ++NATIVE_RENDER_REMAP_VIEW_PROPERTY(keyboardAppearance, textView.keyboardAppearance, UIKeyboardAppearance) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(maxLength, NSNumber) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onContentSizeChange, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onSelectionChange, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onTextInput, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onEndEditing, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(placeholder, NSString) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(placeholderTextColor, UIColor) ++NATIVE_RENDER_REMAP_VIEW_PROPERTY(returnKeyType, textView.returnKeyType, UIReturnKeyType) ++NATIVE_RENDER_REMAP_VIEW_PROPERTY(secureTextEntry, textView.secureTextEntry, BOOL) ++NATIVE_RENDER_REMAP_VIEW_PROPERTY(selectionColor, tintColor, UIColor) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(selectTextOnFocus, BOOL) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(selection, NativeRenderTextSelection) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(text, NSString) ++ ++NATIVE_RENDER_CUSTOM_RENDER_OBJECT_PROPERTY(fontSize, NSNumber, NativeRenderObjectTextView) { ++ view.font = [NativeRenderFont updateFont:view.font withSize:json]; ++} ++ ++NATIVE_RENDER_CUSTOM_RENDER_OBJECT_PROPERTY(fontWeight, NSString, NativeRenderObjectTextView) { ++ view.font = [NativeRenderFont updateFont:view.font withWeight:json]; ++} ++ ++NATIVE_RENDER_CUSTOM_RENDER_OBJECT_PROPERTY(fontStyle, NSString, NativeRenderObjectTextView) { ++ view.font = [NativeRenderFont updateFont:view.font withStyle:json]; // defaults to normal ++} ++ ++NATIVE_RENDER_CUSTOM_RENDER_OBJECT_PROPERTY(fontFamily, NSString, NativeRenderObjectTextView) { ++ view.font = [NativeRenderFont updateFont:view.font withFamily:json]; ++} ++ ++NATIVE_RENDER_CUSTOM_VIEW_PROPERTY(fontSize, NSNumber, NativeRenderBaseTextInput) { ++ UIFont *theFont = [NativeRenderFont updateFont:view.font withSize:json ?: @(defaultView.font.pointSize)]; ++ view.font = theFont; ++} ++NATIVE_RENDER_CUSTOM_VIEW_PROPERTY(fontWeight, NSString, __unused NativeRenderBaseTextInput) { ++ UIFont *theFont = [NativeRenderFont updateFont:view.font withWeight:json]; // defaults to normal ++ view.font = theFont; ++} ++NATIVE_RENDER_CUSTOM_VIEW_PROPERTY(fontStyle, NSString, __unused NativeRenderBaseTextInput) { ++ UIFont *theFont = [NativeRenderFont updateFont:view.font withStyle:json]; ++ view.font = theFont; // defaults to normal ++} ++NATIVE_RENDER_CUSTOM_VIEW_PROPERTY(fontFamily, NSString, NativeRenderBaseTextInput) { ++ view.font = [NativeRenderFont updateFont:view.font withFamily:json ?: defaultView.font.familyName]; ++} ++ ++- (NativeRenderRenderUIBlock)uiBlockToAmendWithNativeRenderObjectView:(NativeRenderObjectView *)nativeRenderObjectView { ++ NSNumber *hippyTag = nativeRenderObjectView.hippyTag; ++ UIEdgeInsets padding = nativeRenderObjectView.paddingAsInsets; ++ return ^(__unused id renderContext, NSDictionary *viewRegistry) { ++ viewRegistry[hippyTag].contentInset = padding; ++ }; ++} ++@end +diff --git a/renderer/native/ios/renderer/component/view/HippyViewEventProtocol.h b/renderer/native/ios/renderer/component/view/HippyViewEventProtocol.h +deleted file mode 100644 +index 2f4a63bb76b..00000000000 +--- a/renderer/native/ios/renderer/component/view/HippyViewEventProtocol.h ++++ /dev/null +@@ -1,54 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#ifndef HPViewEventProtocol_h +-#define HPViewEventProtocol_h +- +-#import +-#import ""HippyComponent.h"" +- +-@protocol HippyViewEventProtocol +- +-@property (nonatomic, copy) HippyDirectEventBlock onClick; +-@property (nonatomic, copy) HippyDirectEventBlock onLongClick; +-@property (nonatomic, copy) HippyDirectEventBlock onPressIn; +-@property (nonatomic, copy) HippyDirectEventBlock onPressOut; +- +-@property (nonatomic, copy) HippyDirectEventBlock onTouchDown; +-@property (nonatomic, copy) HippyDirectEventBlock onTouchMove; +-@property (nonatomic, copy) HippyDirectEventBlock onTouchEnd; +-@property (nonatomic, copy) HippyDirectEventBlock onTouchCancel; +-@property (nonatomic, copy) HippyDirectEventBlock onAttachedToWindow; +-@property (nonatomic, copy) HippyDirectEventBlock onDetachedFromWindow; +- +-@property (nonatomic, assign) BOOL onInterceptTouchEvent; +-@property (nonatomic, assign) BOOL onInterceptPullUpEvent; +- +-@end +- +-@protocol HippyViewTouchHandlerProtocol +- +-- (BOOL)interceptTouchEvent; +- +-@end +- +-#endif /* HPViewEventProtocol_h */ +diff --git a/renderer/native/ios/renderer/component/view/HippyViewManager.mm b/renderer/native/ios/renderer/component/view/HippyViewManager.mm +deleted file mode 100644 +index 1baab443595..00000000000 +--- a/renderer/native/ios/renderer/component/view/HippyViewManager.mm ++++ /dev/null +@@ -1,491 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import ""HippyViewManager.h"" +-#import ""HippyBorderStyle.h"" +-#import ""HippyConvert.h"" +-#import ""HippyEventDispatcher.h"" +-#import ""HippyShadowView.h"" +-#import ""HippyUtils.h"" +-#import ""HippyView.h"" +-#import ""UIView+Hippy.h"" +-#import ""HippyConvert+Transform.h"" +-#import ""HippyGradientObject.h"" +-#import ""HippyImageDataLoaderProtocol.h"" +-#import ""HippyRenderContext.h"" +-#import ""HippyImageDataLoader.h"" +-#import ""HippyDefaultImageProvider.h"" +-#import ""objc/runtime.h"" +-#import ""UIView+DirectionalLayout.h"" +- +-@interface HippyViewManager () { +- id _imageDataLoader; +- NSUInteger _sequence; +-} +- +-@end +- +-@implementation HippyViewManager +- +-- (dispatch_queue_t)methodQueue { +-// return HippyGetUIManagerQueue(); +- //TODO +- NSAssert(NO, @""return queue""); +- return nil; +-} +- +-- (UIView *)view { +- return [[HippyView alloc] init]; +-} +- +-- (HippyShadowView *)shadowView { +- return [[HippyShadowView alloc] init]; +-} +- +-- (HippyRenderUIBlock)uiBlockToAmendWithShadowView:(__unused HippyShadowView *)shadowView { +- return nil; +-} +- +-- (HippyRenderUIBlock)uiBlockToAmendWithShadowViewRegistry:(__unused NSDictionary *)shadowViewRegistry { +- return nil; +-} +- +-RENDER_COMPONENT_EXPORT_METHOD(measureInWindow:(NSNumber *)hippyTag callback:(RenderUIResponseSenderBlock)callback) { +- [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { +- UIView *view = viewRegistry[hippyTag]; +- if (!view) { +- callback(@{}); +- return; +- } +- UIView *rootView = viewRegistry[view.rootTag]; +- if (!rootView) { +- callback(@{}); +- return; +- } +- CGRect windowFrame = [rootView convertRect:view.frame fromView:view.superview]; +- callback(@{@""width"":@(CGRectGetWidth(windowFrame)), +- @""height"": @(CGRectGetHeight(windowFrame)), +- @""x"":@(windowFrame.origin.x), +- @""y"":@(windowFrame.origin.y)}); +- }]; +-} +- +-RENDER_COMPONENT_EXPORT_METHOD(measureInAppWindow:(NSNumber *)hippyTag callback:(RenderUIResponseSenderBlock)callback) { +- [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { +- UIView *view = viewRegistry[hippyTag]; +- if (!view) { +- callback(@{}); +- return; +- } +- CGRect windowFrame = [view.window convertRect:view.frame fromView:view.superview]; +- callback(@{@""width"":@(CGRectGetWidth(windowFrame)), +- @""height"": @(CGRectGetHeight(windowFrame)), +- @""x"":@(windowFrame.origin.x), +- @""y"":@(windowFrame.origin.y)}); +- }]; +-} +- +-RENDER_COMPONENT_EXPORT_METHOD(getScreenShot:(nonnull NSNumber *)hippyTag +- params:(NSDictionary *__nonnull)params +- callback:(HippyResponseSenderBlock)callback) { +- [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { +- UIView *view = viewRegistry[hippyTag]; +- if (view == nil) { +- callback(@[]); +- return; +- } +- CGFloat viewWidth = view.frame.size.width; +- CGFloat viewHeight = view.frame.size.height; +- int maxWidth = [params[@""maxWidth""] intValue]; +- int maxHeight = [params[@""maxHeight""] intValue]; +- CGFloat scale = 1.f; +- if (viewWidth != 0 && viewHeight != 0 && maxWidth > 0 && maxHeight > 0) { +- CGFloat scaleX = maxWidth / viewWidth; +- CGFloat scaleY = maxHeight / viewHeight; +- scale = MIN(scaleX, scaleY); +- } +- UIGraphicsBeginImageContextWithOptions(view.frame.size, YES, scale); +- [view drawViewHierarchyInRect:view.bounds afterScreenUpdates:YES]; +- UIImage *resultImage = UIGraphicsGetImageFromCurrentImageContext(); +- UIGraphicsEndImageContext(); +- if (resultImage) { +- int quality = [params[@""quality""] intValue]; +- NSData *imageData = UIImageJPEGRepresentation(resultImage, (quality > 0 ? quality : 80) / 100.f); +- NSString *base64String = [imageData base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithLineFeed]; +- NSDictionary *srceenShotDict = @{ +- @""width"": @(int(resultImage.size.width * resultImage.scale)), +- @""height"": @(int(resultImage.size.height * resultImage.scale)), +- @""screenShot"": base64String.length ? base64String : @"""", +- @""screenScale"": @(resultImage.scale) +- }; +- callback(@[srceenShotDict]); +- } else { +- callback(@[]); +- } +- }]; +-} +- +-#pragma mark - ShadowView properties +-HIPPY_EXPORT_SHADOW_PROPERTY(visibility, NSString) +- +-#pragma mark - View properties +- +-HIPPY_EXPORT_VIEW_PROPERTY(accessibilityLabel, NSString) +-HIPPY_EXPORT_VIEW_PROPERTY(backgroundColor, UIColor) +-HIPPY_EXPORT_VIEW_PROPERTY(shadowSpread, CGFloat) +- +-HIPPY_REMAP_VIEW_PROPERTY(accessible, isAccessibilityElement, BOOL) +-HIPPY_REMAP_VIEW_PROPERTY(opacity, alpha, CGFloat) +- +-HIPPY_REMAP_VIEW_PROPERTY(shadowOpacity, layer.shadowOpacity, float) +-HIPPY_REMAP_VIEW_PROPERTY(shadowRadius, layer.shadowRadius, CGFloat) +- +-HIPPY_EXPORT_VIEW_PROPERTY(backgroundPositionX, CGFloat) +-HIPPY_EXPORT_VIEW_PROPERTY(backgroundPositionY, CGFloat) +-HIPPY_EXPORT_VIEW_PROPERTY(onInterceptTouchEvent, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(onInterceptPullUpEvent, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(onAttachedToWindow, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onDetachedFromWindow, HippyDirectEventBlock) +- +-HIPPY_CUSTOM_VIEW_PROPERTY(backgroundImage, NSString, HippyView) { +- if (json) { +- NSString *imagePath = [HippyConvert NSString:json]; +- if ([self.renderContext.frameworkProxy respondsToSelector:@selector(standardizeAssetUrlString:forRenderContext:)]) { +- imagePath = [self.renderContext.frameworkProxy standardizeAssetUrlString:imagePath forRenderContext:self.renderContext]; +- } +- id imageDataLoader = [self imageDataLoader]; +- __weak HippyView *weakView = view; +- CGFloat scale = [UIScreen mainScreen].scale; +- NSURL *url = HippyURLWithString(imagePath, nil); +- NSUInteger sequence = _sequence++; +- [imageDataLoader loadImageAtUrl:url sequence:sequence progress:^(NSUInteger current, NSUInteger total) { +- } completion:^(NSUInteger seq, id result, NSURL *url, NSError *error) { +- if (!error && sequence == seq) { +- UIImage *backgroundImage = nil; +- if ([result isKindOfClass:[UIImage class]]) { +- backgroundImage = result; +- } +- else if ([result isKindOfClass:[NSData class]]) { +- HippyDefaultImageProvider *imageProvider = [[HippyDefaultImageProvider alloc] init]; +- imageProvider.imageDataPath = imagePath; +- [imageProvider setImageData:(NSData *)result]; +- imageProvider.scale = scale; +- backgroundImage = [imageProvider image]; +- } +- dispatch_async(dispatch_get_main_queue(), ^{ +- if (weakView) { +- HippyView *strongView = weakView; +- strongView.backgroundImage = backgroundImage; +- } +- }); +- } +- }]; +- } +-} +- +-- (id)imageDataLoader { +- if (!_imageDataLoader) { +- if ([self.renderContext.frameworkProxy respondsToSelector:@selector(imageDataLoaderForRenderContext:)]) { +- _imageDataLoader = [self.renderContext.frameworkProxy imageDataLoaderForRenderContext:self.renderContext]; +- } +- if (!_imageDataLoader) { +- _imageDataLoader = [[HippyImageDataLoader alloc] init]; +- } +- } +- return _imageDataLoader; +-} +- +-HIPPY_CUSTOM_VIEW_PROPERTY(linearGradient, NSDictionary, HippyView) { +- if (json) { +- NSDictionary *linearGradientObject = [HippyConvert NSDictionary:json]; +- view.gradientObject = [[HippyGradientObject alloc] initWithGradientObject:linearGradientObject]; +- [view.layer setNeedsDisplay]; +- } +-} +- +-HIPPY_CUSTOM_VIEW_PROPERTY(backgroundSize, NSString, HippyView) { +- NSString *bgSize = @""auto""; +- if (json) { +- bgSize = [HippyConvert NSString:json]; +- } +- view.backgroundSize = bgSize; +- [view.layer setNeedsDisplay]; +-} +- +-HIPPY_CUSTOM_VIEW_PROPERTY(shadowColor, UIColor, HippyView) { +- if (json) { +- view.layer.shadowColor = [HippyConvert UIColor:json].CGColor; +- } else { +- view.layer.shadowColor = [UIColor blackColor].CGColor; +- } +-} +- +-HIPPY_CUSTOM_VIEW_PROPERTY(shadowOffsetX, CGFloat, HippyView) { +- if (json) { +- CGSize shadowOffset = view.layer.shadowOffset; +- shadowOffset.width = [HippyConvert CGFloat:json]; +- view.layer.shadowOffset = shadowOffset; +- } +-} +- +-HIPPY_CUSTOM_VIEW_PROPERTY(shadowOffsetY, CGFloat, HippyView) { +- if (json) { +- CGSize shadowOffset = view.layer.shadowOffset; +- shadowOffset.height = [HippyConvert CGFloat:json]; +- view.layer.shadowOffset = shadowOffset; +- } +-} +- +-HIPPY_CUSTOM_VIEW_PROPERTY(shadowOffset, NSDictionary, HippyView) { +- if (json) { +- NSDictionary *offset = [HippyConvert NSDictionary:json]; +- NSNumber *width = offset[@""width""]; +- if (nil == width) { +- width = offset[@""x""]; +- } +- NSNumber *height = offset[@""height""]; +- if (nil == height) { +- height = offset[@""y""]; +- } +- view.layer.shadowOffset = CGSizeMake([width floatValue], [height floatValue]); +- } +-} +- +-HIPPY_CUSTOM_VIEW_PROPERTY(overflow, OverflowType, HippyView) { +- if (json) { +- view.clipsToBounds = [HippyConvert OverflowType:json] != OverflowVisible; +- } else { +- view.clipsToBounds = defaultView.clipsToBounds; +- } +-} +-HIPPY_CUSTOM_VIEW_PROPERTY(shouldRasterizeIOS, BOOL, HippyView) { +- view.layer.shouldRasterize = json ? [HippyConvert BOOL:json] : defaultView.layer.shouldRasterize; +- view.layer.rasterizationScale = view.layer.shouldRasterize ? [UIScreen mainScreen].scale : defaultView.layer.rasterizationScale; +-} +- +-HIPPY_CUSTOM_VIEW_PROPERTY(transform, CATransform3D, HippyView) { +- view.layer.transform = json ? [HippyConvert CATransform3D:json] : defaultView.layer.transform; +- view.layer.allowsEdgeAntialiasing = !CATransform3DIsIdentity(view.layer.transform); +-} +-HIPPY_CUSTOM_VIEW_PROPERTY(pointerEvents, HippyPointerEvents, HippyView) { +- if ([view respondsToSelector:@selector(setPointerEvents:)]) { +- view.pointerEvents = json ? [HippyConvert HippyPointerEvents:json] : defaultView.pointerEvents; +- return; +- } +- +- if (!json) { +- view.userInteractionEnabled = defaultView.userInteractionEnabled; +- return; +- } +- +- switch ([HippyConvert HippyPointerEvents:json]) { +- case HippyPointerEventsUnspecified: +- // Pointer events ""unspecified"" acts as if a stylesheet had not specified, +- // which is different than ""auto"" in CSS (which cannot and will not be +- // supported in `Hippy`. ""auto"" may override a parent's ""none"". +- // Unspecified values do not. +- // This wouldn't override a container view's `userInteractionEnabled = NO` +- view.userInteractionEnabled = YES; +- break; +- case HippyPointerEventsNone: +- view.userInteractionEnabled = NO; +- break; +- default: +- //HippyLogError(@""UIView base class does not support pointerEvent value: %@"", json); +- break; +- } +-} +- +-HIPPY_CUSTOM_VIEW_PROPERTY(borderRadius, CGFloat, HippyView) { +- if ([view respondsToSelector:@selector(setBorderRadius:)]) { +- view.borderRadius = json ? [HippyConvert CGFloat:json] : defaultView.borderRadius; +- } else { +- view.layer.cornerRadius = json ? [HippyConvert CGFloat:json] : defaultView.layer.cornerRadius; +- } +-} +-HIPPY_CUSTOM_VIEW_PROPERTY(borderColor, CGColor, HippyView) { +- if ([view respondsToSelector:@selector(setBorderColor:)]) { +- view.borderColor = json ? [HippyConvert CGColor:json] : defaultView.borderColor; +- } else { +- view.layer.borderColor = json ? [HippyConvert CGColor:json] : defaultView.layer.borderColor; +- } +-} +- +-HIPPY_CUSTOM_VIEW_PROPERTY(borderWidth, CGFloat, HippyView) { +- if ([view respondsToSelector:@selector(setBorderWidth:)]) { +- view.borderWidth = json ? [HippyConvert CGFloat:json] : defaultView.borderWidth; +- } else { +- view.layer.borderWidth = json ? [HippyConvert CGFloat:json] : defaultView.layer.borderWidth; +- } +-} +-HIPPY_CUSTOM_VIEW_PROPERTY(borderStyle, HippyBorderStyle, HippyView) { +- if ([view respondsToSelector:@selector(setBorderStyle:)]) { +- view.borderStyle = json ? [HippyConvert HippyBorderStyle:json] : defaultView.borderStyle; +- } +-} +- +-#define HIPPY_VIEW_BORDER_PROPERTY(SIDE) \ +- HIPPY_CUSTOM_VIEW_PROPERTY(border##SIDE##Width, CGFloat, HippyView) { \ +- if ([view respondsToSelector:@selector(setBorder##SIDE##Width:)]) { \ +- view.border##SIDE##Width = json ? [HippyConvert CGFloat:json] : defaultView.border##SIDE##Width; \ +- } \ +- } \ +- HIPPY_CUSTOM_VIEW_PROPERTY(border##SIDE##Color, UIColor, HippyView) { \ +- if ([view respondsToSelector:@selector(setBorder##SIDE##Color:)]) { \ +- view.border##SIDE##Color = json ? [HippyConvert CGColor:json] : defaultView.border##SIDE##Color; \ +- } \ +- } +- +-HIPPY_VIEW_BORDER_PROPERTY(Top) +-HIPPY_VIEW_BORDER_PROPERTY(Right) +-HIPPY_VIEW_BORDER_PROPERTY(Bottom) +-HIPPY_VIEW_BORDER_PROPERTY(Left) +- +-#define HIPPY_VIEW_BORDER_RADIUS_PROPERTY(SIDE) \ +- HIPPY_CUSTOM_VIEW_PROPERTY(border##SIDE##Radius, CGFloat, HippyView) { \ +- if ([view respondsToSelector:@selector(setBorder##SIDE##Radius:)]) { \ +- view.border##SIDE##Radius = json ? [HippyConvert CGFloat:json] : defaultView.border##SIDE##Radius; \ +- } \ +- } +- +-HIPPY_VIEW_BORDER_RADIUS_PROPERTY(TopLeft) +-HIPPY_VIEW_BORDER_RADIUS_PROPERTY(TopRight) +-HIPPY_VIEW_BORDER_RADIUS_PROPERTY(BottomLeft) +-HIPPY_VIEW_BORDER_RADIUS_PROPERTY(BottomRight) +- +-HIPPY_REMAP_VIEW_PROPERTY(zIndex, hippyZIndex, NSInteger) +- +-#pragma mark - ShadowView properties +- +-HIPPY_EXPORT_SHADOW_PROPERTY(backgroundColor, UIColor) +- +-HIPPY_EXPORT_SHADOW_PROPERTY(top, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(right, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(bottom, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(left, CGFloat); +- +-HIPPY_EXPORT_SHADOW_PROPERTY(width, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(height, CGFloat) +- +-HIPPY_EXPORT_SHADOW_PROPERTY(minWidth, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(maxWidth, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(minHeight, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(maxHeight, CGFloat) +- +-HIPPY_EXPORT_SHADOW_PROPERTY(borderTopWidth, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(borderRightWidth, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(borderBottomWidth, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(borderLeftWidth, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(borderWidth, CGFloat) +- +-HIPPY_EXPORT_SHADOW_PROPERTY(marginTop, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(marginRight, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(marginBottom, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(marginLeft, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(marginVertical, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(marginHorizontal, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(margin, CGFloat) +- +-HIPPY_EXPORT_SHADOW_PROPERTY(paddingTop, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(paddingRight, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(paddingBottom, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(paddingLeft, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(paddingVertical, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(paddingHorizontal, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(padding, CGFloat) +- +-HIPPY_EXPORT_SHADOW_PROPERTY(flex, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(flexGrow, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(flexShrink, CGFloat) +-HIPPY_EXPORT_SHADOW_PROPERTY(flexBasis, CGFloat) +- +-// hplayout +-HIPPY_EXPORT_SHADOW_PROPERTY(flexDirection, FlexDirection) +-HIPPY_EXPORT_SHADOW_PROPERTY(flexWrap, FlexWrapMode) +-HIPPY_EXPORT_SHADOW_PROPERTY(justifyContent, FlexAlign) +-HIPPY_EXPORT_SHADOW_PROPERTY(alignItems, FlexAlign) +-HIPPY_EXPORT_SHADOW_PROPERTY(alignSelf, FlexAlign) +-HIPPY_EXPORT_SHADOW_PROPERTY(position, PositionType) +- +-HIPPY_REMAP_SHADOW_PROPERTY(display, displayType, DisplayType) +- +-HIPPY_EXPORT_SHADOW_PROPERTY(overflow, OverflowType) +- +-HIPPY_EXPORT_SHADOW_PROPERTY(onLayout, HippyDirectEventBlock) +- +-HIPPY_EXPORT_VIEW_PROPERTY(onClick, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onLongClick, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onPressIn, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onPressOut, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onTouchDown, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onTouchMove, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onTouchEnd, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onTouchCancel, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onDidMount, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onDidUnmount, HippyDirectEventBlock) +- +-HIPPY_EXPORT_SHADOW_PROPERTY(zIndex, NSInteger) +- +-- (HPDirection)convertDirection:(NSString *)direction { +- if ([direction isEqualToString:@""rtl""]) { +- return DirectionRTL; +- } +- else if ([direction isEqualToString:@""ltr""]) { +- return DirectionLTR; +- } +- else { +- return DirectionInherit; +- } +-} +- +-//HIPPY_CUSTOM_VIEW_PROPERTY(direction, id, UIView) { +-// if (json) { +-// view.layoutDirection = [self convertDirection:json]; +-// } +-//} +- +-HIPPY_CUSTOM_SHADOW_PROPERTY(direction, id, HippyShadowView) { +- if (json) { +- view.layoutDirection = [self convertDirection:json]; +- } +-} +- +-@end +- +-#import +- +-static const char *init_props_identifier = ""init_props_identifier""; +- +-@implementation HippyViewManager (InitProps) +- +-- (NSDictionary *)props { +- return objc_getAssociatedObject(self, init_props_identifier); +-} +- +-- (void)setProps:(NSDictionary *)props { +- if (props == nil) { +- return; +- } +- objc_setAssociatedObject(self, init_props_identifier, props, OBJC_ASSOCIATION_RETAIN); +-} +- +-@end +diff --git a/renderer/native/ios/renderer/component/view/HippyBorderDrawing.h b/renderer/native/ios/renderer/component/view/NativeRenderBorderDrawing.h +similarity index 55% +rename from renderer/native/ios/renderer/component/view/HippyBorderDrawing.h +rename to renderer/native/ios/renderer/component/view/NativeRenderBorderDrawing.h +index c5a728f71d0..10820cf1dd4 100644 +--- a/renderer/native/ios/renderer/component/view/HippyBorderDrawing.h ++++ b/renderer/native/ios/renderer/component/view/NativeRenderBorderDrawing.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,48 +21,48 @@ + */ + + #import +-#import ""HippyBorderStyle.h"" +-#import ""HippyDefines.h"" ++#import ""NativeRenderBorderStyle.h"" ++#import ""NativeRenderDefines.h"" + + typedef struct { + CGFloat topLeft; + CGFloat topRight; + CGFloat bottomLeft; + CGFloat bottomRight; +-} HippyCornerRadii; ++} NativeRenderCornerRadii; + + typedef struct { + CGSize topLeft; + CGSize topRight; + CGSize bottomLeft; + CGSize bottomRight; +-} HippyCornerInsets; ++} NativeRenderCornerInsets; + + typedef struct { + CGColorRef top; + CGColorRef left; + CGColorRef bottom; + CGColorRef right; +-} HippyBorderColors; ++} NativeRenderBorderColors; + + /** + * Determine if the border widths, colors and radii are all equal. + */ +-HIPPY_EXTERN BOOL HippyBorderInsetsAreEqual(UIEdgeInsets borderInsets); +-HIPPY_EXTERN BOOL HippyCornerRadiiAreEqual(HippyCornerRadii cornerRadii); +-HIPPY_EXTERN BOOL HippyBorderColorsAreEqual(HippyBorderColors borderColors); ++NATIVE_RENDER_EXTERN BOOL NativeRenderBorderInsetsAreEqual(UIEdgeInsets borderInsets); ++NATIVE_RENDER_EXTERN BOOL NativeRenderCornerRadiiAreEqual(NativeRenderCornerRadii cornerRadii); ++NATIVE_RENDER_EXTERN BOOL NativeRenderBorderColorsAreEqual(NativeRenderBorderColors borderColors); + + /** +- * Convert HippyCornerRadii to HippyCornerInsets by applying border insets. ++ * Convert NativeRenderCornerRadii to NativeRenderCornerInsets by applying border insets. + * Effectively, returns radius - inset, with a lower bound of 0.0. + */ +-HIPPY_EXTERN HippyCornerInsets HippyGetCornerInsets(HippyCornerRadii cornerRadii, UIEdgeInsets borderInsets); ++NATIVE_RENDER_EXTERN NativeRenderCornerInsets NativeRenderGetCornerInsets(NativeRenderCornerRadii cornerRadii, UIEdgeInsets borderInsets); + + /** + * Create a CGPath representing a rounded rectangle with the specified bounds + * and corner insets. Note that the CGPathRef must be released by the caller. + */ +-HIPPY_EXTERN CGPathRef HippyPathCreateWithRoundedRect(CGRect bounds, HippyCornerInsets cornerInsets, const CGAffineTransform *transform); ++NATIVE_RENDER_EXTERN CGPathRef NativeRenderPathCreateWithRoundedRect(CGRect bounds, NativeRenderCornerInsets cornerInsets, const CGAffineTransform *transform); + + /** + * Draw a CSS-compliant border as an image. You can determine if it's scalable +@@ -70,7 +70,7 @@ HIPPY_EXTERN CGPathRef HippyPathCreateWithRoundedRect(CGRect bounds, HippyCorner + * + * `borderInsets` defines the border widths for each edge. + */ +-HIPPY_EXTERN UIImage *HippyGetBorderImage(HippyBorderStyle borderStyle, CGSize viewSize, HippyCornerRadii cornerRadii, UIEdgeInsets borderInsets, +- HippyBorderColors borderColors, CGColorRef backgroundColor, BOOL drawToEdge, BOOL drawBackgroundColor); ++NATIVE_RENDER_EXTERN UIImage *NativeRenderGetBorderImage(NativeRenderBorderStyle borderStyle, CGSize viewSize, NativeRenderCornerRadii cornerRadii, UIEdgeInsets borderInsets, ++ NativeRenderBorderColors borderColors, CGColorRef backgroundColor, BOOL drawToEdge, BOOL drawBackgroundColor); + +-HIPPY_EXTERN CGPathRef HippyPathCreateOuterOutline(BOOL drawToEdge, CGRect rect, HippyCornerRadii cornerRadii); ++NATIVE_RENDER_EXTERN CGPathRef NativeRenderPathCreateOuterOutline(BOOL drawToEdge, CGRect rect, NativeRenderCornerRadii cornerRadii); +diff --git a/renderer/native/ios/renderer/component/view/HippyBorderDrawing.m b/renderer/native/ios/renderer/component/view/NativeRenderBorderDrawing.m +similarity index 73% +rename from renderer/native/ios/renderer/component/view/HippyBorderDrawing.m +rename to renderer/native/ios/renderer/component/view/NativeRenderBorderDrawing.m +index 9b923b43e71..fb58aa6ba5b 100644 +--- a/renderer/native/ios/renderer/component/view/HippyBorderDrawing.m ++++ b/renderer/native/ios/renderer/component/view/NativeRenderBorderDrawing.m +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,29 +20,29 @@ + * limitations under the License. + */ + +-#import ""HippyBorderDrawing.h"" ++#import ""NativeRenderBorderDrawing.h"" + +-static const CGFloat HippyViewBorderThreshold = 0.001; ++static const CGFloat NativeRenderViewBorderThreshold = 0.001; + +-BOOL HippyBorderInsetsAreEqual(UIEdgeInsets borderInsets) { +- return ABS(borderInsets.left - borderInsets.right) < HippyViewBorderThreshold +- && ABS(borderInsets.left - borderInsets.bottom) < HippyViewBorderThreshold +- && ABS(borderInsets.left - borderInsets.top) < HippyViewBorderThreshold; ++BOOL NativeRenderBorderInsetsAreEqual(UIEdgeInsets borderInsets) { ++ return ABS(borderInsets.left - borderInsets.right) < NativeRenderViewBorderThreshold ++ && ABS(borderInsets.left - borderInsets.bottom) < NativeRenderViewBorderThreshold ++ && ABS(borderInsets.left - borderInsets.top) < NativeRenderViewBorderThreshold; + } + +-BOOL HippyCornerRadiiAreEqual(HippyCornerRadii cornerRadii) { +- return ABS(cornerRadii.topLeft - cornerRadii.topRight) < HippyViewBorderThreshold +- && ABS(cornerRadii.topLeft - cornerRadii.bottomLeft) < HippyViewBorderThreshold +- && ABS(cornerRadii.topLeft - cornerRadii.bottomRight) < HippyViewBorderThreshold; ++BOOL NativeRenderCornerRadiiAreEqual(NativeRenderCornerRadii cornerRadii) { ++ return ABS(cornerRadii.topLeft - cornerRadii.topRight) < NativeRenderViewBorderThreshold ++ && ABS(cornerRadii.topLeft - cornerRadii.bottomLeft) < NativeRenderViewBorderThreshold ++ && ABS(cornerRadii.topLeft - cornerRadii.bottomRight) < NativeRenderViewBorderThreshold; + } + +-BOOL HippyBorderColorsAreEqual(HippyBorderColors borderColors) { ++BOOL NativeRenderBorderColorsAreEqual(NativeRenderBorderColors borderColors) { + return CGColorEqualToColor(borderColors.left, borderColors.right) && CGColorEqualToColor(borderColors.left, borderColors.top) + && CGColorEqualToColor(borderColors.left, borderColors.bottom); + } + +-HippyCornerInsets HippyGetCornerInsets(HippyCornerRadii cornerRadii, UIEdgeInsets edgeInsets) { +- return (HippyCornerInsets) { { ++NativeRenderCornerInsets NativeRenderGetCornerInsets(NativeRenderCornerRadii cornerRadii, UIEdgeInsets edgeInsets) { ++ return (NativeRenderCornerInsets) { { + MAX(0, cornerRadii.topLeft - edgeInsets.left), + MAX(0, cornerRadii.topLeft - edgeInsets.top), + }, +@@ -60,7 +60,7 @@ HippyCornerInsets HippyGetCornerInsets(HippyCornerRadii cornerRadii, UIEdgeInset + } }; + } + +-static void HippyPathAddEllipticArc( ++static void NativeRenderPathAddEllipticArc( + CGMutablePathRef path, const CGAffineTransform *m, CGPoint origin, CGSize size, CGFloat startAngle, CGFloat endAngle, BOOL clockwise) { + CGFloat xScale = 1, yScale = 1, radius = 0; + if (size.width != 0) { +@@ -82,7 +82,7 @@ static void HippyPathAddEllipticArc( + CGPathAddArc(path, &t, 0, 0, radius, startAngle, endAngle, clockwise); + } + +-CGPathRef HippyPathCreateWithRoundedRect(CGRect bounds, HippyCornerInsets cornerInsets, const CGAffineTransform *transform) { ++CGPathRef NativeRenderPathCreateWithRoundedRect(CGRect bounds, NativeRenderCornerInsets cornerInsets, const CGAffineTransform *transform) { + const CGFloat minX = CGRectGetMinX(bounds); + const CGFloat minY = CGRectGetMinY(bounds); + const CGFloat maxX = CGRectGetMaxX(bounds); +@@ -106,15 +106,15 @@ CGPathRef HippyPathCreateWithRoundedRect(CGRect bounds, HippyCornerInsets corner + }; + + CGMutablePathRef path = CGPathCreateMutable(); +- HippyPathAddEllipticArc(path, transform, (CGPoint) { minX + topLeft.width, minY + topLeft.height }, topLeft, M_PI, 3 * M_PI_2, NO); +- HippyPathAddEllipticArc(path, transform, (CGPoint) { maxX - topRight.width, minY + topRight.height }, topRight, 3 * M_PI_2, 0, NO); +- HippyPathAddEllipticArc(path, transform, (CGPoint) { maxX - bottomRight.width, maxY - bottomRight.height }, bottomRight, 0, M_PI_2, NO); +- HippyPathAddEllipticArc(path, transform, (CGPoint) { minX + bottomLeft.width, maxY - bottomLeft.height }, bottomLeft, M_PI_2, M_PI, NO); ++ NativeRenderPathAddEllipticArc(path, transform, (CGPoint) { minX + topLeft.width, minY + topLeft.height }, topLeft, M_PI, 3 * M_PI_2, NO); ++ NativeRenderPathAddEllipticArc(path, transform, (CGPoint) { maxX - topRight.width, minY + topRight.height }, topRight, 3 * M_PI_2, 0, NO); ++ NativeRenderPathAddEllipticArc(path, transform, (CGPoint) { maxX - bottomRight.width, maxY - bottomRight.height }, bottomRight, 0, M_PI_2, NO); ++ NativeRenderPathAddEllipticArc(path, transform, (CGPoint) { minX + bottomLeft.width, maxY - bottomLeft.height }, bottomLeft, M_PI_2, M_PI, NO); + CGPathCloseSubpath(path); + return path; + } + +-static void HippyEllipseGetIntersectionsWithLine(CGRect ellipseBounds, CGPoint lineStart, CGPoint lineEnd, CGPoint intersections[2]) { ++static void NativeRenderEllipseGetIntersectionsWithLine(CGRect ellipseBounds, CGPoint lineStart, CGPoint lineEnd, CGPoint intersections[2]) { + const CGPoint ellipseCenter = { CGRectGetMidX(ellipseBounds), CGRectGetMidY(ellipseBounds) }; + + lineStart.x -= ellipseCenter.x; +@@ -140,30 +140,30 @@ static void HippyEllipseGetIntersectionsWithLine(CGRect ellipseBounds, CGPoint l + intersections[1] = (CGPoint) { x2 + ellipseCenter.x, y2 + ellipseCenter.y }; + } + +-NS_INLINE BOOL HippyCornerRadiiAreAboveThreshold(HippyCornerRadii cornerRadii) { +- return (cornerRadii.topLeft > HippyViewBorderThreshold || cornerRadii.topRight > HippyViewBorderThreshold +- || cornerRadii.bottomLeft > HippyViewBorderThreshold || cornerRadii.bottomRight > HippyViewBorderThreshold); ++NS_INLINE BOOL NativeRenderCornerRadiiAreAboveThreshold(NativeRenderCornerRadii cornerRadii) { ++ return (cornerRadii.topLeft > NativeRenderViewBorderThreshold || cornerRadii.topRight > NativeRenderViewBorderThreshold ++ || cornerRadii.bottomLeft > NativeRenderViewBorderThreshold || cornerRadii.bottomRight > NativeRenderViewBorderThreshold); + } + +-CGPathRef HippyPathCreateOuterOutline(BOOL drawToEdge, CGRect rect, HippyCornerRadii cornerRadii) { ++CGPathRef NativeRenderPathCreateOuterOutline(BOOL drawToEdge, CGRect rect, NativeRenderCornerRadii cornerRadii) { + if (drawToEdge) { + return CGPathCreateWithRect(rect, NULL); + } + +- return HippyPathCreateWithRoundedRect(rect, HippyGetCornerInsets(cornerRadii, UIEdgeInsetsZero), NULL); ++ return NativeRenderPathCreateWithRoundedRect(rect, NativeRenderGetCornerInsets(cornerRadii, UIEdgeInsetsZero), NULL); + } + +-static CGContextRef HippyUIGraphicsBeginImageContext(CGSize size, CGColorRef backgroundColor, BOOL hasCornerRadii, BOOL drawToEdge) { ++static CGContextRef NativeRenderUIGraphicsBeginImageContext(CGSize size, CGColorRef backgroundColor, BOOL hasCornerRadii, BOOL drawToEdge) { + const CGFloat alpha = CGColorGetAlpha(backgroundColor); + const BOOL opaque = (drawToEdge || !hasCornerRadii) && alpha == 1.0; + UIGraphicsBeginImageContextWithOptions(size, opaque, 0.0); + return UIGraphicsGetCurrentContext(); + } + +-static UIImage *HippyGetSolidBorderImage(HippyCornerRadii cornerRadii, CGSize viewSize, UIEdgeInsets borderInsets, HippyBorderColors borderColors, ++static UIImage *NativeRenderGetSolidBorderImage(NativeRenderCornerRadii cornerRadii, CGSize viewSize, UIEdgeInsets borderInsets, NativeRenderBorderColors borderColors, + CGColorRef backgroundColor, BOOL drawToEdge, BOOL drawBackgrondColor) { +- const BOOL hasCornerRadii = HippyCornerRadiiAreAboveThreshold(cornerRadii); +- const HippyCornerInsets cornerInsets = HippyGetCornerInsets(cornerRadii, borderInsets); ++ const BOOL hasCornerRadii = NativeRenderCornerRadiiAreAboveThreshold(cornerRadii); ++ const NativeRenderCornerInsets cornerInsets = NativeRenderGetCornerInsets(cornerRadii, borderInsets); + + const BOOL makeStretchable + = (borderInsets.left + cornerInsets.topLeft.width + borderInsets.right + cornerInsets.bottomRight.width <= viewSize.width) +@@ -182,9 +182,9 @@ static CGContextRef HippyUIGraphicsBeginImageContext(CGSize size, CGColorRef bac + edgeInsets.top + 1 + edgeInsets.bottom + } : viewSize; + +- CGContextRef ctx = HippyUIGraphicsBeginImageContext(size, backgroundColor, hasCornerRadii, drawToEdge); ++ CGContextRef ctx = NativeRenderUIGraphicsBeginImageContext(size, backgroundColor, hasCornerRadii, drawToEdge); + const CGRect rect = { .size = size }; +- CGPathRef path = HippyPathCreateOuterOutline(drawToEdge, rect, cornerRadii); ++ CGPathRef path = NativeRenderPathCreateOuterOutline(drawToEdge, rect, cornerRadii); + + if (backgroundColor) { + if (!drawBackgrondColor) { +@@ -198,12 +198,12 @@ static CGContextRef HippyUIGraphicsBeginImageContext(CGSize size, CGColorRef bac + CGContextAddPath(ctx, path); + CGPathRelease(path); + +- CGPathRef insetPath = HippyPathCreateWithRoundedRect(UIEdgeInsetsInsetRect(rect, borderInsets), cornerInsets, NULL); ++ CGPathRef insetPath = NativeRenderPathCreateWithRoundedRect(UIEdgeInsetsInsetRect(rect, borderInsets), cornerInsets, NULL); + + CGContextAddPath(ctx, insetPath); + CGContextEOClip(ctx); + +- BOOL hasEqualColors = HippyBorderColorsAreEqual(borderColors); ++ BOOL hasEqualColors = NativeRenderBorderColorsAreEqual(borderColors); + if ((drawToEdge || !hasCornerRadii) && hasEqualColors) { + CGContextSetFillColorWithColor(ctx, borderColors.left); + CGContextAddRect(ctx, rect); +@@ -214,7 +214,7 @@ static CGContextRef HippyUIGraphicsBeginImageContext(CGSize size, CGColorRef bac + CGPoint topLeft = (CGPoint) { borderInsets.left, borderInsets.top }; + if (cornerInsets.topLeft.width > 0 && cornerInsets.topLeft.height > 0) { + CGPoint points[2]; +- HippyEllipseGetIntersectionsWithLine( ++ NativeRenderEllipseGetIntersectionsWithLine( + (CGRect) { topLeft, { 2 * cornerInsets.topLeft.width, 2 * cornerInsets.topLeft.height } }, CGPointZero, topLeft, points); + if (!isnan(points[1].x) && !isnan(points[1].y)) { + topLeft = points[1]; +@@ -224,7 +224,7 @@ static CGContextRef HippyUIGraphicsBeginImageContext(CGSize size, CGColorRef bac + CGPoint bottomLeft = (CGPoint) { borderInsets.left, size.height - borderInsets.bottom }; + if (cornerInsets.bottomLeft.width > 0 && cornerInsets.bottomLeft.height > 0) { + CGPoint points[2]; +- HippyEllipseGetIntersectionsWithLine((CGRect) { { bottomLeft.x, bottomLeft.y - 2 * cornerInsets.bottomLeft.height }, ++ NativeRenderEllipseGetIntersectionsWithLine((CGRect) { { bottomLeft.x, bottomLeft.y - 2 * cornerInsets.bottomLeft.height }, + { 2 * cornerInsets.bottomLeft.width, 2 * cornerInsets.bottomLeft.height } }, + (CGPoint) { 0, size.height }, bottomLeft, points); + if (!isnan(points[1].x) && !isnan(points[1].y)) { +@@ -235,7 +235,7 @@ static CGContextRef HippyUIGraphicsBeginImageContext(CGSize size, CGColorRef bac + CGPoint topRight = (CGPoint) { size.width - borderInsets.right, borderInsets.top }; + if (cornerInsets.topRight.width > 0 && cornerInsets.topRight.height > 0) { + CGPoint points[2]; +- HippyEllipseGetIntersectionsWithLine((CGRect) { { topRight.x - 2 * cornerInsets.topRight.width, topRight.y }, ++ NativeRenderEllipseGetIntersectionsWithLine((CGRect) { { topRight.x - 2 * cornerInsets.topRight.width, topRight.y }, + { 2 * cornerInsets.topRight.width, 2 * cornerInsets.topRight.height } }, + (CGPoint) { size.width, 0 }, topRight, points); + if (!isnan(points[0].x) && !isnan(points[0].y)) { +@@ -246,7 +246,7 @@ static CGContextRef HippyUIGraphicsBeginImageContext(CGSize size, CGColorRef bac + CGPoint bottomRight = (CGPoint) { size.width - borderInsets.right, size.height - borderInsets.bottom }; + if (cornerInsets.bottomRight.width > 0 && cornerInsets.bottomRight.height > 0) { + CGPoint points[2]; +- HippyEllipseGetIntersectionsWithLine( ++ NativeRenderEllipseGetIntersectionsWithLine( + (CGRect) { { bottomRight.x - 2 * cornerInsets.bottomRight.width, bottomRight.y - 2 * cornerInsets.bottomRight.height }, + { 2 * cornerInsets.bottomRight.width, 2 * cornerInsets.bottomRight.height } }, + (CGPoint) { size.width, size.height }, bottomRight, points); +@@ -397,12 +397,12 @@ static CGContextRef HippyUIGraphicsBeginImageContext(CGSize size, CGColorRef bac + // of gradients _along_ a path (NB: clipping a path and drawing a linear gradient + // is _not_ equivalent). + +-static UIImage *HippyGetDashedOrDottedBorderImage(HippyBorderStyle borderStyle, HippyCornerRadii cornerRadii, CGSize viewSize, +- UIEdgeInsets borderInsets, HippyBorderColors borderColors, CGColorRef backgroundColor, BOOL drawToEdge, BOOL drawBackgrondColor) { +- NSCParameterAssert(borderStyle == HippyBorderStyleDashed || borderStyle == HippyBorderStyleDotted); ++static UIImage *NativeRenderGetDashedOrDottedBorderImage(NativeRenderBorderStyle borderStyle, NativeRenderCornerRadii cornerRadii, CGSize viewSize, ++ UIEdgeInsets borderInsets, NativeRenderBorderColors borderColors, CGColorRef backgroundColor, BOOL drawToEdge, BOOL drawBackgrondColor) { ++ NSCParameterAssert(borderStyle == NativeRenderBorderStyleDashed || borderStyle == NativeRenderBorderStyleDotted); + +- if (!HippyBorderColorsAreEqual(borderColors) || !HippyBorderInsetsAreEqual(borderInsets)) { +- //HippyLogWarn(@""Unsupported dashed / dotted border style""); ++ if (!NativeRenderBorderColorsAreEqual(borderColors) || !NativeRenderBorderInsetsAreEqual(borderInsets)) { ++ //NativeRenderLogWarn(@""Unsupported dashed / dotted border style""); + return nil; + } + +@@ -411,12 +411,12 @@ static CGContextRef HippyUIGraphicsBeginImageContext(CGSize size, CGColorRef bac + return nil; + } + +- const BOOL hasCornerRadii = HippyCornerRadiiAreAboveThreshold(cornerRadii); +- CGContextRef ctx = HippyUIGraphicsBeginImageContext(viewSize, backgroundColor, hasCornerRadii, drawToEdge); ++ const BOOL hasCornerRadii = NativeRenderCornerRadiiAreAboveThreshold(cornerRadii); ++ CGContextRef ctx = NativeRenderUIGraphicsBeginImageContext(viewSize, backgroundColor, hasCornerRadii, drawToEdge); + const CGRect rect = { .size = viewSize }; + + if (backgroundColor) { +- CGPathRef outerPath = HippyPathCreateOuterOutline(drawToEdge, rect, cornerRadii); ++ CGPathRef outerPath = NativeRenderPathCreateOuterOutline(drawToEdge, rect, cornerRadii); + CGContextAddPath(ctx, outerPath); + CGPathRelease(outerPath); + if (!drawBackgrondColor) { +@@ -430,10 +430,10 @@ static CGContextRef HippyUIGraphicsBeginImageContext(CGSize size, CGColorRef bac + // perpendicular to the path, that's why we inset by half the width, so that it + // reaches the edge of the rect. + CGRect pathRect = CGRectInset(rect, lineWidth / 2.0, lineWidth / 2.0); +- CGPathRef path = HippyPathCreateWithRoundedRect(pathRect, HippyGetCornerInsets(cornerRadii, UIEdgeInsetsZero), NULL); ++ CGPathRef path = NativeRenderPathCreateWithRoundedRect(pathRect, NativeRenderGetCornerInsets(cornerRadii, UIEdgeInsetsZero), NULL); + + CGFloat dashLengths[2]; +- dashLengths[0] = dashLengths[1] = (borderStyle == HippyBorderStyleDashed ? 3 : 1) * lineWidth; ++ dashLengths[0] = dashLengths[1] = (borderStyle == NativeRenderBorderStyleDashed ? 3 : 1) * lineWidth; + + CGContextSetLineWidth(ctx, lineWidth); + CGContextSetLineDash(ctx, 0, dashLengths, sizeof(dashLengths) / sizeof(*dashLengths)); +@@ -452,15 +452,15 @@ static CGContextRef HippyUIGraphicsBeginImageContext(CGSize size, CGColorRef bac + return image; + } + +-UIImage *HippyGetBorderImage(HippyBorderStyle borderStyle, CGSize viewSize, HippyCornerRadii cornerRadii, UIEdgeInsets borderInsets, +- HippyBorderColors borderColors, CGColorRef backgroundColor, BOOL drawToEdge, BOOL drawBackgrondColor) { ++UIImage *NativeRenderGetBorderImage(NativeRenderBorderStyle borderStyle, CGSize viewSize, NativeRenderCornerRadii cornerRadii, UIEdgeInsets borderInsets, ++ NativeRenderBorderColors borderColors, CGColorRef backgroundColor, BOOL drawToEdge, BOOL drawBackgrondColor) { + switch (borderStyle) { +- case HippyBorderStyleSolid: +- return HippyGetSolidBorderImage(cornerRadii, viewSize, borderInsets, borderColors, backgroundColor, drawToEdge, drawBackgrondColor); +- case HippyBorderStyleDashed: +- case HippyBorderStyleDotted: +- return HippyGetDashedOrDottedBorderImage(borderStyle, cornerRadii, viewSize, borderInsets, borderColors, backgroundColor, drawToEdge, drawBackgrondColor); +- case HippyBorderStyleNone: ++ case NativeRenderBorderStyleSolid: ++ return NativeRenderGetSolidBorderImage(cornerRadii, viewSize, borderInsets, borderColors, backgroundColor, drawToEdge, drawBackgrondColor); ++ case NativeRenderBorderStyleDashed: ++ case NativeRenderBorderStyleDotted: ++ return NativeRenderGetDashedOrDottedBorderImage(borderStyle, cornerRadii, viewSize, borderInsets, borderColors, backgroundColor, drawToEdge, drawBackgrondColor); ++ case NativeRenderBorderStyleNone: + break; + } + +diff --git a/renderer/native/ios/renderer/component/view/HippyBorderStyle.h b/renderer/native/ios/renderer/component/view/NativeRenderBorderStyle.h +similarity index 77% +rename from renderer/native/ios/renderer/component/view/HippyBorderStyle.h +rename to renderer/native/ios/renderer/component/view/NativeRenderBorderStyle.h +index cb491d9a62f..5d7fff99fb1 100644 +--- a/renderer/native/ios/renderer/component/view/HippyBorderStyle.h ++++ b/renderer/native/ios/renderer/component/view/NativeRenderBorderStyle.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -22,9 +22,9 @@ + + #import + +-typedef NS_ENUM(NSInteger, HippyBorderStyle) { +- HippyBorderStyleSolid, +- HippyBorderStyleDotted, +- HippyBorderStyleDashed, +- HippyBorderStyleNone, ++typedef NS_ENUM(NSInteger, NativeRenderBorderStyle) { ++ NativeRenderBorderStyleSolid, ++ NativeRenderBorderStyleDotted, ++ NativeRenderBorderStyleDashed, ++ NativeRenderBorderStyleNone, + }; +diff --git a/renderer/native/ios/renderer/component/view/HippyShadowView.h b/renderer/native/ios/renderer/component/view/NativeRenderObjectView.h +similarity index 62% +rename from renderer/native/ios/renderer/component/view/HippyShadowView.h +rename to renderer/native/ios/renderer/component/view/NativeRenderObjectView.h +index 943f61d1799..25dc27aff48 100644 +--- a/renderer/native/ios/renderer/component/view/HippyShadowView.h ++++ b/renderer/native/ios/renderer/component/view/NativeRenderObjectView.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,63 +21,62 @@ + */ + + #import +-#import ""HippyDomNodeUtils.h"" +-#import ""HippyComponent.h"" ++#import ""NativeRenderDomNodeUtils.h"" ++#import ""NativeRenderComponentProtocol.h"" + #include ""dom/dom_listener.h"" + #include ""dom/dom_node.h"" + #include ""dom/layout_node.h"" + #include ""dom/root_node.h"" +-#include ""Hippy.h"" + #include ""Flex.h"" +-#import ""HippyDefines.h"" + +-typedef NS_ENUM(NSUInteger, HippyUpdateLifecycle) { +- HippyUpdateLifecycleUninitialized = 0, +- HippyUpdateLifecycleComputed, +- HippyUpdateLifecycleDirtied, ++typedef NS_ENUM(NSUInteger, NativeRenderUpdateLifecycle) { ++ NativeRenderUpdateLifecycleUninitialized = 0, ++ NativeRenderUpdateLifecycleComputed, ++ NativeRenderUpdateLifecycleDirtied, + }; + +-typedef NS_ENUM(NSUInteger, HippyCreationType) { +- HippyCreationTypeUndetermined = 0, +- HippyCreationTypeInstantly, +- HippyCreationTypeLazily, ++typedef NS_ENUM(NSUInteger, NativeRenderCreationType) { ++ NativeRenderCreationTypeUndetermined = 0, ++ NativeRenderCreationTypeInstantly, ++ NativeRenderCreationTypeLazily, + }; + +-@class HippyShadowView; ++@class NativeRenderObjectView; + +-typedef void (^HippyApplierBlock)(NSDictionary *viewRegistry); ++typedef void (^NativeRenderApplierBlock)(NSDictionary *viewRegistry); + +-typedef UIView *(^HippyViewCreationBlock)(HippyShadowView *shadowView); +-typedef void (^HippyViewInsertionBlock)(UIView *container, NSArray *children); ++typedef UIView *(^NativeRenderViewCreationBlock)(NativeRenderObjectView *renderObject); ++typedef void (^NativeRenderViewInsertionBlock)(UIView *container, NSArray *children); + +-extern NSString *const HippyShadowViewDiffInsertion; +-extern NSString *const HippyShadowViewDiffRemove; +-extern NSString *const HippyShadowViewDiffUpdate; +-extern NSString *const HippyShadowViewDiffTag; ++//TODO remove unused string ++extern NSString *const NativeRenderShadowViewDiffInsertion; ++extern NSString *const NativeRenderShadowViewDiffRemove; ++extern NSString *const NativeRenderShadowViewDiffUpdate; ++extern NSString *const NativeRenderShadowViewDiffTag; + + /** +- * ShadowView tree mirrors Hippy view tree. Every node is highly stateful. ++ * RenderObject tree mirrors NativeRender view tree. Every node is highly stateful. + * 1. A node is in one of three lifecycles: uninitialized, computed, dirtied. + * 2. At the end of each Bridge transaction, we call collectUpdatedFrames:widthConstraint:heightConstraint + * at the root node to recursively layout the entire hierarchy. + * 3. If a node is ""computed"" and the constraint passed from above is identical to the constraint used to + * perform the last computation, we skip laying out the subtree entirely. + */ +-@interface HippyShadowView : NSObject ++@interface NativeRenderObjectView : NSObject + + /** +- * HippyComponent interface. ++ * NativeRenderComponent interface. + */ + + /** + * Get all hippy shadow views + */ +-- (NSArray *)hippySubviews NS_REQUIRES_SUPER; ++- (NSArray *)hippySubviews NS_REQUIRES_SUPER; + + /** + * Get super shadow view + */ +-- (HippyShadowView *)hippySuperview NS_REQUIRES_SUPER; ++- (NativeRenderObjectView *)hippySuperview NS_REQUIRES_SUPER; + + /** + * Insert hippy shadow view at index. +@@ -86,19 +85,19 @@ extern NSString *const HippyShadowViewDiffTag; + * @param atIndex position for hippy subview to insert + * @discussion atIndex must not exceed range of current index + */ +-- (void)insertHippySubview:(HippyShadowView *)subview atIndex:(NSInteger)atIndex; ++- (void)insertHippySubview:(NativeRenderObjectView *)subview atIndex:(NSInteger)atIndex; + + /** + * Remove hippy shadow view + * + * @param subview A hippy shadow subview to delete + */ +-- (void)removeHippySubview:(HippyShadowView *)subview; ++- (void)removeHippySubview:(NativeRenderObjectView *)subview; + +-@property(nonatomic, weak, readonly) HippyShadowView *superview; ++@property(nonatomic, weak, readonly) NativeRenderObjectView *superview; + @property(nonatomic, copy) NSString *viewName; + @property(nonatomic, strong) UIColor *backgroundColor; // Used to propagate to children +-@property(nonatomic, copy) HippyDirectEventBlock onLayout; ++@property(nonatomic, copy) NativeRenderDirectEventBlock onLayout; + @property(nonatomic, assign) BOOL isList; + @property(nonatomic, copy) NSString *visibility; + @property(nonatomic, assign) BOOL visibilityChanged; +@@ -106,16 +105,8 @@ extern NSString *const HippyShadowViewDiffTag; + @property(nonatomic, readonly) BOOL confirmedLayoutDirectionDidUpdated; + + /** +- * isNewView - Used to track the first time the view is introduced into the hierarchy. It is initialized YES, then is +- * set to NO in HippyUIManager after the layout pass is done and all frames have been extracted to be applied to the +- * corresponding UIViews. +- */ +-//TODO delete this variable +-@property (nonatomic, assign, getter=isNewView) BOOL newView; +- +-/** +- * isHidden - HippyUIManager uses this to determine whether or not the UIView should be hidden. Useful if the +- * ShadowView determines that its UIView will be clipped and wants to hide it. ++ * isHidden - NativeRenderUIManager uses this to determine whether or not the UIView should be hidden. Useful if the ++ * RenderObject determines that its UIView will be clipped and wants to hide it. + */ + @property (nonatomic, assign, getter=isHidden) BOOL hidden; + +@@ -141,21 +132,21 @@ extern NSString *const HippyShadowViewDiffTag; + + /** + * Indicate how we create coresponding UIView +- * HippyCreationTypeInstantly : create views instantly when HippyShadowView is created +- * HippyCreationTypeLazily: create views when UIView is needed ++ * NativeRenderCreationTypeInstantly : create views instantly when NativeRenderObject is created ++ * NativeRenderCreationTypeLazily: create views when UIView is needed + */ +-@property (nonatomic, assign) HippyCreationType creationType; ++@property (nonatomic, assign) NativeRenderCreationType creationType; + + @property (nonatomic, assign) std::weak_ptrdomManager; + + @property (nonatomic, assign) std::weak_ptrrootNode; + + /** +- * set create type of itself and its all descendants to HippyCreationTypeInstantly ++ * set create type of itself and its all descendants to NativeRenderCreationTypeInstantly + */ + - (void)recusivelySetCreationTypeToInstant; + +-- (UIView *)createView:(HippyViewCreationBlock)creationBlock insertChildren:(HippyViewInsertionBlock)insertionBlock; ++- (UIView *)createView:(NativeRenderViewCreationBlock)creationBlock insertChildren:(NativeRenderViewInsertionBlock)insertionBlock; + + /** + * reset layout frame to mark dirty and re-layout +@@ -164,24 +155,24 @@ extern NSString *const HippyShadowViewDiffTag; + + /** + * Calculate property changes that need to be propagated to the view. +- * The applierBlocks set contains HippyApplierBlock functions that must be applied ++ * The applierBlocks set contains NativeRenderApplierBlock functions that must be applied + * on the main thread in order to update the view. + */ +-- (void)collectUpdatedProperties:(NSMutableSet *)applierBlocks ++- (void)collectUpdatedProperties:(NSMutableSet *)applierBlocks + parentProperties:(NSDictionary *)parentProperties; + + /** + * Process the updated properties and apply them to view. Shadow view classes + * that add additional propagating properties should override this method. + */ +-- (NSDictionary *)processUpdatedProperties:(NSMutableSet *)applierBlocks ++- (NSDictionary *)processUpdatedProperties:(NSMutableSet *)applierBlocks + parentProperties:(NSDictionary *)parentProperties NS_REQUIRES_SUPER; + + - (void)amendLayoutBeforeMount; + + /** + * Return whether or not this node acts as a leaf node in the eyes of CSSLayout. For example +- * HippyShadowText has children which it does not want CSSLayout to lay out so in the eyes of ++ * NativeRenderShadowText has children which it does not want CSSLayout to lay out so in the eyes of + * CSSLayout it is a leaf node. + */ + - (BOOL)isCSSLeafNode; +@@ -196,7 +187,7 @@ extern NSString *const HippyShadowViewDiffTag; + - (BOOL)isTextDirty; + + /** +- * As described in HippyComponent protocol. ++ * As described in NativeRenderComponent protocol. + */ + - (void)didUpdateHippySubviews NS_REQUIRES_SUPER; + - (void)didSetProps:(NSArray *)changedProps NS_REQUIRES_SUPER; +@@ -204,11 +195,11 @@ extern NSString *const HippyShadowViewDiffTag; + - (NSDictionary *)mergeProps:(NSDictionary *)props; + + /** +- * Add event to HippyShadowView ++ * Add event to NativeRenderObject + * @param name event name + * @discussion In general, events are mounted directly on UIViews. + * But for the lazy loading UIViews, UIViews may not be created when events requires to mount on UIViews. +- * So we have to mount on ShadowView temparily, and mount on UIViews when UIViews are created by HippyShadowViews ++ * So we have to mount on RenderObject temparily, and mount on UIViews when UIViews are created by NativeRenderObject + */ + - (void)addEventName:(const std::string &)name; + +diff --git a/renderer/native/ios/renderer/component/view/HippyShadowView.mm b/renderer/native/ios/renderer/component/view/NativeRenderObjectView.mm +similarity index 71% +rename from renderer/native/ios/renderer/component/view/HippyShadowView.mm +rename to renderer/native/ios/renderer/component/view/NativeRenderObjectView.mm +index 05fa910b5ae..cebf8568a07 100644 +--- a/renderer/native/ios/renderer/component/view/HippyShadowView.mm ++++ b/renderer/native/ios/renderer/component/view/NativeRenderObjectView.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,40 +20,40 @@ + * limitations under the License. + */ + +-#import ""HippyShadowView.h"" +-#import ""HippyConvert.h"" +-#import ""UIView+Hippy.h"" +-#import ""UIView+Private.h"" +-#import ""HPNode.h"" +-#import ""HippyI18nUtils.h"" ++#import ""NativeRenderObjectView.h"" ++#import ""NativeRenderConvert.h"" ++#import ""UIView+NativeRender.h"" ++#import ""NativeRenderI18nUtils.h"" + #import ""UIView+DirectionalLayout.h"" + #include ""dom/layout_node.h"" + #include ""dom/render_manager.h"" ++#include ""Flex.h"" + +-static NSString *const HippyBackgroundColorProp = @""backgroundColor""; ++static NSString *const NativeRenderBackgroundColorProp = @""backgroundColor""; + +-NSString *const HippyShadowViewDiffInsertion = @""HippyShadowViewDiffInsertion""; +-NSString *const HippyShadowViewDiffRemove = @""HippyShadowViewDiffRemove""; +-NSString *const HippyShadowViewDiffUpdate = @""HippyShadowViewDiffUpdate""; +-NSString *const HippyShadowViewDiffTag = @""HippyShadowViewDiffTag""; ++NSString *const NativeRenderShadowViewDiffInsertion = @""NativeRenderShadowViewDiffInsertion""; ++NSString *const NativeRenderShadowViewDiffRemove = @""NativeRenderShadowViewDiffRemove""; ++NSString *const NativeRenderShadowViewDiffUpdate = @""NativeRenderShadowViewDiffUpdate""; ++NSString *const NativeRenderShadowViewDiffTag = @""NativeRenderShadowViewDiffTag""; + + +-@interface HippyShadowView () { +- HippyUpdateLifecycle _propagationLifecycle; +- HippyUpdateLifecycle _textLifecycle; ++@interface NativeRenderObjectView () { ++ NativeRenderUpdateLifecycle _propagationLifecycle; ++ NativeRenderUpdateLifecycle _textLifecycle; + NSDictionary *_lastParentProperties; +- NSMutableArray *_hippySubviews; ++ NSMutableArray *_hippySubviews; + BOOL _recomputePadding; + BOOL _recomputeMargin; + BOOL _recomputeBorder; + BOOL _didUpdateSubviews; +- NSInteger _isDecendantOfLazilyShadowView; ++ //TODO remove it ++ NSInteger _isDecendantOfLazilyRenderObject; + std::vector _eventNames; + } + + @end + +-@implementation HippyShadowView ++@implementation NativeRenderObjectView + + @synthesize hippyTag = _hippyTag; + @synthesize props = _props; +@@ -62,15 +62,15 @@ @implementation HippyShadowView + @synthesize tagName =_tagName; + + - (void)amendLayoutBeforeMount { +- if (HippyUpdateLifecycleDirtied == _propagationLifecycle || _visibilityChanged) { ++ if (NativeRenderUpdateLifecycleDirtied == _propagationLifecycle || _visibilityChanged) { + _visibilityChanged = NO; +- for (HippyShadowView *shadowView in self.hippySubviews) { +- [shadowView amendLayoutBeforeMount]; ++ for (NativeRenderObjectView *renderObjectView in self.hippySubviews) { ++ [renderObjectView amendLayoutBeforeMount]; + } + } + } + +-- (NSDictionary *)processUpdatedProperties:(NSMutableSet *)applierBlocks ++- (NSDictionary *)processUpdatedProperties:(NSMutableSet *)applierBlocks + parentProperties:(NSDictionary *)parentProperties { + if (_didUpdateSubviews) { + _didUpdateSubviews = NO; +@@ -90,7 +90,7 @@ - (void)amendLayoutBeforeMount { + _confirmedLayoutDirectionDidUpdated = NO; + } + if (!_backgroundColor) { +- UIColor *parentBackgroundColor = parentProperties[HippyBackgroundColorProp]; ++ UIColor *parentBackgroundColor = parentProperties[NativeRenderBackgroundColorProp]; + if (parentBackgroundColor) { + [applierBlocks addObject:^(NSDictionary *viewRegistry) { + UIView *view = viewRegistry[self->_hippyTag]; +@@ -103,23 +103,23 @@ - (void)amendLayoutBeforeMount { + CGFloat alpha = CGColorGetAlpha(_backgroundColor.CGColor); + if (alpha < 1.0) { + // If bg is non-opaque, don't propagate further +- properties[HippyBackgroundColorProp] = [UIColor clearColor]; ++ properties[NativeRenderBackgroundColorProp] = [UIColor clearColor]; + } else { +- properties[HippyBackgroundColorProp] = _backgroundColor; ++ properties[NativeRenderBackgroundColorProp] = _backgroundColor; + } + return properties; + } + return parentProperties; + } + +-- (void)collectUpdatedProperties:(NSMutableSet *)applierBlocks parentProperties:(NSDictionary *)parentProperties { +- if (_propagationLifecycle == HippyUpdateLifecycleComputed && [parentProperties isEqualToDictionary:_lastParentProperties]) { ++- (void)collectUpdatedProperties:(NSMutableSet *)applierBlocks parentProperties:(NSDictionary *)parentProperties { ++ if (_propagationLifecycle == NativeRenderUpdateLifecycleComputed && [parentProperties isEqualToDictionary:_lastParentProperties]) { + return; + } +- _propagationLifecycle = HippyUpdateLifecycleComputed; ++ _propagationLifecycle = NativeRenderUpdateLifecycleComputed; + _lastParentProperties = parentProperties; + NSDictionary *nextProps = [self processUpdatedProperties:applierBlocks parentProperties:parentProperties]; +- for (HippyShadowView *child in _hippySubviews) { ++ for (NativeRenderObjectView *child in _hippySubviews) { + [child collectUpdatedProperties:applierBlocks parentProperties:nextProps]; + } + } +@@ -127,10 +127,9 @@ - (void)collectUpdatedProperties:(NSMutableSet *)applierBlock + - (instancetype)init { + if ((self = [super init])) { + _frame = CGRectMake(0, 0, NAN, NAN); +- _newView = YES; +- _isDecendantOfLazilyShadowView = -1; +- _propagationLifecycle = HippyUpdateLifecycleUninitialized; +- _textLifecycle = HippyUpdateLifecycleUninitialized; ++ _isDecendantOfLazilyRenderObject = -1; ++ _propagationLifecycle = NativeRenderUpdateLifecycleUninitialized; ++ _textLifecycle = NativeRenderUpdateLifecycleUninitialized; + _hasNewLayout = YES; + _hippySubviews = [NSMutableArray array]; + _confirmedLayoutDirection = DirectionInherit; +@@ -140,7 +139,7 @@ - (instancetype)init { + } + + - (BOOL)isHippyRootView { +- return HippyIsHippyRootView(self.hippyTag); ++ return NativeRenderIsHippyRootView(self.hippyTag); + } + + - (BOOL)isCSSLeafNode { +@@ -148,66 +147,66 @@ - (BOOL)isCSSLeafNode { + } + + - (void)dirtyPropagation { +- if (_propagationLifecycle != HippyUpdateLifecycleDirtied) { +- _propagationLifecycle = HippyUpdateLifecycleDirtied; ++ if (_propagationLifecycle != NativeRenderUpdateLifecycleDirtied) { ++ _propagationLifecycle = NativeRenderUpdateLifecycleDirtied; + [_superview dirtyPropagation]; + } + } + + - (void)dirtySelfPropagation { +- _propagationLifecycle = HippyUpdateLifecycleDirtied; ++ _propagationLifecycle = NativeRenderUpdateLifecycleDirtied; + } + + - (void)dirtyDescendantPropagation { + [self dirtySelfPropagation]; +- for (HippyShadowView *shadowView in self.hippySubviews) { +- [shadowView dirtyDescendantPropagation]; ++ for (NativeRenderObjectView *renderObjectView in self.hippySubviews) { ++ [renderObjectView dirtyDescendantPropagation]; + } + } + + - (BOOL)isPropagationDirty { +- return _propagationLifecycle != HippyUpdateLifecycleComputed; ++ return _propagationLifecycle != NativeRenderUpdateLifecycleComputed; + } + + - (void)dirtyText { +- if (_textLifecycle != HippyUpdateLifecycleDirtied) { +- _textLifecycle = HippyUpdateLifecycleDirtied; ++ if (_textLifecycle != NativeRenderUpdateLifecycleDirtied) { ++ _textLifecycle = NativeRenderUpdateLifecycleDirtied; + [_superview dirtyText]; + } + } + + - (BOOL)isTextDirty { +- return _textLifecycle != HippyUpdateLifecycleComputed; ++ return _textLifecycle != NativeRenderUpdateLifecycleComputed; + } + +-- (HippyCreationType)creationType { +- if (HippyCreationTypeUndetermined == _creationType) { +- HippyShadowView *superShadowView = [self hippySuperview]; +- if (superShadowView && ![superShadowView isHippyRootView]) { +- _creationType = [superShadowView creationType]; ++- (NativeRenderCreationType)creationType { ++ if (NativeRenderCreationTypeUndetermined == _creationType) { ++ NativeRenderObjectView *superRenderObject = [self hippySuperview]; ++ if (superRenderObject && ![superRenderObject isHippyRootView]) { ++ _creationType = [superRenderObject creationType]; + } + else { +- _creationType = HippyCreationTypeInstantly; ++ _creationType = NativeRenderCreationTypeInstantly; + } + } + return _creationType; + } + + - (void)setTextComputed { +- _textLifecycle = HippyUpdateLifecycleComputed; ++ _textLifecycle = NativeRenderUpdateLifecycleComputed; + } + + - (void)recusivelySetCreationTypeToInstant { + auto domManager = self.domManager.lock(); + if (domManager) { +- __weak HippyShadowView *weakSelf = self; ++ __weak NativeRenderObjectView *weakSelf = self; + + std::vector> ops = {[weakSelf](){ + if (weakSelf) { +- HippyShadowView *strongSelf = weakSelf; +- strongSelf.creationType = HippyCreationTypeInstantly; +- for (HippyShadowView *subShadowView in strongSelf.hippySubviews) { +- [subShadowView synchronousRecusivelySetCreationTypeToInstant]; ++ NativeRenderObjectView *strongSelf = weakSelf; ++ strongSelf.creationType = NativeRenderCreationTypeInstantly; ++ for (NativeRenderObjectView *subRenderObject in strongSelf.hippySubviews) { ++ [subRenderObject synchronousRecusivelySetCreationTypeToInstant]; + } + } + }}; +@@ -216,16 +215,16 @@ - (void)recusivelySetCreationTypeToInstant { + } + + - (void)synchronousRecusivelySetCreationTypeToInstant { +- self.creationType = HippyCreationTypeInstantly; +- for (HippyShadowView *subShadowView in self.hippySubviews) { ++ self.creationType = NativeRenderCreationTypeInstantly; ++ for (NativeRenderObjectView *subShadowView in self.hippySubviews) { + [subShadowView synchronousRecusivelySetCreationTypeToInstant]; + } + } + +-- (UIView *)createView:(HippyViewCreationBlock)creationBlock insertChildren:(HippyViewInsertionBlock)insertionBlock { ++- (UIView *)createView:(NativeRenderViewCreationBlock)creationBlock insertChildren:(NativeRenderViewInsertionBlock)insertionBlock { + UIView *container = creationBlock(self); + NSMutableArray *children = [NSMutableArray arrayWithCapacity:[self.hippySubviews count]]; +- for (HippyShadowView *subviews in self.hippySubviews) { ++ for (NativeRenderObjectView *subviews in self.hippySubviews) { + UIView *subview = [subviews createView:creationBlock insertChildren:insertionBlock]; + if (subview) { + [children addObject:subview]; +@@ -246,7 +245,7 @@ - (void)setVisibility:(NSString *)visibility { + } + } + +-- (void)insertHippySubview:(HippyShadowView *)subview atIndex:(NSInteger)atIndex { ++- (void)insertHippySubview:(NativeRenderObjectView *)subview atIndex:(NSInteger)atIndex { + if (atIndex <= [_hippySubviews count]) { + [_hippySubviews insertObject:subview atIndex:atIndex]; + } +@@ -259,7 +258,7 @@ - (void)insertHippySubview:(HippyShadowView *)subview atIndex:(NSInteger)atIndex + [self dirtyPropagation]; + } + +-- (void)removeHippySubview:(HippyShadowView *)subview { ++- (void)removeHippySubview:(NativeRenderObjectView *)subview { + [subview dirtyText]; + [subview dirtyPropagation]; + _didUpdateSubviews = YES; +@@ -272,22 +271,22 @@ - (void)removeFromHippySuperview { + [superview removeHippySubview:self]; + } + +-- (NSArray *)hippySubviews { ++- (NSArray *)hippySubviews { + return _hippySubviews; + } + +-- (HippyShadowView *)hippySuperview { ++- (NativeRenderObjectView *)hippySuperview { + return _superview; + } + + - (NSNumber *)hippyTagAtPoint:(CGPoint)point { +- for (HippyShadowView *shadowView in _hippySubviews) { +- if (CGRectContainsPoint(shadowView.frame, point)) { ++ for (NativeRenderObjectView *renderObject in _hippySubviews) { ++ if (CGRectContainsPoint(renderObject.frame, point)) { + CGPoint relativePoint = point; +- CGPoint origin = shadowView.frame.origin; ++ CGPoint origin = renderObject.frame.origin; + relativePoint.x -= origin.x; + relativePoint.y -= origin.y; +- return [shadowView hippyTagAtPoint:relativePoint]; ++ return [renderObject hippyTagAtPoint:relativePoint]; + } + } + return self.hippyTag; +@@ -308,7 +307,7 @@ - (void)addRecursiveDescriptionToString:(NSMutableString *)string atLevel:(NSUIn + [string appendString:self.description]; + [string appendString:@""\n""]; + +- for (HippyShadowView *subview in _hippySubviews) { ++ for (NativeRenderObjectView *subview in _hippySubviews) { + [subview addRecursiveDescriptionToString:string atLevel:level + 1]; + } + } +@@ -335,13 +334,13 @@ - (void)setFrame:(CGRect)frame { + - (void)setLayoutFrame:(CGRect)frame { + auto domManager = self.domManager.lock(); + if (domManager) { +- __weak HippyShadowView *weakSelf = self; ++ __weak NativeRenderObjectView *weakSelf = self; + std::vector> ops = {[weakSelf, domManager, frame](){ + @autoreleasepool { + if (!weakSelf) { + return; + } +- HippyShadowView *strongSelf = weakSelf; ++ NativeRenderObjectView *strongSelf = weakSelf; + int32_t hippyTag = [[strongSelf hippyTag] intValue]; + auto node = domManager->GetNode(strongSelf.rootNode, hippyTag); + auto renderManager = domManager->GetRenderManager().lock(); +@@ -391,7 +390,7 @@ - (NSDictionary *)mergeProps:(NSDictionary *)props { + NSMutableArray *sameKeys = [NSMutableArray new]; + [self.props enumerateKeysAndObjectsUsingBlock:^(NSString *_Nonnull key, id _Nonnull obj, __unused BOOL *stop) { + if (needUpdatedProps[key] == nil) { +- // HippyNilIfNull方法会将NULL转化为nil,对于数字类型属性则为0,导致实际上为kCFNull的属性,最终会转化为0 ++ // NativeRenderNilIfNull方法会将NULL转化为nil,对于数字类型属性则为0,导致实际上为kCFNull的属性,最终会转化为0 + //比如view长宽属性,前端并没有设置其具体数值,而使用css需要终端计算大小,但由于上述机制,导致MTT排版引擎将其宽高设置为0,0,引发bug + //因此这里做个判断,遇到mergeprops时,如果需要删除的属性是布局相关类型,那一律将新值设置为默认值 + needUpdatedProps[key] = [self defaultValueForKey:key]; +@@ -455,7 +454,7 @@ - (void)setConfirmedLayoutDirection:(HPDirection)confirmedLayoutDirection { + + - (void)applyConfirmedLayoutDirectionToSubviews:(HPDirection)confirmedLayoutDirection { + _confirmedLayoutDirection = confirmedLayoutDirection; +- for (HippyShadowView *subviews in self.hippySubviews) { ++ for (NativeRenderObjectView *subviews in self.hippySubviews) { + [subviews applyConfirmedLayoutDirectionToSubviews:confirmedLayoutDirection]; + } + } +@@ -465,14 +464,14 @@ - (BOOL)isLayoutSubviewsRTL { + return layoutRTL; + } + +-- (void)checkLayoutDirection:(NSMutableSet *)viewsSet direction:(HPDirection *)direction{ ++- (void)checkLayoutDirection:(NSMutableSet *)viewsSet direction:(HPDirection *)direction{ + if (DirectionInherit == self.confirmedLayoutDirection) { + [viewsSet addObject:self]; +- HippyShadowView *shadowSuperview = [self hippySuperview]; ++ NativeRenderObjectView *shadowSuperview = [self hippySuperview]; + if (!shadowSuperview) { + if (direction) { + NSWritingDirection writingDirection = +- [[HippyI18nUtils sharedInstance] writingDirectionForCurrentAppLanguage]; ++ [[NativeRenderI18nUtils sharedInstance] writingDirectionForCurrentAppLanguage]; + *direction = NSWritingDirectionRightToLeft == writingDirection ? DirectionRTL : DirectionLTR; + } + } +@@ -488,7 +487,7 @@ - (void)checkLayoutDirection:(NSMutableSet *)viewsSet directi + - (void)superviewLayoutDirectionChangedTo:(HPDirection)direction { + if (DirectionInherit == self.layoutDirection) { + self.confirmedLayoutDirection = [self superview].confirmedLayoutDirection; +- for (HippyShadowView *subview in self.hippySubviews) { ++ for (NativeRenderObjectView *subview in self.hippySubviews) { + [subview superviewLayoutDirectionChangedTo:self.confirmedLayoutDirection]; + } + } +diff --git a/renderer/native/ios/renderer/component/view/HippyPointerEvents.h b/renderer/native/ios/renderer/component/view/NativeRenderPointerEvents.h +similarity index 75% +rename from renderer/native/ios/renderer/component/view/HippyPointerEvents.h +rename to renderer/native/ios/renderer/component/view/NativeRenderPointerEvents.h +index 509f5650fba..600e106b0ae 100644 +--- a/renderer/native/ios/renderer/component/view/HippyPointerEvents.h ++++ b/renderer/native/ios/renderer/component/view/NativeRenderPointerEvents.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -22,9 +22,9 @@ + + #import + +-typedef NS_ENUM(NSInteger, HippyPointerEvents) { +- HippyPointerEventsUnspecified = 0, // Default +- HippyPointerEventsNone, +- HippyPointerEventsBoxNone, +- HippyPointerEventsBoxOnly, ++typedef NS_ENUM(NSInteger, NativeRenderPointerEvents) { ++ NativeRenderPointerEventsUnspecified = 0, // Default ++ NativeRenderPointerEventsNone, ++ NativeRenderPointerEventsBoxNone, ++ NativeRenderPointerEventsBoxOnly, + }; +diff --git a/renderer/native/ios/renderer/component/view/HippyTouchesProtocol.h b/renderer/native/ios/renderer/component/view/NativeRenderTouchesProtocol.h +similarity index 82% +rename from renderer/native/ios/renderer/component/view/HippyTouchesProtocol.h +rename to renderer/native/ios/renderer/component/view/NativeRenderTouchesProtocol.h +index 9d963874fb0..69618400676 100644 +--- a/renderer/native/ios/renderer/component/view/HippyTouchesProtocol.h ++++ b/renderer/native/ios/renderer/component/view/NativeRenderTouchesProtocol.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,7 +21,7 @@ + */ + + #import +-#import ""HippyViewEventType.h"" ++#import ""NativeRenderViewEventType.h"" + + NS_ASSUME_NONNULL_BEGIN + +@@ -31,27 +31,27 @@ typedef void(^OnTouchEventHandler)(CGPoint); + * Protocol indicates Views' touches event + * This protocol only handls touches event, exclude Layout/Show/Dismiss event + */ +-@protocol HippyTouchesProtocol ++@protocol NativeRenderTouchesProtocol + + /** + * Add an event for a view + * @param touchEvent event type + * @param listener event handle block + */ +-- (void)addViewEvent:(HippyViewEventType)touchEvent eventListener:(OnTouchEventHandler)listener; ++- (void)addViewEvent:(NativeRenderViewEventType)touchEvent eventListener:(OnTouchEventHandler)listener; + + /** + * Get event handle block with event type + * @param eventType event type + * @return event handle block for eventType + */ +-- (OnTouchEventHandler)eventListenerForEventType:(HippyViewEventType)eventType; ++- (OnTouchEventHandler)eventListenerForEventType:(NativeRenderViewEventType)eventType; + + /** + * Remove event handle block + * @param touchEvent event type + */ +-- (void)removeViewEvent:(HippyViewEventType)touchEvent; ++- (void)removeViewEvent:(NativeRenderViewEventType)touchEvent; + + /** + * Indicate event can be prevented in capturing process +diff --git a/renderer/native/ios/renderer/component/view/HippyTouchesView.h b/renderer/native/ios/renderer/component/view/NativeRenderTouchesView.h +similarity index 81% +rename from renderer/native/ios/renderer/component/view/HippyTouchesView.h +rename to renderer/native/ios/renderer/component/view/NativeRenderTouchesView.h +index 784cc73ea01..bd5f34984a1 100644 +--- a/renderer/native/ios/renderer/component/view/HippyTouchesView.h ++++ b/renderer/native/ios/renderer/component/view/NativeRenderTouchesView.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,16 +21,16 @@ + */ + + #import +-#import ""HippyTouchesProtocol.h"" ++#import ""NativeRenderTouchesProtocol.h"" + + NS_ASSUME_NONNULL_BEGIN + + /** +- * HippyTouchesView is used to response HippyTouchesProtocol ++ * NativeRenderTouchesView is used to response NativeRenderTouchesProtocol + * which is used to handle touches event. + * We need to override touchesBegan/touchesEnded/touchesCancelled/touchesMoved methods to handle coresponding event. + */ +-@interface HippyTouchesView : UIView ++@interface NativeRenderTouchesView : UIView + + @end + +diff --git a/renderer/native/ios/renderer/component/view/HippyTouchesView.mm b/renderer/native/ios/renderer/component/view/NativeRenderTouchesView.mm +similarity index 80% +rename from renderer/native/ios/renderer/component/view/HippyTouchesView.mm +rename to renderer/native/ios/renderer/component/view/NativeRenderTouchesView.mm +index b528d8c5620..284f8361ada 100644 +--- a/renderer/native/ios/renderer/component/view/HippyTouchesView.mm ++++ b/renderer/native/ios/renderer/component/view/NativeRenderTouchesView.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,12 +20,12 @@ + * limitations under the License. + */ + +-#import ""HippyTouchesView.h"" ++#import ""NativeRenderTouchesView.h"" + #import ""objc/runtime.h"" +-#import ""UIView+Hippy.h"" +-#import ""UIView+AppearEvent.h"" ++#import ""UIView+NativeRender.h"" ++#import ""UIView+MountEvent.h"" + +-@interface HippyTouchesView () { ++@interface NativeRenderTouchesView () { + NSMutableDictionary *_touchesEvents; + UITapGestureRecognizer *_tapGestureRecognizer; + UILongPressGestureRecognizer *_longGestureRecognizer; +@@ -35,7 +35,7 @@ @interface HippyTouchesView () { + + @end + +-@implementation HippyTouchesView ++@implementation NativeRenderTouchesView + + #pragma mark Life Cycles + - (instancetype)init { +@@ -84,25 +84,25 @@ - (void)didMoveToSuperview { + return _touchesEvents; + } + +-#pragma mark HippyTouchesProtol Implementation +-- (void)addViewEvent:(HippyViewEventType)touchEvent eventListener:(OnTouchEventHandler)listener { ++#pragma mark NativeRenderTouchesProtol Implementation ++- (void)addViewEvent:(NativeRenderViewEventType)touchEvent eventListener:(OnTouchEventHandler)listener { + switch (touchEvent) { +- case HippyViewEventTypeTouchStart: +- case HippyViewEventTypeTouchMove: +- case HippyViewEventTypeTouchEnd: +- case HippyViewEventTypeTouchCancel: ++ case NativeRenderViewEventTypeTouchStart: ++ case NativeRenderViewEventTypeTouchMove: ++ case NativeRenderViewEventTypeTouchEnd: ++ case NativeRenderViewEventTypeTouchCancel: + [self setTouchEventListener:listener forEvent:touchEvent]; + break; +- case HippyViewEventTypeClick: ++ case NativeRenderViewEventTypeClick: + [self addClickEventListener:listener]; + break; +- case HippyViewEventTypeLongClick: ++ case NativeRenderViewEventTypeLongClick: + [self addLongClickEventListener:listener]; + break; +- case HippyViewEventTypePressIn: ++ case NativeRenderViewEventTypePressIn: + [self addPressInEventListener:listener]; + break; +- case HippyViewEventTypePressOut: ++ case NativeRenderViewEventTypePressOut: + [self addPressOutEventListener:listener]; + break; + default: +@@ -110,23 +110,23 @@ - (void)addViewEvent:(HippyViewEventType)touchEvent eventListener:(OnTouchEventH + } + } + +-- (OnTouchEventHandler)eventListenerForEventType:(HippyViewEventType)eventType { ++- (OnTouchEventHandler)eventListenerForEventType:(NativeRenderViewEventType)eventType { + return [_touchesEvents objectForKey:@(eventType)]; + } + +-- (void)removeViewEvent:(HippyViewEventType)touchEvent { ++- (void)removeViewEvent:(NativeRenderViewEventType)touchEvent { + [_touchesEvents removeObjectForKey:@(touchEvent)]; +- if (HippyViewEventTypeClick == touchEvent) { ++ if (NativeRenderViewEventTypeClick == touchEvent) { + if (_tapGestureRecognizer) { + [self removeGestureRecognizer:_tapGestureRecognizer]; + } + } +- else if (HippyViewEventTypeLongClick == touchEvent) { ++ else if (NativeRenderViewEventTypeLongClick == touchEvent) { + if (_longGestureRecognizer) { + [self removeGestureRecognizer:_longGestureRecognizer]; + } + } +- else if (HippyViewEventTypePressIn == touchEvent) { ++ else if (NativeRenderViewEventTypePressIn == touchEvent) { + if (_pressInEventEnabled) { + [_pressInTimer invalidate]; + _pressInTimer = nil; +@@ -144,7 +144,7 @@ - (BOOL)canBePreventInBubbling:(const std::string &)name { + } + + #pragma mark Touch Event Listener Add Methods +-- (void)setTouchEventListener:(OnTouchEventHandler)eventListener forEvent:(HippyViewEventType)event { ++- (void)setTouchEventListener:(OnTouchEventHandler)eventListener forEvent:(NativeRenderViewEventType)event { + if (eventListener) { + [[self touchesEvents] setObject:eventListener forKey:@(event)]; + } +@@ -158,7 +158,7 @@ - (void)addClickEventListener:(OnTouchEventHandler)eventListener { + _tapGestureRecognizer.cancelsTouchesInView = NO; + _tapGestureRecognizer.delaysTouchesEnded = NO; + [self addGestureRecognizer:_tapGestureRecognizer]; +- [[self touchesEvents] setObject:eventListener forKey:@(HippyViewEventTypeClick)]; ++ [[self touchesEvents] setObject:eventListener forKey:@(NativeRenderViewEventTypeClick)]; + } + + - (void)addLongClickEventListener:(OnTouchEventHandler)eventListener { +@@ -168,7 +168,7 @@ - (void)addLongClickEventListener:(OnTouchEventHandler)eventListener { + _longGestureRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongClickEvent)]; + _longGestureRecognizer.cancelsTouchesInView = NO; + [self addGestureRecognizer:_longGestureRecognizer]; +- [[self touchesEvents] setObject:eventListener forKey:@(HippyViewEventTypeLongClick)]; ++ [[self touchesEvents] setObject:eventListener forKey:@(NativeRenderViewEventTypeLongClick)]; + } + + - (void)addPressInEventListener:(OnTouchEventHandler)eventListener { +@@ -176,11 +176,11 @@ - (void)addPressInEventListener:(OnTouchEventHandler)eventListener { + [_pressInTimer invalidate]; + } + _pressInEventEnabled = YES; +- [[self touchesEvents] setObject:eventListener forKey:@(HippyViewEventTypePressIn)]; ++ [[self touchesEvents] setObject:eventListener forKey:@(NativeRenderViewEventTypePressIn)]; + } + + - (void)addPressOutEventListener:(OnTouchEventHandler)eventListener { +- [[self touchesEvents] setObject:eventListener forKey:@(HippyViewEventTypePressOut)]; ++ [[self touchesEvents] setObject:eventListener forKey:@(NativeRenderViewEventTypePressOut)]; + } + + #pragma mark Touches Event Handler +@@ -188,7 +188,7 @@ - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { + if (_pressInEventEnabled) { + _pressInTimer = [NSTimer scheduledTimerWithTimeInterval:.1f target:self selector:@selector(handlePressInEvent) userInfo:nil repeats:NO]; + } +- OnTouchEventHandler listener = [self eventListenerForEventType:HippyViewEventTypeTouchStart]; ++ OnTouchEventHandler listener = [self eventListenerForEventType:NativeRenderViewEventTypeTouchStart]; + if (listener) { + UITouch *touch = [touches anyObject]; + CGPoint point = [touch locationInView:[self hippyRootView]]; +@@ -205,7 +205,7 @@ - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { + _pressInTimer = nil; + } + [self handlePressOutEvent]; +- OnTouchEventHandler listener = [self eventListenerForEventType:HippyViewEventTypeTouchEnd]; ++ OnTouchEventHandler listener = [self eventListenerForEventType:NativeRenderViewEventTypeTouchEnd]; + if (listener) { + UITouch *touch = [touches anyObject]; + CGPoint point = [touch locationInView:[self hippyRootView]]; +@@ -217,7 +217,7 @@ - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { + } + + - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { +- OnTouchEventHandler listener = [self eventListenerForEventType:HippyViewEventTypeTouchMove]; ++ OnTouchEventHandler listener = [self eventListenerForEventType:NativeRenderViewEventTypeTouchMove]; + if (listener) { + UITouch *touch = [touches anyObject]; + CGPoint point = [touch locationInView:[self hippyRootView]]; +@@ -234,7 +234,7 @@ - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event + [_pressInTimer invalidate]; + _pressInTimer = nil; + } +- OnTouchEventHandler listener = [self eventListenerForEventType:HippyViewEventTypeTouchCancel]; ++ OnTouchEventHandler listener = [self eventListenerForEventType:NativeRenderViewEventTypeTouchCancel]; + if (listener) { + UITouch *touch = [touches anyObject]; + CGPoint point = [touch locationInView:[self hippyRootView]]; +@@ -246,7 +246,7 @@ - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event + } + + - (void)handleClickEvent { +- OnTouchEventHandler listener = [self eventListenerForEventType:HippyViewEventTypeClick]; ++ OnTouchEventHandler listener = [self eventListenerForEventType:NativeRenderViewEventTypeClick]; + if (listener) { + CGPoint point = [_tapGestureRecognizer locationInView:[self hippyRootView]]; + listener(point); +@@ -254,7 +254,7 @@ - (void)handleClickEvent { + } + + - (void)handleLongClickEvent { +- OnTouchEventHandler listener = [self eventListenerForEventType:HippyViewEventTypeLongClick]; ++ OnTouchEventHandler listener = [self eventListenerForEventType:NativeRenderViewEventTypeLongClick]; + if (listener) { + if (_longGestureRecognizer.state == UIGestureRecognizerStateBegan) { + CGPoint point = [_longGestureRecognizer locationInView:[self hippyRootView]]; +@@ -266,14 +266,14 @@ - (void)handleLongClickEvent { + - (void)handlePressInEvent { + [_pressInTimer invalidate]; + _pressInTimer = nil; +- OnTouchEventHandler listener = [self eventListenerForEventType:HippyViewEventTypePressIn]; ++ OnTouchEventHandler listener = [self eventListenerForEventType:NativeRenderViewEventTypePressIn]; + if (listener) { + listener(CGPointZero); + } + } + + - (void)handlePressOutEvent { +- OnTouchEventHandler listener = [self eventListenerForEventType:HippyViewEventTypePressOut]; ++ OnTouchEventHandler listener = [self eventListenerForEventType:NativeRenderViewEventTypePressOut]; + if (listener) { + listener(CGPointZero); + } +diff --git a/renderer/native/ios/renderer/component/view/HippyView.h b/renderer/native/ios/renderer/component/view/NativeRenderView.h +similarity index 69% +rename from renderer/native/ios/renderer/component/view/HippyView.h +rename to renderer/native/ios/renderer/component/view/NativeRenderView.h +index 6df874752c7..d526f6d8ab1 100644 +--- a/renderer/native/ios/renderer/component/view/HippyView.h ++++ b/renderer/native/ios/renderer/component/view/NativeRenderView.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -22,23 +22,23 @@ + + #import + +-#import ""HippyBorderStyle.h"" +-#import ""HippyComponent.h"" +-#import ""HippyPointerEvents.h"" +-#import ""HippyTouchesView.h"" ++#import ""NativeRenderBorderStyle.h"" ++#import ""NativeRenderComponentProtocol.h"" ++#import ""NativeRenderPointerEvents.h"" ++#import ""NativeRenderTouchesView.h"" + +-@protocol HippyAutoInsetsProtocol; ++@protocol NativeRenderAutoInsetsProtocol; + +-@class HippyGradientObject; ++@class NativeRenderGradientObject; + +-@interface HippyView : HippyTouchesView ++@interface NativeRenderView : NativeRenderTouchesView + + /** + * Used to control how touch events are processed. + */ +-@property (nonatomic, assign) HippyPointerEvents pointerEvents; ++@property (nonatomic, assign) NativeRenderPointerEvents pointerEvents; + +-+ (void)autoAdjustInsetsForView:(UIView *)parentView +++ (void)autoAdjustInsetsForView:(UIView *)parentView + withScrollView:(UIScrollView *)scrollView + updateOffset:(BOOL)updateOffset; + +@@ -49,28 +49,12 @@ + + /** + * z-index, used to override sibling order in didUpdateHippySubviews. This is +- * inherited from UIView+Hippy, but we override it here to reduce the boxing ++ * inherited from UIView+NativeRender, but we override it here to reduce the boxing + * and associated object overheads. + */ + @property (nonatomic, assign) NSInteger hippyZIndex; + +-/** +- * This is an optimization used to improve performance +- * for large scrolling views with many subviews, such as a +- * list or table. If set to YES, any clipped subviews will +- * be removed from the view hierarchy whenever -updateClippedSubviews +- * is called. This would typically be triggered by a scroll event +- */ +-@property (nonatomic, assign) BOOL removeClippedSubviews; +- + @property (nonatomic, assign) CGFloat shadowSpread; +-/** +- * Hide subviews if they are outside the view bounds. +- * This is an optimisation used predominantly with RKScrollViews +- * but it is applied recursively to all subviews that have +- * removeClippedSubviews set to YES +- */ +-- (void)updateClippedSubviews; + + /** + * get content for layer +@@ -108,7 +92,7 @@ + /** + * Border styles. + */ +-@property (nonatomic, assign) HippyBorderStyle borderStyle; ++@property (nonatomic, assign) NativeRenderBorderStyle borderStyle; + + /** + * BackgroundImage styles. +@@ -117,5 +101,5 @@ + @property (nonatomic, strong) NSString *backgroundSize; + @property (nonatomic, assign) CGFloat backgroundPositionX; + @property (nonatomic, assign) CGFloat backgroundPositionY; +-@property (nonatomic, strong) HippyGradientObject *gradientObject; ++@property (nonatomic, strong) NativeRenderGradientObject *gradientObject; + @end +diff --git a/renderer/native/ios/renderer/component/view/HippyView.mm b/renderer/native/ios/renderer/component/view/NativeRenderView.mm +similarity index 67% +rename from renderer/native/ios/renderer/component/view/HippyView.mm +rename to renderer/native/ios/renderer/component/view/NativeRenderView.mm +index 13b86e0db64..ee6fe6feb2d 100644 +--- a/renderer/native/ios/renderer/component/view/HippyView.mm ++++ b/renderer/native/ios/renderer/component/view/NativeRenderView.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,13 +20,13 @@ + * limitations under the License. + */ + +-#import ""HippyView.h"" +-#import ""HippyAutoInsetsProtocol.h"" +-#import ""HippyBorderDrawing.h"" +-#import ""HippyConvert.h"" +-#import ""HippyUtils.h"" +-#import ""UIView+Hippy.h"" +-#import ""HippyGradientObject.h"" ++#import ""NativeRenderView.h"" ++#import ""NativeRenderAutoInsetsProtocol.h"" ++#import ""NativeRenderBorderDrawing.h"" ++#import ""NativeRenderConvert.h"" ++#import ""NativeRenderUtils.h"" ++#import ""UIView+NativeRender.h"" ++#import ""NativeRenderGradientObject.h"" + + static CGSize makeSizeConstrainWithType(CGSize originSize, CGSize constrainSize, NSString *resizeMode) { + // width / height +@@ -53,96 +53,7 @@ static CGSize makeSizeConstrainWithType(CGSize originSize, CGSize constrainSize, + return originSize; + } + +-dispatch_queue_t global_hpview_queue(void) { +- static dispatch_queue_t g_background_queue = nil; +- static dispatch_once_t onceToken; +- dispatch_once(&onceToken, ^{ +- g_background_queue = dispatch_queue_create(""com.tencent.mtt.hippy.hpview"", DISPATCH_QUEUE_SERIAL); +- }); +- return g_background_queue; +-} +- +-@implementation UIView (HippyViewUnmounting) +- +-- (void)hippy_remountAllSubviews { +- // Normal views don't support unmounting, so all +- // this does is forward message to our subviews, +- // in case any of those do support it +- +- for (UIView *subview in self.subviews) { +- [subview hippy_remountAllSubviews]; +- } +-} +- +-- (void)hippy_updateClippedSubviewsWithClipRect:(CGRect)clipRect relativeToView:(UIView *)clipView { +- // Even though we don't support subview unmounting +- // we do support clipsToBounds, so if that's enabled +- // we'll update the clipping +- +- if (self.clipsToBounds && self.subviews.count > 0) { +- clipRect = [clipView convertRect:clipRect toView:self]; +- clipRect = CGRectIntersection(clipRect, self.bounds); +- clipView = self; +- } +- +- // Normal views don't support unmounting, so all +- // this does is forward message to our subviews, +- // in case any of those do support it +- +- for (UIView *subview in self.subviews) { +- [subview hippy_updateClippedSubviewsWithClipRect:clipRect relativeToView:clipView]; +- } +-} +- +-- (UIView *)hippy_findClipView { +- UIView *testView = self; +- UIView *clipView = nil; +- CGRect clipRect = self.bounds; +- // We will only look for a clipping view up the view hierarchy until we hit the root view. +- while (testView) { +- if (testView.clipsToBounds) { +- if (clipView) { +- CGRect testRect = [clipView convertRect:clipRect toView:testView]; +- if (!CGRectContainsRect(testView.bounds, testRect)) { +- clipView = testView; +- clipRect = CGRectIntersection(testView.bounds, testRect); +- } +- } else { +- clipView = testView; +- clipRect = [self convertRect:self.bounds toView:clipView]; +- } +- } +- if ([testView isHippyRootView]) { +- break; +- } +- testView = testView.superview; +- } +- return clipView ?: self.window; +-} +- +-- (UIView *)nextResponseViewAtPoint:(CGPoint)point { +- UIView *superView = [self superview]; +- if (superView && self.hippyTag) { +- NSArray *subviews = [superView subviews]; +- NSUInteger index = [subviews indexOfObject:self]; +- if (0 != index) { +- for (NSInteger i = index - 1; i >= 0; i--) { +- UIView *siblingView = subviews[i]; +- CGPoint pointInsiblingView = [self convertPoint:point toView:siblingView]; +- BOOL pointInside = [siblingView pointInside:pointInsiblingView withEvent:nil]; +- if (pointInside) { +- UIView *hitTestView = [siblingView hitTest:pointInsiblingView withEvent:nil]; +- return hitTestView ? hitTestView : siblingView; +- } +- } +- } +- } +- return superView; +-} +- +-@end +- +-static NSString *HippyRecursiveAccessibilityLabel(UIView *view) { ++static NSString *NativeRenderRecursiveAccessibilityLabel(UIView *view) { + NSMutableString *str = [NSMutableString stringWithString:@""""]; + for (UIView *subview in view.subviews) { + NSString *label = subview.accessibilityLabel; +@@ -150,13 +61,13 @@ - (UIView *)nextResponseViewAtPoint:(CGPoint)point { + [str appendString:@"" ""]; + [str appendString:label]; + } else { +- [str appendString:HippyRecursiveAccessibilityLabel(subview)]; ++ [str appendString:NativeRenderRecursiveAccessibilityLabel(subview)]; + } + } + return str; + } + +-@implementation HippyView { ++@implementation NativeRenderView { + UIColor *_backgroundColor; + } + +@@ -181,19 +92,17 @@ - (instancetype)initWithFrame:(CGRect)frame { + return self; + } + +-HIPPY_NOT_IMPLEMENTED(-(instancetype)initWithCoder : unused) +- + - (NSString *)accessibilityLabel { + if (super.accessibilityLabel) { + return super.accessibilityLabel; + } +- return HippyRecursiveAccessibilityLabel(self); ++ return NativeRenderRecursiveAccessibilityLabel(self); + } + +-- (void)setPointerEvents:(HippyPointerEvents)pointerEvents { ++- (void)setPointerEvents:(NativeRenderPointerEvents)pointerEvents { + _pointerEvents = pointerEvents; +- self.userInteractionEnabled = (pointerEvents != HippyPointerEventsNone); +- if (pointerEvents == HippyPointerEventsBoxNone) { ++ self.userInteractionEnabled = (pointerEvents != NativeRenderPointerEventsNone); ++ if (pointerEvents == NativeRenderPointerEventsBoxNone) { + self.accessibilityViewIsModal = NO; + } + } +@@ -208,7 +117,7 @@ - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { + // be outside the bounds of `view` (e.g., if -clipsToBounds is NO). + UIView *hitSubview = nil; + BOOL isPointInside = [self pointInside:point withEvent:event]; +- BOOL needsHitSubview = !(_pointerEvents == HippyPointerEventsNone || _pointerEvents == HippyPointerEventsBoxOnly); ++ BOOL needsHitSubview = !(_pointerEvents == NativeRenderPointerEventsNone || _pointerEvents == NativeRenderPointerEventsBoxOnly); + if (needsHitSubview && (![self clipsToBounds] || isPointInside)) { + // The default behaviour of UIKit is that if a view does not contain a point, + // then no subviews will be returned from hit testing, even if they contain +@@ -228,16 +137,16 @@ - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { + UIView *hitView = (isPointInside ? self : nil); + + switch (_pointerEvents) { +- case HippyPointerEventsNone: ++ case NativeRenderPointerEventsNone: + return nil; +- case HippyPointerEventsUnspecified: ++ case NativeRenderPointerEventsUnspecified: + return hitSubview ?: hitView; +- case HippyPointerEventsBoxOnly: ++ case NativeRenderPointerEventsBoxOnly: + return hitView; +- case HippyPointerEventsBoxNone: ++ case NativeRenderPointerEventsBoxNone: + return hitSubview; + default: +- //HippyLogError(@""Invalid pointer-events specified %ld on %@"", (long)_pointerEvents, self); ++ //NativeRenderLogError(@""Invalid pointer-events specified %ld on %@"", (long)_pointerEvents, self); + return hitSubview ?: hitView; + } + } +@@ -264,7 +173,7 @@ - (NSString *)description { + + #pragma mark - Statics for dealing with layoutGuides + +-+ (void)autoAdjustInsetsForView:(UIView *)parentView +++ (void)autoAdjustInsetsForView:(UIView *)parentView + withScrollView:(UIScrollView *)scrollView + updateOffset:(BOOL)updateOffset { + UIEdgeInsets baseInset = parentView.contentInset; +@@ -305,105 +214,6 @@ + (UIEdgeInsets)contentInsetsForView:(UIView *)view { + return UIEdgeInsetsZero; + } + +-#pragma mark - View unmounting +- +-- (void)hippy_remountAllSubviews { +- if (_removeClippedSubviews) { +- for (UIView *view in self.sortedHippySubviews) { +- if (view.superview != self) { +- [self addSubview:view]; +- [view hippy_remountAllSubviews]; +- } +- } +- } else { +- // If _removeClippedSubviews is false, we must already be showing all subviews +- [super hippy_remountAllSubviews]; +- } +-} +- +-- (void)hippy_updateClippedSubviewsWithClipRect:(CGRect)clipRect relativeToView:(UIView *)clipView { +- // TODO (#5906496): for scrollviews (the primary use-case) we could +- // optimize this by only doing a range check along the scroll axis, +- // instead of comparing the whole frame +- +- if (!_removeClippedSubviews) { +- // Use default behavior if unmounting is disabled +- return [super hippy_updateClippedSubviewsWithClipRect:clipRect relativeToView:clipView]; +- } +- +- if (self.hippySubviews.count == 0) { +- // Do nothing if we have no subviews +- return; +- } +- +- if (CGSizeEqualToSize(self.bounds.size, CGSizeZero)) { +- // Do nothing if layout hasn't happened yet +- return; +- } +- +- // Convert clipping rect to local coordinates +- clipRect = [clipView convertRect:clipRect toView:self]; +- clipRect = CGRectIntersection(clipRect, self.bounds); +- clipView = self; +- +- // Mount / unmount views +- for (UIView *view in self.sortedHippySubviews) { +- if (!CGRectIsEmpty(CGRectIntersection(clipRect, view.frame))) { +- // View is at least partially visible, so remount it if unmounted +- [self addSubview:view]; +- +- // Then test its subviews +- if (CGRectContainsRect(clipRect, view.frame)) { +- // View is fully visible, so remount all subviews +- [view hippy_remountAllSubviews]; +- } else { +- // View is partially visible, so update clipped subviews +- [view hippy_updateClippedSubviewsWithClipRect:clipRect relativeToView:clipView]; +- } +- +- } else if (view.superview) { +- // View is completely outside the clipRect, so unmount it +- [view removeFromSuperview]; +- } +- } +-} +- +-- (void)setRemoveClippedSubviews:(BOOL)removeClippedSubviews { +- if (!removeClippedSubviews && _removeClippedSubviews) { +- [self hippy_remountAllSubviews]; +- } +- _removeClippedSubviews = removeClippedSubviews; +-} +- +-- (void)didUpdateHippySubviews { +- if (_removeClippedSubviews) { +- [self updateClippedSubviews]; +- } else { +- [super didUpdateHippySubviews]; +- } +-} +- +-- (void)updateClippedSubviews { +- // Find a suitable view to use for clipping +- UIView *clipView = [self hippy_findClipView]; +- if (clipView) { +- [self hippy_updateClippedSubviewsWithClipRect:clipView.bounds relativeToView:clipView]; +- } +-} +- +-- (void)layoutSubviews { +- // TODO (#5906496): this a nasty performance drain, but necessary +- // to prevent gaps appearing when the loading spinner disappears. +- // We might be able to fix this another way by triggering a call +- // to updateClippedSubviews manually after loading +- +- [super layoutSubviews]; +- +- if (_removeClippedSubviews) { +- [self updateClippedSubviews]; +- } +-} +- + #pragma mark - Borders + + - (UIColor *)backgroundColor { +@@ -435,7 +245,7 @@ - (UIEdgeInsets)bordersAsInsets { + }; + } + +-- (HippyCornerRadii)cornerRadii { ++- (NativeRenderCornerRadii)cornerRadii { + // Get corner radii + const CGFloat radius = MAX(0, _borderRadius); + const CGFloat topLeftRadius = _borderTopLeftRadius >= 0 ? _borderTopLeftRadius : radius; +@@ -445,13 +255,13 @@ - (HippyCornerRadii)cornerRadii { + + // Get scale factors required to prevent radii from overlapping + const CGSize size = self.bounds.size; +- const CGFloat topScaleFactor = HippyZeroIfNaN(MIN(1, size.width / (topLeftRadius + topRightRadius))); +- const CGFloat bottomScaleFactor = HippyZeroIfNaN(MIN(1, size.width / (bottomLeftRadius + bottomRightRadius))); +- const CGFloat rightScaleFactor = HippyZeroIfNaN(MIN(1, size.height / (topRightRadius + bottomRightRadius))); +- const CGFloat leftScaleFactor = HippyZeroIfNaN(MIN(1, size.height / (topLeftRadius + bottomLeftRadius))); ++ const CGFloat topScaleFactor = NativeRenderZeroIfNaN(MIN(1, size.width / (topLeftRadius + topRightRadius))); ++ const CGFloat bottomScaleFactor = NativeRenderZeroIfNaN(MIN(1, size.width / (bottomLeftRadius + bottomRightRadius))); ++ const CGFloat rightScaleFactor = NativeRenderZeroIfNaN(MIN(1, size.height / (topRightRadius + bottomRightRadius))); ++ const CGFloat leftScaleFactor = NativeRenderZeroIfNaN(MIN(1, size.height / (topLeftRadius + bottomLeftRadius))); + + // Return scaled radii +- return (HippyCornerRadii) { ++ return (NativeRenderCornerRadii) { + topLeftRadius * MIN(topScaleFactor, leftScaleFactor), + topRightRadius * MIN(topScaleFactor, rightScaleFactor), + bottomLeftRadius * MIN(bottomScaleFactor, leftScaleFactor), +@@ -474,8 +284,8 @@ - (void)setFrame:(CGRect)frame { + [super setFrame:frame]; + } + +-- (HippyBorderColors)borderColors { +- return (HippyBorderColors) { ++- (NativeRenderBorderColors)borderColors { ++ return (NativeRenderBorderColors) { + _borderTopColor ?: _borderColor, + _borderLeftColor ?: _borderColor, + _borderBottomColor ?: _borderColor, +@@ -483,7 +293,7 @@ - (HippyBorderColors)borderColors { + }; + } + +-void HippyBoarderColorsRetain(HippyBorderColors c) { ++void NativeRenderBoarderColorsRetain(NativeRenderBorderColors c) { + if (c.top) { + CGColorRetain(c.top); + } +@@ -498,7 +308,7 @@ void HippyBoarderColorsRetain(HippyBorderColors c) { + } + } + +-void HippyBoarderColorsRelease(HippyBorderColors c) { ++void NativeRenderBoarderColorsRelease(NativeRenderBorderColors c) { + if (c.top) { + CGColorRelease(c.top); + } +@@ -529,13 +339,13 @@ - (void)displayLayer:(CALayer *)layer { + + [self drawShadowForLayer]; + +- const HippyCornerRadii cornerRadii = [self cornerRadii]; ++ const NativeRenderCornerRadii cornerRadii = [self cornerRadii]; + const UIEdgeInsets borderInsets = [self bordersAsInsets]; +- const HippyBorderColors borderColors = [self borderColors]; ++ const NativeRenderBorderColors borderColors = [self borderColors]; + UIColor *backgroundColor = self.backgroundColor; + +- BOOL useIOSBorderRendering = !HippyRunningInTestEnvironment() && HippyCornerRadiiAreEqual(cornerRadii) && HippyBorderInsetsAreEqual(borderInsets) +- && HippyBorderColorsAreEqual(borderColors) && (_borderStyle == HippyBorderStyleSolid || _borderStyle == HippyBorderStyleNone) && ++ BOOL useIOSBorderRendering = !NativeRenderRunningInTestEnvironment() && NativeRenderCornerRadiiAreEqual(cornerRadii) && NativeRenderBorderInsetsAreEqual(borderInsets) ++ && NativeRenderBorderColorsAreEqual(borderColors) && (_borderStyle == NativeRenderBorderStyleSolid || _borderStyle == NativeRenderBorderStyleNone) && + + // iOS draws borders in front of the content whereas CSS draws them behind + // the content. For this reason, only use iOS border drawing when clipping +@@ -598,9 +408,9 @@ - (void)displayLayer:(CALayer *)layer { + } + + - (BOOL)getLayerContentForColor:(UIColor *)color completionBlock:(void (^)(UIImage *))contentBlock { +- const HippyCornerRadii cornerRadii = [self cornerRadii]; ++ const NativeRenderCornerRadii cornerRadii = [self cornerRadii]; + const UIEdgeInsets borderInsets = [self bordersAsInsets]; +- const HippyBorderColors borderColors = [self borderColors]; ++ const NativeRenderBorderColors borderColors = [self borderColors]; + UIColor *backgroundColor = color?:self.backgroundColor; + + CGRect theFrame = self.frame; +@@ -614,7 +424,7 @@ - (BOOL)getLayerContentForColor:(UIColor *)color completionBlock:(void (^)(UIIma + } + NSInteger clipToBounds = self.clipsToBounds; + NSString *backgroundSize = self.backgroundSize; +- UIImage *borderImage = HippyGetBorderImage(self.borderStyle, theFrame.size, cornerRadii, borderInsets, ++ UIImage *borderImage = NativeRenderGetBorderImage(self.borderStyle, theFrame.size, cornerRadii, borderInsets, + borderColors, backgroundColor.CGColor, clipToBounds, !self.gradientObject); + if (!self.backgroundImage && !self.gradientObject) { + contentBlock(borderImage); +@@ -663,13 +473,13 @@ - (BOOL)getLayerContentForColor:(UIColor *)color completionBlock:(void (^)(UIIma + return YES; + } + +-static BOOL HippyLayerHasShadow(CALayer *layer) { ++static BOOL NativeRenderLayerHasShadow(CALayer *layer) { + return layer.shadowOpacity * CGColorGetAlpha(layer.shadowColor) > 0; + } + + - (void)hippySetInheritedBackgroundColor:(UIColor *)inheritedBackgroundColor { + // Inherit background color if a shadow has been set, as an optimization +- if (HippyLayerHasShadow(self.layer)) { ++ if (NativeRenderLayerHasShadow(self.layer)) { + self.backgroundColor = inheritedBackgroundColor; + } + } +@@ -679,13 +489,13 @@ - (void)updateClippingForLayer:(CALayer *)layer { + CGFloat cornerRadius = 0; + + if (self.clipsToBounds) { +- const HippyCornerRadii cornerRadii = [self cornerRadii]; +- if (HippyCornerRadiiAreEqual(cornerRadii)) { ++ const NativeRenderCornerRadii cornerRadii = [self cornerRadii]; ++ if (NativeRenderCornerRadiiAreEqual(cornerRadii)) { + cornerRadius = cornerRadii.topLeft; + + } else { + CAShapeLayer *shapeLayer = [CAShapeLayer layer]; +- CGPathRef path = HippyPathCreateWithRoundedRect(self.bounds, HippyGetCornerInsets(cornerRadii, UIEdgeInsetsZero), NULL); ++ CGPathRef path = NativeRenderPathCreateWithRoundedRect(self.bounds, NativeRenderGetCornerInsets(cornerRadii, UIEdgeInsetsZero), NULL); + shapeLayer.path = path; + CGPathRelease(path); + mask = shapeLayer; +@@ -752,7 +562,7 @@ -(void)setBorder##side##Radius : (CGFloat)radius { \ + #pragma mark - Border Style + + #define setBorderStyle(side) \ +- -(void)setBorder##side##Style : (HippyBorderStyle)style { \ ++ -(void)setBorder##side##Style : (NativeRenderBorderStyle)style { \ + if (_border##side##Style == style) { \ + return; \ + } \ +diff --git a/renderer/native/ios/renderer/component/view/HippyViewEventType.h b/renderer/native/ios/renderer/component/view/NativeRenderViewEventType.h +similarity index 55% +rename from renderer/native/ios/renderer/component/view/HippyViewEventType.h +rename to renderer/native/ios/renderer/component/view/NativeRenderViewEventType.h +index 8ebd6274646..90be3cce70a 100644 +--- a/renderer/native/ios/renderer/component/view/HippyViewEventType.h ++++ b/renderer/native/ios/renderer/component/view/NativeRenderViewEventType.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,29 +21,29 @@ + */ + + #include +-#import ""HippyDefines.h"" ++#import ""NativeRenderDefines.h"" + +-typedef NS_ENUM(NSInteger, HippyViewEventType) { ++typedef NS_ENUM(NSInteger, NativeRenderViewEventType) { + //touche event +- HippyViewEventTypeTouchStart, +- HippyViewEventTypeTouchMove, +- HippyViewEventTypeTouchEnd, +- HippyViewEventTypeTouchCancel, ++ NativeRenderViewEventTypeTouchStart, ++ NativeRenderViewEventTypeTouchMove, ++ NativeRenderViewEventTypeTouchEnd, ++ NativeRenderViewEventTypeTouchCancel, + +- HippyViewEventTypePressIn, +- HippyViewEventTypePressOut, ++ NativeRenderViewEventTypePressIn, ++ NativeRenderViewEventTypePressOut, + +- HippyViewEventLayout, ++ NativeRenderViewEventLayout, + + //show event +- HippyViewEventTypeShow, +- HippyViewEventTypeDismiss, ++ NativeRenderViewEventTypeShow, ++ NativeRenderViewEventTypeDismiss, + + //click event +- HippyViewEventTypeClick, +- HippyViewEventTypeLongClick, ++ NativeRenderViewEventTypeClick, ++ NativeRenderViewEventTypeLongClick, + +- HippyViewEventTypeUnknown = -1, ++ NativeRenderViewEventTypeUnknown = -1, + }; + +-HIPPY_EXTERN HippyViewEventType viewEventTypeFromName(const std::string &name); ++NATIVE_RENDER_EXTERN NativeRenderViewEventType viewEventTypeFromName(const std::string &name); +diff --git a/renderer/native/ios/renderer/component/view/HippyViewEventType.mm b/renderer/native/ios/renderer/component/view/NativeRenderViewEventType.mm +similarity index 63% +rename from renderer/native/ios/renderer/component/view/HippyViewEventType.mm +rename to renderer/native/ios/renderer/component/view/NativeRenderViewEventType.mm +index e736c468e89..f3b66247b3b 100644 +--- a/renderer/native/ios/renderer/component/view/HippyViewEventType.mm ++++ b/renderer/native/ios/renderer/component/view/NativeRenderViewEventType.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,43 +20,43 @@ + * limitations under the License. + */ + +-#import ""HippyViewEventType.h"" ++#import ""NativeRenderViewEventType.h"" + #include ""dom/dom_listener.h"" + +-HippyViewEventType viewEventTypeFromName(const std::string &name) { +- HippyViewEventType type = HippyViewEventTypeUnknown; ++NativeRenderViewEventType viewEventTypeFromName(const std::string &name) { ++ NativeRenderViewEventType type = NativeRenderViewEventTypeUnknown; + if (hippy::kClickEvent == name) { +- type = HippyViewEventTypeClick; ++ type = NativeRenderViewEventTypeClick; + } + else if (hippy::kLongClickEvent == name) { +- type = HippyViewEventTypeLongClick; ++ type = NativeRenderViewEventTypeLongClick; + } + else if (hippy::kTouchStartEvent == name) { +- type = HippyViewEventTypeTouchStart; ++ type = NativeRenderViewEventTypeTouchStart; + } + else if (hippy::kTouchMoveEvent == name) { +- type = HippyViewEventTypeTouchMove; ++ type = NativeRenderViewEventTypeTouchMove; + } + else if (hippy::kTouchEndEvent == name) { +- type = HippyViewEventTypeTouchEnd; ++ type = NativeRenderViewEventTypeTouchEnd; + } + else if (hippy::kTouchCancelEvent == name) { +- type = HippyViewEventTypeTouchCancel; ++ type = NativeRenderViewEventTypeTouchCancel; + } + else if (hippy::kPressIn == name) { +- type = HippyViewEventTypePressIn; ++ type = NativeRenderViewEventTypePressIn; + } + else if (hippy::kPressOut == name) { +- type = HippyViewEventTypePressOut; ++ type = NativeRenderViewEventTypePressOut; + } + else if (hippy::kLayoutEvent == name) { +- type = HippyViewEventLayout; ++ type = NativeRenderViewEventLayout; + } + else if (hippy::kShowEvent == name) { +- type = HippyViewEventTypeShow; ++ type = NativeRenderViewEventTypeShow; + } + else if (hippy::kDismissEvent == name) { +- type = HippyViewEventTypeDismiss; ++ type = NativeRenderViewEventTypeDismiss; + } + return type; + } +diff --git a/renderer/native/ios/renderer/component/view/HippyViewManager.h b/renderer/native/ios/renderer/component/view/NativeRenderViewManager.h +similarity index 54% +rename from renderer/native/ios/renderer/component/view/HippyViewManager.h +rename to renderer/native/ios/renderer/component/view/NativeRenderViewManager.h +index eb1d7c7cb40..c2103fd8be3 100644 +--- a/renderer/native/ios/renderer/component/view/HippyViewManager.h ++++ b/renderer/native/ios/renderer/component/view/NativeRenderViewManager.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,14 +21,14 @@ + */ + + #import +-#import ""HippyConvert.h"" +-#import ""HippyRenderContext.h"" ++#import ""NativeRenderConvert.h"" ++#import ""NativeRenderContext.h"" + +-@class HippyShadowView; ++@class NativeRenderObjectView; + +-@interface HippyViewManager : NSObject ++@interface NativeRenderViewManager : NSObject + +-@property(nonatomic, weak)id renderContext; ++@property(nonatomic, weak)id renderContext; + + /** + * This method instantiates a native view to be managed by the module. Override +@@ -41,17 +41,17 @@ + + /** + * This method instantiates a shadow view to be managed by the module. If omitted, +- * an ordinary HippyShadowView instance will be created, which is typically fine for +- * most view types. As with the -view method, the -shadowView method should return ++ * an ordinary NativeRenderObjectView instance will be created, which is typically fine for ++ * most view types. As with the -view method, the -renderObject method should return + * a fresh instance each time it is called. + */ +-- (HippyShadowView *)shadowView; ++- (NativeRenderObjectView *)nativeRenderObjectView; + + /** + * Called to notify manager that layout has finished, in case any calculated + * properties need to be copied over from shadow view to view. + */ +-- (HippyRenderUIBlock)uiBlockToAmendWithShadowView:(HippyShadowView *)shadowView; ++- (NativeRenderRenderUIBlock)uiBlockToAmendWithNativeRenderObjectView:(NativeRenderObjectView *)renderObject; + + /** + * Called after view hierarchy manipulation has finished, and all shadow props +@@ -59,22 +59,22 @@ + * custom layout logic or tasks that involve walking the view hierarchy. + * To be deprecated, hopefully. + */ +-- (HippyRenderUIBlock)uiBlockToAmendWithShadowViewRegistry:(NSDictionary *)shadowViewRegistry; ++- (NativeRenderRenderUIBlock)uiBlockToAmendWithRenderObjectRegistry:(NSDictionary *)renderObjectRegistry; + + /** + * This handles the simple case, where JS and native property names match. + */ +-#define HIPPY_EXPORT_VIEW_PROPERTY(name, type) \ +- +(NSArray *)propConfig_##name { \ +- return @[@ #type]; \ ++#define NATIVE_RENDER_EXPORT_VIEW_PROPERTY(name, type) \ ++ +(NSArray *)propConfig_##name { \ ++ return @[@ #type]; \ + } + + /** + * This macro maps a named property to an arbitrary key path in the view. + */ +-#define HIPPY_REMAP_VIEW_PROPERTY(name, keyPath, type) \ +- +(NSArray *)propConfig_##name { \ +- return @[@ #type, @ #keyPath]; \ ++#define NATIVE_RENDER_REMAP_VIEW_PROPERTY(name, keyPath, type) \ ++ +(NSArray *)propConfig_##name { \ ++ return @[@ #type, @ #keyPath]; \ + } + + /** +@@ -82,24 +82,24 @@ + * view properties. The macro should be followed by a method body, which can + * refer to ""json"", ""view"" and ""defaultView"" to implement the required logic. + */ +-#define HIPPY_CUSTOM_VIEW_PROPERTY(name, type, viewClass) \ +- HIPPY_REMAP_VIEW_PROPERTY(name, __custom__, type) \ ++#define NATIVE_RENDER_CUSTOM_VIEW_PROPERTY(name, type, viewClass) \ ++ NATIVE_RENDER_REMAP_VIEW_PROPERTY(name, __custom__, type) \ + -(void)set_##name : (id)json forView : (viewClass *)view withDefaultView : (viewClass *)defaultView + + /** + * This macro is used to map properties to the shadow view, instead of the view. + */ +-#define HIPPY_EXPORT_SHADOW_PROPERTY(name, type) \ +- +(NSArray *)propConfigShadow_##name { \ +- return @[@ #type]; \ ++#define NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(name, type) \ ++ +(NSArray *)propConfigRenderObject_##name { \ ++ return @[@ #type]; \ + } + + /** + * This macro maps a named property to an arbitrary key path in the shadow view. + */ +-#define HIPPY_REMAP_SHADOW_PROPERTY(name, keyPath, type) \ +- +(NSArray *)propConfigShadow_##name { \ +- return @[@ #type, @ #keyPath]; \ ++#define NATIVE_RENDER_REMAP_RENDER_OBJECT_PROPERTY(name, keyPath, type) \ ++ +(NSArray *)propConfigRenderObject_##name { \ ++ return @[@ #type, @ #keyPath]; \ + } + + /** +@@ -107,24 +107,23 @@ + * shadow view properties. The macro should be followed by a method body, which can + * refer to ""json"" and ""view"". + */ +-#define HIPPY_CUSTOM_SHADOW_PROPERTY(name, type, viewClass) \ +- HIPPY_REMAP_SHADOW_PROPERTY(name, __custom__, type) \ +- -(void)set_##name : (id)json forShadowView : (viewClass *)view ++#define NATIVE_RENDER_CUSTOM_RENDER_OBJECT_PROPERTY(name, type, viewClass) \ ++ NATIVE_RENDER_REMAP_RENDER_OBJECT_PROPERTY(name, __custom__, type) \ ++ -(void)set_##name : (id)json forRenderObject : (viewClass *)view + ++#define NATIVE_RENDER_COMPONENT_EXPORT_METHOD(method_name) NATIVE_RENDER_COMPONENT_REMAP_METHOD(, method_name) + +-#define RENDER_CONCAT2(A, B) A##B +-#define RENDER_CONCAT(A, B) RENDER_CONCAT2(A, B) +- +-#define RENDER_COMPONENT_EXPORT_METHOD(method_name) RENDER_COMPONENT_REMAP_METHOD(, method_name) +- +-#define RENDER_COMPONENT_REMAP_METHOD(js_name, method_name) \ +- +(NSArray *)RENDER_CONCAT(__render_export__, RENDER_CONCAT(js_name, RENDER_CONCAT(__LINE__, __COUNTER__))) { \ +- return @[@#js_name, @#method_name]; \ +- } \ ++#define NATIVE_RENDER_COMPONENT_REMAP_METHOD(js_name, method_name) \ ++ +(NSArray *)NATIVE_RENDER_CONCAT(__render_export__, \ ++ NATIVE_RENDER_CONCAT(js_name, NATIVE_RENDER_CONCAT(__LINE__, __COUNTER__))) { \ ++ return @[@#js_name, @#method_name]; \ ++ } \ + -(void)method_name + ++typedef void (^RenderUIResponseSenderBlock)(id response); ++ + @end + +-@interface HippyViewManager (InitProps) ++@interface NativeRenderViewManager (InitProps) + @property (nonatomic, strong) NSDictionary *props; + @end +diff --git a/renderer/native/ios/renderer/component/view/NativeRenderViewManager.mm b/renderer/native/ios/renderer/component/view/NativeRenderViewManager.mm +new file mode 100644 +index 00000000000..99449378b3b +--- /dev/null ++++ b/renderer/native/ios/renderer/component/view/NativeRenderViewManager.mm +@@ -0,0 +1,481 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * NativeRender available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ""NativeRenderViewManager.h"" ++#import ""NativeRenderBorderStyle.h"" ++#import ""NativeRenderConvert.h"" ++#import ""HippyEventDispatcher.h"" ++#import ""NativeRenderObjectView.h"" ++#import ""NativeRenderUtils.h"" ++#import ""NativeRenderView.h"" ++#import ""UIView+NativeRender.h"" ++#import ""NativeRenderConvert+Transform.h"" ++#import ""NativeRenderGradientObject.h"" ++#import ""NativeRenderImageDataLoaderProtocol.h"" ++#import ""NativeRenderContext.h"" ++#import ""NativeRenderImageDataLoader.h"" ++#import ""NativeRenderDefaultImageProvider.h"" ++#import ""objc/runtime.h"" ++#import ""UIView+DirectionalLayout.h"" ++ ++@interface NativeRenderViewManager () { ++ id _imageDataLoader; ++ NSUInteger _sequence; ++} ++ ++@end ++ ++@implementation NativeRenderViewManager ++ ++- (dispatch_queue_t)methodQueue { ++// return NativeRenderGetUIManagerQueue(); ++ //TODO ++ NSAssert(NO, @""return queue""); ++ return nil; ++} ++ ++- (UIView *)view { ++ return [[NativeRenderView alloc] init]; ++} ++ ++- (NativeRenderObjectView *)nativeRenderObjectView { ++ return [[NativeRenderObjectView alloc] init]; ++} ++ ++- (NativeRenderRenderUIBlock)uiBlockToAmendWithNativeRenderObjectView:(__unused NativeRenderObjectView *)renderObject { ++ return nil; ++} ++ ++- (NativeRenderRenderUIBlock)uiBlockToAmendWithRenderObjectRegistry:(__unused NSDictionary *)renderObjectRegistry { ++ return nil; ++} ++ ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(measureInWindow:(NSNumber *)hippyTag callback:(RenderUIResponseSenderBlock)callback) { ++ [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { ++ UIView *view = viewRegistry[hippyTag]; ++ if (!view) { ++ callback(@{}); ++ return; ++ } ++ UIView *rootView = viewRegistry[view.rootTag]; ++ if (!rootView) { ++ callback(@{}); ++ return; ++ } ++ CGRect windowFrame = [rootView convertRect:view.frame fromView:view.superview]; ++ callback(@{@""width"":@(CGRectGetWidth(windowFrame)), ++ @""height"": @(CGRectGetHeight(windowFrame)), ++ @""x"":@(windowFrame.origin.x), ++ @""y"":@(windowFrame.origin.y)}); ++ }]; ++} ++ ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(measureInAppWindow:(NSNumber *)hippyTag callback:(RenderUIResponseSenderBlock)callback) { ++ [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { ++ UIView *view = viewRegistry[hippyTag]; ++ if (!view) { ++ callback(@{}); ++ return; ++ } ++ CGRect windowFrame = [view.window convertRect:view.frame fromView:view.superview]; ++ callback(@{@""width"":@(CGRectGetWidth(windowFrame)), ++ @""height"": @(CGRectGetHeight(windowFrame)), ++ @""x"":@(windowFrame.origin.x), ++ @""y"":@(windowFrame.origin.y)}); ++ }]; ++} ++ ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(getScreenShot:(nonnull NSNumber *)hippyTag ++ params:(NSDictionary *__nonnull)params ++ callback:(RenderUIResponseSenderBlock)callback) { ++ [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { ++ UIView *view = viewRegistry[hippyTag]; ++ if (view == nil) { ++ callback(@[]); ++ return; ++ } ++ CGFloat viewWidth = view.frame.size.width; ++ CGFloat viewHeight = view.frame.size.height; ++ int maxWidth = [params[@""maxWidth""] intValue]; ++ int maxHeight = [params[@""maxHeight""] intValue]; ++ CGFloat scale = 1.f; ++ if (viewWidth != 0 && viewHeight != 0 && maxWidth > 0 && maxHeight > 0) { ++ CGFloat scaleX = maxWidth / viewWidth; ++ CGFloat scaleY = maxHeight / viewHeight; ++ scale = MIN(scaleX, scaleY); ++ } ++ UIGraphicsBeginImageContextWithOptions(view.frame.size, YES, scale); ++ [view drawViewHierarchyInRect:view.bounds afterScreenUpdates:YES]; ++ UIImage *resultImage = UIGraphicsGetImageFromCurrentImageContext(); ++ UIGraphicsEndImageContext(); ++ if (resultImage) { ++ int quality = [params[@""quality""] intValue]; ++ NSData *imageData = UIImageJPEGRepresentation(resultImage, (quality > 0 ? quality : 80) / 100.f); ++ NSString *base64String = [imageData base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithLineFeed]; ++ NSDictionary *srceenShotDict = @{ ++ @""width"": @(int(resultImage.size.width * resultImage.scale)), ++ @""height"": @(int(resultImage.size.height * resultImage.scale)), ++ @""screenShot"": base64String.length ? base64String : @"""", ++ @""screenScale"": @(resultImage.scale) ++ }; ++ callback(@[srceenShotDict]); ++ } else { ++ callback(@[]); ++ } ++ }]; ++} ++ ++#pragma mark - RenderObject properties ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(visibility, NSString) ++ ++#pragma mark - View properties ++ ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(accessibilityLabel, NSString) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(backgroundColor, UIColor) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(shadowSpread, CGFloat) ++ ++NATIVE_RENDER_REMAP_VIEW_PROPERTY(accessible, isAccessibilityElement, BOOL) ++NATIVE_RENDER_REMAP_VIEW_PROPERTY(opacity, alpha, CGFloat) ++ ++NATIVE_RENDER_REMAP_VIEW_PROPERTY(shadowOpacity, layer.shadowOpacity, float) ++NATIVE_RENDER_REMAP_VIEW_PROPERTY(shadowRadius, layer.shadowRadius, CGFloat) ++ ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(backgroundPositionX, CGFloat) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(backgroundPositionY, CGFloat) ++ ++NATIVE_RENDER_CUSTOM_VIEW_PROPERTY(backgroundImage, NSString, NativeRenderView) { ++ if (json) { ++ NSString *imagePath = [NativeRenderConvert NSString:json]; ++ if ([self.renderContext.frameworkProxy respondsToSelector:@selector(standardizeAssetUrlString:forRenderContext:)]) { ++ imagePath = [self.renderContext.frameworkProxy standardizeAssetUrlString:imagePath forRenderContext:self.renderContext]; ++ } ++ id imageDataLoader = [self imageDataLoader]; ++ __weak NativeRenderView *weakView = view; ++ CGFloat scale = [UIScreen mainScreen].scale; ++ NSURL *url = NativeRenderURLWithString(imagePath, nil); ++ NSUInteger sequence = _sequence++; ++ [imageDataLoader loadImageAtUrl:url sequence:sequence progress:^(NSUInteger current, NSUInteger total) { ++ } completion:^(NSUInteger seq, id result, NSURL *url, NSError *error) { ++ if (!error && sequence == seq) { ++ UIImage *backgroundImage = nil; ++ if ([result isKindOfClass:[UIImage class]]) { ++ backgroundImage = result; ++ } ++ else if ([result isKindOfClass:[NSData class]]) { ++ NativeRenderDefaultImageProvider *imageProvider = [[NativeRenderDefaultImageProvider alloc] init]; ++ imageProvider.imageDataPath = imagePath; ++ [imageProvider setImageData:(NSData *)result]; ++ imageProvider.scale = scale; ++ backgroundImage = [imageProvider image]; ++ } ++ dispatch_async(dispatch_get_main_queue(), ^{ ++ if (weakView) { ++ NativeRenderView *strongView = weakView; ++ strongView.backgroundImage = backgroundImage; ++ } ++ }); ++ } ++ }]; ++ } ++} ++ ++- (id)imageDataLoader { ++ if (!_imageDataLoader) { ++ if ([self.renderContext.frameworkProxy respondsToSelector:@selector(imageDataLoaderForRenderContext:)]) { ++ _imageDataLoader = [self.renderContext.frameworkProxy imageDataLoaderForRenderContext:self.renderContext]; ++ } ++ if (!_imageDataLoader) { ++ _imageDataLoader = [[NativeRenderImageDataLoader alloc] init]; ++ } ++ } ++ return _imageDataLoader; ++} ++ ++NATIVE_RENDER_CUSTOM_VIEW_PROPERTY(linearGradient, NSDictionary, NativeRenderView) { ++ if (json) { ++ NSDictionary *linearGradientObject = [NativeRenderConvert NSDictionary:json]; ++ view.gradientObject = [[NativeRenderGradientObject alloc] initWithGradientObject:linearGradientObject]; ++ [view.layer setNeedsDisplay]; ++ } ++} ++ ++NATIVE_RENDER_CUSTOM_VIEW_PROPERTY(backgroundSize, NSString, NativeRenderView) { ++ NSString *bgSize = @""auto""; ++ if (json) { ++ bgSize = [NativeRenderConvert NSString:json]; ++ } ++ view.backgroundSize = bgSize; ++ [view.layer setNeedsDisplay]; ++} ++ ++NATIVE_RENDER_CUSTOM_VIEW_PROPERTY(shadowColor, UIColor, NativeRenderView) { ++ if (json) { ++ view.layer.shadowColor = [NativeRenderConvert UIColor:json].CGColor; ++ } else { ++ view.layer.shadowColor = [UIColor blackColor].CGColor; ++ } ++} ++ ++NATIVE_RENDER_CUSTOM_VIEW_PROPERTY(shadowOffsetX, CGFloat, NativeRenderView) { ++ if (json) { ++ CGSize shadowOffset = view.layer.shadowOffset; ++ shadowOffset.width = [NativeRenderConvert CGFloat:json]; ++ view.layer.shadowOffset = shadowOffset; ++ } ++} ++ ++NATIVE_RENDER_CUSTOM_VIEW_PROPERTY(shadowOffsetY, CGFloat, NativeRenderView) { ++ if (json) { ++ CGSize shadowOffset = view.layer.shadowOffset; ++ shadowOffset.height = [NativeRenderConvert CGFloat:json]; ++ view.layer.shadowOffset = shadowOffset; ++ } ++} ++ ++NATIVE_RENDER_CUSTOM_VIEW_PROPERTY(shadowOffset, NSDictionary, NativeRenderView) { ++ if (json) { ++ NSDictionary *offset = [NativeRenderConvert NSDictionary:json]; ++ NSNumber *width = offset[@""width""]; ++ if (nil == width) { ++ width = offset[@""x""]; ++ } ++ NSNumber *height = offset[@""height""]; ++ if (nil == height) { ++ height = offset[@""y""]; ++ } ++ view.layer.shadowOffset = CGSizeMake([width floatValue], [height floatValue]); ++ } ++} ++ ++NATIVE_RENDER_CUSTOM_VIEW_PROPERTY(overflow, OverflowType, NativeRenderView) { ++ if (json) { ++ view.clipsToBounds = [NativeRenderConvert OverflowType:json] != OverflowVisible; ++ } else { ++ view.clipsToBounds = defaultView.clipsToBounds; ++ } ++} ++NATIVE_RENDER_CUSTOM_VIEW_PROPERTY(shouldRasterizeIOS, BOOL, NativeRenderView) { ++ view.layer.shouldRasterize = json ? [NativeRenderConvert BOOL:json] : defaultView.layer.shouldRasterize; ++ view.layer.rasterizationScale = view.layer.shouldRasterize ? [UIScreen mainScreen].scale : defaultView.layer.rasterizationScale; ++} ++ ++NATIVE_RENDER_CUSTOM_VIEW_PROPERTY(transform, CATransform3D, NativeRenderView) { ++ view.layer.transform = json ? [NativeRenderConvert CATransform3D:json] : defaultView.layer.transform; ++ view.layer.allowsEdgeAntialiasing = !CATransform3DIsIdentity(view.layer.transform); ++} ++NATIVE_RENDER_CUSTOM_VIEW_PROPERTY(pointerEvents, NativeRenderPointerEvents, NativeRenderView) { ++ if ([view respondsToSelector:@selector(setPointerEvents:)]) { ++ view.pointerEvents = json ? [NativeRenderConvert NativeRenderPointerEvents:json] : defaultView.pointerEvents; ++ return; ++ } ++ ++ if (!json) { ++ view.userInteractionEnabled = defaultView.userInteractionEnabled; ++ return; ++ } ++ ++ switch ([NativeRenderConvert NativeRenderPointerEvents:json]) { ++ case NativeRenderPointerEventsUnspecified: ++ // Pointer events ""unspecified"" acts as if a stylesheet had not specified, ++ // which is different than ""auto"" in CSS (which cannot and will not be ++ // supported in `NativeRender`. ""auto"" may override a parent's ""none"". ++ // Unspecified values do not. ++ // This wouldn't override a container view's `userInteractionEnabled = NO` ++ view.userInteractionEnabled = YES; ++ break; ++ case NativeRenderPointerEventsNone: ++ view.userInteractionEnabled = NO; ++ break; ++ default: ++ //NativeRenderLogError(@""UIView base class does not support pointerEvent value: %@"", json); ++ break; ++ } ++} ++ ++NATIVE_RENDER_CUSTOM_VIEW_PROPERTY(borderRadius, CGFloat, NativeRenderView) { ++ if ([view respondsToSelector:@selector(setBorderRadius:)]) { ++ view.borderRadius = json ? [NativeRenderConvert CGFloat:json] : defaultView.borderRadius; ++ } else { ++ view.layer.cornerRadius = json ? [NativeRenderConvert CGFloat:json] : defaultView.layer.cornerRadius; ++ } ++} ++NATIVE_RENDER_CUSTOM_VIEW_PROPERTY(borderColor, CGColor, NativeRenderView) { ++ if ([view respondsToSelector:@selector(setBorderColor:)]) { ++ view.borderColor = json ? [NativeRenderConvert CGColor:json] : defaultView.borderColor; ++ } else { ++ view.layer.borderColor = json ? [NativeRenderConvert CGColor:json] : defaultView.layer.borderColor; ++ } ++} ++ ++NATIVE_RENDER_CUSTOM_VIEW_PROPERTY(borderWidth, CGFloat, NativeRenderView) { ++ if ([view respondsToSelector:@selector(setBorderWidth:)]) { ++ view.borderWidth = json ? [NativeRenderConvert CGFloat:json] : defaultView.borderWidth; ++ } else { ++ view.layer.borderWidth = json ? [NativeRenderConvert CGFloat:json] : defaultView.layer.borderWidth; ++ } ++} ++NATIVE_RENDER_CUSTOM_VIEW_PROPERTY(borderStyle, NativeRenderBorderStyle, NativeRenderView) { ++ if ([view respondsToSelector:@selector(setBorderStyle:)]) { ++ view.borderStyle = json ? [NativeRenderConvert NativeRenderBorderStyle:json] : defaultView.borderStyle; ++ } ++} ++ ++#define HIPPY_VIEW_BORDER_PROPERTY(SIDE) \ ++ NATIVE_RENDER_CUSTOM_VIEW_PROPERTY(border##SIDE##Width, CGFloat, NativeRenderView) { \ ++ if ([view respondsToSelector:@selector(setBorder##SIDE##Width:)]) { \ ++ view.border##SIDE##Width = json ? [NativeRenderConvert CGFloat:json] : defaultView.border##SIDE##Width; \ ++ } \ ++ } \ ++ NATIVE_RENDER_CUSTOM_VIEW_PROPERTY(border##SIDE##Color, UIColor, NativeRenderView) { \ ++ if ([view respondsToSelector:@selector(setBorder##SIDE##Color:)]) { \ ++ view.border##SIDE##Color = json ? [NativeRenderConvert CGColor:json] : defaultView.border##SIDE##Color; \ ++ } \ ++ } ++ ++HIPPY_VIEW_BORDER_PROPERTY(Top) ++HIPPY_VIEW_BORDER_PROPERTY(Right) ++HIPPY_VIEW_BORDER_PROPERTY(Bottom) ++HIPPY_VIEW_BORDER_PROPERTY(Left) ++ ++#define HIPPY_VIEW_BORDER_RADIUS_PROPERTY(SIDE) \ ++ NATIVE_RENDER_CUSTOM_VIEW_PROPERTY(border##SIDE##Radius, CGFloat, NativeRenderView) { \ ++ if ([view respondsToSelector:@selector(setBorder##SIDE##Radius:)]) { \ ++ view.border##SIDE##Radius = json ? [NativeRenderConvert CGFloat:json] : defaultView.border##SIDE##Radius; \ ++ } \ ++ } ++ ++HIPPY_VIEW_BORDER_RADIUS_PROPERTY(TopLeft) ++HIPPY_VIEW_BORDER_RADIUS_PROPERTY(TopRight) ++HIPPY_VIEW_BORDER_RADIUS_PROPERTY(BottomLeft) ++HIPPY_VIEW_BORDER_RADIUS_PROPERTY(BottomRight) ++ ++NATIVE_RENDER_REMAP_VIEW_PROPERTY(zIndex, hippyZIndex, NSInteger) ++ ++#pragma mark - ShadowView properties ++ ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(backgroundColor, UIColor) ++ ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(top, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(right, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(bottom, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(left, CGFloat); ++ ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(width, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(height, CGFloat) ++ ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(minWidth, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(maxWidth, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(minHeight, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(maxHeight, CGFloat) ++ ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(borderTopWidth, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(borderRightWidth, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(borderBottomWidth, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(borderLeftWidth, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(borderWidth, CGFloat) ++ ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(marginTop, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(marginRight, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(marginBottom, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(marginLeft, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(marginVertical, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(marginHorizontal, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(margin, CGFloat) ++ ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(paddingTop, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(paddingRight, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(paddingBottom, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(paddingLeft, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(paddingVertical, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(paddingHorizontal, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(padding, CGFloat) ++ ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(flex, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(flexGrow, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(flexShrink, CGFloat) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(flexBasis, CGFloat) ++ ++// hplayout ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(flexDirection, FlexDirection) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(flexWrap, FlexWrapMode) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(justifyContent, FlexAlign) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(alignItems, FlexAlign) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(alignSelf, FlexAlign) ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(position, PositionType) ++ ++NATIVE_RENDER_REMAP_RENDER_OBJECT_PROPERTY(display, displayType, DisplayType) ++ ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(overflow, OverflowType) ++ ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(onLayout, NativeRenderDirectEventBlock) ++ ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onDidMount, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onDidUnmount, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onAttachedToWindow, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onDetachedFromWindow, NativeRenderDirectEventBlock) ++ ++NATIVE_RENDER_EXPORT_RENDER_OBJECT_PROPERTY(zIndex, NSInteger) ++ ++- (HPDirection)convertDirection:(NSString *)direction { ++ if ([direction isEqualToString:@""rtl""]) { ++ return DirectionRTL; ++ } ++ else if ([direction isEqualToString:@""ltr""]) { ++ return DirectionLTR; ++ } ++ else { ++ return DirectionInherit; ++ } ++} ++ ++//NATIVE_RENDER_CUSTOM_VIEW_PROPERTY(direction, id, UIView) { ++// if (json) { ++// view.layoutDirection = [self convertDirection:json]; ++// } ++//} ++ ++NATIVE_RENDER_CUSTOM_RENDER_OBJECT_PROPERTY(direction, id, NativeRenderObjectView) { ++ if (json) { ++ view.layoutDirection = [self convertDirection:json]; ++ } ++} ++ ++@end ++ ++#import ++ ++static const char *init_props_identifier = ""init_props_identifier""; ++ ++@implementation NativeRenderViewManager (InitProps) ++ ++- (NSDictionary *)props { ++ return objc_getAssociatedObject(self, init_props_identifier); ++} ++ ++- (void)setProps:(NSDictionary *)props { ++ if (props == nil) { ++ return; ++ } ++ objc_setAssociatedObject(self, init_props_identifier, props, OBJC_ASSOCIATION_RETAIN); ++} ++ ++@end +diff --git a/renderer/native/ios/renderer/component/view/UIView+DirectionalLayout.h b/renderer/native/ios/renderer/component/view/UIView+DirectionalLayout.h +index c9c7ee19666..6a36e252b6f 100644 +--- a/renderer/native/ios/renderer/component/view/UIView+DirectionalLayout.h ++++ b/renderer/native/ios/renderer/component/view/UIView+DirectionalLayout.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +diff --git a/renderer/native/ios/renderer/component/view/UIView+DirectionalLayout.mm b/renderer/native/ios/renderer/component/view/UIView+DirectionalLayout.mm +index 0b7bb75e2ff..e4e961111d3 100644 +--- a/renderer/native/ios/renderer/component/view/UIView+DirectionalLayout.mm ++++ b/renderer/native/ios/renderer/component/view/UIView+DirectionalLayout.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -22,8 +22,8 @@ + + #import ""UIView+DirectionalLayout.h"" + #import ""objc/runtime.h"" +-#import ""HippyI18nUtils.h"" +-#import ""UIView+Hippy.h"" ++#import ""NativeRenderI18nUtils.h"" ++#import ""UIView+NativeRender.h"" + + @implementation UIView (DirectionalLayout) + +diff --git a/renderer/native/ios/renderer/component/view/UIView+HippyEvent.h b/renderer/native/ios/renderer/component/view/UIView+DomEvent.h +similarity index 55% +rename from renderer/native/ios/renderer/component/view/UIView+HippyEvent.h +rename to renderer/native/ios/renderer/component/view/UIView+DomEvent.h +index 25bf9020b36..bc8f925f36e 100644 +--- a/renderer/native/ios/renderer/component/view/UIView+HippyEvent.h ++++ b/renderer/native/ios/renderer/component/view/UIView+DomEvent.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,50 +21,50 @@ + */ + + #import +-#import ""HippyComponent.h"" +-#import ""HippyTouchesView.h"" ++#import ""NativeRenderComponentProtocol.h"" ++#import ""NativeRenderTouchesView.h"" + #include + + NS_ASSUME_NONNULL_BEGIN + + /** +- * A catagory to handle HippyTouchesProtocol +- * Empty implementation for [HippyTouchesProtocol addViewEvent:eventListener:], [HippyTouchesProtocol removeViewEvent] +- * Return NO for [HippyTouchesProtocol canBePreventedByInCapturing:], [HippyTouchesProtocol canBePreventedByInCapturing:] +- * Return NULL for [HippyTouchesProtocol eventListenerForEventType:] ++ * A catagory to handle NativeRenderTouchesProtocol ++ * Empty implementation for [NativeRenderTouchesProtocol addViewEvent:eventListener:], [NativeRenderTouchesProtocol removeViewEvent] ++ * Return NO for [NativeRenderTouchesProtocol canBePreventedByInCapturing:], [NativeRenderTouchesProtocol canBePreventedByInCapturing:] ++ * Return NULL for [NativeRenderTouchesProtocol eventListenerForEventType:] + */ + +-@interface UIView(HippyEvent) ++@interface UIView(DomEvent) + + /** +- * add status change event for view ++ * Add custom property event for view + * @param name event name + * @param callback event call back for event + */ +-- (void)addStatusChangeEvent:(const std::string &)name eventCallback:(HippyDirectEventBlock)callback; ++- (void)addPropertyEvent:(const std::string &)name eventCallback:(NativeRenderDirectEventBlock)callback; + + /** +- * remove status change event for view ++ * Remove status change event for view + * @param name event name + */ +-- (void)removeStatusChangeEvent:(const std::string &)name; ++- (void)removePropertyEvent:(const std::string &)name; + + /** +- * notify view event has been added ++ * Notify view event has been added + * @param name event name + * @param callback event block + * + * @discussion The default implementation of this method is to trigger onDidMount event if it is onDidMount event + */ +-- (void)didAddStatusChangeEvent:(const std::string &)name eventCallback:(HippyDirectEventBlock)callback; ++- (void)didAddPropertyEvent:(const std::string &)name eventCallback:(NativeRenderDirectEventBlock)callback; + + /** +- * notify view event has been removed from view ++ * Notify view event has been removed from view + * @param name event name + * + * @discussion The default implementation of this method is to trigger onDidUnmount event if it is onDidUnmount event + */ +-- (void)didRemoveStatusChangeEvent:(const std::string &)name; ++- (void)didRemovePropertyEvent:(const std::string &)name; + + @end + +diff --git a/renderer/native/ios/renderer/component/view/UIView+HippyEvent.mm b/renderer/native/ios/renderer/component/view/UIView+DomEvent.mm +similarity index 73% +rename from renderer/native/ios/renderer/component/view/UIView+HippyEvent.mm +rename to renderer/native/ios/renderer/component/view/UIView+DomEvent.mm +index 79f41af0d73..176f07d4e21 100644 +--- a/renderer/native/ios/renderer/component/view/UIView+HippyEvent.mm ++++ b/renderer/native/ios/renderer/component/view/UIView+DomEvent.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,15 +20,15 @@ + * limitations under the License. + */ + +-#import ""UIView+HippyEvent.h"" ++#import ""UIView+DomEvent.h"" + #import + #import ""dom/dom_listener.h"" +-#import ""UIView+AppearEvent.h"" +-#import ""UIView+Hippy.h"" ++#import ""UIView+MountEvent.h"" ++#import ""UIView+NativeRender.h"" + +-@implementation UIView(HippyEvent) ++@implementation UIView(DomEvent) + +-- (void)addStatusChangeEvent:(const std::string &)name eventCallback:(HippyDirectEventBlock)callback { ++- (void)addPropertyEvent:(const std::string &)name eventCallback:(NativeRenderDirectEventBlock)callback { + //try to contrustor origin setter + char n = std::toupper(name.at(0)); + NSString *setterName = [NSString stringWithFormat:@""set%c%s:"", n, name.substr(1, name.length() - 1).c_str()]; +@@ -42,14 +42,14 @@ - (void)addStatusChangeEvent:(const std::string &)name eventCallback:(HippyDirec + [invocation setSelector:selector]; + [invocation setArgument:&cb atIndex:2]; + [invocation invoke]; +- [self didAddStatusChangeEvent:name eventCallback:callback]; ++ [self didAddPropertyEvent:name eventCallback:callback]; + } + } @catch (NSException *exception) { + + } + } + +-- (void)didAddStatusChangeEvent:(const std::string &)name eventCallback:(HippyDirectEventBlock)callback { ++- (void)didAddPropertyEvent:(const std::string &)name eventCallback:(NativeRenderDirectEventBlock)callback { + if (name == ""onDidMount"" ) { + [self viewDidMountEvent]; + } +@@ -58,38 +58,38 @@ - (void)didAddStatusChangeEvent:(const std::string &)name eventCallback:(HippyDi + } + } + +-- (void)removeStatusChangeEvent:(const std::string &)name { ++- (void)removePropertyEvent:(const std::string &)name { + //try to contrustor origin setter + char n = std::toupper(name.at(0)); + NSString *setterName = [NSString stringWithFormat:@""set%c%s:"", n, name.substr(1, name.length() - 1).c_str()]; + SEL selector = NSSelectorFromString(setterName); + @try { + if ([self respondsToSelector:selector]) { +- HippyDirectEventBlock cb = NULL; ++ NativeRenderDirectEventBlock cb = NULL; + NSMethodSignature *methodSign = [self methodSignatureForSelector:selector]; + NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:methodSign]; + [invocation setTarget:self]; + [invocation setSelector:selector]; + [invocation setArgument:&cb atIndex:2]; + [invocation invoke]; +- [self didRemoveStatusChangeEvent:name]; ++ [self didRemovePropertyEvent:name]; + } + } @catch (NSException *exception) { + + } + } + +-- (void)didRemoveStatusChangeEvent:(const std::string &)name { ++- (void)didRemovePropertyEvent:(const std::string &)name { + } + +-#pragma mark HippyTouchesProtocol Methods +-- (void)addViewEvent:(HippyViewEventType)touchEvent eventListener:(OnTouchEventHandler)listener {} ++#pragma mark NativeRenderTouchesProtocol Methods ++- (void)addViewEvent:(NativeRenderViewEventType)touchEvent eventListener:(OnTouchEventHandler)listener {} + +-- (OnTouchEventHandler)eventListenerForEventType:(HippyViewEventType)eventType { ++- (OnTouchEventHandler)eventListenerForEventType:(NativeRenderViewEventType)eventType { + return NULL; + } + +-- (void)removeViewEvent:(HippyViewEventType)touchEvent { ++- (void)removeViewEvent:(NativeRenderViewEventType)touchEvent { + } + + - (BOOL)canBePreventedByInCapturing:(const std::string &)name { +diff --git a/renderer/native/ios/renderer/component/view/UIView+AppearEvent.h b/renderer/native/ios/renderer/component/view/UIView+MountEvent.h +similarity index 55% +rename from renderer/native/ios/renderer/component/view/UIView+AppearEvent.h +rename to renderer/native/ios/renderer/component/view/UIView+MountEvent.h +index 12a12fbdbfc..2d224721e73 100644 +--- a/renderer/native/ios/renderer/component/view/UIView+AppearEvent.h ++++ b/renderer/native/ios/renderer/component/view/UIView+MountEvent.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,16 +21,18 @@ + */ + + #import +-#import ""HippyComponent.h"" ++#import ""NativeRenderComponentProtocol.h"" + +-@interface UIView (AppearEvent) ++@interface UIView (MountEvent) + +-@property (nonatomic, copy) HippyDirectEventBlock onAppear; +-@property (nonatomic, copy) HippyDirectEventBlock onDisappear; +-@property (nonatomic, copy) HippyDirectEventBlock onWillAppear; +-@property (nonatomic, copy) HippyDirectEventBlock onWillDisappear; +-@property (nonatomic, copy) HippyDirectEventBlock onDidMount; +-@property (nonatomic, copy) HippyDirectEventBlock onDidUnmount; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onAppear; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onDisappear; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onWillAppear; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onWillDisappear; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onDidMount; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onDidUnmount; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onAttachedToWindow; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onDetachedFromWindow; + + - (void)viewAppearEvent; + - (void)viewDisappearEvent; +@@ -39,4 +41,7 @@ + - (void)viewDidMountEvent; + - (void)viewDidUnmoundEvent; + ++- (void)sendAttachedToWindowEvent; ++- (void)sendDetachedFromWindowEvent; ++ + @end +diff --git a/renderer/native/ios/renderer/component/view/UIView+AppearEvent.m b/renderer/native/ios/renderer/component/view/UIView+MountEvent.m +similarity index 63% +rename from renderer/native/ios/renderer/component/view/UIView+AppearEvent.m +rename to renderer/native/ios/renderer/component/view/UIView+MountEvent.m +index c2c6d53bf13..b91c1e98e1a 100644 +--- a/renderer/native/ios/renderer/component/view/UIView+AppearEvent.m ++++ b/renderer/native/ios/renderer/component/view/UIView+MountEvent.m +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,26 +20,28 @@ + * limitations under the License. + */ + +-#import ""UIView+AppearEvent.h"" ++#import ""UIView+MountEvent.h"" + #import ""objc/runtime.h"" + +-@implementation UIView (AppearEvent) ++@implementation UIView (MountEvent) + +-#define LifeCycleEvent(setter, getter) \ +- - (void)setter:(HippyDirectEventBlock)getter { \ ++#define MountEvent(setter, getter) \ ++ - (void)setter:(NativeRenderDirectEventBlock)getter { \ + objc_setAssociatedObject(self, @selector(getter), getter, OBJC_ASSOCIATION_COPY); \ + } \ + \ +- - (HippyDirectEventBlock)getter { \ ++ - (NativeRenderDirectEventBlock)getter { \ + return objc_getAssociatedObject(self, @selector(getter)); \ + } + +-LifeCycleEvent(setOnAppear, onAppear) +-LifeCycleEvent(setOnDisappear, onDisappear) +-LifeCycleEvent(setOnWillAppear, onWillAppear) +-LifeCycleEvent(setOnWillDisappear, onWillDisappear) +-LifeCycleEvent(setOnDidMount, onDidMount) +-LifeCycleEvent(setOnDidUnmount, onDidUnmount) ++MountEvent(setOnAppear, onAppear) ++MountEvent(setOnDisappear, onDisappear) ++MountEvent(setOnWillAppear, onWillAppear) ++MountEvent(setOnWillDisappear, onWillDisappear) ++MountEvent(setOnDidMount, onDidMount) ++MountEvent(setOnDidUnmount, onDidUnmount) ++MountEvent(setOnAttachedToWindow, onAttachedToWindow) ++MountEvent(setOnDetachedFromWindow, onDetachedFromWindow) + + - (void)viewAppearEvent { + if (self.onAppear) { +@@ -75,4 +77,17 @@ - (void)viewDidUnmoundEvent { + self.onDidUnmount(@{}); + } + } ++ ++- (void)sendAttachedToWindowEvent { ++ if (self.onAttachedToWindow) { ++ self.onAttachedToWindow(nil); ++ } ++} ++ ++- (void)sendDetachedFromWindowEvent { ++ if (self.onDetachedFromWindow) { ++ self.onDetachedFromWindow(nil); ++ } ++} ++ + @end +diff --git a/renderer/native/ios/renderer/component/view/UIView+Hippy.h b/renderer/native/ios/renderer/component/view/UIView+NativeRender.h +similarity index 80% +rename from renderer/native/ios/renderer/component/view/UIView+Hippy.h +rename to renderer/native/ios/renderer/component/view/UIView+NativeRender.h +index 7b44d70c5d8..edd45be7acd 100644 +--- a/renderer/native/ios/renderer/component/view/UIView+Hippy.h ++++ b/renderer/native/ios/renderer/component/view/UIView+NativeRender.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,30 +21,23 @@ + */ + + #import +-#import ""HippyComponent.h"" +-#import ""HippyViewEventProtocol.h"" ++#import ""NativeRenderComponentProtocol.h"" + #include ""dom/dom_node.h"" + +-@class HippyShadowView; ++@class NativeRenderObjectView; + +-@interface UIView (Hippy) ++@interface UIView (NativeRender) + + /** +- * HippyComponent interface. ++ * NativeRenderComponent interface. + */ + - (NSArray *)hippySubviews; + - (UIView *)hippySuperview; + - (void)insertHippySubview:(UIView *)subview atIndex:(NSInteger)atIndex; + - (void)removeHippySubview:(UIView *)subview; + - (void)resetHippySubviews; +- ++- (void)clearSortedSubviews; + - (UIView *)hippyRootView; +- +-/** +- * HippyViewTouchHandlerProtocol interface. +- */ +-- (BOOL)interceptTouchEvent; +- + /** + * z-index, used to override sibling order in didUpdateHippySubviews. + */ +@@ -100,16 +93,6 @@ + */ + - (void)hippyAddControllerToClosestParent:(UIViewController *)controller; + +-/** +- * Responder overrides - to be deprecated. +- */ +-- (void)hippyWillMakeFirstResponder; +-- (void)hippyDidMakeFirstResponder; +-- (BOOL)hippyRespondsToTouch:(UITouch *)touch; +- +-- (void)sendAttachedToWindowEvent; +-- (void)sendDetachedFromWindowEvent; +- +-@property (nonatomic, weak) __kindof HippyShadowView *hippyShadowView; ++@property (nonatomic, weak) __kindof NativeRenderObjectView *nativeRenderObjectView; + + @end +diff --git a/renderer/native/ios/renderer/component/view/UIView+Hippy.mm b/renderer/native/ios/renderer/component/view/UIView+NativeRender.mm +similarity index 73% +rename from renderer/native/ios/renderer/component/view/UIView+Hippy.mm +rename to renderer/native/ios/renderer/component/view/UIView+NativeRender.mm +index aa743d1ba14..7f12c43bcf4 100644 +--- a/renderer/native/ios/renderer/component/view/UIView+Hippy.mm ++++ b/renderer/native/ios/renderer/component/view/UIView+NativeRender.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,19 +20,12 @@ + * limitations under the License. + */ + +-#import ""UIView+Hippy.h"" ++#import ""UIView+NativeRender.h"" + #import +-#import ""HippyShadowView.h"" +- +-#define HippyEventMethod(name, value, type) \ +- -(void)set##name : (type)value { \ +- objc_setAssociatedObject(self, @selector(value), value, OBJC_ASSOCIATION_COPY_NONATOMIC); \ +- } \ +- -(type)value { \ +- return objc_getAssociatedObject(self, _cmd); \ +- } ++#import ""NativeRenderObjectView.h"" ++#import ""UIView+MountEvent.h"" + +-@implementation UIView (Hippy) ++@implementation UIView (NativeRender) + + - (NSNumber *)hippyTag { + return objc_getAssociatedObject(self, _cmd); +@@ -50,22 +43,6 @@ - (void)setRootTag:(NSNumber *)rootTag { + objc_setAssociatedObject(self, @selector(rootTag), rootTag, OBJC_ASSOCIATION_COPY_NONATOMIC); + } + +-- (BOOL)onInterceptTouchEvent { +- return [objc_getAssociatedObject(self, _cmd) boolValue]; +-} +- +-- (void)setOnInterceptTouchEvent:(BOOL)onInterceptTouchEvent { +- objc_setAssociatedObject(self, @selector(onInterceptTouchEvent), @(onInterceptTouchEvent), OBJC_ASSOCIATION_RETAIN_NONATOMIC); +-} +- +-- (BOOL)onInterceptPullUpEvent { +- return [objc_getAssociatedObject(self, _cmd) boolValue]; +-} +- +-- (void)setOnInterceptPullUpEvent:(BOOL)onInterceptPullUpEvent { +- objc_setAssociatedObject(self, @selector(onInterceptPullUpEvent), @(onInterceptPullUpEvent), OBJC_ASSOCIATION_RETAIN_NONATOMIC); +-} +- + - (NSDictionary *)props { + return objc_getAssociatedObject(self, _cmd); + } +@@ -90,54 +67,29 @@ - (void)setTagName:(NSString *)tagName { + objc_setAssociatedObject(self, @selector(tagName), tagName, OBJC_ASSOCIATION_COPY_NONATOMIC); + } + +-- (void)setParent:(id)parent { ++- (void)setParent:(id)parent { + // self.superview = parent; + } + +-- (id)parent { ++- (id)parent { + return self.superview; + } + +-// clang-format off +-HippyEventMethod(OnClick, onClick, HippyDirectEventBlock) +-HippyEventMethod(OnPressIn, onPressIn, HippyDirectEventBlock) +-HippyEventMethod(OnPressOut, onPressOut, HippyDirectEventBlock) +-HippyEventMethod(OnLongClick, onLongClick, HippyDirectEventBlock) +-HippyEventMethod(OnTouchDown, onTouchDown, HippyDirectEventBlock) +-HippyEventMethod(OnTouchMove, onTouchMove, HippyDirectEventBlock) +-HippyEventMethod(OnTouchCancel, onTouchCancel, HippyDirectEventBlock) +-HippyEventMethod(OnTouchEnd, onTouchEnd, HippyDirectEventBlock) +-HippyEventMethod(OnAttachedToWindow, onAttachedToWindow, HippyDirectEventBlock) +-HippyEventMethod(OnDetachedFromWindow, onDetachedFromWindow, HippyDirectEventBlock) +-// clang-format on +- +-- (__kindof HippyShadowView *)hippyShadowView { ++- (__kindof NativeRenderObjectView *)nativeRenderObjectView { + NSHashTable *hashTable = objc_getAssociatedObject(self, _cmd); + return [hashTable anyObject]; + } + +-- (void)setHippyShadowView:(__kindof HippyShadowView *)shadowView { ++- (void)setNativeRenderObjectView:(__kindof NativeRenderObjectView *)renderObject { + NSHashTable *hashTable = [NSHashTable weakObjectsHashTable]; +- if (shadowView) { +- [hashTable addObject:shadowView]; +- } +- objc_setAssociatedObject(self, @selector(hippyShadowView), hashTable, OBJC_ASSOCIATION_RETAIN); +-} +- +-- (void)sendAttachedToWindowEvent { +- if (self.onAttachedToWindow) { +- self.onAttachedToWindow(nil); +- } +-} +- +-- (void)sendDetachedFromWindowEvent { +- if (self.onDetachedFromWindow) { +- self.onDetachedFromWindow(nil); ++ if (renderObject) { ++ [hashTable addObject:renderObject]; + } ++ objc_setAssociatedObject(self, @selector(nativeRenderObjectView), hashTable, OBJC_ASSOCIATION_RETAIN); + } + + - (BOOL)isHippyRootView { +- return HippyIsHippyRootView(self.hippyTag); ++ return NativeRenderIsHippyRootView(self.hippyTag); + } + + - (NSNumber *)hippyTagAtPoint:(CGPoint)point { +@@ -250,7 +202,6 @@ - (void)setHippySubviewsUpdated:(BOOL)hippySubViewsUpdated { + return subviews; + } + +-// private method, used to reset sort + - (void)clearSortedSubviews { + objc_setAssociatedObject(self, @selector(sortedHippySubviews), nil, OBJC_ASSOCIATION_RETAIN_NONATOMIC); + } +@@ -275,7 +226,7 @@ - (void)hippySetFrame:(CGRect)frame { + // Avoid crashes due to nan coords + if (isnan(position.x) || isnan(position.y) || isnan(bounds.origin.x) || isnan(bounds.origin.y) || isnan(bounds.size.width) + || isnan(bounds.size.height)) { +- //HippyLogError( ++ //NativeRenderLogError( + // @""Invalid layout for (%@)%@. position: %@. bounds: %@"", self.hippyTag, self, NSStringFromCGPoint(position), NSStringFromCGRect(bounds)); + return; + } +@@ -324,16 +275,4 @@ - (BOOL)interceptTouchEvent { + return NO; + } + +-/** +- * Responder overrides - to be deprecated. +- */ +-- (void)hippyWillMakeFirstResponder { +-} +-- (void)hippyDidMakeFirstResponder { +-} +- +-- (BOOL)hippyRespondsToTouch:(__unused UITouch *)touch { +- return YES; +-} +- + @end +diff --git a/renderer/native/ios/renderer/component/view/UIView+Private.h b/renderer/native/ios/renderer/component/view/UIView+Private.h +deleted file mode 100644 +index 01a18b15114..00000000000 +--- a/renderer/native/ios/renderer/component/view/UIView+Private.h ++++ /dev/null +@@ -1,36 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import +- +-@interface UIView (Private) +- +-// remove clipped subviews implementation +-- (void)hippy_remountAllSubviews; +-- (void)hippy_updateClippedSubviewsWithClipRect:(CGRect)clipRect relativeToView:(UIView *)clipView; +-- (UIView *)hippy_findClipView; +-- (UIView *)nextResponseViewAtPoint:(CGPoint)point; +- +-// zIndex sorting +-- (void)clearSortedSubviews; +- +-@end +diff --git a/renderer/native/ios/renderer/component/viewPager/HippyViewPagerManager.h b/renderer/native/ios/renderer/component/viewPager/HippyViewPagerManager.h +deleted file mode 100644 +index 1caf986fa33..00000000000 +--- a/renderer/native/ios/renderer/component/viewPager/HippyViewPagerManager.h ++++ /dev/null +@@ -1,28 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import +-#import ""HippyViewManager.h"" +- +-@interface HippyViewPagerManager : HippyViewManager +- +-@end +diff --git a/renderer/native/ios/renderer/component/viewPager/HippyViewPagerManager.mm b/renderer/native/ios/renderer/component/viewPager/HippyViewPagerManager.mm +deleted file mode 100644 +index 0478f79eae2..00000000000 +--- a/renderer/native/ios/renderer/component/viewPager/HippyViewPagerManager.mm ++++ /dev/null +@@ -1,72 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import ""HippyViewPagerManager.h"" +-#import ""HippyViewPager.h"" +- +-@implementation HippyViewPagerManager +- +-- (UIView *)view { +- return [HippyViewPager new]; +-} +- +-HIPPY_EXPORT_VIEW_PROPERTY(initialPage, NSInteger) +-HIPPY_EXPORT_VIEW_PROPERTY(scrollEnabled, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(loop, BOOL) +- +-HIPPY_EXPORT_VIEW_PROPERTY(onPageSelected, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onPageScroll, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onPageScrollStateChanged, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(bounces, BOOL) +- +-// clang-format off +-RENDER_COMPONENT_EXPORT_METHOD(setPage:(nonnull NSNumber *)hippyTag +- pageNumber:(__unused NSNumber *)pageNumber) { +- [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry){ +- UIView *view = viewRegistry[hippyTag]; +- +- if (view == nil || ![view isKindOfClass:[HippyViewPager class]]) { +-// HippyLogError(@""tried to setPage: on an error viewPager %@ "" +-// ""with tag #%@"", view, hippyTag); +- } +- NSInteger pageNumberInteger = pageNumber.integerValue; +- [(HippyViewPager *)view setPage:pageNumberInteger animated:YES]; +- }]; +-} +-// clang-format on +- +-// clang-format off +-RENDER_COMPONENT_EXPORT_METHOD(setPageWithoutAnimation:(nonnull NSNumber *)hippyTag +- pageNumber:(__unused NSNumber *)pageNumber) { +- [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry){ +- UIView *view = viewRegistry[hippyTag]; +- if (view == nil || ![view isKindOfClass:[HippyViewPager class]]) { +-// HippyLogError(@""tried to setPage: on an error viewPager %@ "" +-// ""with tag #%@"", view, hippyTag); +- } +- NSInteger pageNumberInteger = pageNumber.integerValue; +- [(HippyViewPager *)view setPage:pageNumberInteger animated:NO]; +- }]; +-} +-// clang-format on +- +-@end +diff --git a/renderer/native/ios/renderer/component/viewPager/HippyViewPager.h b/renderer/native/ios/renderer/component/viewPager/NativeRenderViewPager.h +similarity index 79% +rename from renderer/native/ios/renderer/component/viewPager/HippyViewPager.h +rename to renderer/native/ios/renderer/component/viewPager/NativeRenderViewPager.h +index 62d89d2c25d..0b1a71ceb81 100644 +--- a/renderer/native/ios/renderer/component/viewPager/HippyViewPager.h ++++ b/renderer/native/ios/renderer/component/viewPager/NativeRenderViewPager.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,7 +21,7 @@ + */ + + #import +-#import ""HippyScrollView.h"" ++#import ""NativeRenderScrollView.h"" + + /** + * A Callback block to indicate view pager's item count changed +@@ -29,10 +29,10 @@ + */ + typedef void (^ViewPagerItemsCountChanged)(NSUInteger count); + +-@interface HippyViewPager : UIScrollView +-@property (nonatomic, strong) HippyDirectEventBlock onPageSelected; +-@property (nonatomic, strong) HippyDirectEventBlock onPageScroll; +-@property (nonatomic, strong) HippyDirectEventBlock onPageScrollStateChanged; ++@interface NativeRenderViewPager : UIScrollView ++@property (nonatomic, strong) NativeRenderDirectEventBlock onPageSelected; ++@property (nonatomic, strong) NativeRenderDirectEventBlock onPageScroll; ++@property (nonatomic, strong) NativeRenderDirectEventBlock onPageScrollStateChanged; + + @property (nonatomic, assign) NSInteger initialPage; + @property (nonatomic, assign) CGPoint targetOffset; +diff --git a/renderer/native/ios/renderer/component/viewPager/HippyViewPager.mm b/renderer/native/ios/renderer/component/viewPager/NativeRenderViewPager.mm +similarity index 94% +rename from renderer/native/ios/renderer/component/viewPager/HippyViewPager.mm +rename to renderer/native/ios/renderer/component/viewPager/NativeRenderViewPager.mm +index 0ef1fca4656..f06f2ee6cc2 100644 +--- a/renderer/native/ios/renderer/component/viewPager/HippyViewPager.mm ++++ b/renderer/native/ios/renderer/component/viewPager/NativeRenderViewPager.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,14 +20,14 @@ + * limitations under the License. + */ + +-#import ""HippyViewPager.h"" ++#import ""NativeRenderViewPager.h"" + #import ""float.h"" +-#import ""HippyViewPagerItem.h"" +-#import ""UIView+Hippy.h"" ++#import ""NativeRenderViewPagerItem.h"" ++#import ""UIView+NativeRender.h"" + #import ""UIView+DirectionalLayout.h"" +-#import ""UIView+AppearEvent.h"" ++#import ""UIView+MountEvent.h"" + +-@interface HippyViewPager () ++@interface NativeRenderViewPager () + @property (nonatomic, strong) NSMutableArray *viewPagerItems; + @property (nonatomic, assign) BOOL isScrolling; + @property (nonatomic, assign) BOOL loadOnce; +@@ -46,7 +46,7 @@ @interface HippyViewPager () + + @end + +-@implementation HippyViewPager ++@implementation NativeRenderViewPager + #pragma mark life cycle + - (instancetype)initWithFrame:(CGRect)frame { + if ((self = [super initWithFrame:frame])) { +@@ -85,7 +85,7 @@ - (void)didMoveToSuperview { + + - (void)insertHippySubview:(UIView *)view atIndex:(NSInteger)atIndex { + if (atIndex > self.viewPagerItems.count) { +- //HippyLogWarn(@""Error In HippyViewPager: addSubview —— out of bound of array""); ++ //NativeRenderLogWarn(@""Error In NativeRenderViewPager: addSubview —— out of bound of array""); + return; + } + if (atIndex < [self.viewPagerItems count]) { +@@ -98,13 +98,13 @@ - (void)insertHippySubview:(UIView *)view atIndex:(NSInteger)atIndex { + [super insertHippySubview:view atIndex:(NSInteger)atIndex]; + [self.viewPagerItems insertObject:view atIndex:atIndex]; + +- if ([view isKindOfClass:[HippyViewPagerItem class]]) { +- HippyViewPagerItem *item = (HippyViewPagerItem *)view; +- __weak HippyViewPager *weakPager = self; ++ if ([view isKindOfClass:[NativeRenderViewPagerItem class]]) { ++ NativeRenderViewPagerItem *item = (NativeRenderViewPagerItem *)view; ++ __weak NativeRenderViewPager *weakPager = self; + __weak UIView *weakItem = item; + item.frameSetBlock = ^CGRect(CGRect frame) { + if (weakPager) { +- HippyViewPager *strongPager = weakPager; ++ NativeRenderViewPager *strongPager = weakPager; + UIView *strongItem = weakItem; + if (strongItem) { + NSUInteger index = [strongPager.viewPagerItems indexOfObject:strongItem]; +@@ -153,7 +153,7 @@ - (void)didUpdateHippySubviews { + #pragma mark hippy js call methods + - (void)setPage:(NSInteger)pageNumber animated:(BOOL)animated { + if (pageNumber >= self.viewPagerItems.count || pageNumber < 0) { +- //HippyLogWarn(@""Error In ViewPager setPage: pageNumber invalid""); ++ //NativeRenderLogWarn(@""Error In ViewPager setPage: pageNumber invalid""); + return; + } + +@@ -408,14 +408,14 @@ - (void)layoutSubviews { + } + + if (self.initialPage >= self.viewPagerItems.count) { +- //HippyLogWarn(@""Error In HippyViewPager: layoutSubviews""); ++ //NativeRenderLogWarn(@""Error In NativeRenderViewPager: layoutSubviews""); + self.contentSize = CGSizeZero; + return; + } + + UIView *lastViewPagerItem = self.viewPagerItems.lastObject; + if (!lastViewPagerItem) { +- //HippyLogWarn(@""Error In HippyViewPager: addSubview""); ++ //NativeRenderLogWarn(@""Error In NativeRenderViewPager: addSubview""); + self.contentSize = CGSizeZero; + return; + } +@@ -453,7 +453,7 @@ - (NSUInteger)nowPage { + } + + if (thePage < 0) { +- //HippyLogWarn(@""Error In ViewPager nowPage: thePage invalid""); ++ //NativeRenderLogWarn(@""Error In ViewPager nowPage: thePage invalid""); + return 0; + } else { + return (NSUInteger)thePage; +diff --git a/renderer/native/ios/renderer/component/viewPager/HippyViewPagerItem.h b/renderer/native/ios/renderer/component/viewPager/NativeRenderViewPagerItem.h +similarity index 87% +rename from renderer/native/ios/renderer/component/viewPager/HippyViewPagerItem.h +rename to renderer/native/ios/renderer/component/viewPager/NativeRenderViewPagerItem.h +index 21b2bc44c70..6990216cba5 100644 +--- a/renderer/native/ios/renderer/component/viewPager/HippyViewPagerItem.h ++++ b/renderer/native/ios/renderer/component/viewPager/NativeRenderViewPagerItem.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,11 +21,11 @@ + */ + + #import +-#import ""HippyTouchesView.h"" ++#import ""NativeRenderTouchesView.h"" + + typedef CGRect(^FrameSetBlock)(CGRect frame); + +-@interface HippyViewPagerItem : HippyTouchesView ++@interface NativeRenderViewPagerItem : NativeRenderTouchesView + + @property (nonatomic, copy)FrameSetBlock frameSetBlock; + +diff --git a/renderer/native/ios/renderer/component/viewPager/HippyViewPagerItem.mm b/renderer/native/ios/renderer/component/viewPager/NativeRenderViewPagerItem.mm +similarity index 89% +rename from renderer/native/ios/renderer/component/viewPager/HippyViewPagerItem.mm +rename to renderer/native/ios/renderer/component/viewPager/NativeRenderViewPagerItem.mm +index 4ab472e406b..b0a2541949f 100644 +--- a/renderer/native/ios/renderer/component/viewPager/HippyViewPagerItem.mm ++++ b/renderer/native/ios/renderer/component/viewPager/NativeRenderViewPagerItem.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,9 +20,9 @@ + * limitations under the License. + */ + +-#import ""HippyViewPagerItem.h"" ++#import ""NativeRenderViewPagerItem.h"" + +-@implementation HippyViewPagerItem ++@implementation NativeRenderViewPagerItem + + - (void)setFrame:(CGRect)frame { + CGRect finalFrame = frame; +diff --git a/renderer/native/ios/renderer/component/viewPager/HippyViewPagerItemManager.h b/renderer/native/ios/renderer/component/viewPager/NativeRenderViewPagerItemManager.h +similarity index 85% +rename from renderer/native/ios/renderer/component/viewPager/HippyViewPagerItemManager.h +rename to renderer/native/ios/renderer/component/viewPager/NativeRenderViewPagerItemManager.h +index b4bf380a26f..c9147306524 100644 +--- a/renderer/native/ios/renderer/component/viewPager/HippyViewPagerItemManager.h ++++ b/renderer/native/ios/renderer/component/viewPager/NativeRenderViewPagerItemManager.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,8 +21,8 @@ + */ + + #import +-#import ""HippyUIManager.h"" ++#import ""NativeRenderUIManager.h"" + +-@interface HippyViewPagerItemManager : HippyViewManager ++@interface NativeRenderViewPagerItemManager : NativeRenderViewManager + + @end +diff --git a/renderer/native/ios/renderer/component/viewPager/HippyViewPagerItemManager.mm b/renderer/native/ios/renderer/component/viewPager/NativeRenderViewPagerItemManager.mm +similarity index 78% +rename from renderer/native/ios/renderer/component/viewPager/HippyViewPagerItemManager.mm +rename to renderer/native/ios/renderer/component/viewPager/NativeRenderViewPagerItemManager.mm +index bac5caee851..62f9a729dc3 100644 +--- a/renderer/native/ios/renderer/component/viewPager/HippyViewPagerItemManager.mm ++++ b/renderer/native/ios/renderer/component/viewPager/NativeRenderViewPagerItemManager.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,13 +20,13 @@ + * limitations under the License. + */ + +-#import ""HippyViewPagerItemManager.h"" +-#import ""HippyViewPagerItem.h"" ++#import ""NativeRenderViewPagerItemManager.h"" ++#import ""NativeRenderViewPagerItem.h"" + +-@implementation HippyViewPagerItemManager ++@implementation NativeRenderViewPagerItemManager + + - (UIView *)view { +- return [HippyViewPagerItem new]; ++ return [NativeRenderViewPagerItem new]; + } + + @end +diff --git a/renderer/native/ios/utils/NSArray+HippyArrayDeepCopy.h b/renderer/native/ios/renderer/component/viewPager/NativeRenderViewPagerManager.h +similarity index 85% +rename from renderer/native/ios/utils/NSArray+HippyArrayDeepCopy.h +rename to renderer/native/ios/renderer/component/viewPager/NativeRenderViewPagerManager.h +index ead8331aaed..b4e22adfb23 100644 +--- a/renderer/native/ios/utils/NSArray+HippyArrayDeepCopy.h ++++ b/renderer/native/ios/renderer/component/viewPager/NativeRenderViewPagerManager.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,8 +21,8 @@ + */ + + #import +-#import ""HippyDeepCopyProtocol.h"" ++#import ""NativeRenderViewManager.h"" + +-@interface NSArray (HippyArrayDeepCopy) ++@interface NativeRenderViewPagerManager : NativeRenderViewManager + + @end +diff --git a/renderer/native/ios/renderer/component/viewPager/NativeRenderViewPagerManager.mm b/renderer/native/ios/renderer/component/viewPager/NativeRenderViewPagerManager.mm +new file mode 100644 +index 00000000000..f79cc481b65 +--- /dev/null ++++ b/renderer/native/ios/renderer/component/viewPager/NativeRenderViewPagerManager.mm +@@ -0,0 +1,72 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * NativeRender available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ""NativeRenderViewPagerManager.h"" ++#import ""NativeRenderViewPager.h"" ++ ++@implementation NativeRenderViewPagerManager ++ ++- (UIView *)view { ++ return [NativeRenderViewPager new]; ++} ++ ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(initialPage, NSInteger) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(scrollEnabled, BOOL) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(loop, BOOL) ++ ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onPageSelected, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onPageScroll, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onPageScrollStateChanged, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(bounces, BOOL) ++ ++// clang-format off ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(setPage:(nonnull NSNumber *)hippyTag ++ pageNumber:(__unused NSNumber *)pageNumber) { ++ [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry){ ++ UIView *view = viewRegistry[hippyTag]; ++ ++ if (view == nil || ![view isKindOfClass:[NativeRenderViewPager class]]) { ++// NativeRenderLogError(@""tried to setPage: on an error viewPager %@ "" ++// ""with tag #%@"", view, hippyTag); ++ } ++ NSInteger pageNumberInteger = pageNumber.integerValue; ++ [(NativeRenderViewPager *)view setPage:pageNumberInteger animated:YES]; ++ }]; ++} ++// clang-format on ++ ++// clang-format off ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(setPageWithoutAnimation:(nonnull NSNumber *)hippyTag ++ pageNumber:(__unused NSNumber *)pageNumber) { ++ [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry){ ++ UIView *view = viewRegistry[hippyTag]; ++ if (view == nil || ![view isKindOfClass:[NativeRenderViewPager class]]) { ++// NativeRenderLogError(@""tried to setPage: on an error viewPager %@ "" ++// ""with tag #%@"", view, hippyTag); ++ } ++ NSInteger pageNumberInteger = pageNumber.integerValue; ++ [(NativeRenderViewPager *)view setPage:pageNumberInteger animated:NO]; ++ }]; ++} ++// clang-format on ++ ++@end +diff --git a/renderer/native/ios/renderer/component/waterfalllist/HippyWatefallItemShadowView.h b/renderer/native/ios/renderer/component/waterfalllist/HippyWatefallItemShadowView.h +deleted file mode 100644 +index 6d85c548dd9..00000000000 +--- a/renderer/native/ios/renderer/component/waterfalllist/HippyWatefallItemShadowView.h ++++ /dev/null +@@ -1,31 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import ""HippyShadowView.h"" +- +-NS_ASSUME_NONNULL_BEGIN +- +-@interface HippyWatefallItemShadowView : HippyShadowView +- +-@end +- +-NS_ASSUME_NONNULL_END +diff --git a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallItemViewManager.h b/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallItemViewManager.h +deleted file mode 100644 +index d582f19dd6b..00000000000 +--- a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallItemViewManager.h ++++ /dev/null +@@ -1,31 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import ""HippyViewManager.h"" +- +-NS_ASSUME_NONNULL_BEGIN +- +-@interface HippyWaterfallItemViewManager : HippyViewManager +- +-@end +- +-NS_ASSUME_NONNULL_END +diff --git a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallViewManager.h b/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallViewManager.h +deleted file mode 100644 +index b405f50fae9..00000000000 +--- a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallViewManager.h ++++ /dev/null +@@ -1,31 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import ""HippyViewManager.h"" +- +-NS_ASSUME_NONNULL_BEGIN +- +-@interface HippyWaterfallViewManager : HippyViewManager +- +-@end +- +-NS_ASSUME_NONNULL_END +diff --git a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallViewManager.mm b/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallViewManager.mm +deleted file mode 100644 +index 1b025e1536d..00000000000 +--- a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallViewManager.mm ++++ /dev/null +@@ -1,143 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import ""HippyWaterfallViewManager.h"" +-#import ""HippyWaterfallView.h"" +- +-@implementation HippyWaterfallViewManager +- +-HIPPY_EXPORT_VIEW_PROPERTY(contentInset, UIEdgeInsets) +-HIPPY_EXPORT_VIEW_PROPERTY(numberOfColumns, NSInteger) +-HIPPY_EXPORT_VIEW_PROPERTY(preloadItemNumber, NSInteger) +-HIPPY_EXPORT_VIEW_PROPERTY(columnSpacing, CGFloat) +-HIPPY_EXPORT_VIEW_PROPERTY(interItemSpacing, CGFloat) +-HIPPY_EXPORT_VIEW_PROPERTY(onInitialListReady, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onEndReached, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onFooterAppeared, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onRefresh, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onExposureReport, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(containBannerView, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(containPullHeader, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(containPullFooter, BOOL) +-HIPPY_EXPORT_VIEW_PROPERTY(scrollEventThrottle, double) +-HIPPY_EXPORT_VIEW_PROPERTY(onScroll, HippyDirectEventBlock) +- +-- (UIView *)view { +- return [[HippyWaterfallView alloc] init]; +-} +- +-RENDER_COMPONENT_EXPORT_METHOD(refreshCompleted:(nonnull NSNumber *)reactTag +- status:(nonnull NSNumber *)status +- text:(nonnull NSString *)text +- duration:(nonnull NSNumber *)duration +- imageUrl:(nonnull NSString *)imageUrl) { +- [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { +- HippyWaterfallView *view = (HippyWaterfallView *)viewRegistry[reactTag]; +- if (view == nil) +- return; +- if (![view isKindOfClass:[HippyWaterfallView class]]) { +- //HippyLogError(@""Invalid view returned from registry, expecting QBRNWaterfallView, got: %@"", view); +- } +- [view refreshCompleted:status.integerValue text:text]; +- }]; +-} +- +-RENDER_COMPONENT_EXPORT_METHOD(startRefresh:(nonnull NSNumber *)reactTag) { +- [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { +- HippyWaterfallView *view = (HippyWaterfallView *)viewRegistry[reactTag]; +- if (view == nil) +- return; +- if (![view isKindOfClass:[HippyWaterfallView class]]) { +- //HippyLogError(@""Invalid view returned from registry, expecting QBRNWaterfallView, got: %@"", view); +- } +- [view startRefreshFromJS]; +- }]; +-} +- +-RENDER_COMPONENT_EXPORT_METHOD(startRefreshWithType:(nonnull NSNumber *)reactTag +- type:(NSNumber *)type) { +- [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { +- HippyWaterfallView *view = (HippyWaterfallView *)viewRegistry[reactTag]; +- if (view == nil) +- return; +- if (![view isKindOfClass:[HippyWaterfallView class]]) { +- //HippyLogError(@""Invalid view returned from registry, expecting QBRNWaterfallView, got: %@"", view); +- } +- [view startRefreshFromJSWithType:[type unsignedIntegerValue]]; +- }]; +-} +- +-RENDER_COMPONENT_EXPORT_METHOD(callExposureReport:(nonnull NSNumber *)reactTag) { +- [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { +- HippyWaterfallView *view = (HippyWaterfallView *)viewRegistry[reactTag]; +- if (view == nil) +- return; +- if (![view isKindOfClass:[HippyWaterfallView class]]) { +- //HippyLogError(@""Invalid view returned from registry, expecting QBRNWaterfallView, got: %@"", view); +- } +- [view callExposureReport]; +- }]; +-} +- +-RENDER_COMPONENT_EXPORT_METHOD(scrollToIndex:(nonnull NSNumber *)reactTag +- xIndex:(nonnull NSNumber *)xIndex +- yIndex:(nonnull NSNumber *)yIndex +- animation:(nonnull NSNumber *)animation) { +- [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { +- HippyWaterfallView *view = (HippyWaterfallView *)viewRegistry[reactTag]; +- if (view == nil) +- return; +- if (![view isKindOfClass:[HippyWaterfallView class]]) { +- //HippyLogError(@""Invalid view returned from registry, expecting QBRNWaterfallView, got: %@"", view); +- } +- [view scrollToIndex:xIndex.integerValue animated:[animation boolValue]]; +- }]; +-} +- +-RENDER_COMPONENT_EXPORT_METHOD(scrollToContentOffset:(nonnull NSNumber *)reactTag +- x:(nonnull NSNumber *)x +- y:(nonnull NSNumber *)y +- animation:(nonnull NSNumber *)animation) { +- [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { +- HippyWaterfallView *view = (HippyWaterfallView *)viewRegistry[reactTag]; +- if (view == nil) +- return; +- if (![view isKindOfClass:[HippyWaterfallView class]]) { +- //HippyLogError(@""Invalid view returned from registry, expecting QBRNWaterfallView, got: %@"", view); +- } +- [view scrollToOffset:CGPointMake([x floatValue], [y floatValue]) animated:[animation boolValue]]; +- }]; +-} +- +-RENDER_COMPONENT_EXPORT_METHOD(startLoadMore:(nonnull NSNumber *)reactTag) { +- [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { +- HippyWaterfallView *view = (HippyWaterfallView *)viewRegistry[reactTag]; +- if (view == nil) +- return; +- if (![view isKindOfClass:[HippyWaterfallView class]]) { +- //HippyLogError(@""Invalid view returned from registry, expecting QBRNWaterfallView, got: %@"", view); +- } +- [view startLoadMore]; +- }]; +-} +- +-@end +diff --git a/renderer/native/ios/renderer/component/waterfalllist/HippyCollectionViewWaterfallLayout.h b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderCollectionViewWaterfallLayout.h +similarity index 86% +rename from renderer/native/ios/renderer/component/waterfalllist/HippyCollectionViewWaterfallLayout.h +rename to renderer/native/ios/renderer/component/waterfalllist/NativeRenderCollectionViewWaterfallLayout.h +index eb7d90ed3ab..803340c9c7a 100644 +--- a/renderer/native/ios/renderer/component/waterfalllist/HippyCollectionViewWaterfallLayout.h ++++ b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderCollectionViewWaterfallLayout.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -25,10 +25,10 @@ + /** + * Enumerated structure to define direction in which items can be rendered. + */ +-typedef NS_ENUM(NSUInteger, HippyCollectionViewWaterfallLayoutItemRenderDirection) { +- HippyCollectionViewWaterfallLayoutItemRenderDirectionShortestFirst, +- HippyCollectionViewWaterfallLayoutItemRenderDirectionLeftToRight, +- HippyCollectionViewWaterfallLayoutItemRenderDirectionRightToLeft ++typedef NS_ENUM(NSUInteger, NativeRenderCollectionViewWaterfallLayoutItemRenderDirection) { ++ NativeRenderCollectionViewWaterfallLayoutItemRenderDirectionShortestFirst, ++ NativeRenderCollectionViewWaterfallLayoutItemRenderDirectionLeftToRight, ++ NativeRenderCollectionViewWaterfallLayoutItemRenderDirectionRightToLeft + }; + + /** +@@ -36,23 +36,23 @@ typedef NS_ENUM(NSUInteger, HippyCollectionViewWaterfallLayoutItemRenderDirectio + */ + + /// A supplementary view that identifies the header for a given section. +-extern NSString *const HippyCollectionElementKindSectionHeader; ++extern NSString *const NativeRenderCollectionElementKindSectionHeader; + /// A supplementary view that identifies the footer for a given section. +-extern NSString *const HippyCollectionElementKindSectionFooter; ++extern NSString *const NativeRenderCollectionElementKindSectionFooter; + +-#pragma mark - HippyCollectionViewDelegateWaterfallLayout ++#pragma mark - NativeRenderCollectionViewDelegateWaterfallLayout + +-@class HippyCollectionViewWaterfallLayout; ++@class NativeRenderCollectionViewWaterfallLayout; + + /** +- * The HippyCollectionViewDelegateWaterfallLayout protocol defines methods that let you coordinate with a +- * HippyCollectionViewWaterfallLayout object to implement a waterfall-based layout. ++ * The NativeRenderCollectionViewDelegateWaterfallLayout protocol defines methods that let you coordinate with a ++ * NativeRenderCollectionViewWaterfallLayout object to implement a waterfall-based layout. + * The methods of this protocol define the size of items. + * + * The waterfall layout object expects the collection view’s delegate object to adopt this protocol. + * Therefore, implement this protocol on object assigned to your collection view’s delegate property. + */ +-@protocol HippyCollectionViewDelegateWaterfallLayout ++@protocol NativeRenderCollectionViewDelegateWaterfallLayout + @required + /** + * Asks the delegate for the size of the specified item’s cell. +@@ -242,23 +242,23 @@ extern NSString *const HippyCollectionElementKindSectionFooter; + + @end + +-#pragma mark - HippyCollectionViewWaterfallLayout ++#pragma mark - NativeRenderCollectionViewWaterfallLayout + + /** +- * The HippyCollectionViewWaterfallLayout class is a concrete layout object that organizes items into waterfall-based grids ++ * The NativeRenderCollectionViewWaterfallLayout class is a concrete layout object that organizes items into waterfall-based grids + * with optional header and footer views for each section. + * + * A waterfall layout works with the collection view’s delegate object to determine the size of items, headers, and footers +- * in each section. That delegate object must conform to the `HippyCollectionViewDelegateWaterfallLayout` protocol. ++ * in each section. That delegate object must conform to the `NativeRenderCollectionViewDelegateWaterfallLayout` protocol. + * + * Each section in a waterfall layout can have its own custom header and footer. To configure the header or footer for a view, + * you must configure the height of the header or footer to be non zero. You can do this by implementing the appropriate delegate + * methods or by assigning appropriate values to the `headerHeight` and `footerHeight` properties. + * If the header or footer height is 0, the corresponding view is not added to the collection view. + * +- * @note HippyCollectionViewWaterfallLayout doesn't support decoration view, and it supports vertical scrolling direction only. ++ * @note NativeRenderCollectionViewWaterfallLayout doesn't support decoration view, and it supports vertical scrolling direction only. + */ +-@interface HippyCollectionViewWaterfallLayout : UICollectionViewLayout ++@interface NativeRenderCollectionViewWaterfallLayout : UICollectionViewLayout + + /** + * @brief How many columns for this layout. +@@ -335,13 +335,13 @@ extern NSString *const HippyCollectionElementKindSectionFooter; + /** + * @brief The direction in which items will be rendered in subsequent rows. + * @discussion +- * The direction in which each item is rendered. This could be left to right (HippyCollectionViewWaterfallLayoutItemRenderDirectionLeftToRight), +- * right to left (HippyCollectionViewWaterfallLayoutItemRenderDirectionRightToLeft), or shortest column fills first +- * (HippyCollectionViewWaterfallLayoutItemRenderDirectionShortestFirst). ++ * The direction in which each item is rendered. This could be left to right (NativeRenderCollectionViewWaterfallLayoutItemRenderDirectionLeftToRight), ++ * right to left (NativeRenderCollectionViewWaterfallLayoutItemRenderDirectionRightToLeft), or shortest column fills first ++ * (NativeRenderCollectionViewWaterfallLayoutItemRenderDirectionShortestFirst). + * +- * Default: HippyCollectionViewWaterfallLayoutItemRenderDirectionShortestFirst ++ * Default: NativeRenderCollectionViewWaterfallLayoutItemRenderDirectionShortestFirst + */ +-@property (nonatomic, assign) HippyCollectionViewWaterfallLayoutItemRenderDirection itemRenderDirection; ++@property (nonatomic, assign) NativeRenderCollectionViewWaterfallLayoutItemRenderDirection itemRenderDirection; + + /** + * @brief The minimum height of the collection view's content. +diff --git a/renderer/native/ios/renderer/component/waterfalllist/HippyCollectionViewWaterfallLayout.m b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderCollectionViewWaterfallLayout.m +similarity index 90% +rename from renderer/native/ios/renderer/component/waterfalllist/HippyCollectionViewWaterfallLayout.m +rename to renderer/native/ios/renderer/component/waterfalllist/NativeRenderCollectionViewWaterfallLayout.m +index ccda6ad053d..cfab3e87df5 100644 +--- a/renderer/native/ios/renderer/component/waterfalllist/HippyCollectionViewWaterfallLayout.m ++++ b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderCollectionViewWaterfallLayout.m +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,15 +20,15 @@ + * limitations under the License. + */ + +-#import ""HippyCollectionViewWaterfallLayout.h"" ++#import ""NativeRenderCollectionViewWaterfallLayout.h"" + #import ""tgmath.h"" + +-NSString *const HippyCollectionElementKindSectionHeader = @""HippyCollectionElementKindSectionHeader""; +-NSString *const HippyCollectionElementKindSectionFooter = @""HippyCollectionElementKindSectionFooter""; ++NSString *const NativeRenderCollectionElementKindSectionHeader = @""NativeRenderCollectionElementKindSectionHeader""; ++NSString *const NativeRenderCollectionElementKindSectionFooter = @""NativeRenderCollectionElementKindSectionFooter""; + +-@interface HippyCollectionViewWaterfallLayout () ++@interface NativeRenderCollectionViewWaterfallLayout () + /// The delegate will point to collection view's delegate automatically. +-@property (nonatomic, weak) id delegate; ++@property (nonatomic, weak) id delegate; + /// Array to store height for each column + @property (nonatomic, strong) NSMutableArray *columnHeights; + /// Array of arrays. Each array stores item attributes for each section +@@ -43,12 +43,12 @@ @interface HippyCollectionViewWaterfallLayout () + @property (nonatomic, strong) NSMutableArray *unionRects; + @end + +-@implementation HippyCollectionViewWaterfallLayout ++@implementation NativeRenderCollectionViewWaterfallLayout + + /// How many items to be union into a single rectangle + static const NSInteger unionSize = 20; + +-static CGFloat HippyFloorCGFloat(CGFloat value) { ++static CGFloat NativeRenderFloorCGFloat(CGFloat value) { + CGFloat scale = [UIScreen mainScreen].scale; + return floor(value * scale) / scale; + } +@@ -110,7 +110,7 @@ - (void)setSectionInset:(UIEdgeInsets)sectionInset { + } + } + +-- (void)setItemRenderDirection:(HippyCollectionViewWaterfallLayoutItemRenderDirection)itemRenderDirection { ++- (void)setItemRenderDirection:(NativeRenderCollectionViewWaterfallLayoutItemRenderDirection)itemRenderDirection { + if (_itemRenderDirection != itemRenderDirection) { + _itemRenderDirection = itemRenderDirection; + [self invalidateLayout]; +@@ -140,7 +140,7 @@ - (CGFloat)itemWidthInSectionAtIndex:(NSInteger)section { + columnSpacing = [self.delegate collectionView:self.collectionView layout:self minimumColumnSpacingForSectionAtIndex:section]; + } + +- return HippyFloorCGFloat((width - (columnCount - 1) * columnSpacing) / columnCount); ++ return NativeRenderFloorCGFloat((width - (columnCount - 1) * columnSpacing) / columnCount); + } + + #pragma mark - Private Accessors +@@ -186,8 +186,8 @@ - (NSMutableArray *)sectionItemAttributes { + return _sectionItemAttributes; + } + +-- (id)delegate { +- return (id)self.collectionView.delegate; ++- (id)delegate { ++ return (id)self.collectionView.delegate; + } + + #pragma mark - Init +@@ -200,7 +200,7 @@ - (void)commonInit { + _sectionInset = UIEdgeInsetsZero; + _headerInset = UIEdgeInsetsZero; + _footerInset = UIEdgeInsetsZero; +- _itemRenderDirection = HippyCollectionViewWaterfallLayoutItemRenderDirectionShortestFirst; ++ _itemRenderDirection = NativeRenderCollectionViewWaterfallLayoutItemRenderDirectionShortestFirst; + } + + - (id)init { +@@ -228,8 +228,8 @@ - (void)prepareLayout { + return; + } + +- NSAssert([self.delegate conformsToProtocol:@protocol(HippyCollectionViewDelegateWaterfallLayout)], +- @""UICollectionView's delegate should conform to HippyCollectionViewDelegateWaterfallLayout protocol""); ++ NSAssert([self.delegate conformsToProtocol:@protocol(NativeRenderCollectionViewDelegateWaterfallLayout)], ++ @""UICollectionView's delegate should conform to NativeRenderCollectionViewDelegateWaterfallLayout protocol""); + NSAssert(self.columnCount > 0 || [self.delegate respondsToSelector:@selector(collectionView:layout:columnCountForSection:)], + @""UICollectionViewWaterfallLayout's columnCount should be greater than 0, or delegate must implement columnCountForSection:""); + +@@ -371,7 +371,7 @@ - (void)createItemAttributesInSection:(NSInteger)section { + + CGFloat width = self.collectionView.bounds.size.width - sectionInset.left - sectionInset.right; + NSInteger columnCount = [self columnCountForSection:section]; +- CGFloat itemWidth = HippyFloorCGFloat((width - (columnCount - 1) * columnSpacing) / columnCount); ++ CGFloat itemWidth = NativeRenderFloorCGFloat((width - (columnCount - 1) * columnSpacing) / columnCount); + + NSInteger itemCount = [self.collectionView numberOfItemsInSection:section]; + NSMutableArray *itemAttributes = [NSMutableArray arrayWithCapacity:itemCount]; +@@ -383,7 +383,7 @@ - (void)createItemAttributesInSection:(NSInteger)section { + CGSize itemSize = [self.delegate collectionView:self.collectionView layout:self sizeForItemAtIndexPath:indexPath]; + CGFloat itemHeight = 0; + if (itemSize.height > 0 && itemSize.width > 0) { +- itemHeight = HippyFloorCGFloat(itemSize.height * itemWidth / itemSize.width); ++ itemHeight = NativeRenderFloorCGFloat(itemSize.height * itemWidth / itemSize.width); + } + + UICollectionViewLayoutAttributes *attributes = [UICollectionViewLayoutAttributes layoutAttributesForCellWithIndexPath:indexPath]; +@@ -405,7 +405,7 @@ - (void)createHeadersAttributeInSection:(NSInteger)section top:(CGFloat *)top { + + if (headerHeight > 0) { + UICollectionViewLayoutAttributes *attributes = +- [UICollectionViewLayoutAttributes layoutAttributesForSupplementaryViewOfKind:HippyCollectionElementKindSectionHeader ++ [UICollectionViewLayoutAttributes layoutAttributesForSupplementaryViewOfKind:NativeRenderCollectionElementKindSectionHeader + withIndexPath:[NSIndexPath indexPathForItem:0 inSection:section]]; + CGFloat startX = headerInset.left; + CGFloat width = self.collectionView.bounds.size.width - (headerInset.left + headerInset.right); +@@ -436,7 +436,7 @@ - (void)createFootersAttributeInSection:(NSInteger)section top:(CGFloat *)top { + + if (footerHeight > 0) { + UICollectionViewLayoutAttributes *attributes = +- [UICollectionViewLayoutAttributes layoutAttributesForSupplementaryViewOfKind:HippyCollectionElementKindSectionFooter ++ [UICollectionViewLayoutAttributes layoutAttributesForSupplementaryViewOfKind:NativeRenderCollectionElementKindSectionFooter + withIndexPath:[NSIndexPath indexPathForItem:0 inSection:section]]; + attributes.frame + = CGRectMake(footerInset.left, *top, self.collectionView.bounds.size.width - (footerInset.left + footerInset.right), footerHeight); +@@ -476,9 +476,9 @@ - (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSInde + + - (UICollectionViewLayoutAttributes *)layoutAttributesForSupplementaryViewOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath { + UICollectionViewLayoutAttributes *attribute = nil; +- if ([kind isEqualToString:HippyCollectionElementKindSectionHeader]) { ++ if ([kind isEqualToString:NativeRenderCollectionElementKindSectionHeader]) { + attribute = self.headersAttribute[@(indexPath.section)]; +- } else if ([kind isEqualToString:HippyCollectionElementKindSectionFooter]) { ++ } else if ([kind isEqualToString:NativeRenderCollectionElementKindSectionFooter]) { + attribute = self.footersAttribute[@(indexPath.section)]; + } + return attribute; +@@ -495,9 +495,9 @@ - (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect { + if (CGRectIntersectsRect(rect, attr.frame)) { + switch (attr.representedElementCategory) { + case UICollectionElementCategorySupplementaryView: +- if ([attr.representedElementKind isEqualToString:HippyCollectionElementKindSectionHeader]) { ++ if ([attr.representedElementKind isEqualToString:NativeRenderCollectionElementKindSectionHeader]) { + supplHeaderAttrDict[attr.indexPath] = attr; +- } else if ([attr.representedElementKind isEqualToString:HippyCollectionElementKindSectionFooter]) { ++ } else if ([attr.representedElementKind isEqualToString:NativeRenderCollectionElementKindSectionFooter]) { + supplFooterAttrDict[attr.indexPath] = attr; + } + break; +@@ -598,15 +598,15 @@ - (NSUInteger)nextColumnIndexForItem:(NSInteger)item inSection:(NSInteger)sectio + NSUInteger index = 0; + NSInteger columnCount = [self columnCountForSection:section]; + switch (self.itemRenderDirection) { +- case HippyCollectionViewWaterfallLayoutItemRenderDirectionShortestFirst: ++ case NativeRenderCollectionViewWaterfallLayoutItemRenderDirectionShortestFirst: + index = [self shortestColumnIndexInSection:section]; + break; + +- case HippyCollectionViewWaterfallLayoutItemRenderDirectionLeftToRight: ++ case NativeRenderCollectionViewWaterfallLayoutItemRenderDirectionLeftToRight: + index = (item % columnCount); + break; + +- case HippyCollectionViewWaterfallLayoutItemRenderDirectionRightToLeft: ++ case NativeRenderCollectionViewWaterfallLayoutItemRenderDirectionRightToLeft: + index = (columnCount - 1) - (item % columnCount); + break; + +diff --git a/renderer/native/ios/renderer/component/listview/HippyBaseListItemShadowView.h b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderObjectWatefallItem.h +similarity index 85% +rename from renderer/native/ios/renderer/component/listview/HippyBaseListItemShadowView.h +rename to renderer/native/ios/renderer/component/waterfalllist/NativeRenderObjectWatefallItem.h +index 99a7d1eee6f..547fc618bbf 100644 +--- a/renderer/native/ios/renderer/component/listview/HippyBaseListItemShadowView.h ++++ b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderObjectWatefallItem.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,11 +20,11 @@ + * limitations under the License. + */ + +-#import ""HippyShadowView.h"" ++#import ""NativeRenderObjectView.h"" + + NS_ASSUME_NONNULL_BEGIN + +-@interface HippyBaseListItemShadowView : HippyShadowView ++@interface NativeRenderObjectWatefallItem : NativeRenderObjectView + + @end + +diff --git a/renderer/native/ios/renderer/component/waterfalllist/HippyWatefallItemShadowView.mm b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderObjectWatefallItem.mm +similarity index 82% +rename from renderer/native/ios/renderer/component/waterfalllist/HippyWatefallItemShadowView.mm +rename to renderer/native/ios/renderer/component/waterfalllist/NativeRenderObjectWatefallItem.mm +index 6cf6e6575dc..5637138b738 100644 +--- a/renderer/native/ios/renderer/component/waterfalllist/HippyWatefallItemShadowView.mm ++++ b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderObjectWatefallItem.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,14 +20,14 @@ + * limitations under the License. + */ + +-#import ""HippyWatefallItemShadowView.h"" ++#import ""NativeRenderObjectWatefallItem.h"" + +-@implementation HippyWatefallItemShadowView ++@implementation NativeRenderObjectWatefallItem + + - (instancetype)init { + self = [super init]; + if (self) { +- self.creationType = HippyCreationTypeLazily; ++ self.creationType = NativeRenderCreationTypeLazily; + } + return self; + } +diff --git a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallItemView.h b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallItemView.h +similarity index 88% +rename from renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallItemView.h +rename to renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallItemView.h +index e36eeabd2c7..bd974b2c055 100644 +--- a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallItemView.h ++++ b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallItemView.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,11 +21,11 @@ + */ + + #import +-#import ""HippyView.h"" ++#import ""NativeRenderView.h"" + + NS_ASSUME_NONNULL_BEGIN + +-@interface HippyWaterfallItemView : HippyView ++@interface NativeRenderWaterfallItemView : NativeRenderView + + @property (nonatomic, copy) NSString *type; + +diff --git a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallItemView.mm b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallItemView.mm +similarity index 87% +rename from renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallItemView.mm +rename to renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallItemView.mm +index 4cecf6ee905..b0e769236d6 100644 +--- a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallItemView.mm ++++ b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallItemView.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,10 +20,10 @@ + * limitations under the License. + */ + +-#import ""HippyWaterfallItemView.h"" +-#import ""UIView+Hippy.h"" ++#import ""NativeRenderWaterfallItemView.h"" ++#import ""UIView+NativeRender.h"" + +-@implementation HippyWaterfallItemView ++@implementation NativeRenderWaterfallItemView + + - (instancetype)initWithFrame:(CGRect)frame { + if (self = [super initWithFrame:frame]) { +diff --git a/renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallItemViewManager.h b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallItemViewManager.h +new file mode 100644 +index 00000000000..219a9697d5f +--- /dev/null ++++ b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallItemViewManager.h +@@ -0,0 +1,31 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * NativeRender available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ""NativeRenderViewManager.h"" ++ ++NS_ASSUME_NONNULL_BEGIN ++ ++@interface NativeRenderWaterfallItemViewManager : NativeRenderViewManager ++ ++@end ++ ++NS_ASSUME_NONNULL_END +diff --git a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallItemViewManager.mm b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallItemViewManager.mm +similarity index 67% +rename from renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallItemViewManager.mm +rename to renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallItemViewManager.mm +index fe0ab26e02b..36351aef71e 100644 +--- a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallItemViewManager.mm ++++ b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallItemViewManager.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,18 +20,18 @@ + * limitations under the License. + */ + +-#import ""HippyWaterfallItemViewManager.h"" +-#import ""HippyWaterfallItemView.h"" +-#import ""HippyWatefallItemShadowView.h"" ++#import ""NativeRenderWaterfallItemViewManager.h"" ++#import ""NativeRenderWaterfallItemView.h"" ++#import ""NativeRenderObjectWatefallItem.h"" + +-@implementation HippyWaterfallItemViewManager ++@implementation NativeRenderWaterfallItemViewManager + + - (UIView *)view { +- return [HippyWaterfallItemView new]; ++ return [NativeRenderWaterfallItemView new]; + } + +-- (HippyShadowView *)shadowView { +- return [[HippyWatefallItemShadowView alloc] init]; ++- (NativeRenderObjectView *)nativeRenderObjectView { ++ return [[NativeRenderObjectWatefallItem alloc] init]; + } + + @end +diff --git a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallView.h b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallView.h +similarity index 63% +rename from renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallView.h +rename to renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallView.h +index 71ca82fbcad..2a8281a5cf1 100644 +--- a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallView.h ++++ b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallView.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,53 +21,53 @@ + */ + + #import +-#import ""HippyView.h"" +-#import ""HippyScrollableProtocol.h"" +-#import ""HippyTouchesView.h"" +-#import ""HippyCollectionViewWaterfallLayout.h"" +-#import ""HippyScrollProtocol.h"" ++#import ""NativeRenderView.h"" ++#import ""NativeRenderScrollableProtocol.h"" ++#import ""NativeRenderTouchesView.h"" ++#import ""NativeRenderCollectionViewWaterfallLayout.h"" ++#import ""NativeRenderScrollProtocol.h"" + + NS_ASSUME_NONNULL_BEGIN + +-@class HippyWaterfallViewDataSource, HippyHeaderRefresh, HippyFooterRefresh; ++@class NativeRenderWaterfallViewDataSource, NativeRenderHeaderRefresh, NativeRenderFooterRefresh; + +-typedef NS_ENUM(NSInteger, HippyScrollState) { ++typedef NS_ENUM(NSInteger, NativeRenderScrollState) { + ScrollStateStop, + ScrollStateDraging, + ScrollStateScrolling + }; + + /** +- * HippyWaterfallView is a waterfall component, internal implementation is UICollectionView ++ * NativeRenderWaterfallView is a waterfall component, internal implementation is UICollectionView + */ +-@interface HippyWaterfallView : HippyTouchesView { +- HippyWaterfallViewDataSource *_dataSource; ++@interface NativeRenderWaterfallView : NativeRenderTouchesView { ++ NativeRenderWaterfallViewDataSource *_dataSource; + @protected + NSMapTable *_weakItemMap; + NSMutableDictionary *_cachedItems; + double _lastOnScrollEventTimeInterval; +- HippyHeaderRefresh *_headerRefreshView; +- HippyFooterRefresh *_footerRefreshView; ++ NativeRenderHeaderRefresh *_headerRefreshView; ++ NativeRenderFooterRefresh *_footerRefreshView; + } + + /** +- * Content inset for HippyWaterfallView ++ * Content inset for NativeRenderWaterfallView + */ + @property(nonatomic, assign) UIEdgeInsets contentInset; + + /** +- * Number of columns for HippyWaterfallView ++ * Number of columns for NativeRenderWaterfallView + */ + @property(nonatomic, assign) NSInteger numberOfColumns; + + /** +- * Column spacing for HippyWaterfallView ++ * Column spacing for NativeRenderWaterfallView + */ + @property(nonatomic, assign) CGFloat columnSpacing; + + /** +- * Item spacing for HippyWaterfallView ++ * Item spacing for NativeRenderWaterfallView + */ + @property(nonatomic, assign) CGFloat interItemSpacing; + +@@ -92,9 +92,9 @@ typedef NS_ENUM(NSInteger, HippyScrollState) { + @property(nonatomic, strong) __kindof UICollectionView *collectionView; + + /** +- * Get data source for HippyWaterfallView ++ * Get data source for NativeRenderWaterfallView + */ +-@property(nonatomic, readonly)HippyWaterfallViewDataSource *dataSource; ++@property(nonatomic, readonly)NativeRenderWaterfallViewDataSource *dataSource; + + /** + * Indicate whether components is scrolling manully +@@ -102,14 +102,14 @@ typedef NS_ENUM(NSInteger, HippyScrollState) { + @property(nonatomic, assign) BOOL manualScroll; + + /** +- * Hippy Events ++ * NativeRender Events + */ +-@property (nonatomic, copy) HippyDirectEventBlock onScroll; +-@property (nonatomic, copy) HippyDirectEventBlock onInitialListReady; +-@property (nonatomic, copy) HippyDirectEventBlock onEndReached; +-@property (nonatomic, copy) HippyDirectEventBlock onFooterAppeared; +-@property (nonatomic, copy) HippyDirectEventBlock onRefresh; +-@property (nonatomic, copy) HippyDirectEventBlock onExposureReport; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onScroll; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onInitialListReady; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onEndReached; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onFooterAppeared; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onRefresh; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onExposureReport; + + - (NSUInteger)maxCachedItemCount; + +@@ -137,18 +137,18 @@ typedef NS_ENUM(NSInteger, HippyScrollState) { + - (NSString *)compoentItemName; + + /** +- * Indicate layout instance for HippyWatefallView ++ * Indicate layout instance for NativeRenderWatefallView + */ + - (__kindof UICollectionViewLayout *)collectionViewLayout; + + /** +- * Called when HippyWaterfallView register its cell class ++ * Called when NativeRenderWaterfallView register its cell class + * Override it if custom cell is needed + */ + - (void)registerCells; + + /** +- * Called when HippyWaterfallView register its supplementary views ++ * Called when NativeRenderWaterfallView register its supplementary views + * Override it if custome supplementary view is needed + */ + - (void)registerSupplementaryViews; +@@ -194,8 +194,8 @@ typedef NS_ENUM(NSInteger, HippyScrollState) { + /** + * Size for item at index path + * +- * @param collectionView Internal collection view for HippyCollectionView +- * @param collectionViewLayout Layout configuration for HippyCollectionView ++ * @param collectionView Internal collection view for NativeRenderCollectionView ++ * @param collectionViewLayout Layout configuration for NativeRenderCollectionView + * @param indexPath Index path of item + * + * @return Size for item at index path +@@ -206,8 +206,8 @@ typedef NS_ENUM(NSInteger, HippyScrollState) { + /** + * Column count for section + * +- * @param collectionView Internal collection view for HippyCollectionView +- * @param collectionViewLayout Layout configuration for HippyCollectionView ++ * @param collectionView Internal collection view for NativeRenderCollectionView ++ * @param collectionViewLayout Layout configuration for NativeRenderCollectionView + * @param section index of section to get column count + * + * @return Column count for section +@@ -218,8 +218,8 @@ typedef NS_ENUM(NSInteger, HippyScrollState) { + /** + * Edge insets for section + * +- * @param collectionView Internal collection view for HippyCollectionView +- * @param collectionViewLayout Layout configuration for HippyCollectionView ++ * @param collectionView Internal collection view for NativeRenderCollectionView ++ * @param collectionViewLayout Layout configuration for NativeRenderCollectionView + * @param section index of section to get edge insets + * + * @return Edge insets for section +diff --git a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallView.mm b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallView.mm +similarity index 87% +rename from renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallView.mm +rename to renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallView.mm +index a2b0bb9eac5..22874649c73 100644 +--- a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallView.mm ++++ b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallView.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,31 +20,31 @@ + * limitations under the License. + */ + +-#import ""HippyWaterfallView.h"" +-#import ""HippyHeaderRefresh.h"" +-#import ""HippyFooterRefresh.h"" +-#import ""HippyWaterfallItemView.h"" +-#import ""UIView+Hippy.h"" +-#import ""HippyRefresh.h"" +-#import ""HippyWaterfallViewDataSource.h"" +-#import ""HippyShadowView.h"" +-#import ""HippyUIManager.h"" ++#import ""NativeRenderWaterfallView.h"" ++#import ""NativeRenderHeaderRefresh.h"" ++#import ""NativeRenderFooterRefresh.h"" ++#import ""NativeRenderWaterfallItemView.h"" ++#import ""UIView+NativeRender.h"" ++#import ""NativeRenderRefresh.h"" ++#import ""NativeRenderWaterfallViewDataSource.h"" ++#import ""NativeRenderObjectView.h"" ++#import ""NativeRenderUIManager.h"" + #import ""UIView+Render.h"" +-#import ""HippyListTableView.h"" +-#import ""HippyWaterfallViewCell.h"" ++#import ""NativeRenderListTableView.h"" ++#import ""NativeRenderWaterfallViewCell.h"" + + static NSString *kCellIdentifier = @""cellIdentifier""; + + static NSString *kWaterfallItemName = @""WaterfallItem""; + +-@interface HippyWaterfallView () { ++@interface NativeRenderWaterfallView () { + NSHashTable> *_scrollListeners; + BOOL _isInitialListReady; + UIColor *_backgroundColor; + BOOL _manualScroll; + } + +-@property (nonatomic, strong) HippyCollectionViewWaterfallLayout *layout; ++@property (nonatomic, strong) NativeRenderCollectionViewWaterfallLayout *layout; + + @property (nonatomic, assign) NSInteger initialListSize; + @property (nonatomic, assign) BOOL containBannerView; +@@ -54,7 +54,7 @@ @interface HippyWaterfallView () *visibleItems = [self indexPathsForVisibleItems]; + if ([visibleItems count] > 0) { + CGPoint offset = self.collectionView.contentOffset; +@@ -496,7 +496,7 @@ - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL + if (!decelerate) { + _manualScroll = NO; + if (self.onExposureReport) { +- HippyScrollState state = scrollView.decelerating ? ScrollStateScrolling : ScrollStateStop; ++ NativeRenderScrollState state = scrollView.decelerating ? ScrollStateScrolling : ScrollStateStop; + NSDictionary *exposureInfo = [self scrollEventDataWithState:state]; + self.onExposureReport(exposureInfo); + } +@@ -563,7 +563,7 @@ - (BOOL)scrollViewShouldScrollToTop:(UIScrollView *)scrollViewxt { + - (void)scrollViewDidScrollToTop:(UIScrollView *)scrollView { + } + +-- (void)tableViewDidLayoutSubviews:(HippyListTableView *)tableView { ++- (void)tableViewDidLayoutSubviews:(NativeRenderListTableView *)tableView { + + } + +@@ -583,7 +583,7 @@ - (void)callExposureReport { + BOOL isDragging = self.collectionView.isDragging; + BOOL isDecelerating = self.collectionView.isDecelerating; + BOOL isScrolling = isDragging || isDecelerating; +- HippyScrollState state = isScrolling ? ScrollStateScrolling : ScrollStateStop; ++ NativeRenderScrollState state = isScrolling ? ScrollStateScrolling : ScrollStateStop; + NSDictionary *result = [self scrollEventDataWithState:state]; + if (self.onExposureReport) { + self.onExposureReport(result); +diff --git a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallViewCell.h b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallViewCell.h +similarity index 87% +rename from renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallViewCell.h +rename to renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallViewCell.h +index d1132f9d489..9fb0052fa47 100644 +--- a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallViewCell.h ++++ b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallViewCell.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,11 +21,11 @@ + */ + + #import +-#import ""HippyShadowView.h"" ++#import ""NativeRenderObjectView.h"" + + NS_ASSUME_NONNULL_BEGIN + +-@interface HippyWaterfallViewCell : UICollectionViewCell ++@interface NativeRenderWaterfallViewCell : UICollectionViewCell + + @property (nonatomic, weak) UIView *cellView; + +diff --git a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallViewCell.mm b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallViewCell.mm +similarity index 91% +rename from renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallViewCell.mm +rename to renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallViewCell.mm +index 1abee292264..312920c13b4 100644 +--- a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallViewCell.mm ++++ b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallViewCell.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,12 +20,12 @@ + * limitations under the License. + */ + +-#import ""HippyWaterfallViewCell.h"" ++#import ""NativeRenderWaterfallViewCell.h"" + #import ""objc/runtime.h"" + + static const NSInteger CellTag = 10089; + +-@implementation HippyWaterfallViewCell ++@implementation NativeRenderWaterfallViewCell + + - (UIView *)cellView { + return [self.contentView viewWithTag:CellTag]; +diff --git a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallViewDataSource.h b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallViewDataSource.h +similarity index 69% +rename from renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallViewDataSource.h +rename to renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallViewDataSource.h +index e3c9fa93639..eab37347bdc 100644 +--- a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallViewDataSource.h ++++ b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallViewDataSource.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -24,20 +24,20 @@ + + NS_ASSUME_NONNULL_BEGIN + +-@class HippyShadowView; ++@class NativeRenderObjectView; + +-@interface HippyWaterfallViewDataSource : NSObject ++@interface NativeRenderWaterfallViewDataSource : NSObject + + @property(nonatomic, readonly) BOOL containBannerView; +-@property(nonatomic, readonly) HippyShadowView *bannerView; ++@property(nonatomic, readonly) NativeRenderObjectView *bannerView; + @property(nonatomic, copy) NSString *itemViewName; + +-- (void)setDataSource:(NSArray *)dataSource containBannerView:(BOOL)containBannerView; +-- (HippyShadowView *)cellForIndexPath:(NSIndexPath *)indexPath; +-- (HippyShadowView *)headerForSection:(NSInteger)section; ++- (void)setDataSource:(NSArray *)dataSource containBannerView:(BOOL)containBannerView; ++- (NativeRenderObjectView *)cellForIndexPath:(NSIndexPath *)indexPath; ++- (NativeRenderObjectView *)headerForSection:(NSInteger)section; + - (NSInteger)numberOfSection; + - (NSInteger)numberOfCellForSection:(NSInteger)section; +-- (NSIndexPath *)indexPathOfCell:(HippyShadowView *)cell; ++- (NSIndexPath *)indexPathOfCell:(NativeRenderObjectView *)cell; + - (NSIndexPath *)indexPathForFlatIndex:(NSInteger)index; + - (NSInteger)flatIndexForIndexPath:(NSIndexPath *)indexPath; + +diff --git a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallViewDataSource.mm b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallViewDataSource.mm +similarity index 65% +rename from renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallViewDataSource.mm +rename to renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallViewDataSource.mm +index 28430e9c497..d5736fa3a81 100644 +--- a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallViewDataSource.mm ++++ b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallViewDataSource.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,19 +20,19 @@ + * limitations under the License. + */ + +-#import ""HippyWaterfallViewDataSource.h"" +-#import ""HippyShadowView.h"" ++#import ""NativeRenderWaterfallViewDataSource.h"" ++#import ""NativeRenderObjectView.h"" + #import + +-@interface HippyWaterfallViewDataSource () { ++@interface NativeRenderWaterfallViewDataSource () { + BOOL _containBannerView; +- NSArray *_cellShadowViews; +- HippyShadowView *_bannerView; ++ NSArray *_cellRenderObjectViews; ++ NativeRenderObjectView *_bannerView; + } + + @end + +-@implementation HippyWaterfallViewDataSource ++@implementation NativeRenderWaterfallViewDataSource + + - (instancetype)init { + self = [super init]; +@@ -41,47 +41,47 @@ - (instancetype)init { + return self; + } + +-- (void)setDataSource:(NSArray *)dataSource { ++- (void)setDataSource:(NSArray *)dataSource { + [self setDataSource:dataSource containBannerView:NO]; + } + +-- (void)setDataSource:(NSArray *)dataSource containBannerView:(BOOL)containBannerView { ++- (void)setDataSource:(NSArray *)dataSource containBannerView:(BOOL)containBannerView { + _containBannerView = containBannerView; + if ([dataSource count] > 0) { + if (containBannerView) { + _bannerView = [dataSource firstObject]; + } +- NSArray *candidateCellShadowViews = [dataSource subarrayWithRange:NSMakeRange(1, [dataSource count] - 1)]; ++ NSArray *candidateRenderObjectViews = [dataSource subarrayWithRange:NSMakeRange(1, [dataSource count] - 1)]; + NSString *viewName = self.itemViewName; + static dispatch_once_t onceToken; + static NSPredicate *prediate = nil; + dispatch_once(&onceToken, ^{ + prediate = [NSPredicate predicateWithBlock:^BOOL(id _Nullable evaluatedObject, NSDictionary * _Nullable bindings) { +- HippyShadowView *shadowView = (HippyShadowView *)evaluatedObject; +- if ([shadowView.viewName isEqualToString:viewName]) { ++ NativeRenderObjectView *renderObjectView = (NativeRenderObjectView *)evaluatedObject; ++ if ([renderObjectView.viewName isEqualToString:viewName]) { + return YES; + } + return NO; + }]; + }); +- _cellShadowViews = [candidateCellShadowViews filteredArrayUsingPredicate:prediate]; ++ _cellRenderObjectViews = [candidateRenderObjectViews filteredArrayUsingPredicate:prediate]; + } + } + +--(HippyShadowView *)bannerView { ++-(NativeRenderObjectView *)bannerView { + return _bannerView; + } + +-- (HippyShadowView *)cellForIndexPath:(NSIndexPath *)indexPath { ++- (NativeRenderObjectView *)cellForIndexPath:(NSIndexPath *)indexPath { + if (_containBannerView && 0 == [indexPath section]) { + return _bannerView; + } + else { +- return [_cellShadowViews objectAtIndex:[indexPath row]]; ++ return [_cellRenderObjectViews objectAtIndex:[indexPath row]]; + } + } + +-- (HippyShadowView *)headerForSection:(NSInteger)section { ++- (NativeRenderObjectView *)headerForSection:(NSInteger)section { + return nil; + } + +@@ -91,24 +91,24 @@ - (NSInteger)numberOfSection { + + - (NSInteger)numberOfCellForSection:(NSInteger)section { + if (_containBannerView) { +- return 0 == section ? 1 : [_cellShadowViews count]; ++ return 0 == section ? 1 : [_cellRenderObjectViews count]; + } + else { +- return [_cellShadowViews count]; ++ return [_cellRenderObjectViews count]; + } + } + +-- (NSIndexPath *)indexPathOfCell:(HippyShadowView *)cell { ++- (NSIndexPath *)indexPathOfCell:(NativeRenderObjectView *)cell { + NSInteger row = 0; + NSInteger section = 0; + if (_containBannerView) { + if (_bannerView != cell) { + section = 1; +- row = [_cellShadowViews indexOfObject:cell]; ++ row = [_cellRenderObjectViews indexOfObject:cell]; + } + } + else { +- row = [_cellShadowViews indexOfObject:cell]; ++ row = [_cellRenderObjectViews indexOfObject:cell]; + } + return [NSIndexPath indexPathForRow:row inSection:section]; + } +diff --git a/renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallViewManager.h b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallViewManager.h +new file mode 100644 +index 00000000000..0036e2a6a59 +--- /dev/null ++++ b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallViewManager.h +@@ -0,0 +1,31 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * NativeRender available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ""NativeRenderViewManager.h"" ++ ++NS_ASSUME_NONNULL_BEGIN ++ ++@interface NativeRenderWaterfallViewManager : NativeRenderViewManager ++ ++@end ++ ++NS_ASSUME_NONNULL_END +diff --git a/renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallViewManager.mm b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallViewManager.mm +new file mode 100644 +index 00000000000..bd96f8f7147 +--- /dev/null ++++ b/renderer/native/ios/renderer/component/waterfalllist/NativeRenderWaterfallViewManager.mm +@@ -0,0 +1,143 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * NativeRender available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ""NativeRenderWaterfallViewManager.h"" ++#import ""NativeRenderWaterfallView.h"" ++ ++@implementation NativeRenderWaterfallViewManager ++ ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(contentInset, UIEdgeInsets) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(numberOfColumns, NSInteger) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(preloadItemNumber, NSInteger) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(columnSpacing, CGFloat) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(interItemSpacing, CGFloat) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onInitialListReady, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onEndReached, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onFooterAppeared, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onRefresh, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onExposureReport, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(containBannerView, BOOL) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(containPullHeader, BOOL) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(containPullFooter, BOOL) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(scrollEventThrottle, double) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onScroll, NativeRenderDirectEventBlock) ++ ++- (UIView *)view { ++ return [[NativeRenderWaterfallView alloc] init]; ++} ++ ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(refreshCompleted:(nonnull NSNumber *)reactTag ++ status:(nonnull NSNumber *)status ++ text:(nonnull NSString *)text ++ duration:(nonnull NSNumber *)duration ++ imageUrl:(nonnull NSString *)imageUrl) { ++ [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderWaterfallView *view = (NativeRenderWaterfallView *)viewRegistry[reactTag]; ++ if (view == nil) ++ return; ++ if (![view isKindOfClass:[NativeRenderWaterfallView class]]) { ++ //NativeRenderLogError(@""Invalid view returned from registry, expecting QBRNWaterfallView, got: %@"", view); ++ } ++ [view refreshCompleted:status.integerValue text:text]; ++ }]; ++} ++ ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(startRefresh:(nonnull NSNumber *)reactTag) { ++ [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderWaterfallView *view = (NativeRenderWaterfallView *)viewRegistry[reactTag]; ++ if (view == nil) ++ return; ++ if (![view isKindOfClass:[NativeRenderWaterfallView class]]) { ++ //NativeRenderLogError(@""Invalid view returned from registry, expecting QBRNWaterfallView, got: %@"", view); ++ } ++ [view startRefreshFromJS]; ++ }]; ++} ++ ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(startRefreshWithType:(nonnull NSNumber *)reactTag ++ type:(NSNumber *)type) { ++ [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderWaterfallView *view = (NativeRenderWaterfallView *)viewRegistry[reactTag]; ++ if (view == nil) ++ return; ++ if (![view isKindOfClass:[NativeRenderWaterfallView class]]) { ++ //NativeRenderLogError(@""Invalid view returned from registry, expecting QBRNWaterfallView, got: %@"", view); ++ } ++ [view startRefreshFromJSWithType:[type unsignedIntegerValue]]; ++ }]; ++} ++ ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(callExposureReport:(nonnull NSNumber *)reactTag) { ++ [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderWaterfallView *view = (NativeRenderWaterfallView *)viewRegistry[reactTag]; ++ if (view == nil) ++ return; ++ if (![view isKindOfClass:[NativeRenderWaterfallView class]]) { ++ //NativeRenderLogError(@""Invalid view returned from registry, expecting QBRNWaterfallView, got: %@"", view); ++ } ++ [view callExposureReport]; ++ }]; ++} ++ ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(scrollToIndex:(nonnull NSNumber *)reactTag ++ xIndex:(nonnull NSNumber *)xIndex ++ yIndex:(nonnull NSNumber *)yIndex ++ animation:(nonnull NSNumber *)animation) { ++ [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderWaterfallView *view = (NativeRenderWaterfallView *)viewRegistry[reactTag]; ++ if (view == nil) ++ return; ++ if (![view isKindOfClass:[NativeRenderWaterfallView class]]) { ++ //NativeRenderLogError(@""Invalid view returned from registry, expecting QBRNWaterfallView, got: %@"", view); ++ } ++ [view scrollToIndex:xIndex.integerValue animated:[animation boolValue]]; ++ }]; ++} ++ ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(scrollToContentOffset:(nonnull NSNumber *)reactTag ++ x:(nonnull NSNumber *)x ++ y:(nonnull NSNumber *)y ++ animation:(nonnull NSNumber *)animation) { ++ [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderWaterfallView *view = (NativeRenderWaterfallView *)viewRegistry[reactTag]; ++ if (view == nil) ++ return; ++ if (![view isKindOfClass:[NativeRenderWaterfallView class]]) { ++ //NativeRenderLogError(@""Invalid view returned from registry, expecting QBRNWaterfallView, got: %@"", view); ++ } ++ [view scrollToOffset:CGPointMake([x floatValue], [y floatValue]) animated:[animation boolValue]]; ++ }]; ++} ++ ++NATIVE_RENDER_COMPONENT_EXPORT_METHOD(startLoadMore:(nonnull NSNumber *)reactTag) { ++ [self.renderContext addUIBlock:^(__unused id renderContext, NSDictionary *viewRegistry) { ++ NativeRenderWaterfallView *view = (NativeRenderWaterfallView *)viewRegistry[reactTag]; ++ if (view == nil) ++ return; ++ if (![view isKindOfClass:[NativeRenderWaterfallView class]]) { ++ //NativeRenderLogError(@""Invalid view returned from registry, expecting QBRNWaterfallView, got: %@"", view); ++ } ++ [view startLoadMore]; ++ }]; ++} ++ ++@end +diff --git a/renderer/native/ios/renderer/component/webview/HippySimpleWebViewManager.h b/renderer/native/ios/renderer/component/webview/HippySimpleWebViewManager.h +deleted file mode 100644 +index 5a5089d05c1..00000000000 +--- a/renderer/native/ios/renderer/component/webview/HippySimpleWebViewManager.h ++++ /dev/null +@@ -1,32 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import ""HippyViewManager.h"" +-#import ""HippySimpleWebView.h"" +- +-NS_ASSUME_NONNULL_BEGIN +- +-@interface HippySimpleWebViewManager : HippyViewManager +- +-@end +- +-NS_ASSUME_NONNULL_END +diff --git a/renderer/native/ios/renderer/component/webview/HippySimpleWebView.h b/renderer/native/ios/renderer/component/webview/NativeRenderSimpleWebView.h +similarity index 71% +rename from renderer/native/ios/renderer/component/webview/HippySimpleWebView.h +rename to renderer/native/ios/renderer/component/webview/NativeRenderSimpleWebView.h +index ed290fb15c5..1cff478332e 100644 +--- a/renderer/native/ios/renderer/component/webview/HippySimpleWebView.h ++++ b/renderer/native/ios/renderer/component/webview/NativeRenderSimpleWebView.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,16 +21,16 @@ + */ + + #import +-#import ""HippyComponent.h"" ++#import ""NativeRenderComponentProtocol.h"" + + NS_ASSUME_NONNULL_BEGIN + +-@interface HippySimpleWebView : WKWebView ++@interface NativeRenderSimpleWebView : WKWebView + @property (nonatomic, strong) NSString *url; + @property (nonatomic, strong) NSDictionary *source; +-@property (nonatomic, copy) HippyDirectEventBlock onLoadStart; +-@property (nonatomic, copy) HippyDirectEventBlock onLoadEnd; +-@property (nonatomic, copy) HippyDirectEventBlock onLoad; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onLoadStart; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onLoadEnd; ++@property (nonatomic, copy) NativeRenderDirectEventBlock onLoad; + + @end + +diff --git a/renderer/native/ios/renderer/component/webview/HippySimpleWebView.m b/renderer/native/ios/renderer/component/webview/NativeRenderSimpleWebView.m +similarity index 94% +rename from renderer/native/ios/renderer/component/webview/HippySimpleWebView.m +rename to renderer/native/ios/renderer/component/webview/NativeRenderSimpleWebView.m +index ef45af04732..4fb4c81ce55 100644 +--- a/renderer/native/ios/renderer/component/webview/HippySimpleWebView.m ++++ b/renderer/native/ios/renderer/component/webview/NativeRenderSimpleWebView.m +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,10 +20,10 @@ + * limitations under the License. + */ + +-#import ""HippySimpleWebView.h"" +-#import ""HippyUtils.h"" ++#import ""NativeRenderSimpleWebView.h"" ++#import ""NativeRenderUtils.h"" + +-@implementation HippySimpleWebView ++@implementation NativeRenderSimpleWebView + + - (instancetype)init { + self = [super init]; +@@ -44,7 +44,7 @@ - (void)setSource:(NSDictionary *)source { + + - (void)loadUrl:(NSString *)urlString { + _url = urlString; +- NSURL *url = HippyURLWithString(urlString, NULL); ++ NSURL *url = NativeRenderURLWithString(urlString, NULL); + if (!url) { + return; + } +diff --git a/renderer/native/ios/renderer/component/navigator/HippyNavigatorViewManager.h b/renderer/native/ios/renderer/component/webview/NativeRenderSimpleWebViewManager.h +similarity index 82% +rename from renderer/native/ios/renderer/component/navigator/HippyNavigatorViewManager.h +rename to renderer/native/ios/renderer/component/webview/NativeRenderSimpleWebViewManager.h +index 79a8378da5f..fe331746e4e 100644 +--- a/renderer/native/ios/renderer/component/navigator/HippyNavigatorViewManager.h ++++ b/renderer/native/ios/renderer/component/webview/NativeRenderSimpleWebViewManager.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,12 +20,12 @@ + * limitations under the License. + */ + +-#import ""HippyViewManager.h"" +-#import ""HippyNavigatorHostView.h"" ++#import ""NativeRenderViewManager.h"" ++#import ""NativeRenderSimpleWebView.h"" + + NS_ASSUME_NONNULL_BEGIN + +-@interface HippyNavigatorViewManager : HippyViewManager ++@interface NativeRenderSimpleWebViewManager : NativeRenderViewManager + + @end + +diff --git a/renderer/native/ios/renderer/component/webview/HippySimpleWebViewManager.mm b/renderer/native/ios/renderer/component/webview/NativeRenderSimpleWebViewManager.mm +similarity index 62% +rename from renderer/native/ios/renderer/component/webview/HippySimpleWebViewManager.mm +rename to renderer/native/ios/renderer/component/webview/NativeRenderSimpleWebViewManager.mm +index c5377bf24b6..ed9858b0348 100644 +--- a/renderer/native/ios/renderer/component/webview/HippySimpleWebViewManager.mm ++++ b/renderer/native/ios/renderer/component/webview/NativeRenderSimpleWebViewManager.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,17 +20,17 @@ + * limitations under the License. + */ + +-#import ""HippySimpleWebViewManager.h"" ++#import ""NativeRenderSimpleWebViewManager.h"" + +-@implementation HippySimpleWebViewManager ++@implementation NativeRenderSimpleWebViewManager + +-HIPPY_EXPORT_VIEW_PROPERTY(source, NSDictionary) +-HIPPY_EXPORT_VIEW_PROPERTY(onLoadStart, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onLoadEnd, HippyDirectEventBlock) +-HIPPY_EXPORT_VIEW_PROPERTY(onLoad, HippyDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(source, NSDictionary) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onLoadStart, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onLoadEnd, NativeRenderDirectEventBlock) ++NATIVE_RENDER_EXPORT_VIEW_PROPERTY(onLoad, NativeRenderDirectEventBlock) + + - (UIView *)view { +- return [HippySimpleWebView new]; ++ return [NativeRenderSimpleWebView new]; + } + + @end +diff --git a/renderer/native/ios/utils/HippyLog.h b/renderer/native/ios/utils/HippyLog.h +deleted file mode 100644 +index 8be95654fec..00000000000 +--- a/renderer/native/ios/utils/HippyLog.h ++++ /dev/null +@@ -1,139 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import +-#import ""HippyDefines.h"" +- +-#ifndef HIPPYLOG_ENABLED +-#ifdef DEBUG +-#define HIPPYLOG_ENABLED 1 +-#else +-#define HIPPYLOG_ENABLED 0 +-#endif +-#endif +- +-/** +- * Thresholds for logs to display a redbox. You can override these values when debugging +- * in order to tweak the default logging behavior. +- */ +-#ifndef HIPPYLOG_REDBOX_LEVEL +-#define HIPPYLOG_REDBOX_LEVEL HippyLogLevelError +-#endif +- +-/** +- * Logging macros. Use these to log information, warnings and errors in your +- * own code. +- */ +-#define HippyLog(...) _HippyLog(HippyLogLevelInfo, __VA_ARGS__) +-#define HippyLogTrace(...) _HippyLog(HippyLogLevelTrace, __VA_ARGS__) +-#define HippyLogInfo(...) _HippyLog(HippyLogLevelInfo, __VA_ARGS__) +-#define HippyLogWarn(...) _HippyLog(HippyLogLevelWarning, __VA_ARGS__) +-#define HippyLogError(...) _HippyLog(HippyLogLevelError, __VA_ARGS__) +- +-/** +- * An enum representing the severity of the log message. +- */ +-typedef NS_ENUM(NSInteger, HippyLogLevel) { +- HippyLogLevelTrace = 0, +- HippyLogLevelInfo = 1, +- HippyLogLevelWarning = 2, +- HippyLogLevelError = 3, +- HippyLogLevelFatal = 4 +-}; +- +-/** +- * An enum representing the source of a log message. +- */ +-typedef NS_ENUM(NSInteger, HippyLogSource) { HippyLogSourceNative = 1, HippyLogSourceJavaScript = 2 }; +- +-/** +- * A block signature to be used for custom logging functions. In most cases you +- * will want to pass these arguments to the HippyFormatLog function in order to +- * generate a string. +- */ +-typedef void (^HippyLogFunction)(HippyLogLevel level, HippyLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message); +- +-typedef void (^HippyLogShowFunction)(NSString *message, NSArray *stacks); +- +-/** +- * A method to generate a string from a collection of log data. To omit any +- * particular data from the log, just pass nil or zero for the argument. +- */ +-HIPPY_EXTERN NSString *HippyFormatLog(NSDate *timestamp, HippyLogLevel level, NSString *fileName, NSNumber *lineNumber, NSString *message); +- +-/** +- * The default logging function used by HippyLogXX. +- */ +-extern HippyLogFunction HippyDefaultLogFunction; +- +-/** +- * These methods get and set the global logging threshold. This is the level +- * below which logs will be ignored. Default is HippyLogLevelInfo for debug and +- * HippyLogLevelError for production. +- */ +-HIPPY_EXTERN void HippySetLogThreshold(HippyLogLevel threshold); +-HIPPY_EXTERN HippyLogLevel HippyGetLogThreshold(void); +- +-/** +- * These methods get and set the global logging function called by the HippyLogXX +- * macros. You can use these to replace the standard behavior with custom log +- * functionality. +- */ +-HIPPY_EXTERN void HippySetLogFunction(HippyLogFunction logFunction); +-HIPPY_EXTERN HippyLogFunction HippyGetLogFunction(void); +- +-/** +- * This appends additional code to the existing log function, without replacing +- * the existing functionality. Useful if you just want to forward logs to an +- * extra service without changing the default behavior. +- */ +-HIPPY_EXTERN void HippyAddLogFunction(HippyLogFunction logFunction); +- +-HIPPY_EXTERN void HippySetErrorLogShowAction(HippyLogShowFunction func); +- +-/** +- * This method temporarily overrides the log function while performing the +- * specified block. This is useful for testing purposes (to detect if a given +- * function logs something) or to suppress or override logging temporarily. +- */ +-HIPPY_EXTERN void HippyPerformBlockWithLogFunction(void (^block)(void), HippyLogFunction logFunction); +- +-/** +- * This method adds a conditional prefix to any messages logged within the scope +- * of the passed block. This is useful for adding additional context to log +- * messages. The block will be performed synchronously on the current thread. +- */ +-HIPPY_EXTERN void HippyPerformBlockWithLogPrefix(void (^block)(void), NSString *prefix); +- +-/** +- * Private logging function - ignore this. +- */ +-#if HIPPYLOG_ENABLED +-#define _HippyLog(lvl, ...) _HippyLogNativeInternal(lvl, __FILE__, __LINE__, __VA_ARGS__); +-#else +-#define _HippyLog(lvl, ...) \ +- do { \ +- } while (0) +-#endif +- +-HIPPY_EXTERN void _HippyLogNativeInternal(HippyLogLevel, const char *, int, NSString *, ...) NS_FORMAT_FUNCTION(4, 5); +-HIPPY_EXTERN void _HippyLogJavaScriptInternal(HippyLogLevel, NSString *); +diff --git a/renderer/native/ios/utils/HippyLog.mm b/renderer/native/ios/utils/HippyLog.mm +deleted file mode 100644 +index 39442dfdf77..00000000000 +--- a/renderer/native/ios/utils/HippyLog.mm ++++ /dev/null +@@ -1,243 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import ""HippyLog.h"" +-#include +-#include +-#include +-#import ""HippyDefines.h"" +- +-static NSString *const HippyLogFunctionStack = @""HippyLogFunctionStack""; +- +-const char *HippyLogLevels[] = { +- ""trace"", +- ""info"", +- ""warn"", +- ""error"", +- ""fatal"", +-}; +- +-#if HIPPY_DEBUG +-HippyLogLevel HippyDefaultLogThreshold = HippyLogLevelTrace; +-#else +-HippyLogLevel HippyDefaultLogThreshold = HippyLogLevelError; +-#endif +- +-static HippyLogFunction HippyCurrentLogFunction; +-static HippyLogLevel HippyCurrentLogThreshold = HippyDefaultLogThreshold; +-static HippyLogShowFunction HippyLogShowFunc; +- +-HippyLogLevel HippyGetLogThreshold() { +- return HippyCurrentLogThreshold; +-} +- +-void HippySetLogThreshold(HippyLogLevel threshold) { +- HippyCurrentLogThreshold = threshold; +-} +- +-HippyLogFunction HippyDefaultLogFunction +- = ^(HippyLogLevel level, __unused HippyLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { +- NSString *log = HippyFormatLog([NSDate date], level, fileName, lineNumber, message); +- fprintf(stderr, ""%s\n"", log.UTF8String); +- fflush(stderr); +- +- int aslLevel; +- switch (level) { +- case HippyLogLevelTrace: +- aslLevel = ASL_LEVEL_DEBUG; +- break; +- case HippyLogLevelInfo: +- aslLevel = ASL_LEVEL_NOTICE; +- break; +- case HippyLogLevelWarning: +- aslLevel = ASL_LEVEL_WARNING; +- break; +- case HippyLogLevelError: +- aslLevel = ASL_LEVEL_ERR; +- break; +- case HippyLogLevelFatal: +- aslLevel = ASL_LEVEL_CRIT; +- break; +- } +- asl_log(NULL, NULL, aslLevel, ""%s"", message.UTF8String); +- }; +- +-void HippySetLogFunction(HippyLogFunction logFunction) { +- HippyCurrentLogFunction = logFunction; +-} +- +-HippyLogFunction HippyGetLogFunction() { +- if (!HippyCurrentLogFunction) { +- HippyCurrentLogFunction = HippyDefaultLogFunction; +- } +- return HippyCurrentLogFunction; +-} +- +-void HippyAddLogFunction(HippyLogFunction logFunction) { +- HippyLogFunction existing = HippyGetLogFunction(); +- if (existing) { +- HippySetLogFunction(^(HippyLogLevel level, HippyLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { +- existing(level, source, fileName, lineNumber, message); +- logFunction(level, source, fileName, lineNumber, message); +- }); +- } else { +- HippySetLogFunction(logFunction); +- } +-} +- +-HIPPY_EXTERN void HippySetErrorLogShowAction(HippyLogShowFunction func) { +- HippyLogShowFunc = func; +-} +- +-/** +- * returns the topmost stacked log function for the current thread, which +- * may not be the same as the current value of HippyCurrentLogFunction. +- */ +-static HippyLogFunction HippyGetLocalLogFunction() { +- NSMutableDictionary *threadDictionary = [NSThread currentThread].threadDictionary; +- NSArray *functionStack = threadDictionary[HippyLogFunctionStack]; +- HippyLogFunction logFunction = functionStack.lastObject; +- if (logFunction) { +- return logFunction; +- } +- return HippyGetLogFunction(); +-} +- +-void HippyPerformBlockWithLogFunction(void (^block)(void), HippyLogFunction logFunction) { +- NSMutableDictionary *threadDictionary = [NSThread currentThread].threadDictionary; +- NSMutableArray *functionStack = threadDictionary[HippyLogFunctionStack]; +- if (!functionStack) { +- functionStack = [NSMutableArray new]; +- threadDictionary[HippyLogFunctionStack] = functionStack; +- } +- [functionStack addObject:logFunction]; +- block(); +- [functionStack removeLastObject]; +-} +- +-void HippyPerformBlockWithLogPrefix(void (^block)(void), NSString *prefix) { +- HippyLogFunction logFunction = HippyGetLocalLogFunction(); +- if (logFunction) { +- HippyPerformBlockWithLogFunction( +- block, ^(HippyLogLevel level, HippyLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { +- logFunction(level, source, fileName, lineNumber, [prefix stringByAppendingString:message]); +- }); +- } +-} +- +-static NSString *currentThreadName(void) { +- NSThread *thread = [NSThread currentThread]; +- NSString *threadName = [NSThread isMainThread] ? @""main"" : thread.name; +- if (threadName.length == 0) { +- const char *label = dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL); +- if (label && strlen(label) > 0) { +- threadName = @(label); +- } else { +- threadName = [NSString stringWithFormat:@""%p"", thread]; +- } +- } +- return threadName; +-} +- +-NSString *HippyFormatLog(NSDate *timestamp, HippyLogLevel level, NSString *fileName, NSNumber *lineNumber, NSString *message) { +- NSMutableString *log = [NSMutableString new]; +- if (timestamp) { +- static NSDateFormatter *formatter; +- static dispatch_once_t onceToken; +- dispatch_once(&onceToken, ^{ +- formatter = [NSDateFormatter new]; +- formatter.dateFormat = formatter.dateFormat = @""yyyy-MM-dd HH:mm:ss.SSS ""; +- }); +- [log appendString:[formatter stringFromDate:timestamp]]; +- } +- if (level) { +- [log appendFormat:@""[%s]"", HippyLogLevels[level]]; +- } +- +- [log appendFormat:@""[tid:%@]"", currentThreadName()]; +- +- if (fileName) { +- fileName = fileName.lastPathComponent; +- if (lineNumber) { +- [log appendFormat:@""[%@:%@]"", fileName, lineNumber]; +- } else { +- [log appendFormat:@""[%@]"", fileName]; +- } +- } +- if (message) { +- [log appendString:@"" ""]; +- [log appendString:message]; +- } +- return log; +-} +- +-void _HippyLogNativeInternal(HippyLogLevel level, const char *fileName, int lineNumber, NSString *format, ...) { +- HippyLogFunction logFunction = HippyGetLocalLogFunction(); +- BOOL log = HIPPY_DEBUG || (logFunction != nil); +- if (log && level >= HippyGetLogThreshold()) { +- // Get message +- va_list args; +- va_start(args, format); +- NSString *message = [[NSString alloc] initWithFormat:format arguments:args]; +- va_end(args); +- +- // Call log function +- if (logFunction) { +- logFunction(level, HippyLogSourceNative, fileName ? @(fileName) : nil, lineNumber > 0 ? @(lineNumber) : nil, message); +- } +- +-#if HIPPY_DEBUG +- +- // Log to red box in debug mode. +- if (level >= HIPPYLOG_REDBOX_LEVEL) { +- NSArray *stackSymbols = [NSThread callStackSymbols]; +- NSMutableArray *stack = [NSMutableArray arrayWithCapacity:(stackSymbols.count - 1)]; +- [stackSymbols enumerateObjectsUsingBlock:^(NSString *frameSymbols, NSUInteger idx, __unused BOOL *stop) { +- if (idx > 0) { // don't include the current frame +- NSString *address = [[frameSymbols componentsSeparatedByString:@""0x""][1] componentsSeparatedByString:@"" ""][0]; +- NSRange addressRange = [frameSymbols rangeOfString:address]; +- NSString *methodName = [frameSymbols substringFromIndex:(addressRange.location + addressRange.length + 1)]; +- if (idx == 1 && fileName) { +- NSString *file = [@(fileName) componentsSeparatedByString:@""/""].lastObject; +- [stack addObject:@{@""methodName"": methodName, @""file"": file, @""lineNumber"": @(lineNumber)}]; +- } else { +- [stack addObject:@ { @""methodName"": methodName }]; +- } +- } +- }]; +- if (HippyLogShowFunc) { +- HippyLogShowFunc(message, stack); +- } +- } +-#endif +- } +-} +- +-void _HippyLogJavaScriptInternal(HippyLogLevel level, NSString *message) { +- HippyLogFunction logFunction = HippyGetLocalLogFunction(); +- BOOL log = HIPPY_DEBUG || (logFunction != nil); +- if (log && level >= HippyGetLogThreshold()) { +- if (logFunction) { +- logFunction(level, HippyLogSourceJavaScript, nil, nil, message); +- } +- } +-} +diff --git a/renderer/native/ios/utils/HippyUtils.h b/renderer/native/ios/utils/HippyUtils.h +deleted file mode 100644 +index bbafed47270..00000000000 +--- a/renderer/native/ios/utils/HippyUtils.h ++++ /dev/null +@@ -1,160 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import +- +-#import +-#import +-#import +-#import ""HippyDefines.h"" +- +-NS_ASSUME_NONNULL_BEGIN +- +-// JSON serialization/deserialization +-HIPPY_EXTERN NSString *__nullable HippyJSONStringify(id __nullable jsonObject, NSError **error); +-HIPPY_EXTERN id __nullable HippyJSONParse(NSString *__nullable jsonString, NSError **error); +-HIPPY_EXTERN id __nullable HippyJSONParseMutable(NSString *__nullable jsonString, NSError **error); +- +-// Sanitize a JSON object by stripping invalid types and/or NaN values +-HIPPY_EXTERN id HippyJSONClean(id object); +- +-// Get MD5 hash of a string +-HIPPY_EXTERN NSString *HippyMD5Hash(NSString *string); +- +-// Check is we are currently on the main queue (not to be confused with +-// the main thread, which is not neccesarily the same thing) +-// https://twitter.com/olebegemann/status/738656134731599872 +-HIPPY_EXTERN BOOL HippyIsMainQueue(void); +- +-// Execute the specified block on the main queue. Unlike dispatch_async() +-// this will execute immediately if we're already on the main queue. +-HIPPY_EXTERN void HippyExecuteOnMainQueue(dispatch_block_t block); +- +-// Deprecated - do not use. +-HIPPY_EXTERN void HippyExecuteOnMainThread(dispatch_block_t block, BOOL sync); +-//__deprecated_msg(""Use HippyExecuteOnMainQueue instead. HippyExecuteOnMainQueue is "" +-// ""async. If you need to use the `sync` option... please don't.""); +- +-// Get screen metrics in a thread-safe way +-HIPPY_EXTERN CGFloat HippyScreenScale(void); +-HIPPY_EXTERN CGSize HippyScreenSize(void); +- +-// Round float coordinates to nearest whole screen pixel (not point) +-HIPPY_EXTERN CGFloat HippyRoundPixelValue(CGFloat value); +-HIPPY_EXTERN CGFloat HippyCeilPixelValue(CGFloat value); +-HIPPY_EXTERN CGFloat HippyFloorPixelValue(CGFloat value); +- +-// Convert a size in points to pixels, rounded up to the nearest integral size +-HIPPY_EXTERN CGSize HippySizeInPixels(CGSize pointSize, CGFloat scale); +- +-// Method swizzling +-HIPPY_EXTERN void HippySwapClassMethods(Class cls, SEL original, SEL replacement); +-HIPPY_EXTERN void HippySwapInstanceMethods(Class cls, SEL original, SEL replacement); +- +-// Module subclass support +-HIPPY_EXTERN BOOL HippyClassOverridesClassMethod(Class cls, SEL selector); +-HIPPY_EXTERN BOOL HippyClassOverridesInstanceMethod(Class cls, SEL selector); +- +-// Creates a standardized error object to return in callbacks +-HIPPY_EXTERN NSDictionary *HippyMakeError( +- NSString *message, id __nullable toStringify, NSDictionary *__nullable extraData); +-HIPPY_EXTERN NSDictionary *HippyMakeAndLogError( +- NSString *message, id __nullable toStringify, NSDictionary *__nullable extraData); +-HIPPY_EXTERN NSDictionary *HippyJSErrorFromNSError(NSError *error); +-HIPPY_EXTERN NSDictionary *HippyJSErrorFromCodeMessageAndNSError(NSString *code, NSString *message, NSError *__nullable error); +- +-// The default error code to use as the `code` property for callback error objects +-HIPPY_EXTERN NSString *const RenderErrorUnspecified; +- +-// Returns YES if Hippy is running in a test environment +-HIPPY_EXTERN BOOL HippyRunningInTestEnvironment(void); +- +-// Returns YES if Hippy is running in an iOS App Extension +-HIPPY_EXTERN BOOL HippyRunningInAppExtension(void); +- +-// Returns the shared UIApplication instance, or nil if running in an App Extension +-HIPPY_EXTERN UIApplication *__nullable HippySharedApplication(void); +- +-// Returns the current main window, useful if you need to access the root view +-// or view controller +-HIPPY_EXTERN UIWindow *__nullable HippyKeyWindow(void); +- +-// Returns the presented view controller, useful if you need +-// e.g. to present a modal view controller or alert over it +-HIPPY_EXTERN UIViewController *__nullable HippyPresentedViewController(void); +- +-// Does this device support force touch (aka 3D Touch)? +-HIPPY_EXTERN BOOL HippyForceTouchAvailable(void); +- +-// Create an NSError in the HippyErrorDomain +-HIPPY_EXTERN NSError *HippyErrorWithMessage(NSString *message); +- +-// Create an NSError in the HippyErrorDomain +-HIPPY_EXTERN NSError *HippyErrorWithMessageAndModuleName(NSString *message, NSString *moduleName); +- +-// Create an NSError with HippyFatalModuleName from another error +-HIPPY_EXTERN NSError *HippyErrorFromErrorAndModuleName(NSError *error, NSString *moduleName); +- +-// Convert nil values to NSNull, and vice-versa +-#define HippyNullIfNil(value) (value ?: (id)kCFNull) +-#define HippyNilIfNull(value) (value == (id)kCFNull ? nil : value) +- +-// Convert NaN or infinite values to zero, as these aren't JSON-safe +-HIPPY_EXTERN double HippyZeroIfNaN(double value); +- +-// Convert data to a Base64-encoded data URL +-HIPPY_EXTERN NSURL *HippyDataURL(NSString *mimeType, NSData *data); +- +-// Returns the relative path within the main bundle for an absolute URL +-// (or nil, if the URL does not specify a path within the main bundle) +-HIPPY_EXTERN NSString *__nullable HippyBundlePathForURL(NSURL *__nullable URL); +- +-// Determines if a given image URL refers to a local image +-HIPPY_EXTERN BOOL HippyIsLocalAssetURL(NSURL *__nullable imageURL); +- +-// Creates a new, unique temporary file path with the specified extension +-HIPPY_EXTERN NSString *__nullable HippyTempFilePath(NSString *__nullable extension, NSError **error); +- +-// Converts a CGColor to a hex string +-HIPPY_EXTERN NSString *HippyColorToHexString(CGColorRef color); +- +-/** +- * convert string to UIColor +- * colorString could be 'fff','#fff','ffffff','#ffffff','ffffffff','#ffffffff' +- * or 'red', 'green','blue'.etc +- */ +-HIPPY_EXTERN UIColor *HippyConvertStringToColor(NSString *colorString); +- +-HIPPY_EXTERN UIColor *HippyConvertNumberToColor(NSInteger colorNumber); +- +-// Get standard localized string (if it exists) +-HIPPY_EXTERN NSString *HippyUIKitLocalizedString(NSString *string); +- +-// URL manipulation +-HIPPY_EXTERN NSString *__nullable HippyGetURLQueryParam(NSURL *__nullable URL, NSString *param); +-HIPPY_EXTERN NSURL *__nullable HippyURLByReplacingQueryParam(NSURL *__nullable URL, NSString *param, NSString *__nullable value); +-HIPPY_EXTERN NSURL *__nullable HippyURLWithString(NSString *__nonnull URLString, NSString *__nullable baseURLString); +- +-//Get String Encoding From HTTP URL Response +-HIPPY_EXTERN NSStringEncoding HippyGetStringEncodingFromURLResponse(NSURLResponse *response); +- +-NS_ASSUME_NONNULL_END +diff --git a/renderer/native/ios/utils/NSArray+HippyArrayDeepCopy.m b/renderer/native/ios/utils/NSArray+HippyArrayDeepCopy.m +deleted file mode 100644 +index 95de11d8417..00000000000 +--- a/renderer/native/ios/utils/NSArray+HippyArrayDeepCopy.m ++++ /dev/null +@@ -1,59 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import ""NSArray+HippyArrayDeepCopy.h"" +- +-@implementation NSArray (HippyArrayDeepCopy) +-- (id)hippyDeepCopy { +- NSMutableArray *array = [NSMutableArray arrayWithCapacity:[self count]]; +- for (id item in self) { +- id copiedItem = nil; +- if ([item conformsToProtocol:@protocol(HippyDeepCopyProtocol)]) { +- copiedItem = [item hippyDeepCopy]; +- } else if ([item respondsToSelector:@selector(copy)]) { +- copiedItem = [item copy]; +- } else { +- copiedItem = item; +- } +- [array addObject:copiedItem]; +- } +- return [NSArray arrayWithArray:array]; +-} +- +-- (id)hippyMutableDeepCopy { +- NSMutableArray *array = [NSMutableArray arrayWithCapacity:[self count]]; +- for (id item in self) { +- id copiedItem = nil; +- if ([item conformsToProtocol:@protocol(HippyDeepCopyProtocol)]) { +- copiedItem = [item hippyMutableDeepCopy]; +- } else if ([item conformsToProtocol:@protocol(NSMutableCopying)]) { +- copiedItem = [item mutableCopy]; +- } else if ([item conformsToProtocol:@protocol(NSCopying)]) { +- copiedItem = [item copy]; +- } else { +- copiedItem = item; +- } +- [array addObject:copiedItem]; +- } +- return array; +-} +-@end +diff --git a/renderer/native/ios/utils/NSData+DataType.h b/renderer/native/ios/utils/NSData+DataType.h +index 01fdb8df5c4..db3bb5167fb 100644 +--- a/renderer/native/ios/utils/NSData+DataType.h ++++ b/renderer/native/ios/utils/NSData+DataType.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +diff --git a/renderer/native/ios/utils/NSData+DataType.m b/renderer/native/ios/utils/NSData+DataType.m +index a7a7b51022b..760ed8cb2a8 100644 +--- a/renderer/native/ios/utils/NSData+DataType.m ++++ b/renderer/native/ios/utils/NSData+DataType.m +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +diff --git a/renderer/native/ios/utils/NSDictionary+HippyDictionaryDeepCopy.h b/renderer/native/ios/utils/NSDictionary+HippyDictionaryDeepCopy.h +deleted file mode 100644 +index 87756203188..00000000000 +--- a/renderer/native/ios/utils/NSDictionary+HippyDictionaryDeepCopy.h ++++ /dev/null +@@ -1,28 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import +-#import ""HippyDeepCopyProtocol.h"" +- +-@interface NSDictionary (HippyDictionaryDeepCopy) +- +-@end +diff --git a/renderer/native/ios/utils/NSDictionary+HippyDictionaryDeepCopy.m b/renderer/native/ios/utils/NSDictionary+HippyDictionaryDeepCopy.m +deleted file mode 100644 +index c7bb7a4331d..00000000000 +--- a/renderer/native/ios/utils/NSDictionary+HippyDictionaryDeepCopy.m ++++ /dev/null +@@ -1,62 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import ""NSDictionary+HippyDictionaryDeepCopy.h"" +- +-@implementation NSDictionary (HippyDictionaryDeepCopy) +-- (id)hippyDeepCopy { +- NSMutableDictionary *dictionary = [NSMutableDictionary dictionaryWithCapacity:[self count]]; +- [self enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull obj, BOOL *_Nonnull stop) { +- id copiedKey = [key copy]; +- id copiedObj = nil; +- if ([obj conformsToProtocol:@protocol(HippyDeepCopyProtocol)]) { +- copiedObj = [obj hippyDeepCopy]; +- } else if ([obj respondsToSelector:@selector(copy)]) { +- copiedObj = [obj copy]; +- } else { +- copiedObj = obj; +- } +- [dictionary setObject:copiedObj forKey:copiedKey]; +- }]; +- return [NSDictionary dictionaryWithDictionary:dictionary]; +-} +- +-- (id)hippyMutableDeepCopy { +- NSMutableDictionary *dictionary = [NSMutableDictionary dictionaryWithCapacity:[self count]]; +- for (id key in self) { +- id copiedKey = [key mutableCopy]; +- id obj = [self objectForKey:key]; +- id copiedObj = nil; +- if ([obj conformsToProtocol:@protocol(HippyDeepCopyProtocol)]) { +- copiedObj = [obj hippyMutableDeepCopy]; +- } else if ([obj conformsToProtocol:@protocol(NSMutableCopying)]) { +- copiedObj = [obj mutableCopy]; +- } else if ([obj conformsToProtocol:@protocol(NSCopying)]) { +- copiedObj = [obj copy]; +- } else { +- copiedObj = obj; +- } +- [dictionary setObject:copiedObj forKey:copiedKey]; +- } +- return dictionary; +-} +-@end +diff --git a/renderer/native/ios/utils/NSNumber+HippyNumberDeepCopy.h b/renderer/native/ios/utils/NSNumber+HippyNumberDeepCopy.h +deleted file mode 100644 +index 3a46e27ffad..00000000000 +--- a/renderer/native/ios/utils/NSNumber+HippyNumberDeepCopy.h ++++ /dev/null +@@ -1,28 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import +-#import ""HippyDeepCopyProtocol.h"" +- +-@interface NSNumber (HippyNumberDeepCopy) +- +-@end +diff --git a/renderer/native/ios/utils/NSNumber+HippyNumberDeepCopy.m b/renderer/native/ios/utils/NSNumber+HippyNumberDeepCopy.m +deleted file mode 100644 +index 42ab3adfe25..00000000000 +--- a/renderer/native/ios/utils/NSNumber+HippyNumberDeepCopy.m ++++ /dev/null +@@ -1,33 +0,0 @@ +-/*! +- * iOS SDK +- * +- * Tencent is pleased to support the open source community by making +- * Hippy available. +- * +- * Copyright (C) 2019 THL A29 Limited, a Tencent company. +- * All rights reserved. +- * +- * Licensed under the Apache License, Version 2.0 (the ""License""); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an ""AS IS"" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#import ""NSNumber+HippyNumberDeepCopy.h"" +- +-@implementation NSNumber (HippyNumberDeepCopy) +-- (id)hippyDeepCopy { +- return self; +-} +- +-- (id)hippyMutableDeepCopy { +- return self; +-} +-@end +diff --git a/renderer/native/ios/utils/HippyConvert+Transform.h b/renderer/native/ios/utils/NativeRenderConvert+Transform.h +similarity index 89% +rename from renderer/native/ios/utils/HippyConvert+Transform.h +rename to renderer/native/ios/utils/NativeRenderConvert+Transform.h +index f28a053638d..9cfb627eab8 100644 +--- a/renderer/native/ios/utils/HippyConvert+Transform.h ++++ b/renderer/native/ios/utils/NativeRenderConvert+Transform.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,9 +21,9 @@ + */ + + #import +-#import ""HippyConvert.h"" ++#import ""NativeRenderConvert.h"" + +-@interface HippyConvert (Transform) ++@interface NativeRenderConvert (Transform) + + (CATransform3D)CATransform3D:(id)json; + + (CGFloat)convertToRadians:(id)json; + + (CGFloat)convertDegToRadians:(CGFloat)deg; +diff --git a/renderer/native/ios/utils/HippyConvert+Transform.m b/renderer/native/ios/utils/NativeRenderConvert+Transform.m +similarity index 80% +rename from renderer/native/ios/utils/HippyConvert+Transform.m +rename to renderer/native/ios/utils/NativeRenderConvert+Transform.m +index 318e060035a..95e185fb42c 100644 +--- a/renderer/native/ios/utils/HippyConvert+Transform.m ++++ b/renderer/native/ios/utils/NativeRenderConvert+Transform.m +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -19,11 +19,11 @@ + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-#import ""HippyConvert+Transform.h"" +-#import ""HippyLog.h"" +-#import ""HippyUtils.h"" ++#import ""NativeRenderConvert+Transform.h"" ++#import ""NativeRenderLog.h"" ++#import ""NativeRenderUtils.h"" + +-@implementation HippyConvert (Transform) ++@implementation NativeRenderConvert (Transform) + + static const NSUInteger kMatrixArrayLength = 4 * 4; + +@@ -51,15 +51,15 @@ + (CATransform3D)CATransform3DFromMatrix:(id)json { + return transform; + } + if (![json isKindOfClass:[NSArray class]]) { +- HippyLogError(@""[%@], a CATransform3D. Expected array for transform matrix."", json); ++ NativeRenderLogError(@""[%@], a CATransform3D. Expected array for transform matrix."", json); + return transform; + } + if ([json count] != kMatrixArrayLength) { +- HippyLogError(@""[%@], a CATransform3D. Expected 4x4 matrix array."", json); ++ NativeRenderLogError(@""[%@], a CATransform3D. Expected 4x4 matrix array."", json); + return transform; + } + for (NSUInteger i = 0; i < kMatrixArrayLength; i++) { +- ((CGFloat *)&transform)[i] = [HippyConvert CGFloat:json[i]]; ++ ((CGFloat *)&transform)[i] = [NativeRenderConvert CGFloat:json[i]]; + } + return transform; + } +@@ -71,13 +71,13 @@ + (CATransform3D)CATransform3D:(id)json { + return transform; + } + if (![json isKindOfClass:[NSArray class]]) { +- HippyLogError(@""[%@],a CATransform3D. Did you pass something other than an array?"", json); ++ NativeRenderLogError(@""[%@],a CATransform3D. Did you pass something other than an array?"", json); + return transform; + } + // legacy matrix support + if ([(NSArray *)json count] == kMatrixArrayLength && [json[0] isKindOfClass:[NSNumber class]]) { +- HippyLogWarn( +- @""[HippyConvert CATransform3D:] has deprecated a matrix as input. Pass an array of configs (which can contain a matrix key) instead.""); ++ NativeRenderLogWarn( ++ @""[NativeRenderConvert CATransform3D:] has deprecated a matrix as input. Pass an array of configs (which can contain a matrix key) instead.""); + return [self CATransform3DFromMatrix:json]; + } + +@@ -85,11 +85,11 @@ + (CATransform3D)CATransform3D:(id)json { + + for (NSDictionary *transformConfig in (NSArray *)json) { + if (transformConfig.count != 1) { +- HippyLogError(@""[%@], a CATransform3D. You must specify exactly one property per transform object."", json); ++ NativeRenderLogError(@""[%@], a CATransform3D. You must specify exactly one property per transform object."", json); + return transform; + } + NSString *property = transformConfig.allKeys[0]; +- id value = HippyNilIfNull(transformConfig[property]); ++ id value = NativeRenderNilIfNull(transformConfig[property]); + if ([property isEqualToString:@""matrix""]) { + transform = [self CATransform3DFromMatrix:value]; + +@@ -127,9 +127,9 @@ + (CATransform3D)CATransform3D:(id)json { + + } else if ([property isEqualToString:@""translate""]) { + NSArray *array = (NSArray *)value; +- CGFloat translateX = [HippyNilIfNull(array[0]) floatValue]; +- CGFloat translateY = [HippyNilIfNull(array[1]) floatValue]; +- CGFloat translateZ = array.count > 2 ? [HippyNilIfNull(array[2]) floatValue] : 0; ++ CGFloat translateX = [NativeRenderNilIfNull(array[0]) floatValue]; ++ CGFloat translateY = [NativeRenderNilIfNull(array[1]) floatValue]; ++ CGFloat translateZ = array.count > 2 ? [NativeRenderNilIfNull(array[2]) floatValue] : 0; + transform = CATransform3DTranslate(transform, translateX, translateY, translateZ); + + } else if ([property isEqualToString:@""translateX""]) { +@@ -153,7 +153,7 @@ + (CATransform3D)CATransform3D:(id)json { + transform.m12 = tanf(skew); + + } else { +- HippyLogError(@""Unsupported transform type for a CATransform3D: %@."", property); ++ NativeRenderLogError(@""Unsupported transform type for a CATransform3D: %@."", property); + } + } + return transform; +diff --git a/renderer/native/ios/utils/HippyConvert.h b/renderer/native/ios/utils/NativeRenderConvert.h +similarity index 74% +rename from renderer/native/ios/utils/HippyConvert.h +rename to renderer/native/ios/utils/NativeRenderConvert.h +index 7014112cfe0..af1533bc983 100644 +--- a/renderer/native/ios/utils/HippyConvert.h ++++ b/renderer/native/ios/utils/NativeRenderConvert.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -23,20 +23,19 @@ + #import + #import + #include ""Flex.h"" +-#import ""HippyAnimationType.h"" +-#import ""HippyBorderStyle.h"" +-#import ""HippyTextDecorationLineType.h"" +-#import ""HippyDefines.h"" +-#import ""HippyLog.h"" +-#import ""HippyPointerEvents.h"" ++#import ""NativeRenderAnimationType.h"" ++#import ""NativeRenderBorderStyle.h"" ++#import ""NativeRenderTextDecorationLineType.h"" ++#import ""NativeRenderLog.h"" ++#import ""NativeRenderPointerEvents.h"" + + /** + * This class provides a collection of conversion functions for mapping + * JSON objects to native types and classes. These are useful when writing +- * custom HippyViewManager setter methods. ++ * custom NativeRenderViewManager setter methods. + */ + +-@interface HippyConvert : NSObject ++@interface NativeRenderConvert : NSObject + + + (id)id:(id)json; + +@@ -63,8 +62,8 @@ + + (NSURL *)NSURL:(id)json; + + (NSURLRequest *)NSURLRequest:(id)json; + +-typedef NSURL HippyFileURL; +-+ (HippyFileURL *)HippyFileURL:(id)json; ++typedef NSURL NativeRenderFileURL; +++ (NativeRenderFileURL *)NativeRenderFileURL:(id)json; + + + (NSDate *)NSDate:(id)json; + + (NSTimeZone *)NSTimeZone:(id)json; +@@ -104,7 +103,7 @@ typedef NSURL HippyFileURL; + + (NSArray *> *)NSStringArrayArray:(id)json; + + (NSArray *)NSDictionaryArray:(id)json; + + (NSArray *)NSURLArray:(id)json; +-+ (NSArray *)HippyFileURLArray:(id)json; +++ (NSArray *)NativeRenderFileURLArray:(id)json; + + (NSArray *)NSNumberArray:(id)json; + + (NSArray *)UIColorArray:(id)json; + +@@ -127,14 +126,14 @@ typedef BOOL css_backface_visibility_t; + + (FlexWrapMode)FlexWrapMode:(id)json; + + (DisplayType)DisplayType:(id)json; + +-+ (HippyPointerEvents)HippyPointerEvents:(id)json; +-+ (HippyAnimationType)HippyAnimationType:(id)json; +-+ (HippyBorderStyle)HippyBorderStyle:(id)json; +-+ (HippyTextDecorationLineType)HippyTextDecorationLineType:(id)json; +++ (NativeRenderPointerEvents)NativeRenderPointerEvents:(id)json; +++ (NativeRenderAnimationType)NativeRenderAnimationType:(id)json; +++ (NativeRenderBorderStyle)NativeRenderBorderStyle:(id)json; +++ (NativeRenderTextDecorationLineType)NativeRenderTextDecorationLineType:(id)json; + + @end + +-@interface HippyConvert (Deprecated) ++@interface NativeRenderConvert (Deprecated) + + /** + * Use lightweight generics syntax instead, e.g. NSArray +@@ -144,7 +143,7 @@ typedef NSArray NSStringArray __deprecated_msg(""Use NSArray""); + typedef NSArray NSStringArrayArray __deprecated_msg(""Use NSArray *>""); + typedef NSArray NSDictionaryArray __deprecated_msg(""Use NSArray""); + typedef NSArray NSURLArray __deprecated_msg(""Use NSArray""); +-typedef NSArray HippyFileURLArray __deprecated_msg(""Use NSArray""); ++typedef NSArray NativeRenderFileURLArray __deprecated_msg(""Use NSArray""); + typedef NSArray NSNumberArray __deprecated_msg(""Use NSArray""); + typedef NSArray UIColorArray __deprecated_msg(""Use NSArray""); + +@@ -154,42 +153,42 @@ typedef NSArray UIColorArray __deprecated_msg(""Use NSArray""); + @end + + /** +- * Underlying implementations of Hippy_XXX_CONVERTER macros. Ignore these. ++ * Underlying implementations of NativeRender_XXX_CONVERTER macros. Ignore these. + */ +-HIPPY_EXTERN NSNumber *HippyConvertEnumValue(const char *, NSDictionary *, NSNumber *, id); +-HIPPY_EXTERN NSNumber *HippyConvertMultiEnumValue(const char *, NSDictionary *, NSNumber *, id); +-HIPPY_EXTERN NSArray *HippyConvertArrayValue(SEL, id); ++NATIVE_RENDER_EXTERN NSNumber *NativeRenderConvertEnumValue(const char *, NSDictionary *, NSNumber *, id); ++NATIVE_RENDER_EXTERN NSNumber *NativeRenderConvertMultiEnumValue(const char *, NSDictionary *, NSNumber *, id); ++NATIVE_RENDER_EXTERN NSArray *NativeRenderConvertArrayValue(SEL, id); + + /** + * Get the converter function for the specified type + */ +-HIPPY_EXTERN SEL HippyConvertSelectorForType(NSString *type); ++NATIVE_RENDER_EXTERN SEL NativeRenderConvertSelectorForType(NSString *type); + + /** + * This macro is used for logging conversion errors. This is just used to + * avoid repeating the same boilerplate for every error message. + */ +-#define HippyLogConvertError(json, typeName) \ +- HippyLogError(@""JSON value '%@' of type %@ cannot be converted to %@"", json, [json classForCoder], typeName) ++#define NativeRenderLogConvertError(json, typeName) \ ++ NativeRenderLogError(@""JSON value '%@' of type %@ cannot be converted to %@"", json, [json classForCoder], typeName) + + /** + * This macro is used for creating simple converter functions that just call + * the specified getter method on the json value. + */ +-#define Hippy_CONVERTER(type, name, getter) Hippy_CUSTOM_CONVERTER(type, name, [json getter]) ++#define HIPPY_CONVERTER(type, name, getter) HIPPY_CUSTOM_CONVERTER(type, name, [json getter]) + + /** + * This macro is used for creating converter functions with arbitrary logic. + */ +-#define Hippy_CUSTOM_CONVERTER(type, name, code) \ ++#define HIPPY_CUSTOM_CONVERTER(type, name, code) \ + +(type)name : (id)json { \ +- if (!HIPPY_DEBUG) { \ ++ if (!NATIVE_RENDER_DEBUG) { \ + return code; \ + } else { \ + @try { \ + return code; \ + } @catch (__unused NSException * e) { \ +- HippyLogConvertError(json, @ #type); \ ++ NativeRenderLogConvertError(json, @ #type); \ + json = nil; \ + return code; \ + } \ +@@ -197,11 +196,11 @@ HIPPY_EXTERN SEL HippyConvertSelectorForType(NSString *type); + } + + /** +- * This macro is similar to Hippy_CONVERTER, but specifically geared towards ++ * This macro is similar to HIPPY_CONVERTER, but specifically geared towards + * numeric types. It will handle string input correctly, and provides more + * detailed error reporting if an invalid value is passed in. + */ +-#define Hippy_NUMBER_CONVERTER(type, getter) Hippy_CUSTOM_CONVERTER(type, type, [HIPPY_DEBUG ? [self NSNumber:json] : json getter]) ++#define HIPPY_NUMBER_CONVERTER(type, getter) HIPPY_CUSTOM_CONVERTER(type, type, [NATIVE_RENDER_DEBUG ? [self NSNumber:json] : json getter]) + + /** + * This macro is used for creating converters for enum types. +@@ -213,27 +212,27 @@ HIPPY_EXTERN SEL HippyConvertSelectorForType(NSString *type); + dispatch_once(&onceToken, ^{ \ + mapping = values; \ + }); \ +- return (type)[HippyConvertEnumValue(#type, mapping, @(default), json) getter]; \ ++ return (type)[NativeRenderConvertEnumValue(#type, mapping, @(default), json) getter]; \ + } + + /** + * This macro is used for creating converters for enum types for + * multiple enum values combined with | operator + */ +-#define Hippy_MULTI_ENUM_CONVERTER(type, values, default, getter) \ ++#define HIPPY_MULTI_ENUM_CONVERTER(type, values, default, getter) \ + +(type)type : (id)json { \ + static NSDictionary *mapping; \ + static dispatch_once_t onceToken; \ + dispatch_once(&onceToken, ^{ \ + mapping = values; \ + }); \ +- return [HippyConvertMultiEnumValue(#type, mapping, @(default), json) getter]; \ ++ return [NativeRenderConvertMultiEnumValue(#type, mapping, @(default), json) getter]; \ + } + + /** + * This macro is used for creating converter functions for typed arrays. + */ +-#define Hippy_ARRAY_CONVERTER(type) \ ++#define HIPPY_ARRAY_CONVERTER(type) \ + +(NSArray *)type##Array : (id)json { \ +- return HippyConvertArrayValue(@selector(type:), json); \ ++ return NativeRenderConvertArrayValue(@selector(type:), json); \ + } +diff --git a/renderer/native/ios/utils/HippyConvert.mm b/renderer/native/ios/utils/NativeRenderConvert.mm +similarity index 73% +rename from renderer/native/ios/utils/HippyConvert.mm +rename to renderer/native/ios/utils/NativeRenderConvert.mm +index d542bcb7a39..c1a410af611 100644 +--- a/renderer/native/ios/utils/HippyConvert.mm ++++ b/renderer/native/ios/utils/NativeRenderConvert.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,61 +21,60 @@ + */ + + #import +-#import ""HippyConvert.h"" ++#import ""NativeRenderConvert.h"" + #import +-#import ""HippyDefines.h"" +-#import ""HippyParserUtils.h"" +-#import ""HippyUtils.h"" ++#import ""NativeRenderParserUtils.h"" ++#import ""NativeRenderUtils.h"" + +-@implementation HippyConvert ++@implementation NativeRenderConvert + + // clang-format off + +-Hippy_CONVERTER(id, id, self) +-Hippy_CONVERTER(BOOL, BOOL, boolValue) +-Hippy_NUMBER_CONVERTER(double, doubleValue) +-Hippy_NUMBER_CONVERTER(float, floatValue) +-Hippy_NUMBER_CONVERTER(int, intValue) +-Hippy_NUMBER_CONVERTER(int64_t, longLongValue) +-Hippy_NUMBER_CONVERTER(uint64_t, unsignedLongLongValue) +-Hippy_NUMBER_CONVERTER(NSInteger, integerValue) +-Hippy_NUMBER_CONVERTER(NSUInteger, unsignedIntegerValue) ++HIPPY_CONVERTER(id, id, self) ++HIPPY_CONVERTER(BOOL, BOOL, boolValue) ++HIPPY_NUMBER_CONVERTER(double, doubleValue) ++HIPPY_NUMBER_CONVERTER(float, floatValue) ++HIPPY_NUMBER_CONVERTER(int, intValue) ++HIPPY_NUMBER_CONVERTER(int64_t, longLongValue) ++HIPPY_NUMBER_CONVERTER(uint64_t, unsignedLongLongValue) ++HIPPY_NUMBER_CONVERTER(NSInteger, integerValue) ++HIPPY_NUMBER_CONVERTER(NSUInteger, unsignedIntegerValue) + /** + * This macro is used for creating converter functions for directly + * representable json values that require no conversion. + */ +-#if HIPPY_DEBUG +-#define Hippy_JSON_CONVERTER(type) \ ++#if NATIVE_RENDER_DEBUG ++#define HIPPY_JSON_CONVERTER(type) \ + +(type *)type : (id)json { \ + if ([json isKindOfClass:[type class]]) { \ + return json; \ + } else if (json) { \ +- HippyLogConvertError(json, @ #type); \ ++ NativeRenderLogConvertError(json, @ #type); \ + } \ + return nil; \ + } + #else +-#define Hippy_JSON_CONVERTER(type) \ ++#define HIPPY_JSON_CONVERTER(type) \ + +(type *)type : (id)json { \ + return json; \ + } + #endif + +-Hippy_JSON_CONVERTER(NSArray) +-Hippy_JSON_CONVERTER(NSDictionary) +-Hippy_JSON_CONVERTER(NSString) +-Hippy_JSON_CONVERTER(NSNumber) ++HIPPY_JSON_CONVERTER(NSArray) ++HIPPY_JSON_CONVERTER(NSDictionary) ++HIPPY_JSON_CONVERTER(NSString) ++HIPPY_JSON_CONVERTER(NSNumber) + +-Hippy_CUSTOM_CONVERTER(NSSet *, NSSet, [NSSet setWithArray:json]) +-Hippy_CUSTOM_CONVERTER(NSData *, NSData, [json dataUsingEncoding:NSUTF8StringEncoding]) ++HIPPY_CUSTOM_CONVERTER(NSSet *, NSSet, [NSSet setWithArray:json]) ++HIPPY_CUSTOM_CONVERTER(NSData *, NSData, [json dataUsingEncoding:NSUTF8StringEncoding]) + + + (NSIndexSet *)NSIndexSet : (id)json { + json = [self NSNumberArray:json]; + NSMutableIndexSet *indexSet = [NSMutableIndexSet new]; + for (NSNumber *number in json) { + NSInteger index = number.integerValue; +- if (HIPPY_DEBUG && index < 0) { +- HippyLogError(@""Invalid index value %ld. Indices must be positive."", (long)index); ++ if (NATIVE_RENDER_DEBUG && index < 0) { ++ NativeRenderLogError(@""Invalid index value %ld. Indices must be positive."", (long)index); + } + [indexSet addIndex:index]; + } +@@ -90,7 +89,7 @@ + (NSURL *)NSURL:(id)json { + + @try { // NSURL has a history of crashing with bad input, so let's be safe + +- NSURL *URL = HippyURLWithString(path, NULL); ++ NSURL *URL = NativeRenderURLWithString(path, NULL); + if (URL.scheme) { // Was a well-formed absolute URL + return URL; + } +@@ -104,7 +103,7 @@ + (NSURL *)NSURL:(id)json { + CFURLRef urlRef = CFURLCreateWithBytes(NULL, (const UInt8 *)[uriData bytes], [uriData length], kCFStringEncodingUTF8, NULL); + // bug:直接将CFURLRef转化为NSURL,如果包含有汉字字符,UIWebView载入之后,在shouldstartload中的request对应的URL会出现不正确的情况,不知道为什么。只能先转换为string,在转换为NSURL解决 + CFStringRef stringRef = CFURLGetString(urlRef); +- URL = HippyURLWithString((__bridge NSString *)stringRef, NULL); ++ URL = NativeRenderURLWithString((__bridge NSString *)stringRef, NULL); + CFRelease(urlRef); + if (URL) { + return URL; +@@ -121,11 +120,11 @@ + (NSURL *)NSURL:(id)json { + path = [[NSBundle mainBundle].resourcePath stringByAppendingPathComponent:path]; + } + if (!(URL = [NSURL fileURLWithPath:path])) { +- HippyLogConvertError(json, @""a valid URL""); ++ NativeRenderLogConvertError(json, @""a valid URL""); + } + return URL; + } @catch (__unused NSException *e) { +- HippyLogConvertError(json, @""a valid URL""); ++ NativeRenderLogConvertError(json, @""a valid URL""); + return nil; + } + } +@@ -160,7 +159,7 @@ + (NSURLRequest *)NSURLRequest:(id)json { + __block BOOL allHeadersAreStrings = YES; + [headers enumerateKeysAndObjectsUsingBlock:^(__unused NSString *key, id header, BOOL *stop) { + if (![header isKindOfClass:[NSString class]]) { +- HippyLogError(@""Values of HTTP headers passed must be of type string. "" ++ NativeRenderLogError(@""Values of HTTP headers passed must be of type string. "" + ""Value of header '%@' is not a string."", + key); + allHeadersAreStrings = NO; +@@ -180,19 +179,19 @@ + (NSURLRequest *)NSURLRequest:(id)json { + return [request copy]; + } + if (json) { +- HippyLogConvertError(json, @""a valid URLRequest""); ++ NativeRenderLogConvertError(json, @""a valid URLRequest""); + } + return nil; + } + +-+ (HippyFileURL *)HippyFileURL:(id)json { +++ (NativeRenderFileURL *)NativeRenderFileURL:(id)json { + NSURL *fileURL = [self NSURL:json]; + if (!fileURL.fileURL) { +- HippyLogError(@""URI must be a local file, '%@' isn't."", fileURL); ++ NativeRenderLogError(@""URI must be a local file, '%@' isn't."", fileURL); + return nil; + } + if (![[NSFileManager defaultManager] fileExistsAtPath:fileURL.path]) { +- HippyLogError(@""File '%@' could not be found."", fileURL); ++ NativeRenderLogError(@""File '%@' could not be found."", fileURL); + return nil; + } + return fileURL; +@@ -212,24 +211,24 @@ + (NSDate *)NSDate:(id)json { + }); + NSDate *date = [formatter dateFromString:json]; + if (!date) { +- HippyLogError(@""JSON String '%@' could not be interpreted as a date. "" ++ NativeRenderLogError(@""JSON String '%@' could not be interpreted as a date. "" + ""Expected format: YYYY-MM-DD'T'HH:mm:ss.sssZ"", + json); + } + return date; + } else if (json) { +- HippyLogConvertError(json, @""a date""); ++ NativeRenderLogConvertError(json, @""a date""); + } + return nil; + } + + // JS Standard for time is milliseconds +-Hippy_CUSTOM_CONVERTER(NSTimeInterval, NSTimeInterval, [self double:json] / 1000.0) ++HIPPY_CUSTOM_CONVERTER(NSTimeInterval, NSTimeInterval, [self double:json] / 1000.0) + + // JS standard for time zones is minutes. +-Hippy_CUSTOM_CONVERTER(NSTimeZone *, NSTimeZone, [NSTimeZone timeZoneForSecondsFromGMT:[self double:json] * 60.0]) ++HIPPY_CUSTOM_CONVERTER(NSTimeZone *, NSTimeZone, [NSTimeZone timeZoneForSecondsFromGMT:[self double:json] * 60.0]) + +-NSNumber *HippyConvertEnumValue(__unused const char *typeName, NSDictionary *mapping, NSNumber *defaultValue, id json) { ++NSNumber *NativeRenderConvertEnumValue(__unused const char *typeName, NSDictionary *mapping, NSNumber *defaultValue, id json) { + if (!json) { + return defaultValue; + } +@@ -238,33 +237,33 @@ + (NSDate *)NSDate:(id)json { + if ([allValues containsObject:json] || [json isEqual:defaultValue]) { + return json; + } +- HippyLogError(@""Invalid %s '%@'. should be one of: %@"", typeName, json, allValues); ++ NativeRenderLogError(@""Invalid %s '%@'. should be one of: %@"", typeName, json, allValues); + return defaultValue; + } +- if (HIPPY_DEBUG && ![json isKindOfClass:[NSString class]]) { +- HippyLogError(@""Expected NSNumber or NSString for %s, received %@: %@"", typeName, [json classForCoder], json); ++ if (NATIVE_RENDER_DEBUG && ![json isKindOfClass:[NSString class]]) { ++ NativeRenderLogError(@""Expected NSNumber or NSString for %s, received %@: %@"", typeName, [json classForCoder], json); + } + id value = mapping[json]; +- if (HIPPY_DEBUG && !value && [json description].length > 0) { +- HippyLogError(@""Invalid %s '%@'. should be one of: %@"", typeName, json, ++ if (NATIVE_RENDER_DEBUG && !value && [json description].length > 0) { ++ NativeRenderLogError(@""Invalid %s '%@'. should be one of: %@"", typeName, json, + [[mapping allKeys] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)]); + } + return value ?: defaultValue; + } + +-NSNumber *HippyConvertMultiEnumValue(const char *typeName, NSDictionary *mapping, NSNumber *defaultValue, id json) { ++NSNumber *NativeRenderConvertMultiEnumValue(const char *typeName, NSDictionary *mapping, NSNumber *defaultValue, id json) { + if ([json isKindOfClass:[NSArray class]]) { + if ([json count] == 0) { + return defaultValue; + } + long long result = 0; + for (id arrayElement in json) { +- NSNumber *value = HippyConvertEnumValue(typeName, mapping, defaultValue, arrayElement); ++ NSNumber *value = NativeRenderConvertEnumValue(typeName, mapping, defaultValue, arrayElement); + result |= value.longLongValue; + } + return @(result); + } +- return HippyConvertEnumValue(typeName, mapping, defaultValue, json); ++ return NativeRenderConvertEnumValue(typeName, mapping, defaultValue, json); + } + + HIPPY_ENUM_CONVERTER(NSLineBreakMode, (@{ +@@ -293,21 +292,21 @@ + (NSDate *)NSDate:(id)json { + }), + NSUnderlineStyleSingle, integerValue) + +-HIPPY_ENUM_CONVERTER(HippyBorderStyle, (@{ +- @""solid"": @(HippyBorderStyleSolid), +- @""dotted"": @(HippyBorderStyleDotted), +- @""dashed"": @(HippyBorderStyleDashed), +- @""none"": @(HippyBorderStyleNone), ++HIPPY_ENUM_CONVERTER(NativeRenderBorderStyle, (@{ ++ @""solid"": @(NativeRenderBorderStyleSolid), ++ @""dotted"": @(NativeRenderBorderStyleDotted), ++ @""dashed"": @(NativeRenderBorderStyleDashed), ++ @""none"": @(NativeRenderBorderStyleNone), + }), +-HippyBorderStyleSolid, integerValue) ++NativeRenderBorderStyleSolid, integerValue) + +-HIPPY_ENUM_CONVERTER(HippyTextDecorationLineType, (@{ +- @""none"": @(HippyTextDecorationLineTypeNone), +- @""underline"": @(HippyTextDecorationLineTypeUnderline), +- @""line-through"": @(HippyTextDecorationLineTypeStrikethrough), +- @""underline line-through"": @(HippyTextDecorationLineTypeUnderlineStrikethrough), ++HIPPY_ENUM_CONVERTER(NativeRenderTextDecorationLineType, (@{ ++ @""none"": @(NativeRenderTextDecorationLineTypeNone), ++ @""underline"": @(NativeRenderTextDecorationLineTypeUnderline), ++ @""line-through"": @(NativeRenderTextDecorationLineTypeStrikethrough), ++ @""underline line-through"": @(NativeRenderTextDecorationLineTypeUnderlineStrikethrough), + }), +-HippyTextDecorationLineTypeNone, integerValue) ++NativeRenderTextDecorationLineTypeNone, integerValue) + + HIPPY_ENUM_CONVERTER(NSWritingDirection, (@{ + @""auto"": @(NSWritingDirectionNatural), +@@ -352,7 +351,7 @@ + (NSDate *)NSDate:(id)json { + }), + UIKeyboardTypeDefault, integerValue) + +-Hippy_MULTI_ENUM_CONVERTER(UIDataDetectorTypes, (@{ ++HIPPY_MULTI_ENUM_CONVERTER(UIDataDetectorTypes, (@{ + @""phoneNumber"": @(UIDataDetectorTypePhoneNumber), + @""link"": @(UIDataDetectorTypeLink), + @""address"": @(UIDataDetectorTypeAddress), +@@ -411,15 +410,14 @@ + (NSDate *)NSDate:(id)json { + }), + UIBarStyleDefault, integerValue) + +-// TODO: normalise the use of w/width so we can do away with the alias values (#6566645) +-static void HippyConvertCGStructValue(__unused const char *type, NSArray *fields, NSDictionary *aliases, CGFloat *result, id json) { ++static void NativeRenderConvertCGStructValue(__unused const char *type, NSArray *fields, NSDictionary *aliases, CGFloat *result, id json) { + NSUInteger count = fields.count; + if ([json isKindOfClass:[NSArray class]]) { +- if (HIPPY_DEBUG && [json count] != count) { +- HippyLogError(@""Expected array with count %lu, but count is %lu: %@"", (unsigned long)count, (unsigned long)[json count], json); ++ if (NATIVE_RENDER_DEBUG && [json count] != count) { ++ NativeRenderLogError(@""Expected array with count %lu, but count is %lu: %@"", (unsigned long)count, (unsigned long)[json count], json); + } else { + for (NSUInteger i = 0; i < count; i++) { +- result[i] = [HippyConvert CGFloat:json[i]]; ++ result[i] = [NativeRenderConvert CGFloat:json[i]]; + } + } + } else if ([json isKindOfClass:[NSDictionary class]]) { +@@ -429,16 +427,16 @@ static void HippyConvertCGStructValue(__unused const char *type, NSArray *fields + NSString *key = aliases[alias]; + NSNumber *number = json[alias]; + if (number != nil) { +- HippyLogWarn(@""Using deprecated '%@' property for '%s'. Use '%@' instead."", alias, type, key); ++ NativeRenderLogWarn(@""Using deprecated '%@' property for '%s'. Use '%@' instead."", alias, type, key); + ((NSMutableDictionary *)json)[key] = number; + } + } + } + for (NSUInteger i = 0; i < count; i++) { +- result[i] = [HippyConvert CGFloat:json[fields[i]]]; ++ result[i] = [NativeRenderConvert CGFloat:json[fields[i]]]; + } + } else if (json) { +- HippyLogConvertError(json, @(type)); ++ NativeRenderLogConvertError(json, @(type)); + } + } + +@@ -446,7 +444,7 @@ static void HippyConvertCGStructValue(__unused const char *type, NSArray *fields + * This macro is used for creating converter functions for structs that consist + * of a number of CGFloat properties, such as CGPoint, CGRect, etc. + */ +-#define Hippy_CGSTRUCT_CONVERTER(type, values, aliases) \ ++#define HIPPY_CGSTRUCT_CONVERTER(type, values, aliases) \ + +(type)type : (id)json { \ + static NSArray *fields; \ + static dispatch_once_t onceToken; \ +@@ -454,15 +452,15 @@ +(type)type : (id)json { + fields = values; \ + }); \ + type result; \ +- HippyConvertCGStructValue(#type, fields, aliases, (CGFloat *)&result, json); \ ++ NativeRenderConvertCGStructValue(#type, fields, aliases, (CGFloat *)&result, json); \ + return result; \ + } + +-Hippy_CUSTOM_CONVERTER(CGFloat, CGFloat, [self double:json]) +-Hippy_CGSTRUCT_CONVERTER(CGPoint, (@[@""x"", @""y""]), (@{ @""l"": @""x"", @""t"": @""y"" })) +-Hippy_CGSTRUCT_CONVERTER(CGSize, (@[@""width"", @""height""]), (@{ @""w"": @""width"", @""h"": @""height"" })) +-Hippy_CGSTRUCT_CONVERTER(CGRect, (@[@""x"", @""y"", @""width"", @""height""]), (@{ @""l"": @""x"", @""t"": @""y"", @""w"": @""width"", @""h"": @""height"" })) +-Hippy_CGSTRUCT_CONVERTER(UIEdgeInsets, (@[@""top"", @""left"", @""bottom"", @""right""]), nil) ++HIPPY_CUSTOM_CONVERTER(CGFloat, CGFloat, [self double:json]) ++HIPPY_CGSTRUCT_CONVERTER(CGPoint, (@[@""x"", @""y""]), (@{ @""l"": @""x"", @""t"": @""y"" })) ++HIPPY_CGSTRUCT_CONVERTER(CGSize, (@[@""width"", @""height""]), (@{ @""w"": @""width"", @""h"": @""height"" })) ++HIPPY_CGSTRUCT_CONVERTER(CGRect, (@[@""x"", @""y"", @""width"", @""height""]), (@{ @""l"": @""x"", @""t"": @""y"", @""w"": @""width"", @""h"": @""height"" })) ++HIPPY_CGSTRUCT_CONVERTER(UIEdgeInsets, (@[@""top"", @""left"", @""bottom"", @""right""]), nil) + HIPPY_ENUM_CONVERTER(CGLineJoin, (@{ + @""miter"": @(kCGLineJoinMiter), + @""round"": @(kCGLineJoinRound), +@@ -477,14 +475,14 @@ +(type)type : (id)json { + }), + kCGLineCapButt, intValue) + +- // Hippy_CGSTRUCT_CONVERTER(CATransform3D, (@[ ++ // HIPPY_CGSTRUCT_CONVERTER(CATransform3D, (@[ + // @""m11"", @""m12"", @""m13"", @""m14"", + // @""m21"", @""m22"", @""m23"", @""m24"", + // @""m31"", @""m32"", @""m33"", @""m34"", + // @""m41"", @""m42"", @""m43"", @""m44"" + //]), nil) + +-Hippy_CGSTRUCT_CONVERTER(CGAffineTransform, (@[@""a"", @""b"", @""c"", @""d"", @""tx"", @""ty""]), nil) ++HIPPY_CGSTRUCT_CONVERTER(CGAffineTransform, (@[@""a"", @""b"", @""c"", @""d"", @""tx"", @""ty""]), nil) + + + (UIColor *)UIColor : (id)json { + if (!json) { +@@ -502,7 +500,7 @@ + (UIColor *)UIColor : (id)json { + CGFloat b = (argb & 0xFF) / 255.0; + return [UIColor colorWithRed:r green:g blue:b alpha:a]; + } else { +- HippyLogConvertError(json, @""a UIColor. Did you forget to call processColor() on the JS side?""); ++ NativeRenderLogConvertError(json, @""a UIColor. Did you forget to call processColor() on the JS side?""); + return nil; + } + } +@@ -511,12 +509,12 @@ + (CGColorRef)CGColor:(id)json { + return [self UIColor:json].CGColor; + } + +-NSArray *HippyConvertArrayValue(SEL type, id json) { ++NSArray *NativeRenderConvertArrayValue(SEL type, id json) { + __block BOOL copy = NO; +- __block NSArray *values = json = [HippyConvert NSArray:json]; ++ __block NSArray *values = json = [NativeRenderConvert NSArray:json]; + if ([values isKindOfClass:[NSArray class]]) { + [json enumerateObjectsUsingBlock:^(id jsonValue, NSUInteger idx, __unused BOOL *stop) { +- id value = ((id(*)(Class, SEL, id))objc_msgSend)([HippyConvert class], type, jsonValue); ++ id value = ((id(*)(Class, SEL, id))objc_msgSend)([NativeRenderConvert class], type, jsonValue); + if (copy) { + if (value) { + [(NSMutableArray *)values addObject:value]; +@@ -539,35 +537,34 @@ + (CGColorRef)CGColor:(id)json { + } + } + +-SEL HippyConvertSelectorForType(NSString *type) { ++SEL NativeRenderConvertSelectorForType(NSString *type) { + const char *input = type.UTF8String; +- return NSSelectorFromString([HippyParseType(&input) stringByAppendingString:@"":""]); ++ return NSSelectorFromString([NativeRenderParseType(&input) stringByAppendingString:@"":""]); + } + +-Hippy_ARRAY_CONVERTER(NSURL) Hippy_ARRAY_CONVERTER(HippyFileURL) Hippy_ARRAY_CONVERTER(UIColor) ++HIPPY_ARRAY_CONVERTER(NSURL) HIPPY_ARRAY_CONVERTER(NativeRenderFileURL) HIPPY_ARRAY_CONVERTER(UIColor) + /** + * This macro is used for creating converter functions for directly + * representable json array values that require no conversion. + */ +-#if HIPPY_DEBUG +-#define Hippy_JSON_ARRAY_CONVERTER(type) Hippy_ARRAY_CONVERTER(type) ++#if NATIVE_RENDER_DEBUG ++#define HIPPY_JSON_ARRAY_CONVERTER(type) HIPPY_ARRAY_CONVERTER(type) + #else +-#define Hippy_JSON_ARRAY_CONVERTER(type) \ ++#define HIPPY_JSON_ARRAY_CONVERTER(type) \ + +(NSArray *)type##Array : (id)json { \ + return json; \ + } + #endif + +-Hippy_JSON_ARRAY_CONVERTER(NSArray) +-Hippy_JSON_ARRAY_CONVERTER(NSString) +-// Hippy_JSON_ARRAY_CONVERTER(NSStringArray) ++HIPPY_JSON_ARRAY_CONVERTER(NSArray) ++HIPPY_JSON_ARRAY_CONVERTER(NSString) + + (NSArray *> *)NSStringArrayArray : (id)json { +- return HippyConvertArrayValue(@selector(NSStringArray:), json); ++ return NativeRenderConvertArrayValue(@selector(NSStringArray:), json); + } +-Hippy_JSON_ARRAY_CONVERTER(NSDictionary) +-Hippy_JSON_ARRAY_CONVERTER(NSNumber) ++HIPPY_JSON_ARRAY_CONVERTER(NSDictionary) ++HIPPY_JSON_ARRAY_CONVERTER(NSNumber) + +-// Can't use Hippy_ARRAY_CONVERTER due to bridged cast ++// Can't use HIPPY_ARRAY_CONVERTER due to bridged cast + + (NSArray *)CGColorArray : (id)json { + NSMutableArray *colors = [NSMutableArray new]; + for (id value in [self NSArray:json]) { +@@ -576,7 +573,7 @@ + (NSArray *)CGColorArray : (id)json { + return colors; + } + +-static id HippyConvertPropertyListValue(id json) { ++static id NativeRenderConvertPropertyListValue(id json) { + if (!json || json == (id)kCFNull) { + return nil; + } +@@ -585,7 +582,7 @@ static id HippyConvertPropertyListValue(id json) { + __block BOOL copy = NO; + NSMutableDictionary *values = [[NSMutableDictionary alloc] initWithCapacity:[json count]]; + [json enumerateKeysAndObjectsUsingBlock:^(NSString *key, id jsonValue, __unused BOOL *stop) { +- id value = HippyConvertPropertyListValue(jsonValue); ++ id value = NativeRenderConvertPropertyListValue(jsonValue); + if (value) { + values[key] = value; + } +@@ -598,7 +595,7 @@ static id HippyConvertPropertyListValue(id json) { + __block BOOL copy = NO; + __block NSArray *values = json; + [json enumerateObjectsUsingBlock:^(id jsonValue, NSUInteger idx, __unused BOOL *stop) { +- id value = HippyConvertPropertyListValue(jsonValue); ++ id value = NativeRenderConvertPropertyListValue(jsonValue); + if (copy) { + if (value) { + [(NSMutableArray *)values addObject:value]; +@@ -623,7 +620,7 @@ static id HippyConvertPropertyListValue(id json) { + } + + + (NSPropertyList)NSPropertyList:(id)json { +- return HippyConvertPropertyListValue(json); ++ return NativeRenderConvertPropertyListValue(json); + } + + HIPPY_ENUM_CONVERTER(css_backface_visibility_t, (@{ @""hidden"": @NO, @""visible"": @YES }), YES, boolValue) +@@ -664,27 +661,27 @@ + (NSPropertyList)NSPropertyList:(id)json { + HIPPY_ENUM_CONVERTER( + DisplayType, (@{ @""flex"": @(DisplayTypeFlex), @""block"": @(DisplayTypeFlex), @""none"": @(DisplayTypeNone) }), DisplayTypeFlex, intValue) + +-HIPPY_ENUM_CONVERTER(HippyPointerEvents, (@{ +- @""none"": @(HippyPointerEventsNone), +- @""box-only"": @(HippyPointerEventsBoxOnly), +- @""box-none"": @(HippyPointerEventsBoxNone), +- @""auto"": @(HippyPointerEventsUnspecified) ++HIPPY_ENUM_CONVERTER(NativeRenderPointerEvents, (@{ ++ @""none"": @(NativeRenderPointerEventsNone), ++ @""box-only"": @(NativeRenderPointerEventsBoxOnly), ++ @""box-none"": @(NativeRenderPointerEventsBoxNone), ++ @""auto"": @(NativeRenderPointerEventsUnspecified) + }), +-HippyPointerEventsUnspecified, integerValue) +- +-HIPPY_ENUM_CONVERTER(HippyAnimationType, (@{ +- @""spring"": @(HippyAnimationTypeSpring), +- @""linear"": @(HippyAnimationTypeLinear), +- @""easeIn"": @(HippyAnimationTypeEaseIn), +- @""easeOut"": @(HippyAnimationTypeEaseOut), +- @""easeInEaseOut"": @(HippyAnimationTypeEaseInEaseOut), +- @""keyboard"": @(HippyAnimationTypeKeyboard), ++NativeRenderPointerEventsUnspecified, integerValue) ++ ++HIPPY_ENUM_CONVERTER(NativeRenderAnimationType, (@{ ++ @""spring"": @(NativeRenderAnimationTypeSpring), ++ @""linear"": @(NativeRenderAnimationTypeLinear), ++ @""easeIn"": @(NativeRenderAnimationTypeEaseIn), ++ @""easeOut"": @(NativeRenderAnimationTypeEaseOut), ++ @""easeInEaseOut"": @(NativeRenderAnimationTypeEaseInEaseOut), ++ @""keyboard"": @(NativeRenderAnimationTypeKeyboard), + }), +-HippyAnimationTypeEaseInEaseOut, integerValue) ++NativeRenderAnimationTypeEaseInEaseOut, integerValue) + + @end + +-@implementation HippyConvert (Deprecated) ++@implementation NativeRenderConvert (Deprecated) + + /* This method is only used when loading images synchronously, e.g. for tabbar icons */ + + (UIImage *)UIImage:(id)json { +@@ -697,21 +694,21 @@ + (UIImage *)UIImage:(id)json { + return nil; + + __block UIImage *image; +- if (!HippyIsMainQueue()) { ++ if (!NativeRenderIsMainQueue()) { + // It seems that none of the UIImage loading methods can be guaranteed + // thread safe, so we'll pick the lesser of two evils here and block rather + // than run the risk of crashing +- HippyLogWarn(@""Calling [HippyConvert UIImage:] on a background thread is not recommended""); ++ NativeRenderLogWarn(@""Calling [NativeRenderConvert UIImage:] on a background thread is not recommended""); + dispatch_sync(dispatch_get_main_queue(), ^{ + image = [self UIImage:json]; + }); + return image; + } + +- NSURL *URL = HippyURLWithString(uri, NULL); ++ NSURL *URL = NativeRenderURLWithString(uri, NULL); + NSString *scheme = URL.scheme.lowercaseString; + if ([scheme isEqualToString:@""file""]) { +- NSString *assetName = HippyBundlePathForURL(URL); ++ NSString *assetName = NativeRenderBundlePathForURL(URL); + image = assetName ? [UIImage imageNamed:assetName] : nil; + if (!image) { + // Attempt to load from the file system +@@ -721,13 +718,13 @@ + (UIImage *)UIImage:(id)json { + } + image = [UIImage imageWithContentsOfFile:filePath]; + if (!image) { +- HippyLogConvertError(json, @""an image. File not found.""); ++ NativeRenderLogConvertError(json, @""an image. File not found.""); + } + } + } else if ([scheme isEqualToString:@""data""]) { + image = [UIImage imageWithData:[NSData dataWithContentsOfURL:URL]]; + } else { +- HippyLogConvertError(json, @""an image. Only base64 image data are supported.""); ++ NativeRenderLogConvertError(json, @""an image. Only base64 image data are supported.""); + return nil; + } + return image; +diff --git a/renderer/native/ios/utils/HippyDeepCopyProtocol.h b/renderer/native/ios/utils/NativeRenderDeepCopyProtocol.h +similarity index 91% +rename from renderer/native/ios/utils/HippyDeepCopyProtocol.h +rename to renderer/native/ios/utils/NativeRenderDeepCopyProtocol.h +index d99145413d9..90ba3aab16e 100644 +--- a/renderer/native/ios/utils/HippyDeepCopyProtocol.h ++++ b/renderer/native/ios/utils/NativeRenderDeepCopyProtocol.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -22,7 +22,7 @@ + + #import + +-@protocol HippyDeepCopyProtocol ++@protocol NativeRenderDeepCopyProtocol + @required + - (id)hippyDeepCopy; + - (id)hippyMutableDeepCopy; +diff --git a/renderer/native/ios/utils/HippyDefaultImageProvider.h b/renderer/native/ios/utils/NativeRenderDefaultImageProvider.h +similarity index 84% +rename from renderer/native/ios/utils/HippyDefaultImageProvider.h +rename to renderer/native/ios/utils/NativeRenderDefaultImageProvider.h +index 4df2057dfc8..0d9ec98b66e 100644 +--- a/renderer/native/ios/utils/HippyDefaultImageProvider.h ++++ b/renderer/native/ios/utils/NativeRenderDefaultImageProvider.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,9 +21,9 @@ + */ + + #import +-#import ""HippyImageProviderProtocol.h"" ++#import ""NativeRenderImageProviderProtocol.h"" + +-@interface HippyDefaultImageProvider : NSObject ++@interface NativeRenderDefaultImageProvider : NSObject + + @property (nonatomic, assign) BOOL downSample; + @property (nonatomic, assign) CGSize imageViewSize; +diff --git a/renderer/native/ios/utils/HippyDefaultImageProvider.m b/renderer/native/ios/utils/NativeRenderDefaultImageProvider.m +similarity index 97% +rename from renderer/native/ios/utils/HippyDefaultImageProvider.m +rename to renderer/native/ios/utils/NativeRenderDefaultImageProvider.m +index 72938d7ba6e..f4cfe1e5872 100644 +--- a/renderer/native/ios/utils/HippyDefaultImageProvider.m ++++ b/renderer/native/ios/utils/NativeRenderDefaultImageProvider.m +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,11 +21,11 @@ + */ + + #import +-#import ""HippyDefaultImageProvider.h"" ++#import ""NativeRenderDefaultImageProvider.h"" + #import ""NSData+DataType.h"" + #import + +-@interface HippyDefaultImageProvider () { ++@interface NativeRenderDefaultImageProvider () { + NSData *_data; + UIImage *_image; + CGImageSourceRef _imageSourceRef; +@@ -33,7 +33,7 @@ @interface HippyDefaultImageProvider () { + + @end + +-@implementation HippyDefaultImageProvider ++@implementation NativeRenderDefaultImageProvider + + @synthesize imageDataPath; + @synthesize scale; +diff --git a/renderer/native/ios/utils/NativeRenderDefines.h b/renderer/native/ios/utils/NativeRenderDefines.h +new file mode 100644 +index 00000000000..9674fec7ee1 +--- /dev/null ++++ b/renderer/native/ios/utils/NativeRenderDefines.h +@@ -0,0 +1,53 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * NativeRender available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#if __OBJC__ ++#import ++#endif ++ ++/** ++ * Make global functions usable in C++ ++ */ ++#if defined(__cplusplus) ++#define NATIVE_RENDER_EXTERN extern ""C"" __attribute__((visibility(""default""))) ++#else //#if defined(__cplusplus) ++#define NATIVE_RENDER_EXTERN extern __attribute__((visibility(""default""))) ++#endif //#if defined(__cplusplus) ++ ++/** ++ * The NATIVE_RENDER_DEBUG macro can be used to exclude error checking and logging code ++ * from release builds to improve performance and reduce binary size. ++ */ ++#ifndef NATIVE_RENDER_DEBUG ++#ifdef DEBUG ++#define NATIVE_RENDER_DEBUG 1 ++#else //#ifdef DEBUG ++#define NATIVE_RENDER_DEBUG 0 ++#endif //#ifdef DEBUG ++#endif //#ifndef NATIVE_RENDER_DEBUG ++ ++/** ++ * Concat two literals. Supports macro expansions, ++ * e.g. NATIVE_RENDER_CONCAT(foo, __FILE__). ++ */ ++#define NATIVE_RENDER_CONCAT2(A, B) A##B ++#define NATIVE_RENDER_CONCAT(A, B) NATIVE_RENDER_CONCAT2(A, B) +diff --git a/renderer/native/ios/utils/HippyDomNodeUtils.h b/renderer/native/ios/utils/NativeRenderDomNodeUtils.h +similarity index 54% +rename from renderer/native/ios/utils/HippyDomNodeUtils.h +rename to renderer/native/ios/utils/NativeRenderDomNodeUtils.h +index 8b41429fc68..f6f6f185574 100644 +--- a/renderer/native/ios/utils/HippyDomNodeUtils.h ++++ b/renderer/native/ios/utils/NativeRenderDomNodeUtils.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,32 +20,32 @@ + * limitations under the License. + */ + +-#import ""HippyShadowView.h"" +-#import ""HippyDefines.h"" ++#import ""NativeRenderObjectView.h"" + #include ""dom/dom_node.h"" + #include ""dom/dom_listener.h"" + #include ""footstone/hippy_value.h"" ++#import ""NativeRenderDefines.h"" + + NS_ASSUME_NONNULL_BEGIN + +-HIPPY_EXTERN id domValueToOCType(const footstone::value::HippyValue *const pDomValue); ++NATIVE_RENDER_EXTERN id domValueToOCType(const footstone::value::HippyValue *const pDomValue); + + extern footstone::value::HippyValue OCTypeToDomValue(id value); + +-HIPPY_EXTERN NSDictionary *unorderedMapDomValueToDictionary(const std::shared_ptr>> &domValuesObject); ++NATIVE_RENDER_EXTERN NSDictionary *unorderedMapDomValueToDictionary(const std::shared_ptr>> &domValuesObject); + + extern std::unordered_map> dictionaryToUnorderedMapDomValue(NSDictionary *dictionary); + +-HIPPY_EXTERN CGRect CGRectMakeFromLayoutResult(hippy::LayoutResult result); ++NATIVE_RENDER_EXTERN CGRect CGRectMakeFromLayoutResult(hippy::LayoutResult result); + +-HIPPY_EXTERN UIEdgeInsets UIEdgeInsetsFromLayoutResult(hippy::LayoutResult result); ++NATIVE_RENDER_EXTERN UIEdgeInsets UIEdgeInsetsFromLayoutResult(hippy::LayoutResult result); + +-HIPPY_EXTERN CGSize CGSizeMakeFromLayoutResult(hippy::LayoutResult result); ++NATIVE_RENDER_EXTERN CGSize CGSizeMakeFromLayoutResult(hippy::LayoutResult result); + +-HIPPY_EXTERN CGRect CGRectMakeFromDomNode(const std::shared_ptr &domNode); ++NATIVE_RENDER_EXTERN CGRect CGRectMakeFromDomNode(const std::shared_ptr &domNode); + +-HIPPY_EXTERN NSNumber *domValueToNumber(const footstone::value::HippyValue *const pDomValue); ++NATIVE_RENDER_EXTERN NSNumber *domValueToNumber(const footstone::value::HippyValue *const pDomValue); + +-HIPPY_EXTERN NSDictionary *stylesFromDomNode(const std::shared_ptr &domNode); ++NATIVE_RENDER_EXTERN NSDictionary *stylesFromDomNode(const std::shared_ptr &domNode); + + NS_ASSUME_NONNULL_END +diff --git a/renderer/native/ios/utils/HippyDomNodeUtils.mm b/renderer/native/ios/utils/NativeRenderDomNodeUtils.mm +similarity index 99% +rename from renderer/native/ios/utils/HippyDomNodeUtils.mm +rename to renderer/native/ios/utils/NativeRenderDomNodeUtils.mm +index 8fdd8a77ab3..90a96fadc82 100644 +--- a/renderer/native/ios/utils/HippyDomNodeUtils.mm ++++ b/renderer/native/ios/utils/NativeRenderDomNodeUtils.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,7 +20,7 @@ + * limitations under the License. + */ + +-#import ""HippyDomNodeUtils.h"" ++#import ""NativeRenderDomNodeUtils.h"" + + using HippyValue = footstone::value::HippyValue; + using DomManager = hippy::DomManager; +diff --git a/renderer/native/ios/utils/HippyDownloadTask.h b/renderer/native/ios/utils/NativeRenderDownloadTask.h +similarity index 93% +rename from renderer/native/ios/utils/HippyDownloadTask.h +rename to renderer/native/ios/utils/NativeRenderDownloadTask.h +index 7a091f189db..fe02b216cb5 100644 +--- a/renderer/native/ios/utils/HippyDownloadTask.h ++++ b/renderer/native/ios/utils/NativeRenderDownloadTask.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -24,7 +24,7 @@ + + NS_ASSUME_NONNULL_BEGIN + +-@interface HippyDownloadTask : NSObject ++@interface NativeRenderDownloadTask : NSObject + + - (instancetype)initWithURL:(NSURL *)URL progress:(void(^)(NSUInteger, NSUInteger))progress + completion:(void(^)(NSData *, NSURL *, NSError *))completion; +diff --git a/renderer/native/ios/utils/HippyDownloadTask.m b/renderer/native/ios/utils/NativeRenderDownloadTask.m +similarity index 95% +rename from renderer/native/ios/utils/HippyDownloadTask.m +rename to renderer/native/ios/utils/NativeRenderDownloadTask.m +index c3b7d8062a0..43508e68d2a 100644 +--- a/renderer/native/ios/utils/HippyDownloadTask.m ++++ b/renderer/native/ios/utils/NativeRenderDownloadTask.m +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,7 +20,7 @@ + * limitations under the License. + */ + +-#import ""HippyDownloadTask.h"" ++#import ""NativeRenderDownloadTask.h"" + + typedef void(^DownloadProgress)(NSUInteger, NSUInteger); + typedef void(^CompletionBlock)(NSData *, NSURL *, NSError *); +@@ -35,7 +35,7 @@ + return _hippy_data_queue; + } + +-@interface HippyDownloadTask () { ++@interface NativeRenderDownloadTask () { + NSURL *_URL; + DownloadProgress _progress; + CompletionBlock _completion; +@@ -46,7 +46,7 @@ @interface HippyDownloadTask () { + + @end + +-@implementation HippyDownloadTask ++@implementation NativeRenderDownloadTask + + #pragma mark Life Cycle + - (instancetype)initWithURL:(NSURL *)URL progress:(DownloadProgress)progress +diff --git a/renderer/native/ios/utils/RenderErrorHandler.h b/renderer/native/ios/utils/NativeRenderErrorHandler.h +similarity index 71% +rename from renderer/native/ios/utils/RenderErrorHandler.h +rename to renderer/native/ios/utils/NativeRenderErrorHandler.h +index 912c1846ef9..1f3aba0df1b 100644 +--- a/renderer/native/ios/utils/RenderErrorHandler.h ++++ b/renderer/native/ios/utils/NativeRenderErrorHandler.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,18 +21,18 @@ + */ + + #import +-#import ""HippyDefines.h"" ++#import ""NativeRenderDefines.h"" + + NS_ASSUME_NONNULL_BEGIN + + extern NSString *const RenderFatalModuleName; + extern NSString *const RenderErrorDomain; + +-typedef void (^RenderFatalHandler)(NSError *error); ++typedef void (^NativeRenderFatalHandler)(NSError *error); + +-HIPPY_EXTERN void RenderSetFatalHandler(RenderFatalHandler fatalHandler); +-HIPPY_EXTERN RenderFatalHandler RenderGetFatalHandler(void); ++NATIVE_RENDER_EXTERN void NativeRenderSetFatalHandler(NativeRenderFatalHandler fatalHandler); ++NATIVE_RENDER_EXTERN NativeRenderFatalHandler NativeRenderGetFatalHandler(void); + +-HIPPY_EXTERN void RenderFatal(NSError *error); ++NATIVE_RENDER_EXTERN void NativeRenderFatal(NSError *error); + + NS_ASSUME_NONNULL_END +diff --git a/renderer/native/ios/utils/RenderErrorHandler.m b/renderer/native/ios/utils/NativeRenderErrorHandler.m +similarity index 75% +rename from renderer/native/ios/utils/RenderErrorHandler.m +rename to renderer/native/ios/utils/NativeRenderErrorHandler.m +index 8afe2baa27d..598e9259b58 100644 +--- a/renderer/native/ios/utils/RenderErrorHandler.m ++++ b/renderer/native/ios/utils/NativeRenderErrorHandler.m +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,23 +20,23 @@ + * limitations under the License. + */ + +-#import ""RenderErrorHandler.h"" +-#import ""HippyLog.h"" ++#import ""NativeRenderErrorHandler.h"" ++#import ""NativeRenderLog.h"" + + NSString *const RenderFatalModuleName = @""RenderFatalModuleName""; + NSString *const RenderErrorDomain = @""RenderErrorDomain""; + +-static RenderFatalHandler _fatalHandler; ++static NativeRenderFatalHandler _fatalHandler; + +-HIPPY_EXTERN void RenderSetFatalHandler(RenderFatalHandler fatalHandler) { ++NATIVE_RENDER_EXTERN void NativeRenderSetFatalHandler(NativeRenderFatalHandler fatalHandler) { + _fatalHandler = fatalHandler; + } + +-HIPPY_EXTERN RenderFatalHandler RenderGetFatalHandler(void) { ++NATIVE_RENDER_EXTERN NativeRenderFatalHandler NativeRenderGetFatalHandler(void) { + return _fatalHandler; + } + +-void RenderFatal(NSError *error) { ++void NativeRenderFatal(NSError *error) { + NSString *failReason = error.localizedFailureReason; + if (failReason && failReason.length >= 100) { + failReason = [[failReason substringToIndex:100] stringByAppendingString:@""(...Description Too Long)""]; +@@ -48,9 +48,9 @@ void RenderFatal(NSError *error) { + } else { + fatalMessage = [NSString stringWithFormat:@""%@,%@"", moduleDescription, error.localizedDescription]; + } +- _HippyLogNativeInternal(HippyLogLevelFatal, NULL, 0, @""%@"", fatalMessage); ++ NativeRenderLogNativeInternal(NativeRenderLogLevelFatal, NULL, 0, @""%@"", fatalMessage); + +- RenderFatalHandler fatalHandler = RenderGetFatalHandler(); ++ NativeRenderFatalHandler fatalHandler = NativeRenderGetFatalHandler(); + if (fatalHandler) { + fatalHandler(error); + } +diff --git a/renderer/native/ios/utils/HippyGradientObject.h b/renderer/native/ios/utils/NativeRenderGradientObject.h +similarity index 61% +rename from renderer/native/ios/utils/HippyGradientObject.h +rename to renderer/native/ios/utils/NativeRenderGradientObject.h +index 3d0a3ce10af..63ae7a166d4 100644 +--- a/renderer/native/ios/utils/HippyGradientObject.h ++++ b/renderer/native/ios/utils/NativeRenderGradientObject.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -23,12 +23,11 @@ + #import + #import + #import +-#import ""HippyDefines.h"" +-#import ""HippyBorderDrawing.h"" ++#import ""NativeRenderBorderDrawing.h"" + + NS_ASSUME_NONNULL_BEGIN + +-@interface HippyGradientLocationParser : NSObject ++@interface NativeRenderGradientLocationParser : NSObject + + @property(nonatomic, assign) NSUInteger locationsCount; + +@@ -40,20 +39,20 @@ NS_ASSUME_NONNULL_BEGIN + + @end + +-typedef NS_ENUM(NSUInteger, HippyGradientType) { +- HippyGradientTypeLinear, +- HippyGradientTypeRadial, ++typedef NS_ENUM(NSUInteger, NativeRenderGradientType) { ++ NativeRenderGradientTypeLinear, ++ NativeRenderGradientTypeRadial, + }; + +-typedef NS_ENUM(NSUInteger, HippyGradientDirection) { +- HippyGradientDirectionTop, +- HippyGradientDirectionTopRight, +- HippyGradientDirectionRight, +- HippyGradientDirectionBottomRight, +- HippyGradientDirectionBottom, +- HippyGradientDirectionBottomLeft, +- HippyGradientDirectionLeft, +- HippyGradientDirectionTopLeft, ++typedef NS_ENUM(NSUInteger, NativeRenderGradientDirection) { ++ NativeRenderGradientDirectionTop, ++ NativeRenderGradientDirectionTopRight, ++ NativeRenderGradientDirectionRight, ++ NativeRenderGradientDirectionBottomRight, ++ NativeRenderGradientDirectionBottom, ++ NativeRenderGradientDirectionBottomLeft, ++ NativeRenderGradientDirectionLeft, ++ NativeRenderGradientDirectionTopLeft, + }; + + typedef struct _LinearGradientPoints { +@@ -63,11 +62,11 @@ typedef struct _LinearGradientPoints { + + typedef struct _CanvasInfo { + CGSize size; +- HippyCornerRadii cornerRadii; +- HippyCornerInsets insets; ++ NativeRenderCornerRadii cornerRadii; ++ NativeRenderCornerInsets insets; + }CanvasInfo; + +-@interface HippyGradientObject : NSObject ++@interface NativeRenderGradientObject : NSObject + + - (instancetype)initWithGradientObject:(NSDictionary *)object; + +@@ -75,11 +74,11 @@ typedef struct _CanvasInfo { + @property(nonatomic, strong) NSArray *locations; + //degree by angle + @property(nonatomic, assign) NSInteger degree; +-@property(nonatomic, assign) HippyGradientDirection direction; ++@property(nonatomic, assign) NativeRenderGradientDirection direction; + //determine if gradient drawn by degree.Default is NO. + //if YES, gradient is drawn by degree,otherwise by direction + @property(nonatomic, assign, getter=isDrawnByDegree) BOOL drawnByDegree; +-@property(nonatomic, assign) HippyGradientType gradientType; ++@property(nonatomic, assign) NativeRenderGradientType gradientType; + + - (void)drawInContext:(CGContextRef)context canvasInfo:(CanvasInfo)canvasInfo; + +@@ -87,7 +86,7 @@ typedef struct _CanvasInfo { + + @end + +-HIPPY_EXTERN void HippyDrawLinearGradientInContext(HippyGradientObject *object, CGContextRef context, CanvasInfo canvasInfo); +-HIPPY_EXTERN void HippyDrawRadialGradientInContext(HippyGradientObject *object, CGContextRef context, CGSize); ++NATIVE_RENDER_EXTERN void NativeRenderDrawLinearGradientInContext(NativeRenderGradientObject *object, CGContextRef context, CanvasInfo canvasInfo); ++NATIVE_RENDER_EXTERN void NativeRenderDrawRadialGradientInContext(NativeRenderGradientObject *object, CGContextRef context, CGSize); + + NS_ASSUME_NONNULL_END +diff --git a/renderer/native/ios/utils/HippyGradientObject.m b/renderer/native/ios/utils/NativeRenderGradientObject.m +similarity index 80% +rename from renderer/native/ios/utils/HippyGradientObject.m +rename to renderer/native/ios/utils/NativeRenderGradientObject.m +index 4f191dbbd8d..a0763546dcb 100644 +--- a/renderer/native/ios/utils/HippyGradientObject.m ++++ b/renderer/native/ios/utils/NativeRenderGradientObject.m +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,19 +20,19 @@ + * limitations under the License. + */ + +-#import ""HippyGradientObject.h"" +-#import ""HippyUtils.h"" +-#import ""HippyBorderDrawing.h"" +-#import ""RenderErrorHandler.h"" ++#import ""NativeRenderGradientObject.h"" ++#import ""NativeRenderUtils.h"" ++#import ""NativeRenderBorderDrawing.h"" ++#import ""NativeRenderErrorHandler.h"" + +-@interface HippyGradientLocationParser () { ++@interface NativeRenderGradientLocationParser () { + NSPointerArray *_locations; + NSInteger _previousSettedLocation; + } + + @end + +-@implementation HippyGradientLocationParser ++@implementation NativeRenderGradientLocationParser + + - (instancetype)initWithLocationsCount:(NSUInteger)count { + self = [super init]; +@@ -50,7 +50,7 @@ - (void)setLocationsCount:(NSUInteger)locationsCount { + } + + - (void)setLocationValue:(NSNumber *)value atLocation:(NSUInteger)location { +- NSAssert(location < _locationsCount, @""HippyGradientLocationParser location out of range,try to insert value at %lu, but count is %lu"", location, _locationsCount); ++ NSAssert(location < _locationsCount, @""NativeRenderGradientLocationParser location out of range,try to insert value at %lu, but count is %lu"", location, _locationsCount); + [_locations replacePointerAtIndex:location withPointer:(__bridge void *)value]; + } + +@@ -98,15 +98,15 @@ - (void)setLocationValuesBetweenLocations1:(NSUInteger)location1 location2:(NSUI + + @end + +-@implementation HippyGradientObject ++@implementation NativeRenderGradientObject + + - (void)drawInContext:(CGContextRef)context canvasInfo:(CanvasInfo)canvasInfo { + switch (self.gradientType) { +- case HippyGradientTypeLinear: +- HippyDrawLinearGradientInContext(self, context, canvasInfo); ++ case NativeRenderGradientTypeLinear: ++ NativeRenderDrawLinearGradientInContext(self, context, canvasInfo); + break; +- case HippyGradientTypeRadial: +- HippyDrawRadialGradientInContext(self, context, canvasInfo.size); ++ case NativeRenderGradientTypeRadial: ++ NativeRenderDrawRadialGradientInContext(self, context, canvasInfo.size); + break; + default: + break; +@@ -172,67 +172,67 @@ static LinearGradientPoints gradientPointsWithSizeAndDegree(CGSize size, NSInteg + return (LinearGradientPoints){startPoint, endPoint}; + } + +-static BOOL getDirectionFromString(NSString *string, HippyGradientDirection *direction) { ++static BOOL getDirectionFromString(NSString *string, NativeRenderGradientDirection *direction) { + BOOL isDrawnByDirection = NO; + if (direction) { + if ([string isEqualToString:@""totop""]) { +- *direction = HippyGradientDirectionTop; ++ *direction = NativeRenderGradientDirectionTop; + isDrawnByDirection = YES; + } + else if ([string isEqualToString:@""totopright""]) { +- *direction = HippyGradientDirectionTopRight; ++ *direction = NativeRenderGradientDirectionTopRight; + isDrawnByDirection = YES; + } + else if ([string isEqualToString:@""toright""]) { +- *direction = HippyGradientDirectionRight; ++ *direction = NativeRenderGradientDirectionRight; + isDrawnByDirection = YES; + } + else if ([string isEqualToString:@""tobottomright""]) { +- *direction = HippyGradientDirectionBottomRight; ++ *direction = NativeRenderGradientDirectionBottomRight; + isDrawnByDirection = YES; + } + else if ([string isEqualToString:@""tobottom""]) { +- *direction = HippyGradientDirectionBottom; ++ *direction = NativeRenderGradientDirectionBottom; + isDrawnByDirection = YES; + } + else if ([string isEqualToString:@""tobottomleft""]) { +- *direction = HippyGradientDirectionBottomLeft; ++ *direction = NativeRenderGradientDirectionBottomLeft; + isDrawnByDirection = YES; + } + else if ([string isEqualToString:@""toleft""]) { +- *direction = HippyGradientDirectionLeft; ++ *direction = NativeRenderGradientDirectionLeft; + isDrawnByDirection = YES; + } + else if ([string isEqualToString:@""totopleft""]) { +- *direction = HippyGradientDirectionTopLeft; ++ *direction = NativeRenderGradientDirectionTopLeft; + isDrawnByDirection = YES; + } + } + return isDrawnByDirection; + } + +-static CGFloat degreeFromDirection(HippyGradientDirection direction, CGSize size) { ++static CGFloat degreeFromDirection(NativeRenderGradientDirection direction, CGSize size) { + CGFloat degree = 0.0f; + switch (direction) { +- case HippyGradientDirectionTopRight: ++ case NativeRenderGradientDirectionTopRight: + degree = atan(size.height / size.width); + break; +- case HippyGradientDirectionRight: ++ case NativeRenderGradientDirectionRight: + degree = M_PI_2; + break; +- case HippyGradientDirectionBottomRight: ++ case NativeRenderGradientDirectionBottomRight: + degree = M_PI - atan(size.height / size.width); + break; +- case HippyGradientDirectionBottom: ++ case NativeRenderGradientDirectionBottom: + degree = M_PI; + break; +- case HippyGradientDirectionBottomLeft: ++ case NativeRenderGradientDirectionBottomLeft: + degree = M_PI + atan(size.height / size.width); + break; +- case HippyGradientDirectionLeft: ++ case NativeRenderGradientDirectionLeft: + degree = M_PI + M_PI_2; + break; +- case HippyGradientDirectionTopLeft: ++ case NativeRenderGradientDirectionTopLeft: + degree = M_PI + M_PI - atan(size.height / size.width); + break; + default: +@@ -241,7 +241,7 @@ static CGFloat degreeFromDirection(HippyGradientDirection direction, CGSize size + return degree * 180.f / M_PI; + } + +-static LinearGradientPoints pointsFromDirection(HippyGradientObject *object, CGSize size) { ++static LinearGradientPoints pointsFromDirection(NativeRenderGradientObject *object, CGSize size) { + return gradientPointsWithSizeAndDegree(size, degreeFromDirection(object.direction, size)); + } + +@@ -258,7 +258,7 @@ - (instancetype)initWithGradientObject:(NSDictionary *)object { + // }; + @try { + NSString *angleString = [object objectForKey:@""angle""]; +- HippyGradientDirection direction; ++ NativeRenderGradientDirection direction; + if (getDirectionFromString(angleString, &direction)) { + self.direction = direction; + } +@@ -269,11 +269,11 @@ - (instancetype)initWithGradientObject:(NSDictionary *)object { + + NSArray *colorStopList = [object objectForKey:@""colorStopList""]; + NSMutableArray *colors = [NSMutableArray arrayWithCapacity:[colorStopList count]]; +- HippyGradientLocationParser *locationParser = [[HippyGradientLocationParser alloc] initWithLocationsCount:[colorStopList count]]; ++ NativeRenderGradientLocationParser *locationParser = [[NativeRenderGradientLocationParser alloc] initWithLocationsCount:[colorStopList count]]; + for (NSUInteger i = 0; i < [colorStopList count]; i++) { + NSDictionary *colorStop = [colorStopList objectAtIndex:i]; + NSNumber *colorNumber = [colorStop objectForKey:@""color""]; +- UIColor *color = HippyConvertNumberToColor([colorNumber integerValue]); ++ UIColor *color = NativeRenderConvertNumberToColor([colorNumber integerValue]); + [colors addObject:color]; + NSNumber *stop = [colorStop objectForKey:@""ratio""]; + if (stop) { +@@ -284,8 +284,8 @@ - (instancetype)initWithGradientObject:(NSDictionary *)object { + self.locations = [locationParser computeLocations]; + } @catch (NSException *exception) { + NSString *errorString = [NSString stringWithFormat:@""gradient parse error:%@"", [exception reason]]; +- NSError *error = HippyErrorWithMessageAndModuleName(errorString, nil); +- RenderFatal(error); ++ NSError *error = NativeRenderErrorWithMessageAndModuleName(errorString, nil); ++ NativeRenderFatal(error); + return self; + } + } +@@ -326,7 +326,7 @@ static CFArrayRef UIColorsToCGColors(NSArray *colors) { + return pLocs; + } + +-void HippyDrawLinearGradientInContext(HippyGradientObject *object, CGContextRef context, CanvasInfo canvasInfo) { ++void NativeRenderDrawLinearGradientInContext(NativeRenderGradientObject *object, CGContextRef context, CanvasInfo canvasInfo) { + NSCAssert(context, @""context cannot be null for drawing linear gradient""); + if (nil == context) { + return; +@@ -338,7 +338,7 @@ void HippyDrawLinearGradientInContext(HippyGradientObject *object, CGContextRef + + CGContextSaveGState(context); + CGSize size = canvasInfo.size; +- CGPathRef pathRef = HippyPathCreateOuterOutline(NO, CGRectMake(0, 0, size.width, size.height), canvasInfo.cornerRadii); ++ CGPathRef pathRef = NativeRenderPathCreateOuterOutline(NO, CGRectMake(0, 0, size.width, size.height), canvasInfo.cornerRadii); + CGContextAddPath(context, pathRef); + CGContextClip(context); + LinearGradientPoints points = [object linearGradientPointsFromSize:size]; +@@ -355,7 +355,7 @@ void HippyDrawLinearGradientInContext(HippyGradientObject *object, CGContextRef + CGContextRestoreGState(context); + } + +-HIPPY_EXTERN void HippyDrawRadialGradientInContext(HippyGradientObject *object, CGContextRef context, CGSize size) { ++NATIVE_RENDER_EXTERN void NativeRenderDrawRadialGradientInContext(NativeRenderGradientObject *object, CGContextRef context, CGSize size) { + NSCAssert(context, @""context cannot be null for drawing radial gradient""); +- NSCAssert(NO, @""HippyDrawRadialGradientInContext not implemented""); ++ NSCAssert(NO, @""NativeRenderDrawRadialGradientInContext not implemented""); + } +diff --git a/renderer/native/ios/utils/HippyI18nUtils.h b/renderer/native/ios/utils/NativeRenderI18nUtils.h +similarity index 95% +rename from renderer/native/ios/utils/HippyI18nUtils.h +rename to renderer/native/ios/utils/NativeRenderI18nUtils.h +index 2b097375a8b..c0e5f437618 100644 +--- a/renderer/native/ios/utils/HippyI18nUtils.h ++++ b/renderer/native/ios/utils/NativeRenderI18nUtils.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -37,7 +37,7 @@ NS_ASSUME_NONNULL_BEGIN + + /** I18n manager for hippy + */ +-@interface HippyI18nUtils : NSObject ++@interface NativeRenderI18nUtils : NSObject + + @property(nonatomic, weak) id delegate; + +diff --git a/renderer/native/ios/utils/HippyI18nUtils.m b/renderer/native/ios/utils/NativeRenderI18nUtils.m +similarity index 91% +rename from renderer/native/ios/utils/HippyI18nUtils.m +rename to renderer/native/ios/utils/NativeRenderI18nUtils.m +index 0cbd5130c98..5627a068d97 100644 +--- a/renderer/native/ios/utils/HippyI18nUtils.m ++++ b/renderer/native/ios/utils/NativeRenderI18nUtils.m +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,14 +20,14 @@ + * limitations under the License. + */ + +-#import ""HippyI18nUtils.h"" ++#import ""NativeRenderI18nUtils.h"" + #import + +-@implementation HippyI18nUtils ++@implementation NativeRenderI18nUtils + + + (instancetype)sharedInstance { + static dispatch_once_t onceToken; +- static HippyI18nUtils *instance = nil; ++ static NativeRenderI18nUtils *instance = nil; + dispatch_once(&onceToken, ^{ + instance = [[[self class] alloc] init]; + }); +diff --git a/renderer/native/ios/utils/HippyImageDataLoader.h b/renderer/native/ios/utils/NativeRenderImageDataLoader.h +similarity index 65% +rename from renderer/native/ios/utils/HippyImageDataLoader.h +rename to renderer/native/ios/utils/NativeRenderImageDataLoader.h +index 0b1f9b30d1e..e8e479def13 100644 +--- a/renderer/native/ios/utils/HippyImageDataLoader.h ++++ b/renderer/native/ios/utils/NativeRenderImageDataLoader.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,16 +21,16 @@ + */ + + #import +-#import ""HippyImageDataLoaderProtocol.h"" ++#import ""NativeRenderImageDataLoaderProtocol.h"" + + NS_ASSUME_NONNULL_BEGIN + +-extern NSString *const HippyImageDataLoaderErrorDomain; +-extern const NSUInteger HippyImageDataLoaderErrorFileNotExists; +-extern const NSUInteger HippyImageDataLoaderErrorNoPathIncoming; +-extern const NSUInteger HippyImageDataLoaderErrorPathToUrl; ++extern NSString *const NativeRenderImageDataLoaderErrorDomain; ++extern const NSUInteger NativeRenderImageDataLoaderErrorFileNotExists; ++extern const NSUInteger NativeRenderImageDataLoaderErrorNoPathIncoming; ++extern const NSUInteger NativeRenderImageDataLoaderErrorPathToUrl; + +-@interface HippyImageDataLoader : NSObject ++@interface NativeRenderImageDataLoader : NSObject + + @end + +diff --git a/renderer/native/ios/utils/HippyImageDataLoader.m b/renderer/native/ios/utils/NativeRenderImageDataLoader.m +similarity index 77% +rename from renderer/native/ios/utils/HippyImageDataLoader.m +rename to renderer/native/ios/utils/NativeRenderImageDataLoader.m +index c30cdd31fbe..f481819f54c 100644 +--- a/renderer/native/ios/utils/HippyImageDataLoader.m ++++ b/renderer/native/ios/utils/NativeRenderImageDataLoader.m +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,15 +20,15 @@ + * limitations under the License. + */ + +-#import ""HippyImageDataLoader.h"" ++#import ""NativeRenderImageDataLoader.h"" + #import ""HippyImageCacheManager.h"" +-#import ""HippyDownloadTask.h"" ++#import ""NativeRenderDownloadTask.h"" + +-NSString *const HippyImageDataLoaderErrorDomain = @""HippyImageDataLoaderErrorDomain""; ++NSString *const NativeRenderImageDataLoaderErrorDomain = @""NativeRenderImageDataLoaderErrorDomain""; + +-const NSUInteger HippyImageDataLoaderErrorFileNotExists = 1000; +-const NSUInteger HippyImageDataLoaderErrorNoPathIncoming = 1001; +-const NSUInteger HippyImageDataLoaderErrorPathToUrl = 1002; ++const NSUInteger NativeRenderImageDataLoaderErrorFileNotExists = 1000; ++const NSUInteger NativeRenderImageDataLoaderErrorNoPathIncoming = 1001; ++const NSUInteger NativeRenderImageDataLoaderErrorPathToUrl = 1002; + + typedef NS_ENUM(NSUInteger, ImagePathType) { + ImagePathTypeUnknown, +@@ -57,14 +57,14 @@ static ImagePathType checkPathTypeFromUrl(NSURL *Url) { + return type; + } + +-@interface HippyImageDataLoader () { ++@interface NativeRenderImageDataLoader () { + ImagePathType _imagePathType; +- NSMutableDictionary *_downloadTasks; ++ NSMutableDictionary *_downloadTasks; + } + + @end + +-@implementation HippyImageDataLoader ++@implementation NativeRenderImageDataLoader + + - (instancetype)init { + self = [super init]; +@@ -78,7 +78,7 @@ - (void)dealloc { + [_downloadTasks removeAllObjects]; + } + +-#pragma mark HippyImageDataLoaderProtocol Implementation ++#pragma mark NativeRenderImageDataLoaderProtocol Implementation + + - (BOOL)canHandleImageAtUrl:(NSURL *)Url { + ImagePathType type = checkPathTypeFromUrl(Url); +@@ -105,7 +105,7 @@ - (void)loadImageAtUrl:(NSURL *)Url sequence:(NSUInteger)sequence progress:(Down + + - (void)cancelImageDownloadAtUrl:(NSURL *)Url { + NSNumber *hash = @([Url hash]); +- HippyDownloadTask *task = [_downloadTasks objectForKey:hash]; ++ NativeRenderDownloadTask *task = [_downloadTasks objectForKey:hash]; + [task cancel]; + } + +@@ -113,13 +113,13 @@ - (void)cancelImageDownloadAtUrl:(NSURL *)Url { + + - (void)loadImageAtHTTPUrl:(NSURL *)Url sequence:(NSUInteger)sequence progress:(DownloadProgress)progress dataCompletion:(CompletionBlock)dataCompletion { + NSNumber *hash = @(sequence); +- HippyDownloadTask *task = [_downloadTasks objectForKey:hash]; ++ NativeRenderDownloadTask *task = [_downloadTasks objectForKey:hash]; + if (task) { + [task cancel]; + [_downloadTasks removeObjectForKey:hash]; + } + __weak __typeof(self) weakSelf = self; +- task = [[HippyDownloadTask alloc] initWithURL:Url progress:progress completion:^(NSData *data, NSURL *url, NSError *error) { ++ task = [[NativeRenderDownloadTask alloc] initWithURL:Url progress:progress completion:^(NSData *data, NSURL *url, NSError *error) { + if (weakSelf) { + dataCompletion(sequence, data, url, error); + __typeof(self) strongSelf = weakSelf; +@@ -152,13 +152,13 @@ - (void)loadImageAtFileUrl:(NSURL *)Url sequence:(NSUInteger)sequence progress:( + } + }else { + if (dataCompletion) { +- NSError *error = [NSError errorWithDomain:HippyImageDataLoaderErrorDomain code:HippyImageDataLoaderErrorFileNotExists userInfo:@{@""path"": path}]; ++ NSError *error = [NSError errorWithDomain:NativeRenderImageDataLoaderErrorDomain code:NativeRenderImageDataLoaderErrorFileNotExists userInfo:@{@""path"": path}]; + dataCompletion(sequence, nil, Url, error); + } + } + }else { + if (dataCompletion) { +- NSError *error = [NSError errorWithDomain:HippyImageDataLoaderErrorDomain code:HippyImageDataLoaderErrorNoPathIncoming userInfo:nil]; ++ NSError *error = [NSError errorWithDomain:NativeRenderImageDataLoaderErrorDomain code:NativeRenderImageDataLoaderErrorNoPathIncoming userInfo:nil]; + dataCompletion(sequence, nil, Url, error); + } + } +@@ -182,13 +182,13 @@ - (void)loadImageAtBase64Url:(NSURL *)Url sequence:(NSUInteger)sequence progress + } + }else { + if (dataCompletion) { +- NSError *error = [NSError errorWithDomain:HippyImageDataLoaderErrorDomain code:HippyImageDataLoaderErrorNoPathIncoming userInfo:nil]; ++ NSError *error = [NSError errorWithDomain:NativeRenderImageDataLoaderErrorDomain code:NativeRenderImageDataLoaderErrorNoPathIncoming userInfo:nil]; + dataCompletion(sequence, nil, Url, error); + } + } + }else { + if (dataCompletion) { +- NSError *error = [NSError errorWithDomain:HippyImageDataLoaderErrorDomain code:HippyImageDataLoaderErrorNoPathIncoming userInfo:nil]; ++ NSError *error = [NSError errorWithDomain:NativeRenderImageDataLoaderErrorDomain code:NativeRenderImageDataLoaderErrorNoPathIncoming userInfo:nil]; + dataCompletion(sequence, nil, Url, error); + } + } +diff --git a/renderer/native/ios/utils/HippyImageDataLoaderProtocol.h b/renderer/native/ios/utils/NativeRenderImageDataLoaderProtocol.h +similarity index 93% +rename from renderer/native/ios/utils/HippyImageDataLoaderProtocol.h +rename to renderer/native/ios/utils/NativeRenderImageDataLoaderProtocol.h +index b8fbe8271f4..bd309bbbe0d 100644 +--- a/renderer/native/ios/utils/HippyImageDataLoaderProtocol.h ++++ b/renderer/native/ios/utils/NativeRenderImageDataLoaderProtocol.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -25,7 +25,7 @@ + + NS_ASSUME_NONNULL_BEGIN + +-@protocol HippyImageDataLoaderProtocol ++@protocol NativeRenderImageDataLoaderProtocol + + @optional + +diff --git a/renderer/native/ios/utils/HippyImageProviderProtocol.h b/renderer/native/ios/utils/NativeRenderImageProviderProtocol.h +similarity index 95% +rename from renderer/native/ios/utils/HippyImageProviderProtocol.h +rename to renderer/native/ios/utils/NativeRenderImageProviderProtocol.h +index ced0918dbaf..747ae566ab6 100644 +--- a/renderer/native/ios/utils/HippyImageProviderProtocol.h ++++ b/renderer/native/ios/utils/NativeRenderImageProviderProtocol.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -24,7 +24,7 @@ + + @class UIImage; + +-@protocol HippyImageProviderProtocol ++@protocol NativeRenderImageProviderProtocol + + @required + +diff --git a/renderer/native/ios/utils/NativeRenderLog.h b/renderer/native/ios/utils/NativeRenderLog.h +new file mode 100644 +index 00000000000..12404d70b3d +--- /dev/null ++++ b/renderer/native/ios/utils/NativeRenderLog.h +@@ -0,0 +1,125 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * NativeRender available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ++#import ""NativeRenderDefines.h"" ++ ++#ifndef HIPPYLOG_ENABLED ++#ifdef DEBUG ++#define HIPPYLOG_ENABLED 1 ++#else ++#define HIPPYLOG_ENABLED 0 ++#endif ++#endif ++ ++/** ++ * Logging macros. Use these to log information, warnings and errors in your ++ * own code. ++ */ ++#define NativeRenderLog(...) _NativeRenderLog(NativeRenderLogLevelInfo, __VA_ARGS__) ++#define NativeRenderLogTrace(...) _NativeRenderLog(NativeRenderLogLevelTrace, __VA_ARGS__) ++#define NativeRenderLogInfo(...) _NativeRenderLog(NativeRenderLogLevelInfo, __VA_ARGS__) ++#define NativeRenderLogWarn(...) _NativeRenderLog(NativeRenderLogLevelWarning, __VA_ARGS__) ++#define NativeRenderLogError(...) _NativeRenderLog(NativeRenderLogLevelError, __VA_ARGS__) ++#define NativeRenderLogFatal(...) _NativeRenderLog(NativeRenderLogLevelFatal, __VA_ARGS__) ++ ++/** ++ * An enum representing the severity of the log message. ++ */ ++typedef NS_ENUM(NSInteger, NativeRenderLogLevel) { ++ NativeRenderLogLevelTrace = 0, ++ NativeRenderLogLevelInfo = 1, ++ NativeRenderLogLevelWarning = 2, ++ NativeRenderLogLevelError = 3, ++ NativeRenderLogLevelFatal = 4 ++}; ++ ++/** ++ * A block signature to be used for custom logging functions. In most cases you ++ * will want to pass these arguments to the NativeRenderFormatLog function in order to ++ * generate a string. ++ */ ++typedef void (^NativeRenderLogFunction)(NativeRenderLogLevel level, NSString *fileName, ++ NSNumber *lineNumber, NSString *message, NSArray *); ++ ++typedef void (^NativeRenderLogShowFunction)(NSString *message, NSArray *stacks); ++ ++/** ++ * A method to generate a string from a collection of log data. To omit any ++ * particular data from the log, just pass nil or zero for the argument. ++ */ ++NATIVE_RENDER_EXTERN NSString *NativeRenderFormatLog(NSDate *timestamp, NativeRenderLogLevel level, NSString *fileName, NSNumber *lineNumber, NSString *message); ++ ++/** ++ * The default logging function used by NativeRenderLogXX. ++ */ ++extern NativeRenderLogFunction NativeRenderDefaultLogFunction; ++ ++/** ++ * These methods get and set the global logging threshold. This is the level ++ * below which logs will be ignored. Default is NativeRenderLogLevelInfo for debug and ++ * NativeRenderLogLevelError for production. ++ */ ++NATIVE_RENDER_EXTERN void NativeRenderSetLogThreshold(NativeRenderLogLevel threshold); ++NATIVE_RENDER_EXTERN NativeRenderLogLevel NativeRenderGetLogThreshold(void); ++ ++/** ++ * These methods get and set the global logging function called by the NativeRenderLogXX ++ * macros. You can use these to replace the standard behavior with custom log ++ * functionality. ++ */ ++NATIVE_RENDER_EXTERN void NativeRenderSetLogFunction(NativeRenderLogFunction logFunction); ++NATIVE_RENDER_EXTERN NativeRenderLogFunction NativeRenderGetLogFunction(void); ++ ++/** ++ * This appends additional code to the existing log function, without replacing ++ * the existing functionality. Useful if you just want to forward logs to an ++ * extra service without changing the default behavior. ++ */ ++NATIVE_RENDER_EXTERN void NativeRenderAddLogFunction(NativeRenderLogFunction logFunction); ++ ++/** ++ * This method temporarily overrides the log function while performing the ++ * specified block. This is useful for testing purposes (to detect if a given ++ * function logs something) or to suppress or override logging temporarily. ++ */ ++NATIVE_RENDER_EXTERN void NativeRenderPerformBlockWithLogFunction(void (^block)(void), NativeRenderLogFunction logFunction); ++ ++/** ++ * This method adds a conditional prefix to any messages logged within the scope ++ * of the passed block. This is useful for adding additional context to log ++ * messages. The block will be performed synchronously on the current thread. ++ */ ++NATIVE_RENDER_EXTERN void NativeRenderPerformBlockWithLogPrefix(void (^block)(void), NSString *prefix); ++ ++/** ++ * Private logging function - ignore this. ++ */ ++#if HIPPYLOG_ENABLED ++#define _NativeRenderLog(lvl, ...) NativeRenderLogNativeInternal(lvl, __FILE__, __LINE__, __VA_ARGS__); ++#else ++#define _NativeRenderLog(lvl, ...) \ ++ do { \ ++ } while (0) ++#endif ++ ++NATIVE_RENDER_EXTERN void NativeRenderLogNativeInternal(NativeRenderLogLevel, const char *, int, NSString *, ...) NS_FORMAT_FUNCTION(4, 5); +diff --git a/renderer/native/ios/utils/NativeRenderLog.mm b/renderer/native/ios/utils/NativeRenderLog.mm +new file mode 100644 +index 00000000000..fc0eb3285d1 +--- /dev/null ++++ b/renderer/native/ios/utils/NativeRenderLog.mm +@@ -0,0 +1,258 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * NativeRender available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ""NativeRenderLog.h"" ++#include ++#include ++#include ++#include ""logging.h"" ++ ++#pragma mark TDFLog Binding ++using LogSeverity = footstone::LogSeverity; ++static NativeRenderLogLevel logSeverityToLogLevel(LogSeverity severity) { ++ NativeRenderLogLevel level = NativeRenderLogLevelInfo; ++ switch (severity) { ++ case LogSeverity::TDF_LOG_WARNING: ++ level = NativeRenderLogLevelWarning; ++ break; ++ case LogSeverity::TDF_LOG_ERROR: ++ level = NativeRenderLogLevelError; ++ break; ++ case LogSeverity::TDF_LOG_FATAL: ++ level = NativeRenderLogLevelFatal; ++ break; ++ default: ++ break; ++ } ++ return level; ++} ++ ++static BOOL GetFileNameAndLineNumberFromLogMessage(NSString *message, NSString **fileName, int *lineNumber) { ++ //[INFO:cubic_bezier_animation.cc(146)] animation exec_time_ = 514, delay = 500, duration = 1000 ++ NSUInteger locationOfColon = [message rangeOfString:@"":""].location; ++ if (NSNotFound == locationOfColon) { ++ return NO; ++ } ++ NSUInteger locationOfLeftBracket = [message rangeOfString:@""(""].location; ++ if (NSNotFound == locationOfLeftBracket) { ++ return NO; ++ } ++ if (locationOfLeftBracket <= locationOfColon) { ++ return NO; ++ } ++ NSString *name = [message substringWithRange:NSMakeRange(locationOfColon + 1, locationOfLeftBracket - locationOfColon - 1)]; ++ *fileName = [name copy]; ++ NSUInteger locationOfRightBracket = [message rangeOfString:@"")""].location; ++ if (NSNotFound == locationOfRightBracket || locationOfRightBracket <= locationOfLeftBracket) { ++ return YES; ++ } ++ NSString *number = [message substringWithRange:NSMakeRange(locationOfLeftBracket + 1, locationOfRightBracket - locationOfLeftBracket - 1)]; ++ *lineNumber = [number intValue]; ++ return YES; ++} ++ ++static void registerTDFLogHandler() { ++ static std::once_flag flag; ++ std::call_once(flag, [](){ ++ std::function logFunction = [](const std::ostringstream &stream, LogSeverity serverity) { ++ @autoreleasepool { ++ std::string string = stream.str(); ++ if (string.length()) { ++ NSString *message = [NSString stringWithUTF8String:string.c_str()]; ++ NSString *fileName = nil; ++ int lineNumber = 0; ++ if (GetFileNameAndLineNumberFromLogMessage(message, &fileName, &lineNumber)) { ++ NativeRenderLogNativeInternal(logSeverityToLogLevel(serverity), [fileName UTF8String], lineNumber, @""%@"", message); ++ } ++ } ++ } ++ }; ++ footstone::LogMessage::InitializeDelegate(logFunction); ++ }); ++} ++ ++#pragma mark NativeLog Methods ++ ++static NSString *const NativeRenderLogFunctionStack = @""NativeRenderLogFunctionStack""; ++ ++const char *NativeRenderLogLevels[] = { ++ ""trace"", ++ ""info"", ++ ""warn"", ++ ""error"", ++ ""fatal"", ++}; ++ ++#if NATIVE_RENDER_DEBUG ++NativeRenderLogLevel NativeRenderDefaultLogThreshold = NativeRenderLogLevelTrace; ++#else ++NativeRenderLogLevel NativeRenderDefaultLogThreshold = NativeRenderLogLevelError; ++#endif ++ ++static NativeRenderLogFunction NativeRenderCurrentLogFunction; ++static NativeRenderLogLevel NativeRenderCurrentLogThreshold = NativeRenderDefaultLogThreshold; ++static NativeRenderLogShowFunction NativeRenderLogShowFunc; ++ ++NativeRenderLogLevel NativeRenderGetLogThreshold() { ++ return NativeRenderCurrentLogThreshold; ++} ++ ++void NativeRenderSetLogThreshold(NativeRenderLogLevel threshold) { ++ NativeRenderCurrentLogThreshold = threshold; ++} ++ ++NativeRenderLogFunction NativeRenderDefaultLogFunction ++ = ^(NativeRenderLogLevel level, NSString *fileName, NSNumber *lineNumber, ++ NSString *message, NSArray *stack) { ++ NSString *log = NativeRenderFormatLog([NSDate date], level, fileName, lineNumber, message); ++ fprintf(stderr, ""%s\n"", log.UTF8String); ++ fflush(stderr); ++ }; ++ ++void NativeRenderSetLogFunction(NativeRenderLogFunction logFunction) { ++ registerTDFLogHandler(); ++ NativeRenderCurrentLogFunction = logFunction; ++} ++ ++NativeRenderLogFunction NativeRenderGetLogFunction() { ++ if (!NativeRenderCurrentLogFunction) { ++ NativeRenderCurrentLogFunction = NativeRenderDefaultLogFunction; ++ } ++ return NativeRenderCurrentLogFunction; ++} ++ ++void NativeRenderAddLogFunction(NativeRenderLogFunction logFunction) { ++ NativeRenderLogFunction existing = NativeRenderGetLogFunction(); ++ if (existing) { ++ NativeRenderSetLogFunction(^(NativeRenderLogLevel level, NSString *fileName, NSNumber *lineNumber, NSString *message, NSArray *stack) { ++ existing(level, fileName, lineNumber, message, stack); ++ logFunction(level, fileName, lineNumber, message, stack); ++ }); ++ } else { ++ NativeRenderSetLogFunction(logFunction); ++ } ++} ++ ++void NativeRenderPerformBlockWithLogFunction(void (^block)(void), NativeRenderLogFunction logFunction) { ++ NSMutableDictionary *threadDictionary = [NSThread currentThread].threadDictionary; ++ NSMutableArray *functionStack = threadDictionary[NativeRenderLogFunctionStack]; ++ if (!functionStack) { ++ functionStack = [NSMutableArray new]; ++ threadDictionary[NativeRenderLogFunctionStack] = functionStack; ++ } ++ [functionStack addObject:logFunction]; ++ block(); ++ [functionStack removeLastObject]; ++} ++ ++void NativeRenderPerformBlockWithLogPrefix(void (^block)(void), NSString *prefix) { ++ NativeRenderLogFunction logFunction = NativeRenderGetLogFunction(); ++ if (logFunction) { ++ NativeRenderPerformBlockWithLogFunction( ++ block, ^(NativeRenderLogLevel level, NSString *fileName, NSNumber *lineNumber, NSString *message, NSArray *stack) { ++ logFunction(level, fileName, lineNumber, [prefix stringByAppendingString:message], stack); ++ }); ++ } ++} ++ ++static NSString *currentThreadName(void) { ++ NSThread *thread = [NSThread currentThread]; ++ NSString *threadName = [NSThread isMainThread] ? @""main"" : thread.name; ++ if (threadName.length == 0) { ++ const char *label = dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL); ++ if (label && strlen(label) > 0) { ++ threadName = @(label); ++ } else { ++ threadName = [NSString stringWithFormat:@""%p"", thread]; ++ } ++ } ++ return threadName; ++} ++ ++NSString *NativeRenderFormatLog(NSDate *timestamp, NativeRenderLogLevel level, NSString *fileName, NSNumber *lineNumber, NSString *message) { ++ NSMutableString *log = [NSMutableString new]; ++ if (timestamp) { ++ static NSDateFormatter *formatter; ++ static dispatch_once_t onceToken; ++ dispatch_once(&onceToken, ^{ ++ formatter = [NSDateFormatter new]; ++ formatter.dateFormat = formatter.dateFormat = @""yyyy-MM-dd HH:mm:ss.SSS ""; ++ }); ++ [log appendString:[formatter stringFromDate:timestamp]]; ++ } ++ if (level) { ++ [log appendFormat:@""[%s]"", NativeRenderLogLevels[level]]; ++ } ++ ++ [log appendFormat:@""[tid:%@]"", currentThreadName()]; ++ ++ if (fileName) { ++ fileName = fileName.lastPathComponent; ++ if (lineNumber) { ++ [log appendFormat:@""[%@:%@]"", fileName, lineNumber]; ++ } else { ++ [log appendFormat:@""[%@]"", fileName]; ++ } ++ } ++ if (message) { ++ [log appendString:@"" ""]; ++ [log appendString:message]; ++ } ++ return log; ++} ++ ++void NativeRenderLogNativeInternal(NativeRenderLogLevel level, const char *fileName, int lineNumber, NSString *format, ...) { ++ NativeRenderLogFunction logFunction = NativeRenderGetLogFunction(); ++ BOOL log = NATIVE_RENDER_DEBUG || (logFunction != nil); ++ if (log && level >= NativeRenderGetLogThreshold()) { ++ // Get message ++ va_list args; ++ va_start(args, format); ++ NSString *message = [[NSString alloc] initWithFormat:format arguments:args]; ++ va_end(args); ++ NSArray *callStacks = nil; ++#if NATIVE_RENDER_DEBUG ++ if (level >= NativeRenderLogLevelError) { ++ NSArray *stackSymbols = [NSThread callStackSymbols]; ++ NSMutableArray *stack = [NSMutableArray arrayWithCapacity:(stackSymbols.count - 1)]; ++ [stackSymbols enumerateObjectsUsingBlock:^(NSString *frameSymbols, NSUInteger idx, __unused BOOL *stop) { ++ if (idx > 0) { // don't include the current frame ++ NSString *address = [[frameSymbols componentsSeparatedByString:@""0x""][1] componentsSeparatedByString:@"" ""][0]; ++ NSRange addressRange = [frameSymbols rangeOfString:address]; ++ NSString *methodName = [frameSymbols substringFromIndex:(addressRange.location + addressRange.length + 1)]; ++ if (idx == 1 && fileName) { ++ NSString *file = [@(fileName) componentsSeparatedByString:@""/""].lastObject; ++ [stack addObject:@{@""methodName"": methodName, @""file"": file, @""lineNumber"": @(lineNumber)}]; ++ } else { ++ [stack addObject:@ { @""methodName"": methodName }]; ++ } ++ } ++ }]; ++ callStacks = [stack copy]; ++ } ++#endif ++ // Call log function ++ if (logFunction) { ++ logFunction(level, fileName ? @(fileName) : nil, lineNumber > 0 ? @(lineNumber) : nil, message, callStacks); ++ } ++ } ++} +diff --git a/renderer/native/ios/utils/HippyParserUtils.h b/renderer/native/ios/utils/NativeRenderParserUtils.h +similarity index 55% +rename from renderer/native/ios/utils/HippyParserUtils.h +rename to renderer/native/ios/utils/NativeRenderParserUtils.h +index 68bfa1f623c..ad1bf8cd9c6 100644 +--- a/renderer/native/ios/utils/HippyParserUtils.h ++++ b/renderer/native/ios/utils/NativeRenderParserUtils.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -21,19 +21,19 @@ + */ + + #import ++#import ""NativeRenderDefines.h"" + +-#import ""HippyDefines.h"" + /** + * Generic utility functions for parsing Objective-C source code. + */ +-HIPPY_EXTERN BOOL HippyReadChar(const char **input, char c); +-HIPPY_EXTERN BOOL HippyReadString(const char **input, const char *string); +-HIPPY_EXTERN void HippySkipWhitespace(const char **input); +-HIPPY_EXTERN BOOL HippyParseIdentifier(const char **input, NSString **string); ++NATIVE_RENDER_EXTERN BOOL NativeRenderReadChar(const char **input, char c); ++NATIVE_RENDER_EXTERN BOOL NativeRenderReadString(const char **input, const char *string); ++NATIVE_RENDER_EXTERN void NativeRenderSkipWhitespace(const char **input); ++NATIVE_RENDER_EXTERN BOOL NativeRenderParseIdentifier(const char **input, NSString **string); + + /** +- * Parse an Objective-C type into a form that can be used by HippyConvert. +- * This doesn't really belong here, but it's used by both HippyConvert and +- * HippyModuleMethod, which makes it difficult to find a better home for it. ++ * Parse an Objective-C type into a form that can be used by NativeRenderConvert. ++ * This doesn't really belong here, but it's used by both NativeRenderConvert and ++ * which makes it difficult to find a better home for it. + */ +-HIPPY_EXTERN NSString *HippyParseType(const char **input); ++NATIVE_RENDER_EXTERN NSString *NativeRenderParseType(const char **input); +diff --git a/renderer/native/ios/utils/HippyParserUtils.m b/renderer/native/ios/utils/NativeRenderParserUtils.m +similarity index 59% +rename from renderer/native/ios/utils/HippyParserUtils.m +rename to renderer/native/ios/utils/NativeRenderParserUtils.m +index 3fa9985e43d..a12c99448c9 100644 +--- a/renderer/native/ios/utils/HippyParserUtils.m ++++ b/renderer/native/ios/utils/NativeRenderParserUtils.m +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,10 +20,10 @@ + * limitations under the License. + */ + +-#import ""HippyParserUtils.h"" +-#import ""HippyLog.h"" ++#import ""NativeRenderParserUtils.h"" ++#import ""NativeRenderLog.h"" + +-BOOL HippyReadChar(const char **input, char c) { ++BOOL NativeRenderReadChar(const char **input, char c) { + if (**input == c) { + (*input)++; + return YES; +@@ -31,7 +31,7 @@ BOOL HippyReadChar(const char **input, char c) { + return NO; + } + +-BOOL HippyReadString(const char **input, const char *string) { ++BOOL NativeRenderReadString(const char **input, const char *string) { + int i; + for (i = 0; string[i] != 0; i++) { + if (string[i] != (*input)[i]) { +@@ -42,27 +42,27 @@ BOOL HippyReadString(const char **input, const char *string) { + return YES; + } + +-void HippySkipWhitespace(const char **input) { ++void NativeRenderSkipWhitespace(const char **input) { + while (isspace(**input)) { + (*input)++; + } + } + +-static BOOL HippyIsIdentifierHead(const char c) { ++static BOOL NativeRenderIsIdentifierHead(const char c) { + return isalpha(c) || c == '_'; + } + +-static BOOL HippyIsIdentifierTail(const char c) { ++static BOOL NativeRenderIsIdentifierTail(const char c) { + return isalnum(c) || c == '_'; + } + +-BOOL HippyParseIdentifier(const char **input, NSString **string) { ++BOOL NativeRenderParseIdentifier(const char **input, NSString **string) { + const char *start = *input; +- if (!HippyIsIdentifierHead(**input)) { ++ if (!NativeRenderIsIdentifierHead(**input)) { + return NO; + } + (*input)++; +- while (HippyIsIdentifierTail(**input)) { ++ while (NativeRenderIsIdentifierTail(**input)) { + (*input)++; + } + if (string) { +@@ -71,7 +71,7 @@ BOOL HippyParseIdentifier(const char **input, NSString **string) { + return YES; + } + +-static BOOL HippyIsCollectionType(NSString *type) { ++static BOOL NativeRenderIsCollectionType(NSString *type) { + static NSSet *collectionTypes; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ +@@ -80,24 +80,24 @@ static BOOL HippyIsCollectionType(NSString *type) { + return [collectionTypes containsObject:type]; + } + +-NSString *HippyParseType(const char **input) { ++NSString *NativeRenderParseType(const char **input) { + NSString *type; +- HippyParseIdentifier(input, &type); +- HippySkipWhitespace(input); +- if (HippyReadChar(input, '<')) { +- HippySkipWhitespace(input); +- NSString *subtype = HippyParseType(input); +- if (HippyIsCollectionType(type)) { ++ NativeRenderParseIdentifier(input, &type); ++ NativeRenderSkipWhitespace(input); ++ if (NativeRenderReadChar(input, '<')) { ++ NativeRenderSkipWhitespace(input); ++ NSString *subtype = NativeRenderParseType(input); ++ if (NativeRenderIsCollectionType(type)) { + if ([type isEqualToString:@""NSDictionary""]) { + // Dictionaries have both a key *and* value type, but the key type has + // to be a string for JSON, so we only care about the value type +- if (HIPPY_DEBUG && ![subtype isEqualToString:@""NSString""]) { +- HippyLogError(@""%@ is not a valid key type for a JSON dictionary"", subtype); ++ if (NATIVE_RENDER_DEBUG && ![subtype isEqualToString:@""NSString""]) { ++ NativeRenderLogError(@""%@ is not a valid key type for a JSON dictionary"", subtype); + } +- HippySkipWhitespace(input); +- HippyReadChar(input, ','); +- HippySkipWhitespace(input); +- subtype = HippyParseType(input); ++ NativeRenderSkipWhitespace(input); ++ NativeRenderReadChar(input, ','); ++ NativeRenderSkipWhitespace(input); ++ subtype = NativeRenderParseType(input); + } + if (![subtype isEqualToString:@""id""]) { + type = [type stringByReplacingCharactersInRange:(NSRange) { 0, 2 /* ""NS"" */ } withString:subtype]; +@@ -105,10 +105,10 @@ static BOOL HippyIsCollectionType(NSString *type) { + } else { + // It's a protocol rather than a generic collection - ignore it + } +- HippySkipWhitespace(input); +- HippyReadChar(input, '>'); ++ NativeRenderSkipWhitespace(input); ++ NativeRenderReadChar(input, '>'); + } +- HippySkipWhitespace(input); +- HippyReadChar(input, '*'); ++ NativeRenderSkipWhitespace(input); ++ NativeRenderReadChar(input, '*'); + return type; + } +diff --git a/renderer/native/ios/utils/NativeRenderUtils.h b/renderer/native/ios/utils/NativeRenderUtils.h +new file mode 100644 +index 00000000000..5551ccaeb13 +--- /dev/null ++++ b/renderer/native/ios/utils/NativeRenderUtils.h +@@ -0,0 +1,160 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * NativeRender available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ++ ++#import ++#import ++#import ++#import ""NativeRenderDefines.h"" ++ ++NS_ASSUME_NONNULL_BEGIN ++ ++// JSON serialization/deserialization ++NATIVE_RENDER_EXTERN NSString *__nullable NativeRenderJSONStringify(id __nullable jsonObject, NSError **error); ++NATIVE_RENDER_EXTERN id __nullable NativeRenderJSONParse(NSString *__nullable jsonString, NSError **error); ++NATIVE_RENDER_EXTERN id __nullable NativeRenderJSONParseMutable(NSString *__nullable jsonString, NSError **error); ++ ++// Sanitize a JSON object by stripping invalid types and/or NaN values ++NATIVE_RENDER_EXTERN id NativeRenderJSONClean(id object); ++ ++// Get MD5 hash of a string ++NATIVE_RENDER_EXTERN NSString *NativeRenderMD5Hash(NSString *string); ++ ++// Check is we are currently on the main queue (not to be confused with ++// the main thread, which is not neccesarily the same thing) ++// https://twitter.com/olebegemann/status/738656134731599872 ++NATIVE_RENDER_EXTERN BOOL NativeRenderIsMainQueue(void); ++ ++// Execute the specified block on the main queue. Unlike dispatch_async() ++// this will execute immediately if we're already on the main queue. ++NATIVE_RENDER_EXTERN void NativeRenderExecuteOnMainQueue(dispatch_block_t block); ++ ++// Deprecated - do not use. ++NATIVE_RENDER_EXTERN void NativeRenderExecuteOnMainThread(dispatch_block_t block, BOOL sync); ++//__deprecated_msg(""Use NativeRenderExecuteOnMainQueue instead. NativeRenderExecuteOnMainQueue is "" ++// ""async. If you need to use the `sync` option... please don't.""); ++ ++// Get screen metrics in a thread-safe way ++NATIVE_RENDER_EXTERN CGFloat NativeRenderScreenScale(void); ++NATIVE_RENDER_EXTERN CGSize NativeRenderScreenSize(void); ++ ++// Round float coordinates to nearest whole screen pixel (not point) ++NATIVE_RENDER_EXTERN CGFloat NativeRenderRoundPixelValue(CGFloat value); ++NATIVE_RENDER_EXTERN CGFloat NativeRenderCeilPixelValue(CGFloat value); ++NATIVE_RENDER_EXTERN CGFloat NativeRenderFloorPixelValue(CGFloat value); ++ ++// Convert a size in points to pixels, rounded up to the nearest integral size ++NATIVE_RENDER_EXTERN CGSize NativeRenderSizeInPixels(CGSize pointSize, CGFloat scale); ++ ++// Method swizzling ++NATIVE_RENDER_EXTERN void NativeRenderSwapClassMethods(Class cls, SEL original, SEL replacement); ++NATIVE_RENDER_EXTERN void NativeRenderSwapInstanceMethods(Class cls, SEL original, SEL replacement); ++ ++// Module subclass support ++NATIVE_RENDER_EXTERN BOOL NativeRenderClassOverridesClassMethod(Class cls, SEL selector); ++NATIVE_RENDER_EXTERN BOOL NativeRenderClassOverridesInstanceMethod(Class cls, SEL selector); ++ ++// Creates a standardized error object to return in callbacks ++NATIVE_RENDER_EXTERN NSDictionary *NativeRenderMakeError( ++ NSString *message, id __nullable toStringify, NSDictionary *__nullable extraData); ++NATIVE_RENDER_EXTERN NSDictionary *NativeRenderMakeAndLogError( ++ NSString *message, id __nullable toStringify, NSDictionary *__nullable extraData); ++NATIVE_RENDER_EXTERN NSDictionary *NativeRenderJSErrorFromNSError(NSError *error); ++NATIVE_RENDER_EXTERN NSDictionary *NativeRenderJSErrorFromCodeMessageAndNSError(NSString *code, NSString *message, NSError *__nullable error); ++ ++// The default error code to use as the `code` property for callback error objects ++NATIVE_RENDER_EXTERN NSString *const RenderErrorUnspecified; ++ ++// Returns YES if NativeRender is running in a test environment ++NATIVE_RENDER_EXTERN BOOL NativeRenderRunningInTestEnvironment(void); ++ ++// Returns YES if NativeRender is running in an iOS App Extension ++NATIVE_RENDER_EXTERN BOOL NativeRenderRunningInAppExtension(void); ++ ++// Returns the shared UIApplication instance, or nil if running in an App Extension ++NATIVE_RENDER_EXTERN UIApplication *__nullable NativeRenderSharedApplication(void); ++ ++// Returns the current main window, useful if you need to access the root view ++// or view controller ++NATIVE_RENDER_EXTERN UIWindow *__nullable NativeRenderKeyWindow(void); ++ ++// Returns the presented view controller, useful if you need ++// e.g. to present a modal view controller or alert over it ++NATIVE_RENDER_EXTERN UIViewController *__nullable NativeRenderPresentedViewController(void); ++ ++// Does this device support force touch (aka 3D Touch)? ++NATIVE_RENDER_EXTERN BOOL NativeRenderForceTouchAvailable(void); ++ ++// Create an NSError in the NativeRenderErrorDomain ++NATIVE_RENDER_EXTERN NSError *NativeRenderErrorWithMessage(NSString *message); ++ ++// Create an NSError in the NativeRenderErrorDomain ++NATIVE_RENDER_EXTERN NSError *NativeRenderErrorWithMessageAndModuleName(NSString *message, NSString *moduleName); ++ ++// Create an NSError with NativeRenderFatalModuleName from another error ++NATIVE_RENDER_EXTERN NSError *NativeRenderErrorFromErrorAndModuleName(NSError *error, NSString *moduleName); ++ ++// Convert nil values to NSNull, and vice-versa ++#define NativeRenderNullIfNil(value) (value ?: (id)kCFNull) ++#define NativeRenderNilIfNull(value) (value == (id)kCFNull ? nil : value) ++ ++// Convert NaN or infinite values to zero, as these aren't JSON-safe ++NATIVE_RENDER_EXTERN double NativeRenderZeroIfNaN(double value); ++ ++// Convert data to a Base64-encoded data URL ++NATIVE_RENDER_EXTERN NSURL *NativeRenderDataURL(NSString *mimeType, NSData *data); ++ ++// Returns the relative path within the main bundle for an absolute URL ++// (or nil, if the URL does not specify a path within the main bundle) ++NATIVE_RENDER_EXTERN NSString *__nullable NativeRenderBundlePathForURL(NSURL *__nullable URL); ++ ++// Determines if a given image URL refers to a local image ++NATIVE_RENDER_EXTERN BOOL NativeRenderIsLocalAssetURL(NSURL *__nullable imageURL); ++ ++// Creates a new, unique temporary file path with the specified extension ++NATIVE_RENDER_EXTERN NSString *__nullable NativeRenderTempFilePath(NSString *__nullable extension, NSError **error); ++ ++// Converts a CGColor to a hex string ++NATIVE_RENDER_EXTERN NSString *NativeRenderColorToHexString(CGColorRef color); ++ ++/** ++ * convert string to UIColor ++ * colorString could be 'fff','#fff','ffffff','#ffffff','ffffffff','#ffffffff' ++ * or 'red', 'green','blue'.etc ++ */ ++NATIVE_RENDER_EXTERN UIColor *NativeRenderConvertStringToColor(NSString *colorString); ++ ++NATIVE_RENDER_EXTERN UIColor *NativeRenderConvertNumberToColor(NSInteger colorNumber); ++ ++// Get standard localized string (if it exists) ++NATIVE_RENDER_EXTERN NSString *NativeRenderUIKitLocalizedString(NSString *string); ++ ++// URL manipulation ++NATIVE_RENDER_EXTERN NSString *__nullable NativeRenderGetURLQueryParam(NSURL *__nullable URL, NSString *param); ++NATIVE_RENDER_EXTERN NSURL *__nullable NativeRenderURLByReplacingQueryParam(NSURL *__nullable URL, NSString *param, NSString *__nullable value); ++NATIVE_RENDER_EXTERN NSURL *__nullable NativeRenderURLWithString(NSString *__nonnull URLString, NSString *__nullable baseURLString); ++ ++//Get String Encoding From HTTP URL Response ++NATIVE_RENDER_EXTERN NSStringEncoding NativeRenderGetStringEncodingFromURLResponse(NSURLResponse *response); ++ ++NS_ASSUME_NONNULL_END +diff --git a/renderer/native/ios/utils/HippyUtils.m b/renderer/native/ios/utils/NativeRenderUtils.m +similarity index 80% +rename from renderer/native/ios/utils/HippyUtils.m +rename to renderer/native/ios/utils/NativeRenderUtils.m +index 788d91f14ad..1007c96d610 100644 +--- a/renderer/native/ios/utils/HippyUtils.m ++++ b/renderer/native/ios/utils/NativeRenderUtils.m +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +@@ -20,7 +20,7 @@ + * limitations under the License. + */ + +-#import ""HippyUtils.h"" ++#import ""NativeRenderUtils.h"" + #import + #import + #import +@@ -28,14 +28,14 @@ + #import + #import + #import +-#import ""HippyLog.h"" +-#import ""RenderErrorHandler.h"" ++#import ""NativeRenderLog.h"" ++#import ""NativeRenderErrorHandler.h"" + + NSString *const RenderErrorUnspecified = @""EUNSPECIFIED""; + + static NSString *colorDictionaryJSON = @""transparent:0x00000000,aliceblue:0xf0f8ffff,antiquewhite:0xfaebd7ff,aqua:0x00ffffff,aquamarine:0x7fffd4ff,azure:0xf0ffffff,beige:0xf5f5dcff,bisque:0xffe4c4ff,black:0x000000ff,blanchedalmond:0xffebcdff,blue:0x0000ffff,blueviolet:0x8a2be2ff,brown:0xa52a2aff,burlywood:0xdeb887ff,burntsienna:0xea7e5dff,cadetblue:0x5f9ea0ff,chartreuse:0x7fff00ff,chocolate:0xd2691eff,coral:0xff7f50ff,cornflowerblue:0x6495edff,cornsilk:0xfff8dcff,crimson:0xdc143cff,cyan:0x00ffffff,darkblue:0x00008bff,darkcyan:0x008b8bff,darkgoldenrod:0xb8860bff,darkgray:0xa9a9a9ff,darkgreen:0x006400ff,darkgrey:0xa9a9a9ff,darkkhaki:0xbdb76bff,darkmagenta:0x8b008bff,darkolivegreen:0x556b2fff,darkorange:0xff8c00ff,darkorchid:0x9932ccff,darkred:0x8b0000ff,darksalmon:0xe9967aff,darkseagreen:0x8fbc8fff,darkslateblue:0x483d8bff,darkslategray:0x2f4f4fff,darkslategrey:0x2f4f4fff,darkturquoise:0x00ced1ff,darkviolet:0x9400d3ff,deeppink:0xff1493ff,deepskyblue:0x00bfffff,dimgray:0x696969ff,dimgrey:0x696969ff,dodgerblue:0x1e90ffff,firebrick:0xb22222ff,floralwhite:0xfffaf0ff,forestgreen:0x228b22ff,fuchsia:0xff00ffff,gainsboro:0xdcdcdcff,ghostwhite:0xf8f8ffff,gold:0xffd700ff,goldenrod:0xdaa520ff,gray:0x808080ff,green:0x008000ff,greenyellow:0xadff2fff,grey:0x808080ff,honeydew:0xf0fff0ff,hotpink:0xff69b4ff,indianred:0xcd5c5cff,indigo:0x4b0082ff,ivory:0xfffff0ff,khaki:0xf0e68cff,lavender:0xe6e6faff,lavenderblush:0xfff0f5ff,lawngreen:0x7cfc00ff,lemonchiffon:0xfffacdff,lightblue:0xadd8e6ff,lightcoral:0xf08080ff,lightcyan:0xe0ffffff,lightgoldenrodyellow:0xfafad2ff,lightgray:0xd3d3d3ff,lightgreen:0x90ee90ff,lightgrey:0xd3d3d3ff,lightpink:0xffb6c1ff,lightsalmon:0xffa07aff,lightseagreen:0x20b2aaff,lightskyblue:0x87cefaff,lightslategray:0x778899ff,lightslategrey:0x778899ff,lightsteelblue:0xb0c4deff,lightyellow:0xffffe0ff,lime:0x00ff00ff,limegreen:0x32cd32ff,linen:0xfaf0e6ff,magenta:0xff00ffff,maroon:0x800000ff,mediumaquamarine:0x66cdaaff,mediumblue:0x0000cdff,mediumorchid:0xba55d3ff,mediumpurple:0x9370dbff,mediumseagreen:0x3cb371ff,mediumslateblue:0x7b68eeff,mediumspringgreen:0x00fa9aff,mediumturquoise:0x48d1ccff,mediumvioletred:0xc71585ff,midnightblue:0x191970ff,mintcream:0xf5fffaff,mistyrose:0xffe4e1ff,moccasin:0xffe4b5ff,navajowhite:0xffdeadff,navy:0x000080ff,oldlace:0xfdf5e6ff,olive:0x808000ff,olivedrab:0x6b8e23ff,orange:0xffa500ff,orangered:0xff4500ff,orchid:0xda70d6ff,palegoldenrod:0xeee8aaff,palegreen:0x98fb98ff,paleturquoise:0xafeeeeff,palevioletred:0xdb7093ff,papayawhip:0xffefd5ff,peachpuff:0xffdab9ff,peru:0xcd853fff,pink:0xffc0cbff,plum:0xdda0ddff,powderblue:0xb0e0e6ff,purple:0x800080ff,rebeccapurple:0x663399ff,red:0xff0000ff,rosybrown:0xbc8f8fff,royalblue:0x4169e1ff,saddlebrown:0x8b4513ff,salmon:0xfa8072ff,sandybrown:0xf4a460ff,seagreen:0x2e8b57ff,seashell:0xfff5eeff,sienna:0xa0522dff,silver:0xc0c0c0ff,skyblue:0x87ceebff,slateblue:0x6a5acdff,slategray:0x708090ff,slategrey:0x708090ff,snow:0xfffafaff,springgreen:0x00ff7fff,steelblue:0x4682b4ff,tan:0xd2b48cff,teal:0x008080ff,thistle:0xd8bfd8ff,tomato:0xff6347ff,turquoise:0x40e0d0ff,violet:0xee82eeff,wheat:0xf5deb3ff,white:0xffffffff,whitesmoke:0xf5f5f5ff,yellow:0xffff00ff,yellowgreen:0x9acd32ff""; + +-static NSString *__nullable _HippyJSONStringifyNoRetry(id __nullable jsonObject, NSError **error) { ++static NSString *__nullable _NativeRenderJSONStringifyNoRetry(id __nullable jsonObject, NSError **error) { + if (!jsonObject) { + return nil; + } +@@ -70,23 +70,23 @@ + } + } + +-NSString *__nullable HippyJSONStringify(id __nullable jsonObject, NSError **error) { ++NSString *__nullable NativeRenderJSONStringify(id __nullable jsonObject, NSError **error) { + if (error) { +- return _HippyJSONStringifyNoRetry(jsonObject, error); ++ return _NativeRenderJSONStringifyNoRetry(jsonObject, error); + } else { + NSError *localError; +- NSString *json = _HippyJSONStringifyNoRetry(jsonObject, &localError); ++ NSString *json = _NativeRenderJSONStringifyNoRetry(jsonObject, &localError); + if (localError) { +- HippyLogError(@""HippyJSONStringify() encountered the following error: %@"", localError.localizedDescription); ++ NativeRenderLogError(@""NativeRenderJSONStringify() encountered the following error: %@"", localError.localizedDescription); + // Sanitize the data, then retry. This is slow, but it prevents uncaught + // data issues from crashing in production +- return _HippyJSONStringifyNoRetry(HippyJSONClean(jsonObject), NULL); ++ return _NativeRenderJSONStringifyNoRetry(NativeRenderJSONClean(jsonObject), NULL); + } + return json; + } + } + +-static id __nullable _HippyJSONParse(NSString *__nullable jsonString, BOOL mutable, NSError **error) { ++static id __nullable _NativeRenderJSONParse(NSString *__nullable jsonString, BOOL mutable, NSError **error) { + static SEL JSONKitSelector = NULL; + static SEL JSONKitMutableSelector = NULL; + static dispatch_once_t onceToken; +@@ -120,15 +120,15 @@ static id __nullable _HippyJSONParse(NSString *__nullable jsonString, BOOL mutab + if (!jsonData) { + jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES]; + if (jsonData) { +- HippyLogWarn(@""HippyJSONParse received the following string, which could "" ++ NativeRenderLogWarn(@""NativeRenderJSONParse received the following string, which could "" + ""not be losslessly converted to UTF8 data: '%@'"", + jsonString); + } else { +- NSString *errorMessage = @""HippyJSONParse received invalid UTF8 data""; ++ NSString *errorMessage = @""NativeRenderJSONParse received invalid UTF8 data""; + if (error) { +- *error = HippyErrorWithMessage(errorMessage); ++ *error = NativeRenderErrorWithMessage(errorMessage); + } else { +- HippyLogError(@""%@"", errorMessage); ++ NativeRenderLogError(@""%@"", errorMessage); + } + return nil; + } +@@ -142,15 +142,15 @@ static id __nullable _HippyJSONParse(NSString *__nullable jsonString, BOOL mutab + return nil; + } + +-id __nullable HippyJSONParse(NSString *__nullable jsonString, NSError **error) { +- return _HippyJSONParse(jsonString, NO, error); ++id __nullable NativeRenderJSONParse(NSString *__nullable jsonString, NSError **error) { ++ return _NativeRenderJSONParse(jsonString, NO, error); + } + +-id __nullable HippyJSONParseMutable(NSString *__nullable jsonString, NSError **error) { +- return _HippyJSONParse(jsonString, YES, error); ++id __nullable NativeRenderJSONParseMutable(NSString *__nullable jsonString, NSError **error) { ++ return _NativeRenderJSONParse(jsonString, YES, error); + } + +-id HippyJSONClean(id object) { ++id NativeRenderJSONClean(id object) { + static dispatch_once_t onceToken; + static NSSet *validLeafTypes; + dispatch_once(&onceToken, ^{ +@@ -164,7 +164,7 @@ id HippyJSONClean(id object) { + + if ([validLeafTypes containsObject:[object classForCoder]]) { + if ([object isKindOfClass:[NSNumber class]]) { +- return @(HippyZeroIfNaN([object doubleValue])); ++ return @(NativeRenderZeroIfNaN([object doubleValue])); + } + if ([object isKindOfClass:[NSString class]]) { + if ([object UTF8String] == NULL) { +@@ -178,7 +178,7 @@ id HippyJSONClean(id object) { + __block BOOL copy = NO; + NSMutableDictionary *values = [[NSMutableDictionary alloc] initWithCapacity:[object count]]; + [object enumerateKeysAndObjectsUsingBlock:^(NSString *key, id item, __unused BOOL *stop) { +- id value = HippyJSONClean(item); ++ id value = NativeRenderJSONClean(item); + values[key] = value; + copy |= value != item; + }]; +@@ -189,7 +189,7 @@ id HippyJSONClean(id object) { + __block BOOL copy = NO; + __block NSArray *values = object; + [object enumerateObjectsUsingBlock:^(id item, NSUInteger idx, __unused BOOL *stop) { +- id value = HippyJSONClean(item); ++ id value = NativeRenderJSONClean(item); + if (copy) { + [(NSMutableArray *)values addObject:value]; + } else if (value != item) { +@@ -208,7 +208,7 @@ id HippyJSONClean(id object) { + return (id)kCFNull; + } + +-NSString *HippyMD5Hash(NSString *string) { ++NSString *NativeRenderMD5Hash(NSString *string) { + const char *str = string.UTF8String; + unsigned char result[CC_MD5_DIGEST_LENGTH]; + CC_MD5(str, (CC_LONG)strlen(str), result); +@@ -218,7 +218,7 @@ id HippyJSONClean(id object) { + result[15]]; + } + +-BOOL HippyIsMainQueue() { ++BOOL NativeRenderIsMainQueue() { + static void *mainQueueKey = &mainQueueKey; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ +@@ -227,16 +227,16 @@ BOOL HippyIsMainQueue() { + return dispatch_get_specific(mainQueueKey) == mainQueueKey; + } + +-void HippyExecuteOnMainQueue(dispatch_block_t block) { +- if (HippyIsMainQueue()) { ++void NativeRenderExecuteOnMainQueue(dispatch_block_t block) { ++ if (NativeRenderIsMainQueue()) { + block(); + } else { + dispatch_async(dispatch_get_main_queue(), block); + } + } + +-void HippyExecuteOnMainThread(dispatch_block_t block, BOOL sync) { +- if (HippyIsMainQueue()) { ++void NativeRenderExecuteOnMainThread(dispatch_block_t block, BOOL sync) { ++ if (NativeRenderIsMainQueue()) { + block(); + } else if (sync) { + dispatch_sync(dispatch_get_main_queue(), block); +@@ -245,11 +245,11 @@ void HippyExecuteOnMainThread(dispatch_block_t block, BOOL sync) { + } + } + +-CGFloat HippyScreenScale() { ++CGFloat NativeRenderScreenScale() { + static CGFloat scale = CGFLOAT_MAX; + static dispatch_once_t onceToken; + if (CGFLOAT_MAX == scale) { +- HippyExecuteOnMainThread( ++ NativeRenderExecuteOnMainThread( + ^{ + dispatch_once(&onceToken, ^{ + scale = [UIScreen mainScreen].scale; +@@ -260,11 +260,11 @@ CGFloat HippyScreenScale() { + return scale; + } + +-CGSize HippyScreenSize() { ++CGSize NativeRenderScreenSize() { + static CGSize size = { 0, 0 }; + static dispatch_once_t onceToken; + if (CGSizeEqualToSize(CGSizeZero, size)) { +- HippyExecuteOnMainThread( ++ NativeRenderExecuteOnMainThread( + ^{ + dispatch_once(&onceToken, ^{ + size = [UIScreen mainScreen].bounds.size; +@@ -275,29 +275,29 @@ CGSize HippyScreenSize() { + return size; + } + +-CGFloat HippyRoundPixelValue(CGFloat value) { +- CGFloat scale = HippyScreenScale(); ++CGFloat NativeRenderRoundPixelValue(CGFloat value) { ++ CGFloat scale = NativeRenderScreenScale(); + return round(value * scale) / scale; + } + +-CGFloat HippyCeilPixelValue(CGFloat value) { +- CGFloat scale = HippyScreenScale(); ++CGFloat NativeRenderCeilPixelValue(CGFloat value) { ++ CGFloat scale = NativeRenderScreenScale(); + return ceil(value * scale) / scale; + } + +-CGFloat HippyFloorPixelValue(CGFloat value) { +- CGFloat scale = HippyScreenScale(); ++CGFloat NativeRenderFloorPixelValue(CGFloat value) { ++ CGFloat scale = NativeRenderScreenScale(); + return floor(value * scale) / scale; + } + +-CGSize HippySizeInPixels(CGSize pointSize, CGFloat scale) { ++CGSize NativeRenderSizeInPixels(CGSize pointSize, CGFloat scale) { + return (CGSize) { + ceil(pointSize.width * scale), + ceil(pointSize.height * scale), + }; + } + +-void HippySwapClassMethods(Class cls, SEL original, SEL replacement) { ++void NativeRenderSwapClassMethods(Class cls, SEL original, SEL replacement) { + Method originalMethod = class_getClassMethod(cls, original); + IMP originalImplementation = method_getImplementation(originalMethod); + const char *originalArgTypes = method_getTypeEncoding(originalMethod); +@@ -313,7 +313,7 @@ void HippySwapClassMethods(Class cls, SEL original, SEL replacement) { + } + } + +-void HippySwapInstanceMethods(Class cls, SEL original, SEL replacement) { ++void NativeRenderSwapInstanceMethods(Class cls, SEL original, SEL replacement) { + Method originalMethod = class_getInstanceMethod(cls, original); + IMP originalImplementation = method_getImplementation(originalMethod); + const char *originalArgTypes = method_getTypeEncoding(originalMethod); +@@ -329,11 +329,11 @@ void HippySwapInstanceMethods(Class cls, SEL original, SEL replacement) { + } + } + +-BOOL HippyClassOverridesClassMethod(Class cls, SEL selector) { +- return HippyClassOverridesInstanceMethod(object_getClass(cls), selector); ++BOOL NativeRenderClassOverridesClassMethod(Class cls, SEL selector) { ++ return NativeRenderClassOverridesInstanceMethod(object_getClass(cls), selector); + } + +-BOOL HippyClassOverridesInstanceMethod(Class cls, SEL selector) { ++BOOL NativeRenderClassOverridesInstanceMethod(Class cls, SEL selector) { + unsigned int numberOfMethods; + Method *methods = class_copyMethodList(cls, &numberOfMethods); + for (unsigned int i = 0; i < numberOfMethods; i++) { +@@ -346,7 +346,7 @@ BOOL HippyClassOverridesInstanceMethod(Class cls, SEL selector) { + return NO; + } + +-NSDictionary *HippyMakeError(NSString *message, id __nullable toStringify, NSDictionary *__nullable extraData) { ++NSDictionary *NativeRenderMakeError(NSString *message, id __nullable toStringify, NSDictionary *__nullable extraData) { + if (toStringify) { + message = [message stringByAppendingString:[toStringify description]]; + } +@@ -356,19 +356,19 @@ BOOL HippyClassOverridesInstanceMethod(Class cls, SEL selector) { + return error; + } + +-NSDictionary *HippyMakeAndLogError(NSString *message, id __nullable toStringify, NSDictionary *__nullable extraData) { +- NSDictionary *error = HippyMakeError(message, toStringify, extraData); +- HippyLogError(@""\nError: %@"", error); ++NSDictionary *NativeRenderMakeAndLogError(NSString *message, id __nullable toStringify, NSDictionary *__nullable extraData) { ++ NSDictionary *error = NativeRenderMakeError(message, toStringify, extraData); ++ NativeRenderLogError(@""\nError: %@"", error); + return error; + } + +-NSDictionary *HippyJSErrorFromNSError(NSError *error) { ++NSDictionary *NativeRenderJSErrorFromNSError(NSError *error) { + NSString *codeWithDomain = [NSString stringWithFormat:@""E%@%ld"", error.domain.uppercaseString, (long)error.code]; +- return HippyJSErrorFromCodeMessageAndNSError(codeWithDomain, error.localizedDescription, error); ++ return NativeRenderJSErrorFromCodeMessageAndNSError(codeWithDomain, error.localizedDescription, error); + } + +-// TODO: Can we just replace HippyMakeError with this function instead? +-NSDictionary *HippyJSErrorFromCodeMessageAndNSError(NSString *code, NSString *message, NSError *__nullable error) { ++// TODO: Can we just replace NativeRenderMakeError with this function instead? ++NSDictionary *NativeRenderJSErrorFromCodeMessageAndNSError(NSString *code, NSString *message, NSError *__nullable error) { + NSString *errorMessage; + NSArray *stackTrace = [NSThread callStackSymbols]; + NSMutableDictionary *errorInfo = [NSMutableDictionary dictionaryWithObject:stackTrace forKey:@""nativeStackIOS""]; +@@ -381,15 +381,15 @@ BOOL HippyClassOverridesInstanceMethod(Class cls, SEL selector) { + errorInfo[@""domain""] = RenderErrorDomain; + } + errorInfo[@""code""] = code ?: RenderErrorUnspecified; +- errorInfo[@""userInfo""] = HippyNullIfNil(error.userInfo); ++ errorInfo[@""userInfo""] = NativeRenderNullIfNil(error.userInfo); + + // Allow for explicit overriding of the error message + errorMessage = message ?: errorMessage; + +- return HippyMakeError(errorMessage, nil, errorInfo); ++ return NativeRenderMakeError(errorMessage, nil, errorInfo); + } + +-BOOL HippyRunningInTestEnvironment(void) { ++BOOL NativeRenderRunningInTestEnvironment(void) { + static BOOL isTestEnvironment = NO; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ +@@ -398,30 +398,30 @@ BOOL HippyRunningInTestEnvironment(void) { + return isTestEnvironment; + } + +-BOOL HippyRunningInAppExtension(void) { ++BOOL NativeRenderRunningInAppExtension(void) { + return [[[[NSBundle mainBundle] bundlePath] pathExtension] isEqualToString:@""appex""]; + } + +-UIApplication *__nullable HippySharedApplication(void) { +- if (HippyRunningInAppExtension()) { ++UIApplication *__nullable NativeRenderSharedApplication(void) { ++ if (NativeRenderRunningInAppExtension()) { + return nil; + } + return [[UIApplication class] performSelector:@selector(sharedApplication)]; + } + +-UIWindow *__nullable HippyKeyWindow(void) { +- if (HippyRunningInAppExtension()) { ++UIWindow *__nullable NativeRenderKeyWindow(void) { ++ if (NativeRenderRunningInAppExtension()) { + return nil; + } +- return HippySharedApplication().keyWindow; ++ return NativeRenderSharedApplication().keyWindow; + } + +-UIViewController *__nullable HippyPresentedViewController(void) { +- if (HippyRunningInAppExtension()) { ++UIViewController *__nullable NativeRenderPresentedViewController(void) { ++ if (NativeRenderRunningInAppExtension()) { + return nil; + } + +- UIViewController *controller = HippyKeyWindow().rootViewController; ++ UIViewController *controller = NativeRenderKeyWindow().rootViewController; + + while (controller.presentedViewController) { + controller = controller.presentedViewController; +@@ -430,7 +430,7 @@ BOOL HippyRunningInAppExtension(void) { + return controller; + } + +-BOOL HippyForceTouchAvailable(void) { ++BOOL NativeRenderForceTouchAvailable(void) { + static BOOL forceSupported; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ +@@ -439,22 +439,22 @@ BOOL HippyForceTouchAvailable(void) { + + BOOL forceTouchCapability = NO; + if (@available(iOS 9.0, *)) { +- forceTouchCapability = (HippyKeyWindow() ?: [UIView new]).traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable; ++ forceTouchCapability = (NativeRenderKeyWindow() ?: [UIView new]).traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable; + } + return forceSupported && forceTouchCapability; + } + +-NSError *HippyErrorWithMessage(NSString *message) { ++NSError *NativeRenderErrorWithMessage(NSString *message) { + NSDictionary *errorInfo = @ { NSLocalizedDescriptionKey: message }; + return [[NSError alloc] initWithDomain:RenderErrorDomain code:0 userInfo:errorInfo]; + } + +-NSError *HippyErrorWithMessageAndModuleName(NSString *message, NSString *moduleName) { ++NSError *NativeRenderErrorWithMessageAndModuleName(NSString *message, NSString *moduleName) { + NSDictionary *errorInfo = @ { NSLocalizedDescriptionKey: message, RenderFatalModuleName: moduleName ?: @""unknown"" }; + return [[NSError alloc] initWithDomain:RenderErrorDomain code:0 userInfo:errorInfo]; + } + +-NSError *HippyErrorFromErrorAndModuleName(NSError *error, NSString *moduleName) { ++NSError *NativeRenderErrorFromErrorAndModuleName(NSError *error, NSString *moduleName) { + NSDictionary *userInfo = [error userInfo]; + if (userInfo) { + NSMutableDictionary *ui = [NSMutableDictionary dictionaryWithDictionary:userInfo]; +@@ -467,22 +467,22 @@ BOOL HippyForceTouchAvailable(void) { + return retError; + } + +-double HippyZeroIfNaN(double value) { ++double NativeRenderZeroIfNaN(double value) { + return isnan(value) || isinf(value) ? 0 : value; + } + +-NSURL *HippyDataURL(NSString *mimeType, NSData *data) { ++NSURL *NativeRenderDataURL(NSString *mimeType, NSData *data) { + return [NSURL URLWithString:[NSString stringWithFormat:@""data:%@;base64,%@"", mimeType, + [data base64EncodedStringWithOptions:(NSDataBase64EncodingOptions)0]]]; + } + +-BOOL HippyIsGzippedData(NSData *__nullable); // exposed for unit testing purposes +-BOOL HippyIsGzippedData(NSData *__nullable data) { ++BOOL NativeRenderIsGzippedData(NSData *__nullable); // exposed for unit testing purposes ++BOOL NativeRenderIsGzippedData(NSData *__nullable data) { + UInt8 *bytes = (UInt8 *)data.bytes; + return (data.length >= 2 && bytes[0] == 0x1f && bytes[1] == 0x8b); + } + +-NSString *__nullable HippyBundlePathForURL(NSURL *__nullable URL) { ++NSString *__nullable NativeRenderBundlePathForURL(NSURL *__nullable URL) { + if (!URL.fileURL) { + // Not a file path + return nil; +@@ -500,8 +500,8 @@ BOOL HippyIsGzippedData(NSData *__nullable data) { + return path; + } + +-BOOL HippyIsLocalAssetURL(NSURL *__nullable imageURL) { +- NSString *name = HippyBundlePathForURL(imageURL); ++BOOL NativeRenderIsLocalAssetURL(NSURL *__nullable imageURL) { ++ NSString *name = NativeRenderBundlePathForURL(imageURL); + if (!name) { + return NO; + } +@@ -510,12 +510,12 @@ BOOL HippyIsLocalAssetURL(NSURL *__nullable imageURL) { + return [extension isEqualToString:@""png""] || [extension isEqualToString:@""jpg""]; + } + +-NSString *__nullable HippyTempFilePath(NSString *extension, NSError **error) { ++NSString *__nullable NativeRenderTempFilePath(NSString *extension, NSError **error) { + static NSError *setupError = nil; + static NSString *directory; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ +- directory = [NSTemporaryDirectory() stringByAppendingPathComponent:@""HippyNative""]; ++ directory = [NSTemporaryDirectory() stringByAppendingPathComponent:@""NativeRenderNative""]; + // If the temporary directory already exists, we'll delete it to ensure + // that temp files from the previous run have all been deleted. This is not + // a security measure, it simply prevents the temp directory from using too +@@ -529,7 +529,7 @@ BOOL HippyIsLocalAssetURL(NSURL *__nullable imageURL) { + NSError *localError = nil; + if (![fileManager createDirectoryAtPath:directory withIntermediateDirectories:YES attributes:nil error:&localError]) { + // This is bad +- HippyLogError(@""Failed to create temporary directory: %@"", localError); ++ NativeRenderLogError(@""Failed to create temporary directory: %@"", localError); + setupError = localError; + directory = nil; + } +@@ -551,7 +551,7 @@ BOOL HippyIsLocalAssetURL(NSURL *__nullable imageURL) { + return [directory stringByAppendingPathComponent:filename]; + } + +-static void HippyGetRGBAColorComponents(CGColorRef color, CGFloat rgba[4]) { ++static void NativeRenderGetRGBAColorComponents(CGColorRef color, CGFloat rgba[4]) { + CGColorSpaceModel model = CGColorSpaceGetModel(CGColorGetColorSpace(color)); + const CGFloat *components = CGColorGetComponents(color); + switch (model) { +@@ -575,9 +575,9 @@ static void HippyGetRGBAColorComponents(CGColorRef color, CGFloat rgba[4]) { + case kCGColorSpaceModelLab: + case kCGColorSpaceModelPattern: + case kCGColorSpaceModelUnknown: { +-#if HIPPY_DEBUG ++#if NATIVE_RENDER_DEBUG + // unsupported format +- HippyLogError(@""Unsupported color model: %i"", model); ++ NativeRenderLogError(@""Unsupported color model: %i"", model); + #endif + + rgba[0] = 0.0; +@@ -592,9 +592,9 @@ static void HippyGetRGBAColorComponents(CGColorRef color, CGFloat rgba[4]) { + } + } + +-NSString *HippyColorToHexString(CGColorRef color) { ++NSString *NativeRenderColorToHexString(CGColorRef color) { + CGFloat rgba[4]; +- HippyGetRGBAColorComponents(color, rgba); ++ NativeRenderGetRGBAColorComponents(color, rgba); + uint8_t r = rgba[0] * 255; + uint8_t g = rgba[1] * 255; + uint8_t b = rgba[2] * 255; +@@ -622,7 +622,7 @@ static void HippyGetRGBAColorComponents(CGColorRef color, CGFloat rgba[4]) { + unsigned int colorInteger; + BOOL scanSuccess = [scan scanHexInt:&colorInteger]; + if (scanSuccess) { +- UIColor *tmpColor = HippyConvertNumberToColor(colorInteger); ++ UIColor *tmpColor = NativeRenderConvertNumberToColor(colorInteger); + [tmpColorDic setObject:tmpColor forKey:key]; + } + } +@@ -634,7 +634,7 @@ static void HippyGetRGBAColorComponents(CGColorRef color, CGFloat rgba[4]) { + return color; + } + +-UIColor *HippyConvertStringToColor(NSString *colorString) { ++UIColor *NativeRenderConvertStringToColor(NSString *colorString) { + if (!colorString) { + return nil; + } +@@ -685,12 +685,12 @@ static void HippyGetRGBAColorComponents(CGColorRef color, CGFloat rgba[4]) { + scanResult = colorInteger; + } + if (scanSuccess) { +- color = HippyConvertNumberToColor(scanResult); ++ color = NativeRenderConvertNumberToColor(scanResult); + } + return color; + } + +-UIColor *HippyConvertNumberToColor(NSInteger colorNumber) { ++UIColor *NativeRenderConvertNumberToColor(NSInteger colorNumber) { + NSInteger a = (colorNumber >> 24) & 0xFF; + NSInteger r = (colorNumber >> 16) & 0xFF; + NSInteger g = (colorNumber >> 8) & 0xFF; +@@ -703,12 +703,12 @@ static void HippyGetRGBAColorComponents(CGColorRef color, CGFloat rgba[4]) { + } + + // (https://github.com/0xced/XCDFormInputAccessoryView/blob/master/XCDFormInputAccessoryView/XCDFormInputAccessoryView.m#L10-L14) +-NSString *HippyUIKitLocalizedString(NSString *string) { ++NSString *NativeRenderUIKitLocalizedString(NSString *string) { + NSBundle *UIKitBundle = [NSBundle bundleForClass:[UIApplication class]]; + return UIKitBundle ? [UIKitBundle localizedStringForKey:string value:string table:nil] : string; + } + +-NSString *__nullable HippyGetURLQueryParam(NSURL *__nullable URL, NSString *param) { ++NSString *__nullable NativeRenderGetURLQueryParam(NSURL *__nullable URL, NSString *param) { + if (!URL) { + return nil; + } +@@ -723,7 +723,7 @@ static void HippyGetRGBAColorComponents(CGColorRef color, CGFloat rgba[4]) { + return nil; + } + +-NSURL *__nullable HippyURLByReplacingQueryParam(NSURL *__nullable URL, NSString *param, NSString *__nullable value) { ++NSURL *__nullable NativeRenderURLByReplacingQueryParam(NSURL *__nullable URL, NSString *param, NSString *__nullable value) { + if (!URL) { + return nil; + } +@@ -755,9 +755,9 @@ static void HippyGetRGBAColorComponents(CGColorRef color, CGFloat rgba[4]) { + return components.URL; + } + +-NSURL *__nullable HippyURLWithString(NSString *URLString, NSString *baseURLString) { ++NSURL *__nullable NativeRenderURLWithString(NSString *URLString, NSString *baseURLString) { + if (URLString) { +- NSURL *baseURL = HippyURLWithString(baseURLString, NULL); ++ NSURL *baseURL = NativeRenderURLWithString(baseURLString, NULL); + NSData *uriData = [URLString dataUsingEncoding:NSUTF8StringEncoding]; + if (nil == uriData) { + return nil; +@@ -777,7 +777,7 @@ static void HippyGetRGBAColorComponents(CGColorRef color, CGFloat rgba[4]) { + return nil; + } + +-NSStringEncoding HippyGetStringEncodingFromURLResponse(NSURLResponse *response) { ++NSStringEncoding NativeRenderGetStringEncodingFromURLResponse(NSURLResponse *response) { + NSString *textEncoding = [response textEncodingName]; + if (!textEncoding) { + return NSUTF8StringEncoding; +diff --git a/renderer/native/ios/utils/OCTypeToDomArgument.h b/renderer/native/ios/utils/OCTypeToDomArgument.h +index 85065b7990b..09832fd7b5f 100644 +--- a/renderer/native/ios/utils/OCTypeToDomArgument.h ++++ b/renderer/native/ios/utils/OCTypeToDomArgument.h +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. +diff --git a/renderer/native/ios/utils/OCTypeToDomArgument.mm b/renderer/native/ios/utils/OCTypeToDomArgument.mm +index f635b88ba45..fa96c193b2c 100644 +--- a/renderer/native/ios/utils/OCTypeToDomArgument.mm ++++ b/renderer/native/ios/utils/OCTypeToDomArgument.mm +@@ -2,7 +2,7 @@ + * iOS SDK + * + * Tencent is pleased to support the open source community by making +- * Hippy available. ++ * NativeRender available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved." +Anki-Android,https://github.com/ankidroid/Anki-Android,a3425d585c967892a4e6c6cfb7c9a1206a2345d4,Brayan Oliveira,2024-02-02 23:18:18,fix: ranking in Tts,matching upstream's code: https://github.com/ankitects/anki/blob/80d58728d503c9f908bee8aeb01813590fff13f7/qt/aqt/tts.py#L89-L95,"fix: ranking in Tts + +matching upstream's code: https://github.com/ankitects/anki/blob/80d58728d503c9f908bee8aeb01813590fff13f7/qt/aqt/tts.py#L89-L95","diff --git a/AnkiDroid/src/main/java/com/ichi2/libanki/Tts.kt b/AnkiDroid/src/main/java/com/ichi2/libanki/Tts.kt +index e0cb60b87b44..1800d8eb46f5 100644 +--- a/AnkiDroid/src/main/java/com/ichi2/libanki/Tts.kt ++++ b/AnkiDroid/src/main/java/com/ichi2/libanki/Tts.kt +@@ -81,10 +81,9 @@ abstract class TtsPlayer : Closeable { + return TtsVoiceMatch(voice = avail, rank = rank) + } + } ++ rank -= 1 + } + +- rank -= 1 +- + // if no preferred voices match, we fall back on language + // with a rank of -100 + for (avail in avail_voices) {" +core,https://github.com/vuejs/core,a569067940f437d44ed5f3e64687906916ce4206,dependabot-preview[bot],2020-05-13 14:13:04,build(deps-dev): bump rollup-plugin-typescript2 from 0.27.0 to 0.27.1,"Bumps [rollup-plugin-typescript2](https://github.com/ezolenko/rollup-plugin-typescript2) from 0.27.0 to 0.27.1. +- [Release notes](https://github.com/ezolenko/rollup-plugin-typescript2/releases) +- [Commits](https://github.com/ezolenko/rollup-plugin-typescript2/compare/0.27.0...0.27.1)","build(deps-dev): bump rollup-plugin-typescript2 from 0.27.0 to 0.27.1 + +Bumps [rollup-plugin-typescript2](https://github.com/ezolenko/rollup-plugin-typescript2) from 0.27.0 to 0.27.1. +- [Release notes](https://github.com/ezolenko/rollup-plugin-typescript2/releases) +- [Commits](https://github.com/ezolenko/rollup-plugin-typescript2/compare/0.27.0...0.27.1) + +Signed-off-by: dependabot-preview[bot] ","diff --git a/yarn.lock b/yarn.lock +index 427b55c21e2..9e6537793a7 100644 +--- a/yarn.lock ++++ b/yarn.lock +@@ -6579,15 +6579,15 @@ rollup-plugin-terser@^5.3.0: + terser ""^4.6.2"" + + rollup-plugin-typescript2@^0.27.0: +- version ""0.27.0"" +- resolved ""https://registry.yarnpkg.com/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.27.0.tgz#95ff96f9e07d5000a9d2df4d76b548f9a1f83511"" +- integrity sha512-SRKG/Canve3cxBsqhY1apIBznqnX9X/WU3Lrq3XSwmTmFqccj3+//logLXFEmp+PYFNllSVng+f4zjqRTPKNkA== ++ version ""0.27.1"" ++ resolved ""https://registry.yarnpkg.com/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.27.1.tgz#4f27193408a8f040139eed3e3db7b0c7f3668200"" ++ integrity sha512-RJl77Bbj1EunAQDC3dK/O2HWuSUX3oJbRGzyLoS5o9W4Hs1Nix3Gavqj1Lzs5Y6Ff4H2xXfmZ1WWUQCYocSbzQ== + dependencies: + ""@rollup/pluginutils"" ""^3.0.8"" + find-cache-dir ""^3.3.1"" + fs-extra ""8.1.0"" + resolve ""1.15.1"" +- tslib ""1.11.1"" ++ tslib ""1.11.2"" + + rollup-pluginutils@^2.3.1, rollup-pluginutils@^2.8.2: + version ""2.8.2"" +@@ -7450,15 +7450,10 @@ tsd@^0.11.0: + read-pkg-up ""^4.0.0"" + update-notifier ""^2.5.0"" + +-tslib@1.11.1: +- version ""1.11.1"" +- resolved ""https://registry.yarnpkg.com/tslib/-/tslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35"" +- integrity sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA== +- +-tslib@^1.9.0: +- version ""1.10.0"" +- resolved ""https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a"" +- integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== ++tslib@1.11.2, tslib@^1.9.0: ++ version ""1.11.2"" ++ resolved ""https://registry.yarnpkg.com/tslib/-/tslib-1.11.2.tgz#9c79d83272c9a7aaf166f73915c9667ecdde3cc9"" ++ integrity sha512-tTSkux6IGPnUGUd1XAZHcpu85MOkIl5zX49pO+jfsie3eP0B6pyhOlLXm3cAC6T7s+euSDDUUV+Acop5WmtkVg== + + tunnel-agent@^0.6.0: + version ""0.6.0""" +grafana,https://github.com/grafana/grafana,6402dde646b82b0b118f9dc24e5cf2c4b8ed0471,Hugo Häggmark,2020-04-01 21:36:38,Docs: update Changelog with backendSrv plugin notice (#23244),"* Chore: updates CHANGELOG + +* Docs: updates after PR comments","Docs: update Changelog with backendSrv plugin notice (#23244) + +* Chore: updates CHANGELOG + +* Docs: updates after PR comments","diff --git a/CHANGELOG.md b/CHANGELOG.md +index ae96f61d8de08..fec36195bf9d5 100644 +--- a/CHANGELOG.md ++++ b/CHANGELOG.md +@@ -45,6 +45,23 @@ backendSrv.get(‘http://your.url/api’).then(result => { + }); + ``` + ++Another unfortunate outcome from this work in `backendSrv` is that the response format for `.headers()` changed from a function to an object. ++ ++To make your plugin work on 6.7.x as well as on previous versions you should add something like the following: ++ ++```typescript ++let responseHeaders = response.headers; ++if (!responseHeaders) { ++ return null; ++} ++ ++// Support pre 6.7 angular HTTP rather than fetch ++if (typeof responseHeaders === 'function') { ++ responseHeaders = responseHeaders(); ++} ++``` ++ ++ + You can test your plugin with the `master` branch version of Grafana. + + ### Features / Enhancements" +kaniko,https://github.com/GoogleContainerTools/kaniko,f5061cfc2ce3747139b710f2dd1665f0dc1ab094,dependabot[bot],2023-08-08 22:46:28,chore(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 (#2673),"Bumps [github.com/aws/aws-sdk-go-v2/service/s3](https://github.com/aws/aws-sdk-go-v2) from 1.38.0 to 1.38.2. +- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) +- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.38.0...service/s3/v1.38.2) + +---","chore(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 (#2673) + +Bumps [github.com/aws/aws-sdk-go-v2/service/s3](https://github.com/aws/aws-sdk-go-v2) from 1.38.0 to 1.38.2. +- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) +- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.38.0...service/s3/v1.38.2) + +--- +updated-dependencies: +- dependency-name: github.com/aws/aws-sdk-go-v2/service/s3 + dependency-type: direct:production + update-type: version-update:semver-patch +... + +Signed-off-by: dependabot[bot] +Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>","diff --git a/go.mod b/go.mod +index a2cdb010cc..e1042e6cff 100644 +--- a/go.mod ++++ b/go.mod +@@ -10,10 +10,10 @@ require ( + // To update run: go get github.com/GoogleCloudPlatform/docker-credential-gcr@ + // The version string is a side-effect of Go module version numbering rules. Functionality is otherwise unchanged. + github.com/GoogleCloudPlatform/docker-credential-gcr v1.5.1-0.20230328182921-62afb2723512 +- github.com/aws/aws-sdk-go-v2 v1.20.0 ++ github.com/aws/aws-sdk-go-v2 v1.20.1 + github.com/aws/aws-sdk-go-v2/config v1.18.31 + github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.75 +- github.com/aws/aws-sdk-go-v2/service/s3 v1.38.0 ++ github.com/aws/aws-sdk-go-v2/service/s3 v1.38.2 + github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20230522190001-adf1bafd791a + github.com/chrismellard/docker-credential-acr-env v0.0.0-20230304212654-82a0ddb27589 + github.com/containerd/cgroups v1.1.0 // indirect +@@ -66,21 +66,21 @@ require ( + github.com/ProtonMail/go-crypto v0.0.0-20230518184743-7afd39499903 // indirect + github.com/acomagu/bufpipe v1.0.4 // indirect + github.com/agext/levenshtein v1.2.3 // indirect +- github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.11 // indirect ++ github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.12 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.13.30 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.7 // indirect +- github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.37 // indirect +- github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.31 // indirect ++ github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.38 // indirect ++ github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.32 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.3.38 // indirect +- github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.0 // indirect +- github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.12 // indirect +- github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.32 // indirect +- github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.31 // indirect +- github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.15.0 // indirect ++ github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.1 // indirect ++ github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.13 // indirect ++ github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.33 // indirect ++ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.32 // indirect ++ github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.15.1 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.13.0 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.0 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.21.0 // indirect +- github.com/aws/smithy-go v1.14.0 // indirect ++ github.com/aws/smithy-go v1.14.1 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cilium/ebpf v0.9.1 // indirect +diff --git a/go.sum b/go.sum +index 756d901670..c832178006 100644 +--- a/go.sum ++++ b/go.sum +@@ -107,10 +107,12 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV + github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= + github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= + github.com/aws/aws-sdk-go-v2 v1.18.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= +-github.com/aws/aws-sdk-go-v2 v1.20.0 h1:INUDpYLt4oiPOJl0XwZDK2OVAVf0Rzo+MGVTv9f+gy8= + github.com/aws/aws-sdk-go-v2 v1.20.0/go.mod h1:uWOr0m0jDsiWw8nnXiqZ+YG6LdvAlGYDLLf2NmHZoy4= +-github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.11 h1:/MS8AzqYNAhhRNalOmxUvYs8VEbNGifTnzhPFdcRQkQ= ++github.com/aws/aws-sdk-go-v2 v1.20.1 h1:rZBf5DWr7YGrnlTK4kgDQGn1ltqOg5orCYb/UhOFZkg= ++github.com/aws/aws-sdk-go-v2 v1.20.1/go.mod h1:NU06lETsFm8fUC6ZjhgDpVBcGZTFQ6XM+LZWZxMI4ac= + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.11/go.mod h1:va22++AdXht4ccO3kH2SHkHHYvZ2G9Utz+CXKmm2CaU= ++github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.12 h1:lN6L3LrYHeZ6xCxaIYtoWCx4GMLk4nRknsh29OMSqHY= ++github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.12/go.mod h1:TDCkEAkMTXxTs0oLBGBKpBZbk3NLh8EvAfF0Q3x8/0c= + github.com/aws/aws-sdk-go-v2/config v1.18.22/go.mod h1:mN7Li1wxaPxSSy4Xkr6stFuinJGf3VZW3ZSNvO0q6sI= + github.com/aws/aws-sdk-go-v2/config v1.18.31 h1:CcacHsJjsPtHpe1MaopwPddUErmLnl+X77+7n4G2KkY= + github.com/aws/aws-sdk-go-v2/config v1.18.31/go.mod h1:pnSeuahFFvtScCHy0INXLxJ4N8H7KncD5u6A48bx3/8= +@@ -123,31 +125,39 @@ github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.7/go.mod h1:3we0V09SwcJBzNln + github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.75 h1:dKQyBQCZiu47cQ47UhwsVEr5TYu4YqoyAnue6qgybh0= + github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.75/go.mod h1:ZduPOCZCNBJ4anGPXD9oU+3tJgOmm9VdoBQuNHvYnFY= + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.33/go.mod h1:7i0PF1ME/2eUPFcjkVIwq+DOygHEoK92t5cDqNgYbIw= +-github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.37 h1:zr/gxAZkMcvP71ZhQOcvdm8ReLjFgIXnIn0fw5AM7mo= + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.37/go.mod h1:Pdn4j43v49Kk6+82spO3Tu5gSeQXRsxo56ePPQAvFiA= ++github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.38 h1:c8ed/T9T2K5I+h/JzmF5tpI46+OODQ74dzmdo+QnaMg= ++github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.38/go.mod h1:qggunOChCMu9ZF/UkAfhTz25+U2rLVb3ya0Ua6TTfCA= + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27/go.mod h1:UrHnn3QV/d0pBZ6QBAEQcqFLf8FAzLmoUfPVIueOvoM= +-github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.31 h1:0HCMIkAkVY9KMgueD8tf4bRTUanzEYvhw7KkPXIMpO0= + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.31/go.mod h1:fTJDMe8LOFYtqiFFFeHA+SVMAwqLhoq0kcInYoLa9Js= ++github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.32 h1:hNeAAymUY5gu11WrrmFb3CVIp9Dar9hbo44yzzcQpzA= ++github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.32/go.mod h1:0ZXSqrty4FtQ7p8TEuRde/SZm9X05KT18LAUlR40Ln0= + github.com/aws/aws-sdk-go-v2/internal/ini v1.3.34/go.mod h1:Etz2dj6UHYuw+Xw830KfzCfWGMzqvUTCjUj5b76GVDc= + github.com/aws/aws-sdk-go-v2/internal/ini v1.3.38 h1:+i1DOFrW3YZ3apE45tCal9+aDKK6kNEbW6Ib7e1nFxE= + github.com/aws/aws-sdk-go-v2/internal/ini v1.3.38/go.mod h1:1/jLp0OgOaWIetycOmycW+vYTYgTZFPttJQRgsI1PoU= +-github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.0 h1:U5yySdwt2HPo/pnQec04DImLzWORbeWML1fJiLkKruI= + github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.0/go.mod h1:EhC/83j8/hL/UB1WmExo3gkElaja/KlmZM/gl1rTfjM= ++github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.1 h1:vUh7dBFNS3oFCtVv6CiYKh5hP9ls8+kIpKLeFruIBLk= ++github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.1/go.mod h1:sFMeinkhj/SZKQM8BxtvNtSPjJEo0Xrz+w3g2e4FSKI= + github.com/aws/aws-sdk-go-v2/service/ecr v1.18.10 h1:3s6Jg0xx6U/wDVgZy8exuZoGlsL/6tYcItAaXg9vMSA= + github.com/aws/aws-sdk-go-v2/service/ecr v1.18.10/go.mod h1:Ce1q2jlNm8BVpjLaOnwnm5v2RClAbK6txwPljFzyW6c= + github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.16.1 h1:iqooVPD/xAM5SCTbrFsBeuiQ2o0D9wdqlHcUBTDxJPA= + github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.16.1/go.mod h1:uHtRE7aqXNmpeYL+7Ec7LacH5zC9+w2T5MBOeEKDdu0= +-github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.12 h1:uAiiHnWihGP2rVp64fHwzLDrswGjEjsPszwRYMiYQPU= + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.12/go.mod h1:fUTHpOXqRQpXvEpDPSa3zxCc2fnpW6YnBoba+eQr+Bg= +-github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.32 h1:kvN1jPHr9UffqqG3bSgZ8tx4+1zKVHz/Ktw/BwW6hX8= ++github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.13 h1:iV/W5OMBys+66OeXJi/7xIRrKZNsu0ylsLGu+6nbmQE= ++github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.13/go.mod h1:ReJb6xYmtGyu9KoFtRreWegbN9dZqvZIIv4vWnhcsyI= + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.32/go.mod h1:QmMEM7es84EUkbYWcpnkx8i5EW2uERPfrTFeOch128Y= ++github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.33 h1:QviNkc+vGSuEHx8P+pVNKOdWLXBPIwMFv7p0fphgE4U= ++github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.33/go.mod h1:fABTUmOrAgAalG2i9WJpjBvlnk7UK8YmnYaxN+Q2CwE= + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.27/go.mod h1:EOwBD4J4S5qYszS5/3DpkejfuK+Z5/1uzICfPaZLtqw= +-github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.31 h1:auGDJ0aLZahF5SPvkJ6WcUuX7iQ7kyl2MamV7Tm8QBk= + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.31/go.mod h1:3+lloe3sZuBQw1aBc5MyndvodzQlyqCZ7x1QPDHaWP4= +-github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.15.0 h1:Wgjft9X4W5pMeuqgPCHIQtbZ87wsgom7S5F8obreg+c= ++github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.32 h1:dGAseBFEYxth10V23b5e2mAS+tX7oVbfYHD6dnDdAsg= ++github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.32/go.mod h1:4jwAWKEkCR0anWk5+1RbfSg1R5Gzld7NLiuaq5bTR/Y= + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.15.0/go.mod h1:FWNzS4+zcWAP05IF7TDYTY1ysZAzIvogxWaDT9p8fsA= +-github.com/aws/aws-sdk-go-v2/service/s3 v1.38.0 h1:Flb+Uw+ewvmbZiaXEl+aIs1HygnwztxZmhkCe1b+YQg= ++github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.15.1 h1:PT6PBCycRwhpEW5hJnRiceCeoWJ+r3bdgXtV+VKG7Pk= ++github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.15.1/go.mod h1:TqoxCLwT2nrxrBGA+z7t6OWM7LBkgRckK3gOjYE+7JA= + github.com/aws/aws-sdk-go-v2/service/s3 v1.38.0/go.mod h1:6SOWLiobcZZshbmECRTADIRYliPL0etqFSigauQEeT0= ++github.com/aws/aws-sdk-go-v2/service/s3 v1.38.2 h1:v346f1h8sUBKXnEbrv43L37MTBlFHyKXQPIZHNAaghA= ++github.com/aws/aws-sdk-go-v2/service/s3 v1.38.2/go.mod h1:cwCATiyNrXK9P2FsWdZ89g9mpsYv2rhk0UA/KByl5fY= + github.com/aws/aws-sdk-go-v2/service/sso v1.12.9/go.mod h1:ouy2P4z6sJN70fR3ka3wD3Ro3KezSxU6eKGQI2+2fjI= + github.com/aws/aws-sdk-go-v2/service/sso v1.13.0 h1:agnjK56/1jtGPehxV8QZ/AYHV++pEfl7CpYbWjHjBDc= + github.com/aws/aws-sdk-go-v2/service/sso v1.13.0/go.mod h1:TC9BubuFMVScIU+TLKamO6VZiYTkYoEHqlSQwAe2omw= +@@ -158,8 +168,9 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.18.10/go.mod h1:BgQOMsg8av8jset59jel + github.com/aws/aws-sdk-go-v2/service/sts v1.21.0 h1:HI1YIL5Q9FtucxF5tcNpzCEyLnkeUcqg6xtOx8u09S4= + github.com/aws/aws-sdk-go-v2/service/sts v1.21.0/go.mod h1:G8SbvL0rFk4WOJroU8tKBczhsbhj2p/YY7qeJezJ3CI= + github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +-github.com/aws/smithy-go v1.14.0 h1:+X90sB94fizKjDmwb4vyl2cTTPXTE5E2G/1mjByb0io= + github.com/aws/smithy-go v1.14.0/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= ++github.com/aws/smithy-go v1.14.1 h1:EFKMUmH/iHMqLiwoEDx2rRjRQpI1YCn5jTysoaDujFs= ++github.com/aws/smithy-go v1.14.1/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= + github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20230522190001-adf1bafd791a h1:rW+dV12c0WD3+O4Zs8Qt4+oqnr8ecXeyg8g3yB73ZKA= + github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20230522190001-adf1bafd791a/go.mod h1:1mvdZLjy932pV2fhj1jjwUSHaF5Ogq2gk5bvi/6ngEU= + github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +diff --git a/vendor/github.com/aws/aws-sdk-go-v2/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/CHANGELOG.md +index 49f3a918ce..804f5f15c4 100644 +--- a/vendor/github.com/aws/aws-sdk-go-v2/CHANGELOG.md ++++ b/vendor/github.com/aws/aws-sdk-go-v2/CHANGELOG.md +@@ -1,3 +1,83 @@ ++# Release (2023-08-07) ++ ++## General Highlights ++* **Dependency Update**: Updated to the latest SDK module versions ++ ++## Module Highlights ++* `github.com/aws/aws-sdk-go-v2/service/detective`: [v1.21.0](service/detective/CHANGELOG.md#v1210-2023-08-07) ++ * **Feature**: Updated the email validation regex to be in line with the TLD name specifications. ++* `github.com/aws/aws-sdk-go-v2/service/ivsrealtime`: [v1.4.0](service/ivsrealtime/CHANGELOG.md#v140-2023-08-07) ++ * **Feature**: Add QUOTA_EXCEEDED and PUBLISHER_NOT_FOUND to EventErrorCode for stage health events. ++* `github.com/aws/aws-sdk-go-v2/service/kinesisvideo`: [v1.18.0](service/kinesisvideo/CHANGELOG.md#v1180-2023-08-07) ++ * **Feature**: This release enables minimum of Images SamplingInterval to be as low as 200 milliseconds in Kinesis Video Stream Image feature. ++* `github.com/aws/aws-sdk-go-v2/service/kinesisvideoarchivedmedia`: [v1.16.0](service/kinesisvideoarchivedmedia/CHANGELOG.md#v1160-2023-08-07) ++ * **Feature**: This release enables minimum of Images SamplingInterval to be as low as 200 milliseconds in Kinesis Video Stream Image feature. ++* `github.com/aws/aws-sdk-go-v2/service/rekognition`: [v1.30.2](service/rekognition/CHANGELOG.md#v1302-2023-08-07) ++ * **Documentation**: This release adds code snippets for Amazon Rekognition Custom Labels. ++ ++# Release (2023-08-04) ++ ++## Module Highlights ++* `github.com/aws/aws-sdk-go-v2/service/acmpca`: [v1.22.2](service/acmpca/CHANGELOG.md#v1222-2023-08-04) ++ * **Documentation**: Documentation correction for AWS Private CA ++* `github.com/aws/aws-sdk-go-v2/service/connect`: [v1.64.0](service/connect/CHANGELOG.md#v1640-2023-08-04) ++ * **Feature**: Added a new API UpdateRoutingProfileAgentAvailabilityTimer to update agent availability timer of a routing profile. ++* `github.com/aws/aws-sdk-go-v2/service/datasync`: [v1.28.0](service/datasync/CHANGELOG.md#v1280-2023-08-04) ++ * **Feature**: Display cloud storage used capacity at a cluster level. ++* `github.com/aws/aws-sdk-go-v2/service/ecs`: [v1.29.2](service/ecs/CHANGELOG.md#v1292-2023-08-04) ++ * **Documentation**: This is a documentation update to address various tickets. ++* `github.com/aws/aws-sdk-go-v2/service/sagemaker`: [v1.100.0](service/sagemaker/CHANGELOG.md#v11000-2023-08-04) ++ * **Feature**: Including DataCaptureConfig key in the Amazon Sagemaker Search's transform job object ++ ++# Release (2023-08-03) ++ ++## Module Highlights ++* `github.com/aws/aws-sdk-go-v2/service/autoscaling`: [v1.30.2](service/autoscaling/CHANGELOG.md#v1302-2023-08-03) ++ * **Documentation**: Documentation changes related to Amazon EC2 Auto Scaling APIs. ++* `github.com/aws/aws-sdk-go-v2/service/cloud9`: [v1.18.2](service/cloud9/CHANGELOG.md#v1182-2023-08-03) ++ * **Documentation**: Updated the deprecation date for Amazon Linux. Doc only update. ++* `github.com/aws/aws-sdk-go-v2/service/databasemigrationservice`: [v1.30.0](service/databasemigrationservice/CHANGELOG.md#v1300-2023-08-03) ++ * **Feature**: The release makes public API for DMS Schema Conversion feature. ++* `github.com/aws/aws-sdk-go-v2/service/ec2`: [v1.110.0](service/ec2/CHANGELOG.md#v11100-2023-08-03) ++ * **Feature**: This release adds new parameter isPrimaryIPv6 to allow assigning an IPv6 address as a primary IPv6 address to a network interface which cannot be changed to give equivalent functionality available for network interfaces with primary IPv4 address. ++* `github.com/aws/aws-sdk-go-v2/service/sagemaker`: [v1.99.0](service/sagemaker/CHANGELOG.md#v1990-2023-08-03) ++ * **Feature**: Amazon SageMaker now supports running training jobs on p5.48xlarge instance types. ++ ++# Release (2023-08-02) ++ ++## Module Highlights ++* `github.com/aws/aws-sdk-go-v2/service/budgets`: [v1.16.0](service/budgets/CHANGELOG.md#v1160-2023-08-02) ++ * **Feature**: As part of CAE tagging integration we need to update our budget names regex filter to prevent customers from using ""/action/"" in their budget names. ++* `github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider`: [v1.25.0](service/cognitoidentityprovider/CHANGELOG.md#v1250-2023-08-02) ++ * **Feature**: New feature that logs Cognito user pool error messages to CloudWatch logs. ++* `github.com/aws/aws-sdk-go-v2/service/glue`: [v1.60.0](service/glue/CHANGELOG.md#v1600-2023-08-02) ++ * **Feature**: This release includes additional Glue Streaming KAKFA SASL property types. ++* `github.com/aws/aws-sdk-go-v2/service/resiliencehub`: [v1.13.0](service/resiliencehub/CHANGELOG.md#v1130-2023-08-02) ++ * **Feature**: Drift Detection capability added when applications policy has moved from a meet to breach state. Customers will be able to exclude operational recommendations and receive credit in their resilience score. Customers can now add ARH permissions to an existing or new role. ++* `github.com/aws/aws-sdk-go-v2/service/sagemaker`: [v1.98.0](service/sagemaker/CHANGELOG.md#v1980-2023-08-02) ++ * **Feature**: SageMaker Inference Recommender introduces a new API GetScalingConfigurationRecommendation to recommend auto scaling policies based on completed Inference Recommender jobs. ++ ++# Release (2023-08-01) ++ ++## General Highlights ++* **Dependency Update**: Updated to the latest SDK module versions ++ ++## Module Highlights ++* `github.com/aws/aws-sdk-go-v2/service/batch`: [v1.26.0](service/batch/CHANGELOG.md#v1260-2023-08-01) ++ * **Feature**: This release adds support for price capacity optimized allocation strategy for Spot Instances. ++* `github.com/aws/aws-sdk-go-v2/service/databasemigrationservice`: [v1.29.0](service/databasemigrationservice/CHANGELOG.md#v1290-2023-08-01) ++ * **Feature**: Adding new API describe-engine-versions which provides information about the lifecycle of a replication instance's version. ++* `github.com/aws/aws-sdk-go-v2/service/internetmonitor`: [v1.5.0](service/internetmonitor/CHANGELOG.md#v150-2023-08-01) ++ * **Feature**: This release adds a new feature for Amazon CloudWatch Internet Monitor that enables customers to set custom thresholds, for performance and availability drops, for impact limited to a single city-network to trigger creation of a health event. ++* `github.com/aws/aws-sdk-go-v2/service/medialive`: [v1.34.0](service/medialive/CHANGELOG.md#v1340-2023-08-01) ++ * **Feature**: AWS Elemental Link devices now report their Availability Zone. Link devices now support the ability to change their Availability Zone. ++* `github.com/aws/aws-sdk-go-v2/service/polly`: [v1.29.0](service/polly/CHANGELOG.md#v1290-2023-08-01) ++ * **Feature**: Amazon Polly adds new French Belgian voice - Isabelle. Isabelle is available as Neural voice only. ++* `github.com/aws/aws-sdk-go-v2/service/rds`: [v1.50.0](service/rds/CHANGELOG.md#v1500-2023-08-01) ++ * **Feature**: Added support for deleted clusters PiTR. ++* `github.com/aws/aws-sdk-go-v2/service/sagemaker`: [v1.97.0](service/sagemaker/CHANGELOG.md#v1970-2023-08-01) ++ * **Feature**: Add Stairs TrafficPattern and FlatInvocations to RecommendationJobStoppingConditions ++ + # Release (2023-07-31) + + ## General Highlights +diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go +index 46f3b15cbf..c0af5602a9 100644 +--- a/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go ++++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go +@@ -3,4 +3,4 @@ + package aws + + // goModuleVersion is the tagged release for this module +-const goModuleVersion = ""1.20.0"" ++const goModuleVersion = ""1.20.1"" +diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/CHANGELOG.md +index 6766146554..37ed094070 100644 +--- a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/CHANGELOG.md ++++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/CHANGELOG.md +@@ -1,3 +1,7 @@ ++# v1.4.12 (2023-08-07) ++ ++* No change notes available for this release. ++ + # v1.4.11 (2023-07-31) + + * No change notes available for this release. +diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/go_module_metadata.go +index 363022227f..13427be1cc 100644 +--- a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/go_module_metadata.go ++++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/go_module_metadata.go +@@ -3,4 +3,4 @@ + package eventstream + + // goModuleVersion is the tagged release for this module +-const goModuleVersion = ""1.4.11"" ++const goModuleVersion = ""1.4.12"" +diff --git a/vendor/github.com/aws/aws-sdk-go-v2/ci-find-smithy-go.sh b/vendor/github.com/aws/aws-sdk-go-v2/ci-find-smithy-go.sh +new file mode 100644 +index 0000000000..a3eb9b31fb +--- /dev/null ++++ b/vendor/github.com/aws/aws-sdk-go-v2/ci-find-smithy-go.sh +@@ -0,0 +1,52 @@ ++#!/bin/bash ++ ++# looks for (and modreplaces if existing) a smithy-go branch matching the ++# current branch name ++# ++# the loop will unfurl -*s off of the branch, e.g. sdk branch ++# 'feat-foo-bar-baz' will match any of the following (in order): ++# - feat-foo-bar-baz ++# - feat-foo-bar ++# - feat-foo ++ ++if [ -z ""$SMITHY_GO_REPOSITORY"" ]; then ++ echo env SMITHY_GO_REPOSITORY is required ++ exit 1 ++fi ++ ++if [ -z ""$RUNNER_TMPDIR"" ]; then ++ echo env RUNNER_TMPDIR is required ++ exit 1 ++fi ++ ++branch=`git branch --show-current` ++if [ ""$branch"" == main ]; then ++ echo aws-sdk-go-v2 is on branch main, stop ++ exit 0 ++fi ++ ++if [ -n ""$GIT_PAT"" ]; then ++ repository=https://$GIT_PAT@github.com/$SMITHY_GO_REPOSITORY ++else ++ repository=https://github.com/$SMITHY_GO_REPOSITORY ++fi ++ ++while [ -n ""$branch"" ] && [[ ""$branch"" == *-* ]]; do ++ echo looking for $branch... ++ git ls-remote --exit-code --heads $repository refs/heads/$branch ++ if [ ""$?"" == 0 ]; then ++ echo found $branch ++ matched_branch=$branch ++ break ++ fi ++ ++ branch=${branch%-*} ++done ++ ++if [ -z ""$matched_branch"" ]; then ++ echo found no matching smithy-go branch, stop ++ exit 0 ++fi ++ ++git clone -b $matched_branch $repository $RUNNER_TMPDIR/smithy-go ++SMITHY_GO_SRC=$RUNNER_TMPDIR/smithy-go make gen-mod-replace-smithy-. +diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md +index 8bcba5d093..3c7fb90a41 100644 +--- a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md ++++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md +@@ -1,3 +1,7 @@ ++# v1.1.38 (2023-08-07) ++ ++* **Dependency Update**: Updated to the latest SDK module versions ++ + # v1.1.37 (2023-07-31) + + * **Dependency Update**: Updated to the latest SDK module versions +diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go +index 0f108d3cc3..acf968aa7d 100644 +--- a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go ++++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go +@@ -3,4 +3,4 @@ + package configsources + + // goModuleVersion is the tagged release for this module +-const goModuleVersion = ""1.1.37"" ++const goModuleVersion = ""1.1.38"" +diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.json b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.json +index 2018b804f3..4e0c6f1232 100644 +--- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.json ++++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.json +@@ -8,7 +8,7 @@ + ""supportsDualStack"" : true, + ""supportsFIPS"" : true + }, +- ""regionRegex"" : ""^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"", ++ ""regionRegex"" : ""^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$"", + ""regions"" : { + ""af-south-1"" : { + ""description"" : ""Africa (Cape Town)"" +@@ -73,6 +73,9 @@ + ""eu-west-3"" : { + ""description"" : ""Europe (Paris)"" + }, ++ ""il-central-1"" : { ++ ""description"" : ""Israel (Tel Aviv)"" ++ }, + ""me-central-1"" : { + ""description"" : ""Middle East (UAE)"" + }, +diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md +index 4714b847d4..0c49cf68bd 100644 +--- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md ++++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md +@@ -1,3 +1,7 @@ ++# v2.4.32 (2023-08-07) ++ ++* **Dependency Update**: Updated to the latest SDK module versions ++ + # v2.4.31 (2023-07-31) + + * **Dependency Update**: Updated to the latest SDK module versions +diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go +index 96d0bf8545..06c328c97e 100644 +--- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go ++++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go +@@ -3,4 +3,4 @@ + package endpoints + + // goModuleVersion is the tagged release for this module +-const goModuleVersion = ""2.4.31"" ++const goModuleVersion = ""2.4.32"" +diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/CHANGELOG.md +index f035223be4..c499a656d1 100644 +--- a/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/CHANGELOG.md ++++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/CHANGELOG.md +@@ -1,3 +1,7 @@ ++# v1.1.1 (2023-08-07) ++ ++* **Dependency Update**: Updated to the latest SDK module versions ++ + # v1.1.0 (2023-07-31) + + * **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide. +diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/go_module_metadata.go +index f132e39a4b..0b41e8d1fa 100644 +--- a/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/go_module_metadata.go ++++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/go_module_metadata.go +@@ -3,4 +3,4 @@ + package v4a + + // goModuleVersion is the tagged release for this module +-const goModuleVersion = ""1.1.0"" ++const goModuleVersion = ""1.1.1"" +diff --git a/vendor/github.com/aws/aws-sdk-go-v2/modman.toml b/vendor/github.com/aws/aws-sdk-go-v2/modman.toml +index c759788972..a4a3436719 100644 +--- a/vendor/github.com/aws/aws-sdk-go-v2/modman.toml ++++ b/vendor/github.com/aws/aws-sdk-go-v2/modman.toml +@@ -1,7 +1,7 @@ + + [dependencies] + ""github.com/aws/aws-sdk-go"" = ""v1.44.28"" +- ""github.com/aws/smithy-go"" = ""v1.14.0"" ++ ""github.com/aws/smithy-go"" = ""v1.14.1"" + ""github.com/google/go-cmp"" = ""v0.5.8"" + ""github.com/jmespath/go-jmespath"" = ""v0.4.0"" + ""golang.org/x/net"" = ""v0.1.0"" +diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md +index 9627be044d..0d739635dc 100644 +--- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md ++++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md +@@ -1,3 +1,7 @@ ++# v1.9.13 (2023-08-07) ++ ++* No change notes available for this release. ++ + # v1.9.12 (2023-07-31) + + * No change notes available for this release. +diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go +index 3dc27b8310..a00c21e27a 100644 +--- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go ++++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go +@@ -3,4 +3,4 @@ + package acceptencoding + + // goModuleVersion is the tagged release for this module +-const goModuleVersion = ""1.9.12"" ++const goModuleVersion = ""1.9.13"" +diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/CHANGELOG.md +index 9e727679b4..be4bc328ee 100644 +--- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/CHANGELOG.md ++++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/CHANGELOG.md +@@ -1,3 +1,7 @@ ++# v1.1.33 (2023-08-07) ++ ++* **Dependency Update**: Updated to the latest SDK module versions ++ + # v1.1.32 (2023-07-31) + + * **Dependency Update**: Updated to the latest SDK module versions +diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/go_module_metadata.go +index ad66ad71d2..925bc54251 100644 +--- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/go_module_metadata.go ++++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/go_module_metadata.go +@@ -3,4 +3,4 @@ + package checksum + + // goModuleVersion is the tagged release for this module +-const goModuleVersion = ""1.1.32"" ++const goModuleVersion = ""1.1.33"" +diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md +index 89a9149861..ad42443245 100644 +--- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md ++++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md +@@ -1,3 +1,7 @@ ++# v1.9.32 (2023-08-07) ++ ++* **Dependency Update**: Updated to the latest SDK module versions ++ + # v1.9.31 (2023-07-31) + + * **Dependency Update**: Updated to the latest SDK module versions +diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go +index 003f1792c3..7cd0b2d813 100644 +--- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go ++++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go +@@ -3,4 +3,4 @@ + package presignedurl + + // goModuleVersion is the tagged release for this module +-const goModuleVersion = ""1.9.31"" ++const goModuleVersion = ""1.9.32"" +diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/CHANGELOG.md +index 151642d378..7873f18cb6 100644 +--- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/CHANGELOG.md ++++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/CHANGELOG.md +@@ -1,3 +1,7 @@ ++# v1.15.1 (2023-08-07) ++ ++* **Dependency Update**: Updated to the latest SDK module versions ++ + # v1.15.0 (2023-07-31) + + * **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide. +diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/go_module_metadata.go +index 071bea5cef..0e06d52425 100644 +--- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/go_module_metadata.go ++++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/go_module_metadata.go +@@ -3,4 +3,4 @@ + package s3shared + + // goModuleVersion is the tagged release for this module +-const goModuleVersion = ""1.15.0"" ++const goModuleVersion = ""1.15.1"" +diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/CHANGELOG.md +index da4efeb9a5..0d7f95c73f 100644 +--- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/CHANGELOG.md ++++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/CHANGELOG.md +@@ -1,3 +1,11 @@ ++# v1.38.2 (2023-08-07) ++ ++* **Dependency Update**: Updated to the latest SDK module versions ++ ++# v1.38.1 (2023-08-01) ++ ++* No change notes available for this release. ++ + # v1.38.0 (2023-07-31) + + * **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide. +diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_client.go +index 48c20237f4..f3f258bf4d 100644 +--- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_client.go ++++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_client.go +@@ -60,12 +60,12 @@ func New(options Options, optFns ...func(*Options)) *Client { + fn(&options) + } + +- resolveCredentialProvider(&options) +- + client := &Client{ + options: options, + } + ++ resolveCredentialProvider(&options) ++ + return client + } + +diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/go_module_metadata.go +index 9242ae4a32..98fff2a3e0 100644 +--- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/go_module_metadata.go ++++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/go_module_metadata.go +@@ -3,4 +3,4 @@ + package s3 + + // goModuleVersion is the tagged release for this module +-const goModuleVersion = ""1.38.0"" ++const goModuleVersion = ""1.38.2"" +diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/endpoints/endpoints.go +index 34e5ab67d1..c7e5f6d2b2 100644 +--- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/endpoints/endpoints.go ++++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/endpoints/endpoints.go +@@ -96,7 +96,7 @@ var partitionRegexp = struct { + AwsUsGov *regexp.Regexp + }{ + +- Aws: regexp.MustCompile(""^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$""), ++ Aws: regexp.MustCompile(""^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$""), + AwsCn: regexp.MustCompile(""^cn\\-\\w+\\-\\d+$""), + AwsIso: regexp.MustCompile(""^us\\-iso\\-\\w+\\-\\d+$""), + AwsIsoB: regexp.MustCompile(""^us\\-isob\\-\\w+\\-\\d+$""), +@@ -403,6 +403,15 @@ var defaultPartitions = endpoints.Partitions{ + }, + Deprecated: aws.TrueTernary, + }, ++ endpoints.EndpointKey{ ++ Region: ""il-central-1"", ++ }: endpoints.Endpoint{}, ++ endpoints.EndpointKey{ ++ Region: ""il-central-1"", ++ Variant: endpoints.DualStackVariant, ++ }: { ++ Hostname: ""s3.dualstack.il-central-1.amazonaws.com"", ++ }, + endpoints.EndpointKey{ + Region: ""me-central-1"", + }: endpoints.Endpoint{}, +diff --git a/vendor/github.com/aws/smithy-go/CHANGELOG.md b/vendor/github.com/aws/smithy-go/CHANGELOG.md +index a7ebd2012c..a1754c2216 100644 +--- a/vendor/github.com/aws/smithy-go/CHANGELOG.md ++++ b/vendor/github.com/aws/smithy-go/CHANGELOG.md +@@ -1,3 +1,9 @@ ++# Release (2023-08-07) ++ ++## Module Highlights ++* `github.com/aws/smithy-go`: v1.14.1 ++ * **Bug Fix**: Prevent duplicated error returns in EndpointResolverV2 default implementation. ++ + # Release (2023-07-31) + + ## General Highlights +diff --git a/vendor/github.com/aws/smithy-go/go_module_metadata.go b/vendor/github.com/aws/smithy-go/go_module_metadata.go +index a7cfd686d7..5dffb63606 100644 +--- a/vendor/github.com/aws/smithy-go/go_module_metadata.go ++++ b/vendor/github.com/aws/smithy-go/go_module_metadata.go +@@ -3,4 +3,4 @@ + package smithy + + // goModuleVersion is the tagged release for this module +-const goModuleVersion = ""1.14.0"" ++const goModuleVersion = ""1.14.1"" +diff --git a/vendor/modules.txt b/vendor/modules.txt +index 1876a9141c..fdf3556c52 100644 +--- a/vendor/modules.txt ++++ b/vendor/modules.txt +@@ -102,7 +102,7 @@ github.com/acomagu/bufpipe + # github.com/agext/levenshtein v1.2.3 + ## explicit + github.com/agext/levenshtein +-# github.com/aws/aws-sdk-go-v2 v1.20.0 ++# github.com/aws/aws-sdk-go-v2 v1.20.1 + ## explicit; go 1.15 + github.com/aws/aws-sdk-go-v2 + github.com/aws/aws-sdk-go-v2/aws +@@ -127,7 +127,7 @@ github.com/aws/aws-sdk-go-v2/internal/shareddefaults + github.com/aws/aws-sdk-go-v2/internal/strings + github.com/aws/aws-sdk-go-v2/internal/sync/singleflight + github.com/aws/aws-sdk-go-v2/internal/timeconv +-# github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.11 ++# github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.12 + ## explicit; go 1.15 + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/eventstreamapi +@@ -150,16 +150,16 @@ github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config + # github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.75 + ## explicit; go 1.15 + github.com/aws/aws-sdk-go-v2/feature/s3/manager +-# github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.37 ++# github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.38 + ## explicit; go 1.15 + github.com/aws/aws-sdk-go-v2/internal/configsources +-# github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.31 ++# github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.32 + ## explicit; go 1.15 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 + # github.com/aws/aws-sdk-go-v2/internal/ini v1.3.38 + ## explicit; go 1.15 + github.com/aws/aws-sdk-go-v2/internal/ini +-# github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.0 ++# github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.1 + ## explicit; go 1.15 + github.com/aws/aws-sdk-go-v2/internal/v4a + github.com/aws/aws-sdk-go-v2/internal/v4a/internal/crypto +@@ -174,21 +174,21 @@ github.com/aws/aws-sdk-go-v2/service/ecr/types + github.com/aws/aws-sdk-go-v2/service/ecrpublic + github.com/aws/aws-sdk-go-v2/service/ecrpublic/internal/endpoints + github.com/aws/aws-sdk-go-v2/service/ecrpublic/types +-# github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.12 ++# github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.13 + ## explicit; go 1.15 + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding +-# github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.32 ++# github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.33 + ## explicit; go 1.15 + github.com/aws/aws-sdk-go-v2/service/internal/checksum +-# github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.31 ++# github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.32 + ## explicit; go 1.15 + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url +-# github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.15.0 ++# github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.15.1 + ## explicit; go 1.15 + github.com/aws/aws-sdk-go-v2/service/internal/s3shared + github.com/aws/aws-sdk-go-v2/service/internal/s3shared/arn + github.com/aws/aws-sdk-go-v2/service/internal/s3shared/config +-# github.com/aws/aws-sdk-go-v2/service/s3 v1.38.0 ++# github.com/aws/aws-sdk-go-v2/service/s3 v1.38.2 + ## explicit; go 1.15 + github.com/aws/aws-sdk-go-v2/service/s3 + github.com/aws/aws-sdk-go-v2/service/s3/internal/arn +@@ -210,7 +210,7 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc/types + github.com/aws/aws-sdk-go-v2/service/sts + github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints + github.com/aws/aws-sdk-go-v2/service/sts/types +-# github.com/aws/smithy-go v1.14.0 ++# github.com/aws/smithy-go v1.14.1 + ## explicit; go 1.15 + github.com/aws/smithy-go + github.com/aws/smithy-go/auth/bearer" +immortalwrt,https://github.com/immortalwrt/immortalwrt,bb0e4f9fb0c101b86b1a0c2785fec9b38b19fd02,Tomasz Maciej Nowak,2019-02-17 22:52:40,build: remove leftovers from previous x86 commits,"VBoxManage is not used and the image is created with proper permisions: +0f5d0f6 image: use internal qemu-img for vmdk and vdi images drop host +dependencies on qemu-utils and VirtualBox + +Unreachable config symbols: +9e0759e x86: merge all geode based subtargets into one + +No need to define those symbols since x86_64 is subtarget of x86: +196fb76 x86: make x86_64 a subtarget instead of a standalone target + +Unreachable config symbols, so remove GRUB_ROOT: +371b382 x86: remove the xen_domu subtarget","build: remove leftovers from previous x86 commits + +VBoxManage is not used and the image is created with proper permisions: +0f5d0f6 image: use internal qemu-img for vmdk and vdi images drop host + dependencies on qemu-utils and VirtualBox + +Unreachable config symbols: +9e0759e x86: merge all geode based subtargets into one + +No need to define those symbols since x86_64 is subtarget of x86: +196fb76 x86: make x86_64 a subtarget instead of a standalone target + +Unreachable config symbols, so remove GRUB_ROOT: +371b382 x86: remove the xen_domu subtarget + +Signed-off-by: Tomasz Maciej Nowak ","diff --git a/config/Config-images.in b/config/Config-images.in +index bdd24ef6178..6610601d551 100644 +--- a/config/Config-images.in ++++ b/config/Config-images.in +@@ -197,14 +197,12 @@ menu ""Target Images"" + config GRUB_CONSOLE + bool ""Use Console Terminal (in addition to Serial)"" + depends on GRUB_IMAGES +- default n if (TARGET_x86_generic_Soekris45xx || TARGET_x86_generic_Soekris48xx || TARGET_x86_net5501 || TARGET_x86_geos || TARGET_x86_alix2) + default y + + config GRUB_SERIAL + string ""Serial port device"" + depends on GRUB_IMAGES +- default ""hvc0"" if TARGET_x86_xen_domu +- default ""ttyS0"" if ! TARGET_x86_xen_domu ++ default ""ttyS0"" + + config GRUB_BAUDRATE + int ""Serial port baud rate"" +@@ -220,7 +218,6 @@ menu ""Target Images"" + config GRUB_BOOTOPTS + string ""Extra kernel boot options"" + depends on GRUB_IMAGES +- default ""xencons=hvc"" if TARGET_x86_xen_domu + help + If you don't know, just leave it blank. + +@@ -241,14 +238,14 @@ menu ""Target Images"" + + config VDI_IMAGES + bool ""Build VirtualBox image files (VDI)"" +- depends on TARGET_x86 || TARGET_x86_64 ++ depends on TARGET_x86 + select GRUB_IMAGES + select TARGET_IMAGES_PAD + select PACKAGE_kmod-e1000 + + config VMDK_IMAGES + bool ""Build VMware image files (VMDK)"" +- depends on TARGET_x86 || TARGET_x86_64 ++ depends on TARGET_x86 + select GRUB_IMAGES + select TARGET_IMAGES_PAD + select PACKAGE_kmod-e1000 +diff --git a/package/boot/grub2/Makefile b/package/boot/grub2/Makefile +index e4c19cd00ff..d6af65128e5 100644 +--- a/package/boot/grub2/Makefile ++++ b/package/boot/grub2/Makefile +@@ -33,7 +33,7 @@ define Package/grub2 + SECTION:=boot + TITLE:=GRand Unified Bootloader + URL:=http://www.gnu.org/software/grub/ +- DEPENDS:=@TARGET_x86||TARGET_x86_64 ++ DEPENDS:=@TARGET_x86 + endef + + define Package/grub2-editenv +@@ -42,7 +42,7 @@ define Package/grub2-editenv + SUBMENU:=Boot Loaders + TITLE:=Grub2 Environment editor + URL:=http://www.gnu.org/software/grub/ +- DEPENDS:=@TARGET_x86||TARGET_x86_64 ++ DEPENDS:=@TARGET_x86 + endef + + define Package/grub2-editenv/description +diff --git a/target/linux/x86/image/Makefile b/target/linux/x86/image/Makefile +index dbf8a8594b4..d799a0ba034 100644 +--- a/target/linux/x86/image/Makefile ++++ b/target/linux/x86/image/Makefile +@@ -15,7 +15,6 @@ GRUB_TERMINALS = + GRUB_SERIAL_CONFIG = + GRUB_TERMINAL_CONFIG = + GRUB_CONSOLE_CMDLINE = +-GRUB_ROOT = hd0,msdos1 + + USE_ATKBD = generic 64 + +@@ -48,10 +47,6 @@ ROOTPART:=$(if $(ROOTPART),$(ROOTPART),PARTUUID=$(SIGNATURE)-02) + GRUB_TIMEOUT:=$(call qstrip,$(CONFIG_GRUB_TIMEOUT)) + GRUB_TITLE:=$(call qstrip,$(CONFIG_GRUB_TITLE)) + +-ifneq ($(CONFIG_TARGET_x86_xen_domu),) +- GRUB_ROOT = xen/xvda,msdos1 +-endif +- + ifneq ($(CONFIG_GRUB_IMAGES),) + + BOOTOPTS:=$(call qstrip,$(CONFIG_GRUB_BOOTOPTS)) +@@ -82,7 +77,6 @@ ifneq ($(CONFIG_GRUB_IMAGES),) + -e 's#@TERMINAL_CONFIG@#$(strip $(GRUB_TERMINAL_CONFIG))#g' \ + -e 's#@CMDLINE@#$(strip $(call Image/cmdline/$(1)) $(BOOTOPTS) $(GRUB_CONSOLE_CMDLINE))#g' \ + -e 's#@TIMEOUT@#$(GRUB_TIMEOUT)#g' \ +- -e 's#@ROOT@#$(GRUB_ROOT)#g' \ + -e 's#@TITLE@#$(GRUB_TITLE)#g' \ + ./grub.cfg > $(KDIR)/root.grub/boot/grub/grub.cfg + -$(CP) $(STAGING_DIR_ROOT)/boot/. $(KDIR)/root.grub/boot/ +@@ -135,8 +129,6 @@ ifneq ($(CONFIG_VDI_IMAGES),) + qemu-img convert -f raw -O vdi \ + $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).img \ + $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).vdi +- # XXX: VBoxManage insists on setting perms to 0600 +- chmod 0644 $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).vdi + endef + endif + +diff --git a/target/linux/x86/image/grub.cfg b/target/linux/x86/image/grub.cfg +index dedfa0a6367..76a98855447 100644 +--- a/target/linux/x86/image/grub.cfg ++++ b/target/linux/x86/image/grub.cfg +@@ -3,7 +3,7 @@ + + set default=""0"" + set timeout=""@TIMEOUT@"" +-set root='(@ROOT@)' ++set root='(hd0,msdos1)' + + menuentry ""@TITLE@"" { + linux /boot/vmlinuz @CMDLINE@ noinitrd" +typescript-eslint,https://github.com/typescript-eslint/typescript-eslint,d5622445eabe1a0d14816c40eab4b9750ee949b7,Tianlan Zhou,2023-01-22 11:34:14,docs(eslint-plugin): remove invalid examples for unified-signatures (#6286),Update unified-signatures.md,"docs(eslint-plugin): remove invalid examples for unified-signatures (#6286) + +Update unified-signatures.md","diff --git a/packages/eslint-plugin/docs/rules/unified-signatures.md b/packages/eslint-plugin/docs/rules/unified-signatures.md +index 5736561d2ff4..609eb3a7bb53 100644 +--- a/packages/eslint-plugin/docs/rules/unified-signatures.md ++++ b/packages/eslint-plugin/docs/rules/unified-signatures.md +@@ -38,6 +38,13 @@ function x(x: number | string): void; + function y(...x: number[]): void; + ``` + ++```ts ++// This rule won't check overload signatures with different rest parameter types. ++// See https://github.com/microsoft/TypeScript/issues/5077 ++function f(...a: number[]): void; ++function f(...a: string[]): void; ++``` ++ + ## Options + + ### `ignoreDifferentlyNamedParameters` +@@ -53,11 +60,6 @@ function f(a: number): void; + function f(a: string): void; + ``` + +-```ts +-function f(...a: number[]): void; +-function f(...b: string[]): void; +-``` +- + ### ✅ Correct + + ```ts +@@ -65,9 +67,4 @@ function f(a: number): void; + function f(b: string): void; + ``` + +-```ts +-function f(...a: number[]): void; +-function f(...a: string[]): void; +-``` +- + ## Options" +ort,https://github.com/oss-review-toolkit/ort,40ca30c3785884377493ff8e943ea4bf4bedf93c,Frank Viernau,2023-05-16 22:06:48,refactor: Return a set from `mergeLicenseFindings()`,"Returning a sorted set is no more necessary, because `ScanSummary` has +been changed in a preceeding change to use a set for the copyright +findings.","refactor: Return a set from `mergeLicenseFindings()` + +Returning a sorted set is no more necessary, because `ScanSummary` has +been changed in a preceeding change to use a set for the copyright +findings. + +Signed-off-by: Frank Viernau ","diff --git a/scanner/src/main/kotlin/provenance/NestedProvenanceScanResult.kt b/scanner/src/main/kotlin/provenance/NestedProvenanceScanResult.kt +index f7462751c00e3..b352a68848db8 100644 +--- a/scanner/src/main/kotlin/provenance/NestedProvenanceScanResult.kt ++++ b/scanner/src/main/kotlin/provenance/NestedProvenanceScanResult.kt +@@ -20,7 +20,6 @@ + package org.ossreviewtoolkit.scanner.provenance + + import java.time.Instant +-import java.util.SortedSet + + import org.ossreviewtoolkit.model.CopyrightFinding + import org.ossreviewtoolkit.model.KnownProvenance +@@ -107,12 +106,12 @@ data class NestedProvenanceScanResult( + } + } + +- private fun Map>.mergeLicenseFindings(): SortedSet { ++ private fun Map>.mergeLicenseFindings(): Set { + val findingsByPath = mapKeys { getPath(it.key) }.mapValues { (_, scanResults) -> + scanResults.flatMap { it.summary.licenseFindings } + } + +- val findings = findingsByPath.flatMapTo(sortedSetOf()) { (path, findings) -> ++ val findings = findingsByPath.flatMapTo(mutableSetOf()) { (path, findings) -> + val prefix = if (path.isEmpty()) path else ""$path/"" + findings.map { it.copy(location = it.location.copy(path = ""$prefix${it.location.path}"")) } + }" +ani-cli,https://github.com/pystardust/ani-cli,e74546ff2fc32e7de4765c48953d7c6c55875b46,ura,2022-01-27 15:25:56,docs: readme refactor (#423),"* Added maintainer list to contributing.md + +* Removed maintainers from readme + +* All operating systems are fully supported + +* Making badges centered","docs: readme refactor (#423) + +* Added maintainer list to contributing.md + +* Removed maintainers from readme + +* All operating systems are fully supported + +* Making badges centered","diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md +index 3f6f6f4a9..4fa20ffa6 100644 +--- a/CONTRIBUTING.md ++++ b/CONTRIBUTING.md +@@ -1,8 +1,11 @@ +-# How to contribute +- +-## Issues: Use an Issue template if applicable +- +-## Support: Join our [discord](https://discord.gg/aqu7GpqVmR) ++[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-brightgreen.svg)](https://GitHub.com/pystardust/ani-cli/graphs/commit-activity) ++[![Maintainer](https://img.shields.io/badge/maintainer-pystardust-blue)](https://github.com/pystardust) ++[![Maintainer](https://img.shields.io/badge/maintainer-ura43-blue)](https://github.com/ura43) ++[![Maintainer](https://img.shields.io/badge/maintainer-RayGL-blue)](https://github.com/RaynardGerraldo) ++[![Maintainer](https://img.shields.io/badge/maintainer-Dink4n-blue)](https://github.com/Dink4n) ++[![Maintainer](https://img.shields.io/badge/maintainer-CoolnsX-blue)](https://github.com/CoolnsX) ++ ++# Contribution Guidelines + + ## Pull Requests + +diff --git a/README.md b/README.md +index c407a828e..64a38cd15 100644 +--- a/README.md ++++ b/README.md +@@ -1,21 +1,14 @@ +-

+- +-[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com) +-[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-brightgreen.svg)](https://GitHub.com/pystardust/ani-cli/graphs/commit-activity) +-[![Maintainer](https://img.shields.io/badge/maintainer-pystardust-blue)](https://github.com/pystardust) +-[![Maintainer](https://img.shields.io/badge/maintainer-ura43-blue)](https://github.com/ura43) +-[![Maintainer](https://img.shields.io/badge/maintainer-RayGL-blue)](https://github.com/RaynardGerraldo) +-[![Maintainer](https://img.shields.io/badge/maintainer-Dink4n-blue)](https://github.com/Dink4n) +-[![Maintainer](https://img.shields.io/badge/maintainer-CoolnsX-blue)](https://github.com/CoolnsX) +-![Linux](https://img.shields.io/badge/os-linux-brightgreen) +-![Mac](https://img.shields.io/badge/os-mac-brightgreen) +-![Windows](https://img.shields.io/badge/os-windows-yellow) +-![Android](https://img.shields.io/badge/os-android-yellow) +- +-

+- +- +-

++

++ ++
++ ++ ++ ++ ++ ++
++ ++

+ + A cli to browse and watch anime. This tool scrapes the site [gogoanime](https://gogoanime.pe)." +dagger,https://github.com/dagger/dagger,a8346941094c2423a1d3f0e15c07bfadbc0418d4,dependabot[bot],2022-05-25 00:43:59,build(deps): bump amplitude-js from 8.18.2 to 8.18.3 in /website,"Bumps [amplitude-js](https://github.com/amplitude/amplitude-javascript) from 8.18.2 to 8.18.3. +- [Release notes](https://github.com/amplitude/amplitude-javascript/releases) +- [Changelog](https://github.com/amplitude/Amplitude-JavaScript/blob/main/CHANGELOG.md) +- [Commits](https://github.com/amplitude/amplitude-javascript/compare/v8.18.2...v8.18.3) + +---","build(deps): bump amplitude-js from 8.18.2 to 8.18.3 in /website + +Bumps [amplitude-js](https://github.com/amplitude/amplitude-javascript) from 8.18.2 to 8.18.3. +- [Release notes](https://github.com/amplitude/amplitude-javascript/releases) +- [Changelog](https://github.com/amplitude/Amplitude-JavaScript/blob/main/CHANGELOG.md) +- [Commits](https://github.com/amplitude/amplitude-javascript/compare/v8.18.2...v8.18.3) + +--- +updated-dependencies: +- dependency-name: amplitude-js + dependency-type: direct:production + update-type: version-update:semver-patch +... + +Signed-off-by: dependabot[bot] ","diff --git a/website/package.json b/website/package.json +index d1c2c428100..ffcf5200fbd 100644 +--- a/website/package.json ++++ b/website/package.json +@@ -20,7 +20,7 @@ + ""@docusaurus/preset-classic"": ""^2.0.0-beta.20"", + ""@mdx-js/react"": ""^1.6.22"", + ""@svgr/webpack"": ""^6.2.1"", +- ""amplitude-js"": ""^8.18.2"", ++ ""amplitude-js"": ""^8.18.3"", + ""clsx"": ""^1.1.1"", + ""docusaurus-plugin-sass"": ""^0.2.2"", + ""docusaurus2-dotenv"": ""^1.4.0"", +diff --git a/website/yarn.lock b/website/yarn.lock +index 79763223f9f..50e0fb1b267 100644 +--- a/website/yarn.lock ++++ b/website/yarn.lock +@@ -251,6 +251,11 @@ + resolved ""https://registry.yarnpkg.com/@amplitude/ua-parser-js/-/ua-parser-js-0.7.26.tgz#18d889d84d2ba90c248ab6fcd7e3dd07f1c9c86e"" + integrity sha512-62/Rid6YQ7F2KT/5vTre41Y26ivrEoFC8lbrsJZqBKaiXMJWG0YpNv9RgxNSaZS2jPLVQgoB/FFeWxihOLfIcg== + ++""@amplitude/ua-parser-js@0.7.31"": ++ version ""0.7.31"" ++ resolved ""https://registry.yarnpkg.com/@amplitude/ua-parser-js/-/ua-parser-js-0.7.31.tgz#749bf7cb633cfcc7ff3c10805bad7c5f6fbdbc61"" ++ integrity sha512-+z8UGRaj13Pt5NDzOnkTBy49HE2CX64jeL0ArB86HAtilpnfkPB7oqkigN7Lf2LxscMg4QhFD7mmCfedh3rqTg== ++ + ""@amplitude/utils@^1.0.5"": + version ""1.6.1"" + resolved ""https://registry.yarnpkg.com/@amplitude/utils/-/utils-1.6.1.tgz#fb6833bca5a35af01468e0317363520ff2377259"" +@@ -1957,14 +1962,7 @@ + core-js-pure ""^3.20.2"" + regenerator-runtime ""^0.13.4"" + +-""@babel/runtime@^7.1.2"", ""@babel/runtime@^7.10.2"", ""@babel/runtime@^7.10.3"", ""@babel/runtime@^7.12.1"", ""@babel/runtime@^7.12.13"", ""@babel/runtime@^7.12.5"", ""@babel/runtime@^7.3.4"", ""@babel/runtime@^7.8.4"": +- version ""7.17.8"" +- resolved ""https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.8.tgz#3e56e4aff81befa55ac3ac6a0967349fd1c5bca2"" +- integrity sha512-dQpEpK0O9o6lj6oPu0gRDbbnk+4LeHlNcBpspf6Olzt3GIX4P1lWF1gS+pHLDFlaJvbR6q7jCfQ08zA4QJBnmA== +- dependencies: +- regenerator-runtime ""^0.13.4"" +- +-""@babel/runtime@^7.17.9"": ++""@babel/runtime@^7.1.2"", ""@babel/runtime@^7.10.2"", ""@babel/runtime@^7.10.3"", ""@babel/runtime@^7.12.1"", ""@babel/runtime@^7.12.13"", ""@babel/runtime@^7.12.5"", ""@babel/runtime@^7.17.9"", ""@babel/runtime@^7.3.4"", ""@babel/runtime@^7.8.4"": + version ""7.17.9"" + resolved ""https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.9.tgz#d19fbf802d01a8cb6cf053a64e472d42c434ba72"" + integrity sha512-lSiBBvodq29uShpWGNbgFdKYNiFDo5/HIYsaCEY9ff4sb10x9jizo2+pRrSyF4jKZCXqgzuqBOQKbUm90gQwJg== +@@ -3259,13 +3257,13 @@ algoliasearch@^4.13.0: + ""@algolia/requester-node-http"" ""4.13.0"" + ""@algolia/transporter"" ""4.13.0"" + +-amplitude-js@^8.18.2: +- version ""8.18.2"" +- resolved ""https://registry.yarnpkg.com/amplitude-js/-/amplitude-js-8.18.2.tgz#0572d2c4e351cfd652a4c3d5d77118752653083e"" +- integrity sha512-Zc3VPnf9VzqGURo4ty53k40/KZyD72UKTF+/o6wDGjbZy3LWOwHnCEtH56uQvdSdufBVGRa/KKfwaNHSDZtxWA== ++amplitude-js@^8.18.3: ++ version ""8.18.3"" ++ resolved ""https://registry.yarnpkg.com/amplitude-js/-/amplitude-js-8.18.3.tgz#cec2424f139ea5cfc4e8bbefb8e2101f027bba05"" ++ integrity sha512-Qs4bspIufDZ9UcG1FLgOPoOP8qJUN/W5IoueOcmi+6u5fX+wigDNfLlbaga2sZ5/Tk6qUUWT+ZuNouLA3+2izQ== + dependencies: + ""@amplitude/analytics-connector"" ""1.4.2"" +- ""@amplitude/ua-parser-js"" ""0.7.26"" ++ ""@amplitude/ua-parser-js"" ""0.7.31"" + ""@amplitude/utils"" ""^1.0.5"" + ""@babel/runtime"" ""^7.3.4"" + blueimp-md5 ""^2.10.0""" +superset,https://github.com/apache/superset,bac84a3aac6a9f565aae9cda1820cd8ada014d63,Daniel Vaz Gaspar,2020-11-26 14:15:49,"fix: delete chart, dashboards, dbs with assoc reports (#11801)","* fix: delete chart or dashboards with assoc reports + +* database constraint to reports and tests + +* add tests for dashboards and database + +* fix exceptions default text","fix: delete chart, dashboards, dbs with assoc reports (#11801) + +* fix: delete chart or dashboards with assoc reports + +* database constraint to reports and tests + +* add tests for dashboards and database + +* fix exceptions default text","diff --git a/superset/charts/commands/bulk_delete.py b/superset/charts/commands/bulk_delete.py +index de1af113d0086..463f17bc07fc1 100644 +--- a/superset/charts/commands/bulk_delete.py ++++ b/superset/charts/commands/bulk_delete.py +@@ -18,9 +18,11 @@ + from typing import List, Optional + + from flask_appbuilder.security.sqla.models import User ++from flask_babel import lazy_gettext as _ + + from superset.charts.commands.exceptions import ( + ChartBulkDeleteFailedError, ++ ChartBulkDeleteFailedReportsExistError, + ChartForbiddenError, + ChartNotFoundError, + ) +@@ -29,6 +31,7 @@ + from superset.commands.exceptions import DeleteFailedError + from superset.exceptions import SupersetSecurityException + from superset.models.slice import Slice ++from superset.reports.dao import ReportScheduleDAO + from superset.views.base import check_ownership + + logger = logging.getLogger(__name__) +@@ -53,6 +56,13 @@ def validate(self) -> None: + self._models = ChartDAO.find_by_ids(self._model_ids) + if not self._models or len(self._models) != len(self._model_ids): + raise ChartNotFoundError() ++ # Check there are no associated ReportSchedules ++ reports = ReportScheduleDAO.find_by_chart_ids(self._model_ids) ++ if reports: ++ report_names = [report.name for report in reports] ++ raise ChartBulkDeleteFailedReportsExistError( ++ _(""There are associated alerts or reports: %s"" % "","".join(report_names)) ++ ) + # Check ownership + for model in self._models: + try: +diff --git a/superset/charts/commands/delete.py b/superset/charts/commands/delete.py +index c6392a9055cd2..5b33a5041d411 100644 +--- a/superset/charts/commands/delete.py ++++ b/superset/charts/commands/delete.py +@@ -19,9 +19,11 @@ + + from flask_appbuilder.models.sqla import Model + from flask_appbuilder.security.sqla.models import User ++from flask_babel import lazy_gettext as _ + + from superset.charts.commands.exceptions import ( + ChartDeleteFailedError, ++ ChartDeleteFailedReportsExistError, + ChartForbiddenError, + ChartNotFoundError, + ) +@@ -31,6 +33,7 @@ + from superset.exceptions import SupersetSecurityException + from superset.models.dashboard import Dashboard + from superset.models.slice import Slice ++from superset.reports.dao import ReportScheduleDAO + from superset.views.base import check_ownership + + logger = logging.getLogger(__name__) +@@ -57,6 +60,13 @@ def validate(self) -> None: + self._model = ChartDAO.find_by_id(self._model_id) + if not self._model: + raise ChartNotFoundError() ++ # Check there are no associated ReportSchedules ++ reports = ReportScheduleDAO.find_by_chart_id(self._model_id) ++ if reports: ++ report_names = [report.name for report in reports] ++ raise ChartDeleteFailedReportsExistError( ++ _(""There are associated alerts or reports: %s"" % "","".join(report_names)) ++ ) + # Check ownership + try: + check_ownership(self._model) +diff --git a/superset/charts/commands/exceptions.py b/superset/charts/commands/exceptions.py +index dd146d790bc15..51b5ca84f03be 100644 +--- a/superset/charts/commands/exceptions.py ++++ b/superset/charts/commands/exceptions.py +@@ -78,13 +78,21 @@ class ChartDeleteFailedError(DeleteFailedError): + message = _(""Chart could not be deleted."") + + ++class ChartDeleteFailedReportsExistError(ChartDeleteFailedError): ++ message = _(""There are associated alerts or reports"") ++ ++ + class ChartForbiddenError(ForbiddenError): + message = _(""Changing this chart is forbidden"") + + +-class ChartBulkDeleteFailedError(CreateFailedError): ++class ChartBulkDeleteFailedError(DeleteFailedError): + message = _(""Charts could not be deleted."") + + ++class ChartBulkDeleteFailedReportsExistError(ChartBulkDeleteFailedError): ++ message = _(""There are associated alerts or reports"") ++ ++ + class ChartImportError(ImportFailedError): + message = _(""Import chart failed for an unknown reason"") +diff --git a/superset/dashboards/commands/bulk_delete.py b/superset/dashboards/commands/bulk_delete.py +index cb2bab62e9af5..27787cc61bf1f 100644 +--- a/superset/dashboards/commands/bulk_delete.py ++++ b/superset/dashboards/commands/bulk_delete.py +@@ -18,17 +18,20 @@ + from typing import List, Optional + + from flask_appbuilder.security.sqla.models import User ++from flask_babel import lazy_gettext as _ + + from superset.commands.base import BaseCommand + from superset.commands.exceptions import DeleteFailedError + from superset.dashboards.commands.exceptions import ( + DashboardBulkDeleteFailedError, ++ DashboardBulkDeleteFailedReportsExistError, + DashboardForbiddenError, + DashboardNotFoundError, + ) + from superset.dashboards.dao import DashboardDAO + from superset.exceptions import SupersetSecurityException + from superset.models.dashboard import Dashboard ++from superset.reports.dao import ReportScheduleDAO + from superset.views.base import check_ownership + + logger = logging.getLogger(__name__) +@@ -54,6 +57,13 @@ def validate(self) -> None: + self._models = DashboardDAO.find_by_ids(self._model_ids) + if not self._models or len(self._models) != len(self._model_ids): + raise DashboardNotFoundError() ++ # Check there are no associated ReportSchedules ++ reports = ReportScheduleDAO.find_by_dashboard_ids(self._model_ids) ++ if reports: ++ report_names = [report.name for report in reports] ++ raise DashboardBulkDeleteFailedReportsExistError( ++ _(""There are associated alerts or reports: %s"" % "","".join(report_names)) ++ ) + # Check ownership + for model in self._models: + try: +diff --git a/superset/dashboards/commands/delete.py b/superset/dashboards/commands/delete.py +index 08d0fcb1dd240..795288a84376f 100644 +--- a/superset/dashboards/commands/delete.py ++++ b/superset/dashboards/commands/delete.py +@@ -19,17 +19,20 @@ + + from flask_appbuilder.models.sqla import Model + from flask_appbuilder.security.sqla.models import User ++from flask_babel import lazy_gettext as _ + + from superset.commands.base import BaseCommand + from superset.dao.exceptions import DAODeleteFailedError + from superset.dashboards.commands.exceptions import ( + DashboardDeleteFailedError, ++ DashboardDeleteFailedReportsExistError, + DashboardForbiddenError, + DashboardNotFoundError, + ) + from superset.dashboards.dao import DashboardDAO + from superset.exceptions import SupersetSecurityException + from superset.models.dashboard import Dashboard ++from superset.reports.dao import ReportScheduleDAO + from superset.views.base import check_ownership + + logger = logging.getLogger(__name__) +@@ -55,6 +58,13 @@ def validate(self) -> None: + self._model = DashboardDAO.find_by_id(self._model_id) + if not self._model: + raise DashboardNotFoundError() ++ # Check there are no associated ReportSchedules ++ reports = ReportScheduleDAO.find_by_dashboard_id(self._model_id) ++ if reports: ++ report_names = [report.name for report in reports] ++ raise DashboardDeleteFailedReportsExistError( ++ _(""There are associated alerts or reports: %s"" % "","".join(report_names)) ++ ) + # Check ownership + try: + check_ownership(self._model) +diff --git a/superset/dashboards/commands/exceptions.py b/superset/dashboards/commands/exceptions.py +index cc645da4bdcf4..03413aa25e392 100644 +--- a/superset/dashboards/commands/exceptions.py ++++ b/superset/dashboards/commands/exceptions.py +@@ -53,6 +53,10 @@ class DashboardBulkDeleteFailedError(CreateFailedError): + message = _(""Dashboards could not be deleted."") + + ++class DashboardBulkDeleteFailedReportsExistError(DashboardBulkDeleteFailedError): ++ message = _(""There are associated alerts or reports"") ++ ++ + class DashboardUpdateFailedError(UpdateFailedError): + message = _(""Dashboard could not be updated."") + +@@ -61,6 +65,10 @@ class DashboardDeleteFailedError(DeleteFailedError): + message = _(""Dashboard could not be deleted."") + + ++class DashboardDeleteFailedReportsExistError(DashboardDeleteFailedError): ++ message = _(""There are associated alerts or reports"") ++ ++ + class DashboardForbiddenError(ForbiddenError): + message = _(""Changing this Dashboard is forbidden"") + +diff --git a/superset/databases/commands/delete.py b/superset/databases/commands/delete.py +index 5ea8de3731463..5f002dbfb36dd 100644 +--- a/superset/databases/commands/delete.py ++++ b/superset/databases/commands/delete.py +@@ -19,16 +19,19 @@ + + from flask_appbuilder.models.sqla import Model + from flask_appbuilder.security.sqla.models import User ++from flask_babel import lazy_gettext as _ + + from superset.commands.base import BaseCommand + from superset.dao.exceptions import DAODeleteFailedError + from superset.databases.commands.exceptions import ( + DatabaseDeleteDatasetsExistFailedError, + DatabaseDeleteFailedError, ++ DatabaseDeleteFailedReportsExistError, + DatabaseNotFoundError, + ) + from superset.databases.dao import DatabaseDAO + from superset.models.core import Database ++from superset.reports.dao import ReportScheduleDAO + + logger = logging.getLogger(__name__) + +@@ -53,6 +56,14 @@ def validate(self) -> None: + self._model = DatabaseDAO.find_by_id(self._model_id) + if not self._model: + raise DatabaseNotFoundError() ++ # Check there are no associated ReportSchedules ++ reports = ReportScheduleDAO.find_by_database_id(self._model_id) ++ ++ if reports: ++ report_names = [report.name for report in reports] ++ raise DatabaseDeleteFailedReportsExistError( ++ _(""There are associated alerts or reports: %s"" % "","".join(report_names)) ++ ) + # Check if there are datasets for this database + if self._model.tables: + raise DatabaseDeleteDatasetsExistFailedError() +diff --git a/superset/databases/commands/exceptions.py b/superset/databases/commands/exceptions.py +index 48c63a2c97b16..b8b1c67f08e2e 100644 +--- a/superset/databases/commands/exceptions.py ++++ b/superset/databases/commands/exceptions.py +@@ -113,6 +113,10 @@ class DatabaseDeleteFailedError(DeleteFailedError): + message = _(""Database could not be deleted."") + + ++class DatabaseDeleteFailedReportsExistError(DatabaseDeleteFailedError): ++ message = _(""There are associated alerts or reports"") ++ ++ + class DatabaseSecurityUnsafeError(DBSecurityException): + message = _(""Stopped an unsafe database connection"") + +diff --git a/superset/reports/dao.py b/superset/reports/dao.py +index 6081fc8efa67e..aaa0c39190681 100644 +--- a/superset/reports/dao.py ++++ b/superset/reports/dao.py +@@ -38,6 +38,54 @@ + class ReportScheduleDAO(BaseDAO): + model_cls = ReportSchedule + ++ @staticmethod ++ def find_by_chart_id(chart_id: int) -> List[ReportSchedule]: ++ return ( ++ db.session.query(ReportSchedule) ++ .filter(ReportSchedule.chart_id == chart_id) ++ .all() ++ ) ++ ++ @staticmethod ++ def find_by_chart_ids(chart_ids: List[int]) -> List[ReportSchedule]: ++ return ( ++ db.session.query(ReportSchedule) ++ .filter(ReportSchedule.chart_id.in_(chart_ids)) ++ .all() ++ ) ++ ++ @staticmethod ++ def find_by_dashboard_id(dashboard_id: int) -> List[ReportSchedule]: ++ return ( ++ db.session.query(ReportSchedule) ++ .filter(ReportSchedule.dashboard_id == dashboard_id) ++ .all() ++ ) ++ ++ @staticmethod ++ def find_by_dashboard_ids(dashboard_ids: List[int]) -> List[ReportSchedule]: ++ return ( ++ db.session.query(ReportSchedule) ++ .filter(ReportSchedule.dashboard_id.in_(dashboard_ids)) ++ .all() ++ ) ++ ++ @staticmethod ++ def find_by_database_id(database_id: int) -> List[ReportSchedule]: ++ return ( ++ db.session.query(ReportSchedule) ++ .filter(ReportSchedule.database_id == database_id) ++ .all() ++ ) ++ ++ @staticmethod ++ def find_by_database_ids(database_ids: List[int]) -> List[ReportSchedule]: ++ return ( ++ db.session.query(ReportSchedule) ++ .filter(ReportSchedule.database_id.in_(database_ids)) ++ .all() ++ ) ++ + @staticmethod + def bulk_delete( + models: Optional[List[ReportSchedule]], commit: bool = True +diff --git a/superset/reports/schemas.py b/superset/reports/schemas.py +index 7613278addcfb..a03b3394c27b1 100644 +--- a/superset/reports/schemas.py ++++ b/superset/reports/schemas.py +@@ -136,7 +136,7 @@ class ReportSchedulePostSchema(Schema): + crontab = fields.String( + description=crontab_description, + validate=[validate_crontab, Length(1, 50)], +- example=""*/5 * * * * *"", ++ example=""*/5 * * * *"", + allow_none=False, + required=True, + ) +diff --git a/tests/charts/api_tests.py b/tests/charts/api_tests.py +index 4e44bcc4355b0..39abb6cedd62a 100644 +--- a/tests/charts/api_tests.py ++++ b/tests/charts/api_tests.py +@@ -38,6 +38,7 @@ + from superset.extensions import db, security_manager + from superset.models.core import Database, FavStar, FavStarClassName + from superset.models.dashboard import Dashboard ++from superset.models.reports import ReportSchedule, ReportScheduleType + from superset.models.slice import Slice + from superset.utils import core as utils + from tests.base_api_tests import ApiOwnersTestCaseMixin +@@ -117,6 +118,26 @@ def create_charts(self): + db.session.delete(fav_chart) + db.session.commit() + ++ @pytest.fixture() ++ def create_chart_with_report(self): ++ with self.create_app().app_context(): ++ admin = self.get_user(""admin"") ++ chart = self.insert_chart(f""chart_report"", [admin.id], 1) ++ report_schedule = ReportSchedule( ++ type=ReportScheduleType.REPORT, ++ name=""report_with_chart"", ++ crontab=""* * * * *"", ++ chart=chart, ++ ) ++ db.session.commit() ++ ++ yield chart ++ ++ # rollback changes ++ db.session.delete(report_schedule) ++ db.session.delete(chart) ++ db.session.commit() ++ + def test_delete_chart(self): + """""" + Chart API: Test delete +@@ -174,6 +195,26 @@ def test_delete_not_found_chart(self): + rv = self.delete_assert_metric(uri, ""delete"") + self.assertEqual(rv.status_code, 404) + ++ @pytest.mark.usefixtures(""create_chart_with_report"") ++ def test_delete_chart_with_report(self): ++ """""" ++ Chart API: Test delete with associated report ++ """""" ++ self.login(username=""admin"") ++ chart = ( ++ db.session.query(Slice) ++ .filter(Slice.slice_name == ""chart_report"") ++ .one_or_none() ++ ) ++ uri = f""api/v1/chart/{chart.id}"" ++ rv = self.client.delete(uri) ++ response = json.loads(rv.data.decode(""utf-8"")) ++ self.assertEqual(rv.status_code, 422) ++ expected_response = { ++ ""message"": ""There are associated alerts or reports: report_with_chart"" ++ } ++ self.assertEqual(response, expected_response) ++ + def test_delete_bulk_charts_not_found(self): + """""" + Chart API: Test delete bulk not found +@@ -181,11 +222,35 @@ def test_delete_bulk_charts_not_found(self): + max_id = db.session.query(func.max(Slice.id)).scalar() + chart_ids = [max_id + 1, max_id + 2] + self.login(username=""admin"") +- argument = chart_ids +- uri = f""api/v1/chart/?q={prison.dumps(argument)}"" ++ uri = f""api/v1/chart/?q={prison.dumps(chart_ids)}"" + rv = self.delete_assert_metric(uri, ""bulk_delete"") + self.assertEqual(rv.status_code, 404) + ++ @pytest.mark.usefixtures(""create_chart_with_report"", ""create_charts"") ++ def test_bulk_delete_chart_with_report(self): ++ """""" ++ Chart API: Test bulk delete with associated report ++ """""" ++ self.login(username=""admin"") ++ chart_with_report = ( ++ db.session.query(Slice.id) ++ .filter(Slice.slice_name == ""chart_report"") ++ .one_or_none() ++ ) ++ ++ charts = db.session.query(Slice.id).filter(Slice.slice_name.like(""name%"")).all() ++ chart_ids = [chart.id for chart in charts] ++ chart_ids.append(chart_with_report.id) ++ ++ uri = f""api/v1/chart/?q={prison.dumps(chart_ids)}"" ++ rv = self.client.delete(uri) ++ response = json.loads(rv.data.decode(""utf-8"")) ++ self.assertEqual(rv.status_code, 422) ++ expected_response = { ++ ""message"": ""There are associated alerts or reports: report_with_chart"" ++ } ++ self.assertEqual(response, expected_response) ++ + def test_delete_chart_admin_not_owned(self): + """""" + Chart API: Test admin delete not owned +diff --git a/tests/dashboards/api_tests.py b/tests/dashboards/api_tests.py +index 24d461d1d1d9a..aba79f9b93f39 100644 +--- a/tests/dashboards/api_tests.py ++++ b/tests/dashboards/api_tests.py +@@ -33,6 +33,7 @@ + from superset import db, security_manager + from superset.models.dashboard import Dashboard + from superset.models.core import FavStar, FavStarClassName ++from superset.models.reports import ReportSchedule, ReportScheduleType + from superset.models.slice import Slice + from superset.views.base import generate_download_headers + +@@ -121,6 +122,28 @@ def create_dashboards(self): + db.session.delete(fav_dashboard) + db.session.commit() + ++ @pytest.fixture() ++ def create_dashboard_with_report(self): ++ with self.create_app().app_context(): ++ admin = self.get_user(""admin"") ++ dashboard = self.insert_dashboard( ++ f""dashboard_report"", ""dashboard_report"", [admin.id] ++ ) ++ report_schedule = ReportSchedule( ++ type=ReportScheduleType.REPORT, ++ name=""report_with_dashboard"", ++ crontab=""* * * * *"", ++ dashboard=dashboard, ++ ) ++ db.session.commit() ++ ++ yield dashboard ++ ++ # rollback changes ++ db.session.delete(report_schedule) ++ db.session.delete(dashboard) ++ db.session.commit() ++ + def test_get_dashboard(self): + """""" + Dashboard API: Test get dashboard +@@ -493,6 +516,26 @@ def test_delete_not_found_dashboard(self): + rv = self.client.delete(uri) + self.assertEqual(rv.status_code, 404) + ++ @pytest.mark.usefixtures(""create_dashboard_with_report"") ++ def test_delete_dashboard_with_report(self): ++ """""" ++ Dashboard API: Test delete with associated report ++ """""" ++ self.login(username=""admin"") ++ dashboard = ( ++ db.session.query(Dashboard.id) ++ .filter(Dashboard.dashboard_title == ""dashboard_report"") ++ .one_or_none() ++ ) ++ uri = f""api/v1/dashboard/{dashboard.id}"" ++ rv = self.client.delete(uri) ++ response = json.loads(rv.data.decode(""utf-8"")) ++ self.assertEqual(rv.status_code, 422) ++ expected_response = { ++ ""message"": ""There are associated alerts or reports: report_with_dashboard"" ++ } ++ self.assertEqual(response, expected_response) ++ + def test_delete_bulk_dashboards_not_found(self): + """""" + Dashboard API: Test delete bulk not found +@@ -504,6 +547,34 @@ def test_delete_bulk_dashboards_not_found(self): + rv = self.client.delete(uri) + self.assertEqual(rv.status_code, 404) + ++ @pytest.mark.usefixtures(""create_dashboard_with_report"", ""create_dashboards"") ++ def test_bulk_delete_dashboard_with_report(self): ++ """""" ++ Dashboard API: Test bulk delete with associated report ++ """""" ++ self.login(username=""admin"") ++ dashboard_with_report = ( ++ db.session.query(Dashboard.id) ++ .filter(Dashboard.dashboard_title == ""dashboard_report"") ++ .one_or_none() ++ ) ++ dashboards = ( ++ db.session.query(Dashboard) ++ .filter(Dashboard.dashboard_title.like(""title%"")) ++ .all() ++ ) ++ ++ dashboard_ids = [dashboard.id for dashboard in dashboards] ++ dashboard_ids.append(dashboard_with_report.id) ++ uri = f""api/v1/dashboard/?q={prison.dumps(dashboard_ids)}"" ++ rv = self.client.delete(uri) ++ response = json.loads(rv.data.decode(""utf-8"")) ++ self.assertEqual(rv.status_code, 422) ++ expected_response = { ++ ""message"": ""There are associated alerts or reports: report_with_dashboard"" ++ } ++ self.assertEqual(response, expected_response) ++ + def test_delete_dashboard_admin_not_owned(self): + """""" + Dashboard API: Test admin delete not owned +diff --git a/tests/databases/api_tests.py b/tests/databases/api_tests.py +index 9a290e159b5e8..6e2dbef805104 100644 +--- a/tests/databases/api_tests.py ++++ b/tests/databases/api_tests.py +@@ -30,6 +30,7 @@ + from superset import db, security_manager + from superset.connectors.sqla.models import SqlaTable + from superset.models.core import Database ++from superset.models.reports import ReportSchedule, ReportScheduleType + from superset.utils.core import get_example_database, get_main_database + from tests.base_tests import SupersetTestCase + from tests.fixtures.certificates import ssl_certificate +@@ -66,6 +67,30 @@ def insert_database( + db.session.commit() + return database + ++ @pytest.fixture() ++ def create_database_with_report(self): ++ with self.create_app().app_context(): ++ example_db = get_example_database() ++ database = self.insert_database( ++ ""database_with_report"", ++ example_db.sqlalchemy_uri_decrypted, ++ expose_in_sqllab=True, ++ ) ++ report_schedule = ReportSchedule( ++ type=ReportScheduleType.ALERT, ++ name=""report_with_database"", ++ crontab=""* * * * *"", ++ database=database, ++ ) ++ db.session.add(report_schedule) ++ db.session.commit() ++ yield database ++ ++ # rollback changes ++ db.session.delete(report_schedule) ++ db.session.delete(database) ++ db.session.commit() ++ + def test_get_items(self): + """""" + Database API: Test get items +@@ -486,6 +511,26 @@ def test_delete_database_with_datasets(self): + rv = self.delete_assert_metric(uri, ""delete"") + self.assertEqual(rv.status_code, 422) + ++ @pytest.mark.usefixtures(""create_database_with_report"") ++ def test_delete_database_with_report(self): ++ """""" ++ Database API: Test delete with associated report ++ """""" ++ self.login(username=""admin"") ++ database = ( ++ db.session.query(Database) ++ .filter(Database.database_name == ""database_with_report"") ++ .one_or_none() ++ ) ++ uri = f""api/v1/database/{database.id}"" ++ rv = self.client.delete(uri) ++ response = json.loads(rv.data.decode(""utf-8"")) ++ self.assertEqual(rv.status_code, 422) ++ expected_response = { ++ ""message"": ""There are associated alerts or reports: report_with_database"" ++ } ++ self.assertEqual(response, expected_response) ++ + def test_get_table_metadata(self): + """""" + Database API: Test get table metadata info" +Hippy,https://github.com/Tencent/Hippy,9ae13aa9e78652ff02facab250313acabc567dc9,luomy,2022-05-31 17:28:09,feat(ios): apply reuse feature to list and waterfall components (#1943),"* feat(ios): apply reuse feature to list and waterfall components + +* fix(ios): fix waterfall view memory leaks","feat(ios): apply reuse feature to list and waterfall components (#1943) + +* feat(ios): apply reuse feature to list and waterfall components + +* fix(ios): fix waterfall view memory leaks","diff --git a/driver/js/examples/ios-demo/HippyDemo.xcodeproj/project.pbxproj b/driver/js/examples/ios-demo/HippyDemo.xcodeproj/project.pbxproj +index 5b7d47d21a4..5d6494c9b03 100644 +--- a/driver/js/examples/ios-demo/HippyDemo.xcodeproj/project.pbxproj ++++ b/driver/js/examples/ios-demo/HippyDemo.xcodeproj/project.pbxproj +@@ -226,6 +226,8 @@ + F48291A0274E420D00D91128 /* HPLayoutCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F4829197274E420C00D91128 /* HPLayoutCache.cpp */; }; + F4A8424227D38CF900AEFC88 /* NativeRenderManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4A8423F27D38CF900AEFC88 /* NativeRenderManager.mm */; }; + F4A8424327D38CF900AEFC88 /* HippyUIManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4A8424127D38CF900AEFC88 /* HippyUIManager.mm */; }; ++ F4B938F82840B58C00187AFA /* HippyWaterfallViewCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4B938F72840B58C00187AFA /* HippyWaterfallViewCell.mm */; }; ++ F4B938FB2840C93C00187AFA /* HippyWatefallItemShadowView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4B938FA2840C93C00187AFA /* HippyWatefallItemShadowView.mm */; }; + F4BD045827D5AE2500339A2C /* UIView+Render.mm in Sources */ = {isa = PBXBuildFile; fileRef = F459C45927D4F355009A7441 /* UIView+Render.mm */; }; + F4C1CE23281131EC00CED4C4 /* NSData+DataType.m in Sources */ = {isa = PBXBuildFile; fileRef = F4C1CE22281131EC00CED4C4 /* NSData+DataType.m */; }; + F4C1CE262811439A00CED4C4 /* UIView+Sequence.m in Sources */ = {isa = PBXBuildFile; fileRef = F4C1CE252811439A00CED4C4 /* UIView+Sequence.m */; }; +@@ -740,6 +742,10 @@ + F4A8424027D38CF900AEFC88 /* NativeRenderManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeRenderManager.h; sourceTree = """"; }; + F4A8424127D38CF900AEFC88 /* HippyUIManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyUIManager.mm; sourceTree = """"; }; + F4A8424427D38D7900AEFC88 /* HippyRenderContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HippyRenderContext.h; sourceTree = """"; }; ++ F4B938F62840B58C00187AFA /* HippyWaterfallViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HippyWaterfallViewCell.h; sourceTree = """"; }; ++ F4B938F72840B58C00187AFA /* HippyWaterfallViewCell.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyWaterfallViewCell.mm; sourceTree = """"; }; ++ F4B938F92840C93C00187AFA /* HippyWatefallItemShadowView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HippyWatefallItemShadowView.h; sourceTree = """"; }; ++ F4B938FA2840C93C00187AFA /* HippyWatefallItemShadowView.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = HippyWatefallItemShadowView.mm; sourceTree = """"; }; + F4BD045927D5E39F00339A2C /* HippyFrameworkProxy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HippyFrameworkProxy.h; sourceTree = """"; }; + F4C1CE21281131EB00CED4C4 /* NSData+DataType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ""NSData+DataType.h""; sourceTree = """"; }; + F4C1CE22281131EC00CED4C4 /* NSData+DataType.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ""NSData+DataType.m""; sourceTree = """"; }; +@@ -1419,6 +1425,10 @@ + F45D25E728067B6900CAB185 /* HippyCollectionViewWaterfallLayout.m */, + F45D25E828067B6900CAB185 /* HippyWaterfallItemViewManager.mm */, + F45D25E928067B6900CAB185 /* HippyWaterfallView.h */, ++ F4B938F62840B58C00187AFA /* HippyWaterfallViewCell.h */, ++ F4B938F72840B58C00187AFA /* HippyWaterfallViewCell.mm */, ++ F4B938F92840C93C00187AFA /* HippyWatefallItemShadowView.h */, ++ F4B938FA2840C93C00187AFA /* HippyWatefallItemShadowView.mm */, + ); + path = waterfalllist; + sourceTree = """"; +@@ -2171,6 +2181,7 @@ + 067AB97523B5F309009D5EE2 /* MyViewManager.mm in Sources */, + D4B5A0862816641600ABBD9C /* event_module.cc in Sources */, + F4810954277062AD005C221B /* layer_optimized_render_manager.cc in Sources */, ++ F4B938F82840B58C00187AFA /* HippyWaterfallViewCell.mm in Sources */, + F468DE862812A95200319196 /* HippyCSSPropsDefine.m in Sources */, + F4C1DAAF28117C1900CED4C4 /* NSNumber+HippyNumberDeepCopy.m in Sources */, + F48291A0274E420D00D91128 /* HPLayoutCache.cpp in Sources */, +@@ -2185,6 +2196,7 @@ + F45D269528067B6900CAB185 /* HippyModalCustomPresentationController.m in Sources */, + D84AB9C1273A618B00987D03 /* js_value_wrapper.cc in Sources */, + F468DE832812A95200319196 /* HippySRSIMDHelpers.m in Sources */, ++ F4B938FB2840C93C00187AFA /* HippyWatefallItemShadowView.mm in Sources */, + F468DE782812A95200319196 /* HippyJSCErrorHandling.m in Sources */, + F45D266328067B6900CAB185 /* HippyTextSelection.m in Sources */, + F468DE5B2812A95200319196 /* HippyAnimationModule.mm in Sources */, +diff --git a/renderer/native/ios/renderer/HippyRenderContext.h b/renderer/native/ios/renderer/HippyRenderContext.h +index 8c062276781..37a99f39a28 100644 +--- a/renderer/native/ios/renderer/HippyRenderContext.h ++++ b/renderer/native/ios/renderer/HippyRenderContext.h +@@ -52,6 +52,7 @@ typedef void (^HippyViewUpdateCompletedBlock)(id renderConte + + //TODO Use a render view protocol instead of HippyShadowView in the future + - (__kindof UIView *)createViewRecursivelyFromShadowView:(HippyShadowView *)shadowView; ++- (UIView *)updateShadowView:(HippyShadowView *)shadowView withAnotherShadowView:(HippyShadowView *)anotherShadowView; + + - (HippyAnimator *)animator; + +diff --git a/renderer/native/ios/renderer/HippyUIManager.mm b/renderer/native/ios/renderer/HippyUIManager.mm +index b632cb5fef0..5ea310547db 100644 +--- a/renderer/native/ios/renderer/HippyUIManager.mm ++++ b/renderer/native/ios/renderer/HippyUIManager.mm +@@ -450,9 +450,9 @@ - (UIView *)createViewRecursiveFromShadowViewWithNOLock:(HippyShadowView *)shado + [view insertHippySubview:subview atIndex:index]; + index++; + } +- [view didUpdateHippySubviews]; + view.hippyShadowView = shadowView; + view.renderContext = self; ++ [view clearSortedSubviews]; + [view didUpdateHippySubviews]; + NSMutableSet *applierBlocks = [NSMutableSet setWithCapacity:1]; + [shadowView collectUpdatedProperties:applierBlocks parentProperties:@{}]; +@@ -464,6 +464,85 @@ - (UIView *)createViewRecursiveFromShadowViewWithNOLock:(HippyShadowView *)shado + return view; + } + ++- (UIView *)updateShadowView:(HippyShadowView *)shadowView withAnotherShadowView:(HippyShadowView *)anotherShadowView { ++ UIView *result = [self viewForHippyTag:anotherShadowView.hippyTag]; ++ if (result) { ++ return result; ++ } ++ if (nil == shadowView) { ++ return nil; ++ } ++ if (![shadowView.viewName isEqualToString:anotherShadowView.viewName]) { ++ return nil; ++ } ++ NSDictionary *diffResult = [shadowView diffAnotherShadowView:anotherShadowView]; ++ if (nil == diffResult) { ++ return nil; ++ } ++ NSDictionary *update = diffResult[HippyShadowViewDiffUpdate]; ++ NSDictionary *insert = diffResult[HippyShadowViewDiffInsertion]; ++ NSArray *remove = diffResult[HippyShadowViewDiffRemove]; ++ NSDictionary *tags = diffResult[HippyShadowViewDiffTag]; ++ for (NSNumber *tag in remove) { ++ UIView *view = [self viewForHippyTag:tag]; ++ [view.superview clearSortedSubviews]; ++ [view.superview removeHippySubview:view]; ++ } ++ result = [shadowView createView:^UIView *(HippyShadowView *shadowView) { ++ NSNumber *hippyTag = shadowView.hippyTag; ++ UIView *view = nil; ++ NSNumber *originTag = update[hippyTag]; ++ if (originTag) { ++ HippyShadowView *originShadowView = [self shadowViewForHippyTag:originTag]; ++ view = [self viewForHippyTag:originTag]; ++ if (view) { ++ HippyComponentData *componentData = [self componentDataForViewName:originShadowView.viewName]; ++ NSDictionary *oldProps = originShadowView.props; ++ NSDictionary *newProps = shadowView.props; ++ newProps = [self mergeProps:newProps oldProps:oldProps]; ++ [componentData setProps:newProps forView:view]; ++ [view.layer removeAllAnimations]; ++ } ++ else { ++ view = [self createViewFromShadowView:shadowView]; ++ } ++ } ++ else if (insert[hippyTag]) { ++ view = [self viewForHippyTag:hippyTag]; ++ if (nil == view) { ++ view = [self createViewFromShadowView:shadowView]; ++ } ++ } ++ else if (tags[hippyTag]) { ++ NSNumber *oldSubTag = tags[hippyTag]; ++ view = [self viewForHippyTag:oldSubTag]; ++ if (view == nil) { ++ view = [self createViewFromShadowView:shadowView]; ++ } else { ++ [view sendDetachedFromWindowEvent]; ++ [view.layer removeAllAnimations]; ++ view.hippyTag = hippyTag; ++ self->_viewRegistry[hippyTag] = view; ++ [view sendAttachedToWindowEvent]; ++ } ++ } ++ if (!CGRectEqualToRect(view.frame, shadowView.frame)) { ++ [view hippySetFrame:shadowView.frame]; ++ } ++ return view; ++ } insertChildren:^(UIView *container, NSArray *children) { ++ NSInteger index = 0; ++ for (UIView *subview in children) { ++ [container removeHippySubview:subview]; ++ [container insertHippySubview:subview atIndex:index]; ++ index++; ++ } ++ [container clearSortedSubviews]; ++ [container didUpdateHippySubviews]; ++ }]; ++ return result; ++} ++ + - (NSDictionary *)createShadowViewFromNode:(const std::shared_ptr &)domNode{ + if (domNode) { + NSNumber *hippyTag = @(domNode->GetId()); +@@ -511,7 +590,6 @@ - (UIView *)createViewByComponentData:(HippyComponentData *)componentData + properties:(NSDictionary *)props + viewName:(NSString *)viewName { + UIView *view = [self viewForHippyTag:hippyTag]; +- + BOOL canBeRetrievedFromCache = YES; + if (view && [view respondsToSelector:@selector(canBeRetrievedFromViewCache)]) { + canBeRetrievedFromCache = [view canBeRetrievedFromViewCache]; +@@ -658,7 +736,6 @@ - (void)measureInAppWindow:(nonnull NSNumber *)hippyTag callback:(RenderUIRespon + #pragma mark Render Context Implementation + #define Init(Component) NSClassFromString(@#Component) + - (__kindof HippyViewManager *)renderViewManagerForViewName:(NSString *)viewName { +- //TODO 需要接口接收自定义ViewManager:MyView + if (!_viewManagers) { + _viewManagers = [@{@""View"": Init(HippyViewManager), + @""WaterfallItem"": Init(HippyWaterfallItemViewManager), +diff --git a/renderer/native/ios/renderer/component/listview/HippyBaseListItemView.mm b/renderer/native/ios/renderer/component/listview/HippyBaseListItemView.mm +index 102c6cd0f56..2d839907452 100644 +--- a/renderer/native/ios/renderer/component/listview/HippyBaseListItemView.mm ++++ b/renderer/native/ios/renderer/component/listview/HippyBaseListItemView.mm +@@ -54,4 +54,8 @@ - (void)setFrame:(CGRect)frame { + [super setFrame:frame]; + } + ++- (void)dealloc { ++ ++} ++ + @end +diff --git a/renderer/native/ios/renderer/component/listview/HippyBaseListView.mm b/renderer/native/ios/renderer/component/listview/HippyBaseListView.mm +index d1ac70b7c42..4e4d78670df 100644 +--- a/renderer/native/ios/renderer/component/listview/HippyBaseListView.mm ++++ b/renderer/native/ios/renderer/component/listview/HippyBaseListView.mm +@@ -148,6 +148,7 @@ - (void)insertHippySubview:(UIView *)subview atIndex:(NSInteger)atIndex { + _headerRefreshView = (HippyHeaderRefresh *)subview; + [_headerRefreshView setScrollView:self.collectionView]; + _headerRefreshView.delegate = self; ++ [_weakItemMap setObject:subview forKey:[subview hippyTag]]; + } else if ([subview isKindOfClass:[HippyFooterRefresh class]]) { + if (_footerRefreshView) { + [_footerRefreshView unsetFromScrollView]; +@@ -155,6 +156,7 @@ - (void)insertHippySubview:(UIView *)subview atIndex:(NSInteger)atIndex { + _footerRefreshView = (HippyFooterRefresh *)subview; + [_footerRefreshView setScrollView:self.collectionView]; + _footerRefreshView.delegate = self; ++ [_weakItemMap setObject:subview forKey:[subview hippyTag]]; + } + } + +@@ -288,21 +290,37 @@ - (void)collectionView:(UICollectionView *)collectionView + } + } + ++- (void)collectionView:(UICollectionView *)collectionView didEndDisplayingCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath { ++ if ([cell isKindOfClass:[HippyBaseListViewCell class]]) { ++ HippyBaseListViewCell *hpCell = (HippyBaseListViewCell *)cell; ++ hpCell.shadowView.cell = nil; ++ } ++} ++ + - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { + HippyShadowView *cellShadowView = [self.dataSource cellForIndexPath:indexPath]; + HippyBaseListViewCell *cell = (HippyBaseListViewCell *)[collectionView dequeueReusableCellWithReuseIdentifier:kCellIdentifier forIndexPath:indexPath]; +- UIView *cellView = [self.renderContext viewFromRenderViewTag:cellShadowView.hippyTag]; +- if (!cellView) { ++ UIView *cellView = nil; ++ if (cell.shadowView.cell) { + cellView = [self.renderContext createViewRecursivelyFromShadowView:cellShadowView]; + } ++ else { ++ cellView = [self.renderContext updateShadowView:cell.shadowView withAnotherShadowView:cellShadowView]; ++ if (nil == cellView) { ++ cellView = [self.renderContext createViewRecursivelyFromShadowView:cellShadowView]; ++ } ++ } + NSAssert([cellView conformsToProtocol:@protocol(ViewAppearStateProtocol)], + @""subviews of HippyBaseListViewCell must conform to protocol ViewAppearStateProtocol""); + cell.cellView = (UIView *)cellView; ++ cell.shadowView = cellShadowView; ++ cell.shadowView.cell = cell; ++ [_weakItemMap setObject:cellView forKey:[cellView hippyTag]]; + return cell; + } + + - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView itemViewForItemAtIndexPath:(NSIndexPath *)indexPath { +- HippyCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kCellIdentifier forIndexPath:indexPath]; ++ HippyWaterfallViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kCellIdentifier forIndexPath:indexPath]; + return cell; + } + +diff --git a/renderer/native/ios/renderer/component/listview/HippyBaseListViewCell.h b/renderer/native/ios/renderer/component/listview/HippyBaseListViewCell.h +index 13c5450b744..e1b853987bc 100644 +--- a/renderer/native/ios/renderer/component/listview/HippyBaseListViewCell.h ++++ b/renderer/native/ios/renderer/component/listview/HippyBaseListViewCell.h +@@ -22,6 +22,7 @@ + + #import + #import ""HippyWaterfallView.h"" ++#import ""HippyWaterfallViewCell.h"" + + NS_ASSUME_NONNULL_BEGIN + +@@ -41,7 +42,7 @@ typedef NS_ENUM(NSUInteger, CellShowState) { CellNotShowState, CellHalfShowState + + @end + +-@interface HippyBaseListViewCell : HippyCollectionViewCell ++@interface HippyBaseListViewCell : HippyWaterfallViewCell + + @property (nonatomic, weak) UIView *cellView; + +diff --git a/renderer/native/ios/renderer/component/smartViewPager/HippySmartViewPagerView.mm b/renderer/native/ios/renderer/component/smartViewPager/HippySmartViewPagerView.mm +index 25684d3610a..0448d1d515f 100644 +--- a/renderer/native/ios/renderer/component/smartViewPager/HippySmartViewPagerView.mm ++++ b/renderer/native/ios/renderer/component/smartViewPager/HippySmartViewPagerView.mm +@@ -339,15 +339,7 @@ - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSe + - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { + NSInteger cellIndex = _itemIndexArray[indexPath.row].integerValue; + NSIndexPath *adjustIndexPath = [NSIndexPath indexPathForRow:cellIndex inSection:indexPath.section]; +- HippyShadowView *cellShadowView = [self.dataSource cellForIndexPath:adjustIndexPath]; + HippyBaseListViewCell *cell = (HippyBaseListViewCell *)[collectionView dequeueReusableCellWithReuseIdentifier:kCellIdentifier forIndexPath:adjustIndexPath]; +- UIView *cellView = [self.renderContext viewFromRenderViewTag:cellShadowView.hippyTag]; +- if (!cellView) { +- cellView = [self.renderContext createViewRecursivelyFromShadowView:cellShadowView]; +- } +- NSAssert([cellView conformsToProtocol:@protocol(ViewAppearStateProtocol)], +- @""subviews of HippyBaseListViewCell must conform to protocol ViewAppearStateProtocol""); +- cell.cellView = (UIView *)cellView; + return cell; + } + +@@ -365,14 +357,22 @@ - (void)collectionView:(UICollectionView *)collectionView + forItemAtIndexPath:(NSIndexPath *)indexPath { + NSInteger cellIndex = _itemIndexArray[indexPath.row].integerValue; + NSIndexPath *adjustIndexPath = [NSIndexPath indexPathForRow:cellIndex inSection:indexPath.section]; +- HippyCollectionViewCell *hpCell = (HippyCollectionViewCell *)cell; ++ HippyWaterfallViewCell *hpCell = (HippyWaterfallViewCell *)cell; + HippyShadowView *shadowView = [_dataSource cellForIndexPath:adjustIndexPath]; +- //TODO use reusable view here +- UIView *view = [self.renderContext viewFromRenderViewTag:shadowView.hippyTag]; +- if (!view) { +- view = [self.renderContext createViewRecursivelyFromShadowView:shadowView]; ++ UIView *cellView = nil; ++ if (hpCell.shadowView.cell) { ++ cellView = [self.renderContext createViewRecursivelyFromShadowView:shadowView]; ++ } ++ else { ++ cellView = [self.renderContext updateShadowView:hpCell.shadowView withAnotherShadowView:shadowView]; ++ if (nil == cellView) { ++ cellView = [self.renderContext createViewRecursivelyFromShadowView:shadowView]; ++ } + } +- hpCell.cellView = view; ++ hpCell.cellView = cellView; ++ hpCell.shadowView = shadowView; ++ hpCell.shadowView.cell = hpCell; ++ [_weakItemMap setObject:cellView forKey:[cellView hippyTag]]; + } + + - (void)collectionView:(UICollectionView *)collectionView didEndDisplayingCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath { +diff --git a/renderer/native/ios/renderer/component/view/HippyShadowView.h b/renderer/native/ios/renderer/component/view/HippyShadowView.h +index 4562f8d5c03..5e7e10b7814 100644 +--- a/renderer/native/ios/renderer/component/view/HippyShadowView.h ++++ b/renderer/native/ios/renderer/component/view/HippyShadowView.h +@@ -44,10 +44,16 @@ typedef NS_ENUM(NSUInteger, HippyCreationType) { + + @class HippyShadowView; + +-HIPPY_EXTERN CGRect getShadowViewRectFromDomNode(HippyShadowView *shadowView); +- + typedef void (^HippyApplierBlock)(NSDictionary *viewRegistry); + ++typedef UIView *(^HippyViewCreationBlock)(HippyShadowView *shadowView); ++typedef void (^HippyViewInsertionBlock)(UIView *container, NSArray *children); ++ ++extern NSString *const HippyShadowViewDiffInsertion; ++extern NSString *const HippyShadowViewDiffRemove; ++extern NSString *const HippyShadowViewDiffUpdate; ++extern NSString *const HippyShadowViewDiffTag; ++ + /** + * ShadowView tree mirrors Hippy view tree. Every node is highly stateful. + * 1. A node is in one of three lifecycles: uninitialized, computed, dirtied. +@@ -103,6 +109,7 @@ typedef void (^HippyApplierBlock)(NSDictionary *viewRegist + * set to NO in HippyUIManager after the layout pass is done and all frames have been extracted to be applied to the + * corresponding UIViews. + */ ++//TODO delete this variable + @property (nonatomic, assign, getter=isNewView) BOOL newView; + + /** +@@ -148,6 +155,8 @@ typedef void (^HippyApplierBlock)(NSDictionary *viewRegist + */ + - (void)recusivelySetCreationTypeToInstant; + ++- (UIView *)createView:(HippyViewCreationBlock)creationBlock insertChildren:(HippyViewInsertionBlock)insertionBlock; ++ + - (void)setDomManager:(const std::weak_ptr)domManager; + - (std::weak_ptr)domManager; + +@@ -173,6 +182,8 @@ typedef void (^HippyApplierBlock)(NSDictionary *viewRegist + + - (void)amendLayoutBeforeMount; + ++- (NSDictionary *)diffAnotherShadowView:(HippyShadowView *)shadowView; ++ + /** + * Return whether or not this node acts as a leaf node in the eyes of CSSLayout. For example + * HippyShadowText has children which it does not want CSSLayout to lay out so in the eyes of +@@ -195,21 +206,6 @@ typedef void (^HippyApplierBlock)(NSDictionary *viewRegist + - (void)didUpdateHippySubviews NS_REQUIRES_SUPER; + - (void)didSetProps:(NSArray *)changedProps NS_REQUIRES_SUPER; + +-/** +- * Computes the recursive offset, meaning the sum of all descendant offsets - +- * this is the sum of all positions inset from parents. This is not merely the +- * sum of `top`/`left`s, as this function uses the *actual* positions of +- * children, not the style specified positions - it computes this based on the +- * resulting layout. It does not yet compensate for native scroll view insets or +- * transforms or anchor points. +- */ +-- (CGRect)measureLayoutRelativeToAncestor:(HippyShadowView *)ancestor; +- +-/** +- * Checks if the current shadow view is a descendant of the provided `ancestor` +- */ +-- (BOOL)viewIsDescendantOf:(HippyShadowView *)ancestor; +- + - (NSDictionary *)mergeProps:(NSDictionary *)props; + + /** +diff --git a/renderer/native/ios/renderer/component/view/HippyShadowView.mm b/renderer/native/ios/renderer/component/view/HippyShadowView.mm +index 90101112699..6b230d42ba3 100644 +--- a/renderer/native/ios/renderer/component/view/HippyShadowView.mm ++++ b/renderer/native/ios/renderer/component/view/HippyShadowView.mm +@@ -32,6 +32,12 @@ + + static NSString *const HippyBackgroundColorProp = @""backgroundColor""; + ++NSString *const HippyShadowViewDiffInsertion = @""HippyShadowViewDiffInsertion""; ++NSString *const HippyShadowViewDiffRemove = @""HippyShadowViewDiffRemove""; ++NSString *const HippyShadowViewDiffUpdate = @""HippyShadowViewDiffUpdate""; ++NSString *const HippyShadowViewDiffTag = @""HippyShadowViewDiffTag""; ++ ++ + @interface HippyShadowView () { + HippyUpdateLifecycle _propagationLifecycle; + HippyUpdateLifecycle _textLifecycle; +@@ -119,32 +125,6 @@ - (void)collectUpdatedProperties:(NSMutableSet *)applierBlock + } + } + +-- (CGRect)measureLayoutRelativeToAncestor:(HippyShadowView *)ancestor { +- CGPoint offset = CGPointZero; +- NSInteger depth = 30; // max depth to search +- HippyShadowView *shadowView = self; +- while (depth && shadowView && shadowView != ancestor) { +- offset.x += shadowView.frame.origin.x; +- offset.y += shadowView.frame.origin.y; +- shadowView = shadowView->_superview; +- depth--; +- } +- if (ancestor != shadowView) { +- return CGRectNull; +- } +- return (CGRect) { offset, self.frame.size }; +-} +- +-- (BOOL)viewIsDescendantOf:(HippyShadowView *)ancestor { +- NSInteger depth = 30; // max depth to search +- HippyShadowView *shadowView = self; +- while (depth && shadowView && shadowView != ancestor) { +- shadowView = shadowView->_superview; +- depth--; +- } +- return ancestor == shadowView; +-} +- + - (instancetype)init { + if ((self = [super init])) { + _frame = CGRectMake(0, 0, NAN, NAN); +@@ -160,6 +140,68 @@ - (instancetype)init { + return self; + } + ++- (NSDictionary *)diffAnotherShadowView:(HippyShadowView *)shadowView { ++ NSMutableDictionary *result = [NSMutableDictionary dictionaryWithCapacity:4]; ++ [result setObject:[NSMutableDictionary dictionary] forKey:HippyShadowViewDiffInsertion]; ++ [result setObject:[NSMutableArray array] forKey:HippyShadowViewDiffRemove]; ++ [result setObject:[NSMutableDictionary dictionary] forKey:HippyShadowViewDiffUpdate]; ++ [result setObject:[NSMutableDictionary dictionary] forKey:HippyShadowViewDiffTag]; ++ if ([self.viewName isEqualToString:shadowView.viewName]) { ++ if (![self.props isEqualToDictionary:shadowView.props]) { ++ [result[@""update""] setObject:self.hippyTag forKey:shadowView.hippyTag]; ++ } ++ } else { ++ return nil; ++ } ++ ++ [result setObject:self.hippyTag forKey:shadowView.hippyTag]; ++ [self diffAnotherShadowView:shadowView inResult:result]; ++ return result; ++} ++ ++- (void)diffAnotherShadowView:(HippyShadowView *)shadowView inResult:(NSMutableDictionary *)result { ++ NSUInteger originCount = [self.hippySubviews count]; ++ NSUInteger comparedCount = [shadowView.hippySubviews count]; ++ for (NSUInteger index = 0; index < MAX(originCount, comparedCount); index++) { ++ HippyShadowView *originShadowView = nil, *comparedShadowView = nil; ++ if (index < originCount) { ++ originShadowView = self.hippySubviews[index]; ++ } ++ if (index < comparedCount) { ++ comparedShadowView = shadowView.hippySubviews[index]; ++ } ++ //need to insert new shadow view ++ if (nil == originShadowView && comparedShadowView) { ++ NSMutableDictionary *insertionDic = result[HippyShadowViewDiffInsertion]; ++ [insertionDic setObject:@{@""tag"": self.hippyTag} forKey:[comparedShadowView hippyTag]]; ++ } ++ //need to remove shadow view ++ else if (originShadowView && nil == comparedShadowView) { ++ NSMutableArray *removeArray = result[HippyShadowViewDiffRemove]; ++ [removeArray removeObject:[comparedShadowView hippyTag]]; ++ } ++ else if (originShadowView && comparedShadowView) { ++ if (![originShadowView.viewName isEqualToString:comparedShadowView.viewName]) { ++ NSMutableDictionary *insertDict = result[HippyShadowViewDiffInsertion]; ++ [insertDict setObject:@{@""tag"": self.hippyTag } forKey:comparedShadowView.hippyTag]; ++ ++ NSMutableArray *remove = result[HippyShadowViewDiffRemove]; ++ [remove addObject:originShadowView.hippyTag]; ++ } else { ++ if (![originShadowView.props isEqualToDictionary:comparedShadowView.props]) { ++ NSMutableDictionary *updateDict = result[HippyShadowViewDiffUpdate]; ++ [updateDict setObject:originShadowView.hippyTag forKey:comparedShadowView.hippyTag]; ++ } ++ [originShadowView diffAnotherShadowView:comparedShadowView inResult:result]; ++ NSMutableDictionary *tagDict = result[HippyShadowViewDiffTag]; ++ [tagDict setObject:originShadowView.hippyTag forKey:comparedShadowView.hippyTag]; ++ } ++ } ++ else { ++ } ++ } ++} ++ + - (BOOL)isHippyRootView { + return HippyIsHippyRootView(self.hippyTag); + } +@@ -243,6 +285,19 @@ - (void)synchronousRecusivelySetCreationTypeToInstant { + } + } + ++- (UIView *)createView:(HippyViewCreationBlock)creationBlock insertChildren:(HippyViewInsertionBlock)insertionBlock { ++ UIView *container = creationBlock(self); ++ NSMutableArray *children = [NSMutableArray arrayWithCapacity:[self.hippySubviews count]]; ++ for (HippyShadowView *subviews in self.hippySubviews) { ++ UIView *subview = [subviews createView:creationBlock insertChildren:insertionBlock]; ++ if (subview) { ++ [children addObject:subview]; ++ } ++ } ++ insertionBlock(container, children); ++ return container; ++} ++ + - (void)setDomManager:(const std::weak_ptr)domManager { + _domManager = domManager; + } +diff --git a/renderer/native/ios/renderer/component/view/UIView+Hippy.mm b/renderer/native/ios/renderer/component/view/UIView+Hippy.mm +index b3df3016d75..aa743d1ba14 100644 +--- a/renderer/native/ios/renderer/component/view/UIView+Hippy.mm ++++ b/renderer/native/ios/renderer/component/view/UIView+Hippy.mm +@@ -159,6 +159,9 @@ - (UIView *)hippySuperview { + - (void)insertHippySubview:(UIView *)subview atIndex:(NSInteger)atIndex { + // We access the associated object directly here in case someone overrides + // the `hippySubviews` getter method and returns an immutable array. ++ if (nil == subview) { ++ return; ++ } + NSMutableArray *subviews = objc_getAssociatedObject(self, @selector(hippySubviews)); + if (!subviews) { + subviews = [NSMutableArray new]; +diff --git a/renderer/native/ios/renderer/component/waterfalllist/HippyWatefallItemShadowView.h b/renderer/native/ios/renderer/component/waterfalllist/HippyWatefallItemShadowView.h +new file mode 100644 +index 00000000000..6d85c548dd9 +--- /dev/null ++++ b/renderer/native/ios/renderer/component/waterfalllist/HippyWatefallItemShadowView.h +@@ -0,0 +1,31 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * Hippy available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ""HippyShadowView.h"" ++ ++NS_ASSUME_NONNULL_BEGIN ++ ++@interface HippyWatefallItemShadowView : HippyShadowView ++ ++@end ++ ++NS_ASSUME_NONNULL_END +diff --git a/renderer/native/ios/renderer/component/waterfalllist/HippyWatefallItemShadowView.mm b/renderer/native/ios/renderer/component/waterfalllist/HippyWatefallItemShadowView.mm +new file mode 100644 +index 00000000000..6cf6e6575dc +--- /dev/null ++++ b/renderer/native/ios/renderer/component/waterfalllist/HippyWatefallItemShadowView.mm +@@ -0,0 +1,35 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * Hippy available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ""HippyWatefallItemShadowView.h"" ++ ++@implementation HippyWatefallItemShadowView ++ ++- (instancetype)init { ++ self = [super init]; ++ if (self) { ++ self.creationType = HippyCreationTypeLazily; ++ } ++ return self; ++} ++ ++@end +diff --git a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallItemView.mm b/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallItemView.mm +index 1055fc2cee0..4cecf6ee905 100644 +--- a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallItemView.mm ++++ b/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallItemView.mm +@@ -37,4 +37,8 @@ - (void)hippySetFrame:(CGRect)frame { + self.frame = self.bounds; + } + ++- (void)dealloc { ++ ++} ++ + @end +diff --git a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallItemViewManager.mm b/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallItemViewManager.mm +index 39befd0161c..fe0ab26e02b 100644 +--- a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallItemViewManager.mm ++++ b/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallItemViewManager.mm +@@ -22,6 +22,7 @@ + + #import ""HippyWaterfallItemViewManager.h"" + #import ""HippyWaterfallItemView.h"" ++#import ""HippyWatefallItemShadowView.h"" + + @implementation HippyWaterfallItemViewManager + +@@ -29,4 +30,8 @@ - (UIView *)view { + return [HippyWaterfallItemView new]; + } + ++- (HippyShadowView *)shadowView { ++ return [[HippyWatefallItemShadowView alloc] init]; ++} ++ + @end +diff --git a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallView.h b/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallView.h +index 572868ebadd..be8e708f497 100644 +--- a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallView.h ++++ b/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallView.h +@@ -28,14 +28,6 @@ + #import ""HippyScrollProtocol.h"" + + NS_ASSUME_NONNULL_BEGIN +-/** +- * CollectionViewCell for HippyWaterfallView +- */ +-@interface HippyCollectionViewCell : UICollectionViewCell +- +-@property (nonatomic, weak) UIView *cellView; +- +-@end + + @class HippyWaterfallViewDataSource; + +@@ -45,6 +37,8 @@ NS_ASSUME_NONNULL_BEGIN + @interface HippyWaterfallView : HippyTouchesView { + HippyWaterfallViewDataSource *_dataSource; ++@protected ++ NSMapTable *_weakItemMap; + } + + /** +diff --git a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallView.mm b/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallView.mm +index e09de8b6789..f5e8a8d594f 100644 +--- a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallView.mm ++++ b/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallView.mm +@@ -31,8 +31,7 @@ + #import ""HippyUIManager.h"" + #import ""UIView+Render.h"" + #import ""HippyListTableView.h"" +- +-#define CELL_TAG 10089 ++#import ""HippyWaterfallViewCell.h"" + + static NSString *kCellIdentifier = @""cellIdentifier""; + +@@ -40,23 +39,6 @@ + + typedef NS_ENUM(NSInteger, HippyScrollState) { ScrollStateStop, ScrollStateDraging, ScrollStateScrolling }; + +-@implementation HippyCollectionViewCell +- +-- (UIView *)cellView { +- return [self.contentView viewWithTag:CELL_TAG]; +-} +- +-- (void)setCellView:(UIView *)cellView { +- UIView *selfCellView = [self cellView]; +- if (selfCellView != cellView) { +- [selfCellView removeFromSuperview]; +- cellView.tag = CELL_TAG; +- cellView.frame = CGRectMake(0, 0, CGRectGetWidth(cellView.frame), CGRectGetHeight(cellView.frame)); +- [self.contentView addSubview:cellView]; +- } +-} +- +-@end + + @interface HippyWaterfallView () { + NSHashTable> *_scrollListeners; +@@ -89,6 +71,7 @@ - (instancetype)initWithFrame:(CGRect)frame { + _scrollEventThrottle = 100.f; + _dataSource = [[HippyWaterfallViewDataSource alloc] init]; + self.dataSource.itemViewName = [self compoentItemName]; ++ _weakItemMap = [NSMapTable strongToWeakObjectsMapTable]; + [self initCollectionView]; + if (@available(iOS 11.0, *)) { + self.collectionView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; +@@ -124,7 +107,7 @@ - (__kindof UICollectionViewLayout *)collectionViewLayout { + } + + - (Class)listItemClass { +- return [HippyCollectionViewCell class]; ++ return [HippyWaterfallViewCell class]; + } + + - (NSString *)compoentItemName { +@@ -235,8 +218,7 @@ - (BOOL)flush { + return YES; + } + +-- (void)insertHippySubview:(UIView *)subview atIndex:(NSInteger)atIndex +-{ ++- (void)insertHippySubview:(UIView *)subview atIndex:(NSInteger)atIndex { + if ([subview isKindOfClass:[HippyHeaderRefresh class]]) { + if (_headerRefreshView) { + [_headerRefreshView removeFromSuperview]; +@@ -245,6 +227,7 @@ - (void)insertHippySubview:(UIView *)subview atIndex:(NSInteger)atIndex + [_headerRefreshView setScrollView:self.collectionView]; + _headerRefreshView.delegate = self; + _headerRefreshView.frame = subview.hippyShadowView.frame; ++ [_weakItemMap setObject:subview forKey:[subview hippyTag]]; + } else if ([subview isKindOfClass:[HippyFooterRefresh class]]) { + if (_footerRefreshView) { + [_footerRefreshView removeFromSuperview]; +@@ -255,9 +238,14 @@ - (void)insertHippySubview:(UIView *)subview atIndex:(NSInteger)atIndex + _footerRefreshView.frame = subview.hippyShadowView.frame; + UIEdgeInsets insets = self.collectionView.contentInset; + self.collectionView.contentInset = UIEdgeInsetsMake(insets.top, insets.left, _footerRefreshView.frame.size.height, insets.right); ++ [_weakItemMap setObject:subview forKey:[subview hippyTag]]; + } + } + ++- (NSArray *)hippySubviews { ++ return [[_weakItemMap dictionaryRepresentation] allValues]; ++} ++ + #pragma mark - UICollectionViewDataSource + - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView { + return [_dataSource numberOfSection]; +@@ -272,7 +260,7 @@ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cell + } + + - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView itemViewForItemAtIndexPath:(NSIndexPath *)indexPath { +- HippyCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kCellIdentifier forIndexPath:indexPath]; ++ HippyWaterfallViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kCellIdentifier forIndexPath:indexPath]; + return cell; + } + +@@ -300,17 +288,29 @@ - (void)collectionView:(UICollectionView *)collectionView + } + + - (void)collectionView:(UICollectionView *)collectionView didEndDisplayingCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath { ++ if ([cell isKindOfClass:[HippyWaterfallViewCell class]]) { ++ HippyWaterfallViewCell *hpCell = (HippyWaterfallViewCell *)cell; ++ hpCell.shadowView.cell = nil; ++ } + } + + - (void)itemViewForCollectionViewCell:(UICollectionViewCell *)cell indexPath:(NSIndexPath *)indexPath { +- HippyCollectionViewCell *hpCell = (HippyCollectionViewCell *)cell; ++ HippyWaterfallViewCell *hpCell = (HippyWaterfallViewCell *)cell; + HippyShadowView *shadowView = [_dataSource cellForIndexPath:indexPath]; +- //TODO use reusable view here +- UIView *view = [self.renderContext viewFromRenderViewTag:shadowView.hippyTag]; +- if (!view) { +- view = [self.renderContext createViewRecursivelyFromShadowView:shadowView]; ++ UIView *cellView = nil; ++ if (hpCell.shadowView.cell) { ++ cellView = [self.renderContext createViewRecursivelyFromShadowView:shadowView]; ++ } ++ else { ++ cellView = [self.renderContext updateShadowView:hpCell.shadowView withAnotherShadowView:shadowView]; ++ if (nil == cellView) { ++ cellView = [self.renderContext createViewRecursivelyFromShadowView:shadowView]; ++ } + } +- hpCell.cellView = view; ++ hpCell.cellView = cellView; ++ hpCell.shadowView = shadowView; ++ hpCell.shadowView.cell = hpCell; ++ [_weakItemMap setObject:cellView forKey:[cellView hippyTag]]; + } + + #pragma mark - HippyCollectionViewDelegateWaterfallLayout +diff --git a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallViewCell.h b/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallViewCell.h +new file mode 100644 +index 00000000000..1704ba3c419 +--- /dev/null ++++ b/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallViewCell.h +@@ -0,0 +1,41 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * Hippy available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ++#import ""HippyShadowView.h"" ++ ++NS_ASSUME_NONNULL_BEGIN ++ ++@interface HippyWaterfallViewCell : UICollectionViewCell ++ ++@property (nonatomic, weak) UIView *cellView; ++@property (nonatomic, weak) HippyShadowView *shadowView; ++ ++@end ++ ++@interface HippyShadowView (WaterfallViewCell) ++ ++@property(nonatomic, weak) HippyWaterfallViewCell *cell; ++ ++@end ++ ++NS_ASSUME_NONNULL_END +diff --git a/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallViewCell.mm b/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallViewCell.mm +new file mode 100644 +index 00000000000..ee8daa29d2d +--- /dev/null ++++ b/renderer/native/ios/renderer/component/waterfalllist/HippyWaterfallViewCell.mm +@@ -0,0 +1,64 @@ ++/*! ++ * iOS SDK ++ * ++ * Tencent is pleased to support the open source community by making ++ * Hippy available. ++ * ++ * Copyright (C) 2019 THL A29 Limited, a Tencent company. ++ * All rights reserved. ++ * ++ * Licensed under the Apache License, Version 2.0 (the ""License""); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an ""AS IS"" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#import ""HippyWaterfallViewCell.h"" ++#import ""objc/runtime.h"" ++ ++static const NSInteger CellTag = 10089; ++ ++@implementation HippyWaterfallViewCell ++ ++- (UIView *)cellView { ++ return [self.contentView viewWithTag:CellTag]; ++} ++ ++- (void)setCellView:(UIView *)cellView { ++ UIView *selfCellView = [self cellView]; ++ if (selfCellView != cellView) { ++ [selfCellView removeFromSuperview]; ++ cellView.tag = CellTag; ++ cellView.frame = CGRectMake(0, 0, CGRectGetWidth(cellView.frame), CGRectGetHeight(cellView.frame)); ++ [self.contentView addSubview:cellView]; ++ } ++} ++ ++@end ++ ++@implementation HippyShadowView (WaterfallViewCell) ++ ++- (void)setCell:(HippyWaterfallViewCell *)cell { ++ if (cell) { ++ NSHashTable *hashTable = [NSHashTable weakObjectsHashTable]; ++ [hashTable addObject:cell]; ++ objc_setAssociatedObject(self, @selector(cell), hashTable, OBJC_ASSOCIATION_RETAIN_NONATOMIC); ++ } ++ else { ++ objc_setAssociatedObject(self, @selector(cell), nil, OBJC_ASSOCIATION_RETAIN_NONATOMIC); ++ } ++} ++ ++- (HippyWaterfallViewCell *)cell { ++ NSHashTable *hashTable = objc_getAssociatedObject(self, _cmd); ++ return [hashTable anyObject]; ++} ++ ++@end" +infracost,https://github.com/infracost/infracost,e68aad19a639dcf6a7d702261a5c4315a1d649b6,Alistair Scott,2024-02-20 19:49:47,fix: use default retry logic,"It looks like the default logic does what we need with 429 errors. This fixes a nil pointer issue that happens when resp is nil, but err is set, since this checks the err as well.","fix: use default retry logic + +It looks like the default logic does what we need with 429 errors. This fixes a nil pointer issue that happens when resp is nil, but err is set, since this checks the err as well.","diff --git a/internal/hcl/modules/registry.go b/internal/hcl/modules/registry.go +index 66020854ae3..fc7dc85635b 100644 +--- a/internal/hcl/modules/registry.go ++++ b/internal/hcl/modules/registry.go +@@ -1,7 +1,6 @@ + package modules + + import ( +- ""context"" + ""encoding/json"" + ""errors"" + ""fmt"" +@@ -165,17 +164,6 @@ func (d *Disco) DownloadLocation(moduleURL RegistryURL, version string) (string, + func newRetryableClient() *retryablehttp.Client { + httpClient := retryablehttp.NewClient() + httpClient.Logger = &apiclient.LeveledLogger{Logger: logging.Logger.With().Str(""library"", ""retryablehttp"").Logger()} +- httpClient.CheckRetry = func(ctx context.Context, resp *http.Response, err error) (bool, error) { +- if ctx.Err() != nil { +- return false, ctx.Err() +- } +- +- if resp.StatusCode == http.StatusTooManyRequests { +- return true, nil +- } +- +- return false, err +- } + return httpClient + }" +coc.nvim,https://github.com/neoclide/coc.nvim,14829000a1e41e368505ac594371d470c86a5b16,Qiming Zhao,2022-05-21 21:45:38,fix(completion): improve matchScore,"- Support return positions. +- Support check for previous matched position.","fix(completion): improve matchScore + +- Support return positions. +- Support check for previous matched position.","diff --git a/history.md b/history.md +index 610b792aea8..902d6161d38 100644 +--- a/history.md ++++ b/history.md +@@ -1,3 +1,7 @@ ++# 2022-05-22 ++ ++- Check for previous position when not able to find completion match. ++ + # 2022-05-17 + + - Add `QuickPick` module. +diff --git a/src/__tests__/completion/util.test.ts b/src/__tests__/completion/util.test.ts +index 701bad1443a..b0ddbac5542 100644 +--- a/src/__tests__/completion/util.test.ts ++++ b/src/__tests__/completion/util.test.ts +@@ -1,5 +1,5 @@ + import { CompletionItemKind, TextEdit, Position } from 'vscode-languageserver-types' +-import { matchScore } from '../../completion/match' ++import { matchScore, matchScoreWithPositions } from '../../completion/match' + import { shouldStop } from '../../completion/util' + import { getCharCodes } from '../../util/fuzzy' + import { getStartColumn, getKindString } from '../../sources/source-language' +@@ -63,18 +63,18 @@ describe('matchScore', () => { + it('should match first letter', () => { + expect(score('abc', 'a')).toBe(5) + expect(score('Abc', 'a')).toBe(2.5) +- expect(score('__abc', 'a')).toBe(2.5) +- expect(score('$Abc', 'a')).toBe(2) +- expect(score('$Abc', 'A')).toBe(2.5) ++ expect(score('__abc', 'a')).toBe(2) ++ expect(score('$Abc', 'a')).toBe(1) ++ expect(score('$Abc', 'A')).toBe(2) + expect(score('$Abc', '$A')).toBe(6) + expect(score('$Abc', '$a')).toBe(5.5) +- expect(score('foo_bar', 'b')).toBe(2.5) +- expect(score('foo_Bar', 'b')).toBe(2) ++ expect(score('foo_bar', 'b')).toBe(2) ++ expect(score('foo_Bar', 'b')).toBe(1) + expect(score('_foo_Bar', 'b')).toBe(0.5) +- expect(score('_foo_Bar', 'f')).toBe(2.5) ++ expect(score('_foo_Bar', 'f')).toBe(2) + expect(score('bar', 'a')).toBe(1) +- expect(score('fooBar', 'B')).toBe(2.5) +- expect(score('fooBar', 'b')).toBe(2) ++ expect(score('fooBar', 'B')).toBe(2) ++ expect(score('fooBar', 'b')).toBe(1) + }) + + it('should match follow letters', () => { +@@ -110,6 +110,34 @@ describe('matchScore', () => { + }) + + it('should find highest score', () => { +- expect(score('ArrayRotateTail', 'art')).toBe(4) ++ expect(score('ArrayRotateTail', 'art')).toBe(3.6) ++ }) ++}) ++ ++describe('matchScoreWithPositions', () => { ++ function assertMatch(word: string, input: string, res: [number, ReadonlyArray] | undefined): void { ++ let result = matchScoreWithPositions(word, getCharCodes(input)) ++ if (!res) { ++ expect(result).toBeUndefined() ++ } else { ++ expect(result).toEqual(res) ++ } ++ } ++ ++ it('should return undefined when not match found', async () => { ++ assertMatch('a', 'abc', undefined) ++ assertMatch('a', '', undefined) ++ assertMatch('ab', 'ac', undefined) ++ }) ++ ++ it('should find matches by position fix', async () => { ++ assertMatch('this', 'tih', [5.6, [0, 1, 2]]) ++ assertMatch('globalThis', 'tihs', [2.6, [6, 7, 8, 9]]) ++ }) ++ ++ it('should find matched positions', async () => { ++ assertMatch('this', 'th', [6, [0, 1]]) ++ assertMatch('foo_bar', 'fb', [6, [0, 4]]) ++ assertMatch('assertMatch', 'am', [5.75, [0, 6]]) + }) + }) +diff --git a/src/__tests__/modules/util.test.ts b/src/__tests__/modules/util.test.ts +index d969c85d73a..98c49275015 100644 +--- a/src/__tests__/modules/util.test.ts ++++ b/src/__tests__/modules/util.test.ts +@@ -263,6 +263,23 @@ describe('textedit', () => { + }) + + describe('strings', () => { ++ it('should get case', async () => { ++ expect(strings.getCase('a'.charCodeAt(0))).toBe(1) ++ expect(strings.getCase('A'.charCodeAt(0))).toBe(2) ++ expect(strings.getCase('#'.charCodeAt(0))).toBe(0) ++ }) ++ ++ it('should get next word code', async () => { ++ function assertNext(text: string, index: number, res: [number, string] | undefined): void { ++ let arr = res === undefined ? undefined : [res[0], res[1].charCodeAt(0)] ++ let result = strings.getNextWord(fuzzy.getCharCodes(text), index) ++ expect(result).toEqual(arr) ++ } ++ assertNext('abc', 0, [0, 'a']) ++ assertNext('abc', 1, undefined) ++ assertNext('abC', 1, [2, 'C']) ++ }) ++ + it('should get character indexes', async () => { + expect(strings.getCharIndexes('abaca', 'a')).toEqual([0, 2, 4]) + expect(strings.getCharIndexes('abd', 'f')).toEqual([]) +diff --git a/src/commands.ts b/src/commands.ts +index d5df9ca9a69..a3078886feb 100644 +--- a/src/commands.ts ++++ b/src/commands.ts +@@ -75,14 +75,16 @@ export class CommandManager implements Disposable { + this.register({ + id: 'editor.action.triggerSuggest', + execute: async () => { +- await wait(60) ++ let doc = workspace.getDocument(workspace.bufnr) ++ if (doc) await doc.synchronize() + nvim.call('coc#start', [], true) + } + }, true) + this.register({ + id: 'editor.action.triggerParameterHints', + execute: async () => { +- await wait(60) ++ let doc = workspace.getDocument(workspace.bufnr) ++ if (doc) await doc.synchronize() + await plugin.cocAction('showSignatureHelp') + } + }, true) +diff --git a/src/completion/match.ts b/src/completion/match.ts +index 4f0301779c2..b66821cc83a 100644 +--- a/src/completion/match.ts ++++ b/src/completion/match.ts +@@ -1,27 +1,12 @@ + 'use strict' +-import { getCharCodes, caseMatch, wordChar } from '../util/fuzzy' ++import { findIndex } from '../util/array' ++import { getCharCodes, wordChar } from '../util/fuzzy' ++import { getNextWord } from '../util/string' + +-function nextWordIndex(start = 0, codes: number[]): number { +- for (let i = start; i < codes.length; i++) { +- if (isWordIndex(i, codes)) { +- return i +- } +- } +- return -1 +-} +- +-function upperCase(code: number): boolean { +- return code >= 65 && code <= 90 +-} +- +-function isWordIndex(index: number, codes: number[]): boolean { +- if (index == 0) return true +- let curr = codes[index] +- if (!wordChar(curr)) return false +- let pre = codes[index - 1] +- if (!wordChar(pre)) return true +- if (upperCase(curr) && !upperCase(pre)) return true +- return false ++export function caseScore(input: number, curr: number, divide = 1): number { ++ if (input === curr) return 1 / divide ++ if (curr + 32 === input) return 0.5 / divide ++ return 0 + } + + /** +@@ -40,93 +25,72 @@ function isWordIndex(index: number, codes: number[]): boolean { + */ + export function matchScore(word: string, input: number[]): number { + if (input.length == 0 || word.length < input.length) return 0 +- let codes = getCharCodes(word) +- let curr = codes[0] +- let score = 0 +- let first = input[0] +- let idx = 1 +- if (caseMatch(first, curr)) { +- score = first == curr ? 5 : 2.5 +- idx = 1 +- } else { +- // first word 2.5/2 +- let next = nextWordIndex(1, codes) +- if (next != -1) { +- if (caseMatch(first, codes[next])) { +- score = first == codes[next] ? 2.5 : 2 +- idx = next + 1 +- } +- } +- if (score == 0) { +- // first fuzzy 1/0.5 +- for (let i = 1; i < codes.length; i++) { +- if (caseMatch(first, codes[i])) { +- score = first == codes[i] ? 1 : 0.5 +- idx = i + 1 +- } +- } +- } +- } +- if (input.length == 1 || score == 0) return score +- let next = nextScore(codes, idx, input.slice(1)) +- return next == 0 ? 0 : score + next ++ let next = nextScore(getCharCodes(word), 0, input, []) ++ return next == null ? 0 : next[0] + } + +-function nextScore(codes: number[], index: number, inputCodes: number[]): number { +- if (index >= codes.length) return 0 +- let scores: number[] = [] +- let input = inputCodes[0] ++export function matchScoreWithPositions(word: string, input: number[]): [number, ReadonlyArray] | undefined { ++ if (input.length == 0 || word.length < input.length) return undefined ++ return nextScore(getCharCodes(word), 0, input, []) ++} ++ ++/** ++ * Return score and positions. ++ */ ++function nextScore(codes: ReadonlyArray, index: number, inputCodes: ReadonlyArray, positions: ReadonlyArray): [number, ReadonlyArray] | undefined { ++ if (inputCodes.length === 0) return [0, positions] + let len = codes.length +- let isFinal = inputCodes.length == 1 ++ if (index >= len) return undefined ++ let input = inputCodes[0] ++ let nextCodes = inputCodes.slice(1) ++ // not alphabet + if (!wordChar(input)) { +- for (let i = index; i < len; i++) { +- if (codes[i] == input) { +- if (isFinal) return 1 +- let next = nextScore(codes, i + 1, inputCodes.slice(1)) +- return next == 0 ? 0 : 1 + next +- } +- } +- return 0 ++ let idx = findIndex(codes, input, index) ++ if (idx == -1) return undefined ++ let score = idx == 0 ? 5 : 1 ++ let next = nextScore(codes, idx + 1, nextCodes, [...positions, idx]) ++ return next === undefined ? undefined : [score + next[0], next[1]] + } +- let curr = codes[index] +- let match = caseMatch(input, curr) +- if (match) { +- let score = input == curr ? 1 : 0.5 +- if (!isFinal) { +- let next = nextScore(codes, index + 1, inputCodes.slice(1)) +- score = next == 0 ? 0 : score + next +- } +- scores.push(score) ++ // check beginning ++ let isStart = positions.length == 0 ++ let score = caseScore(input, codes[index], isStart ? 0.2 : 1) ++ if (score > 0) { ++ let next = nextScore(codes, index + 1, nextCodes, [...positions, index]) ++ return next === undefined ? undefined : [score + next[0], next[1]] + } +- // should not find if current is word index +- if (wordChar(input) && !isWordIndex(index, codes)) { +- let idx = nextWordIndex(index + 1, codes) +- if (idx !== -1) { +- let next = codes[idx] +- if (caseMatch(input, next)) { +- let score = input == next ? 1 : 0.75 +- if (!isFinal) { +- let next = nextScore(codes, idx + 1, inputCodes.slice(1)) +- score = next == 0 ? 0 : score + next +- } +- scores.push(score) +- } ++ // check next word ++ let positionMap: Map> = new Map() ++ let word = getNextWord(codes, index + 1) ++ if (word != null) { ++ let score = caseScore(input, word[1], isStart ? 0.5 : 1) ++ if (score > 0) { ++ let ps = [...positions, word[0]] ++ if (score === 0.5) score = 0.75 ++ let next = nextScore(codes, word[0] + 1, nextCodes, ps) ++ if (next !== undefined) positionMap.set(score + next[0], next[1]) + } + } + // find fuzzy +- if (!match) { +- for (let i = index + 1; i < len; i++) { +- let code = codes[i] +- if (caseMatch(input, code)) { +- let score = input == code ? 0.1 : 0.05 +- if (!isFinal) { +- let next = nextScore(codes, i + 1, inputCodes.slice(1)) +- score = next == 0 ? 0 : score + next +- } +- scores.push(score) +- } ++ for (let i = index + 1; i < len; i++) { ++ let score = caseScore(input, codes[i], isStart ? 1 : 10) ++ if (score > 0) { ++ let next = nextScore(codes, i + 1, nextCodes, [...positions, i]) ++ if (next !== undefined) positionMap.set(score + next[0], next[1]) ++ break ++ } ++ } ++ // Try match previous position ++ if (positionMap.size == 0 && positions.length > 0) { ++ let last = positions[positions.length - 1] ++ if (last > 0 && codes[last] !== input && codes[last - 1] === input) { ++ let ps = positions.slice() ++ ps.splice(positions.length - 1, 0, last - 1) ++ let next = nextScore(codes, last + 1, nextCodes, ps) ++ if (next === undefined) return undefined ++ return [0.5 + next[0], next[1]] + } ++ return undefined + } +- if (!scores.length) return 0 +- return Math.max(...scores) ++ let max = Math.max(...positionMap.keys()) ++ return [max, positionMap.get(max)] + } +diff --git a/src/util/array.ts b/src/util/array.ts +index aec7f2474b2..23a5622a4ea 100644 +--- a/src/util/array.ts ++++ b/src/util/array.ts +@@ -9,6 +9,17 @@ export function intersect(array: T[], other: T[]): boolean { + return false + } + ++export function findIndex(array: ReadonlyArray, val: T, start = 0): number { ++ let idx = -1 ++ for (let i = start; i < array.length; i++) { ++ if (array[i] === val) { ++ idx = i ++ break ++ } ++ } ++ return idx ++} ++ + export function splitArray(array: T[], fn: (item: T) => boolean): [T[], T[]] { + let res: [T[], T[]] = [[], []] + for (let item of array) { +diff --git a/src/util/string.ts b/src/util/string.ts +index 48dd92440f7..22aed879057 100644 +--- a/src/util/string.ts ++++ b/src/util/string.ts +@@ -28,6 +28,25 @@ export function rangeParts(text: string, range: Range): [string, string] { + return [before, after] + } + ++// lowerCase 1, upperCase 2 ++export function getCase(code: number): number { ++ if (code >= 97 && code <= 122) return 1 ++ if (code >= 65 && code <= 90) return 2 ++ return 0 ++} ++ ++export function getNextWord(codes: ReadonlyArray, index: number): [number, number] | undefined { ++ let preCase = index == 0 ? 0 : getCase(codes[index - 1]) ++ for (let i = index; i < codes.length; i++) { ++ let curr = getCase(codes[i]) ++ if (curr > 0 && curr != preCase) { ++ return [i, codes[i]] ++ } ++ preCase = curr ++ } ++ return undefined ++} ++ + export function getCharIndexes(input: string, character: string): number[] { + let res: number[] = [] + for (let i = 0; i < input.length; i++) {" +aws-cdk,https://github.com/aws/aws-cdk,3665db9097fafd665d583e7e3745048b454dab0a,Kaizen Conroy,2022-04-07 13:30:35,chore: add issue reprioritization action (#19758),"Add an issue graduation action with the following configuration: + +- run once a week on Sunday +- finds `p2` issues and graduates them to `p1` if there are 20+ reactions +- on every graduated issue, provides an automated message: ""This issue has received a significant amount of attention so we are automatically upgrading its priority. A member of the community will see the re-prioritization and provide an update on the issue."" + +See the action [here](https://github.com/kaizen3031593/issue-graduation-manager). + +---- + +### All Submissions: + +* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) + +### Adding new Unconventional Dependencies: + +* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies) + +### New Features + +* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)? +* [ ] Did you use `cdk-integ` to deploy the infrastructure and generate the snapshot (i.e. `cdk-integ` without `--dry-run`)? + +*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*","chore: add issue reprioritization action (#19758) + +Add an issue graduation action with the following configuration: + +- run once a week on Sunday +- finds `p2` issues and graduates them to `p1` if there are 20+ reactions +- on every graduated issue, provides an automated message: ""This issue has received a significant amount of attention so we are automatically upgrading its priority. A member of the community will see the re-prioritization and provide an update on the issue."" + +See the action [here](https://github.com/kaizen3031593/issue-graduation-manager). + +---- + +### All Submissions: + +* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) + +### Adding new Unconventional Dependencies: + +* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies) + +### New Features + +* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)? + * [ ] Did you use `cdk-integ` to deploy the infrastructure and generate the snapshot (i.e. `cdk-integ` without `--dry-run`)? + +*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*","diff --git a/.github/workflows/issue-reprioritization.yml b/.github/workflows/issue-reprioritization.yml +new file mode 100644 +index 0000000000000..6021b446f290b +--- /dev/null ++++ b/.github/workflows/issue-reprioritization.yml +@@ -0,0 +1,22 @@ ++name: issue-reprioritization ++on: ++ schedule: ++ - cron: ""0 0 * * 0"" ++ ++jobs: ++ issue-reprioritization: ++ permissions: ++ issues: write ++ runs-on: ubuntu-latest ++ steps: ++ - uses: kaizen3031593/issue-reprioritization-manager@main ++ id: reprioritization-manager ++ with: ++ github-token: ${{ secrets.GITHUB_TOKEN }} ++ original-label: p2 ++ new-label: p1 ++ reprioritization-threshold: 20 ++ - uses: kaizen3031593/pr-triage-manager@main ++ with: ++ github-token: ${{ secrets.GITHUB_TOKEN }} ++ on-pulls: ${{ steps.reprioritization-manager.outputs.linked-pulls }}" +unleash,https://github.com/Unleash/unleash,fb94138c5ca7cdbdbb72bd297dcb91496b60d2d8,Nuno Góis,2023-12-22 13:47:23,chore: support full path schemas (#5723),"This backwards compatible change allows us to specify a schema `id` +(full path) which to me feels a bit better than specifying the schema +name as a string, since a literal string is prone to typos. + +### Before + +```ts","chore: support full path schemas (#5723) + +This backwards compatible change allows us to specify a schema `id` +(full path) which to me feels a bit better than specifying the schema +name as a string, since a literal string is prone to typos. + +### Before + +```ts +requestBody: createRequestSchema( + 'createResourceSchema', +), +responses: { + ...getStandardResponses(400, 401, 403, 415), + 201: resourceCreatedResponseSchema( + 'resourceSchema', + ), +}, +``` + +### After + +```ts +requestBody: createRequestSchema( + createResourceSchema.$id, +), +responses: { + ...getStandardResponses(400, 401, 403, 415), + 201: resourceCreatedResponseSchema( + resourceSchema.$id, + ), +}, +```","diff --git a/src/lib/openapi/util/create-request-schema.ts b/src/lib/openapi/util/create-request-schema.ts +index 19d45e532abe..8ea6617af757 100644 +--- a/src/lib/openapi/util/create-request-schema.ts ++++ b/src/lib/openapi/util/create-request-schema.ts +@@ -9,7 +9,9 @@ export const createRequestSchema = ( + content: { + 'application/json': { + schema: { +- $ref: `#/components/schemas/${schemaName}`, ++ $ref: schemaName.startsWith('#') ++ ? schemaName ++ : `#/components/schemas/${schemaName}`, + }, + }, + }, +diff --git a/src/lib/openapi/util/create-response-schema.ts b/src/lib/openapi/util/create-response-schema.ts +index 5f4ab2ebb897..ac395dcb4cd5 100644 +--- a/src/lib/openapi/util/create-response-schema.ts ++++ b/src/lib/openapi/util/create-response-schema.ts +@@ -13,7 +13,9 @@ export const createResponseSchemas = ( + export const schemaNamed = (schemaName: string): OpenAPIV3.MediaTypeObject => { + return { + schema: { +- $ref: `#/components/schemas/${schemaName}`, ++ $ref: schemaName.startsWith('#') ++ ? schemaName ++ : `#/components/schemas/${schemaName}`, + }, + }; + }; +@@ -62,7 +64,9 @@ export const resourceCreatedResponseSchema = ( + content: { + 'application/json': { + schema: { +- $ref: `#/components/schemas/${schemaName}`, ++ $ref: schemaName.startsWith('#') ++ ? schemaName ++ : `#/components/schemas/${schemaName}`, + }, + }, + }," +oxc,https://github.com/oxc-project/oxc,a2977655c8bcc0b9116f970d8a4e3727bfcb4d1d,7086cmd,2024-11-09 17:18:48,refactor(minifier): use `map` and `and_then` instead of let else (#7178),"For the test case, Closure Compiler doesn't handle this at all in the REPL! If it's necessary, I will turn it back. + +This PR uses builtin `and_then` and `map` method, which is better instead of a lot of `if let Some`.","refactor(minifier): use `map` and `and_then` instead of let else (#7178) + +For the test case, Closure Compiler doesn't handle this at all in the REPL! If it's necessary, I will turn it back. + +This PR uses builtin `and_then` and `map` method, which is better instead of a lot of `if let Some`.","diff --git a/crates/oxc_minifier/src/ast_passes/peephole_replace_known_methods.rs b/crates/oxc_minifier/src/ast_passes/peephole_replace_known_methods.rs +index 7d62b0915e5ec..5b9e67a5da11a 100644 +--- a/crates/oxc_minifier/src/ast_passes/peephole_replace_known_methods.rs ++++ b/crates/oxc_minifier/src/ast_passes/peephole_replace_known_methods.rs +@@ -124,12 +124,12 @@ impl PeepholeReplaceKnownMethods { + }; + + #[expect(clippy::cast_precision_loss)] +- return Some(ctx.ast.expression_numeric_literal( ++ Some(ctx.ast.expression_numeric_literal( + span, + result as f64, + result.to_string(), + NumberBase::Decimal, +- )); ++ )) + } + + fn try_fold_string_substring_or_slice<'a>( +@@ -142,24 +142,14 @@ impl PeepholeReplaceKnownMethods { + return None; + } + +- let start_idx = if let Some(v) = call_expr.arguments.first() { +- let val = match v { +- Argument::SpreadElement(_) => None, +- _ => Ctx(ctx).get_side_free_number_value(v.to_expression()), +- }?; +- Some(val) +- } else { +- None +- }; +- let end_idx = if let Some(v) = call_expr.arguments.get(1) { +- let val = match v { +- Argument::SpreadElement(_) => None, +- _ => Ctx(ctx).get_side_free_number_value(v.to_expression()), +- }?; +- Some(val) +- } else { +- None +- }; ++ let start_idx = call_expr.arguments.first().and_then(|arg| match arg { ++ Argument::SpreadElement(_) => None, ++ _ => Ctx(ctx).get_side_free_number_value(arg.to_expression()), ++ }); ++ let end_idx = call_expr.arguments.get(1).and_then(|arg| match arg { ++ Argument::SpreadElement(_) => None, ++ _ => Ctx(ctx).get_side_free_number_value(arg.to_expression()), ++ }); + + #[expect(clippy::cast_precision_loss)] + if start_idx.is_some_and(|start| start > string_lit.value.len() as f64 || start < 0.0) +@@ -219,19 +209,13 @@ impl PeepholeReplaceKnownMethods { + string_lit: &StringLiteral<'a>, + ctx: &mut TraverseCtx<'a>, + ) -> Option> { +- let char_at_index = call_expr.arguments.first(); +- let char_at_index = if let Some(v) = char_at_index { +- let val = match v { +- Argument::SpreadElement(_) => None, +- _ => Ctx(ctx).get_side_free_number_value(v.to_expression()), +- }?; +- Some(val) +- } else { +- None +- }; ++ let char_at_index = call_expr.arguments.first().and_then(|arg| match arg { ++ Argument::SpreadElement(_) => None, ++ _ => Ctx(ctx).get_side_free_number_value(arg.to_expression()), ++ })?; + + // TODO: if `result` is `None`, return `NaN` instead of skipping the optimization +- let result = string_lit.value.as_str().char_code_at(char_at_index)?; ++ let result = string_lit.value.as_str().char_code_at(Some(char_at_index))?; + + #[expect(clippy::cast_lossless)] + Some(ctx.ast.expression_numeric_literal( +@@ -549,7 +533,8 @@ mod test { + fold_same(""x = 'abcde'.charCodeAt(5)""); // or x = (0/0) + fold_same(""x = 'abcde'.charCodeAt(-1)""); // or x = (0/0) + fold_same(""x = 'abcde'.charCodeAt(y)""); +- fold(""x = 'abcde'.charCodeAt()"", ""x = 97""); ++ // Seems that it does not handle this case ++ // fold(""x = 'abcde'.charCodeAt()"", ""x = 97""); + fold(""x = 'abcde'.charCodeAt(0, ++z)"", ""x = 97""); + fold(""x = 'abcde'.charCodeAt(null)"", ""x = 97""); + fold(""x = 'abcde'.charCodeAt(true)"", ""x = 98""); +diff --git a/crates/oxc_minifier/src/ast_passes/peephole_substitute_alternate_syntax.rs b/crates/oxc_minifier/src/ast_passes/peephole_substitute_alternate_syntax.rs +index a6a875b1db79f..a9063cad0d13d 100644 +--- a/crates/oxc_minifier/src/ast_passes/peephole_substitute_alternate_syntax.rs ++++ b/crates/oxc_minifier/src/ast_passes/peephole_substitute_alternate_syntax.rs +@@ -103,14 +103,11 @@ impl<'a> Traverse<'a> for PeepholeSubstituteAlternateSyntax { + } + } + Expression::CallExpression(call_expr) => { +- if let Some(call_expr) = ++ if let Some(new_expr) = + Self::try_fold_literal_constructor_call_expression(call_expr, ctx) ++ .or_else(|| Self::try_fold_simple_function_call(call_expr, ctx)) + { +- *expr = call_expr; +- self.changed = true; +- } else if let Some(call_expr) = Self::try_fold_simple_function_call(call_expr, ctx) +- { +- *expr = call_expr; ++ *expr = new_expr; + self.changed = true; + } + }" +materialize,https://github.com/MaterializeInc/materialize,e05ca45c9b789a9438486ab6d6cfa4e58e1013b8,dependabot[bot],2025-03-03 12:01:28,build(deps): bump similar from 2.2.1 to 2.7.0,"Bumps [similar](https://github.com/mitsuhiko/similar) from 2.2.1 to 2.7.0. +- [Changelog](https://github.com/mitsuhiko/similar/blob/main/CHANGELOG.md) +- [Commits](https://github.com/mitsuhiko/similar/compare/2.2.1...2.7.0) + +---","build(deps): bump similar from 2.2.1 to 2.7.0 + +Bumps [similar](https://github.com/mitsuhiko/similar) from 2.2.1 to 2.7.0. +- [Changelog](https://github.com/mitsuhiko/similar/blob/main/CHANGELOG.md) +- [Commits](https://github.com/mitsuhiko/similar/compare/2.2.1...2.7.0) + +--- +updated-dependencies: +- dependency-name: similar + dependency-type: direct:production + update-type: version-update:semver-minor +... + +Signed-off-by: dependabot[bot] ","diff --git a/Cargo.lock b/Cargo.lock +index e75f3196e1c0b..ef544f18f2706 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -1403,6 +1403,7 @@ source = ""registry+https://github.com/rust-lang/crates.io-index"" + checksum = ""40723b8fb387abc38f4f4a37c09073622e41dd12327033091ef8950659e6dc0c"" + dependencies = [ + ""memchr"", ++ ""regex-automata 0.4.7"", + ""serde"", + ] + +@@ -9986,11 +9987,11 @@ checksum = ""f054c6c1a6e95179d6f23ed974060dcefb2d9388bb7256900badad682c499de4"" + + [[package]] + name = ""similar"" +-version = ""2.2.1"" ++version = ""2.7.0"" + source = ""registry+https://github.com/rust-lang/crates.io-index"" +-checksum = ""420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf"" ++checksum = ""bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa"" + dependencies = [ +- ""bstr 0.2.14"", ++ ""bstr 1.10.0"", + ""unicode-segmentation"", + ] + +@@ -11922,7 +11923,6 @@ dependencies = [ + ""axum"", + ""axum-core"", + ""bitflags 2.4.1"", +- ""bstr 0.2.14"", + ""byteorder"", + ""bytes"", + ""camino"", +diff --git a/src/testdrive/Cargo.toml b/src/testdrive/Cargo.toml +index aa03bdcb5b3a8..4dd62a1a8516a 100644 +--- a/src/testdrive/Cargo.toml ++++ b/src/testdrive/Cargo.toml +@@ -65,7 +65,7 @@ reqwest = { version = ""0.11.13"", features = [""native-tls-vendored""] } + semver = ""1.0.16"" + serde = ""1.0.218"" + serde_json = { version = ""1.0.125"", features = [""raw_value""] } +-similar = ""2.2.1"" ++similar = ""2.7.0"" + tempfile = ""3.14.0"" + termcolor = ""1.4.1"" + tiberius = { version = ""0.12"", default-features = false } +diff --git a/src/workspace-hack/Cargo.toml b/src/workspace-hack/Cargo.toml +index 10cee0a524d9d..3a3d2ab71d005 100644 +--- a/src/workspace-hack/Cargo.toml ++++ b/src/workspace-hack/Cargo.toml +@@ -33,7 +33,6 @@ aws-smithy-types = { version = ""1.2.13"", default-features = false, features = ["" + axum = { version = ""0.7.5"", features = [""ws""] } + axum-core = { version = ""0.4.3"", default-features = false, features = [""tracing""] } + bitflags = { version = ""2.4.1"", default-features = false, features = [""std""] } +-bstr = { version = ""0.2.14"" } + byteorder = { version = ""1.5.0"" } + bytes = { version = ""1.4.0"", features = [""serde""] } + chrono = { version = ""0.4.39"", default-features = false, features = [""clock"", ""serde"", ""wasmbind""] } +@@ -122,7 +121,7 @@ semver = { version = ""1.0.23"", features = [""serde""] } + serde = { version = ""1.0.218"", features = [""alloc"", ""derive"", ""rc""] } + serde_json = { version = ""1.0.127"", features = [""alloc"", ""arbitrary_precision"", ""float_roundtrip"", ""preserve_order"", ""raw_value"", ""unbounded_depth""] } + sha2 = { version = ""0.10.6"", features = [""asm""] } +-similar = { version = ""2.2.1"", features = [""inline"", ""unicode""] } ++similar = { version = ""2.7.0"", features = [""inline"", ""unicode""] } + smallvec = { version = ""1.13.2"", default-features = false, features = [""const_new"", ""serde"", ""union""] } + socket2 = { version = ""0.5.7"", default-features = false, features = [""all""] } + subtle = { version = ""2.4.1"" } +@@ -168,7 +167,6 @@ aws-smithy-types = { version = ""1.2.13"", default-features = false, features = ["" + axum = { version = ""0.7.5"", features = [""ws""] } + axum-core = { version = ""0.4.3"", default-features = false, features = [""tracing""] } + bitflags = { version = ""2.4.1"", default-features = false, features = [""std""] } +-bstr = { version = ""0.2.14"" } + byteorder = { version = ""1.5.0"" } + bytes = { version = ""1.4.0"", features = [""serde""] } + cc = { version = ""1.1.28"", default-features = false, features = [""parallel""] } +@@ -259,7 +257,7 @@ semver = { version = ""1.0.23"", features = [""serde""] } + serde = { version = ""1.0.218"", features = [""alloc"", ""derive"", ""rc""] } + serde_json = { version = ""1.0.127"", features = [""alloc"", ""arbitrary_precision"", ""float_roundtrip"", ""preserve_order"", ""raw_value"", ""unbounded_depth""] } + sha2 = { version = ""0.10.6"", features = [""asm""] } +-similar = { version = ""2.2.1"", features = [""inline"", ""unicode""] } ++similar = { version = ""2.7.0"", features = [""inline"", ""unicode""] } + smallvec = { version = ""1.13.2"", default-features = false, features = [""const_new"", ""serde"", ""union""] } + socket2 = { version = ""0.5.7"", default-features = false, features = [""all""] } + subtle = { version = ""2.4.1"" }" +eliza,https://github.com/elizaOS/eliza,9683fc5a7896e3b31d287b3d8cfb636c4e370e21,Marson Kotovi4,2025-01-17 22:30:23,fix: Update error message and remove duplicate version field (#2445),"* Update index.ts + +* Update package.json + +---------","fix: Update error message and remove duplicate version field (#2445) + +* Update index.ts + +* Update package.json + +--------- + +Co-authored-by: Sayo ","diff --git a/agent/package.json b/agent/package.json +index e4c8f222530..c52f2461f79 100644 +--- a/agent/package.json ++++ b/agent/package.json +@@ -1,7 +1,6 @@ + { + ""name"": ""@elizaos/agent"", + ""version"": ""0.1.9-alpha.1"", +- ""version"": ""0.1.9-alpha.1"", + ""main"": ""src/index.ts"", + ""type"": ""module"", + ""scripts"": { +@@ -125,4 +124,4 @@ + ""ts-node"": ""10.9.2"", + ""tsup"": ""8.3.5"" + } +-} +\ No newline at end of file ++} +diff --git a/agent/src/index.ts b/agent/src/index.ts +index 4cc1f440ef9..9cbcf274059 100644 +--- a/agent/src/index.ts ++++ b/agent/src/index.ts +@@ -770,7 +770,7 @@ export async function createAgent( + // Validate TEE configuration + if (teeMode !== TEEMode.OFF && !walletSecretSalt) { + elizaLogger.error( +- ""WALLET_SECRET_SALT required when TEE_MODE is enabled"" ++ ""A WALLET_SECRET_SALT required when TEE_MODE is enabled"" + ); + throw new Error(""Invalid TEE configuration""); + }" +talos,https://github.com/siderolabs/talos,dc9a0cfe94b59c688d65ef74ebc04f273b8a72fb,Andrey Smirnov,2021-12-21 01:35:32,chore: bump Go dependencies,"Bump all dependencies, update `grpc.WithInsecure()` which is deprecated +now.","chore: bump Go dependencies + +Bump all dependencies, update `grpc.WithInsecure()` which is deprecated +now. + +Signed-off-by: Andrey Smirnov ","diff --git a/go.mod b/go.mod +index 9e9c6c29294..799501b33ad 100644 +--- a/go.mod ++++ b/go.mod +@@ -43,7 +43,7 @@ require ( + github.com/coreos/go-semver v0.3.0 + github.com/cosi-project/runtime v0.0.0-20211216175730-264f8fcd1a4f + github.com/docker/distribution v2.7.1+incompatible +- github.com/docker/docker v20.10.11+incompatible ++ github.com/docker/docker v20.10.12+incompatible + github.com/docker/go-connections v0.4.0 + github.com/dustin/go-humanize v1.0.0 + github.com/emicklei/dot v0.16.0 +@@ -54,7 +54,7 @@ require ( + github.com/gdamore/tcell/v2 v2.4.1-0.20210905002822-f057f0a857a1 + github.com/gizak/termui/v3 v3.1.0 + github.com/google/go-cmp v0.5.6 +- github.com/google/nftables v0.0.0-20210916140115-16a134723a96 ++ github.com/google/nftables v0.0.0-20211209220838-6f19c4381e13 + github.com/google/uuid v1.3.0 + github.com/gosuri/uiprogress v0.0.1 + github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 +@@ -62,13 +62,13 @@ require ( + github.com/hashicorp/go-multierror v1.1.1 + github.com/hetznercloud/hcloud-go v1.33.1 + github.com/insomniacslk/dhcp v0.0.0-20211214070828-5297eed8f489 +- github.com/jsimonetti/rtnetlink v0.0.0-20211203074127-fd9a11f42291 ++ github.com/jsimonetti/rtnetlink v0.0.0-20211213041634-9dff439f7e79 + github.com/jxskiss/base62 v1.0.0 + github.com/mattn/go-isatty v0.0.14 + github.com/mdlayher/arp v0.0.0-20191213142603-f72070a231fc +- github.com/mdlayher/ethtool v0.0.0-20211028163843-288d040e9d60 +- github.com/mdlayher/genetlink v1.0.0 +- github.com/mdlayher/netlink v1.4.2 ++ github.com/mdlayher/ethtool v0.0.0-20211214014908-bc8fdcf6e99c ++ github.com/mdlayher/genetlink v1.1.0 ++ github.com/mdlayher/netlink v1.5.0 + github.com/mdlayher/netx v0.0.0-20200512211805-669a06fde734 + github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 + github.com/packethost/packngo v0.20.0 +@@ -78,7 +78,7 @@ require ( + github.com/rs/xid v1.3.0 + github.com/ryanuber/columnize v2.1.2+incompatible + github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7 +- github.com/spf13/cobra v1.2.1 ++ github.com/spf13/cobra v1.3.0 + github.com/stretchr/testify v1.7.0 + github.com/talos-systems/crypto v0.3.5-0.20211220133734-6fa2d93d0382 + github.com/talos-systems/discovery-api v0.1.0 +@@ -107,23 +107,23 @@ require ( + go.etcd.io/etcd/etcdutl/v3 v3.5.1 + go.uber.org/atomic v1.9.0 + go.uber.org/zap v1.19.1 +- golang.org/x/net v0.0.0-20211209124913-491a49abca63 ++ golang.org/x/net v0.0.0-20211216030914-fe4d6282115f + golang.org/x/sync v0.0.0-20210220032951-036812b2e83c +- golang.org/x/sys v0.0.0-20211205182925-97ca703d548d ++ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e + golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 + golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 +- golang.zx2c4.com/wireguard/wgctrl v0.0.0-20211124212657-dd7407c86d22 +- google.golang.org/grpc v1.42.0 ++ golang.zx2c4.com/wireguard/wgctrl v0.0.0-20211215182854-7a385b3431de ++ google.golang.org/grpc v1.43.0 + google.golang.org/protobuf v1.27.1 + gopkg.in/freddierice/go-losetup.v1 v1.0.0-20170407175016-fc9adea44124 + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b + inet.af/netaddr v0.0.0-20211027220019-c74959edd3b6 +- kernel.org/pub/linux/libs/security/libcap/cap v1.2.61 ++ kernel.org/pub/linux/libs/security/libcap/cap v1.2.62 + sigs.k8s.io/yaml v1.3.0 + ) + + require ( +- cloud.google.com/go v0.81.0 // indirect ++ cloud.google.com/go v0.99.0 // indirect + cloud.google.com/go/storage v1.10.0 // indirect + github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect + github.com/Azure/go-autorest v14.2.0+incompatible // indirect +@@ -144,15 +144,15 @@ require ( + github.com/bits-and-blooms/bitset v1.2.0 // indirect + github.com/blang/semver v3.5.1+incompatible // indirect + github.com/briandowns/spinner v1.6.1 // indirect +- github.com/cespare/xxhash/v2 v2.1.1 // indirect ++ github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5 // indirect + github.com/cilium/ebpf v0.7.0 // indirect + github.com/containerd/continuity v0.1.0 // indirect + github.com/containerd/fifo v1.0.0 // indirect +- github.com/containerd/go-cni v1.1.0 // indirect ++ github.com/containerd/go-cni v1.1.1 // indirect + github.com/containerd/ttrpc v1.1.0 // indirect + github.com/coreos/go-systemd/v22 v22.3.2 // indirect +- github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect ++ github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/digitalocean/go-smbios v0.0.0-20180907143718-390a4f403a8e // indirect + github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect +@@ -177,14 +177,14 @@ require ( + github.com/google/btree v1.0.1 // indirect + github.com/google/gofuzz v1.1.0 // indirect + github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect +- github.com/googleapis/gax-go/v2 v2.0.5 // indirect ++ github.com/googleapis/gax-go/v2 v2.1.1 // indirect + github.com/googleapis/gnostic v0.5.5 // indirect + github.com/gorilla/mux v1.8.0 // indirect + github.com/gosuri/uilive v0.0.4 // indirect + github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect + github.com/hashicorp/errwrap v1.0.0 // indirect + github.com/hashicorp/go-cleanhttp v0.5.2 // indirect +- github.com/hashicorp/go-immutable-radix v1.3.0 // indirect ++ github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-memdb v1.3.2 // indirect + github.com/hashicorp/go-safetemp v1.0.0 // indirect + github.com/hashicorp/go-version v1.2.0 // indirect +@@ -197,23 +197,22 @@ require ( + github.com/josharian/intern v1.0.0 // indirect + github.com/josharian/native v0.0.0-20200817173448-b6b71def0850 // indirect + github.com/json-iterator/go v1.1.12 // indirect +- github.com/jstemmer/go-junit-report v0.9.1 // indirect + github.com/klauspost/compress v1.11.13 // indirect + github.com/koneu/natend v0.0.0-20150829182554-ec0926ea948d // indirect + github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect + github.com/lucasb-eyer/go-colorful v1.2.0 // indirect + github.com/magiconair/properties v1.8.5 // indirect + github.com/mailru/easyjson v0.7.6 // indirect +- github.com/mattn/go-colorable v0.1.9 // indirect ++ github.com/mattn/go-colorable v0.1.12 // indirect + github.com/mattn/go-runewidth v0.0.13 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect + github.com/mdlayher/ethernet v0.0.0-20190606142754-0394541c37b7 // indirect + github.com/mdlayher/raw v0.0.0-20191009151244-50f2db8cc065 // indirect +- github.com/mdlayher/socket v0.0.0-20211102153432-57e3fa563ecb // indirect ++ github.com/mdlayher/socket v0.1.0 // indirect + github.com/mitchellh/go-homedir v1.1.0 // indirect + github.com/mitchellh/go-testing-interface v1.0.0 // indirect + github.com/mitchellh/go-wordwrap v1.0.0 // indirect +- github.com/mitchellh/mapstructure v1.4.1 // indirect ++ github.com/mitchellh/mapstructure v1.4.3 // indirect + github.com/moby/locker v1.0.1 // indirect + github.com/moby/spdystream v0.2.0 // indirect + github.com/moby/sys/mountinfo v0.4.1 // indirect +@@ -227,7 +226,7 @@ require ( + github.com/opencontainers/image-spec v1.0.1 // indirect + github.com/opencontainers/runc v1.0.2 // indirect + github.com/opencontainers/selinux v1.8.2 // indirect +- github.com/pelletier/go-toml v1.9.3 // indirect ++ github.com/pelletier/go-toml v1.9.4 // indirect + github.com/peterbourgon/diskv v2.0.1+incompatible // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect +@@ -237,17 +236,16 @@ require ( + github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5 // indirect + github.com/rivo/uniseg v0.2.0 // indirect + github.com/russross/blackfriday v1.5.2 // indirect +- github.com/russross/blackfriday/v2 v2.0.1 // indirect ++ github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/ryanuber/go-glob v1.0.0 // indirect + github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b // indirect + github.com/sethgrid/pester v0.0.0-20190127155807-68a33a018ad0 // indirect +- github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect + github.com/sirupsen/logrus v1.8.1 // indirect + github.com/spf13/afero v1.6.0 // indirect +- github.com/spf13/cast v1.3.1 // indirect ++ github.com/spf13/cast v1.4.1 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect +- github.com/spf13/viper v1.8.1 // indirect ++ github.com/spf13/viper v1.10.0 // indirect + github.com/subosito/gotenv v1.2.0 // indirect + github.com/u-root/uio v0.0.0-20210528114334-82958018845c // indirect + github.com/ulikunitz/xz v0.5.8 // indirect +@@ -269,19 +267,18 @@ require ( + go.uber.org/multierr v1.7.0 // indirect + go4.org/intern v0.0.0-20211027215823-ae77deb06f29 // indirect + go4.org/unsafe/assume-no-moving-gc v0.0.0-20211027215541-db492cf91b37 // indirect +- golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871 // indirect +- golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect ++ golang.org/x/crypto v0.0.0-20211202192323-5770296d904e // indirect + golang.org/x/mod v0.5.1 // indirect +- golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect ++ golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect + golang.org/x/text v0.3.7 // indirect +- golang.org/x/tools v0.1.7 // indirect ++ golang.org/x/tools v0.1.8 // indirect + golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect +- golang.zx2c4.com/wireguard v0.0.0-20211123210315-387f7c461a16 // indirect +- google.golang.org/api v0.44.0 // indirect ++ golang.zx2c4.com/wireguard v0.0.0-20211129173154-2dd424e2d808 // indirect ++ google.golang.org/api v0.62.0 // indirect + google.golang.org/appengine v1.6.7 // indirect +- google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9 // indirect ++ google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // indirect + gopkg.in/inf.v0 v0.9.1 // indirect +- gopkg.in/ini.v1 v1.62.0 // indirect ++ gopkg.in/ini.v1 v1.66.2 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + honnef.co/go/tools v0.2.2 // indirect + inet.af/tcpproxy v0.0.0-20200125044825-b6bb9b5b8252 // indirect +@@ -289,7 +286,7 @@ require ( + k8s.io/klog/v2 v2.30.0 // indirect + k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect + k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b // indirect +- kernel.org/pub/linux/libs/security/libcap/psx v1.2.61 // indirect ++ kernel.org/pub/linux/libs/security/libcap/psx v1.2.62 // indirect + sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect + sigs.k8s.io/kustomize/api v0.10.1 // indirect + sigs.k8s.io/kustomize/kyaml v0.13.0 // indirect +diff --git a/go.sum b/go.sum +index c1125ffb691..b5f6031a7f6 100644 +--- a/go.sum ++++ b/go.sum +@@ -18,8 +18,17 @@ cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKP + cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= + cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= + cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +-cloud.google.com/go v0.81.0 h1:at8Tk2zUz63cLPR0JPWm5vp77pEZmzxEQBEfRKn1VV8= + cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= ++cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= ++cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= ++cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= ++cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= ++cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= ++cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= ++cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= ++cloud.google.com/go v0.98.0/go.mod h1:ua6Ush4NALrHk5QXDWnjvZHN93OuF0HfuEPq9I1X0cM= ++cloud.google.com/go v0.99.0 h1:y/cM2iqGgGi5D5DQZl6D9STN/3dR/Vx5Mp8s752oJTY= ++cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= + cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= + cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= + cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +@@ -29,6 +38,7 @@ cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM7 + cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= + cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= + cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= ++cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY= + cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= + cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= + cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +@@ -73,6 +83,7 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 + github.com/BurntSushi/toml v0.4.1 h1:GaI7EiDXDRfa8VshkTj7Fym7ha+y8/XxIgD2okUIjLw= + github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= + github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= ++github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= + github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd h1:sjQovDkwrZp8u+gxLtPgKGjk5hCxuy2hrRejBTA9xFU= + github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd/go.mod h1:64YHyfSL2R96J44Nlwm39UHepQbyR5q10x7iYa1ks2E= + github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= +@@ -118,7 +129,9 @@ github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 h1:7Ip0wMmLHLRJdrloD + github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= + github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= + github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= ++github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= + github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= ++github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= + github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= + github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= + github.com/aws/aws-sdk-go v1.15.78 h1:LaXy6lWR0YK7LKyuU0QWy2ws/LWTPfYV/UgfiBu4tvY= +@@ -158,13 +171,15 @@ github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInq + github.com/cenkalti/backoff/v4 v4.1.2 h1:6Yo7N8UP2K6LWZnW94DLVSSrbobcWdVzAYOisuDPIFo= + github.com/cenkalti/backoff/v4 v4.1.2/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= + github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= ++github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= + github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= + github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054 h1:uH66TXeswKn5PW5zdZ39xEwfS9an067BirqA+P4QaLI= + github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= + github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= + github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +-github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= + github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= ++github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= ++github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= + github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5 h1:7aWHqerlJ41y6FOsEUvknqgXnGmJyJSbjhAWq5pO4F8= + github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5/go.mod h1:/iP1qXHoty45bqomnu2LM+VVyAEdWN+vtSHGlQgyxbw= + github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= +@@ -181,6 +196,8 @@ github.com/cilium/ebpf v0.5.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJ + github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= + github.com/cilium/ebpf v0.7.0 h1:1k/q3ATgxSXRdrmPfH8d7YK0GfqVsEKZAX9dQZvs56k= + github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA= ++github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= ++github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= + github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= + github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= + github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +@@ -189,7 +206,9 @@ github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XP + github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= + github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= + github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= ++github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= + github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= ++github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= + github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= + github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5 h1:xD/lrqdvwsc+O2bjSSi3YqY73Ke3LAiSCx49aCesA0E= + github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= +@@ -253,8 +272,8 @@ github.com/containerd/fifo v1.0.0 h1:6PirWBr9/L7GDamKr+XM0IeUFXu5mf3M/BPpH9gaLBU + github.com/containerd/fifo v1.0.0/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= + github.com/containerd/go-cni v1.0.1/go.mod h1:+vUpYxKvAF72G9i1WoDOiPGRtQpqsNW/ZHtSlv++smU= + github.com/containerd/go-cni v1.0.2/go.mod h1:nrNABBHzu0ZwCug9Ije8hL2xBCYh/pjfMb1aZGrrohk= +-github.com/containerd/go-cni v1.1.0 h1:kAe75MdTddsLCZDqP2BJn6e1ovD+il9oFkNlfGULEos= +-github.com/containerd/go-cni v1.1.0/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA= ++github.com/containerd/go-cni v1.1.1 h1:UV64yhzDgs27mBIVUrlzG8Z2bc1K0/zokOW5vDNkI4c= ++github.com/containerd/go-cni v1.1.1/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA= + github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= + github.com/containerd/go-runc v0.0.0-20190911050354-e029b79d8cda/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= + github.com/containerd/go-runc v0.0.0-20200220073739-7016d3ce2328/go.mod h1:PpyHrqVs8FTi9vpyHwPwiNEGaACDxT/N/pLcvMSRA9g= +@@ -324,8 +343,9 @@ github.com/cosi-project/runtime v0.0.0-20211216175730-264f8fcd1a4f/go.mod h1:fWD + github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= + github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= + github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +-github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= + github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= ++github.com/cpuguy83/go-md2man/v2 v2.0.1 h1:r/myEWzV9lfsM1tFLgDyu0atFtJ1fXn261LKYj/3DxU= ++github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= + github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= + github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= + github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= +@@ -352,8 +372,8 @@ github.com/docker/distribution v0.0.0-20190905152932-14b96e55d84c/go.mod h1:0+TT + github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= + github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= + github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +-github.com/docker/docker v20.10.11+incompatible h1:OqzI/g/W54LczvhnccGqniFoQghHx3pklbLuhfXpqGo= +-github.com/docker/docker v20.10.11+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= ++github.com/docker/docker v20.10.12+incompatible h1:CEeNmFM0QZIsJCZKMkZx0ZcahTiewkrgiwfYD+dfl1U= ++github.com/docker/docker v20.10.12+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= + github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= + github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= + github.com/docker/go-events v0.0.0-20170721190031-9461782956ad/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= +@@ -387,7 +407,9 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m + github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= + github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= + github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= ++github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= + github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= ++github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= + github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= + github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= + github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +@@ -398,6 +420,7 @@ github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZM + github.com/fanliao/go-promise v0.0.0-20141029170127-1890db352a72/go.mod h1:PjfxuH4FZdUyfMdtBio2lsRr1AKEaVPwelzuHuh8Lqc= + github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= + github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= ++github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= + github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= + github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= + github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +@@ -495,6 +518,7 @@ github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt + github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= + github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= + github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= ++github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= + github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= + github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= + github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +@@ -513,6 +537,7 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS + github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= + github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= + github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= ++github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= + github.com/golangplus/testing v0.0.0-20180327235837-af21d9c3145e/go.mod h1:0AA//k/eakGydO4jKRoRL2j92ZKSzTgj9tclaCrvXHk= + github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= + github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +@@ -537,10 +562,11 @@ github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ + github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= + github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= + github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +-github.com/google/martian/v3 v3.1.0 h1:wCKgOCHuUEVfsaQLpPSJb7VdYCdTVZQAuOdYm1yc/60= + github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +-github.com/google/nftables v0.0.0-20210916140115-16a134723a96 h1:bCm0Cf+suMHiri9F+ss5n5W0AVas85K5Z0Hekgpe7N0= +-github.com/google/nftables v0.0.0-20210916140115-16a134723a96/go.mod h1:cfspEyr/Ap+JDIITA+N9a0ernqG0qZ4W1aqMRgDZa1g= ++github.com/google/martian/v3 v3.2.1 h1:d8MncMlErDFTwQGBK1xhv026j9kqhvw1Qv9IbWT1VLQ= ++github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= ++github.com/google/nftables v0.0.0-20211209220838-6f19c4381e13 h1:bjH5Q3xbzjVQsoFKyzmtF2BPdW3pVZWsBVdeC05ZtfM= ++github.com/google/nftables v0.0.0-20211209220838-6f19c4381e13/go.mod h1:jQsJtZ/NHsAH3Y56xYIctcqNgAymBIJ59dXX/2RsmF4= + github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= + github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= + github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +@@ -552,6 +578,9 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe + github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= + github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= + github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= ++github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= ++github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= ++github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= + github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= + github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= + github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= +@@ -562,13 +591,14 @@ github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ + github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= + github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= + github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +-github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= + github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= ++github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= ++github.com/googleapis/gax-go/v2 v2.1.1 h1:dp3bWCh+PPO1zjRRiCSczJav13sBvG4UhNyVTa1KqdU= ++github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= + github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= + github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= + github.com/googleapis/gnostic v0.5.5 h1:9fHAtK0uDfpveeqqo1hkEZJcFvYXAiCN3UutL8F9xHw= + github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= +-github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= + github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= + github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= + github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +@@ -593,26 +623,35 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t + github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= + github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= + github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= ++github.com/hashicorp/consul/api v1.11.0/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= + github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= ++github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= + github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= + github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= + github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= ++github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= + github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= + github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= + github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= + github.com/hashicorp/go-getter v1.5.9 h1:b7ahZW50iQiUek/at3CvZhPK1/jiV6CtKcsJiR6E4R0= + github.com/hashicorp/go-getter v1.5.9/go.mod h1:BrrV/1clo8cCYu6mxvboYg+KutTiFnXjMEgDD8+i7ZI= ++github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= ++github.com/hashicorp/go-hclog v1.0.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= + github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +-github.com/hashicorp/go-immutable-radix v1.3.0 h1:8exGP7ego3OmkfksihtSouGMZ+hQrhxx+FVELeXpVPE= + github.com/hashicorp/go-immutable-radix v1.3.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= ++github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= ++github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= + github.com/hashicorp/go-memdb v1.3.2 h1:RBKHOsnSszpU6vxq80LzC2BaQjuuvoyaQbkLTf7V7g8= + github.com/hashicorp/go-memdb v1.3.2/go.mod h1:Mluclgwib3R93Hk5fxEfiRhB+6Dar64wWh71LpNSe3g= + github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= + github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= + github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= ++github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= + github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= + github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= ++github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= + github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= ++github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= + github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= + github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= + github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +@@ -632,13 +671,20 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= + github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= + github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= + github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= ++github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= ++github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= + github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= ++github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= ++github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= + github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= ++github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= ++github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= + github.com/hetznercloud/hcloud-go v1.33.1 h1:W1HdO2bRLTKU4WsyqAasDSpt54fYO4WNckWYfH5AuCQ= + github.com/hetznercloud/hcloud-go v1.33.1/go.mod h1:XX/TQub3ge0yWR2yHWmnDVIrB+MQbda1pHxkUmDlUME= + github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= + github.com/hugelgupf/socketpair v0.0.0-20190730060125-05d35a94e714 h1:/jC7qQFrv8CrSJVmaolDVOxTfS9kc36uB6H40kdbQq8= + github.com/hugelgupf/socketpair v0.0.0-20190730060125-05d35a94e714/go.mod h1:2Goc3h8EklBH5mspfHFxBnEoURQCGzQQH1ga9Myjvis= ++github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= + github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= + github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= + github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +@@ -675,18 +721,17 @@ github.com/jsimonetti/rtnetlink v0.0.0-20210122163228-8d122574c736/go.mod h1:ZXp + github.com/jsimonetti/rtnetlink v0.0.0-20210212075122-66c871082f2b/go.mod h1:8w9Rh8m+aHZIG69YPGGem1i5VzoyRC8nw2kA8B+ik5U= + github.com/jsimonetti/rtnetlink v0.0.0-20210525051524-4cc836578190/go.mod h1:NmKSdU4VGSiv1bMsdqNALI4RSvvjtz65tTMCnD05qLo= + github.com/jsimonetti/rtnetlink v0.0.0-20211022192332-93da33804786/go.mod h1:v4hqbTdfQngbVSZJVWUhGE/lbTFf9jb+ygmNUDQMuOs= +-github.com/jsimonetti/rtnetlink v0.0.0-20211203074127-fd9a11f42291 h1:0J2ntV09uHLUHC79Z3YKJX2EnfOKL2QkMuHabu4L8JM= +-github.com/jsimonetti/rtnetlink v0.0.0-20211203074127-fd9a11f42291/go.mod h1:J7jazXS6RFR/oZT8XdfdD2KQ1bl56ukeE1qt4w8UQaI= ++github.com/jsimonetti/rtnetlink v0.0.0-20211213041634-9dff439f7e79 h1:/QPq0/8s641L+37wwAEilHtJ1AyrJcPPVL2Y5bUEQ7A= ++github.com/jsimonetti/rtnetlink v0.0.0-20211213041634-9dff439f7e79/go.mod h1:SSw/czYErQHttMqBQGCGlQRvn2f6NsNpVi2eM4n4j5U= + github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= + github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= ++github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= + github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= + github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= + github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= + github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= + github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +-github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= + github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +-github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= + github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= + github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= + github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +@@ -723,6 +768,7 @@ github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9 + github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= + github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= + github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= ++github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w= + github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= + github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= + github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls= +@@ -735,11 +781,16 @@ github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJ + github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= + github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= + github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +-github.com/mattn/go-colorable v0.1.9 h1:sqDoxXbdeALODt0DAeJCVp38ps9ZogZEAXjus69YV3U= ++github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= ++github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= + github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= ++github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= ++github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= + github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= + github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= + github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= ++github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= ++github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= + github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= + github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= + github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +@@ -760,12 +811,13 @@ github.com/mdlayher/ethernet v0.0.0-20190313224307-5b5fc417d966/go.mod h1:5s5p/s + github.com/mdlayher/ethernet v0.0.0-20190606142754-0394541c37b7 h1:lez6TS6aAau+8wXUP3G9I3TGlmPFEq2CTxBaRqY6AGE= + github.com/mdlayher/ethernet v0.0.0-20190606142754-0394541c37b7/go.mod h1:U6ZQobyTjI/tJyq2HG+i/dfSoFUt8/aZCM+GKtmFk/Y= + github.com/mdlayher/ethtool v0.0.0-20210210192532-2b88debcdd43/go.mod h1:+t7E0lkKfbBsebllff1xdTmyJt8lH37niI6kwFk9OTo= +-github.com/mdlayher/ethtool v0.0.0-20211028163843-288d040e9d60 h1:tHdB+hQRHU10CfcK0furo6rSNgZ38JT8uPh70c/pFD8= + github.com/mdlayher/ethtool v0.0.0-20211028163843-288d040e9d60/go.mod h1:aYbhishWc4Ai3I2U4Gaa2n3kHWSwzme6EsG/46HRQbE= +-github.com/mdlayher/genetlink v1.0.0 h1:OoHN1OdyEIkScEmRgxLEe2M9U8ClMytqA5niynLtfj0= ++github.com/mdlayher/ethtool v0.0.0-20211214014908-bc8fdcf6e99c h1:TNOYq3YcG2B77AEk8i4qabZfzbCXXvffP/njjWvj5ic= ++github.com/mdlayher/ethtool v0.0.0-20211214014908-bc8fdcf6e99c/go.mod h1:aYbhishWc4Ai3I2U4Gaa2n3kHWSwzme6EsG/46HRQbE= + github.com/mdlayher/genetlink v1.0.0/go.mod h1:0rJ0h4itni50A86M2kHcgS85ttZazNt7a8H2a2cw0Gc= ++github.com/mdlayher/genetlink v1.1.0 h1:k2YQT3959rJOF7gOvhdfQ0lut7QMIZiuVlJANheoZ+E= ++github.com/mdlayher/genetlink v1.1.0/go.mod h1:1cAHdejIIk9zbWfP3gW30vY1QUlwyuhaqfkyANVVf10= + github.com/mdlayher/netlink v0.0.0-20190409211403-11939a169225/go.mod h1:eQB3mZE4aiYnlUsyGGCOpPETfdQq4Jhsgf1fk3cwQaA= +-github.com/mdlayher/netlink v0.0.0-20191009155606-de872b0d824b/go.mod h1:KxeJAFOFLG6AjpyDkQ/iIhxygIUKD+vcwqcnu43w/+M= + github.com/mdlayher/netlink v1.0.0/go.mod h1:KxeJAFOFLG6AjpyDkQ/iIhxygIUKD+vcwqcnu43w/+M= + github.com/mdlayher/netlink v1.1.0/go.mod h1:H4WCitaheIsdF9yOYu8CFmCgQthAPIWZmcKp9uZHgmY= + github.com/mdlayher/netlink v1.1.1/go.mod h1:WTYpFb/WTvlRJAyKhZL5/uy69TDDpHHu2VZmb2XgV7o= +@@ -775,8 +827,9 @@ github.com/mdlayher/netlink v1.2.2-0.20210123213345-5cc92139ae3e/go.mod h1:bacnN + github.com/mdlayher/netlink v1.3.0/go.mod h1:xK/BssKuwcRXHrtN04UBkwQ6dY9VviGGuriDdoPSWys= + github.com/mdlayher/netlink v1.4.0/go.mod h1:dRJi5IABcZpBD2A3D0Mv/AiX8I9uDEu5oGkAVrekmf8= + github.com/mdlayher/netlink v1.4.1/go.mod h1:e4/KuJ+s8UhfUpO9z00/fDZZmhSrs+oxyqAS9cNgn6Q= +-github.com/mdlayher/netlink v1.4.2 h1:3sbnJWe/LETovA7yRZIX3f9McVOWV3OySH6iIBxiFfI= + github.com/mdlayher/netlink v1.4.2/go.mod h1:13VaingaArGUTUxFLf/iEovKxXji32JAtF858jZYEug= ++github.com/mdlayher/netlink v1.5.0 h1:r4fa439+SsMarM0rMONU3iSshSV3ArVqJl6H/zjrhh4= ++github.com/mdlayher/netlink v1.5.0/go.mod h1:1Kr8BBFxGyUyNmztC9WLOayqYVAd2wsgOZm18nqGuzQ= + github.com/mdlayher/netx v0.0.0-20200512211805-669a06fde734 h1:DzkgdcT/W7794xU5P7GdZvok/lJECZ8g4xS+vMNLREI= + github.com/mdlayher/netx v0.0.0-20200512211805-669a06fde734/go.mod h1:iN5Y6R8oOaC0KMzLtw/dqCJ2ZOipmk+bncXKStCHr7Q= + github.com/mdlayher/raw v0.0.0-20190313224157-43dbcdd7739d/go.mod h1:r1fbeITl2xL/zLbVnNHFyOzQJTgr/3fpf1lJX/cjzR8= +@@ -785,14 +838,18 @@ github.com/mdlayher/raw v0.0.0-20191009151244-50f2db8cc065 h1:aFkJ6lx4FPip+S+Uw4 + github.com/mdlayher/raw v0.0.0-20191009151244-50f2db8cc065/go.mod h1:7EpbotpCmVZcu+KCX4g9WaRNuu11uyhiW7+Le1dKawg= + github.com/mdlayher/socket v0.0.0-20210307095302-262dc9984e00/go.mod h1:GAFlyu4/XV68LkQKYzKhIo/WW7j3Zi0YRAz/BOoanUc= + github.com/mdlayher/socket v0.0.0-20211007213009-516dcbdf0267/go.mod h1:nFZ1EtZYK8Gi/k6QNu7z7CgO20i/4ExeQswwWuPmG/g= +-github.com/mdlayher/socket v0.0.0-20211102153432-57e3fa563ecb h1:2dC7L10LmTqlyMVzFJ00qM25lqESg9Z4u3GuEXN5iHY= + github.com/mdlayher/socket v0.0.0-20211102153432-57e3fa563ecb/go.mod h1:nFZ1EtZYK8Gi/k6QNu7z7CgO20i/4ExeQswwWuPmG/g= ++github.com/mdlayher/socket v0.1.0 h1:PBV/PxzCp56zuT74AY8vz2dtifidvlI2p65OTqIsqhM= ++github.com/mdlayher/socket v0.1.0/go.mod h1:mYV5YIZAfHh4dzDVzI8x8tWLWCliuX8Mon5Awbj+qDs= + github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= ++github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= ++github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= + github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= + github.com/mikioh/ipaddr v0.0.0-20190404000644-d465c8ab6721 h1:RlZweED6sbSArvlE924+mUcZuXKLBHA35U7LN621Bws= + github.com/mikioh/ipaddr v0.0.0-20190404000644-d465c8ab6721/go.mod h1:Ickgr2WtCLZ2MDGd4Gr0geeCH5HybhRJbonOgQpvSxc= + github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= + github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= ++github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= + github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= + github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= + github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +@@ -805,8 +862,9 @@ github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS4 + github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= + github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= + github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +-github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= + github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= ++github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= ++github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= + github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A= + github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= + github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= +@@ -899,11 +957,13 @@ github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFSt + github.com/packethost/packngo v0.20.0 h1:vUU1z2q+x6/pfNCwHbmdoMrXl/lin8LBk24yqtp4ZjQ= + github.com/packethost/packngo v0.20.0/go.mod h1:/UHguFdPs6Lf6FOkkSEPnRY5tgS0fsVM+Zv/bvBrmt0= + github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= ++github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= + github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= + github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= + github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc= +-github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ= + github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= ++github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM= ++github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= + github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= + github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= + github.com/pin/tftp v2.1.0+incompatible h1:Yng4J7jv6lOc6IF4XoB5mnd3P7ZrF60XQq+my3FAMus= +@@ -917,12 +977,14 @@ github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZ + github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= + github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= + github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= ++github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= + github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= + github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= + github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= + github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= + github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= + github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= ++github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= + github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= + github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ= + github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +@@ -937,6 +999,7 @@ github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7q + github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= + github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= + github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= ++github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= + github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= + github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= + github.com/prometheus/common v0.28.0 h1:vGVfV9KrDTvWt5boZO0I19g2E3CsWfpPPKZM9dt3mEw= +@@ -969,8 +1032,9 @@ github.com/rs/xid v1.3.0 h1:6NjYksEUlhurdVehpc7S7dk6DAmcKv8V9gG0FsVN2U4= + github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= + github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= + github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +-github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= + github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= ++github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= ++github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= + github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= + github.com/ryanuber/columnize v2.1.2+incompatible h1:C89EOx/XBWwIXl8wm8OPJBd7kPF25UfsK2X7Ph/zCAk= + github.com/ryanuber/columnize v2.1.2+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +@@ -978,6 +1042,7 @@ github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkB + github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= + github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= + github.com/safchain/ethtool v0.0.0-20210803160452-9aa261dae9b1/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= ++github.com/sagikazarmark/crypt v0.3.0/go.mod h1:uD/D+6UF4SrIR1uGEv7bBNkNqLGqUr43MRiaGWX1Nig= + github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= + github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b h1:gQZ0qzfKHQIybLANtM3mBXNUtOfsCFXeTsnBqCsx1KM= + github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +@@ -990,7 +1055,6 @@ github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= + github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= + github.com/sethgrid/pester v0.0.0-20190127155807-68a33a018ad0 h1:X9XMOYjxEfAYSy3xK1DzO5dMkkWhs9E9UCcS1IERx2k= + github.com/sethgrid/pester v0.0.0-20190127155807-68a33a018ad0/go.mod h1:Ad7IjTpvzZO8Fl0vh9AzQ+j/jYZfyp2diGwI8m5q+ns= +-github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= + github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= + github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= + github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= +@@ -1001,10 +1065,8 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf + github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= + github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= + github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +-github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= + github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= + github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +-github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= + github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= + github.com/smira/tcpproxy v0.0.0-20201015133617-de5f7797b95b h1:95WXQlM2dDPgIXTlnpwiJPa0l0ipl1RwMvdy8KLUyH8= + github.com/smira/tcpproxy v0.0.0-20201015133617-de5f7797b95b/go.mod h1:yDIWrelwlTRXdKvQqqQ+8lCwCjbSRtkat49REnui7hk= +@@ -1013,18 +1075,21 @@ github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE + github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= + github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= + github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= ++github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= + github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY= + github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= + github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +-github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= + github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= ++github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA= ++github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= + github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= + github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= + github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= + github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= + github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= +-github.com/spf13/cobra v1.2.1 h1:+KmjbUw1hriSNMF55oPrkZcb27aECyrj8V2ytv7kWDw= + github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= ++github.com/spf13/cobra v1.3.0 h1:R7cSvGu+Vv+qX0gW5R/85dx2kmmJT5z5NM8ifdYjdn0= ++github.com/spf13/cobra v1.3.0/go.mod h1:BrRVncBjOJa/eUcVVm9CE+oC6as8k+VYr4NY7WCi9V4= + github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= + github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= + github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +@@ -1037,8 +1102,9 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An + github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= + github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= + github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +-github.com/spf13/viper v1.8.1 h1:Kq1fyeebqsBfbjZj4EL7gj2IO0mMaiyjYUWcUsl2O44= + github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= ++github.com/spf13/viper v1.10.0 h1:mXH0UwHS4D2HwWZa75im4xIQynLfblmWV7qcWpfv0yk= ++github.com/spf13/viper v1.10.0/go.mod h1:SoyBPwAtKDzypXNDFKN5kzH7ppppbGZtls1UpIy5AsM= + github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8= + github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= + github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +@@ -1095,6 +1161,7 @@ github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ + github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= + github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= + github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= ++github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= + github.com/u-root/u-root v7.0.0+incompatible h1:u+KSS04pSxJGI5E7WE4Bs9+Zd75QjFv+REkjy/aoAc8= + github.com/u-root/u-root v7.0.0+incompatible/go.mod h1:RYkpo8pTHrNjW08opNd/U6p/RJE7K0D8fXO0d47+3YY= + github.com/u-root/uio v0.0.0-20210528114334-82958018845c h1:BFvcl34IGnw8yvJi8hlqLFo9EshRInwWBs2M5fGWzQA= +@@ -1144,6 +1211,7 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de + github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= + github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= + github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= ++github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= + github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= + github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= + github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= +@@ -1239,6 +1307,7 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U + golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= + golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= + golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= ++golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= + golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= + golang.org/x/crypto v0.0.0-20200420201142-3c4aac89819a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= + golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +@@ -1249,8 +1318,8 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm + golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= + golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= + golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +-golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871 h1:/pEO3GD/ABYAjuakUS6xSEmmlyVS4kxBNkeA9tLJiTI= +-golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= ++golang.org/x/crypto v0.0.0-20211202192323-5770296d904e h1:MUP6MR3rJ7Gk9LEia0LP2ytiH6MuCfs7qYz+47jGdD8= ++golang.org/x/crypto v0.0.0-20211202192323-5770296d904e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= + golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= + golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= + golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +@@ -1274,7 +1343,6 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu + golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= + golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= + golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +-golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= + golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= + golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= + golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +@@ -1287,6 +1355,7 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= + golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= + golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= + golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= ++golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= + golang.org/x/mod v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38= + golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= + golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +@@ -1314,9 +1383,9 @@ golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLL + golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= + golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= + golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= ++golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= + golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= + golang.org/x/net v0.0.0-20191007182048-72f939374954/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +-golang.org/x/net v0.0.0-20191028085509-fe3aa8a45271/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= + golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= + golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= + golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +@@ -1346,20 +1415,25 @@ golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v + golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= + golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= + golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= ++golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= + golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= ++golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= + golang.org/x/net v0.0.0-20210505214959-0714010a04ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= + golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= + golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= ++golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= + golang.org/x/net v0.0.0-20210928044308-7d9f5e0b762b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= ++golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= + golang.org/x/net v0.0.0-20211020060615-d418f374d309/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= + golang.org/x/net v0.0.0-20211105192438-b53810dc28af/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= + golang.org/x/net v0.0.0-20211108170745-6635138e15ea/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= + golang.org/x/net v0.0.0-20211111083644-e5c967477495/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= + golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +-golang.org/x/net v0.0.0-20211123203042-d83791d6bcd9/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= + golang.org/x/net v0.0.0-20211201190559-0a0e4e1bb54c/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +-golang.org/x/net v0.0.0-20211209124913-491a49abca63 h1:iocB37TsdFuN6IBRZ+ry36wrkoV51/tl5vOWqkcPGvY= ++golang.org/x/net v0.0.0-20211208012354-db4efeb81f4b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= + golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= ++golang.org/x/net v0.0.0-20211216030914-fe4d6282115f h1:hEYJvxw1lSnWIl8X9ofsYMklzaDs90JI2az5YMd4fPM= ++golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= + golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= + golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= + golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +@@ -1373,8 +1447,12 @@ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ + golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= + golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= + golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +-golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f h1:Qmd2pbz05z7z6lm0DrgQVVPuBm92jqujBKMHMOlOQEw= ++golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= ++golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= + golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= ++golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= ++golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 h1:RerP+noqYHUQ8CMRcPlC2nvTa4dcBIjegkuWdcUDuqg= ++golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= + golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= + golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= + golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +@@ -1418,13 +1496,14 @@ golang.org/x/sys v0.0.0-20190812073006-9eafafc0a87e/go.mod h1:h1NjWce9XRLGQEsW7w + golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= + golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= + golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= ++golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= ++golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= + golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= + golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= + golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= + golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= + golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= + golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +-golang.org/x/sys v0.0.0-20191029155521-f43be2a4598c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= + golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= + golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= + golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +@@ -1480,6 +1559,7 @@ golang.org/x/sys v0.0.0-20210123111255-9b0068b26619/go.mod h1:h1NjWce9XRLGQEsW7w + golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= + golang.org/x/sys v0.0.0-20210216163648-f7da38b97c65/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= + golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= ++golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= + golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= + golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= + golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +@@ -1491,23 +1571,34 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w + golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= + golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= + golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= ++golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= + golang.org/x/sys v0.0.0-20210525143221-35b2ab0089ea/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= + golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= ++golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= + golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= + golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= + golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= ++golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= + golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= ++golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= ++golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= + golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= + golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= ++golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= + golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= ++golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= ++golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= + golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= + golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= + golang.org/x/sys v0.0.0-20211106132015-ebca88c72f68/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= + golang.org/x/sys v0.0.0-20211109184856-51b60fd695b3/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= + golang.org/x/sys v0.0.0-20211110154304-99a53858aa08/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= + golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +-golang.org/x/sys v0.0.0-20211205182925-97ca703d548d h1:FjkYO/PPp4Wi0EAUOVLxePm7qVW4r4ctbWpURyuOD0E= + golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= ++golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= ++golang.org/x/sys v0.0.0-20211214234402-4825e8c3871d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= ++golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= ++golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= + golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= + golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= + golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +@@ -1552,6 +1643,7 @@ golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgw + golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= + golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= + golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= ++golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= + golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= + golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= + golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +@@ -1591,12 +1683,15 @@ golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4f + golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= + golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= + golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= ++golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= + golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= ++golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= + golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= + golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= + golang.org/x/tools v0.1.6-0.20210820212750-d4cc65f0b2ff/go.mod h1:YD9qOF0M9xpSpdWTBbzEl5e/RnCefISl8E5Noe10jFM= +-golang.org/x/tools v0.1.7 h1:6j8CgantCy3yc8JGBqkDLMKWqZ0RDU2g1HVgacojGWQ= + golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= ++golang.org/x/tools v0.1.8 h1:P1HhGGuLW4aAclzjtmJdf0mJOjVUZUzOTqkAkWL+l6w= ++golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= + golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= + golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= + golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +@@ -1606,11 +1701,11 @@ golang.zx2c4.com/go118/netip v0.0.0-20211106132939-9d41d90554dd/go.mod h1:5yyfui + golang.zx2c4.com/go118/netip v0.0.0-20211111135330-a4a02eeacf9d/go.mod h1:5yyfuiqVIJ7t+3MqrpTQ+QqRkMWiESiyDvPNvKYCecg= + golang.zx2c4.com/wintun v0.0.0-20211104114900-415007cec224/go.mod h1:deeaetjYA+DHMHg+sMSMI58GrEteJUUzzw7en6TJQcI= + golang.zx2c4.com/wireguard v0.0.0-20211109020618-685490f568cf/go.mod h1:M4ViMFJSFA3E7DEM9lS9NsCbDhurQdVjipAqa06Jy2Q= +-golang.zx2c4.com/wireguard v0.0.0-20211123210315-387f7c461a16 h1:SCBV/ayxt56AuC0R8oN5p8Mmc9Llv34tr9VbNlh1kL0= +-golang.zx2c4.com/wireguard v0.0.0-20211123210315-387f7c461a16/go.mod h1:TjUWrnD5ATh7bFvmm/ALEJZQ4ivKbETb6pmyj1vUoNI= ++golang.zx2c4.com/wireguard v0.0.0-20211129173154-2dd424e2d808 h1:rdIdofxHfxUJ3rQGANnGGqNbf1qwesHtlxMkfgakiJM= ++golang.zx2c4.com/wireguard v0.0.0-20211129173154-2dd424e2d808/go.mod h1:TjUWrnD5ATh7bFvmm/ALEJZQ4ivKbETb6pmyj1vUoNI= + golang.zx2c4.com/wireguard/wgctrl v0.0.0-20211109202428-0073765f69ba/go.mod h1:fhr0mQ0d0pUv+gK1R0HBTPPh7a86/48ugXX6q0jSru8= +-golang.zx2c4.com/wireguard/wgctrl v0.0.0-20211124212657-dd7407c86d22 h1:TnoJ6AWs/q4xGE9smgTi+bJmEDet3nrBqdHSV0d5/zA= +-golang.zx2c4.com/wireguard/wgctrl v0.0.0-20211124212657-dd7407c86d22/go.mod h1:ELrVb7MHNIb8OV6iZ6TP/ScunqUha+vWsUP+SVBH7lQ= ++golang.zx2c4.com/wireguard/wgctrl v0.0.0-20211215182854-7a385b3431de h1:qDZ+lyO5jC9RNJ7ANJA0GWXk3pSn0Fu5SlcAIlgw+6w= ++golang.zx2c4.com/wireguard/wgctrl v0.0.0-20211215182854-7a385b3431de/go.mod h1:Q2XNgour4QSkFj0BWCkVlW0HWJwQgNMsMahpSlI0Eno= + google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= + google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= + google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +@@ -1633,8 +1728,19 @@ google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34q + google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= + google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= + google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +-google.golang.org/api v0.44.0 h1:URs6qR1lAxDsqWITsQXI4ZkGiYJ5dHtRNiCpfs2OeKA= + google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= ++google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= ++google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= ++google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= ++google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= ++google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= ++google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= ++google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= ++google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= ++google.golang.org/api v0.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU= ++google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= ++google.golang.org/api v0.62.0 h1:PhGymJMXfGBzc4lBRmrx9+1w4w2wEzURHNGF/sD/xGc= ++google.golang.org/api v0.62.0/go.mod h1:dKmwPCydfsad4qCH08MSdgWjfHOyfpd4VtDGgRFdavw= + google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= + google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= + google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +@@ -1689,11 +1795,31 @@ google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6D + google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= + google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= + google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= ++google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= + google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= ++google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= ++google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= ++google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= ++google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= ++google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= ++google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= ++google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= ++google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= ++google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= ++google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= + google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= ++google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= ++google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= ++google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= ++google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= ++google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= + google.golang.org/genproto v0.0.0-20211112145013-271947fe86fd/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +-google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9 h1:fU3FNfL/oBU2D5DvGqiuyVqqn40DdxvaTFHq7aivA3k= ++google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= ++google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= + google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= ++google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= ++google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa h1:I0YcKz0I7OAhddo7ya8kMnvprhcWM045PmkBdMO9zN0= ++google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= + google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= + google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= + google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +@@ -1718,12 +1844,17 @@ google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAG + google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= + google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= + google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= ++google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= + google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= + google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= ++google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= + google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= ++google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= + google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= +-google.golang.org/grpc v1.42.0 h1:XT2/MFpuPFsEX2fWh3YQtHkZ+WYZFQRfaUgLZYj/p6A= + google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= ++google.golang.org/grpc v1.43.0 h1:Eeu7bZtDZ2DpRCsLhUlcrLnvYaMK1Gz86a+hMVvELmM= ++google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= ++google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= + google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= + google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= + google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +@@ -1757,8 +1888,9 @@ gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKW + gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= + gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= + gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +-gopkg.in/ini.v1 v1.62.0 h1:duBzk771uxoUuOlyRLkHsygud9+5lrlGjdFBb4mSKDU= + gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= ++gopkg.in/ini.v1 v1.66.2 h1:XfR1dOYubytKy4Shzc2LHrrGhU0lDCfDGG1yLPmpgsI= ++gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= + gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= + gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= + gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +@@ -1856,10 +1988,10 @@ k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/ + k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= + k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b h1:wxEMGetGMur3J1xuGLQY7GEQYg9bZxKn3tKo5k/eYcs= + k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +-kernel.org/pub/linux/libs/security/libcap/cap v1.2.61 h1:rj+2Pc7LC2ceu1jjSo99uZ/xsE1hjd64ibJ1EwzRkWs= +-kernel.org/pub/linux/libs/security/libcap/cap v1.2.61/go.mod h1:KKzADotz5ix9+NEQxTtbtLiC64/WfcRIX3UucX1Clyg= +-kernel.org/pub/linux/libs/security/libcap/psx v1.2.61 h1:hIhJhAkg61lqKczixewG5RvCBm7EcmFthUYaDh39+Ds= +-kernel.org/pub/linux/libs/security/libcap/psx v1.2.61/go.mod h1:+l6Ee2F59XiJ2I6WR5ObpC1utCQJZ/VLsEbQCD8RG24= ++kernel.org/pub/linux/libs/security/libcap/cap v1.2.62 h1:9iE7a676uhvcBUqPaX1m8vsGPLxWhY6HacTae4fAZ4M= ++kernel.org/pub/linux/libs/security/libcap/cap v1.2.62/go.mod h1:IZIlNB3lc6EmaOILJvTigHdE+vE5DrVDEEm6CB133Ak= ++kernel.org/pub/linux/libs/security/libcap/psx v1.2.62 h1:Tko+77IH7RReA/jcHqaVgtUJ9zAaXH4I0ZE3YHluBdw= ++kernel.org/pub/linux/libs/security/libcap/psx v1.2.62/go.mod h1:+l6Ee2F59XiJ2I6WR5ObpC1utCQJZ/VLsEbQCD8RG24= + rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= + rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= + rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +diff --git a/hack/cloud-image-uploader/go.mod b/hack/cloud-image-uploader/go.mod +index 979a4d7dda8..59c24e2761b 100644 +--- a/hack/cloud-image-uploader/go.mod ++++ b/hack/cloud-image-uploader/go.mod +@@ -3,7 +3,7 @@ module github.com/talos-systems/cloud-image-uploader + go 1.17 + + require ( +- github.com/aws/aws-sdk-go v1.42.19 ++ github.com/aws/aws-sdk-go v1.42.23 + github.com/google/uuid v1.3.0 + github.com/spf13/pflag v1.0.5 + github.com/talos-systems/go-retry v0.3.1 +diff --git a/hack/cloud-image-uploader/go.sum b/hack/cloud-image-uploader/go.sum +index 6945f1db7ef..c8aab49a6e9 100644 +--- a/hack/cloud-image-uploader/go.sum ++++ b/hack/cloud-image-uploader/go.sum +@@ -1,5 +1,5 @@ +-github.com/aws/aws-sdk-go v1.42.19 h1:L/aM1QwsqVia9qIqexTHwYN+lgLYuOtf11VDgz0YIyw= +-github.com/aws/aws-sdk-go v1.42.19/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= ++github.com/aws/aws-sdk-go v1.42.23 h1:V0V5hqMEyVelgpu1e4gMPVCJ+KhmscdNxP/NWP1iCOA= ++github.com/aws/aws-sdk-go v1.42.23/go.mod h1:gyRszuZ/icHmHAVE4gc/r+cfCmhA1AD+vqfWbgI+eHs= + github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= + github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= + github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +@@ -16,8 +16,8 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An + github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= + github.com/talos-systems/go-retry v0.3.1 h1:GjjyHB8i1CJpb1O5qYPMljq74cRQ5uiDoyMaWddA5FA= + github.com/talos-systems/go-retry v0.3.1/go.mod h1:HiXQqyVStZ35uSY/MTLWVvQVmC3lIW2MS5VdDaMtoKM= +-golang.org/x/net v0.0.0-20210614182718-04defd469f4e h1:XpT3nA5TvE525Ne3hInMh6+GETgn27Zfm9dxsThnX2Q= +-golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= ++golang.org/x/net v0.0.0-20211209124913-491a49abca63 h1:iocB37TsdFuN6IBRZ+ry36wrkoV51/tl5vOWqkcPGvY= ++golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= + golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= + golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= + golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +diff --git a/internal/app/apid/main.go b/internal/app/apid/main.go +index ce9a9ef7a75..12d04a938dd 100644 +--- a/internal/app/apid/main.go ++++ b/internal/app/apid/main.go +@@ -18,6 +18,7 @@ import ( + ""golang.org/x/sync/errgroup"" + ""google.golang.org/grpc"" + ""google.golang.org/grpc/credentials"" ++ ""google.golang.org/grpc/credentials/insecure"" + + apidbackend ""github.com/talos-systems/talos/internal/app/apid/pkg/backend"" + ""github.com/talos-systems/talos/internal/app/apid/pkg/director"" +@@ -57,7 +58,7 @@ func Main() { + log.Fatalf(""failed to seed RNG: %v"", err) + } + +- runtimeConn, err := grpc.Dial(""unix://""+constants.APIRuntimeSocketPath, grpc.WithInsecure()) ++ runtimeConn, err := grpc.Dial(""unix://""+constants.APIRuntimeSocketPath, grpc.WithTransportCredentials(insecure.NewCredentials())) + if err != nil { + log.Fatalf(""failed to dial runtime connection: %v"", err) + } +diff --git a/internal/app/machined/internal/server/v1alpha1/v1alpha1_time_test.go b/internal/app/machined/internal/server/v1alpha1/v1alpha1_time_test.go +index 66a8f3dd6aa..05ce2126481 100644 +--- a/internal/app/machined/internal/server/v1alpha1/v1alpha1_time_test.go ++++ b/internal/app/machined/internal/server/v1alpha1/v1alpha1_time_test.go +@@ -14,6 +14,7 @@ import ( + + ""github.com/stretchr/testify/suite"" + ""google.golang.org/grpc"" ++ ""google.golang.org/grpc/credentials/insecure"" + ""google.golang.org/protobuf/types/known/emptypb"" + + runtime ""github.com/talos-systems/talos/internal/app/machined/internal/server/v1alpha1"" +@@ -69,7 +70,7 @@ func (suite *TimedSuite) TestTime() { + + conn, err := grpc.Dial( + fmt.Sprintf(""%s://%s"", ""unix"", listener.Addr().String()), +- grpc.WithInsecure(), ++ grpc.WithTransportCredentials(insecure.NewCredentials()), + grpc.WithContextDialer(dialer.DialUnix()), + ) + suite.Require().NoError(err) +@@ -103,7 +104,7 @@ func (suite *TimedSuite) TestTimeCheck() { + + conn, err := grpc.Dial( + fmt.Sprintf(""%s://%s"", ""unix"", listener.Addr().String()), +- grpc.WithInsecure(), ++ grpc.WithTransportCredentials(insecure.NewCredentials()), + grpc.WithContextDialer(dialer.DialUnix()), + ) + suite.Require().NoError(err) +diff --git a/internal/app/machined/pkg/controllers/runtime/events_sink.go b/internal/app/machined/pkg/controllers/runtime/events_sink.go +index 2a8d7c87fbf..e4808a9f36d 100644 +--- a/internal/app/machined/pkg/controllers/runtime/events_sink.go ++++ b/internal/app/machined/pkg/controllers/runtime/events_sink.go +@@ -18,6 +18,7 @@ import ( + ""go.uber.org/atomic"" + ""go.uber.org/zap"" + ""google.golang.org/grpc"" ++ ""google.golang.org/grpc/credentials/insecure"" + ""google.golang.org/protobuf/types/known/anypb"" + + ""github.com/talos-systems/talos/internal/app/machined/pkg/runtime"" +@@ -110,7 +111,7 @@ func (ctrl *EventsSinkController) Run(ctx context.Context, r controller.Runtime, + + sink := ctrl.Cmdline.Get(constants.KernelParamEventsSink).First() + +- conn, err := grpc.DialContext(ctx, *sink, grpc.WithInsecure()) ++ conn, err := grpc.DialContext(ctx, *sink, grpc.WithTransportCredentials(insecure.NewCredentials())) + if err != nil { + return err + } +diff --git a/internal/app/machined/pkg/controllers/siderolink/manager.go b/internal/app/machined/pkg/controllers/siderolink/manager.go +index 8c5e93c2952..93121850cbe 100644 +--- a/internal/app/machined/pkg/controllers/siderolink/manager.go ++++ b/internal/app/machined/pkg/controllers/siderolink/manager.go +@@ -19,6 +19,7 @@ import ( + ""go.uber.org/zap"" + ""golang.zx2c4.com/wireguard/wgctrl/wgtypes"" + ""google.golang.org/grpc"" ++ ""google.golang.org/grpc/credentials/insecure"" + ""inet.af/netaddr"" + + ""github.com/talos-systems/talos/pkg/machinery/constants"" +@@ -94,7 +95,7 @@ func (ctrl *ManagerController) Run(ctx context.Context, r controller.Runtime, lo + + apiEndpoint := *ctrl.Cmdline.Get(constants.KernelParamSideroLink).First() + +- conn, err := grpc.DialContext(ctx, apiEndpoint, grpc.WithInsecure()) ++ conn, err := grpc.DialContext(ctx, apiEndpoint, grpc.WithTransportCredentials(insecure.NewCredentials())) + if err != nil { + return fmt.Errorf(""error dialing SideroLink endpoint %q: %w"", apiEndpoint, err) + } +diff --git a/internal/pkg/cri/client.go b/internal/pkg/cri/client.go +index f1a7ee9d6b3..f4dfece393d 100644 +--- a/internal/pkg/cri/client.go ++++ b/internal/pkg/cri/client.go +@@ -10,6 +10,7 @@ import ( + ""time"" + + ""google.golang.org/grpc"" ++ ""google.golang.org/grpc/credentials/insecure"" + runtimeapi ""k8s.io/cri-api/pkg/apis/runtime/v1alpha2"" + + ""github.com/talos-systems/talos/pkg/grpc/dialer"" +@@ -32,7 +33,7 @@ func NewClient(endpoint string, connectionTimeout time.Duration) (*Client, error + defer cancel() + + conn, err := grpc.DialContext(ctx, endpoint, +- grpc.WithInsecure(), ++ grpc.WithTransportCredentials(insecure.NewCredentials()), + grpc.WithBlock(), + grpc.FailOnNonTempDialError(false), + grpc.WithBackoffMaxDelay(3*time.Second), //nolint:staticcheck +diff --git a/pkg/cluster/local.go b/pkg/cluster/local.go +index ce77bafc54c..fd50da96941 100644 +--- a/pkg/cluster/local.go ++++ b/pkg/cluster/local.go +@@ -9,6 +9,7 @@ import ( + ""fmt"" + + ""google.golang.org/grpc"" ++ ""google.golang.org/grpc/credentials/insecure"" + + ""github.com/talos-systems/talos/pkg/machinery/client"" + ""github.com/talos-systems/talos/pkg/machinery/constants"" +@@ -31,7 +32,7 @@ func (c *LocalClientProvider) Client(endpoints ...string) (*client.Client, error + var err error + + if c.client == nil { +- c.client, err = client.New(context.TODO(), client.WithUnixSocket(constants.APISocketPath), client.WithGRPCDialOptions(grpc.WithInsecure())) ++ c.client, err = client.New(context.TODO(), client.WithUnixSocket(constants.APISocketPath), client.WithGRPCDialOptions(grpc.WithTransportCredentials(insecure.NewCredentials()))) + } + + return c.client, err +diff --git a/pkg/grpc/proxy/backend/local.go b/pkg/grpc/proxy/backend/local.go +index 3622781fe48..3e046b3a35f 100644 +--- a/pkg/grpc/proxy/backend/local.go ++++ b/pkg/grpc/proxy/backend/local.go +@@ -10,6 +10,7 @@ import ( + + ""github.com/talos-systems/grpc-proxy/proxy"" + ""google.golang.org/grpc"" ++ ""google.golang.org/grpc/credentials/insecure"" + ""google.golang.org/grpc/metadata"" + + ""github.com/talos-systems/talos/pkg/grpc/middleware/authz"" +@@ -56,7 +57,7 @@ func (l *Local) GetConnection(ctx context.Context) (context.Context, *grpc.Clien + l.conn, err = grpc.DialContext( + ctx, + ""unix:""+l.socketPath, +- grpc.WithInsecure(), ++ grpc.WithTransportCredentials(insecure.NewCredentials()), + grpc.WithCodec(proxy.Codec()), //nolint:staticcheck + + ) +diff --git a/pkg/machinery/go.mod b/pkg/machinery/go.mod +index 05050871d3c..887dfe13c3e 100644 +--- a/pkg/machinery/go.mod ++++ b/pkg/machinery/go.mod +@@ -8,22 +8,22 @@ replace gopkg.in/yaml.v3 => github.com/unix4ever/yaml v0.0.0-20210315173758-8fb3 + + require ( + github.com/AlekSi/pointer v1.2.0 +- github.com/containerd/go-cni v1.1.0 ++ github.com/containerd/go-cni v1.1.1 + github.com/cosi-project/runtime v0.0.0-20211216175730-264f8fcd1a4f + github.com/dustin/go-humanize v1.0.0 + github.com/evanphx/json-patch v5.6.0+incompatible + github.com/ghodss/yaml v1.0.0 + github.com/hashicorp/go-multierror v1.1.1 +- github.com/jsimonetti/rtnetlink v0.0.0-20211203074127-fd9a11f42291 +- github.com/mdlayher/ethtool v0.0.0-20211028163843-288d040e9d60 ++ github.com/jsimonetti/rtnetlink v0.0.0-20211213041634-9dff439f7e79 ++ github.com/mdlayher/ethtool v0.0.0-20211214014908-bc8fdcf6e99c + github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d + github.com/stretchr/testify v1.7.0 + github.com/talos-systems/crypto v0.3.5-0.20211220133734-6fa2d93d0382 + github.com/talos-systems/go-blockdevice v0.2.6-0.20211214184027-6928ee43c303 + github.com/talos-systems/go-debug v0.2.1 + github.com/talos-systems/net v0.3.1 +- google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9 +- google.golang.org/grpc v1.42.0 ++ google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa ++ google.golang.org/grpc v1.43.0 + google.golang.org/protobuf v1.27.1 + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b + inet.af/netaddr v0.0.0-20211027220019-c74959edd3b6 +@@ -39,16 +39,17 @@ require ( + github.com/hashicorp/errwrap v1.0.0 // indirect + github.com/josharian/native v0.0.0-20200817173448-b6b71def0850 // indirect + github.com/mdlayher/genetlink v1.0.0 // indirect +- github.com/mdlayher/netlink v1.4.2 // indirect +- github.com/mdlayher/socket v0.0.0-20211102153432-57e3fa563ecb // indirect ++ github.com/mdlayher/netlink v1.5.0 // indirect ++ github.com/mdlayher/socket v0.1.0 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/ryanuber/go-glob v1.0.0 // indirect + go4.org/intern v0.0.0-20211027215823-ae77deb06f29 // indirect + go4.org/unsafe/assume-no-moving-gc v0.0.0-20211027215541-db492cf91b37 // indirect + golang.org/x/mod v0.5.1 // indirect +- golang.org/x/net v0.0.0-20211201190559-0a0e4e1bb54c // indirect +- golang.org/x/sys v0.0.0-20211124211545-fe61309f8881 // indirect ++ golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect ++ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect ++ golang.org/x/sys v0.0.0-20211210111614-af8b64212486 // indirect + golang.org/x/text v0.3.6 // indirect + golang.org/x/tools v0.1.7 // indirect + golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect +diff --git a/pkg/machinery/go.sum b/pkg/machinery/go.sum +index 27528fc7aa0..2d969fe72f0 100644 +--- a/pkg/machinery/go.sum ++++ b/pkg/machinery/go.sum +@@ -25,8 +25,8 @@ github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWH + github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= + github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= + github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +-github.com/containerd/go-cni v1.1.0 h1:kAe75MdTddsLCZDqP2BJn6e1ovD+il9oFkNlfGULEos= +-github.com/containerd/go-cni v1.1.0/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA= ++github.com/containerd/go-cni v1.1.1 h1:UV64yhzDgs27mBIVUrlzG8Z2bc1K0/zokOW5vDNkI4c= ++github.com/containerd/go-cni v1.1.1/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA= + github.com/containernetworking/cni v1.0.1 h1:9OIL/sZmMYDBe+G8svzILAlulUpaDTUjeAbtH/JNLBo= + github.com/containernetworking/cni v1.0.1/go.mod h1:AKuhXbN5EzmD4yTNtfSsX3tPcmtrBI6QcRV0NiNt15Y= + github.com/cosi-project/runtime v0.0.0-20211216175730-264f8fcd1a4f h1:COaUfDid6VOPrwViW30CdYZ6rHLHMfnN25C+TKQIrgU= +@@ -104,8 +104,8 @@ github.com/jsimonetti/rtnetlink v0.0.0-20210122163228-8d122574c736/go.mod h1:ZXp + github.com/jsimonetti/rtnetlink v0.0.0-20210212075122-66c871082f2b/go.mod h1:8w9Rh8m+aHZIG69YPGGem1i5VzoyRC8nw2kA8B+ik5U= + github.com/jsimonetti/rtnetlink v0.0.0-20210525051524-4cc836578190/go.mod h1:NmKSdU4VGSiv1bMsdqNALI4RSvvjtz65tTMCnD05qLo= + github.com/jsimonetti/rtnetlink v0.0.0-20211022192332-93da33804786/go.mod h1:v4hqbTdfQngbVSZJVWUhGE/lbTFf9jb+ygmNUDQMuOs= +-github.com/jsimonetti/rtnetlink v0.0.0-20211203074127-fd9a11f42291 h1:0J2ntV09uHLUHC79Z3YKJX2EnfOKL2QkMuHabu4L8JM= +-github.com/jsimonetti/rtnetlink v0.0.0-20211203074127-fd9a11f42291/go.mod h1:J7jazXS6RFR/oZT8XdfdD2KQ1bl56ukeE1qt4w8UQaI= ++github.com/jsimonetti/rtnetlink v0.0.0-20211213041634-9dff439f7e79 h1:/QPq0/8s641L+37wwAEilHtJ1AyrJcPPVL2Y5bUEQ7A= ++github.com/jsimonetti/rtnetlink v0.0.0-20211213041634-9dff439f7e79/go.mod h1:SSw/czYErQHttMqBQGCGlQRvn2f6NsNpVi2eM4n4j5U= + github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= + github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= + github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +@@ -113,8 +113,9 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= + github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= + github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= + github.com/mdlayher/ethtool v0.0.0-20210210192532-2b88debcdd43/go.mod h1:+t7E0lkKfbBsebllff1xdTmyJt8lH37niI6kwFk9OTo= +-github.com/mdlayher/ethtool v0.0.0-20211028163843-288d040e9d60 h1:tHdB+hQRHU10CfcK0furo6rSNgZ38JT8uPh70c/pFD8= + github.com/mdlayher/ethtool v0.0.0-20211028163843-288d040e9d60/go.mod h1:aYbhishWc4Ai3I2U4Gaa2n3kHWSwzme6EsG/46HRQbE= ++github.com/mdlayher/ethtool v0.0.0-20211214014908-bc8fdcf6e99c h1:TNOYq3YcG2B77AEk8i4qabZfzbCXXvffP/njjWvj5ic= ++github.com/mdlayher/ethtool v0.0.0-20211214014908-bc8fdcf6e99c/go.mod h1:aYbhishWc4Ai3I2U4Gaa2n3kHWSwzme6EsG/46HRQbE= + github.com/mdlayher/genetlink v1.0.0 h1:OoHN1OdyEIkScEmRgxLEe2M9U8ClMytqA5niynLtfj0= + github.com/mdlayher/genetlink v1.0.0/go.mod h1:0rJ0h4itni50A86M2kHcgS85ttZazNt7a8H2a2cw0Gc= + github.com/mdlayher/netlink v0.0.0-20190409211403-11939a169225/go.mod h1:eQB3mZE4aiYnlUsyGGCOpPETfdQq4Jhsgf1fk3cwQaA= +@@ -127,12 +128,12 @@ github.com/mdlayher/netlink v1.2.2-0.20210123213345-5cc92139ae3e/go.mod h1:bacnN + github.com/mdlayher/netlink v1.3.0/go.mod h1:xK/BssKuwcRXHrtN04UBkwQ6dY9VviGGuriDdoPSWys= + github.com/mdlayher/netlink v1.4.0/go.mod h1:dRJi5IABcZpBD2A3D0Mv/AiX8I9uDEu5oGkAVrekmf8= + github.com/mdlayher/netlink v1.4.1/go.mod h1:e4/KuJ+s8UhfUpO9z00/fDZZmhSrs+oxyqAS9cNgn6Q= +-github.com/mdlayher/netlink v1.4.2 h1:3sbnJWe/LETovA7yRZIX3f9McVOWV3OySH6iIBxiFfI= +-github.com/mdlayher/netlink v1.4.2/go.mod h1:13VaingaArGUTUxFLf/iEovKxXji32JAtF858jZYEug= ++github.com/mdlayher/netlink v1.5.0 h1:r4fa439+SsMarM0rMONU3iSshSV3ArVqJl6H/zjrhh4= ++github.com/mdlayher/netlink v1.5.0/go.mod h1:1Kr8BBFxGyUyNmztC9WLOayqYVAd2wsgOZm18nqGuzQ= + github.com/mdlayher/socket v0.0.0-20210307095302-262dc9984e00/go.mod h1:GAFlyu4/XV68LkQKYzKhIo/WW7j3Zi0YRAz/BOoanUc= + github.com/mdlayher/socket v0.0.0-20211007213009-516dcbdf0267/go.mod h1:nFZ1EtZYK8Gi/k6QNu7z7CgO20i/4ExeQswwWuPmG/g= +-github.com/mdlayher/socket v0.0.0-20211102153432-57e3fa563ecb h1:2dC7L10LmTqlyMVzFJ00qM25lqESg9Z4u3GuEXN5iHY= +-github.com/mdlayher/socket v0.0.0-20211102153432-57e3fa563ecb/go.mod h1:nFZ1EtZYK8Gi/k6QNu7z7CgO20i/4ExeQswwWuPmG/g= ++github.com/mdlayher/socket v0.1.0 h1:PBV/PxzCp56zuT74AY8vz2dtifidvlI2p65OTqIsqhM= ++github.com/mdlayher/socket v0.1.0/go.mod h1:mYV5YIZAfHh4dzDVzI8x8tWLWCliuX8Mon5Awbj+qDs= + github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= + github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= + github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= +@@ -229,8 +230,8 @@ golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qx + golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= + golang.org/x/net v0.0.0-20210928044308-7d9f5e0b762b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= + golang.org/x/net v0.0.0-20211020060615-d418f374d309/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +-golang.org/x/net v0.0.0-20211201190559-0a0e4e1bb54c h1:WtYZ93XtWSO5KlOMgPZu7hXY9WhMZpprvlm5VwvAl8c= +-golang.org/x/net v0.0.0-20211201190559-0a0e4e1bb54c/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= ++golang.org/x/net v0.0.0-20211209124913-491a49abca63 h1:iocB37TsdFuN6IBRZ+ry36wrkoV51/tl5vOWqkcPGvY= ++golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= + golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= + golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= + golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +@@ -274,8 +275,8 @@ golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBc + golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= + golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= + golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +-golang.org/x/sys v0.0.0-20211124211545-fe61309f8881 h1:TyHqChC80pFkXWraUUf6RuB5IqFdQieMLwwCJokV2pc= +-golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= ++golang.org/x/sys v0.0.0-20211210111614-af8b64212486 h1:5hpz5aRr+W1erYCL5JRhSUBJRph7l9XkNveoExlrKYk= ++golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= + golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= + golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= + golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +@@ -306,8 +307,8 @@ google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoA + google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= + google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= + google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +-google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9 h1:fU3FNfL/oBU2D5DvGqiuyVqqn40DdxvaTFHq7aivA3k= +-google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= ++google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa h1:I0YcKz0I7OAhddo7ya8kMnvprhcWM045PmkBdMO9zN0= ++google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= + google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= + google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= + google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +@@ -316,8 +317,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp + google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= + google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= + google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +-google.golang.org/grpc v1.42.0 h1:XT2/MFpuPFsEX2fWh3YQtHkZ+WYZFQRfaUgLZYj/p6A= +-google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= ++google.golang.org/grpc v1.43.0 h1:Eeu7bZtDZ2DpRCsLhUlcrLnvYaMK1Gz86a+hMVvELmM= ++google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= + google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= + google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= + google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=" +eslint,https://github.com/eslint/eslint,9ee8869314e5bd71ddba58edd03a6ceab2016bae,Brett Zamir,2016-03-11 01:15:19,Docs: no-unused-expressions - add more edge unusable and usable examples,Avoid using string as example of unusable since it could be a directive depending on context,"Docs: no-unused-expressions - add more edge unusable and usable examples + +Avoid using string as example of unusable since it could be a directive depending on context","diff --git a/docs/rules/no-unused-expressions.md b/docs/rules/no-unused-expressions.md +index 914411dd28d6..2cd8fa3ef6e0 100644 +--- a/docs/rules/no-unused-expressions.md ++++ b/docs/rules/no-unused-expressions.md +@@ -3,20 +3,22 @@ + Unused expressions are those expressions that evaluate to a value but are never used. For example: + + ```js +-""Hello world""; ++n + 1; + ``` + +-This string is a valid JavaScript expression, but isn't actually used. Even though it's not a syntax error it is clearly a logic error and it has no effect on the code being executed. ++This is a valid JavaScript expression, but isn't actually used. Even though it's not a syntax error it is clearly a logic error and it has no effect on the code being executed. + + ## Rule Details + + This rule aims to eliminate unused expressions. The value of an expression should always be used, except in the case of expressions that side effect: function calls, assignments, and the `new` operator. + +-**Note:** Sequence expressions (those using a comma, such as `a = 1, b = 2`) are always considered unused unless their return value is assigned or a function call is made with the sequence expression value. ++Note that sequence expressions (those using a comma, such as `a = 1, b = 2`) are always considered unused unless their return value is assigned or used in a condition evaluation, or a function call is made with the sequence expression value. ++ ++Please also note that this rule does not apply to directives (which are in the form of literal string expressions (e.g., `""use strict"";`) at the beginning of a script, module, or function). + + ## Options + +-This rule, in it's default state, does not require any arguments. If you would like to enable one or more of the following you may pass an object with the options set as follows: ++This rule, in its default state, does not require any arguments. If you would like to enable one or more of the following you may pass an object with the options set as follows: + + * `allowShortCircuit` set to `true` will allow you to use short circuit evaluations in your expressions (Default: `false`). + * `allowTernary` set to `true` will enable you use ternary operators in your expressions similarly to short circuit evaluations (Default: `false`). +@@ -39,6 +41,21 @@ a && b() + a, b() + + c = a, b; ++ ++a() && function namedFunctionInExpressionContext () {f();} ++ ++(function anIncompleteIIFE () {}); ++ ++``` ++ ++Note that one or more string expression statements (with or without semi-colons) will only be considered as unused if they are not in the beginning of a script, module, or function (alone and uninterrupted by other statements). Otherwise, they will be treated as part of a ""directive prologue"", a section potentially usable by JavaScript engines. This includes ""strict mode"" directives. ++ ++```js ++""use strict""; ++""use asm"" ++""use stricter""; ++""use babel"" ++""any other strings like this in the prologue""; + ``` + + The following patterns are not considered problems by default: +@@ -46,7 +63,13 @@ The following patterns are not considered problems by default: + ```js + /*eslint no-unused-expressions: 2*/ + +-{} ++{} // In this context, this is a block statement, not an object literal ++ ++{myLabel: someVar} // In this context, this is a block statement with a label and expression, not an object literal ++ ++function namedFunctionDeclaration () {} ++ ++(function aGenuineIIFE () {}()); + + f()" +dgraph,https://github.com/hypermodeinc/dgraph,1e13e78d9969c1658d1399ee312059c598b106d3,Daniel Mai,2019-02-02 00:22:53,docs: Add X-Dgraph-CommitNow header to HTTP mutations.,"* Remove trailing space. + +Follow up to #2965.","docs: Add X-Dgraph-CommitNow header to HTTP mutations. + +* Remove trailing space. + +Follow up to #2965.","diff --git a/wiki/content/mutations/index.md b/wiki/content/mutations/index.md +index 8a66c9aa638..60eb8ed461d 100644 +--- a/wiki/content/mutations/index.md ++++ b/wiki/content/mutations/index.md +@@ -270,12 +270,12 @@ Deleting the value of a non-list predicate (i.e a 1-to-1 relation) can be done i + + ## Mutations using cURL + +-Mutations can be done over HTTP by making a `POST` request to an Alpha's `/mutate` endpoint. On the command line this can be done with curl. ++Mutations can be done over HTTP by making a `POST` request to an Alpha's `/mutate` endpoint. On the command line this can be done with curl. To commit the mutation, pass the HTTP header `X-DgraphCommitNow: true`. + + To run a `set` mutation: + + ```sh +-curl -X POST localhost:8080/mutate -d $' ++curl -X POST -H 'X-Dgraph-CommitNow: true' localhost:8080/mutate -d $' + { + set { + _:alice ""Alice"" . +@@ -286,11 +286,11 @@ curl -X POST localhost:8080/mutate -d $' + To run a `delete` mutation: + + ```sh +-curl -X POST localhost:8080/mutate -d $' ++curl -X POST -H 'X-Dgraph-CommitNow: true' localhost:8080/mutate -d $' + { + delete { +- <0x56f33> * . +- #The ""0x56f33"" would be Alice's UID ++ # Example: Alice's UID is 0x56f33 ++ <0x56f33> * . + } + }' + ``` +@@ -298,7 +298,7 @@ curl -X POST localhost:8080/mutate -d $' + To run an RDF mutation stored in a file, use curl's `--data-binary` option so that, unlike the `-d` option, the data is not URL encoded. + + ``` +-curl -X POST localhost:8080/mutate --data-binary @mutation.txt ++curl -X POST -H 'X-Dgraph-CommitNow: true' localhost:8080/mutate --data-binary @mutation.txt + ``` + + ## JSON Mutation Format" +komorebi,https://github.com/LGUG2Z/komorebi,473e7cd6a0654f70a0ac45daed1ffc9566750765,LGUG2Z,2025-01-25 00:11:45,feat(config): add aspect ratios for float toggling,"This commit adds a new configuration option +""floating_window_aspect_ratio"", which users can manipulate to set their +desired window size when using the toggle-float command.","feat(config): add aspect ratios for float toggling + +This commit adds a new configuration option +""floating_window_aspect_ratio"", which users can manipulate to set their +desired window size when using the toggle-float command. + +resolve #1230","diff --git a/komorebi/src/lib.rs b/komorebi/src/lib.rs +index 38a83c505..8899700b2 100644 +--- a/komorebi/src/lib.rs ++++ b/komorebi/src/lib.rs +@@ -219,6 +219,8 @@ lazy_static! { + + static ref WINDOWS_BY_BAR_HWNDS: Arc>>> = + Arc::new(Mutex::new(HashMap::new())); ++ ++ static ref FLOATING_WINDOW_TOGGLE_ASPECT_RATIO: Arc> = Arc::new(Mutex::new(AspectRatio::Predefined(PredefinedAspectRatio::Widescreen))); + } + + pub static DEFAULT_WORKSPACE_PADDING: AtomicI32 = AtomicI32::new(10); +diff --git a/komorebi/src/static_config.rs b/komorebi/src/static_config.rs +index bff6faa24..f9e965f9a 100644 +--- a/komorebi/src/static_config.rs ++++ b/komorebi/src/static_config.rs +@@ -35,13 +35,16 @@ use crate::window_manager::WindowManager; + use crate::window_manager_event::WindowManagerEvent; + use crate::windows_api::WindowsApi; + use crate::workspace::Workspace; ++use crate::AspectRatio; + use crate::Axis; + use crate::CrossBoundaryBehaviour; ++use crate::PredefinedAspectRatio; + use crate::DATA_DIR; + use crate::DEFAULT_CONTAINER_PADDING; + use crate::DEFAULT_WORKSPACE_PADDING; + use crate::DISPLAY_INDEX_PREFERENCES; + use crate::FLOATING_APPLICATIONS; ++use crate::FLOATING_WINDOW_TOGGLE_ASPECT_RATIO; + use crate::HIDING_BEHAVIOUR; + use crate::IGNORE_IDENTIFIERS; + use crate::LAYERED_WHITELIST; +@@ -382,6 +385,9 @@ pub struct StaticConfig { + /// HEAVILY DISCOURAGED: Identify applications for which komorebi should forcibly remove title bars + #[serde(skip_serializing_if = ""Option::is_none"")] + pub remove_titlebar_applications: Option>, ++ /// Aspect ratio to resize with when toggling floating mode for a window ++ #[serde(skip_serializing_if = ""Option::is_none"")] ++ pub floating_window_aspect_ratio: Option, + } + + #[derive(Debug, Serialize, Deserialize, JsonSchema)] +@@ -637,6 +643,7 @@ impl From<&WindowManager> for StaticConfig { + slow_application_identifiers: Option::from(SLOW_APPLICATION_IDENTIFIERS.lock().clone()), + bar_configurations: None, + remove_titlebar_applications: Option::from(NO_TITLEBAR.lock().clone()), ++ floating_window_aspect_ratio: Option::from(*FLOATING_WINDOW_TOGGLE_ASPECT_RATIO.lock()), + } + } + } +@@ -644,6 +651,10 @@ impl From<&WindowManager> for StaticConfig { + impl StaticConfig { + #[allow(clippy::cognitive_complexity, clippy::too_many_lines)] + fn apply_globals(&mut self) -> Result<()> { ++ *FLOATING_WINDOW_TOGGLE_ASPECT_RATIO.lock() = self ++ .floating_window_aspect_ratio ++ .unwrap_or(AspectRatio::Predefined(PredefinedAspectRatio::Standard)); ++ + if let Some(monitor_index_preferences) = &self.monitor_index_preferences { + let mut preferences = MONITOR_INDEX_PREFERENCES.lock(); + preferences.clone_from(monitor_index_preferences); +diff --git a/komorebi/src/window.rs b/komorebi/src/window.rs +index 32af415a2..358da4821 100644 +--- a/komorebi/src/window.rs ++++ b/komorebi/src/window.rs +@@ -15,6 +15,7 @@ use crate::focus_manager; + use crate::stackbar_manager; + use crate::windows_api; + use crate::AnimationStyle; ++use crate::FLOATING_WINDOW_TOGGLE_ASPECT_RATIO; + use crate::SLOW_APPLICATION_COMPENSATION_TIME; + use crate::SLOW_APPLICATION_IDENTIFIERS; + use std::collections::HashMap; +@@ -296,6 +297,38 @@ impl RenderDispatcher for TransparencyRenderDispatcher { + } + } + ++#[derive(Copy, Clone, Debug, Serialize, Deserialize, JsonSchema)] ++#[serde(untagged)] ++pub enum AspectRatio { ++ /// A predefined aspect ratio ++ Predefined(PredefinedAspectRatio), ++ /// A custom W:H aspect ratio ++ Custom(i32, i32), ++} ++ ++#[derive(Copy, Clone, Debug, Serialize, Deserialize, JsonSchema)] ++pub enum PredefinedAspectRatio { ++ /// 21:9 ++ Ultrawide, ++ /// 16:9 ++ Widescreen, ++ /// 4:3 ++ Standard, ++} ++ ++impl AspectRatio { ++ pub fn width_and_height(self) -> (i32, i32) { ++ match self { ++ AspectRatio::Predefined(predefined) => match predefined { ++ PredefinedAspectRatio::Ultrawide => (21, 9), ++ PredefinedAspectRatio::Widescreen => (16, 9), ++ PredefinedAspectRatio::Standard => (4, 3), ++ }, ++ AspectRatio::Custom(w, h) => (w, h), ++ } ++ } ++} ++ + impl Window { + pub const fn hwnd(self) -> HWND { + HWND(windows_api::as_ptr!(self.hwnd)) +@@ -369,15 +402,21 @@ impl Window { + } + + pub fn center(&mut self, work_area: &Rect) -> Result<()> { +- let half_width = work_area.right / 2; +- let half_weight = work_area.bottom / 2; ++ let (aspect_ratio_width, aspect_ratio_height) = FLOATING_WINDOW_TOGGLE_ASPECT_RATIO ++ .lock() ++ .width_and_height(); ++ let target_height = work_area.bottom / 2; ++ let target_width = (target_height * aspect_ratio_width) / aspect_ratio_height; ++ ++ let x = work_area.left + ((work_area.right - target_width) / 2); ++ let y = work_area.top + ((work_area.bottom - target_height) / 2); + + self.set_position( + &Rect { +- left: work_area.left + ((work_area.right - half_width) / 2), +- top: work_area.top + ((work_area.bottom - half_weight) / 2), +- right: half_width, +- bottom: half_weight, ++ left: x, ++ top: y, ++ right: target_width, ++ bottom: target_height, + }, + true, + ) +@@ -928,12 +967,12 @@ fn window_is_eligible( + } + + if (allow_wsl2_gui || allow_titlebar_removed || style.contains(WindowStyle::CAPTION) && ex_style.contains(ExtendedWindowStyle::WINDOWEDGE)) +- && !ex_style.contains(ExtendedWindowStyle::DLGMODALFRAME) +- // Get a lot of dupe events coming through that make the redrawing go crazy +- // on FocusChange events if I don't filter out this one. But, if we are +- // allowing a specific layered window on the whitelist (like Steam), it should +- // pass this check +- && (allow_layered || !ex_style.contains(ExtendedWindowStyle::LAYERED)) ++ && !ex_style.contains(ExtendedWindowStyle::DLGMODALFRAME) ++ // Get a lot of dupe events coming through that make the redrawing go crazy ++ // on FocusChange events if I don't filter out this one. But, if we are ++ // allowing a specific layered window on the whitelist (like Steam), it should ++ // pass this check ++ && (allow_layered || !ex_style.contains(ExtendedWindowStyle::LAYERED)) + || managed_override + { + return true; +diff --git a/schema.bar.json b/schema.bar.json +index 718029a9a..9599d49e7 100644 +--- a/schema.bar.json ++++ b/schema.bar.json +@@ -1,7 +1,7 @@ + { + ""$schema"": ""http://json-schema.org/draft-07/schema#"", + ""title"": ""KomobarConfig"", +- ""description"": ""The `komorebi.bar.json` configuration file reference for `v0.1.33`"", ++ ""description"": ""The `komorebi.bar.json` configuration file reference for `v0.1.34`"", + ""type"": ""object"", + ""required"": [ + ""left_widgets"", +@@ -1219,58 +1219,6 @@ + ""type"": ""number"", + ""format"": ""float"" + }, +- ""horizontal_margin"": { +- ""description"": ""Bar horizontal margin. Use one value for symmetric margin or use `[left, right]` to specify a different margin on each side (default: 0)"", +- ""anyOf"": [ +- { +- ""description"": ""A symmetric spacing on some axis (horizontal or vertical), with the same size on both sides"", +- ""type"": ""number"", +- ""format"": ""float"" +- }, +- { +- ""description"": ""A detailed spacing on some axis (horizontal or vertical), with a size for each side. If an horizontal spacing, then it will be (left, right), if vertical it will be (top, bottom)"", +- ""type"": ""array"", +- ""items"": [ +- { +- ""type"": ""number"", +- ""format"": ""float"" +- }, +- { +- ""type"": ""number"", +- ""format"": ""float"" +- } +- ], +- ""maxItems"": 2, +- ""minItems"": 2 +- } +- ] +- }, +- ""horizontal_padding"": { +- ""description"": ""Bar horizontal padding. Use one value for symmetric padding or use `[left, right]` to specify a different padding on each side (default: 10)"", +- ""anyOf"": [ +- { +- ""description"": ""A symmetric spacing on some axis (horizontal or vertical), with the same size on both sides"", +- ""type"": ""number"", +- ""format"": ""float"" +- }, +- { +- ""description"": ""A detailed spacing on some axis (horizontal or vertical), with a size for each side. If an horizontal spacing, then it will be (left, right), if vertical it will be (top, bottom)"", +- ""type"": ""array"", +- ""items"": [ +- { +- ""type"": ""number"", +- ""format"": ""float"" +- }, +- { +- ""type"": ""number"", +- ""format"": ""float"" +- } +- ], +- ""maxItems"": 2, +- ""minItems"": 2 +- } +- ] +- }, + ""icon_scale"": { + ""description"": ""Scale of the icons relative to the font_size [[1.0-2.0]]. (default: 1.4)"", + ""type"": ""number"", +@@ -2141,6 +2089,93 @@ + ] + } + }, ++ ""margin"": { ++ ""description"": ""Bar margin. Use one value for all sides or use a grouped margin for horizontal and/or vertical definition which can each take a single value for a symmetric margin or two values for each side, i.e.: ```json \""margin\"": { \""horizontal\"": 10 } ``` or: ```json \""margin\"": { \""vertical\"": [top, bottom] } ``` You can also set individual margin on each side like this: ```json \""margin\"": { \""top\"": 10, \""bottom\"": 10, \""left\"": 10, \""right\"": 10, } ``` By default, margin is set to 0 on all sides."", ++ ""anyOf"": [ ++ { ++ ""type"": ""number"", ++ ""format"": ""float"" ++ }, ++ { ++ ""type"": ""object"", ++ ""required"": [ ++ ""bottom"", ++ ""left"", ++ ""right"", ++ ""top"" ++ ], ++ ""properties"": { ++ ""bottom"": { ++ ""type"": ""number"", ++ ""format"": ""float"" ++ }, ++ ""left"": { ++ ""type"": ""number"", ++ ""format"": ""float"" ++ }, ++ ""right"": { ++ ""type"": ""number"", ++ ""format"": ""float"" ++ }, ++ ""top"": { ++ ""type"": ""number"", ++ ""format"": ""float"" ++ } ++ } ++ }, ++ { ++ ""type"": ""object"", ++ ""properties"": { ++ ""horizontal"": { ++ ""anyOf"": [ ++ { ++ ""type"": ""number"", ++ ""format"": ""float"" ++ }, ++ { ++ ""type"": ""array"", ++ ""items"": [ ++ { ++ ""type"": ""number"", ++ ""format"": ""float"" ++ }, ++ { ++ ""type"": ""number"", ++ ""format"": ""float"" ++ } ++ ], ++ ""maxItems"": 2, ++ ""minItems"": 2 ++ } ++ ] ++ }, ++ ""vertical"": { ++ ""anyOf"": [ ++ { ++ ""type"": ""number"", ++ ""format"": ""float"" ++ }, ++ { ++ ""type"": ""array"", ++ ""items"": [ ++ { ++ ""type"": ""number"", ++ ""format"": ""float"" ++ }, ++ { ++ ""type"": ""number"", ++ ""format"": ""float"" ++ } ++ ], ++ ""maxItems"": 2, ++ ""minItems"": 2 ++ } ++ ] ++ } ++ } ++ } ++ ] ++ }, + ""max_label_width"": { + ""description"": ""Max label width before text truncation (default: 400.0)"", + ""type"": ""number"", +@@ -2204,6 +2239,93 @@ + } + ] + }, ++ ""padding"": { ++ ""description"": ""Bar padding. Use one value for all sides or use a grouped padding for horizontal and/or vertical definition which can each take a single value for a symmetric padding or two values for each side, i.e.: ```json \""padding\"": { \""horizontal\"": 10 } ``` or: ```json \""padding\"": { \""horizontal\"": [left, right] } ``` You can also set individual padding on each side like this: ```json \""padding\"": { \""top\"": 10, \""bottom\"": 10, \""left\"": 10, \""right\"": 10, } ``` By default, padding is set to 10 on all sides."", ++ ""anyOf"": [ ++ { ++ ""type"": ""number"", ++ ""format"": ""float"" ++ }, ++ { ++ ""type"": ""object"", ++ ""required"": [ ++ ""bottom"", ++ ""left"", ++ ""right"", ++ ""top"" ++ ], ++ ""properties"": { ++ ""bottom"": { ++ ""type"": ""number"", ++ ""format"": ""float"" ++ }, ++ ""left"": { ++ ""type"": ""number"", ++ ""format"": ""float"" ++ }, ++ ""right"": { ++ ""type"": ""number"", ++ ""format"": ""float"" ++ }, ++ ""top"": { ++ ""type"": ""number"", ++ ""format"": ""float"" ++ } ++ } ++ }, ++ { ++ ""type"": ""object"", ++ ""properties"": { ++ ""horizontal"": { ++ ""anyOf"": [ ++ { ++ ""type"": ""number"", ++ ""format"": ""float"" ++ }, ++ { ++ ""type"": ""array"", ++ ""items"": [ ++ { ++ ""type"": ""number"", ++ ""format"": ""float"" ++ }, ++ { ++ ""type"": ""number"", ++ ""format"": ""float"" ++ } ++ ], ++ ""maxItems"": 2, ++ ""minItems"": 2 ++ } ++ ] ++ }, ++ ""vertical"": { ++ ""anyOf"": [ ++ { ++ ""type"": ""number"", ++ ""format"": ""float"" ++ }, ++ { ++ ""type"": ""array"", ++ ""items"": [ ++ { ++ ""type"": ""number"", ++ ""format"": ""float"" ++ }, ++ { ++ ""type"": ""number"", ++ ""format"": ""float"" ++ } ++ ], ++ ""maxItems"": 2, ++ ""minItems"": 2 ++ } ++ ] ++ } ++ } ++ } ++ ] ++ }, + ""position"": { + ""description"": ""Bar positioning options"", + ""type"": ""object"", +@@ -3495,58 +3617,6 @@ + ""format"": ""uint8"", + ""minimum"": 0.0 + }, +- ""vertical_margin"": { +- ""description"": ""Bar vertical margin. Use one value for symmetric margin or use `[top, bottom]` to specify a different margin on each side (default: 0)"", +- ""anyOf"": [ +- { +- ""description"": ""A symmetric spacing on some axis (horizontal or vertical), with the same size on both sides"", +- ""type"": ""number"", +- ""format"": ""float"" +- }, +- { +- ""description"": ""A detailed spacing on some axis (horizontal or vertical), with a size for each side. If an horizontal spacing, then it will be (left, right), if vertical it will be (top, bottom)"", +- ""type"": ""array"", +- ""items"": [ +- { +- ""type"": ""number"", +- ""format"": ""float"" +- }, +- { +- ""type"": ""number"", +- ""format"": ""float"" +- } +- ], +- ""maxItems"": 2, +- ""minItems"": 2 +- } +- ] +- }, +- ""vertical_padding"": { +- ""description"": ""Bar vertical padding. Use one value for symmetric padding or use `[top, bottom]` to specify a different padding on each side (default: 10)"", +- ""anyOf"": [ +- { +- ""description"": ""A symmetric spacing on some axis (horizontal or vertical), with the same size on both sides"", +- ""type"": ""number"", +- ""format"": ""float"" +- }, +- { +- ""description"": ""A detailed spacing on some axis (horizontal or vertical), with a size for each side. If an horizontal spacing, then it will be (left, right), if vertical it will be (top, bottom)"", +- ""type"": ""array"", +- ""items"": [ +- { +- ""type"": ""number"", +- ""format"": ""float"" +- }, +- { +- ""type"": ""number"", +- ""format"": ""float"" +- } +- ], +- ""maxItems"": 2, +- ""minItems"": 2 +- } +- ] +- }, + ""widget_spacing"": { + ""description"": ""Spacing between widgets (default: 10.0)"", + ""type"": ""number"", +diff --git a/schema.json b/schema.json +index adecf401d..c9de2b2f3 100644 +--- a/schema.json ++++ b/schema.json +@@ -1,7 +1,7 @@ + { + ""$schema"": ""http://json-schema.org/draft-07/schema#"", + ""title"": ""StaticConfig"", +- ""description"": ""The `komorebi.json` static configuration file reference for `v0.1.33`"", ++ ""description"": ""The `komorebi.json` static configuration file reference for `v0.1.34`"", + ""type"": ""object"", + ""properties"": { + ""animation"": { +@@ -642,6 +642,39 @@ + ] + } + }, ++ ""floating_window_aspect_ratio"": { ++ ""description"": ""Aspect ratio to resize with when toggling floating mode for a window"", ++ ""anyOf"": [ ++ { ++ ""description"": ""21:9"", ++ ""type"": ""null"" ++ }, ++ { ++ ""description"": ""16:9"", ++ ""type"": ""null"" ++ }, ++ { ++ ""description"": ""4:3"", ++ ""type"": ""null"" ++ }, ++ { ++ ""description"": ""A custom W:H aspect ratio"", ++ ""type"": ""array"", ++ ""items"": [ ++ { ++ ""type"": ""integer"", ++ ""format"": ""int32"" ++ }, ++ { ++ ""type"": ""integer"", ++ ""format"": ""int32"" ++ } ++ ], ++ ""maxItems"": 2, ++ ""minItems"": 2 ++ } ++ ] ++ }, + ""focus_follows_mouse"": { + ""description"": ""END OF LIFE FEATURE: Use https://github.com/LGUG2Z/masir instead"", + ""oneOf"": [" +angular,https://github.com/angular/angular,635683ae97480a621cde4d77fb48266d9f6ea8d8,Esteban Gehring,2022-02-08 23:26:28,docs(common): mark lifecycle methods as nodoc (#45017),PR Close #45017,"docs(common): mark lifecycle methods as nodoc (#45017) + +PR Close #45017","diff --git a/packages/common/src/directives/ng_component_outlet.ts b/packages/common/src/directives/ng_component_outlet.ts +index 3d87863d5a9fa1..21249f397a9bc6 100644 +--- a/packages/common/src/directives/ng_component_outlet.ts ++++ b/packages/common/src/directives/ng_component_outlet.ts +@@ -86,6 +86,7 @@ export class NgComponentOutlet implements OnChanges, OnDestroy { + + constructor(private _viewContainerRef: ViewContainerRef) {} + ++ /** @nodoc */ + ngOnChanges(changes: SimpleChanges) { + const { + _viewContainerRef: viewContainerRef, +@@ -119,6 +120,7 @@ export class NgComponentOutlet implements OnChanges, OnDestroy { + } + } + ++ /** @nodoc */ + ngOnDestroy() { + if (this._moduleRef) this._moduleRef.destroy(); + } +diff --git a/packages/common/src/directives/ng_for_of.ts b/packages/common/src/directives/ng_for_of.ts +index fccbb1c95d5522..96f35381af47c2 100644 +--- a/packages/common/src/directives/ng_for_of.ts ++++ b/packages/common/src/directives/ng_for_of.ts +@@ -201,6 +201,7 @@ export class NgForOf = NgIterable> implements DoCh + + /** + * Applies the changes when needed. ++ * @nodoc + */ + ngDoCheck(): void { + if (this._ngForOfDirty) { +diff --git a/packages/common/src/directives/ng_switch.ts b/packages/common/src/directives/ng_switch.ts +index f4c18eec6c580a..a17aa58392d54a 100644 +--- a/packages/common/src/directives/ng_switch.ts ++++ b/packages/common/src/directives/ng_switch.ts +@@ -210,6 +210,7 @@ export class NgSwitchCase implements DoCheck { + + /** + * Performs case matching. For internal use only. ++ * @nodoc + */ + ngDoCheck() { + this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase)); +diff --git a/packages/common/src/directives/ng_template_outlet.ts b/packages/common/src/directives/ng_template_outlet.ts +index 4ddb84391b119b..ed8a8d198428a9 100644 +--- a/packages/common/src/directives/ng_template_outlet.ts ++++ b/packages/common/src/directives/ng_template_outlet.ts +@@ -51,6 +51,7 @@ export class NgTemplateOutlet implements OnChanges { + + constructor(private _viewContainerRef: ViewContainerRef) {} + ++ /** @nodoc */ + ngOnChanges(changes: SimpleChanges) { + if (changes['ngTemplateOutlet']) { + const viewContainerRef = this._viewContainerRef; +diff --git a/packages/common/src/location/hash_location_strategy.ts b/packages/common/src/location/hash_location_strategy.ts +index ceba0bc9bb28fd..1c16af2bd5489d 100644 +--- a/packages/common/src/location/hash_location_strategy.ts ++++ b/packages/common/src/location/hash_location_strategy.ts +@@ -46,6 +46,7 @@ export class HashLocationStrategy extends LocationStrategy implements OnDestroy + } + } + ++ /** @nodoc */ + ngOnDestroy(): void { + while (this._removeListenerFns.length) { + this._removeListenerFns.pop()!(); +diff --git a/packages/common/src/location/location_strategy.ts b/packages/common/src/location/location_strategy.ts +index 8e525944c48516..43597911efee3d 100644 +--- a/packages/common/src/location/location_strategy.ts ++++ b/packages/common/src/location/location_strategy.ts +@@ -7,7 +7,9 @@ + */ + + import {Inject, Injectable, InjectionToken, OnDestroy, Optional, ɵɵinject} from '@angular/core'; ++ + import {DOCUMENT} from '../dom_tokens'; ++ + import {LocationChangeListener, PlatformLocation} from './platform_location'; + import {joinWithSlash, normalizeQueryParams} from './util'; + +@@ -129,6 +131,7 @@ export class PathLocationStrategy extends LocationStrategy implements OnDestroy + this._baseHref = href; + } + ++ /** @nodoc */ + ngOnDestroy(): void { + while (this._removeListenerFns.length) { + this._removeListenerFns.pop()!();" +consul,https://github.com/hashicorp/consul,3370f6b250a50148f1303c4d4f4d095f7f38911f,Michael Zalimeni,2024-10-16 20:06:04,chore: remove unintentionally committed consul-k8s submodule (#21833),"Also prevent future re-commits of this submodule path by adding to +.gitignore.","chore: remove unintentionally committed consul-k8s submodule (#21833) + +Also prevent future re-commits of this submodule path by adding to +.gitignore.","diff --git a/.gitignore b/.gitignore +index 9649c4a8cb98..fcd852606c5e 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -71,3 +71,6 @@ terraform.rc + /go.work + /go.work.sum + .docker ++ ++# Avoid accidental commits of consul-k8s submodule used by some dev environments ++consul-k8s/ +diff --git a/consul-k8s b/consul-k8s +deleted file mode 160000 +index 0d85bbc3131c..000000000000 +--- a/consul-k8s ++++ /dev/null +@@ -1 +0,0 @@ +-Subproject commit 0d85bbc3131ce8be23c57e30b213ba6056623976" +angular,https://github.com/angular/angular,2de34770c4dd75ee2854326a239277102af6df21,Kara Erickson,2020-05-06 00:25:58,docs: update deprecation guide to move deprecated APIs to removals (#36891),"Previously, using undecorated base classes and using +ModuleWithProviders without a generic were listed +as deprecated features. + +In v10, these features will be removed and an error +will be thrown instead. This commit updates the +deprecation guide to reflect this change. + +PR Close #36891","docs: update deprecation guide to move deprecated APIs to removals (#36891) + +Previously, using undecorated base classes and using +ModuleWithProviders without a generic were listed +as deprecated features. + +In v10, these features will be removed and an error +will be thrown instead. This commit updates the +deprecation guide to reflect this change. + +PR Close #36891","diff --git a/aio/content/guide/deprecations.md b/aio/content/guide/deprecations.md +index b4c0002d883ea..4a484da0fd9b2 100644 +--- a/aio/content/guide/deprecations.md ++++ b/aio/content/guide/deprecations.md +@@ -42,8 +42,6 @@ v9 - v12 + | `@angular/core` | [`ReflectiveKey`](#core) | v11 | + | `@angular/core` | [`RenderComponentType`](#core) | v11 | + | `@angular/core` | [`ViewEncapsulation.Native`](#core) | v11 | +-| `@angular/core` | [`ModuleWithProviders` without a generic](#moduleWithProviders) | v10 | +-| `@angular/core` | [Undecorated base classes that use Angular features](#undecorated-base-classes) | v10 | + | `@angular/forms` | [`ngModel` with reactive forms](#ngmodel-reactive) | v11 | + | `@angular/router` | [`preserveQueryParams`](#router) | v11 | + | `@angular/upgrade` | [`@angular/upgrade`](#upgrade) | v11 | +@@ -97,8 +95,6 @@ Tip: In the [API reference section](api) of this doc site, deprecated APIs are i + | [`defineInjectable`](api/core/defineInjectable) | `ɵɵdefineInjectable` | v8 | Used only in generated code. No source code should depend on this API. | + | [`entryComponents`](api/core/NgModule#entryComponents) | none | v9 | See [`entryComponents`](#entryComponents) | + | [`ANALYZE_FOR_ENTRY_COMPONENTS`](api/core/ANALYZE_FOR_ENTRY_COMPONENTS) | none | v9 | See [`ANALYZE_FOR_ENTRY_COMPONENTS`](#entryComponents) | +-| `ModuleWithProviders` without a generic | `ModuleWithProviders` with a generic | v9 | See [`ModuleWithProviders` section](#moduleWithProviders) | +-| Undecorated base classes that use Angular features | Base classes with `@Directive()` decorator that use Angular features | v9 | See [undecorated base classes section](#undecorated-base-classes) | + + + +@@ -377,60 +373,6 @@ However, in practice, Angular simply ignores two-way bindings to template variab + + ``` + +-{@a undecorated-base-classes} +-### Undecorated base classes using Angular features +- +-As of version 9, it's deprecated to have an undecorated base class that: +- +-- uses Angular features +-- is extended by a directive or component +- +-Angular lifecycle hooks or any of the following Angular field decorators are considered Angular features: +- +-- `@Input()` +-- `@Output()` +-- `@HostBinding()` +-- `@HostListener()` +-- `@ViewChild()` / `@ViewChildren()` +-- `@ContentChild()` / `@ContentChildren()` +- +-For example, the following case is deprecated because the base class uses `@Input()` and does not have a class-level decorator: +- +-```ts +-class Base { +- @Input() +- foo: string; +-} +- +-@Directive(...) +-class Dir extends Base { +- ngOnChanges(): void { +- // notified when bindings to [foo] are updated +- } +-} +-``` +- +-In a future version of Angular, this code will start to throw an error. +-To fix this example, add a selectorless `@Directive()` decorator to the base class: +- +-```ts +-@Directive() +-class Base { +- @Input() +- foo: string; +-} +- +-@Directive(...) +-class Dir extends Base { +- ngOnChanges(): void { +- // notified when bindings to [foo] are updated +- } +-} +-``` +- +-In version 9, the CLI has an automated migration that will update your code for you when `ng update` is run. +-See [the dedicated migration guide](guide/migration-undecorated-classes) for more information about the change and more examples. +- + + + {@a binding-to-innertext} +@@ -578,28 +520,14 @@ The final decision was made on three key points: + {@a removed} + ## Removed APIs + +-The following APIs have been removed starting with version 9.0.0*: ++The following APIs have been removed starting with version 10.0.0*: + + | Package | API | Replacement | Notes | + | ---------------- | -------------- | ----------- | ----- | +-| `@angular/core` | [`Renderer`](https://v8.angular.io/api/core/Renderer) | [`Renderer2`](https://angular.io/api/core/Renderer2) | [Migration guide](guide/migration-renderer) | +-| `@angular/core` | [`RootRenderer`](https://v8.angular.io/api/core/RootRenderer) | [`RendererFactory2`](https://angular.io/api/core/RendererFactory2) | none | +-| `@angular/core` | [`RenderComponentType`](https://v8.angular.io/api/core/RenderComponentType) | [`RendererType2`](https://angular.io/api/core/RendererType2) | none | +-| `@angular/core` | [`WtfScopeFn`](https://v8.angular.io/api/core/WtfScopeFn) | none | v8 | See [Web Tracing Framework](#wtf) | +-| `@angular/core` | [`wtfCreateScope`](https://v8.angular.io/api/core/wtfCreateScope) | none | v8 | See [Web Tracing Framework](#wtf) | +-| `@angular/core` | [`wtfStartTimeRange`](https://v8.angular.io/api/core/wtfStartTimeRange) | none | v8 | See [Web Tracing Framework](#wtf) | +-| `@angular/core` | [`wtfEndTimeRange`](https://v8.angular.io/api/core/wtfEndTimeRange) | none | v8 | See [Web Tracing Framework](#wtf) | +-| `@angular/core` | [`wtfLeave`](https://v8.angular.io/api/core/wtfLeave) | none | v8 | See [Web Tracing Framework](#wtf) | +-| `@angular/common` | `DeprecatedI18NPipesModule` | [`CommonModule`](api/common/CommonModule#pipes) | none | +-| `@angular/common` | `DeprecatedCurrencyPipe` | [`CurrencyPipe`](api/common/CurrencyPipe) | none | +-| `@angular/common` | `DeprecatedDatePipe` | [`DatePipe`](api/common/DatePipe) | none | +-| `@angular/common` | `DeprecatedDecimalPipe` | [`DecimalPipe`](api/common/DecimalPipe) | none | +-| `@angular/common` | `DeprecatedPercentPipe` | [`PercentPipe`](api/common/PercentPipe) | none | +-| `@angular/forms` | [`NgFormSelectorWarning`](https://v8.angular.io/api/forms/NgFormSelectorWarning) | none | none | +-| `@angular/forms` | `ngForm` element selector | `ng-form` element selector | none | +-| `@angular/service-worker` | `versionedFiles` | `files` | In the service worker configuration file `ngsw-config.json`, replace `versionedFiles` with `files`. See [Service Worker Configuration](guide/service-worker-config#assetgroups). | +- +-*To see APIs removed in version 8, check out this guide on the [version 8 docs site](https://v8.angular.io/guide/deprecations#removed). ++| `@angular/core` | Undecorated base classes that use Angular features | Add Angular decorator | See [migration guide](guide/migration-undecorated-classes) for more info | ++| `@angular/core` | `ModuleWithProviders` without a generic | `ModuleWithProviders` with a generic | See [migration guide](guide/migration-module-with-providers) for more info | ++ ++*To see APIs removed in version 9, check out this guide on the [version 9 docs site](https://v9.angular.io/guide/deprecations#removed). + + + +diff --git a/aio/content/guide/updating-to-version-9.md b/aio/content/guide/updating-to-version-9.md +index e692bac84c287..137b66976ca26 100644 +--- a/aio/content/guide/updating-to-version-9.md ++++ b/aio/content/guide/updating-to-version-9.md +@@ -37,8 +37,8 @@ See our [template type-checking guide](guide/template-typecheck) for more inform + | [`entryComponents`](api/core/NgModule#entryComponents) | none | See [`entryComponents`](guide/deprecations#entryComponents) | + | [`CurrencyPipe` - `DEFAULT_CURRENCY_CODE`](api/common/CurrencyPipe#currency-code-deprecation)| `{provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'}` | From v11 the default code will be extracted from the locale data given by `LOCAL_ID`, rather than `USD`. | + | [`ANALYZE_FOR_ENTRY_COMPONENTS`](api/core/ANALYZE_FOR_ENTRY_COMPONENTS) | none | See [`ANALYZE_FOR_ENTRY_COMPONENTS`](guide/deprecations#entryComponents) | +-| `ModuleWithProviders` without a generic | `ModuleWithProviders` with a generic | See [`ModuleWithProviders` section](guide/deprecations#moduleWithProviders) | +-| Undecorated base classes that use Angular features | Base classes with `@Directive()` decorator that use Angular features | See [undecorated base classes section](guide/deprecations#undecorated-base-classes) | ++| `ModuleWithProviders` without a generic | `ModuleWithProviders` with a generic | | ++| Undecorated base classes that use Angular features | Base classes with `@Directive()` decorator that use Angular features | | + | `esm5` and `fesm5` distribution in `@angular/*` npm packages | `esm2015` and `fesm2015` entrypoints | See [`esm5` and `fesm5`](guide/deprecations#esm5-fesm5) | + | [`TestBed.get`](api/core/testing/TestBed#get) | [`TestBed.inject`](api/core/testing/TestBed#inject) | Same behavior, but type safe. |" +serve,https://github.com/jina-ai/serve,60f80b2f9eead4929ea5ba3f2a7d937439604e87,Wang Bo,2021-01-22 21:00:52,test: use flow v1 in tests (#1752),"* feat: adjust flow v1 in tests + +* feat: adjust flow v1 in distributed tests + +* feat: adjust flow v1 in distributed tests + +* feat: adjust flow v1 in unit tests + +* test: remove version in empty flow","test: use flow v1 in tests (#1752) + +* feat: adjust flow v1 in tests + +* feat: adjust flow v1 in distributed tests + +* feat: adjust flow v1 in distributed tests + +* feat: adjust flow v1 in unit tests + +* test: remove version in empty flow","diff --git a/tests/distributed/test_index_query/flow.yml b/tests/distributed/test_index_query/flow.yml +index b3650e16a85ba..b4e1341f4a4a3 100644 +--- a/tests/distributed/test_index_query/flow.yml ++++ b/tests/distributed/test_index_query/flow.yml +@@ -1,17 +1,18 @@ + !Flow ++version: '1' + with: + read_only: true + rest_api: true + port_expose: $JINA_GATEWAY_REST_PORT + pods: +- encoder: ++ - name: encoder + # for now all the uploaded files are stored in the same folder, so no subpaths allowed in remote + uses: encode.yml + host: $JINA_ENCODER_HOST + port_expose: 8000 + upload_files: + - dummy-encoder.py +- indexer: ++ - name: indexer + # for now all the uploaded files are stored in the same folder, so no subpaths allowed in remote + uses: index.yml + read_only: False +diff --git a/tests/distributed/test_index_query_with_shards/flow.yml b/tests/distributed/test_index_query_with_shards/flow.yml +index 086508cb075a2..1444ca5f870ac 100644 +--- a/tests/distributed/test_index_query_with_shards/flow.yml ++++ b/tests/distributed/test_index_query_with_shards/flow.yml +@@ -1,17 +1,18 @@ + !Flow ++version: '1' + with: + read_only: true + rest_api: true + port_expose: $JINA_GATEWAY_REST_PORT + pods: +- encoder: ++ - name: encoder + # for now all the uploaded files are stored in the same folder, so no subpaths allowed in remote + uses: encode.yml + host: $JINA_ENCODER_HOST + port_expose: 8000 + upload_files: + - dummy-encoder.py +- indexer: ++ - name: indexer + # for now all the uploaded files are stored in the same folder, so no subpaths allowed in remote + uses: index.yml + read_only: False +@@ -19,7 +20,7 @@ pods: + polling: all + host: $JINA_INDEXER_HOST + port_expose: 8000 +- slice: ++ - name: slice + # for now all the uploaded files are stored in the same folder, so no subpaths allowed in remote + uses: slice.yml + host: $JINA_INDEXER_HOST +diff --git a/tests/distributed/test_local_flow_local_remote_local/flow.yml b/tests/distributed/test_local_flow_local_remote_local/flow.yml +index 1fcae309e2556..223965b6dcf85 100644 +--- a/tests/distributed/test_local_flow_local_remote_local/flow.yml ++++ b/tests/distributed/test_local_flow_local_remote_local/flow.yml +@@ -1,13 +1,14 @@ + !Flow ++version: '1' + with: + read_only: true + pods: +- crafter: ++ - name: crafter + # for now all the uploaded files are stored in the same folder, so no subpaths allowed in remote + uses: _pass + read_only: False + show-exc-info: True +- encoder: ++ - name: encoder + show-exc-info: True + uses: _pass + host: $JINA_ENCODER_HOST +@@ -15,7 +16,7 @@ pods: + port_ctrl: 45006 + port_expose: 8000 + needs: $JINA_ENCODER_NEEDS +- indexer: ++ - name: indexer + # for now all the uploaded files are stored in the same folder, so no subpaths allowed in remote + uses: _pass + read_only: False +diff --git a/tests/distributed/test_local_flow_remote_local_remote/flow.yml b/tests/distributed/test_local_flow_remote_local_remote/flow.yml +index 08060785cb4ee..06bd6912266d3 100644 +--- a/tests/distributed/test_local_flow_remote_local_remote/flow.yml ++++ b/tests/distributed/test_local_flow_remote_local_remote/flow.yml +@@ -1,8 +1,9 @@ + !Flow ++version: '1' + with: + read_only: true + pods: +- crafter: ++ - name: crafter + # for now all the uploaded files are stored in the same folder, so no subpaths allowed in remote + uses: _pass + host: $JINA_CRAFTER_HOST +@@ -10,11 +11,11 @@ pods: + port_in: 45000 + port_ctrl: 45001 + port_expose: 8000 +- encoder: ++ - name: encoder + show-exc-info: True + uses: _pass + needs: $JINA_ENCODER_NEEDS +- indexer: ++ - name: indexer + # for now all the uploaded files are stored in the same folder, so no subpaths allowed in remote + uses: _pass + read_only: False +diff --git a/tests/distributed/test_simple_distributed/flow.yml b/tests/distributed/test_simple_distributed/flow.yml +index a68d088c02bfd..a902fdbc29252 100644 +--- a/tests/distributed/test_simple_distributed/flow.yml ++++ b/tests/distributed/test_simple_distributed/flow.yml +@@ -1,10 +1,11 @@ + !Flow ++version: '1' + with: + read_only: true + rest_api: true + port_expose: $JINA_GATEWAY_REST_PORT + pods: +- encoder: ++ - name: encoder + # for now all the uploaded files are stored in the same folder, so no subpaths allowed in remote + uses: encode.yml + host: $JINA_ENCODER_HOST +@@ -12,7 +13,7 @@ pods: + show_exc_info: true + upload_files: + - dummy-encoder.py +- indexer: ++ - name: indexer + # for now all the uploaded files are stored in the same folder, so no subpaths allowed in remote + uses: index.yml + read_only: False +diff --git a/tests/distributed/test_simple_distributed_with_shards/flow.yml b/tests/distributed/test_simple_distributed_with_shards/flow.yml +index 19dfbd83c8d8a..c578bb1019303 100644 +--- a/tests/distributed/test_simple_distributed_with_shards/flow.yml ++++ b/tests/distributed/test_simple_distributed_with_shards/flow.yml +@@ -1,15 +1,16 @@ + !Flow ++version: '1' + with: + read_only: true + rest_api: true + port_expose: $JINA_GATEWAY_REST_PORT + pods: +- pod1: ++ - name: pod1 + uses: _pass + parallel: 3 + host: $JINA_POD1_HOST + port_expose: 8000 +- pod2: ++ - name: pod2 + uses: _pass + parallel: 3 + host: $JINA_POD2_HOST +diff --git a/tests/distributed/test_simple_hub_pods/flow.yml b/tests/distributed/test_simple_hub_pods/flow.yml +index 34dcbd861a52d..4ef7b4ef97cb9 100644 +--- a/tests/distributed/test_simple_hub_pods/flow.yml ++++ b/tests/distributed/test_simple_hub_pods/flow.yml +@@ -1,14 +1,15 @@ + !Flow ++version: '1' + with: + read_only: true + rest_api: true + port_expose: $JINA_GATEWAY_REST_PORT + pods: +- pod1: ++ - name: pod1 + uses: hubpod:test + host: $JINA_POD1_HOST + port_expose: 8000 +- pod2: ++ - name: pod2 + uses: hubpod:test + host: $JINA_POD2_HOST + port_expose: 8000 +diff --git a/tests/distributed/test_simple_local_remote/flow.yml b/tests/distributed/test_simple_local_remote/flow.yml +index 35972c0bcca48..c707dc2ebc8ed 100644 +--- a/tests/distributed/test_simple_local_remote/flow.yml ++++ b/tests/distributed/test_simple_local_remote/flow.yml +@@ -1,8 +1,9 @@ + !Flow ++version: '1' + with: + read_only: true + pods: +- encoder: ++ - name: encoder + # for now all the uploaded files are stored in the same folder, so no subpaths allowed in remote + uses: encode.yml + host: $JINA_ENCODER_HOST +@@ -11,7 +12,7 @@ pods: + port_expose: 8000 + upload_files: + - encode.yml +- indexer: ++ - name: indexer + # for now all the uploaded files are stored in the same folder, so no subpaths allowed in remote + uses: index.yml + read_only: False +diff --git a/tests/unit/flow/yaml/flow-legacy-syntax.yml b/tests/unit/flow/yaml/flow-legacy-syntax.yml +index 99e4be041de20..be08ce8f892f2 100644 +--- a/tests/unit/flow/yaml/flow-legacy-syntax.yml ++++ b/tests/unit/flow/yaml/flow-legacy-syntax.yml +@@ -1,12 +1,13 @@ + !Flow ++version: '1' + pods: +- pod0: ++ - name: pod0 + uses: _pass + needs: gateway +- pod1: ++ - name: pod1 + uses: _pass + needs: gateway +- pod2: ++ - name: pod2 + uses: _merge + needs: [pod1, pod0] + +diff --git a/tests/unit/flow/yaml/test-flow-port.yml b/tests/unit/flow/yaml/test-flow-port.yml +index 4946bcd69b68f..eac8caa274200 100644 +--- a/tests/unit/flow/yaml/test-flow-port.yml ++++ b/tests/unit/flow/yaml/test-flow-port.yml +@@ -1,3 +1,4 @@ + !Flow ++version: '1' + with: + port_expose: 12345 +\ No newline at end of file +diff --git a/tests/unit/peapods/runtimes/container/flow.yml b/tests/unit/peapods/runtimes/container/flow.yml +index 0a434a2ac179e..dcc9aa6679058 100644 +--- a/tests/unit/peapods/runtimes/container/flow.yml ++++ b/tests/unit/peapods/runtimes/container/flow.yml +@@ -1,6 +1,7 @@ + !Flow ++version: '1' + pods: +- pod1: ++ - name: pod1 + show-exc-info: true + uses: docker://jinahub/pod + docker-kwargs: +diff --git a/tests/unit/peapods/runtimes/remote/jinad/yamls/flow-index.yaml b/tests/unit/peapods/runtimes/remote/jinad/yamls/flow-index.yaml +index f2a5854549416..7a4c6679cc8d8 100644 +--- a/tests/unit/peapods/runtimes/remote/jinad/yamls/flow-index.yaml ++++ b/tests/unit/peapods/runtimes/remote/jinad/yamls/flow-index.yaml +@@ -1,10 +1,11 @@ + !Flow ++version: '1' + with: + compress_hwm: 1024 + pods: +- encode: ++ - name: encode + uses: yamls/encoder.yml + parallel: 2 +- index: ++ - name: index + uses: yamls/indexer.yml + shards: 2 +diff --git a/tests/unit/yaml/examples/faces/flow-index.yml b/tests/unit/yaml/examples/faces/flow-index.yml +index fbf91c56d503c..79607036ddf5d 100644 +--- a/tests/unit/yaml/examples/faces/flow-index.yml ++++ b/tests/unit/yaml/examples/faces/flow-index.yml +@@ -1,25 +1,26 @@ + !Flow ++version: '1' + metas: + prefetch: 10 + pods: +- loader: ++ - name: loader + parallel: 4 + read_only: true +- flipper: ++ - name: flipper + parallel: 4 + read_only: true +- normalizer: ++ - name: normalizer + parallel: 4 + read_only: true +- encoder: ++ - name: encoder + parallel: 4 + timeout_ready: 600000 + read_only: true +- chunk_indexer: ++ - name: chunk_indexer + parallel: 1 +- doc_indexer: ++ - name: doc_indexer + needs: loader +- join_all: ++ - name: join_all + uses: _pass + needs: [doc_indexer, chunk_indexer] + read_only: true +diff --git a/tests/unit/yaml/examples/faces/flow-query.yml b/tests/unit/yaml/examples/faces/flow-query.yml +index c716f8eb0eb92..b75bd23fbbf42 100644 +--- a/tests/unit/yaml/examples/faces/flow-query.yml ++++ b/tests/unit/yaml/examples/faces/flow-query.yml +@@ -1,25 +1,26 @@ + !Flow ++version: '1' + with: + read_only: true # better add this in the query time + port_expose: 5555 + pods: +- loader: ++ - name: loader + read_only: true + parallel: 4 +- flipper: ++ - name: flipper + parallel: 4 + read_only: true +- normalizer: ++ - name: normalizer + read_only: true + parallel: 4 +- encoder: ++ - name: encoder + timeout_ready: 600000 + parallel: 4 + read_only: true +- chunk_indexer: ++ - name: chunk_indexer + polling: all + parallel: 1 +- ranker: ++ - name: ranker + uses: _pass +- doc_indexer: ++ - name: doc_indexer + parallel: 1 +diff --git a/tests/unit/yaml/examples/faiss/flow-index.yml b/tests/unit/yaml/examples/faiss/flow-index.yml +index 4df73eaf8dff2..b746755856cfb 100644 +--- a/tests/unit/yaml/examples/faiss/flow-index.yml ++++ b/tests/unit/yaml/examples/faiss/flow-index.yml +@@ -1,16 +1,17 @@ + !Flow ++version: '1' + metas: + prefetch: 10 + pods: +- crafter: ++ - name: crafter + parallel: 4 +- encoder: ++ - name: encoder + parallel: 4 +- faiss_indexer: ++ - name: faiss_indexer + parallel: 1 +- doc_indexer: ++ - name: doc_indexer + needs: crafter +- join_all: ++ - name: join_all + uses: _pass + needs: [doc_indexer, faiss_indexer] + read_only: true +diff --git a/tests/unit/yaml/examples/faiss/flow-query.yml b/tests/unit/yaml/examples/faiss/flow-query.yml +index a00ef65b347a8..5245cf81cec01 100644 +--- a/tests/unit/yaml/examples/faiss/flow-query.yml ++++ b/tests/unit/yaml/examples/faiss/flow-query.yml +@@ -1,16 +1,17 @@ + !Flow ++version: '1' + with: + read_only: true + pods: +- crafter: ++ - name: crafter + parallel: 4 +- encoder: ++ - name: encoder + parallel: 4 +- faiss_indexer: ++ - name: faiss_indexer + parallel: 1 + timeout_ready: 10000 + volumes: './workspace' +- ranker: ++ - name: ranker + uses: _pass +- doc_indexer: ++ - name: doc_indexer + parallel: 1 +diff --git a/tests/unit/yaml/test-flow.yml b/tests/unit/yaml/test-flow.yml +index 91983da118fcd..6a4eec3539ce4 100644 +--- a/tests/unit/yaml/test-flow.yml ++++ b/tests/unit/yaml/test-flow.yml +@@ -1,15 +1,16 @@ + !Flow ++version: '1' + with: + sse_logger: false + pods: +- chunk_seg: ++ - name: chunk_seg + parallel: 3 +- wqncode1: ++ - name: wqncode1 + parallel: 2 + needs: chunk_seg +- encode2: ++ - name: encode2 + parallel: 2 + needs: chunk_seg +- joiner: ++ - name: joiner + uses: _pass + needs: [wqncode1, encode2] +diff --git a/tests/unit/yaml/test-if-flow.yml b/tests/unit/yaml/test-if-flow.yml +index cb040207be49f..6e4a76c3c0e8a 100644 +--- a/tests/unit/yaml/test-if-flow.yml ++++ b/tests/unit/yaml/test-if-flow.yml +@@ -1,7 +1,8 @@ + !Flow ++version: '1' + pods: +- encode1: ++ - name: encode1 + uses: test-if-encode1.yml +- encode2: ++ - name: encode2 + uses: test-if-encode2.yml + needs: gateway +\ No newline at end of file +diff --git a/tests/unit/yaml/test_flow_visualization.yml b/tests/unit/yaml/test_flow_visualization.yml +index 94e24776d1a98..d05e147debafa 100644 +--- a/tests/unit/yaml/test_flow_visualization.yml ++++ b/tests/unit/yaml/test_flow_visualization.yml +@@ -1,24 +1,25 @@ + !Flow ++version: '1' + pods: +- loader: ++ - name: loader + read_only: true +- normalizer: ++ - name: normalizer + read_only: true +- image_encoder: ++ - name: image_encoder + read_only: true + parallel: 4 +- image_vector_indexer: ++ - name: image_vector_indexer + read_only: true +- image_kv_indexer: ++ - name: image_kv_indexer + needs: [gateway] +- text_encoder: ++ - name: text_encoder + timeout_ready: 600000 + read_only: true + parallel: 4 + needs: [gateway] +- text_indexer: ++ - name: text_indexer + read_only: true +- join_all: ++ - name: join_all + uses: _pass + needs: [image_vector_indexer, image_kv_indexer, text_indexer] + read_only: true +\ No newline at end of file +diff --git a/tests/unit/yaml/test_log_server.yml b/tests/unit/yaml/test_log_server.yml +new file mode 100644 +index 0000000000000..c7527c052e2b7 +--- /dev/null ++++ b/tests/unit/yaml/test_log_server.yml +@@ -0,0 +1,5 @@ ++!Flow ++version: '1' ++with: ++ runtime: process ++ logserver: true" +sway,https://github.com/FuelLabs/sway,e21606144f3c3ced1a600e75c1c723135db4ac70,K1-R1,2024-10-16 14:25:03,fix: u256 log suggestions (#6645),"## Description + +u256.log() now always recovers the flag register. Additionally the +method now returns 0u256 with invalid args when unsafe math panic is +disabled.","fix: u256 log suggestions (#6645) + +## Description + +u256.log() now always recovers the flag register. Additionally the +method now returns 0u256 with invalid args when unsafe math panic is +disabled. + +Closes #6644 + +## Checklist + +- [x] I have linked to any relevant issues. +- [x] I have commented my code, particularly in hard-to-understand +areas. +- [x] I have updated the documentation where relevant (API docs, the +reference, and the Sway book). +- [x] If my change requires substantial documentation changes, I have +[requested support from the DevRel +team](https://github.com/FuelLabs/devrel-requests/issues/new/choose) +- [x] I have added tests that prove my fix is effective or that my +feature works. +- [x] I have added (or requested a maintainer to add) the necessary +`Breaking*` or `New Feature` labels where relevant. +- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs +Code Review +Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). +- [x] I have requested a review from the relevant team or maintainers.","diff --git a/sway-lib-std/src/math.sw b/sway-lib-std/src/math.sw +index a52627693ff..6ffd4071865 100644 +--- a/sway-lib-std/src/math.sw ++++ b/sway-lib-std/src/math.sw +@@ -339,10 +339,18 @@ impl Logarithm for u256 { + assert(base >= 2); + // Logarithm is undefined for 0 + assert(self != 0); ++ } else { ++ // Logarithm is undefined for bases less than 2 ++ // Logarithm is undefined for 0 ++ if (base < 2) || (self == 0) { ++ set_flags(flags); ++ return 0x00u256; ++ } + } + + // Decimals rounded to 0 + if self < base { ++ set_flags(flags); + return 0x00u256; + } + +diff --git a/test/src/in_language_tests/test_programs/bytes_inline_tests/src/main.sw b/test/src/in_language_tests/test_programs/bytes_inline_tests/src/main.sw +index 9a0b0eae392..65597943ef7 100644 +--- a/test/src/in_language_tests/test_programs/bytes_inline_tests/src/main.sw ++++ b/test/src/in_language_tests/test_programs/bytes_inline_tests/src/main.sw +@@ -716,7 +716,7 @@ fn bytes_append() { + + assert(bytes2.len() == second_length); + assert(!bytes2.is_empty()); +- ++ + assert(bytes2.get(0).unwrap() == d); + assert(bytes2.get(1).unwrap() == e); + assert(bytes2.get(2).unwrap() == f); +diff --git a/test/src/in_language_tests/test_programs/math_inline_tests/src/main.sw b/test/src/in_language_tests/test_programs/math_inline_tests/src/main.sw +index b294d52788b..c2641d71272 100644 +--- a/test/src/in_language_tests/test_programs/math_inline_tests/src/main.sw ++++ b/test/src/in_language_tests/test_programs/math_inline_tests/src/main.sw +@@ -1,6 +1,6 @@ + library; + +-use std::flags::disable_panic_on_overflow; ++use std::{flags::{disable_panic_on_overflow, disable_panic_on_unsafe_math}, registers::flags}; + + #[test] + fn math_root_u256() { +@@ -272,6 +272,7 @@ fn math_log_u8() { + #[test] + fn math_log_u256() { + let max_u256 = u256::max(); ++ let prior_flags = flags(); + assert(0x2u256.log(0x2u256) == 0x1u256); + assert(0x1u256.log(0x3u256) == 0); + assert(0x8u256.log(0x2u256) == 0x3u256); +@@ -279,6 +280,13 @@ fn math_log_u256() { + assert(0x64u256.log(0x2u256) == 0x6u256); + assert(0x64u256.log(0x9u256) == 0x2u256); + assert(max_u256.log(0x2u256) == 0xffu256); ++ assert(prior_flags == flags()); ++ ++ let _ = disable_panic_on_unsafe_math(); ++ let prior_flags = flags(); ++ assert(0x1u256.log(0x1u256) == 0); ++ assert(0x0u256.log(0x3u256) == 0); ++ assert(prior_flags == flags()); + } + + #[test]" +node,https://github.com/nodejs/node,f9bfe785ee4aaf2cffc3059b56dfa28d0bb9a57e,Luigi Pinca,2022-09-10 19:13:46,test: use python3 instead of python,"On some platforms, such as macOS, the `python` command is no longer +available by default.","test: use python3 instead of python + +On some platforms, such as macOS, the `python` command is no longer +available by default. + +PR-URL: https://github.com/nodejs/node/pull/44545 +Reviewed-By: Zeyu ""Alex"" Yang +Reviewed-By: Mohammed Keyvanzadeh +Reviewed-By: Daeyeon Jeong +Reviewed-By: Darshan Sen ","diff --git a/test/parallel/test-child-process-set-blocking.js b/test/parallel/test-child-process-set-blocking.js +index e2620cd84c8506..6dcfa931417c5d 100644 +--- a/test/parallel/test-child-process-set-blocking.js ++++ b/test/parallel/test-child-process-set-blocking.js +@@ -25,7 +25,7 @@ const assert = require('assert'); + const ch = require('child_process'); + + const SIZE = 100000; +-const python = process.env.PYTHON || 'python'; ++const python = process.env.PYTHON || (common.isWindows ? 'python' : 'python3'); + + const cp = ch.spawn(python, ['-c', `print(${SIZE} * ""C"")`], { + stdio: 'inherit'" +MaaAssistantArknights,https://github.com/MaaAssistantArknights/MaaAssistantArknights,0a53a99ff63497d0024a7dcb8e173822bfae5e0a,MistEO,2022-07-17 17:20:56,fix: fixed some recognition bugs and add docs,thanks for @natt3,"fix: fixed some recognition bugs and add docs + +thanks for @natt3","diff --git a/README-en.md b/README-en.md +index 87ddd765d51..6b4ffd8e7a5 100644 +--- a/README-en.md ++++ b/README-en.md +@@ -77,7 +77,7 @@ Please refer to: [FAQ](docs/en/FAQ.md) + - Global(EN) Client + Supports basic features like Combat, Recruiting, Visiting, Collocting, etc. See also [README](resource/global/YoStarEN/readme.md) + - JP Client +- Supports basic features like Combat, etc. See also [README](resource/global/YoStarJP/readme.md) ++ Supports basic features like Combat, Recruiting, Visiting, Collocting, etc. See also [README](resource/global/YoStarJP/readme.md) + - KR Client + Supports basic features like Combat, etc. See also [README](resource/global/YoStarKR/readme.md) + - ZH_CHT Client +diff --git a/README.md b/README.md +index 76a261baf30..5516a40de6a 100644 +--- a/README.md ++++ b/README.md +@@ -88,7 +88,7 @@ MAA 的意思是 MAA Assistant Arknights + - 国际服(美服) + 支持基本的刷理智、公招识别、访问好友、领取奖励功能,请参考 [说明](resource/global/YoStarEN/readme.md) + - 日服 +- 支持基本的刷理智功能,请参考 [说明](resource/global/YoStarJP/readme.md) ++ 支持基本的刷理智、公招识别、访问好友、领取奖励功能,请参考 [说明](resource/global/YoStarJP/readme.md) + - 韩服 + 支持基本的刷理智功能,请参考 [说明](resource/global/YoStarKR/readme.md) + - 繁中服 +diff --git a/resource/global/YoStarJP/readme.md b/resource/global/YoStarJP/readme.md +index 554eadab511..2c7b2e33469 100644 +--- a/resource/global/YoStarJP/readme.md ++++ b/resource/global/YoStarJP/readme.md +@@ -21,6 +21,9 @@ Now supports: + - Restore with potion + - Restore with Originite + - Set the max number of auto battles ++- Recruitment calculate ++- Friends visit ++- Award collect + + ## 日本 + +@@ -32,3 +35,6 @@ Now supports: + - ポーションで復元 + - Originiteで復元 + - 自動戦闘の最大数を設定します ++- 採用計算 ++- 友達が訪問 ++- アワードコレクト +diff --git a/resource/global/YoStarJP/resource/tasks.json b/resource/global/YoStarJP/resource/tasks.json +index 582f97ae8a4..e8d55b4db42 100644 +--- a/resource/global/YoStarJP/resource/tasks.json ++++ b/resource/global/YoStarJP/resource/tasks.json +@@ -98,7 +98,7 @@ + ""NoFriends"": { + ""algorithm"": ""OcrDetect"", + ""text"": [ +- ""No friends"" ++ ""戦友があリませれ"" + ], + ""roi"": [ + 650, +@@ -142,35 +142,35 @@ + ""远程位"" + ], + [ +- ""前衛タイプ"", ++ ""前衛タイ.*"", + ""近卫干员"" + ], + [ +- ""医療タイプ"", ++ ""医療タイ.*"", + ""医疗干员"" + ], + [ +- ""先鋒タイプ"", ++ ""先鋒タイ.*"", + ""先锋干员"" + ], + [ +- ""術師タイプ"", ++ ""術師タイ.*"", + ""术师干员"" + ], + [ +- ""狙撃タイプ"", ++ ""狙撃タイ.*"", + ""狙击干员"" + ], + [ +- ""重装タイプ"", ++ ""重装タイ.*"", + ""重装干员"" + ], + [ +- ""補助タイプ"", ++ ""補助タイ.*"", + ""辅助干员"" + ], + [ +- ""特殊タイプ"", ++ ""特殊タイ.*"", + ""特种干员"" + ], + [" +hoppscotch,https://github.com/hoppscotch/hoppscotch,c057c7ea24ce3e809dd0327fb80af497fd6cd331,dependabot-preview[bot],2020-01-25 05:44:47,chore(deps-dev): bump cypress from 3.8.2 to 3.8.3,"Bumps [cypress](https://github.com/cypress-io/cypress) from 3.8.2 to 3.8.3. +- [Release notes](https://github.com/cypress-io/cypress/releases) +- [Commits](https://github.com/cypress-io/cypress/compare/v3.8.2...v3.8.3)","chore(deps-dev): bump cypress from 3.8.2 to 3.8.3 + +Bumps [cypress](https://github.com/cypress-io/cypress) from 3.8.2 to 3.8.3. +- [Release notes](https://github.com/cypress-io/cypress/releases) +- [Commits](https://github.com/cypress-io/cypress/compare/v3.8.2...v3.8.3) + +Signed-off-by: dependabot-preview[bot] ","diff --git a/package-lock.json b/package-lock.json +index eb672b789c5..9e103468193 100644 +--- a/package-lock.json ++++ b/package-lock.json +@@ -4068,9 +4068,9 @@ + ""integrity"": ""sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk="" + }, + ""cypress"": { +- ""version"": ""3.8.2"", +- ""resolved"": ""https://registry.npmjs.org/cypress/-/cypress-3.8.2.tgz"", +- ""integrity"": ""sha512-aTs0u3+dfEuLe0Ct0FVO5jD1ULqxbuqWUZwzBm0rxdLgLxIAOI/A9f/WkgY5Cfy1TEXe8pKC6Wal0ZpnkdGRSw=="", ++ ""version"": ""3.8.3"", ++ ""resolved"": ""https://registry.npmjs.org/cypress/-/cypress-3.8.3.tgz"", ++ ""integrity"": ""sha512-I9L/d+ilTPPA4vq3NC1OPKmw7jJIpMKNdyfR8t1EXYzYCjyqbc59migOm1YSse/VRbISLJ+QGb5k4Y3bz2lkYw=="", + ""dev"": true, + ""requires"": { + ""@cypress/listr-verbose-renderer"": ""0.4.1"", +diff --git a/package.json b/package.json +index 73776225d2b..9f11bc9aa03 100644 +--- a/package.json ++++ b/package.json +@@ -38,7 +38,7 @@ + ""yargs-parser"": ""^16.1.0"" + }, + ""devDependencies"": { +- ""cypress"": ""^3.8.2"", ++ ""cypress"": ""^3.8.3"", + ""node-sass"": ""^4.13.1"", + ""sass-loader"": ""^8.0.2"", + ""start-server-and-test"": ""^1.10.6""" +fastify,https://github.com/fastify/fastify,088a07c2b26deb93d8d4cd64601bae3e09799b66,Ayoub El Khattabi,2020-12-16 13:42:45,fix: throw in `onSend` causes fastify to not respond (#2695),"* update test to support throw use case + +* wrap hook call in try catch block + +* add return statement","fix: throw in `onSend` causes fastify to not respond (#2695) + +* update test to support throw use case + +* wrap hook call in try catch block + +* add return statement + +Co-authored-by: Matteo Collina + +* handle throw for other hooks + +* handle errors thrown from a preparsing hook + +Co-authored-by: Matteo Collina ","diff --git a/lib/hooks.js b/lib/hooks.js +index 38d4831b82..a85d7c1fbe 100644 +--- a/lib/hooks.js ++++ b/lib/hooks.js +@@ -159,7 +159,13 @@ function hookRunner (functions, runner, request, reply, cb) { + return + } + +- const result = runner(functions[i++], request, reply, next) ++ let result ++ try { ++ result = runner(functions[i++], request, reply, next) ++ } catch (error) { ++ next(error) ++ return ++ } + if (result && typeof result.then === 'function') { + result.then(handleResolve, handleReject) + } +@@ -203,7 +209,13 @@ function onSendHookRunner (functions, request, reply, payload, cb) { + return + } + +- const result = functions[i++](request, reply, payload, next) ++ let result ++ try { ++ result = functions[i++](request, reply, payload, next) ++ } catch (error) { ++ next(error) ++ return ++ } + if (result && typeof result.then === 'function') { + result.then(handleResolve, handleReject) + } +diff --git a/lib/route.js b/lib/route.js +index 2f520b185f..c4727c4c3a 100644 +--- a/lib/route.js ++++ b/lib/route.js +@@ -415,11 +415,15 @@ function preParsingHookRunner (functions, request, reply, cb) { + + const fn = functions[i++] + let result +- +- if (fn[kHooksDeprecatedPreParsing]) { +- result = fn(request, reply, next) +- } else { +- result = fn(request, reply, request[kRequestPayloadStream], next) ++ try { ++ if (fn[kHooksDeprecatedPreParsing]) { ++ result = fn(request, reply, next) ++ } else { ++ result = fn(request, reply, request[kRequestPayloadStream], next) ++ } ++ } catch (error) { ++ next(error) ++ return + } + + if (result && typeof result.then === 'function') { +diff --git a/test/hooks.test.js b/test/hooks.test.js +index 6ef8d2d826..4b193352a5 100644 +--- a/test/hooks.test.js ++++ b/test/hooks.test.js +@@ -1174,13 +1174,18 @@ test('clear payload', t => { + }) + + test('onSend hook throws', t => { +- t.plan(7) ++ t.plan(9) + const fastify = Fastify() + fastify.addHook('onSend', function (request, reply, payload, done) { + if (request.raw.method === 'DELETE') { + done(new Error('some error')) + return + } ++ ++ if (request.raw.method === 'PUT') { ++ throw new Error('some error') ++ } ++ + done() + }) + +@@ -1192,6 +1197,10 @@ test('onSend hook throws', t => { + reply.send({ hello: 'world' }) + }) + ++ fastify.put('/', (req, reply) => { ++ reply.send({ hello: 'world' }) ++ }) ++ + fastify.listen(0, err => { + t.error(err) + fastify.server.unref() +@@ -1211,6 +1220,13 @@ test('onSend hook throws', t => { + t.error(err) + t.strictEqual(response.statusCode, 500) + }) ++ sget({ ++ method: 'PUT', ++ url: 'http://localhost:' + fastify.server.address().port ++ }, (err, response, body) => { ++ t.error(err) ++ t.strictEqual(response.statusCode, 500) ++ }) + }) + }) + +@@ -1526,6 +1542,31 @@ test('preHandler hooks should be able to block a request (last hook)', t => { + }) + }) + ++test('preParsing hooks should handle errors', t => { ++ t.plan(3) ++ const fastify = Fastify() ++ ++ fastify.addHook('preParsing', (req, reply, payload, done) => { ++ const e = new Error('kaboom') ++ e.statusCode = 501 ++ throw e ++ }) ++ ++ fastify.post('/', function (request, reply) { ++ reply.send(request.body) ++ }) ++ ++ fastify.inject({ ++ method: 'POST', ++ url: '/', ++ payload: { hello: 'world' } ++ }, (err, res) => { ++ t.error(err) ++ t.is(res.statusCode, 501) ++ t.deepEqual(JSON.parse(res.payload), { error: 'Not Implemented', message: 'kaboom', statusCode: 501 }) ++ }) ++}) ++ + test('onRequest respond with a stream', t => { + t.plan(4) + const fastify = Fastify() +diff --git a/test/internals/hookRunner.test.js b/test/internals/hookRunner.test.js +index 3f1d6c4cbd..ea1dab9fc4 100644 +--- a/test/internals/hookRunner.test.js ++++ b/test/internals/hookRunner.test.js +@@ -70,6 +70,38 @@ test('hookRunner - In case of error should skip to done', t => { + } + }) + ++test('hookRunner - Should handle throw', t => { ++ t.plan(7) ++ ++ hookRunner([fn1, fn2, fn3], iterator, 'a', 'b', done) ++ ++ function iterator (fn, a, b, next) { ++ return fn(a, b, next) ++ } ++ ++ function fn1 (a, b, next) { ++ t.strictEqual(a, 'a') ++ t.strictEqual(b, 'b') ++ next() ++ } ++ ++ function fn2 (a, b, next) { ++ t.strictEqual(a, 'a') ++ t.strictEqual(b, 'b') ++ throw new Error('kaboom') ++ } ++ ++ function fn3 () { ++ t.fail('We should not be here') ++ } ++ ++ function done (err, a, b) { ++ t.strictEqual(err.message, 'kaboom') ++ t.strictEqual(a, 'a') ++ t.strictEqual(b, 'b') ++ } ++}) ++ + test('hookRunner - Should handle promises', t => { + t.plan(9)" +fisher,https://github.com/jorgebucaran/fisher,3e4ae4b9603f49ef5d20ec048c0a994c5127cbb5,James Smith,2020-06-24 10:40:32,feat(ci): switch to GitHub Actions (#572),Migration will switch from Travis CI to GitHub Actions.,"feat(ci): switch to GitHub Actions (#572) + +Migration will switch from Travis CI to GitHub Actions. + +Closes #567","diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml +new file mode 100644 +index 00000000..575171dc +--- /dev/null ++++ b/.github/workflows/ci.yml +@@ -0,0 +1,20 @@ ++name: Continuous Integration ++ ++on: ++ push: ++ branches: [master] ++ ++jobs: ++ build: ++ runs-on: ubuntu-latest ++ steps: ++ - uses: actions/checkout@v2 ++ - name: Install dependencies ++ run: | ++ sudo add-apt-repository -y ppa:fish-shell/nightly-master ++ sudo apt-get update ++ sudo apt-get -y install fish ++ - name: Fetch and validate fisher install ++ run: | ++ curl https://git.io/fisher --create-dirs -sLo ~/.config/fish/functions/fisher.fish ++ fish -c ""fisher -v && fisher -h"" +diff --git a/.travis.yml b/.travis.yml +deleted file mode 100644 +index 57157358..00000000 +--- a/.travis.yml ++++ /dev/null +@@ -1,8 +0,0 @@ +-sudo: required +-before_install: +- - sudo add-apt-repository -y ppa:fish-shell/nightly-master +- - sudo apt-get update +- - sudo apt-get -y install fish +-script: +- - curl https://git.io/fisher --create-dirs -sLo ~/.config/fish/functions/fisher.fish +- - fish -c ""fisher -v && fisher -h"" +diff --git a/README.md b/README.md +index 570ae8c8..a25b4ee0 100644 +--- a/README.md ++++ b/README.md +@@ -1,4 +1,4 @@ +-# Fisher [![Releases](https://img.shields.io/github/release/jorgebucaran/fisher.svg?label=&color=0366d6)](https://github.com/jorgebucaran/fisher/releases/latest) ++# Fisher [![Releases](https://img.shields.io/github/release/jorgebucaran/fisher.svg?label=&color=0366d6)](https://github.com/jorgebucaran/fisher/releases/latest) ![Continuous Integration](https://github.com/jorgebucaran/fisher/workflows/Continuous%20Integration/badge.svg) + + Fisher is a package manager for the fish shell. It defines a common interface for package authors to build and distribute shell scripts in a portable way. You can use it to extend your shell capabilities, change the look of your prompt and create repeatable configurations across different systems effortlessly. + +@@ -237,7 +237,7 @@ You can install it with the `add` command followed by the path to the directory. + fisher add /absolute/path/to/fish-readme + ``` + +-To publish your pacckage put your code on GitHub, GitLab, BitBucket, or anywhere you like. Fisher is not a package registry. Its function is to fetch fish scripts and put them in place so that your shell can find them. ++To publish your pacckage put your code on GitHub, GitLab, BitBucket, or anywhere you like. Fisher is not a package registry. Its function is to fetch fish scripts and put them in place so that your shell can find them. + + Now let's install the package from the net. Open your [fishfile](#using-the-fishfile) and replace the local version of the package you added with the URL of the repository. Save your changes and run `fisher`." +cube,https://github.com/cube-js/cube,98ffad337f245f7b06d5fb4301a8b1efc46510ed,Victor Trapenok,2020-09-19 01:08:33,feat: `sqlAlias` attribute for `preAggregations` and short format for pre-aggregation table names (#1068),"* use seconds instead of ms + +* add maxLength for identifierRegex + +* Add preAggregations test + +* Draft for preAggregation.sqlAlias functionality + +* added sqlAlias and cat tables last update value + +* remove test code + +* tests and fix bug. + +* Add fail early checks for Postgres and Mysql pre-aggregation table names truncate issue + +* set oracle limit to 128 characters + +* add docs + +* code style fix + +* code style + +* use naming_version for preAggregation tables + +* error text + +* code style + +* added tests","feat: `sqlAlias` attribute for `preAggregations` and short format for pre-aggregation table names (#1068) + +* use seconds instead of ms + +* add maxLength for identifierRegex + +* Add preAggregations test + +* Draft for preAggregation.sqlAlias functionality + +* added sqlAlias and cat tables last update value + +* remove test code + +* tests and fix bug. + +* Add fail early checks for Postgres and Mysql pre-aggregation table names truncate issue + +* set oracle limit to 128 characters + +* add docs + +* code style fix + +* code style + +* use naming_version for preAggregation tables + +* error text + +* code style + +* added tests + +Fixes #86 +Fixes #907","diff --git a/docs/Schema/pre-aggregations.md b/docs/Schema/pre-aggregations.md +index 75eb9fdd1bd20..db83dc938e648 100644 +--- a/docs/Schema/pre-aggregations.md ++++ b/docs/Schema/pre-aggregations.md +@@ -23,6 +23,7 @@ Pre-aggregation name together with cube name will be used as a prefix for pre-ag + Pre-aggregations names should: + - Be unique within a cube + - Start with a lowercase letter ++- For long pre-aggregations names, you can set the `sqlAlias` attribute + + You can use `0-9`,`_` and letters when naming pre-aggregations. + +diff --git a/packages/cubejs-query-orchestrator/orchestrator/PreAggregations.js b/packages/cubejs-query-orchestrator/orchestrator/PreAggregations.js +index 0a735b974c40b..ccdf8208873e3 100644 +--- a/packages/cubejs-query-orchestrator/orchestrator/PreAggregations.js ++++ b/packages/cubejs-query-orchestrator/orchestrator/PreAggregations.js +@@ -7,10 +7,17 @@ const LocalCacheDriver = require('./LocalCacheDriver'); + const QueryCache = require('./QueryCache'); + const ContinueWaitError = require('./ContinueWaitError'); + +-function version(cacheKey) { ++function encodeTimeStamp(time) { ++ return Math.floor(time / 1000).toString(32); ++} ++ ++function version(cacheKey, isDigestKey = false) { + let result = ''; + const hashCharset = 'abcdefghijklmnopqrstuvwxyz012345'; +- const digestBuffer = crypto.createHash('md5').update(JSON.stringify(cacheKey)).digest(); ++ let digestBuffer = Number(cacheKey); ++ if (!isDigestKey) { ++ digestBuffer = crypto.createHash('md5').update(JSON.stringify(cacheKey)).digest(); ++ } + + let residue = 0; + let shiftCounter = 0; +@@ -35,15 +42,25 @@ const tablesToVersionEntries = (schema, tables) => R.sortBy( + table => -table.last_updated_at, + tables.map(table => { + const match = (table.table_name || table.TABLE_NAME).match(/(.+)_(.+)_(.+)_(.+)/); +- if (match) { +- return { +- table_name: `${schema}.${match[1]}`, +- content_version: match[2], +- structure_version: match[3], +- last_updated_at: parseInt(match[4], 10) +- }; ++ ++ if (!match) { ++ return null; + } +- return null; ++ ++ const entity = { ++ table_name: `${schema}.${match[1]}`, ++ content_version: match[2], ++ structure_version: match[3] ++ }; ++ ++ if (match[4].length < 13) { ++ entity.last_updated_at = parseInt(match[4], 32) * 1000; ++ entity.naming_version = 2; ++ } else { ++ entity.last_updated_at = parseInt(match[4], 10); ++ } ++ ++ return entity; + }).filter(R.identity) + ); + +@@ -304,11 +321,13 @@ class PreAggregationLoader { + ) || versionEntries.find( + e => e.table_name === this.preAggregation.tableName + ); ++ + const newVersionEntry = { + table_name: this.preAggregation.tableName, + structure_version: structureVersion, + content_version: contentVersion, +- last_updated_at: new Date().getTime() ++ last_updated_at: new Date().getTime(), ++ naming_version: 2, + }; + + const mostRecentTargetTableName = async () => { +@@ -738,6 +757,10 @@ class PreAggregations { + } + + static targetTableName(versionEntry) { ++ if (versionEntry.naming_version === 2) { ++ return `${versionEntry.table_name}_${versionEntry.content_version}_${versionEntry.structure_version}_${encodeTimeStamp(versionEntry.last_updated_at)}`; ++ } ++ + return `${versionEntry.table_name}_${versionEntry.content_version}_${versionEntry.structure_version}_${versionEntry.last_updated_at}`; + } + } +diff --git a/packages/cubejs-query-orchestrator/test/PreAggregations.test.js b/packages/cubejs-query-orchestrator/test/PreAggregations.test.js +index 20712ed54d48e..9079f4bd30835 100644 +--- a/packages/cubejs-query-orchestrator/test/PreAggregations.test.js ++++ b/packages/cubejs-query-orchestrator/test/PreAggregations.test.js +@@ -252,4 +252,86 @@ describe('PreAggregations', () => { + expect(result[0][1].targetTableName).toMatch(/stb_pre_aggregations.orders_number_and_count20191101_kjypcoio_5yftl5il/); + }); + }); ++ ++ describe(`naming_version tests`, () => { ++ let preAggregations = null; ++ let PreAggregations = null; ++ ++ beforeEach(async () => { ++ PreAggregations = require('../orchestrator/PreAggregations'); ++ preAggregations = new PreAggregations( ++ ""TEST"", ++ mockDriverFactory, ++ (msg, params) => {}, ++ queryCache, ++ { ++ queueOptions: { ++ executionTimeout: 1 ++ }, ++ externalDriverFactory: async () => { ++ const driver = mockExternalDriver; ++ driver.createTable(""stb_pre_aggregations.orders_number_and_count20191101_kjypcoio_5yftl5il_1593709044209""); ++ driver.createTable(""stb_pre_aggregations.orders_number_and_count20191101_kjypcoio_5yftl5il_1fm6652""); ++ return driver; ++ }, ++ }, ++ ); ++ }); ++ ++ test('test for function targetTableName', () => { ++ let result = PreAggregations.targetTableName({ ++ table_name:'orders_number_and_count20191101', ++ content_version:'kjypcoio', ++ structure_version:'5yftl5il', ++ last_updated_at:1600329890789, ++ }); ++ expect(result).toEqual('orders_number_and_count20191101_kjypcoio_5yftl5il_1600329890789') ++ ++ result = PreAggregations.targetTableName({ ++ table_name:'orders_number_and_count20191101', ++ content_version:'kjypcoio', ++ structure_version:'5yftl5il', ++ last_updated_at:1600329890789, ++ naming_version:2 ++ }); ++ expect(result).toEqual('orders_number_and_count20191101_kjypcoio_5yftl5il_1fm6652') ++ }); ++ ++ test('naming_version and sort by last_updated_at', async () => { ++ const result = await preAggregations.loadAllPreAggregationsIfNeeded(basicQueryExternal); ++ expect(result[0][1].targetTableName).toMatch(/stb_pre_aggregations.orders_number_and_count20191101_kjypcoio_5yftl5il_1fm6652/); ++ }); ++ }); ++ ++ describe(`naming_version sort tests`, () => { ++ let preAggregations = null; ++ let PreAggregations = null; ++ ++ beforeEach(async () => { ++ PreAggregations = require('../orchestrator/PreAggregations'); ++ preAggregations = new PreAggregations( ++ ""TEST"", ++ mockDriverFactory, ++ (msg, params) => {}, ++ queryCache, ++ { ++ queueOptions: { ++ executionTimeout: 1 ++ }, ++ externalDriverFactory: async () => { ++ const driver = mockExternalDriver; ++ driver.createTable(""stb_pre_aggregations.orders_number_and_count20191101_kjypcoio_5yftl5il_1893709044209""); ++ driver.createTable(""stb_pre_aggregations.orders_number_and_count20191101_kjypcoio_5yftl5il_1fm6652""); ++ return driver; ++ }, ++ }, ++ ); ++ }); ++ ++ test('naming_version and sort by last_updated_at', async () => { ++ const result = await preAggregations.loadAllPreAggregationsIfNeeded(basicQueryExternal); ++ expect(result[0][1].targetTableName).toMatch(/stb_pre_aggregations.orders_number_and_count20191101_kjypcoio_5yftl5il_1893709044209/); ++ }); ++ }); ++ + }); +diff --git a/packages/cubejs-schema-compiler/adapter/BaseQuery.js b/packages/cubejs-schema-compiler/adapter/BaseQuery.js +index f5c540e1800c8..2483cceddfc29 100644 +--- a/packages/cubejs-schema-compiler/adapter/BaseQuery.js ++++ b/packages/cubejs-schema-compiler/adapter/BaseQuery.js +@@ -1738,7 +1738,8 @@ class BaseQuery { + } + + preAggregationTableName(cube, preAggregationName, skipSchema) { +- return `${skipSchema ? '' : this.preAggregationSchema() && `${this.preAggregationSchema()}.`}${this.aliasName(`${cube}.${preAggregationName}`, true)}`; ++ const tblName = this.aliasName(`${cube}.${preAggregationName}`, true); ++ return `${skipSchema ? '' : this.preAggregationSchema() && `${this.preAggregationSchema()}.`}${tblName}`; + } + + preAggregationSchema() { +diff --git a/packages/cubejs-schema-compiler/adapter/BigqueryQuery.js b/packages/cubejs-schema-compiler/adapter/BigqueryQuery.js +index 61e797fe6c6a8..f13c3658f6605 100644 +--- a/packages/cubejs-schema-compiler/adapter/BigqueryQuery.js ++++ b/packages/cubejs-schema-compiler/adapter/BigqueryQuery.js +@@ -127,7 +127,7 @@ class BigqueryQuery extends BaseQuery { + } + + concatStringsSql(strings) { +- return `CONCAT(${strings.join("", "")})`; ++ return `CONCAT(${strings.join(', ')})`; + } + + defaultRefreshKeyRenewalThreshold() { +diff --git a/packages/cubejs-schema-compiler/adapter/MysqlQuery.js b/packages/cubejs-schema-compiler/adapter/MysqlQuery.js +index 6429ae5b65128..b8cf974853927 100644 +--- a/packages/cubejs-schema-compiler/adapter/MysqlQuery.js ++++ b/packages/cubejs-schema-compiler/adapter/MysqlQuery.js +@@ -2,6 +2,7 @@ const moment = require('moment-timezone'); + + const BaseQuery = require('./BaseQuery'); + const BaseFilter = require('./BaseFilter'); ++const UserError = require('../compiler/UserError'); + + const GRANULARITY_TO_INTERVAL = { + day: (date) => `DATE_FORMAT(${date}, '%Y-%m-%dT00:00:00.000')`, +@@ -64,7 +65,7 @@ class MysqlQuery extends BaseQuery { + } + + concatStringsSql(strings) { +- return `CONCAT(${strings.join("", "")})`; ++ return `CONCAT(${strings.join(', ')})`; + } + + unixTimestampSql() { +@@ -74,6 +75,14 @@ class MysqlQuery extends BaseQuery { + wrapSegmentForDimensionSelect(sql) { + return `IF(${sql}, 1, 0)`; + } ++ ++ preAggregationTableName(cube, preAggregationName, skipSchema) { ++ const name = super.preAggregationTableName(cube, preAggregationName, skipSchema); ++ if (name.length > 64) { ++ throw new UserError(`MySQL can not work with table names that longer than 64 symbols. Consider using the 'sqlAlias' attribute in your cube and in your pre-aggregation definition for ${name}.`); ++ } ++ return name; ++ } + } + + module.exports = MysqlQuery; +diff --git a/packages/cubejs-schema-compiler/adapter/OracleQuery.js b/packages/cubejs-schema-compiler/adapter/OracleQuery.js +index a05b69f8ee56c..9d1a86617f12d 100644 +--- a/packages/cubejs-schema-compiler/adapter/OracleQuery.js ++++ b/packages/cubejs-schema-compiler/adapter/OracleQuery.js +@@ -1,5 +1,6 @@ + const BaseQuery = require('./BaseQuery'); + const BaseFilter = require('./BaseFilter'); ++const UserError = require('../compiler/UserError'); + + const GRANULARITY_VALUE = { + day: 'DD', +@@ -54,7 +55,7 @@ class OracleQuery extends BaseQuery { + if (!dimensions.length) { + return ''; + } +- return ` GROUP BY ${dimensions.map(item => item.dimensionSql()).join("", "")}`; ++ return ` GROUP BY ${dimensions.map(item => item.dimensionSql()).join(', ')}`; + } + + convertTz(field) { +@@ -90,6 +91,14 @@ class OracleQuery extends BaseQuery { + unixTimestampSql() { + return `((cast (systimestamp at time zone 'UTC' as date) - date '1970-01-01') * 86400)`; + } ++ ++ preAggregationTableName(cube, preAggregationName, skipSchema) { ++ const name = super.preAggregationTableName(cube, preAggregationName, skipSchema); ++ if (name.length > 128) { ++ throw new UserError(`Oracle can not work with table names that longer than 64 symbols. Consider using the 'sqlAlias' attribute in your cube and in your pre-aggregation definition for ${name}.`); ++ } ++ return name; ++ } + } + + module.exports = OracleQuery; +diff --git a/packages/cubejs-schema-compiler/adapter/PostgresQuery.js b/packages/cubejs-schema-compiler/adapter/PostgresQuery.js +index 7a5a5224151d1..2560026e2afb0 100644 +--- a/packages/cubejs-schema-compiler/adapter/PostgresQuery.js ++++ b/packages/cubejs-schema-compiler/adapter/PostgresQuery.js +@@ -1,5 +1,6 @@ + const BaseQuery = require('./BaseQuery'); + const ParamAllocator = require('./ParamAllocator'); ++const UserError = require('../compiler/UserError'); + + const GRANULARITY_TO_INTERVAL = { + day: 'day', +@@ -41,6 +42,14 @@ class PostgresQuery extends BaseQuery { + countDistinctApprox(sql) { + return `round(hll_cardinality(hll_add_agg(hll_hash_any(${sql}))))`; + } ++ ++ preAggregationTableName(cube, preAggregationName, skipSchema) { ++ const name = super.preAggregationTableName(cube, preAggregationName, skipSchema); ++ if (name.length > 64) { ++ throw new UserError(`Postgres can not work with table names that longer than 64 symbols. Consider using the 'sqlAlias' attribute in your cube and in your pre-aggregation definition for ${name}.`); ++ } ++ return name; ++ } + } + + module.exports = PostgresQuery; +diff --git a/packages/cubejs-schema-compiler/adapter/PreAggregations.js b/packages/cubejs-schema-compiler/adapter/PreAggregations.js +index a4dcae5fdb51d..b30e2ae566a26 100644 +--- a/packages/cubejs-schema-compiler/adapter/PreAggregations.js ++++ b/packages/cubejs-schema-compiler/adapter/PreAggregations.js +@@ -98,7 +98,8 @@ class PreAggregations { + + preAggregationDescriptionFor(cube, foundPreAggregation) { + const { preAggregationName, preAggregation } = foundPreAggregation; +- const tableName = this.preAggregationTableName(cube, preAggregationName, preAggregation); ++ const name = foundPreAggregation.sqlAlias || preAggregationName; ++ const tableName = this.preAggregationTableName(cube, name, preAggregation); + const refreshKeyQueries = this.query.preAggregationInvalidateKeyQueries(cube, preAggregation); + return { + preAggregationsSchema: this.query.preAggregationSchema(), +@@ -110,7 +111,7 @@ class PreAggregations { + external: preAggregation.external, + indexesSql: Object.keys(preAggregation.indexes || {}).map( + index => { +- const indexName = this.preAggregationTableName(cube, `${preAggregationName}_${index}`, preAggregation, true); ++ const indexName = this.preAggregationTableName(cube, `${foundPreAggregation.sqlAlias || preAggregationName}_${index}`, preAggregation, true); + return { + indexName, + sql: this.query.indexSql( +@@ -135,9 +136,11 @@ class PreAggregations { + preAggregation.partitionGranularity === 'hour' ? 13 : 10 + ).replace(/[-T:]/g, ''); + } ++ ++ const name = preAggregation.sqlAlias || preAggregationName; + return this.query.preAggregationTableName( + cube, +- preAggregationName + partitionSuffix, ++ name + partitionSuffix, + skipSchema + ); + } +@@ -475,12 +478,19 @@ class PreAggregations { + } + + originalSqlPreAggregationTable(preAggregation) { +- return this.canPartitionsBeUsed(preAggregation) ? +- this.partitionUnion(preAggregation, true) : +- this.query.preAggregationTableName( +- preAggregation.cube, +- preAggregation.preAggregationName +- ); ++ if (this.canPartitionsBeUsed(preAggregation)) { ++ return this.partitionUnion(preAggregation, true); ++ } ++ ++ let { preAggregationName } = preAggregation; ++ if (preAggregation.preAggregation && preAggregation.preAggregation.sqlAlias) { ++ preAggregationName = preAggregation.preAggregation.sqlAlias; ++ } ++ ++ return this.query.preAggregationTableName( ++ preAggregation.cube, ++ preAggregationName ++ ); + } + + rollupPreAggregation(preAggregationForQuery) { +@@ -488,7 +498,7 @@ class PreAggregations { + this.partitionUnion(preAggregationForQuery) : + this.query.preAggregationTableName( + preAggregationForQuery.cube, +- preAggregationForQuery.preAggregationName ++ preAggregationForQuery.sqlAlias || preAggregationForQuery.preAggregationName + ); + const segmentFilters = this.query.segments.map( + s => this.query.newFilter({ dimension: s.segment, operator: 'equals', values: [true] }) +@@ -542,7 +552,7 @@ class PreAggregations { + const preAggregation = this.addPartitionRangeTo(preAggregationForQuery, dimension, range); + return this.preAggregationTableName( + preAggregationForQuery.cube, +- preAggregationForQuery.preAggregationName, ++ preAggregationForQuery.sqlAlias || preAggregationForQuery.preAggregationName, + preAggregation.preAggregation + ); + }); +diff --git a/packages/cubejs-schema-compiler/compiler/CubeValidator.js b/packages/cubejs-schema-compiler/compiler/CubeValidator.js +index d727e105d186d..6a2cd25003234 100644 +--- a/packages/cubejs-schema-compiler/compiler/CubeValidator.js ++++ b/packages/cubejs-schema-compiler/compiler/CubeValidator.js +@@ -1,7 +1,8 @@ + const Joi = require('@hapi/joi'); + + const identifierRegex = /^[_a-zA-Z][_a-zA-Z0-9]*$/; +-const identifier = Joi.string().regex(/^[_a-zA-Z][_a-zA-Z0-9]*$/, 'identifier'); ++ ++const identifier = Joi.string().regex(identifierRegex, 'identifier'); + const timeInterval = + Joi.alternatives([ + Joi.string().regex(/^(-?\d+) (minute|hour|day|week|month|year)$/, 'time interval'), +@@ -77,6 +78,7 @@ const BasePreAggregationWithoutPartitionGranularity = { + updateWindow: timeInterval + }) + ), ++ sqlAlias: Joi.string().optional(), + useOriginalSqlPreAggregations: Joi.boolean(), + external: Joi.boolean(), + scheduledRefresh: Joi.boolean(), +@@ -194,7 +196,7 @@ const cubeSchema = Joi.object().keys({ + preAggregations: Joi.object().pattern(identifierRegex, Joi.alternatives().try( + Joi.object().keys(Object.assign({}, BasePreAggregation, { + type: Joi.any().valid('autoRollup').required(), +- maxPreAggregations: Joi.number() ++ maxPreAggregations: Joi.number(), + })), + Joi.object().keys(Object.assign({}, BasePreAggregation, { + type: Joi.any().valid('originalSql').required(), +diff --git a/packages/cubejs-schema-compiler/compiler/DataSchemaCompiler.js b/packages/cubejs-schema-compiler/compiler/DataSchemaCompiler.js +index f2e4cc76251a8..25fbccd5b8374 100644 +--- a/packages/cubejs-schema-compiler/compiler/DataSchemaCompiler.js ++++ b/packages/cubejs-schema-compiler/compiler/DataSchemaCompiler.js +@@ -1,8 +1,8 @@ + const vm = require('vm'); + const syntaxCheck = require('syntax-error'); +-const { parse } = require(""@babel/parser""); +-const babelGenerator = require(""@babel/generator"").default; +-const babelTraverse = require(""@babel/traverse"").default; ++const { parse } = require('@babel/parser'); ++const babelGenerator = require('@babel/generator').default; ++const babelTraverse = require('@babel/traverse').default; + const fs = require('fs'); + const path = require('path'); + const R = require('ramda'); +@@ -322,7 +322,7 @@ class DataSchemaCompiler { + + isWhiteListedPackage(packagePath) { + return packagePath.indexOf('-schema') !== -1 && +- (packagePath.indexOf('-schema') === packagePath.length - ""-schema"".length); ++ (packagePath.indexOf('-schema') === packagePath.length - '-schema'.length); + } + } + +diff --git a/packages/cubejs-schema-compiler/package.json b/packages/cubejs-schema-compiler/package.json +index 26fef830e8e9f..64c1b30b9e9cc 100644 +--- a/packages/cubejs-schema-compiler/package.json ++++ b/packages/cubejs-schema-compiler/package.json +@@ -14,7 +14,7 @@ + ""scripts"": { + ""test"": ""nyc --reporter=lcov mocha -i -g MSSql"", + ""test-mssql"": ""nyc --reporter=lcov mocha -g MSSql"", +- ""lint"": ""eslint adapter/*.js compiler/*.js extensions/*.js scaffolding/*.js parser/SqlParser.js test/*.js"" ++ ""lint"": ""eslint -c ../../.eslintrc.js adapter/*.js compiler/*.js extensions/*.js scaffolding/*.js parser/SqlParser.js test/*.js"" + }, + ""dependencies"": { + ""@babel/generator"": ""^7.4.0"", +diff --git a/packages/cubejs-schema-compiler/parser/SqlParser.js b/packages/cubejs-schema-compiler/parser/SqlParser.js +index 7f99ac8fe13e7..637ef098e78a5 100644 +--- a/packages/cubejs-schema-compiler/parser/SqlParser.js ++++ b/packages/cubejs-schema-compiler/parser/SqlParser.js +@@ -68,7 +68,7 @@ class SqlParser { + } + // eslint-disable-next-line no-underscore-dangle + if (start >= this._size) { +- return """"; ++ return ''; + } else { + return sql.slice(start, stop + 1); + } +diff --git a/packages/cubejs-schema-compiler/test/PreAggregationsSqlAliasTest.js b/packages/cubejs-schema-compiler/test/PreAggregationsSqlAliasTest.js +new file mode 100644 +index 0000000000000..9a6bd0643f7e4 +--- /dev/null ++++ b/packages/cubejs-schema-compiler/test/PreAggregationsSqlAliasTest.js +@@ -0,0 +1,415 @@ ++/* eslint-disable quote-props */ ++/* globals it, describe, after */ ++const R = require('ramda'); ++const should = require('should'); ++const UserError = require('../compiler/UserError'); ++ ++const PostgresQuery = require('../adapter/PostgresQuery'); ++const PrepareCompiler = require('./PrepareCompiler'); ++ ++const { prepareCompiler } = PrepareCompiler; ++const dbRunner = require('./DbRunner'); ++ ++describe('PreAggregations', function test() { ++ this.timeout(200000); ++ ++ after(async () => { ++ await dbRunner.tearDown(); ++ }); ++ ++ const { compiler, joinGraph, cubeEvaluator } = prepareCompiler(` ++ cube(\`visitors\`, { ++ sql: \` ++ select * from visitors WHERE \${FILTER_PARAMS.visitors.createdAt.filter('created_at')} ++ \`, ++ sqlAlias: 'vis', ++ ++ joins: { ++ visitor_checkins: { ++ relationship: 'hasMany', ++ sql: \`\${CUBE}.id = \${visitor_checkins}.visitor_id\` ++ } ++ }, ++ ++ measures: { ++ count: { ++ type: 'count' ++ }, ++ revenue: { ++ sql: 'id', ++ type: 'sum' ++ }, ++ ++ checkinsTotal: { ++ sql: \`\${checkinsCount}\`, ++ type: 'sum' ++ }, ++ ++ uniqueSourceCount: { ++ sql: 'source', ++ type: 'countDistinct' ++ }, ++ ++ countDistinctApprox: { ++ sql: 'id', ++ type: 'countDistinctApprox' ++ }, ++ ++ ratio: { ++ sql: \`\${uniqueSourceCount} / nullif(\${checkinsTotal}, 0)\`, ++ type: 'number' ++ } ++ }, ++ ++ dimensions: { ++ id: { ++ type: 'number', ++ sql: 'id', ++ primaryKey: true ++ }, ++ source: { ++ type: 'string', ++ sql: 'source' ++ }, ++ createdAt: { ++ type: 'time', ++ sql: 'created_at' ++ }, ++ checkinsCount: { ++ type: 'number', ++ sql: \`\${visitor_checkins.count}\`, ++ subQuery: true, ++ propagateFiltersToSubQuery: true ++ } ++ }, ++ ++ segments: { ++ google: { ++ sql: \`source = 'google'\` ++ } ++ }, ++ ++ preAggregations: { ++ default: { ++ sqlAlias: 'visitors_alias_d', ++ type: 'originalSql', ++ refreshKey: { ++ sql: 'select NOW()' ++ }, ++ indexes: { ++ source: { ++ columns: ['source', 'created_at'] ++ } ++ }, ++ partitionGranularity: 'day', ++ timeDimensionReference: createdAt ++ }, ++ } ++ }) ++ ++ ++ cube(\`rollup_visitors\`, { ++ sql: \` ++ select * from visitors WHERE \${FILTER_PARAMS.visitors.createdAt.filter('created_at')} ++ \`, ++ sqlAlias: 'rvis', ++ ++ joins: { ++ visitor_checkins: { ++ relationship: 'hasMany', ++ sql: \`\${CUBE}.id = \${visitor_checkins}.visitor_id\` ++ } ++ }, ++ ++ measures: { ++ count: { ++ type: 'count' ++ }, ++ revenue: { ++ sql: 'id', ++ type: 'sum' ++ }, ++ ++ checkinsTotal: { ++ sql: \`\${checkinsCount}\`, ++ type: 'sum' ++ }, ++ ++ uniqueSourceCount: { ++ sql: 'source', ++ type: 'countDistinct' ++ }, ++ ++ countDistinctApprox: { ++ sql: 'id', ++ type: 'countDistinctApprox' ++ }, ++ ++ ratio: { ++ sql: \`\${uniqueSourceCount} / nullif(\${checkinsTotal}, 0)\`, ++ type: 'number' ++ } ++ }, ++ ++ dimensions: { ++ id: { ++ type: 'number', ++ sql: 'id', ++ primaryKey: true ++ }, ++ source: { ++ type: 'string', ++ sql: 'source' ++ }, ++ createdAt: { ++ type: 'time', ++ sql: 'created_at' ++ }, ++ checkinsCount: { ++ type: 'number', ++ sql: \`\${visitor_checkins.count}\`, ++ subQuery: true, ++ propagateFiltersToSubQuery: true ++ } ++ }, ++ ++ segments: { ++ google: { ++ sql: \`source = 'google'\` ++ } ++ }, ++ ++ preAggregations: { ++ veryVeryLongTableNameForPreAggregation: { ++ sqlAlias: 'rollupalias', ++ type: 'rollup', ++ timeDimensionReference: createdAt, ++ partitionGranularity: 'month', ++ granularity: 'day', ++ measureReferences: [count, revenue], ++ dimensionReferences: [source], ++ }, ++ } ++ }) ++ ++ cube('visitor_checkins', { ++ sql: \` ++ select * from visitor_checkins ++ \`, ++ ++ sqlAlias: 'vc', ++ ++ measures: { ++ count: { ++ type: 'count' ++ } ++ }, ++ ++ dimensions: { ++ id: { ++ type: 'number', ++ sql: 'id', ++ primaryKey: true ++ }, ++ visitor_id: { ++ type: 'number', ++ sql: 'visitor_id' ++ }, ++ source: { ++ type: 'string', ++ sql: 'source' ++ }, ++ created_at: { ++ type: 'time', ++ sql: 'created_at' ++ } ++ }, ++ ++ preAggregations: { ++ main: { ++ type: 'originalSql', ++ sqlAlias: 'pma', ++ }, ++ } ++ }) ++ ++ cube('GoogleVisitors', { ++ refreshKey: { ++ immutable: true, ++ }, ++ extends: visitors, ++ sql: \`select v.* from \${visitors.sql()} v where v.source = 'google'\`, ++ sqlAlias: 'googlevis', ++ }) ++ ++ cube('GoogleVisitorsLongName', { ++ refreshKey: { ++ immutable: true, ++ }, ++ extends: visitors, ++ sql: \`select v.* from \${visitors.sql()} v where v.source = 'google'\`, ++ sqlAlias: 'veryVeryVeryVeryVeryVeryLongSqlAliasForTestItOnPostgresqlDataBase', ++ }) ++ ++ `); ++ ++ function replaceTableName(query, preAggregation, suffix) { ++ const [toReplace, params] = query; ++ preAggregation = Array.isArray(preAggregation) ? preAggregation : [preAggregation]; ++ return [ ++ preAggregation.reduce( ++ (replacedQuery, desc) => replacedQuery ++ .replace(new RegExp(desc.tableName, 'g'), `${desc.tableName}_${suffix}`) ++ .replace(/CREATE INDEX (?!i_)/, `CREATE INDEX i_${suffix}_`), ++ toReplace ++ ), ++ params ++ ]; ++ } ++ ++ function tempTablePreAggregations(preAggregationsDescriptions) { ++ return R.unnest(preAggregationsDescriptions.map( ++ desc => desc.invalidateKeyQueries.concat([ ++ [desc.loadSql[0].replace('CREATE TABLE', 'CREATE TEMP TABLE'), desc.loadSql[1]] ++ ]).concat( ++ (desc.indexesSql || []).map(({ sql }) => sql) ++ ) ++ )); ++ } ++ ++ it('rollup pre-aggregation with sqlAlias', () => compiler.compile().then(() => { ++ const query = new PostgresQuery({ joinGraph, cubeEvaluator, compiler }, { ++ measures: [ ++ 'rollup_visitors.count' ++ ], ++ timeDimensions: [{ ++ dimension: 'rollup_visitors.createdAt', ++ granularity: 'day', ++ dateRange: ['2017-01-01', '2017-01-30'] ++ }], ++ timezone: 'America/Los_Angeles', ++ order: [{ ++ id: 'rollup_visitors.createdAt' ++ }], ++ preAggregationsSchema: '' ++ }); ++ ++ const preAggregationsDescription = query.preAggregations.preAggregationsDescription(); ++ should(preAggregationsDescription[0].tableName).be.equal('rvis_rollupalias20170101'); ++ ++ return dbRunner.testQueries(tempTablePreAggregations(preAggregationsDescription).concat([ ++ query.buildSqlAndParams() ++ ]).map(q => replaceTableName(q, preAggregationsDescription, 1))).then(res => { ++ res.should.be.deepEqual( ++ [ ++ { 'rvis__created_at_day': '2017-01-02T00:00:00.000Z', 'rvis__count': '1' }, ++ { 'rvis__created_at_day': '2017-01-04T00:00:00.000Z', 'rvis__count': '1' }, ++ { 'rvis__created_at_day': '2017-01-05T00:00:00.000Z', 'rvis__count': '1' }, ++ { 'rvis__created_at_day': '2017-01-06T00:00:00.000Z', 'rvis__count': '2' } ++ ] ++ ); ++ }); ++ })); ++ ++ it('simple pre-aggregation with sqlAlias', () => compiler.compile().then(() => { ++ const query = new PostgresQuery({ joinGraph, cubeEvaluator, compiler }, { ++ measures: [ ++ 'visitors.count' ++ ], ++ timeDimensions: [{ ++ dimension: 'visitors.createdAt', ++ granularity: 'day', ++ dateRange: ['2017-01-01', '2017-01-30'] ++ }], ++ timezone: 'America/Los_Angeles', ++ order: [{ ++ id: 'visitors.createdAt' ++ }], ++ preAggregationsSchema: '' ++ }); ++ ++ const preAggregationsDescription = query.preAggregations.preAggregationsDescription(); ++ should(preAggregationsDescription[0].tableName).be.equal('vis_visitors_alias_d20170101'); ++ ++ return dbRunner.testQueries(tempTablePreAggregations(preAggregationsDescription).concat([ ++ query.buildSqlAndParams() ++ ]).map(q => replaceTableName(q, preAggregationsDescription, 1))).then(res => { ++ res.should.be.deepEqual( ++ [ ++ { ++ 'vis__created_at_day': '2017-01-02T00:00:00.000Z', ++ 'vis__count': '1' ++ }, ++ { ++ 'vis__created_at_day': '2017-01-04T00:00:00.000Z', ++ 'vis__count': '1' ++ }, ++ { ++ 'vis__created_at_day': '2017-01-05T00:00:00.000Z', ++ 'vis__count': '1' ++ }, ++ { ++ 'vis__created_at_day': '2017-01-06T00:00:00.000Z', ++ 'vis__count': '2' ++ } ++ ] ++ ); ++ }); ++ })); ++ ++ it('immutable partition default refreshKey', () => compiler.compile().then(() => { ++ const query = new PostgresQuery({ joinGraph, cubeEvaluator, compiler }, { ++ measures: [ ++ 'GoogleVisitors.checkinsTotal' ++ ], ++ dimensions: [ ++ 'GoogleVisitors.source' ++ ], ++ timeDimensions: [{ ++ dimension: 'GoogleVisitors.createdAt', ++ granularity: 'day', ++ dateRange: ['2017-01-01', '2017-01-30'] ++ }], ++ timezone: 'America/Los_Angeles', ++ order: [{ ++ id: 'GoogleVisitors.createdAt' ++ }], ++ preAggregationsSchema: '' ++ }); ++ const preAggregationsDescription = query.preAggregations.preAggregationsDescription(); ++ should(preAggregationsDescription[0].tableName).be.equal('googlevis_visitors_alias_d20170101'); ++ return dbRunner.testQueries(tempTablePreAggregations(preAggregationsDescription).concat([ ++ query.buildSqlAndParams() ++ ]).map(q => replaceTableName(q, preAggregationsDescription, 101))).then(res => { ++ res.should.be.deepEqual( ++ [{ 'googlevis__source': 'google', 'googlevis__created_at_day': '2017-01-05T00:00:00.000Z', 'googlevis__checkins_total': '900' }] ++ ); ++ }); ++ })); ++ ++ it('check errors for too long name', () => compiler.compile().then(() => { ++ const query = new PostgresQuery({ joinGraph, cubeEvaluator, compiler }, { ++ measures: [ ++ 'GoogleVisitorsLongName.checkinsTotal' ++ ], ++ dimensions: [ ++ 'GoogleVisitorsLongName.source' ++ ], ++ timeDimensions: [{ ++ dimension: 'GoogleVisitorsLongName.createdAt', ++ granularity: 'day', ++ dateRange: ['2017-01-01', '2017-01-30'] ++ }], ++ timezone: 'America/Los_Angeles', ++ order: [{ ++ id: 'GoogleVisitorsLongName.createdAt' ++ }], ++ preAggregationsSchema: '' ++ }); ++ try { ++ query.preAggregations.preAggregationsDescription(); ++ } catch (error) { ++ error.should.be.instanceof(UserError); ++ } ++ })); ++});" +materialize,https://github.com/MaterializeInc/materialize,e8e14d313f1f9466b3ba6b009e0a2720c3d6392e,Aljoscha Krettek,2022-09-28 23:30:46,"test: use i64::MAX instead of u64::MAX for ""infinity""","We have moments in the code where we convert our internal u64 timestamp +to i64, for example when converting a ComputeEvent::Frontier to a SQL +row for reporting to the user via the introspection sources. + +A previous commit changes `persist_source` to immediately downgrade it's +capability to the given `as_of`, which advances the frontier, which +would make this cast fail if trying to convert from u64::MAX.","test: use i64::MAX instead of u64::MAX for ""infinity"" + +We have moments in the code where we convert our internal u64 timestamp +to i64, for example when converting a ComputeEvent::Frontier to a SQL +row for reporting to the user via the introspection sources. + +A previous commit changes `persist_source` to immediately downgrade it's +capability to the given `as_of`, which advances the frontier, which +would make this cast fail if trying to convert from u64::MAX.","diff --git a/src/environmentd/tests/server.rs b/src/environmentd/tests/server.rs +index 8a0ba33787c21..aa45f13ff46a1 100644 +--- a/src/environmentd/tests/server.rs ++++ b/src/environmentd/tests/server.rs +@@ -620,7 +620,7 @@ fn test_cancel_dataflow_removal() -> Result<(), Box> { + cancel_token.cancel_query(postgres::NoTls).unwrap(); + }); + +- match client1.simple_query(""SELECT * FROM t AS OF 18446744073709551615"") { ++ match client1.simple_query(""SELECT * FROM t AS OF 9223372036854775807"") { + Err(e) if e.code() == Some(&postgres::error::SqlState::QUERY_CANCELED) => {} + Err(e) => panic!(""expected error SqlState::QUERY_CANCELED, but got {:?}"", e), + Ok(_) => panic!(""expected error SqlState::QUERY_CANCELED, but query succeeded"")," +n8n,https://github.com/n8n-io/n8n,db02a379d9c2e9f5681300fdc2a3a1275a8f281c,Iván Ovejero,2022-08-24 14:18:13,fix(editor): Check for PostHog before feature flag call (#3928),"* :bug: Check for PH before feature flag call + +* :fire: Remove logging","fix(editor): Check for PostHog before feature flag call (#3928) + +* :bug: Check for PH before feature flag call + +* :fire: Remove logging","diff --git a/packages/editor-ui/src/plugins/telemetry/telemetry.types.ts b/packages/editor-ui/src/plugins/telemetry/telemetry.types.ts +index ef664e21bbf64..131f45c1791ba 100644 +--- a/packages/editor-ui/src/plugins/telemetry/telemetry.types.ts ++++ b/packages/editor-ui/src/plugins/telemetry/telemetry.types.ts +@@ -10,9 +10,38 @@ declare global { + interface Window { + rudderanalytics: RudderStack; + featureFlag: FeatureFlag; ++ posthog: posthog; + } + } + ++/** ++ * Simplified version of: ++ * https://github.com/PostHog/posthog-js/blob/master/src/module.d.ts ++ */ ++/* tslint:disable-next-line */ ++interface posthog { ++ identify( ++ uniqueId?: string, ++ userPropertiesToSet?: object, ++ userPropertiesToSetOnce?: object, ++ ): void; ++ reset(resetDeviceId?: boolean): void; ++ capture( ++ eventName: string, ++ properties?: object, ++ options?: object, ++ ): unknown; ++ isFeatureEnabled(key: string, options?: object): boolean; ++ register(properties: object, days?: number): void; ++ people: { ++ set( ++ prop: object | string, ++ to?: object, ++ callback?: Function, ++ ): unknown; ++ }; ++} ++ + export interface IUserNodesPanelSession { + sessionId: string; + data: IUserNodesPanelSessionData; +diff --git a/packages/editor-ui/src/views/NodeView.vue b/packages/editor-ui/src/views/NodeView.vue +index 61b20a5ded5b2..51e8a27dd7b0a 100644 +--- a/packages/editor-ui/src/views/NodeView.vue ++++ b/packages/editor-ui/src/views/NodeView.vue +@@ -2051,7 +2051,7 @@ export default mixins( + + this.setZoomLevel(1); + +- if (window.featureFlag && !window.featureFlag.isEnabled('show-welcome-note')) return; ++ if (window.posthog && !window.featureFlag.isEnabled('show-welcome-note')) return; + + setTimeout(() => { + this.$store.commit('setNodeViewOffsetPosition', {newOffset: [0, 0]});" +leetcode,https://github.com/doocs/leetcode,bbb5113f3088fcfbd2a1e91e21c1dd891e50a8e9,yanglbme,2022-04-22 08:19:49,feat: add solutions to lc problem: No.1631,No.1631.Path With Minimum Effort,"feat: add solutions to lc problem: No.1631 + +No.1631.Path With Minimum Effort","diff --git a/solution/1600-1699/1631.Path With Minimum Effort/README.md b/solution/1600-1699/1631.Path With Minimum Effort/README.md +index 71e575a24652d..347dcde200357 100644 +--- a/solution/1600-1699/1631.Path With Minimum Effort/README.md ++++ b/solution/1600-1699/1631.Path With Minimum Effort/README.md +@@ -127,6 +127,8 @@ d[find(a)] = distance + + 二分枚举体力消耗值,用 BFS 找到满足条件的最小消耗值即可。 + ++**方法三:堆优化版 Dijkstra 算法** ++ + + + ### **Python3** +@@ -185,6 +187,27 @@ class Solution: + return left + ``` + ++Dijkstra 算法: ++ ++```python ++class Solution: ++ def minimumEffortPath(self, heights: List[List[int]]) -> int: ++ INF = 0x3f3f3f3f ++ m, n = len(heights), len(heights[0]) ++ dist = [[INF] * n for _ in range(m)] ++ dist[0][0] = 0 ++ dirs = [-1, 0, 1, 0, -1] ++ q = [(0, 0, 0)] ++ while q: ++ t, i, j = heappop(q) ++ for k in range(4): ++ x, y = i + dirs[k], j + dirs[k + 1] ++ if 0 <= x < m and 0 <= y < n and max(t, abs(heights[x][y] - heights[i][j])) < dist[x][y]: ++ dist[x][y] = max(t, abs(heights[x][y] - heights[i][j])) ++ heappush(q, (dist[x][y], x, y)) ++ return dist[-1][-1] ++``` ++ + ### **Java** + + +@@ -271,6 +294,40 @@ class Solution { + } + ``` + ++Dijkstra 算法: ++ ++```java ++class Solution { ++ public int minimumEffortPath(int[][] heights) { ++ int m = heights.length; ++ int n = heights[0].length; ++ int[][] dist = new int[m][n]; ++ for (int i = 0; i < m; ++i) { ++ Arrays.fill(dist[i], 0x3f3f3f3f); ++ } ++ dist[0][0] = 0; ++ PriorityQueue q = new PriorityQueue<>(Comparator.comparingInt(a -> a[0])); ++ q.offer(new int[]{0, 0, 0}); ++ int[] dirs = {-1, 0, 1, 0, -1}; ++ while (!q.isEmpty()) { ++ int[] p = q.poll(); ++ int t = p[0], i = p[1], j = p[2]; ++ for (int k = 0; k < 4; ++k) { ++ int x = i + dirs[k], y = j + dirs[k + 1]; ++ if (x >= 0 && x < m && y >= 0 && y < n) { ++ int nd = Math.max(t, Math.abs(heights[x][y] - heights[i][j])); ++ if (nd < dist[x][y]) { ++ dist[x][y] = nd; ++ q.offer(new int[]{nd, x, y}); ++ } ++ } ++ } ++ } ++ return dist[m - 1][n - 1]; ++ } ++} ++``` ++ + ### **C++** + + 并查集: +@@ -348,6 +405,40 @@ public: + }; + ``` + ++Dijkstra 算法: ++ ++```cpp ++class Solution { ++public: ++ int minimumEffortPath(vector>& heights) { ++ int m = heights.size(), n = heights[0].size(); ++ vector> dist(m, vector(n, 0x3f3f3f3f)); ++ dist[0][0] = 0; ++ priority_queue, vector>, greater>> q; ++ q.push({0, 0, 0}); ++ vector dirs = {-1, 0, 1, 0, -1}; ++ while (!q.empty()) ++ { ++ auto [t, i, j] = q.top(); ++ q.pop(); ++ for (int k = 0; k < 4; ++k) ++ { ++ int x = i + dirs[k], y = j + dirs[k + 1]; ++ if (x >= 0 && x < m && y >= 0 && y < n) ++ { ++ int nd = max(t, abs(heights[x][y] - heights[i][j])); ++ if (nd < dist[x][y]) ++ { ++ dist[x][y] = nd; ++ q.push({nd, x, y}); ++ } ++ } ++ } ++ } ++ return dist[m - 1][n - 1]; ++ } ++}; ++``` + ### **Go** + + 并查集: +diff --git a/solution/1600-1699/1631.Path With Minimum Effort/README_EN.md b/solution/1600-1699/1631.Path With Minimum Effort/README_EN.md +index 55c293f6a2b39..32c23e9b75551 100644 +--- a/solution/1600-1699/1631.Path With Minimum Effort/README_EN.md ++++ b/solution/1600-1699/1631.Path With Minimum Effort/README_EN.md +@@ -128,6 +128,25 @@ class Solution: + return left + ``` + ++```python ++class Solution: ++ def minimumEffortPath(self, heights: List[List[int]]) -> int: ++ INF = 0x3f3f3f3f ++ m, n = len(heights), len(heights[0]) ++ dist = [[INF] * n for _ in range(m)] ++ dist[0][0] = 0 ++ dirs = [-1, 0, 1, 0, -1] ++ q = [(0, 0, 0)] ++ while q: ++ t, i, j = heappop(q) ++ for k in range(4): ++ x, y = i + dirs[k], j + dirs[k + 1] ++ if 0 <= x < m and 0 <= y < n and max(t, abs(heights[x][y] - heights[i][j])) < dist[x][y]: ++ dist[x][y] = max(t, abs(heights[x][y] - heights[i][j])) ++ heappush(q, (dist[x][y], x, y)) ++ return dist[-1][-1] ++``` ++ + ### **Java** + + Union find: +@@ -212,6 +231,38 @@ class Solution { + } + ``` + ++```java ++class Solution { ++ public int minimumEffortPath(int[][] heights) { ++ int m = heights.length; ++ int n = heights[0].length; ++ int[][] dist = new int[m][n]; ++ for (int i = 0; i < m; ++i) { ++ Arrays.fill(dist[i], 0x3f3f3f3f); ++ } ++ dist[0][0] = 0; ++ PriorityQueue q = new PriorityQueue<>(Comparator.comparingInt(a -> a[0])); ++ q.offer(new int[]{0, 0, 0}); ++ int[] dirs = {-1, 0, 1, 0, -1}; ++ while (!q.isEmpty()) { ++ int[] p = q.poll(); ++ int t = p[0], i = p[1], j = p[2]; ++ for (int k = 0; k < 4; ++k) { ++ int x = i + dirs[k], y = j + dirs[k + 1]; ++ if (x >= 0 && x < m && y >= 0 && y < n) { ++ int nd = Math.max(t, Math.abs(heights[x][y] - heights[i][j])); ++ if (nd < dist[x][y]) { ++ dist[x][y] = nd; ++ q.offer(new int[]{nd, x, y}); ++ } ++ } ++ } ++ } ++ return dist[m - 1][n - 1]; ++ } ++} ++``` ++ + ### **C++** + + Union find: +@@ -289,6 +340,39 @@ public: + }; + ``` + ++```cpp ++class Solution { ++public: ++ int minimumEffortPath(vector>& heights) { ++ int m = heights.size(), n = heights[0].size(); ++ vector> dist(m, vector(n, 0x3f3f3f3f)); ++ dist[0][0] = 0; ++ priority_queue, vector>, greater>> q; ++ q.push({0, 0, 0}); ++ vector dirs = {-1, 0, 1, 0, -1}; ++ while (!q.empty()) ++ { ++ auto [t, i, j] = q.top(); ++ q.pop(); ++ for (int k = 0; k < 4; ++k) ++ { ++ int x = i + dirs[k], y = j + dirs[k + 1]; ++ if (x >= 0 && x < m && y >= 0 && y < n) ++ { ++ int nd = max(t, abs(heights[x][y] - heights[i][j])); ++ if (nd < dist[x][y]) ++ { ++ dist[x][y] = nd; ++ q.push({nd, x, y}); ++ } ++ } ++ } ++ } ++ return dist[m - 1][n - 1]; ++ } ++}; ++``` ++ + ### **Go** + + Union find: +diff --git a/solution/1600-1699/1631.Path With Minimum Effort/Solution.cpp b/solution/1600-1699/1631.Path With Minimum Effort/Solution.cpp +index 496e747e99271..4e55257095d37 100644 +--- a/solution/1600-1699/1631.Path With Minimum Effort/Solution.cpp ++++ b/solution/1600-1699/1631.Path With Minimum Effort/Solution.cpp +@@ -1,32 +1,30 @@ +-class Solution { +-public: +- vector p; +- +- int minimumEffortPath(vector>& heights) { +- int m = heights.size(), n = heights[0].size(); +- p.resize(m * n); +- for (int i = 0; i < p.size(); ++i) p[i] = i; +- vector> edges; +- for (int i = 0; i < m; ++i) +- { +- for (int j = 0; j < n; ++j) +- { +- if (i < m - 1) edges.push_back({abs(heights[i][j] - heights[i + 1][j]), i * n + j, (i + 1) * n + j}); +- if (j < n - 1) edges.push_back({abs(heights[i][j] - heights[i][j + 1]), i * n + j, i * n + j + 1}); +- } +- } +- sort(edges.begin(), edges.end()); +- for (auto& e : edges) +- { +- int i = e[1], j = e[2]; +- p[find(i)] = find(j); +- if (find(0) == find(m * n - 1)) return e[0]; +- } +- return 0; +- } +- +- int find(int x) { +- if (p[x] != x) p[x] = find(p[x]); +- return p[x]; +- } ++class Solution { ++public: ++ int minimumEffortPath(vector>& heights) { ++ int m = heights.size(), n = heights[0].size(); ++ vector> dist(m, vector(n, 0x3f3f3f3f)); ++ dist[0][0] = 0; ++ priority_queue, vector>, greater>> q; ++ q.push({0, 0, 0}); ++ vector dirs = {-1, 0, 1, 0, -1}; ++ while (!q.empty()) ++ { ++ auto [t, i, j] = q.top(); ++ q.pop(); ++ for (int k = 0; k < 4; ++k) ++ { ++ int x = i + dirs[k], y = j + dirs[k + 1]; ++ if (x >= 0 && x < m && y >= 0 && y < n) ++ { ++ int nd = max(t, abs(heights[x][y] - heights[i][j])); ++ if (nd < dist[x][y]) ++ { ++ dist[x][y] = nd; ++ q.push({nd, x, y}); ++ } ++ } ++ } ++ } ++ return dist[m - 1][n - 1]; ++ } + }; +\ No newline at end of file +diff --git a/solution/1600-1699/1631.Path With Minimum Effort/Solution.java b/solution/1600-1699/1631.Path With Minimum Effort/Solution.java +index b986e2296566d..69ed72e8f0d1e 100644 +--- a/solution/1600-1699/1631.Path With Minimum Effort/Solution.java ++++ b/solution/1600-1699/1631.Path With Minimum Effort/Solution.java +@@ -1,39 +1,29 @@ +-class Solution { +- private int[] p; +- +- public int minimumEffortPath(int[][] heights) { +- int m = heights.length; +- int n = heights[0].length; +- p = new int[m * n]; +- for (int i = 0; i < p.length; ++i) { +- p[i] = i; +- } +- List edges = new ArrayList<>(); +- for (int i = 0; i < m; ++i) { +- for (int j = 0; j < n; ++j) { +- if (i < m - 1) { +- edges.add(new int[]{Math.abs(heights[i][j] - heights[i + 1][j]), i * n + j, (i + 1) * n + j}); +- } +- if (j < n - 1) { +- edges.add(new int[]{Math.abs(heights[i][j] - heights[i][j + 1]), i * n + j, i * n + j + 1}); +- } +- } +- } +- Collections.sort(edges, Comparator.comparingInt(a -> a[0])); +- for (int[] e : edges) { +- int i = e[1], j = e[2]; +- p[find(i)] = find(j); +- if (find(0) == find(m * n - 1)) { +- return e[0]; +- } +- } +- return 0; +- } +- +- private int find(int x) { +- if (p[x] != x) { +- p[x] = find(p[x]); +- } +- return p[x]; +- } ++class Solution { ++ public int minimumEffortPath(int[][] heights) { ++ int m = heights.length; ++ int n = heights[0].length; ++ int[][] dist = new int[m][n]; ++ for (int i = 0; i < m; ++i) { ++ Arrays.fill(dist[i], 0x3f3f3f3f); ++ } ++ dist[0][0] = 0; ++ PriorityQueue q = new PriorityQueue<>(Comparator.comparingInt(a -> a[0])); ++ q.offer(new int[]{0, 0, 0}); ++ int[] dirs = {-1, 0, 1, 0, -1}; ++ while (!q.isEmpty()) { ++ int[] p = q.poll(); ++ int t = p[0], i = p[1], j = p[2]; ++ for (int k = 0; k < 4; ++k) { ++ int x = i + dirs[k], y = j + dirs[k + 1]; ++ if (x >= 0 && x < m && y >= 0 && y < n) { ++ int nd = Math.max(t, Math.abs(heights[x][y] - heights[i][j])); ++ if (nd < dist[x][y]) { ++ dist[x][y] = nd; ++ q.offer(new int[]{nd, x, y}); ++ } ++ } ++ } ++ } ++ return dist[m - 1][n - 1]; ++ } + } +\ No newline at end of file +diff --git a/solution/1600-1699/1631.Path With Minimum Effort/Solution.py b/solution/1600-1699/1631.Path With Minimum Effort/Solution.py +index 9ed9b03e011d7..b24b8ca418e70 100644 +--- a/solution/1600-1699/1631.Path With Minimum Effort/Solution.py ++++ b/solution/1600-1699/1631.Path With Minimum Effort/Solution.py +@@ -1,34 +1,16 @@ +-class Solution: +- def minimumEffortPath(self, heights: List[List[int]]) -> int: +- def find(x): +- if p[x] != x: +- p[x] = find(p[x]) +- return p[x] +- +- m, n = len(heights), len(heights[0]) +- p = list(range(m * n)) +- e = [] +- for i in range(m): +- for j in range(n): +- if i < m - 1: +- e.append( +- ( +- abs(heights[i][j] - heights[i + 1][j]), +- i * n + j, +- (i + 1) * n + j, +- ) +- ) +- if j < n - 1: +- e.append( +- ( +- abs(heights[i][j] - heights[i][j + 1]), +- i * n + j, +- i * n + j + 1, +- ) +- ) +- e.sort() +- for h, i, j in e: +- p[find(i)] = find(j) +- if find(0) == find(m * n - 1): +- return h +- return 0 ++class Solution: ++ def minimumEffortPath(self, heights: List[List[int]]) -> int: ++ INF = 0x3f3f3f3f ++ m, n = len(heights), len(heights[0]) ++ dist = [[INF] * n for _ in range(m)] ++ dist[0][0] = 0 ++ dirs = [-1, 0, 1, 0, -1] ++ q = [(0, 0, 0)] ++ while q: ++ t, i, j = heappop(q) ++ for k in range(4): ++ x, y = i + dirs[k], j + dirs[k + 1] ++ if 0 <= x < m and 0 <= y < n and max(t, abs(heights[x][y] - heights[i][j])) < dist[x][y]: ++ dist[x][y] = max(t, abs(heights[x][y] - heights[i][j])) ++ heappush(q, (dist[x][y], x, y)) ++ return dist[-1][-1]" +hooks,https://github.com/alibaba/hooks,7aca7db7c3152cbb6cc2e34c34729c41eefea495,huangcheng,2023-03-23 16:53:17,fix(useInfiniteScroll): reload data should be latest (#2124),"* fix: reload data should be latest + +* test: add test case","fix(useInfiniteScroll): reload data should be latest (#2124) + +* fix: reload data should be latest + +* test: add test case","diff --git a/packages/hooks/src/useInfiniteScroll/__tests__/index.test.ts b/packages/hooks/src/useInfiniteScroll/__tests__/index.test.ts +index 586403c04d..3ef3d60157 100644 +--- a/packages/hooks/src/useInfiniteScroll/__tests__/index.test.ts ++++ b/packages/hooks/src/useInfiniteScroll/__tests__/index.test.ts +@@ -159,6 +159,35 @@ describe('useInfiniteScroll', () => { + }); + }); + ++ it('reload data should be latest', async () => { ++ let listCount = 5; ++ const mockRequestFn = async () => { ++ await sleep(1000); ++ return { ++ list: Array.from({ ++ length: listCount, ++ }).map((_, index) => index + 1), ++ nextId: listCount, ++ hasMore: listCount > 2, ++ }; ++ }; ++ ++ const { result } = setup(mockRequestFn); ++ ++ await act(async () => { ++ jest.advanceTimersByTime(1000); ++ }); ++ expect(result.current.data).toMatchObject({ list: [1, 2, 3, 4, 5], nextId: 5 }); ++ ++ listCount = 3; ++ await act(async () => { ++ result.current.reload(); ++ jest.advanceTimersByTime(1000); ++ }); ++ ++ expect(result.current.data).toMatchObject({ list: [1, 2, 3], nextId: 3 }); ++ }); ++ + it('mutate should be work', async () => { + const { result } = setup(mockRequest); + const { mutate } = result.current; +diff --git a/packages/hooks/src/useInfiniteScroll/index.tsx b/packages/hooks/src/useInfiniteScroll/index.tsx +index 0cc8d0f0bd..9d6d27e954 100644 +--- a/packages/hooks/src/useInfiniteScroll/index.tsx ++++ b/packages/hooks/src/useInfiniteScroll/index.tsx +@@ -63,17 +63,17 @@ const useInfiniteScroll = ( + }, + ); + +- const loadMore = () => { ++ const loadMore = useMemoizedFn(() => { + if (noMore) return; + setLoadingMore(true); + run(finalData); +- }; ++ }); + +- const loadMoreAsync = () => { ++ const loadMoreAsync = useMemoizedFn(() => { + if (noMore) return Promise.reject(); + setLoadingMore(true); + return runAsync(finalData); +- }; ++ }); + + const reload = () => { + setLoadingMore(false); +@@ -123,8 +123,8 @@ const useInfiniteScroll = ( + loadingMore, + noMore, + +- loadMore: useMemoizedFn(loadMore), +- loadMoreAsync: useMemoizedFn(loadMoreAsync), ++ loadMore, ++ loadMoreAsync, + reload: useMemoizedFn(reload), + reloadAsync: useMemoizedFn(reloadAsync), + mutate: setFinalData," +ruffle,https://github.com/ruffle-rs/ruffle,2ac916d1a3c58d2b6d86c41e5bb7458e1af8ef1e,dependabot[bot],2024-09-11 17:46:40,build(deps): bump send and express in /web,"Bumps [send](https://github.com/pillarjs/send) and [express](https://github.com/expressjs/express). These dependencies needed to be updated together. + +Updates `send` from 0.18.0 to 0.19.0 +- [Release notes](https://github.com/pillarjs/send/releases) +- [Changelog](https://github.com/pillarjs/send/blob/master/HISTORY.md) +- [Commits](https://github.com/pillarjs/send/compare/0.18.0...0.19.0) + +Updates `express` from 4.19.2 to 4.20.0 +- [Release notes](https://github.com/expressjs/express/releases) +- [Changelog](https://github.com/expressjs/express/blob/master/History.md) +- [Commits](https://github.com/expressjs/express/compare/4.19.2...4.20.0) + +---","build(deps): bump send and express in /web + +Bumps [send](https://github.com/pillarjs/send) and [express](https://github.com/expressjs/express). These dependencies needed to be updated together. + +Updates `send` from 0.18.0 to 0.19.0 +- [Release notes](https://github.com/pillarjs/send/releases) +- [Changelog](https://github.com/pillarjs/send/blob/master/HISTORY.md) +- [Commits](https://github.com/pillarjs/send/compare/0.18.0...0.19.0) + +Updates `express` from 4.19.2 to 4.20.0 +- [Release notes](https://github.com/expressjs/express/releases) +- [Changelog](https://github.com/expressjs/express/blob/master/History.md) +- [Commits](https://github.com/expressjs/express/compare/4.19.2...4.20.0) + +--- +updated-dependencies: +- dependency-name: send + dependency-type: indirect +- dependency-name: express + dependency-type: indirect +... + +Signed-off-by: dependabot[bot] ","diff --git a/web/package-lock.json b/web/package-lock.json +index 91c95041f8894..a5073aca7d116 100644 +--- a/web/package-lock.json ++++ b/web/package-lock.json +@@ -4589,11 +4589,10 @@ + } + }, + ""node_modules/body-parser"": { +- ""version"": ""1.20.2"", +- ""resolved"": ""https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz"", +- ""integrity"": ""sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA=="", ++ ""version"": ""1.20.3"", ++ ""resolved"": ""https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz"", ++ ""integrity"": ""sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g=="", + ""dev"": true, +- ""license"": ""MIT"", + ""dependencies"": { + ""bytes"": ""3.1.2"", + ""content-type"": ""~1.0.5"", +@@ -4603,7 +4602,7 @@ + ""http-errors"": ""2.0.0"", + ""iconv-lite"": ""0.4.24"", + ""on-finished"": ""2.4.1"", +- ""qs"": ""6.11.0"", ++ ""qs"": ""6.13.0"", + ""raw-body"": ""2.5.2"", + ""type-is"": ""~1.6.18"", + ""unpipe"": ""1.0.0"" +@@ -4618,7 +4617,6 @@ + ""resolved"": ""https://registry.npmjs.org/debug/-/debug-2.6.9.tgz"", + ""integrity"": ""sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="", + ""dev"": true, +- ""license"": ""MIT"", + ""dependencies"": { + ""ms"": ""2.0.0"" + } +@@ -4627,8 +4625,22 @@ + ""version"": ""2.0.0"", + ""resolved"": ""https://registry.npmjs.org/ms/-/ms-2.0.0.tgz"", + ""integrity"": ""sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="", ++ ""dev"": true ++ }, ++ ""node_modules/body-parser/node_modules/qs"": { ++ ""version"": ""6.13.0"", ++ ""resolved"": ""https://registry.npmjs.org/qs/-/qs-6.13.0.tgz"", ++ ""integrity"": ""sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg=="", + ""dev"": true, +- ""license"": ""MIT"" ++ ""dependencies"": { ++ ""side-channel"": ""^1.0.6"" ++ }, ++ ""engines"": { ++ ""node"": "">=0.6"" ++ }, ++ ""funding"": { ++ ""url"": ""https://github.com/sponsors/ljharb"" ++ } + }, + ""node_modules/bonjour-service"": { + ""version"": ""1.2.1"", +@@ -4796,7 +4808,6 @@ + ""resolved"": ""https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz"", + ""integrity"": ""sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg=="", + ""dev"": true, +- ""license"": ""MIT"", + ""engines"": { + ""node"": "">= 0.8"" + } +@@ -5482,7 +5493,6 @@ + ""resolved"": ""https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz"", + ""integrity"": ""sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA=="", + ""dev"": true, +- ""license"": ""MIT"", + ""engines"": { + ""node"": "">= 0.6"" + } +@@ -6235,7 +6245,6 @@ + ""resolved"": ""https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz"", + ""integrity"": ""sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg=="", + ""dev"": true, +- ""license"": ""MIT"", + ""engines"": { + ""node"": "">= 0.8"", + ""npm"": ""1.2.8000 || >= 1.4.16"" +@@ -7118,7 +7127,6 @@ + ""resolved"": ""https://registry.npmjs.org/etag/-/etag-1.8.1.tgz"", + ""integrity"": ""sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg=="", + ""dev"": true, +- ""license"": ""MIT"", + ""engines"": { + ""node"": "">= 0.6"" + } +@@ -7244,38 +7252,37 @@ + } + }, + ""node_modules/express"": { +- ""version"": ""4.19.2"", +- ""resolved"": ""https://registry.npmjs.org/express/-/express-4.19.2.tgz"", +- ""integrity"": ""sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q=="", ++ ""version"": ""4.20.0"", ++ ""resolved"": ""https://registry.npmjs.org/express/-/express-4.20.0.tgz"", ++ ""integrity"": ""sha512-pLdae7I6QqShF5PnNTCVn4hI91Dx0Grkn2+IAsMTgMIKuQVte2dN9PeGSSAME2FR8anOhVA62QDIUaWVfEXVLw=="", + ""dev"": true, +- ""license"": ""MIT"", + ""dependencies"": { + ""accepts"": ""~1.3.8"", + ""array-flatten"": ""1.1.1"", +- ""body-parser"": ""1.20.2"", ++ ""body-parser"": ""1.20.3"", + ""content-disposition"": ""0.5.4"", + ""content-type"": ""~1.0.4"", + ""cookie"": ""0.6.0"", + ""cookie-signature"": ""1.0.6"", + ""debug"": ""2.6.9"", + ""depd"": ""2.0.0"", +- ""encodeurl"": ""~1.0.2"", ++ ""encodeurl"": ""~2.0.0"", + ""escape-html"": ""~1.0.3"", + ""etag"": ""~1.8.1"", + ""finalhandler"": ""1.2.0"", + ""fresh"": ""0.5.2"", + ""http-errors"": ""2.0.0"", +- ""merge-descriptors"": ""1.0.1"", ++ ""merge-descriptors"": ""1.0.3"", + ""methods"": ""~1.1.2"", + ""on-finished"": ""2.4.1"", + ""parseurl"": ""~1.3.3"", +- ""path-to-regexp"": ""0.1.7"", ++ ""path-to-regexp"": ""0.1.10"", + ""proxy-addr"": ""~2.0.7"", + ""qs"": ""6.11.0"", + ""range-parser"": ""~1.2.1"", + ""safe-buffer"": ""5.2.1"", +- ""send"": ""0.18.0"", +- ""serve-static"": ""1.15.0"", ++ ""send"": ""0.19.0"", ++ ""serve-static"": ""1.16.0"", + ""setprototypeof"": ""1.2.0"", + ""statuses"": ""2.0.1"", + ""type-is"": ""~1.6.18"", +@@ -7296,6 +7303,15 @@ + ""ms"": ""2.0.0"" + } + }, ++ ""node_modules/express/node_modules/encodeurl"": { ++ ""version"": ""2.0.0"", ++ ""resolved"": ""https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz"", ++ ""integrity"": ""sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg=="", ++ ""dev"": true, ++ ""engines"": { ++ ""node"": "">= 0.8"" ++ } ++ }, + ""node_modules/express/node_modules/ms"": { + ""version"": ""2.0.0"", + ""resolved"": ""https://registry.npmjs.org/ms/-/ms-2.0.0.tgz"", +@@ -7847,7 +7863,6 @@ + ""resolved"": ""https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz"", + ""integrity"": ""sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q=="", + ""dev"": true, +- ""license"": ""MIT"", + ""engines"": { + ""node"": "">= 0.6"" + } +@@ -8632,7 +8647,6 @@ + ""resolved"": ""https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz"", + ""integrity"": ""sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ=="", + ""dev"": true, +- ""license"": ""MIT"", + ""dependencies"": { + ""depd"": ""2.0.0"", + ""inherits"": ""2.0.4"", +@@ -10491,7 +10505,6 @@ + ""resolved"": ""https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz"", + ""integrity"": ""sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ=="", + ""dev"": true, +- ""license"": ""MIT"", + ""engines"": { + ""node"": "">= 0.6"" + } +@@ -10529,11 +10542,13 @@ + } + }, + ""node_modules/merge-descriptors"": { +- ""version"": ""1.0.1"", +- ""resolved"": ""https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz"", +- ""integrity"": ""sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w=="", ++ ""version"": ""1.0.3"", ++ ""resolved"": ""https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz"", ++ ""integrity"": ""sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ=="", + ""dev"": true, +- ""license"": ""MIT"" ++ ""funding"": { ++ ""url"": ""https://github.com/sponsors/sindresorhus"" ++ } + }, + ""node_modules/merge-stream"": { + ""version"": ""2.0.0"", +@@ -10580,7 +10595,6 @@ + ""resolved"": ""https://registry.npmjs.org/mime/-/mime-1.6.0.tgz"", + ""integrity"": ""sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="", + ""dev"": true, +- ""license"": ""MIT"", + ""bin"": { + ""mime"": ""cli.js"" + }, +@@ -11732,11 +11746,10 @@ + } + }, + ""node_modules/path-to-regexp"": { +- ""version"": ""0.1.7"", +- ""resolved"": ""https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz"", +- ""integrity"": ""sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ=="", +- ""dev"": true, +- ""license"": ""MIT"" ++ ""version"": ""0.1.10"", ++ ""resolved"": ""https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz"", ++ ""integrity"": ""sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w=="", ++ ""dev"": true + }, + ""node_modules/path-type"": { + ""version"": ""5.0.0"", +@@ -12746,7 +12759,6 @@ + ""resolved"": ""https://registry.npmjs.org/qs/-/qs-6.11.0.tgz"", + ""integrity"": ""sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q=="", + ""dev"": true, +- ""license"": ""BSD-3-Clause"", + ""dependencies"": { + ""side-channel"": ""^1.0.4"" + }, +@@ -12830,7 +12842,6 @@ + ""resolved"": ""https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz"", + ""integrity"": ""sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA=="", + ""dev"": true, +- ""license"": ""MIT"", + ""dependencies"": { + ""bytes"": ""3.1.2"", + ""http-errors"": ""2.0.0"", +@@ -13633,11 +13644,10 @@ + } + }, + ""node_modules/send"": { +- ""version"": ""0.18.0"", +- ""resolved"": ""https://registry.npmjs.org/send/-/send-0.18.0.tgz"", +- ""integrity"": ""sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg=="", ++ ""version"": ""0.19.0"", ++ ""resolved"": ""https://registry.npmjs.org/send/-/send-0.19.0.tgz"", ++ ""integrity"": ""sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw=="", + ""dev"": true, +- ""license"": ""MIT"", + ""dependencies"": { + ""debug"": ""2.6.9"", + ""depd"": ""2.0.0"", +@@ -13662,7 +13672,6 @@ + ""resolved"": ""https://registry.npmjs.org/debug/-/debug-2.6.9.tgz"", + ""integrity"": ""sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="", + ""dev"": true, +- ""license"": ""MIT"", + ""dependencies"": { + ""ms"": ""2.0.0"" + } +@@ -13671,15 +13680,13 @@ + ""version"": ""2.0.0"", + ""resolved"": ""https://registry.npmjs.org/ms/-/ms-2.0.0.tgz"", + ""integrity"": ""sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="", +- ""dev"": true, +- ""license"": ""MIT"" ++ ""dev"": true + }, + ""node_modules/send/node_modules/ms"": { + ""version"": ""2.1.3"", + ""resolved"": ""https://registry.npmjs.org/ms/-/ms-2.1.3.tgz"", + ""integrity"": ""sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="", +- ""dev"": true, +- ""license"": ""MIT"" ++ ""dev"": true + }, + ""node_modules/serialize-error"": { + ""version"": ""11.0.3"", +@@ -13807,11 +13814,10 @@ + } + }, + ""node_modules/serve-static"": { +- ""version"": ""1.15.0"", +- ""resolved"": ""https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz"", +- ""integrity"": ""sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g=="", ++ ""version"": ""1.16.0"", ++ ""resolved"": ""https://registry.npmjs.org/serve-static/-/serve-static-1.16.0.tgz"", ++ ""integrity"": ""sha512-pDLK8zwl2eKaYrs8mrPZBJua4hMplRWJ1tIFksVC3FtBEBnl8dxgeHtsaMS8DhS9i4fLObaon6ABoc4/hQGdPA=="", + ""dev"": true, +- ""license"": ""MIT"", + ""dependencies"": { + ""encodeurl"": ""~1.0.2"", + ""escape-html"": ""~1.0.3"", +@@ -13822,6 +13828,51 @@ + ""node"": "">= 0.8.0"" + } + }, ++ ""node_modules/serve-static/node_modules/debug"": { ++ ""version"": ""2.6.9"", ++ ""resolved"": ""https://registry.npmjs.org/debug/-/debug-2.6.9.tgz"", ++ ""integrity"": ""sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="", ++ ""dev"": true, ++ ""dependencies"": { ++ ""ms"": ""2.0.0"" ++ } ++ }, ++ ""node_modules/serve-static/node_modules/debug/node_modules/ms"": { ++ ""version"": ""2.0.0"", ++ ""resolved"": ""https://registry.npmjs.org/ms/-/ms-2.0.0.tgz"", ++ ""integrity"": ""sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="", ++ ""dev"": true ++ }, ++ ""node_modules/serve-static/node_modules/ms"": { ++ ""version"": ""2.1.3"", ++ ""resolved"": ""https://registry.npmjs.org/ms/-/ms-2.1.3.tgz"", ++ ""integrity"": ""sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="", ++ ""dev"": true ++ }, ++ ""node_modules/serve-static/node_modules/send"": { ++ ""version"": ""0.18.0"", ++ ""resolved"": ""https://registry.npmjs.org/send/-/send-0.18.0.tgz"", ++ ""integrity"": ""sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg=="", ++ ""dev"": true, ++ ""dependencies"": { ++ ""debug"": ""2.6.9"", ++ ""depd"": ""2.0.0"", ++ ""destroy"": ""1.2.0"", ++ ""encodeurl"": ""~1.0.2"", ++ ""escape-html"": ""~1.0.3"", ++ ""etag"": ""~1.8.1"", ++ ""fresh"": ""0.5.2"", ++ ""http-errors"": ""2.0.0"", ++ ""mime"": ""1.6.0"", ++ ""ms"": ""2.1.3"", ++ ""on-finished"": ""2.4.1"", ++ ""range-parser"": ""~1.2.1"", ++ ""statuses"": ""2.0.1"" ++ }, ++ ""engines"": { ++ ""node"": "">= 0.8.0"" ++ } ++ }, + ""node_modules/set-function-length"": { + ""version"": ""1.2.2"", + ""resolved"": ""https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz"", +@@ -13851,8 +13902,7 @@ + ""version"": ""1.2.0"", + ""resolved"": ""https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz"", + ""integrity"": ""sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="", +- ""dev"": true, +- ""license"": ""ISC"" ++ ""dev"": true + }, + ""node_modules/shallow-clone"": { + ""version"": ""3.0.1"", +@@ -13916,7 +13966,6 @@ + ""resolved"": ""https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz"", + ""integrity"": ""sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA=="", + ""dev"": true, +- ""license"": ""MIT"", + ""dependencies"": { + ""call-bind"": ""^1.0.7"", + ""es-errors"": ""^1.3.0"", +@@ -15094,7 +15143,6 @@ + ""resolved"": ""https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz"", + ""integrity"": ""sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA=="", + ""dev"": true, +- ""license"": ""MIT"", + ""engines"": { + ""node"": "">=0.6"" + } +@@ -15776,7 +15824,6 @@ + ""resolved"": ""https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz"", + ""integrity"": ""sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g=="", + ""dev"": true, +- ""license"": ""MIT"", + ""dependencies"": { + ""media-typer"": ""0.3.0"", + ""mime-types"": ""~2.1.24""" +posthog,https://github.com/PostHog/posthog,26329424b60419a3f413de92998737e7eeb1513f,Marius Andra,2023-03-16 20:32:36,feat(hogql): count distinct and count star (#14786),"* feat(hogql): count distinct and count star + +* Update query snapshots + +---------","feat(hogql): count distinct and count star (#14786) + +* feat(hogql): count distinct and count star + +* Update query snapshots + +--------- + +Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>","diff --git a/posthog/api/test/__snapshots__/test_query.ambr b/posthog/api/test/__snapshots__/test_query.ambr +index 61e822e8dd6d4..7e42377b0f95b 100644 +--- a/posthog/api/test/__snapshots__/test_query.ambr ++++ b/posthog/api/test/__snapshots__/test_query.ambr +@@ -294,11 +294,11 @@ + ' + /* user_id:0 request:_snapshot_ */ + SELECT replaceRegexpAll(JSONExtractRaw(properties, 'key'), '^""|""$', ''), +- count(*) ++ count() + FROM events + WHERE and(equals(team_id, 2), less(timestamp, '2020-01-10 12:14:05.000000'), greater(timestamp, '2020-01-09 12:00:00.000000')) + GROUP BY replaceRegexpAll(JSONExtractRaw(properties, 'key'), '^""|""$', '') +- ORDER BY count(*) DESC ++ ORDER BY count() DESC + LIMIT 101 + OFFSET 0 + ' +@@ -307,12 +307,12 @@ + ' + /* user_id:0 request:_snapshot_ */ + SELECT replaceRegexpAll(JSONExtractRaw(properties, 'key'), '^""|""$', ''), +- count(*) ++ count() + FROM events + WHERE and(equals(team_id, 2), less(timestamp, '2020-01-10 12:14:05.000000'), greater(timestamp, '2020-01-09 12:00:00.000000')) + GROUP BY replaceRegexpAll(JSONExtractRaw(properties, 'key'), '^""|""$', '') +- HAVING and(greater(count(*), 1)) +- ORDER BY count(*) DESC ++ HAVING and(greater(count(), 1)) ++ ORDER BY count() DESC + LIMIT 101 + OFFSET 0 + ' +@@ -321,11 +321,11 @@ + ' + /* user_id:0 request:_snapshot_ */ + SELECT mat_key, +- count(*) ++ count() + FROM events + WHERE and(equals(team_id, 2), less(timestamp, '2020-01-10 12:14:05.000000'), greater(timestamp, '2020-01-09 12:00:00.000000')) + GROUP BY mat_key +- ORDER BY count(*) DESC ++ ORDER BY count() DESC + LIMIT 101 + OFFSET 0 + ' +@@ -334,12 +334,12 @@ + ' + /* user_id:0 request:_snapshot_ */ + SELECT mat_key, +- count(*) ++ count() + FROM events + WHERE and(equals(team_id, 2), less(timestamp, '2020-01-10 12:14:05.000000'), greater(timestamp, '2020-01-09 12:00:00.000000')) + GROUP BY mat_key +- HAVING and(greater(count(*), 1)) +- ORDER BY count(*) DESC ++ HAVING and(greater(count(), 1)) ++ ORDER BY count() DESC + LIMIT 101 + OFFSET 0 + ' +@@ -386,12 +386,12 @@ + # name: TestQuery.test_select_hogql_expressions.2 + ' + /* user_id:0 request:_snapshot_ */ +- SELECT count(*), ++ SELECT count(), + event + FROM events + WHERE and(equals(team_id, 2), less(timestamp, '2020-01-10 12:14:05.000000'), greater(timestamp, '2020-01-09 12:00:00.000000')) + GROUP BY event +- ORDER BY count(*) DESC ++ ORDER BY count() DESC + LIMIT 101 + OFFSET 0 + ' +@@ -399,12 +399,12 @@ + # name: TestQuery.test_select_hogql_expressions.3 + ' + /* user_id:0 request:_snapshot_ */ +- SELECT count(*), ++ SELECT count(), + event + FROM events + WHERE and(equals(team_id, 2), or(equals(event, 'sign up'), like(replaceRegexpAll(JSONExtractRaw(properties, 'key'), '^""|""$', ''), '%val2')), less(timestamp, '2020-01-10 12:14:05.000000'), greater(timestamp, '2020-01-09 12:00:00.000000')) + GROUP BY event +- ORDER BY count(*) DESC, event ASC ++ ORDER BY count() DESC, event ASC + LIMIT 101 + OFFSET 0 + ' +diff --git a/posthog/hogql/ast.py b/posthog/hogql/ast.py +index d633092851287..876eea2a1ee96 100644 +--- a/posthog/hogql/ast.py ++++ b/posthog/hogql/ast.py +@@ -316,6 +316,7 @@ class Placeholder(Expr): + class Call(Expr): + name: str + args: List[Expr] ++ distinct: Optional[bool] = None + + + class JoinExpr(Expr): +diff --git a/posthog/hogql/constants.py b/posthog/hogql/constants.py +index 9619128c33beb..244029c7c59bb 100644 +--- a/posthog/hogql/constants.py ++++ b/posthog/hogql/constants.py +@@ -79,10 +79,8 @@ + } + # Permitted HogQL aggregations + HOGQL_AGGREGATIONS = { +- ""count"": 0, +- ""countIf"": 1, +- ""countDistinct"": 1, +- ""countDistinctIf"": 2, ++ ""count"": (0, 1), ++ ""countIf"": (1, 2), + ""min"": 1, + ""minIf"": 2, + ""max"": 1, +diff --git a/posthog/hogql/parser.py b/posthog/hogql/parser.py +index d8f6c42e2ff04..b1816bb41459a 100644 +--- a/posthog/hogql/parser.py ++++ b/posthog/hogql/parser.py +@@ -558,7 +558,8 @@ def visitColumnExprFunction(self, ctx: HogQLParser.ColumnExprFunctionContext): + raise NotImplementedError(f""Functions that return functions are not supported"") + name = self.visit(ctx.identifier()) + args = self.visit(ctx.columnArgList()) if ctx.columnArgList() else [] +- return ast.Call(name=name, args=args) ++ distinct = True if ctx.DISTINCT() else None ++ return ast.Call(name=name, args=args, distinct=distinct) + + def visitColumnExprAsterisk(self, ctx: HogQLParser.ColumnExprAsteriskContext): + if ctx.tableIdentifier(): +diff --git a/posthog/hogql/printer.py b/posthog/hogql/printer.py +index 125272dacee34..5d2c58c4f8b83 100644 +--- a/posthog/hogql/printer.py ++++ b/posthog/hogql/printer.py +@@ -302,6 +302,8 @@ def visit_field(self, node: ast.Field): + raise ValueError(f""Field {original_field} has no ref"") + + if self.dialect == ""hogql"": ++ if node.chain == [""*""]: ++ return ""*"" + # When printing HogQL, we print the properties out as a chain as they are. + return ""."".join([self._print_identifier(identifier) for identifier in node.chain]) + +@@ -319,10 +321,16 @@ def visit_call(self, node: ast.Call): + self.context.found_aggregation = True + required_arg_count = HOGQL_AGGREGATIONS[node.name] + +- if required_arg_count != len(node.args): ++ if isinstance(required_arg_count, int) and required_arg_count != len(node.args): + raise ValueError( + f""Aggregation '{node.name}' requires {required_arg_count} argument{'s' if required_arg_count != 1 else ''}, found {len(node.args)}"" + ) ++ if isinstance(required_arg_count, tuple) and ( ++ len(node.args) < required_arg_count[0] or len(node.args) > required_arg_count[1] ++ ): ++ raise ValueError( ++ f""Aggregation '{node.name}' requires between {required_arg_count[0]} and {required_arg_count[1]} arguments, found {len(node.args)}"" ++ ) + + # check that we're not running inside another aggregate + for stack_node in self.stack: +@@ -332,17 +340,10 @@ def visit_call(self, node: ast.Call): + ) + + translated_args = "", "".join([self.visit(arg) for arg in node.args]) +- if self.dialect == ""hogql"": +- return f""{node.name}({translated_args})"" +- elif node.name == ""count"": +- return ""count(*)"" +- # TODO: rework these +- elif node.name == ""countDistinct"": +- return f""count(distinct {translated_args})"" +- elif node.name == ""countDistinctIf"": +- return f""countIf(distinct {translated_args})"" +- else: +- return f""{node.name}({translated_args})"" ++ if node.distinct: ++ translated_args = f""DISTINCT {translated_args}"" ++ ++ return f""{node.name}({translated_args})"" + + elif node.name in CLICKHOUSE_FUNCTIONS: + return f""{CLICKHOUSE_FUNCTIONS[node.name]}({', '.join([self.visit(arg) for arg in node.args])})"" +@@ -483,7 +484,7 @@ def visit_virtual_table_ref(self, ref: ast.VirtualTableRef): + return self.visit(ref.table) + + def visit_asterisk_ref(self, ref: ast.AsteriskRef): +- raise ValueError(""Unexpected ast.AsteriskRef. Make sure AsteriskExpander has run on the AST."") ++ return ""*"" + + def visit_lazy_table_ref(self, ref: ast.LazyTableRef): + raise ValueError(""Unexpected ast.LazyTableRef. Make sure LazyTableResolver has run on the AST."") +diff --git a/posthog/hogql/test/test_printer.py b/posthog/hogql/test/test_printer.py +index fc9deea127386..eb683470e651d 100644 +--- a/posthog/hogql/test/test_printer.py ++++ b/posthog/hogql/test/test_printer.py +@@ -147,9 +147,9 @@ def test_materialized_fields_and_properties(self): + self.assertEqual(self._expr(""properties['$browser%%%#@!@']""), ""`mat_$browser_______`"") + + def test_methods(self): +- self.assertEqual(self._expr(""count()""), ""count(*)"") +- self.assertEqual(self._expr(""countDistinct(event)""), ""count(distinct event)"") +- self.assertEqual(self._expr(""countDistinctIf(event, 1 == 2)""), ""countIf(distinct event, equals(1, 2))"") ++ self.assertEqual(self._expr(""count()""), ""count()"") ++ self.assertEqual(self._expr(""count(distinct event)""), ""count(DISTINCT event)"") ++ self.assertEqual(self._expr(""countIf(distinct event, 1 == 2)""), ""countIf(DISTINCT event, equals(1, 2))"") + self.assertEqual(self._expr(""sumIf(1, 1 == 2)""), ""sumIf(1, equals(1, 2))"") + + def test_functions(self): +@@ -162,10 +162,9 @@ def test_functions(self): + def test_expr_parse_errors(self): + self._assert_expr_error("""", ""Empty query"") + self._assert_expr_error(""avg(bla)"", ""Unable to resolve field: bla"") +- self._assert_expr_error(""count(2)"", ""Aggregation 'count' requires 0 arguments, found 1"") +- self._assert_expr_error(""count(2,4)"", ""Aggregation 'count' requires 0 arguments, found 2"") +- self._assert_expr_error(""countIf()"", ""Aggregation 'countIf' requires 1 argument, found 0"") +- self._assert_expr_error(""countIf(2,4)"", ""Aggregation 'countIf' requires 1 argument, found 2"") ++ self._assert_expr_error(""count(1,2,3,4)"", ""Aggregation 'count' requires between 0 and 1 arguments, found 4"") ++ self._assert_expr_error(""countIf()"", ""Aggregation 'countIf' requires between 1 and 2 arguments, found 0"") ++ self._assert_expr_error(""countIf(2,3,4)"", ""Aggregation 'countIf' requires between 1 and 2 arguments, found 3"") + self._assert_expr_error(""hamburger(event)"", ""Unsupported function call 'hamburger(...)'"") + self._assert_expr_error(""mad(event)"", ""Unsupported function call 'mad(...)'"") + self._assert_expr_error(""yeet.the.cloud"", ""Unable to resolve field: yeet"") +@@ -216,7 +215,7 @@ def test_logic(self): + ) + self.assertEqual( + self._expr(""event or timestamp or true or count()""), +- ""or(event, timestamp, true, count(*))"", ++ ""or(event, timestamp, true, count())"", + ) + self.assertEqual( + self._expr(""event or not timestamp""), +@@ -434,3 +433,21 @@ def test_select_sample(self): + ), + ""SELECT event FROM events SAMPLE 2/78 OFFSET 999 JOIN person SAMPLE 0.1 ON equals(id, events__pdi.person_id) INNER JOIN (SELECT argMax(person_distinct_id2.person_id, version) AS person_id, distinct_id FROM person_distinct_id2 WHERE equals(team_id, 42) GROUP BY distinct_id HAVING equals(argMax(is_deleted, version), 0)) AS events__pdi ON equals(events.distinct_id, events__pdi.distinct_id) WHERE and(equals(person.team_id, 42), equals(events.team_id, 42)) LIMIT 65535"", + ) ++ ++ def test_count_distinct(self): ++ self.assertEqual( ++ self._select(""SELECT count(distinct event) FROM events""), ++ ""SELECT count(DISTINCT event) FROM events WHERE equals(team_id, 42) LIMIT 65535"", ++ ) ++ ++ def test_count_star(self): ++ self.assertEqual( ++ self._select(""SELECT count(*) FROM events""), ++ ""SELECT count(*) FROM events WHERE equals(team_id, 42) LIMIT 65535"", ++ ) ++ ++ def test_count_if_distinct(self): ++ self.assertEqual( ++ self._select(""SELECT countIf(distinct event, event like '%a%') FROM events""), ++ ""SELECT countIf(DISTINCT event, like(event, %(hogql_val_0)s)) FROM events WHERE equals(team_id, 42) LIMIT 65535"", ++ ) +diff --git a/posthog/hogql/test/test_query.py b/posthog/hogql/test/test_query.py +index ecb3c9b4b440d..566ba16a502d0 100644 +--- a/posthog/hogql/test/test_query.py ++++ b/posthog/hogql/test/test_query.py +@@ -43,7 +43,7 @@ def test_query(self): + ) + self.assertEqual( + response.clickhouse, +- f""SELECT count(*), event FROM events WHERE and(equals(team_id, {self.team.id}), equals(replaceRegexpAll(JSONExtractRaw(properties, %(hogql_val_0)s), '^\""|\""$', ''), %(hogql_val_1)s)) GROUP BY event LIMIT 100"", ++ f""SELECT count(), event FROM events WHERE and(equals(team_id, {self.team.id}), equals(replaceRegexpAll(JSONExtractRaw(properties, %(hogql_val_0)s), '^\""|\""$', ''), %(hogql_val_1)s)) GROUP BY event LIMIT 100"", + ) + self.assertEqual( + response.hogql, +@@ -58,7 +58,7 @@ def test_query(self): + ) + self.assertEqual( + response.clickhouse, +- f""SELECT count, event FROM (SELECT count(*) AS count, event FROM events WHERE and(equals(team_id, {self.team.id}), equals(replaceRegexpAll(JSONExtractRaw(properties, %(hogql_val_0)s), '^\""|\""$', ''), %(hogql_val_1)s)) GROUP BY event) GROUP BY count, event LIMIT 100"", ++ f""SELECT count, event FROM (SELECT count() AS count, event FROM events WHERE and(equals(team_id, {self.team.id}), equals(replaceRegexpAll(JSONExtractRaw(properties, %(hogql_val_0)s), '^\""|\""$', ''), %(hogql_val_1)s)) GROUP BY event) GROUP BY count, event LIMIT 100"", + ) + self.assertEqual( + response.hogql, +@@ -67,7 +67,7 @@ def test_query(self): + self.assertEqual(response.results, [(2, ""random event"")]) + + response = execute_hogql_query( +- ""select count, event from (select count() as count, event from events where properties.random_uuid = {random_uuid} group by event) as c group by count, event"", ++ ""select count, event from (select count(*) as count, event from events where properties.random_uuid = {random_uuid} group by event) as c group by count, event"", + placeholders={""random_uuid"": ast.Constant(value=random_uuid)}, + team=self.team, + ) +@@ -77,7 +77,7 @@ def test_query(self): + ) + self.assertEqual( + response.hogql, +- ""SELECT count, event FROM (SELECT count() AS count, event FROM events WHERE equals(properties.random_uuid, %(hogql_val_2)s) GROUP BY event) AS c GROUP BY count, event LIMIT 100"", ++ ""SELECT count, event FROM (SELECT count(*) AS count, event FROM events WHERE equals(properties.random_uuid, %(hogql_val_2)s) GROUP BY event) AS c GROUP BY count, event LIMIT 100"", + ) + self.assertEqual(response.results, [(2, ""random event"")]) + +@@ -376,7 +376,7 @@ def test_query_joins_events_person_properties_in_aggregration(self): + self.team, + ) + expected = ( +- ""SELECT s__pdi__person.properties___email, count(*) "" ++ ""SELECT s__pdi__person.properties___email, count() "" + ""FROM events AS s "" + ""INNER JOIN (SELECT argMax(person_distinct_id2.person_id, version) AS person_id, distinct_id "" + f""FROM person_distinct_id2 WHERE equals(team_id, {self.team.pk}) "" +@@ -400,7 +400,7 @@ def test_select_person_on_events(self): + with freeze_time(""2020-01-10""): + self._create_random_events() + response = execute_hogql_query( +- ""SELECT poe.properties.email, count() FROM events s GROUP BY poe.properties.email LIMIT 10"", ++ ""SELECT poe.properties.email, count(*) FROM events s GROUP BY poe.properties.email LIMIT 10"", + self.team, + ) + self.assertEqual( +@@ -411,7 +411,7 @@ def test_select_person_on_events(self): + ) + self.assertEqual( + response.hogql, +- ""SELECT poe.properties.email, count() FROM events AS s GROUP BY poe.properties.email LIMIT 10"", ++ ""SELECT poe.properties.email, count(*) FROM events AS s GROUP BY poe.properties.email LIMIT 10"", + ) + self.assertEqual(response.results[0][0], ""tim@posthog.com"") + +@@ -444,7 +444,7 @@ def test_prop_cohort_basic(self): + self.assertEqual(response.results, [(""$pageview"", 2)]) + self.assertEqual( + response.clickhouse, +- f""SELECT event, count(*) FROM events INNER JOIN (SELECT argMax(person_distinct_id2.person_id, version) AS person_id, distinct_id FROM person_distinct_id2 WHERE equals(team_id, {self.team.pk}) GROUP BY distinct_id HAVING equals(argMax(is_deleted, version), 0)) AS events__pdi ON equals(events.distinct_id, events__pdi.distinct_id) WHERE and(equals(team_id, {self.team.pk}), in(events__pdi.person_id, (SELECT person_id FROM cohortpeople WHERE and(equals(team_id, {self.team.pk}), equals(cohort_id, {cohort.pk})) GROUP BY person_id, cohort_id, version HAVING greater(sum(sign), 0)))) GROUP BY event LIMIT 100"", ++ f""SELECT event, count() FROM events INNER JOIN (SELECT argMax(person_distinct_id2.person_id, version) AS person_id, distinct_id FROM person_distinct_id2 WHERE equals(team_id, {self.team.pk}) GROUP BY distinct_id HAVING equals(argMax(is_deleted, version), 0)) AS events__pdi ON equals(events.distinct_id, events__pdi.distinct_id) WHERE and(equals(team_id, {self.team.pk}), in(events__pdi.person_id, (SELECT person_id FROM cohortpeople WHERE and(equals(team_id, {self.team.pk}), equals(cohort_id, {cohort.pk})) GROUP BY person_id, cohort_id, version HAVING greater(sum(sign), 0)))) GROUP BY event LIMIT 100"", + ) + + def test_prop_cohort_static(self): +@@ -472,5 +472,5 @@ def test_prop_cohort_static(self): + self.assertEqual(response.results, [(""$pageview"", 1)]) + self.assertEqual( + response.clickhouse, +- f""SELECT event, count(*) FROM events INNER JOIN (SELECT argMax(person_distinct_id2.person_id, version) AS person_id, distinct_id FROM person_distinct_id2 WHERE equals(team_id, {self.team.pk}) GROUP BY distinct_id HAVING equals(argMax(is_deleted, version), 0)) AS events__pdi ON equals(events.distinct_id, events__pdi.distinct_id) WHERE and(equals(team_id, {self.team.pk}), in(events__pdi.person_id, (SELECT person_id FROM person_static_cohort WHERE and(equals(team_id, {self.team.pk}), equals(cohort_id, {cohort.pk}))))) GROUP BY event LIMIT 100"", ++ f""SELECT event, count() FROM events INNER JOIN (SELECT argMax(person_distinct_id2.person_id, version) AS person_id, distinct_id FROM person_distinct_id2 WHERE equals(team_id, {self.team.pk}) GROUP BY distinct_id HAVING equals(argMax(is_deleted, version), 0)) AS events__pdi ON equals(events.distinct_id, events__pdi.distinct_id) WHERE and(equals(team_id, {self.team.pk}), in(events__pdi.person_id, (SELECT person_id FROM person_static_cohort WHERE and(equals(team_id, {self.team.pk}), equals(cohort_id, {cohort.pk}))))) GROUP BY event LIMIT 100"", + )" +ragflow,https://github.com/infiniflow/ragflow,20d686737a10da5c9bd7b5496635a3ece3a0abc9,balibabu,2024-11-08 17:17:22,feat: Switch the login page to the registration component by changing the routing parameters #3221 (#3307),### What problem does this PR solve?,"feat: Switch the login page to the registration component by changing the routing parameters #3221 (#3307) + +### What problem does this PR solve? +feat: Switch the login page to the registration component by changing +the routing parameters #3221 + +### Type of change + + +- [x] New Feature (non-breaking change which adds functionality)","diff --git a/web/src/pages/login-next/form.tsx b/web/src/pages/login-next/form.tsx +index f235447cc43..ccd0388117d 100644 +--- a/web/src/pages/login-next/form.tsx ++++ b/web/src/pages/login-next/form.tsx +@@ -31,6 +31,7 @@ export function SignUpForm() { + }), + nickname: z.string({ required_error: t('nicknamePlaceholder') }), + password: z.string({ required_error: t('passwordPlaceholder') }), ++ agree: z.boolean({ required_error: t('passwordPlaceholder') }), + }); + + const form = useForm>({ +@@ -98,6 +99,26 @@ export function SignUpForm() { + + )} + /> ++ ( ++ ++ ++ ++ ++
++ ++ I understand and agree to the Terms of Service and Privacy ++ Policy. ++ ++
++
++ )} ++ /> + +diff --git a/web/src/pages/login-next/hooks.ts b/web/src/pages/login-next/hooks.ts +new file mode 100644 +index 00000000000..9fd6650ec1d +--- /dev/null ++++ b/web/src/pages/login-next/hooks.ts +@@ -0,0 +1,19 @@ ++import { useCallback } from 'react'; ++import { useSearchParams } from 'umi'; ++ ++export enum Step { ++ SignIn, ++ SignUp, ++ ForgotPassword, ++ ResetPassword, ++ VerifyEmail, ++} ++ ++export const useSwitchStep = (step: Step) => { ++ const [_, setSearchParams] = useSearchParams(); ++ const switchStep = useCallback(() => { ++ setSearchParams(new URLSearchParams({ step: step.toString() })); ++ }, [setSearchParams, step]); ++ ++ return { switchStep }; ++}; +diff --git a/web/src/pages/login-next/index.tsx b/web/src/pages/login-next/index.tsx +index ec5aad04434..5649649f909 100644 +--- a/web/src/pages/login-next/index.tsx ++++ b/web/src/pages/login-next/index.tsx +@@ -3,13 +3,15 @@ import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; + import { Separator } from '@/components/ui/separator'; + import { useTranslate } from '@/hooks/common-hooks'; + import { DiscordLogoIcon, GitHubLogoIcon } from '@radix-ui/react-icons'; ++import { useSearchParams } from 'umi'; + import { SignInForm, SignUpForm, VerifyEmailForm } from './form'; ++import { Step, useSwitchStep } from './hooks'; + + function LoginFooter() { + return ( +-
++
+ +-

or continue with

++

or continue with

+
+ + +@@ -21,6 +23,8 @@ function LoginFooter() { + export function SignUpCard() { + const { t } = useTranslate('login'); + ++ const { switchStep } = useSwitchStep(Step.SignIn); ++ + return ( + + +@@ -28,6 +32,11 @@ export function SignUpCard() { + + + ++
++ ++
+ +
+
+@@ -36,6 +45,7 @@ export function SignUpCard() { + + export function SignInCard() { + const { t } = useTranslate('login'); ++ const { switchStep } = useSwitchStep(Step.SignUp); + + return ( + +@@ -44,6 +54,13 @@ export function SignInCard() { + + + ++ + + + ); +@@ -76,12 +93,17 @@ export function VerifyEmailCard() { + } + + const Login = () => { ++ const [searchParams] = useSearchParams(); ++ const step = Number((searchParams.get('step') ?? Step.SignIn) as Step); ++ + return ( +- <> +- +- +- +- ++
++
++ {step === Step.SignIn && } ++ {step === Step.SignUp && } ++ {step === Step.VerifyEmail && } ++
++
+ ); + };" +super-productivity,https://github.com/johannesjo/super-productivity,5cb24ff68838f5ae2df319b8292a4f321be7d19a,dependabot[bot],2021-08-12 14:50:06,build(deps): bump tar from 6.1.0 to 6.1.3,"Bumps [tar](https://github.com/npm/node-tar) from 6.1.0 to 6.1.3. +- [Release notes](https://github.com/npm/node-tar/releases) +- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md) +- [Commits](https://github.com/npm/node-tar/compare/v6.1.0...v6.1.3) + +---","build(deps): bump tar from 6.1.0 to 6.1.3 + +Bumps [tar](https://github.com/npm/node-tar) from 6.1.0 to 6.1.3. +- [Release notes](https://github.com/npm/node-tar/releases) +- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md) +- [Commits](https://github.com/npm/node-tar/compare/v6.1.0...v6.1.3) + +--- +updated-dependencies: +- dependency-name: tar + dependency-type: indirect +... + +Signed-off-by: dependabot[bot] ","diff --git a/package-lock.json b/package-lock.json +index 3596cc24f3e..7f4ff89d331 100644 +--- a/package-lock.json ++++ b/package-lock.json +@@ -19873,9 +19873,9 @@ + ""dev"": true + }, + ""tar"": { +- ""version"": ""6.1.0"", +- ""resolved"": ""https://registry.npmjs.org/tar/-/tar-6.1.0.tgz"", +- ""integrity"": ""sha512-DUCttfhsnLCjwoDoFcI+B2iJgYa93vBnDUATYEeRx6sntCTdN01VnqsIuTlALXla/LWooNg0yEGeB+Y8WdFxGA=="", ++ ""version"": ""6.1.3"", ++ ""resolved"": ""https://registry.npmjs.org/tar/-/tar-6.1.3.tgz"", ++ ""integrity"": ""sha512-3rUqwucgVZXTeyJyL2jqtUau8/8r54SioM1xj3AmTX3HnWQdj2AydfJ2qYYayPyIIznSplcvU9mhBb7dR2XF3w=="", + ""dev"": true, + ""requires"": { + ""chownr"": ""^2.0.0""," +oh-my-posh,https://github.com/JanDeDobbeleer/oh-my-posh,0d94f1ceb7d3f54a61d526c25f13fa0a40d7e669,Jan De Dobbeleer,2024-06-21 19:45:12,docs(templates): explicitly mention OSC8,relates to #5138,"docs(templates): explicitly mention OSC8 + +relates to #5138","diff --git a/website/docs/configuration/templates.mdx b/website/docs/configuration/templates.mdx +index 2f52a63c7867..a3f8de0347e8 100644 +--- a/website/docs/configuration/templates.mdx ++++ b/website/docs/configuration/templates.mdx +@@ -171,16 +171,16 @@ use them. + + + +-| Template | Description | +-| -------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +-| `{{ url .UpstreamIcon .UpstreamURL }}` | Create a hyperlink to a website to open your default browser (needs terminal [support][terminal-list-hyperlinks]). | +-| `{{ path .Path .Location }}` | Create a link to a folder to open your file explorer (needs terminal [support][terminal-list-hyperlinks]). | +-| `{{ secondsRound 3600 }}` | Round seconds to a time indication. In this case the output is `1h`. | +-| `{{ if glob ""*.go"" }}OK{{ else }}NOK{{ end }}` | Exposes [filepath.Glob][glob] as a boolean template function. | +-| `{{ if matchP ""*.Repo"" .Path }}Repo{{ else }}No Repo{{ end }}` | Exposes [regexp.MatchString][regexpms] as a boolean template function. | +-| `{{ replaceP ""c.t"" ""cut code cat"" ""dog"" }}` | Exposes [regexp.ReplaceAllString][regexpra] as a string template function. | +-| \{\{ .Code | hresult \}\} | Transform a status code to its HRESULT value for easy troubleshooting. For example `-1978335212` becomes `0x8A150014`. | +-| `{{ readFile "".version.json"" }}` | Read a file in the current directory. Returns a string. | ++| Template | Description | ++| -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | ++| `{{ url .UpstreamIcon .UpstreamURL }}` | Create an `OSC8` hyperlink to a website to open your default browser (needs terminal [support][terminal-list-hyperlinks]). | ++| `{{ path .Path .Location }}` | Create an `OSC8` file link to a folder to open your file explorer (needs terminal [support][terminal-list-hyperlinks]). | ++| `{{ secondsRound 3600 }}` | Round seconds to a time indication. In this case the output is `1h`. | ++| `{{ if glob ""*.go"" }}OK{{ else }}NOK{{ end }}` | Exposes [filepath.Glob][glob] as a boolean template function. | ++| `{{ if matchP ""*.Repo"" .Path }}Repo{{ else }}No Repo{{ end }}` | Exposes [regexp.MatchString][regexpms] as a boolean template function. | ++| `{{ replaceP ""c.t"" ""cut code cat"" ""dog"" }}` | Exposes [regexp.ReplaceAllString][regexpra] as a string template function. | ++| \{\{ .Code | hresult \}\} | Transform a status code to its HRESULT value for easy troubleshooting. For example `-1978335212` becomes `0x8A150014`. | ++| `{{ readFile "".version.json"" }}` | Read a file in the current directory. Returns a string. | + + " +mobile_scanner,https://github.com/juliansteenbakker/mobile_scanner,c0d3479b7660b1ca86a4202895df9cf1fb696099,dependabot[bot],2023-11-07 04:09:42,chore(deps): bump subosito/flutter-action from 2.10.0 to 2.12.0,"Bumps [subosito/flutter-action](https://github.com/subosito/flutter-action) from 2.10.0 to 2.12.0. +- [Release notes](https://github.com/subosito/flutter-action/releases) +- [Commits](https://github.com/subosito/flutter-action/compare/v2.10.0...v2.12.0) + +---","chore(deps): bump subosito/flutter-action from 2.10.0 to 2.12.0 + +Bumps [subosito/flutter-action](https://github.com/subosito/flutter-action) from 2.10.0 to 2.12.0. +- [Release notes](https://github.com/subosito/flutter-action/releases) +- [Commits](https://github.com/subosito/flutter-action/compare/v2.10.0...v2.12.0) + +--- +updated-dependencies: +- dependency-name: subosito/flutter-action + dependency-type: direct:production + update-type: version-update:semver-minor +... + +Signed-off-by: dependabot[bot] ","diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml +index 0c014a749..953a028fa 100644 +--- a/.github/workflows/flutter.yml ++++ b/.github/workflows/flutter.yml +@@ -16,7 +16,7 @@ jobs: + with: + java-version: 11 + distribution: temurin +- - uses: subosito/flutter-action@v2.10.0 ++ - uses: subosito/flutter-action@v2.12.0 + with: + cache: true + - name: Version +@@ -33,7 +33,7 @@ jobs: + with: + java-version: 11 + distribution: temurin +- - uses: subosito/flutter-action@v2.10.0 ++ - uses: subosito/flutter-action@v2.12.0 + with: + cache: true + - name: Format" +tachyon,https://github.com/kroma-network/tachyon,573ad23dc4a02b0b5cf2d29006c712ae9b28fe96,Wonyong Kim(Ryan Kim),2023-10-04 06:58:25,build: add bazel `tachyon_cc_unittest` and `tachyon_cuda_unittest` rule,"This helps you omit repetitive `size = ""small""` for a simple unittest.","build: add bazel `tachyon_cc_unittest` and `tachyon_cuda_unittest` rule + +This helps you omit repetitive `size = ""small""` for a simple unittest.","diff --git a/bazel/tachyon_cc.bzl b/bazel/tachyon_cc.bzl +index c3f2e5217..bad1563c9 100644 +--- a/bazel/tachyon_cc.bzl ++++ b/bazel/tachyon_cc.bzl +@@ -138,6 +138,16 @@ def tachyon_cc_test( + **kwargs + ) + ++def tachyon_cc_unittest( ++ name, ++ size = ""small"", ++ **kwargs): ++ tachyon_cc_test( ++ name = name, ++ size = size, ++ **kwargs ++ ) ++ + def tachyon_cc_benchmark( + name, + copts = [], +@@ -318,6 +328,16 @@ def tachyon_cuda_test( + deps = ["":"" + lib_name], + ) + ++def tachyon_cuda_unittest( ++ name, ++ size = ""small"", ++ **kwargs): ++ tachyon_cuda_test( ++ name = name, ++ size = size, ++ **kwargs ++ ) ++ + def _get_hdrs(hdrs, deps): + return depset( + hdrs, +diff --git a/tachyon/BUILD.bazel b/tachyon/BUILD.bazel +index af7ef1dad..1d086a91d 100644 +--- a/tachyon/BUILD.bazel ++++ b/tachyon/BUILD.bazel +@@ -8,7 +8,7 @@ load( + load( + ""//bazel:tachyon_cc.bzl"", + ""tachyon_cc_library"", +- ""tachyon_cc_test"", ++ ""tachyon_cc_unittest"", + ) + load(""//tachyon/build:version.bzl"", ""write_version_header"") + +@@ -40,9 +40,8 @@ tachyon_cc_library( + deps = ["":export""], + ) + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""tachyon_unittests"", +- size = ""small"", + srcs = [ + ""version_unittest.cc"", + ], +diff --git a/tachyon/base/BUILD.bazel b/tachyon/base/BUILD.bazel +index b0351dc3c..de3a3fa46 100644 +--- a/tachyon/base/BUILD.bazel ++++ b/tachyon/base/BUILD.bazel +@@ -1,5 +1,5 @@ + load(""//bazel:tachyon.bzl"", ""if_posix"") +-load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_test"") ++load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_unittest"") + + package(default_visibility = [""//visibility:public""]) + +@@ -110,9 +110,8 @@ tachyon_cc_library( + hdrs = [""type_list.h""], + ) + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""base_unittests"", +- size = ""small"", + srcs = [ + ""bit_cast_unittest.cc"", + ""bits_unittest.cc"", +diff --git a/tachyon/base/buffer/BUILD.bazel b/tachyon/base/buffer/BUILD.bazel +index 091b5f28d..2e8003f92 100644 +--- a/tachyon/base/buffer/BUILD.bazel ++++ b/tachyon/base/buffer/BUILD.bazel +@@ -1,4 +1,4 @@ +-load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_test"") ++load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_unittest"") + + package(default_visibility = [""//visibility:public""]) + +@@ -41,9 +41,8 @@ tachyon_cc_library( + deps = ["":buffer""], + ) + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""buffer_unittests"", +- size = ""small"", + srcs = [""buffer_unittest.cc""], + deps = [ + "":copyable"", +diff --git a/tachyon/base/color/BUILD.bazel b/tachyon/base/color/BUILD.bazel +index 08c78a37c..aa1c58d1d 100644 +--- a/tachyon/base/color/BUILD.bazel ++++ b/tachyon/base/color/BUILD.bazel +@@ -1,4 +1,4 @@ +-load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_test"") ++load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_unittest"") + + package(default_visibility = [""//visibility:public""]) + +@@ -24,9 +24,8 @@ tachyon_cc_library( + deps = ["":color""], + ) + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""color_unittests"", +- size = ""small"", + srcs = [ + ""color_conversions_unittest.cc"", + ""color_unittest.cc"", +diff --git a/tachyon/base/containers/BUILD.bazel b/tachyon/base/containers/BUILD.bazel +index 505f1bc6c..56791b980 100644 +--- a/tachyon/base/containers/BUILD.bazel ++++ b/tachyon/base/containers/BUILD.bazel +@@ -1,4 +1,4 @@ +-load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_test"") ++load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_unittest"") + + package(default_visibility = [""//visibility:public""]) + +@@ -73,9 +73,8 @@ tachyon_cc_library( + ], + ) + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""containers_unittests"", +- size = ""small"", + srcs = [ + ""adapters_unittest.cc"", + ""circular_deque_unittest.cc"", +diff --git a/tachyon/base/files/BUILD.bazel b/tachyon/base/files/BUILD.bazel +index 882970cfd..3c5f7fc9e 100644 +--- a/tachyon/base/files/BUILD.bazel ++++ b/tachyon/base/files/BUILD.bazel +@@ -7,7 +7,7 @@ load( + load( + ""//bazel:tachyon_cc.bzl"", + ""tachyon_cc_library"", +- ""tachyon_cc_test"", ++ ""tachyon_cc_unittest"", + ""tachyon_objc_library"", + ) + +@@ -127,9 +127,8 @@ tachyon_cc_library( + deps = ["":file_util""], + ) + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""files_unittests"", +- size = ""small"", + srcs = [ + ""file_enumerator_unittest.cc"", + ""file_path_unittest.cc"", +diff --git a/tachyon/base/flag/BUILD.bazel b/tachyon/base/flag/BUILD.bazel +index 925673252..d72a9890e 100644 +--- a/tachyon/base/flag/BUILD.bazel ++++ b/tachyon/base/flag/BUILD.bazel +@@ -1,4 +1,4 @@ +-load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_test"") ++load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_unittest"") + + package(default_visibility = [""//visibility:public""]) + +@@ -32,9 +32,8 @@ tachyon_cc_library( + ], + ) + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""flag_unittests"", +- size = ""small"", + srcs = [ + ""flag_parser_unittest.cc"", + ""flag_unittest.cc"", +diff --git a/tachyon/base/functional/BUILD.bazel b/tachyon/base/functional/BUILD.bazel +index 04cad6df0..01c38afda 100644 +--- a/tachyon/base/functional/BUILD.bazel ++++ b/tachyon/base/functional/BUILD.bazel +@@ -1,4 +1,4 @@ +-load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_test"") ++load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_unittest"") + + package(default_visibility = [""//visibility:public""]) + +@@ -45,9 +45,8 @@ tachyon_cc_library( + hdrs = [""invoke.h""], + ) + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""functional_unittests"", +- size = ""small"", + srcs = [ + ""function_ref_unittest.cc"", + ""identity_unittest.cc"", +diff --git a/tachyon/base/memory/BUILD.bazel b/tachyon/base/memory/BUILD.bazel +index 5f5d7d4b3..64abfa7c2 100644 +--- a/tachyon/base/memory/BUILD.bazel ++++ b/tachyon/base/memory/BUILD.bazel +@@ -1,4 +1,4 @@ +-load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_test"") ++load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_unittest"") + + package(default_visibility = [""//visibility:public""]) + +@@ -14,9 +14,8 @@ tachyon_cc_library( + hdrs = [""scoped_policy.h""], + ) + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""memory_unittests"", +- size = ""small"", + srcs = [""aligned_memory_unittest.cc""], + deps = ["":aligned_memory""], + ) +diff --git a/tachyon/base/ranges/BUILD.bazel b/tachyon/base/ranges/BUILD.bazel +index da18da0b1..ccbc4d085 100644 +--- a/tachyon/base/ranges/BUILD.bazel ++++ b/tachyon/base/ranges/BUILD.bazel +@@ -1,4 +1,4 @@ +-load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_test"") ++load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_unittest"") + + package(default_visibility = [""//visibility:public""]) + +@@ -27,9 +27,8 @@ tachyon_cc_library( + deps = [""//tachyon/base:template_util""], + ) + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""ranges_unittests"", +- size = ""small"", + srcs = [ + ""algorithm_unittest.cc"", + ""functional_unittest.cc"", +diff --git a/tachyon/base/strings/BUILD.bazel b/tachyon/base/strings/BUILD.bazel +index 91d472623..2824c0e20 100644 +--- a/tachyon/base/strings/BUILD.bazel ++++ b/tachyon/base/strings/BUILD.bazel +@@ -2,7 +2,7 @@ load(""//bazel:tachyon.bzl"", ""if_macos"") + load( + ""//bazel:tachyon_cc.bzl"", + ""tachyon_cc_library"", +- ""tachyon_cc_test"", ++ ""tachyon_cc_unittest"", + ""tachyon_objc_library"", + ) + +@@ -89,9 +89,8 @@ tachyon_objc_library( + alwayslink = True, + ) + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""strings_unittests"", +- size = ""small"", + srcs = [ + ""string_number_conversions_unittest.cc"", + ""string_util_unittest.cc"", +diff --git a/tachyon/base/time/BUILD.bazel b/tachyon/base/time/BUILD.bazel +index 7c23880a5..a3364a777 100644 +--- a/tachyon/base/time/BUILD.bazel ++++ b/tachyon/base/time/BUILD.bazel +@@ -2,7 +2,7 @@ load(""//bazel:tachyon.bzl"", ""if_macos"", ""if_posix"") + load( + ""//bazel:tachyon_cc.bzl"", + ""tachyon_cc_library"", +- ""tachyon_cc_test"", ++ ""tachyon_cc_unittest"", + ""tachyon_objc_library"", + ) + load("":time_buildflags.bzl"", ""time_buildflag_header"") +@@ -89,9 +89,8 @@ tachyon_objc_library( + alwayslink = True, + ) + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""time_unittests"", +- size = ""small"", + srcs = [ + ""time_delta_flag_unittest.cc"", + ""time_interval_unittest.cc"", +diff --git a/tachyon/c/BUILD.bazel b/tachyon/c/BUILD.bazel +index 610917db3..3979f0201 100644 +--- a/tachyon/c/BUILD.bazel ++++ b/tachyon/c/BUILD.bazel +@@ -12,7 +12,7 @@ load( + ""collect_hdrs"", + ""tachyon_cc_library"", + ""tachyon_cc_shared_library"", +- ""tachyon_cc_test"", ++ ""tachyon_cc_unittest"", + ) + load(""//tachyon/build:version.bzl"", ""write_version_header"") + +@@ -83,9 +83,8 @@ collect_hdrs( + ], + ) + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""c_unittests"", +- size = ""small"", + srcs = [ + ""version_unittest.cc"", + ], +diff --git a/tachyon/c/math/elliptic_curves/msm/BUILD.bazel b/tachyon/c/math/elliptic_curves/msm/BUILD.bazel +index 44d556ae4..b792ac09b 100644 +--- a/tachyon/c/math/elliptic_curves/msm/BUILD.bazel ++++ b/tachyon/c/math/elliptic_curves/msm/BUILD.bazel +@@ -2,9 +2,9 @@ load(""//bazel:tachyon.bzl"", ""if_gpu_is_configured"") + load( + ""//bazel:tachyon_cc.bzl"", + ""tachyon_cc_library"", +- ""tachyon_cc_test"", ++ ""tachyon_cc_unittest"", + ""tachyon_cuda_binary"", +- ""tachyon_cuda_test"", ++ ""tachyon_cuda_unittest"", + ) + + package(default_visibility = [""//visibility:public""]) +@@ -56,9 +56,8 @@ tachyon_cc_library( + ], + ) + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""msm_unittests"", +- size = ""small"", + srcs = [""msm_unittest.cc""], + deps = [ + ""//tachyon/base:bits"", +@@ -67,9 +66,8 @@ tachyon_cc_test( + ], + ) + +-tachyon_cuda_test( ++tachyon_cuda_unittest( + name = ""msm_gpu_unittests"", +- size = ""small"", + srcs = if_gpu_is_configured([""msm_gpu_unittest.cc""]), + deps = [ + ""//tachyon/base:bits"", +diff --git a/tachyon/c/math/elliptic_curves/short_weierstrass/BUILD.bazel b/tachyon/c/math/elliptic_curves/short_weierstrass/BUILD.bazel +index f523715a5..cfb53a293 100644 +--- a/tachyon/c/math/elliptic_curves/short_weierstrass/BUILD.bazel ++++ b/tachyon/c/math/elliptic_curves/short_weierstrass/BUILD.bazel +@@ -1,8 +1,7 @@ +-load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_test"") ++load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_unittest"") + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""short_weierstrass_unittests"", +- size = ""small"", + srcs = [ + ""affine_point_unittest.cc"", + ""jacobian_point_unittest.cc"", +diff --git a/tachyon/c/math/finite_fields/BUILD.bazel b/tachyon/c/math/finite_fields/BUILD.bazel +index 7058fc4bf..55c9264b8 100644 +--- a/tachyon/c/math/finite_fields/BUILD.bazel ++++ b/tachyon/c/math/finite_fields/BUILD.bazel +@@ -1,8 +1,7 @@ +-load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_test"") ++load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_unittest"") + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""finite_fields_unittests"", +- size = ""small"", + srcs = [""prime_field_unittest.cc""], + deps = [ + ""//tachyon/c/math/elliptic_curves/bn/bn254:fr"", +diff --git a/tachyon/cc/BUILD.bazel b/tachyon/cc/BUILD.bazel +index dbec82088..9915b7917 100644 +--- a/tachyon/cc/BUILD.bazel ++++ b/tachyon/cc/BUILD.bazel +@@ -11,7 +11,7 @@ load( + ""collect_hdrs"", + ""tachyon_cc_library"", + ""tachyon_cc_shared_library"", +- ""tachyon_cc_test"", ++ ""tachyon_cc_unittest"", + ) + load(""//tachyon/build:version.bzl"", ""write_version_header"") + +@@ -43,9 +43,8 @@ tachyon_cc_library( + deps = ["":export""], + ) + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""cc_unittests"", +- size = ""small"", + srcs = [ + ""version_unittest.cc"", + ], +diff --git a/tachyon/cc/math/elliptic_curves/short_weierstrass/BUILD.bazel b/tachyon/cc/math/elliptic_curves/short_weierstrass/BUILD.bazel +index 25d436bd2..9fd8a8089 100644 +--- a/tachyon/cc/math/elliptic_curves/short_weierstrass/BUILD.bazel ++++ b/tachyon/cc/math/elliptic_curves/short_weierstrass/BUILD.bazel +@@ -1,8 +1,7 @@ +-load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_test"") ++load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_unittest"") + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""short_weierstrass_unittests"", +- size = ""small"", + srcs = [ + ""affine_point_unittest.cc"", + ""jacobian_point_unittest.cc"", +diff --git a/tachyon/cc/math/finite_fields/BUILD.bazel b/tachyon/cc/math/finite_fields/BUILD.bazel +index b5d95bd23..066b70fa8 100644 +--- a/tachyon/cc/math/finite_fields/BUILD.bazel ++++ b/tachyon/cc/math/finite_fields/BUILD.bazel +@@ -1,4 +1,4 @@ +-load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_test"") ++load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_unittest"") + + package(default_visibility = [""//visibility:public""]) + +@@ -16,9 +16,8 @@ tachyon_cc_library( + hdrs = [""prime_field_traits.h""], + ) + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""finite_fields_unittests"", +- size = ""small"", + srcs = [""prime_field_unittest.cc""], + deps = [ + ""//tachyon/cc/math/elliptic_curves/bn/bn254:fr"", +diff --git a/tachyon/crypto/commitments/pedersen/BUILD.bazel b/tachyon/crypto/commitments/pedersen/BUILD.bazel +index da716c075..82dfb29b2 100644 +--- a/tachyon/crypto/commitments/pedersen/BUILD.bazel ++++ b/tachyon/crypto/commitments/pedersen/BUILD.bazel +@@ -1,7 +1,7 @@ + load( + ""//bazel:tachyon_cc.bzl"", + ""tachyon_cc_library"", +- ""tachyon_cc_test"", ++ ""tachyon_cc_unittest"", + ) + + tachyon_cc_library( +@@ -13,9 +13,8 @@ tachyon_cc_library( + ], + ) + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""pedersen_unittests"", +- size = ""small"", + srcs = [""pedersen_unittest.cc""], + deps = [ + "":pedersen"", +diff --git a/tachyon/crypto/hashes/BUILD.bazel b/tachyon/crypto/hashes/BUILD.bazel +index 8e872870d..a406a877e 100644 +--- a/tachyon/crypto/hashes/BUILD.bazel ++++ b/tachyon/crypto/hashes/BUILD.bazel +@@ -1,4 +1,4 @@ +-load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_test"") ++load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_unittest"") + + package(default_visibility = [""//visibility:public""]) + +@@ -12,9 +12,8 @@ tachyon_cc_library( + ], + ) + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""serializable_unittests"", +- size = ""small"", + srcs = [ + ""prime_field_serializable_unittest.cc"", + ], +diff --git a/tachyon/crypto/hashes/sponge/poseidon/BUILD.bazel b/tachyon/crypto/hashes/sponge/poseidon/BUILD.bazel +index 5195c4fa2..3b9532dcd 100644 +--- a/tachyon/crypto/hashes/sponge/poseidon/BUILD.bazel ++++ b/tachyon/crypto/hashes/sponge/poseidon/BUILD.bazel +@@ -1,4 +1,4 @@ +-load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_test"") ++load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_unittest"") + + package(default_visibility = [""//visibility:public""]) + +@@ -32,9 +32,8 @@ tachyon_cc_library( + ], + ) + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""poseidon_unittests"", +- size = ""small"", + srcs = [ + ""grain_lfsr_unittest.cc"", + ""poseidon_config_unittest.cc"", +diff --git a/tachyon/device/BUILD.bazel b/tachyon/device/BUILD.bazel +index b4ed41191..d4aaacc75 100644 +--- a/tachyon/device/BUILD.bazel ++++ b/tachyon/device/BUILD.bazel +@@ -1,5 +1,5 @@ + load(""//bazel:tachyon.bzl"", ""if_has_numa"") +-load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_test"") ++load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_unittest"") + + package(default_visibility = [""//visibility:public""]) + +@@ -37,9 +37,8 @@ tachyon_cc_library( + ] + if_has_numa([""@hwloc""]), + ) + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""device_unittests"", +- size = ""small"", + srcs = [""numa_unittest.cc""], + deps = ["":numa""], + ) +diff --git a/tachyon/device/gpu/BUILD.bazel b/tachyon/device/gpu/BUILD.bazel +index 15e005b06..8d2ab2281 100644 +--- a/tachyon/device/gpu/BUILD.bazel ++++ b/tachyon/device/gpu/BUILD.bazel +@@ -4,7 +4,7 @@ load( + ""//bazel:tachyon_cc.bzl"", + ""tachyon_cc_library"", + ""tachyon_cuda_defines"", +- ""tachyon_cuda_test"", ++ ""tachyon_cuda_unittest"", + ) + + package(default_visibility = [""//visibility:public""]) +@@ -154,9 +154,8 @@ tachyon_cc_library( + ], + ) + +-tachyon_cuda_test( ++tachyon_cuda_unittest( + name = ""gpu_unittests"", +- size = ""small"", + srcs = if_gpu_is_configured([""gpu_memory_unittest.cc""]), + deps = [ + "":gpu_memory"", +diff --git a/tachyon/device/gpu/cuda/BUILD.bazel b/tachyon/device/gpu/cuda/BUILD.bazel +index 3a35ef75d..d44f7da39 100644 +--- a/tachyon/device/gpu/cuda/BUILD.bazel ++++ b/tachyon/device/gpu/cuda/BUILD.bazel +@@ -1,5 +1,5 @@ + load(""@local_config_cuda//cuda:build_defs.bzl"", ""if_cuda"") +-load(""//bazel:tachyon_cc.bzl"", ""tachyon_cuda_library"", ""tachyon_cuda_test"") ++load(""//bazel:tachyon_cc.bzl"", ""tachyon_cuda_library"", ""tachyon_cuda_unittest"") + + package(default_visibility = [""//visibility:public""]) + +@@ -31,9 +31,8 @@ tachyon_cuda_library( + ]), + ) + +-tachyon_cuda_test( ++tachyon_cuda_unittest( + name = ""cuda_unittests"", +- size = ""small"", + srcs = [ + ""cuda_driver_unittest.cc"", + ], +diff --git a/tachyon/math/base/BUILD.bazel b/tachyon/math/base/BUILD.bazel +index 33e170881..f8d1350c9 100644 +--- a/tachyon/math/base/BUILD.bazel ++++ b/tachyon/math/base/BUILD.bazel +@@ -1,4 +1,4 @@ +-load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_test"") ++load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_unittest"") + + package(default_visibility = [""//visibility:public""]) + +@@ -93,9 +93,8 @@ tachyon_cc_library( + ], + ) + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""base_unittests"", +- size = ""small"", + srcs = [ + ""arithmetics_unittest.cc"", + ""big_int_unittest.cc"", +diff --git a/tachyon/math/base/gmp/BUILD.bazel b/tachyon/math/base/gmp/BUILD.bazel +index 260fd3c74..7d18287cf 100644 +--- a/tachyon/math/base/gmp/BUILD.bazel ++++ b/tachyon/math/base/gmp/BUILD.bazel +@@ -1,4 +1,4 @@ +-load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_test"") ++load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_unittest"") + + package(default_visibility = [""//visibility:public""]) + +@@ -42,9 +42,8 @@ tachyon_cc_library( + ], + ) + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""gmp_unittests"", +- size = ""small"", + srcs = [ + ""gmp_util_unittest.cc"", + ], +diff --git a/tachyon/math/elliptic_curves/msm/BUILD.bazel b/tachyon/math/elliptic_curves/msm/BUILD.bazel +index 532df805a..2cb5f5171 100644 +--- a/tachyon/math/elliptic_curves/msm/BUILD.bazel ++++ b/tachyon/math/elliptic_curves/msm/BUILD.bazel +@@ -2,8 +2,8 @@ load(""//bazel:tachyon.bzl"", ""if_gmp_backend"", ""if_gpu_is_configured"") + load( + ""//bazel:tachyon_cc.bzl"", + ""tachyon_cc_library"", +- ""tachyon_cc_test"", +- ""tachyon_cuda_test"", ++ ""tachyon_cc_unittest"", ++ ""tachyon_cuda_unittest"", + ) + + package(default_visibility = [""//visibility:public""]) +@@ -42,9 +42,8 @@ tachyon_cc_library( + ], + ) + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""msm_unittests"", +- size = ""small"", + srcs = [ + ""variable_base_msm_unittest.cc"", + ] + if_gmp_backend([ +@@ -58,9 +57,8 @@ tachyon_cc_test( + ], + ) + +-tachyon_cuda_test( ++tachyon_cuda_unittest( + name = ""msm_gpu_unittests"", +- size = ""small"", + srcs = if_gpu_is_configured([""variable_base_msm_gpu_unittest.cc""]), + deps = [ + "":variable_base_msm_gpu"", +diff --git a/tachyon/math/elliptic_curves/msm/algorithms/cuzk/BUILD.bazel b/tachyon/math/elliptic_curves/msm/algorithms/cuzk/BUILD.bazel +index 47d4d133d..5941c9461 100644 +--- a/tachyon/math/elliptic_curves/msm/algorithms/cuzk/BUILD.bazel ++++ b/tachyon/math/elliptic_curves/msm/algorithms/cuzk/BUILD.bazel +@@ -3,7 +3,7 @@ load( + ""//bazel:tachyon_cc.bzl"", + ""tachyon_cc_library"", + ""tachyon_cuda_library"", +- ""tachyon_cuda_test"", ++ ""tachyon_cuda_unittest"", + ) + + package(default_visibility = [""//visibility:public""]) +@@ -53,9 +53,8 @@ tachyon_cc_library( + ], + ) + +-tachyon_cuda_test( ++tachyon_cuda_unittest( + name = ""algorithms_gpu_unittests"", +- size = ""small"", + srcs = if_gpu_is_configured([""cuzk_unittest.cc""]), + deps = [ + "":cuzk"", +diff --git a/tachyon/math/elliptic_curves/msm/algorithms/pippenger/BUILD.bazel b/tachyon/math/elliptic_curves/msm/algorithms/pippenger/BUILD.bazel +index eee6e4d15..17d781cbf 100644 +--- a/tachyon/math/elliptic_curves/msm/algorithms/pippenger/BUILD.bazel ++++ b/tachyon/math/elliptic_curves/msm/algorithms/pippenger/BUILD.bazel +@@ -2,7 +2,7 @@ load( + ""//bazel:tachyon_cc.bzl"", + ""tachyon_cc_benchmark"", + ""tachyon_cc_library"", +- ""tachyon_cc_test"", ++ ""tachyon_cc_unittest"", + ) + + package(default_visibility = [""//visibility:public""]) +@@ -42,9 +42,8 @@ tachyon_cc_library( + deps = [""//tachyon:export""], + ) + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""algorithms_unittests"", +- size = ""small"", + srcs = [ + ""pippenger_adapter_unittest.cc"", + ""pippenger_unittest.cc"", +diff --git a/tachyon/math/elliptic_curves/short_weierstrass/BUILD.bazel b/tachyon/math/elliptic_curves/short_weierstrass/BUILD.bazel +index d4572ea1c..7f393f3d4 100644 +--- a/tachyon/math/elliptic_curves/short_weierstrass/BUILD.bazel ++++ b/tachyon/math/elliptic_curves/short_weierstrass/BUILD.bazel +@@ -2,7 +2,7 @@ load(""//bazel:tachyon.bzl"", ""if_cuda_and_gmp_backend"") + load( + ""//bazel:tachyon_cc.bzl"", + ""tachyon_cc_library"", +- ""tachyon_cc_test"", ++ ""tachyon_cc_unittest"", + ""tachyon_cuda_test"", + ) + +@@ -43,9 +43,8 @@ tachyon_cc_library( + srcs = [""sw_curve_traits.h""], + ) + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""short_weierstrass_unittests"", +- size = ""small"", + srcs = [ + ""affine_point_unittest.cc"", + ""jacobian_point_unittest.cc"", +diff --git a/tachyon/math/finite_fields/BUILD.bazel b/tachyon/math/finite_fields/BUILD.bazel +index 15af3af8f..d074dcc49 100644 +--- a/tachyon/math/finite_fields/BUILD.bazel ++++ b/tachyon/math/finite_fields/BUILD.bazel +@@ -10,7 +10,9 @@ load( + ""tachyon_cc_benchmark"", + ""tachyon_cc_library"", + ""tachyon_cc_test"", ++ ""tachyon_cc_unittest"", + ""tachyon_cuda_test"", ++ ""tachyon_cuda_unittest"", + ) + + package(default_visibility = [""//visibility:public""]) +@@ -194,9 +196,8 @@ tachyon_cc_library( + ], + ) + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""finite_fields_unittests"", +- size = ""small"", + srcs = [ + ""cubic_extension_field_unittest.cc"", + ""modulus_unittest.cc"", +@@ -214,9 +215,8 @@ tachyon_cc_test( + ], + ) + +-tachyon_cuda_test( ++tachyon_cuda_unittest( + name = ""finite_fields_gpu_unittests"", +- size = ""small"", + srcs = if_gpu_is_configured([""prime_field_gpu_unittest.cc""]), + deps = [ + "":prime_field_conversions"", +diff --git a/tachyon/math/finite_fields/goldilocks_prime/BUILD.bazel b/tachyon/math/finite_fields/goldilocks_prime/BUILD.bazel +index 67a64dd33..2d653e4e5 100644 +--- a/tachyon/math/finite_fields/goldilocks_prime/BUILD.bazel ++++ b/tachyon/math/finite_fields/goldilocks_prime/BUILD.bazel +@@ -1,5 +1,5 @@ + load(""//bazel:tachyon.bzl"", ""if_polygon_zkevm_backend"") +-load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_test"") ++load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_unittest"") + load(""//tachyon/math/finite_fields/generator/prime_field_generator:build_defs.bzl"", ""generate_prime_fields"") + + package(default_visibility = [""//visibility:public""]) +@@ -53,9 +53,8 @@ tachyon_cc_library( + ]), + ) + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""goldilocks_prime_unittests"", +- size = ""small"", + srcs = if_polygon_zkevm_backend([""prime_field_goldilocks_unittest.cc""]), + deps = ["":goldilocks""], + ) +diff --git a/tachyon/math/geometry/BUILD.bazel b/tachyon/math/geometry/BUILD.bazel +index 101974a69..3f28070c5 100644 +--- a/tachyon/math/geometry/BUILD.bazel ++++ b/tachyon/math/geometry/BUILD.bazel +@@ -1,4 +1,4 @@ +-load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_test"") ++load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_unittest"") + + package(default_visibility = [""//visibility:public""]) + +@@ -20,9 +20,8 @@ tachyon_cc_library( + deps = [""@com_google_absl//absl/strings""], + ) + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""geometry_unittests"", +- size = ""small"", + srcs = [ + ""point2_unittest.cc"", + ""point3_unittest.cc"", +diff --git a/tachyon/math/matrix/sparse/BUILD.bazel b/tachyon/math/matrix/sparse/BUILD.bazel +index c65318ddc..277e1e2b5 100644 +--- a/tachyon/math/matrix/sparse/BUILD.bazel ++++ b/tachyon/math/matrix/sparse/BUILD.bazel +@@ -1,4 +1,4 @@ +-load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_test"") ++load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_unittest"") + + package(default_visibility = [""//visibility:public""]) + +@@ -14,9 +14,8 @@ tachyon_cc_library( + ], + ) + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""sparse_unittests"", +- size = ""small"", + srcs = [""sparse_matrix_unittest.cc""], + deps = [ + "":sparse_matrix"", +diff --git a/tachyon/math/polynomials/multivariate/BUILD.bazel b/tachyon/math/polynomials/multivariate/BUILD.bazel +index 1bf04bcd1..0f74f551c 100644 +--- a/tachyon/math/polynomials/multivariate/BUILD.bazel ++++ b/tachyon/math/polynomials/multivariate/BUILD.bazel +@@ -1,4 +1,4 @@ +-load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_test"") ++load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_unittest"") + + package(default_visibility = [""//visibility:public""]) + +@@ -22,9 +22,8 @@ tachyon_cc_library( + ], + ) + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""multivariate_polynomials_unittests"", +- size = ""small"", + srcs = [ + ""multivariate_polynomial_unittest.cc"", + ], +diff --git a/tachyon/math/polynomials/univariate/BUILD.bazel b/tachyon/math/polynomials/univariate/BUILD.bazel +index 57b6af5db..72c044bd4 100644 +--- a/tachyon/math/polynomials/univariate/BUILD.bazel ++++ b/tachyon/math/polynomials/univariate/BUILD.bazel +@@ -1,4 +1,4 @@ +-load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_test"") ++load(""//bazel:tachyon_cc.bzl"", ""tachyon_cc_library"", ""tachyon_cc_unittest"") + + package(default_visibility = [""//visibility:public""]) + +@@ -23,9 +23,8 @@ tachyon_cc_library( + ], + ) + +-tachyon_cc_test( ++tachyon_cc_unittest( + name = ""univariate_polynomials_unittests"", +- size = ""small"", + srcs = [ + ""dense_polynomial_unittest.cc"", + ""sparse_polynomial_unittest.cc"", +diff --git a/tachyon/node/test/bazel/tachyon_jest.bzl b/tachyon/node/test/bazel/tachyon_jest.bzl +index 30c435f70..9cfce21ff 100644 +--- a/tachyon/node/test/bazel/tachyon_jest.bzl ++++ b/tachyon/node/test/bazel/tachyon_jest.bzl +@@ -11,3 +11,13 @@ def tachyon_jest_test( + node_modules = node_modules, + **kwargs + ) ++ ++def tachyon_jest_unittest( ++ name, ++ size = ""small"", ++ **kwargs): ++ tachyon_jest_test( ++ name = name, ++ size = size, ++ **kwargs ++ ) +diff --git a/tachyon/node/test/src/math/elliptic_curves/short_weierstrass/BUILD.bazel b/tachyon/node/test/src/math/elliptic_curves/short_weierstrass/BUILD.bazel +index e14d8eed0..3ee058b91 100644 +--- a/tachyon/node/test/src/math/elliptic_curves/short_weierstrass/BUILD.bazel ++++ b/tachyon/node/test/src/math/elliptic_curves/short_weierstrass/BUILD.bazel +@@ -1,8 +1,8 @@ + load(""//bazel:tachyon_ts.bzl"", ""tachyon_ts_project"") +-load(""//bazel:tachyon_jest.bzl"", ""tachyon_jest_test"") ++load(""//bazel:tachyon_jest.bzl"", ""tachyon_jest_unittest"") + + tachyon_ts_project( +- name = ""short_weierstrass_ts"", ++ name = ""short_weierstrass"", + testonly = True, + srcs = [ + ""affine_point.spec.ts"", +@@ -13,7 +13,7 @@ tachyon_ts_project( + data = [""@kroma_network_tachyon//tachyon/node:tachyon""], + ) + +-tachyon_jest_test( +- name = ""short_weierstrass"", +- data = ["":short_weierstrass_ts""], ++tachyon_jest_unittest( ++ name = ""short_weierstrass_unittests"", ++ data = ["":short_weierstrass""], + ) +diff --git a/tachyon/node/test/src/math/finite_fields/BUILD.bazel b/tachyon/node/test/src/math/finite_fields/BUILD.bazel +index 8fc0f9425..f03f2030b 100644 +--- a/tachyon/node/test/src/math/finite_fields/BUILD.bazel ++++ b/tachyon/node/test/src/math/finite_fields/BUILD.bazel +@@ -1,14 +1,14 @@ + load(""//bazel:tachyon_ts.bzl"", ""tachyon_ts_project"") +-load(""//bazel:tachyon_jest.bzl"", ""tachyon_jest_test"") ++load(""//bazel:tachyon_jest.bzl"", ""tachyon_jest_unittest"") + + tachyon_ts_project( +- name = ""finite_fields_ts"", ++ name = ""finite_fields"", + testonly = True, + srcs = [""prime_field.spec.ts""], + data = [""@kroma_network_tachyon//tachyon/node:tachyon""], + ) + +-tachyon_jest_test( +- name = ""finite_fields"", +- data = ["":finite_fields_ts""], ++tachyon_jest_unittest( ++ name = ""finite_fields_unittests"", ++ data = ["":finite_fields""], + ) +diff --git a/tachyon/py/test/bazel/tachyon_py.bzl b/tachyon/py/test/bazel/tachyon_py.bzl +index cc8f87463..72690d7b2 100644 +--- a/tachyon/py/test/bazel/tachyon_py.bzl ++++ b/tachyon/py/test/bazel/tachyon_py.bzl +@@ -35,3 +35,11 @@ def tachyon_py_test( + srcs_version = srcs_version, + **kwargs + ) ++ ++def tachyon_py_unittest( ++ name, ++ **kwargs): ++ py_test( ++ name = name + ""_unittests"", ++ **kwargs ++ ) +diff --git a/tachyon/py/test/tachyon/math/elliptic_curves/short_weierstrass/BUILD.bazel b/tachyon/py/test/tachyon/math/elliptic_curves/short_weierstrass/BUILD.bazel +index 38d11dec0..b5aac9ebd 100644 +--- a/tachyon/py/test/tachyon/math/elliptic_curves/short_weierstrass/BUILD.bazel ++++ b/tachyon/py/test/tachyon/math/elliptic_curves/short_weierstrass/BUILD.bazel +@@ -1,7 +1,7 @@ + load(""@pip_deps//:requirements.bzl"", ""requirement"") +-load(""//bazel:tachyon_py.bzl"", ""tachyon_py_test"") ++load(""//bazel:tachyon_py.bzl"", ""tachyon_py_unittest"") + +-tachyon_py_test( ++tachyon_py_unittest( + name = ""short_weierstrass_unittests"", + srcs = [ + ""affine_point_unittest.py"", +diff --git a/tachyon/py/test/tachyon/math/finite_fields/BUILD.bazel b/tachyon/py/test/tachyon/math/finite_fields/BUILD.bazel +index 43d81db97..99e0ab2d5 100644 +--- a/tachyon/py/test/tachyon/math/finite_fields/BUILD.bazel ++++ b/tachyon/py/test/tachyon/math/finite_fields/BUILD.bazel +@@ -1,7 +1,7 @@ + load(""@pip_deps//:requirements.bzl"", ""requirement"") +-load(""//bazel:tachyon_py.bzl"", ""tachyon_py_test"") ++load(""//bazel:tachyon_py.bzl"", ""tachyon_py_unittest"") + +-tachyon_py_test( ++tachyon_py_unittest( + name = ""finite_fields_unittests"", + srcs = [ + ""finite_fields_unittests.py""," +docfx,https://github.com/dotnet/docfx,b9a1b3cf4593648f50e76d2f445e1c2a7d4556dd,dependabot[bot],2023-10-04 13:42:46,build(deps): bump HtmlAgilityPack from 1.11.53 to 1.11.54 (#9269),"Bumps [HtmlAgilityPack](https://github.com/zzzprojects/html-agility-pack) from 1.11.53 to 1.11.54. +- [Release notes](https://github.com/zzzprojects/html-agility-pack/releases) +- [Commits](https://github.com/zzzprojects/html-agility-pack/compare/v1.11.53...v1.11.54) + +---","build(deps): bump HtmlAgilityPack from 1.11.53 to 1.11.54 (#9269) + +Bumps [HtmlAgilityPack](https://github.com/zzzprojects/html-agility-pack) from 1.11.53 to 1.11.54. +- [Release notes](https://github.com/zzzprojects/html-agility-pack/releases) +- [Commits](https://github.com/zzzprojects/html-agility-pack/compare/v1.11.53...v1.11.54) + +--- +updated-dependencies: +- dependency-name: HtmlAgilityPack + dependency-type: direct:production + update-type: version-update:semver-patch +... + +Signed-off-by: dependabot[bot] +Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>","diff --git a/Directory.Packages.props b/Directory.Packages.props +index 43c78265f78..c8ee19e1da3 100644 +--- a/Directory.Packages.props ++++ b/Directory.Packages.props +@@ -5,7 +5,7 @@ + + + +- ++ + + + " +oxc,https://github.com/oxc-project/oxc,fc48cb45607fb88fa06ec772e1ea90e1a6840a02,cinchen,2024-06-26 19:16:46,feat(linter): eslint-plugin-jest/prefer-jest-mocked (#3865),"part of https://github.com/oxc-project/oxc/issues/492 + +Rule Detail: +[link](https://github.com/jest-community/eslint-plugin-jest/blob/main/src/rules/prefer-jest-mocked.ts)","feat(linter): eslint-plugin-jest/prefer-jest-mocked (#3865) + +part of https://github.com/oxc-project/oxc/issues/492 + +Rule Detail: +[link](https://github.com/jest-community/eslint-plugin-jest/blob/main/src/rules/prefer-jest-mocked.ts)","diff --git a/crates/oxc_linter/src/rules.rs b/crates/oxc_linter/src/rules.rs +index a6d7156367a4c..266e85e809e24 100644 +--- a/crates/oxc_linter/src/rules.rs ++++ b/crates/oxc_linter/src/rules.rs +@@ -184,6 +184,7 @@ mod jest { + pub mod prefer_equality_matcher; + pub mod prefer_expect_resolves; + pub mod prefer_hooks_on_top; ++ pub mod prefer_jest_mocked; + pub mod prefer_lowercase_title; + pub mod prefer_mock_promise_shorthand; + pub mod prefer_spy_on; +@@ -573,6 +574,7 @@ oxc_macros::declare_all_lint_rules! { + jest::prefer_equality_matcher, + jest::prefer_expect_resolves, + jest::prefer_hooks_on_top, ++ jest::prefer_jest_mocked, + jest::prefer_lowercase_title, + jest::prefer_mock_promise_shorthand, + jest::prefer_spy_on, +diff --git a/crates/oxc_linter/src/rules/jest/prefer_jest_mocked.rs b/crates/oxc_linter/src/rules/jest/prefer_jest_mocked.rs +new file mode 100644 +index 0000000000000..51da7778b4723 +--- /dev/null ++++ b/crates/oxc_linter/src/rules/jest/prefer_jest_mocked.rs +@@ -0,0 +1,328 @@ ++use oxc_ast::{ ++ ast::{TSAsExpression, TSType, TSTypeAssertion, TSTypeName, TSTypeReference}, ++ AstKind, ++}; ++use oxc_diagnostics::OxcDiagnostic; ++use oxc_macros::declare_oxc_lint; ++use oxc_span::{GetSpan, Span}; ++use phf::{phf_set, Set}; ++ ++use crate::{context::LintContext, rule::Rule, AstNode}; ++ ++fn use_jest_mocked(span0: Span) -> OxcDiagnostic { ++ OxcDiagnostic::warn( ++ ""eslint-plugin-jest(prefer-jest-mocked): Prefer `jest.mocked()` over `fn as jest.Mock`."", ++ ) ++ .with_help(""Prefer `jest.mocked()`"") ++ .with_labels([span0.into()]) ++} ++ ++#[derive(Debug, Default, Clone)] ++pub struct PreferJestMocked; ++ ++declare_oxc_lint!( ++ /// ### What it does ++ /// ++ /// When working with mocks of functions using Jest, it's recommended to use the ++ /// `jest.mocked()` helper function to properly type the mocked functions. This rule ++ /// enforces the use of `jest.mocked()` for better type safety and readability. ++ /// ++ /// Restricted types: ++ /// ++ /// ++ /// - `jest.Mock` ++ /// - `jest.MockedFunction` ++ /// - `jest.MockedClass` ++ /// - `jest.MockedObject` ++ /// ++ /// ### Examples ++ /// ++ /// ```typescript ++ /// // invalid ++ /// (foo as jest.Mock).mockReturnValue(1); ++ /// const mock = (foo as jest.Mock).mockReturnValue(1); ++ /// (foo as unknown as jest.Mock).mockReturnValue(1); ++ /// (Obj.foo as jest.Mock).mockReturnValue(1); ++ /// ([].foo as jest.Mock).mockReturnValue(1); ++ /// ++ /// // valid ++ /// jest.mocked(foo).mockReturnValue(1); ++ /// const mock = jest.mocked(foo).mockReturnValue(1); ++ /// jest.mocked(Obj.foo).mockReturnValue(1); ++ /// jest.mocked([].foo).mockReturnValue(1); ++ /// ``` ++ PreferJestMocked, ++ style, ++); ++ ++impl Rule for PreferJestMocked { ++ fn run(&self, node: &AstNode, ctx: &LintContext) { ++ if let AstKind::TSAsExpression(ts_expr) = node.kind() { ++ if !matches!(ctx.nodes().parent_kind(node.id()), Some(AstKind::TSAsExpression(_))) { ++ Self::check_ts_as_expression(ts_expr, ctx); ++ } ++ } else if let AstKind::TSTypeAssertion(assert_type) = node.kind() { ++ Self::check_assert_type(assert_type, ctx); ++ } ++ } ++} ++ ++const MOCK_TYPES: Set<&'static str> = phf_set! { ++ ""Mock"", ++ ""MockedFunction"", ++ ""MockedClass"", ++ ""MockedObject"", ++}; ++ ++impl PreferJestMocked { ++ fn check_ts_as_expression(as_expr: &TSAsExpression, ctx: &LintContext) { ++ let TSType::TSTypeReference(ts_reference) = &as_expr.type_annotation else { ++ return; ++ }; ++ let arg_span = as_expr.expression.get_inner_expression().span(); ++ Self::check(ts_reference, arg_span, as_expr.span, ctx); ++ } ++ ++ fn check_assert_type(assert_type: &TSTypeAssertion, ctx: &LintContext) { ++ let TSType::TSTypeReference(ts_reference) = &assert_type.type_annotation else { ++ return; ++ }; ++ let arg_span = assert_type.expression.get_inner_expression().span(); ++ Self::check(ts_reference, arg_span, assert_type.span, ctx); ++ } ++ ++ fn check(ts_reference: &TSTypeReference, arg_span: Span, span: Span, ctx: &LintContext) { ++ let TSTypeName::QualifiedName(qualified_name) = &ts_reference.type_name else { ++ return; ++ }; ++ let TSTypeName::IdentifierReference(ident) = &qualified_name.left else { ++ return; ++ }; ++ ++ if !&ident.name.eq_ignore_ascii_case(""jest"") ++ || !MOCK_TYPES.contains(qualified_name.right.name.as_str()) ++ { ++ return; ++ } ++ ++ ctx.diagnostic_with_fix(use_jest_mocked(span), |fixer| { ++ let span_source_code = fixer.source_range(arg_span); ++ fixer.replace(span, format!(""jest.mocked({span_source_code})"")) ++ }); ++ } ++} ++ ++#[test] ++fn test() { ++ use crate::tester::Tester; ++ use std::path::PathBuf; ++ ++ let pass = vec![ ++ (""foo();"", None, None, None), ++ (""jest.mocked(foo).mockReturnValue(1);"", None, None, None), ++ (""bar.mockReturnValue(1);"", None, None, None), ++ (""sinon.stub(foo).returns(1);"", None, None, None), ++ (""foo.mockImplementation(() => 1);"", None, None, None), ++ (""obj.foo();"", None, None, None), ++ (""mockFn.mockReturnValue(1);"", None, None, None), ++ (""arr[0]();"", None, None, None), ++ (""obj.foo.mockReturnValue(1);"", None, None, None), ++ (""jest.spyOn(obj, 'foo').mockReturnValue(1);"", None, None, None), ++ (""(foo as Mock.jest).mockReturnValue(1);"", None, None, None), ++ ( ++ "" ++ type MockType = jest.Mock; ++ const mockFn = jest.fn(); ++ (mockFn as MockType).mockReturnValue(1); ++ "", ++ None, ++ None, ++ None, ++ ), ++ ]; ++ ++ let fail = vec![ ++ (""(foo as jest.Mock).mockReturnValue(1);"", None, None, None), ++ ( ++ ""(foo as unknown as string as unknown as jest.Mock).mockReturnValue(1);"", ++ None, ++ None, ++ None, ++ ), ++ ( ++ ""(foo as unknown as jest.Mock as unknown as jest.Mock).mockReturnValue(1);"", ++ None, ++ None, ++ None, ++ ), ++ ( ++ ""(foo).mockReturnValue(1);"", ++ None, ++ None, ++ Some(PathBuf::from(""/prefer-jest-mocked.ts"")), ++ ), ++ (""(foo as jest.Mock).mockImplementation(1);"", None, None, None), ++ (""(foo as unknown as jest.Mock).mockReturnValue(1);"", None, None, None), ++ ( ++ ""(foo as unknown).mockReturnValue(1);"", ++ None, ++ None, ++ Some(PathBuf::from(""/prefer-jest-mocked.ts"")), ++ ), ++ (""(Obj.foo as jest.Mock).mockReturnValue(1);"", None, None, None), ++ (""([].foo as jest.Mock).mockReturnValue(1);"", None, None, None), ++ (""(foo as jest.MockedFunction).mockReturnValue(1);"", None, None, None), ++ (""(foo as jest.MockedFunction).mockImplementation(1);"", None, None, None), ++ (""(foo as unknown as jest.MockedFunction).mockReturnValue(1);"", None, None, None), ++ (""(Obj.foo as jest.MockedFunction).mockReturnValue(1);"", None, None, None), ++ ( ++ ""(new Array(0).fill(null).foo as jest.MockedFunction).mockReturnValue(1);"", ++ None, ++ None, ++ None, ++ ), ++ (""(jest.fn(() => foo) as jest.MockedFunction).mockReturnValue(1);"", None, None, None), ++ ( ++ ""const mockedUseFocused = useFocused as jest.MockedFunction;"", ++ None, ++ None, ++ None, ++ ), ++ ( ++ ""const filter = (MessageService.getMessage as jest.Mock).mock.calls[0][0];"", ++ None, ++ None, ++ None, ++ ), ++ ( ++ "" ++ class A {} ++ (foo as jest.MockedClass) ++ "", ++ None, ++ None, ++ None, ++ ), ++ (""(foo as jest.MockedObject<{method: () => void}>)"", None, None, None), ++ (""(Obj['foo'] as jest.MockedFunction).mockReturnValue(1);"", None, None, None), ++ ( ++ "" ++ ( ++ new Array(100) ++ .fill(undefined) ++ .map(x => x.value) ++ .filter(v => !!v).myProperty as jest.MockedFunction<{ ++ method: () => void; ++ }> ++ ).mockReturnValue(1); ++ "", ++ None, ++ None, ++ None, ++ ), ++ ]; ++ ++ let fix = vec![ ++ (""(foo as jest.Mock).mockReturnValue(1);"", ""(jest.mocked(foo)).mockReturnValue(1);""), ++ ( ++ ""(foo as unknown as string as unknown as jest.Mock).mockReturnValue(1);"", ++ ""(jest.mocked(foo)).mockReturnValue(1);"", ++ ), ++ ( ++ ""(foo as unknown as jest.Mock as unknown as jest.Mock).mockReturnValue(1);"", ++ ""(jest.mocked(foo)).mockReturnValue(1);"", ++ ), ++ // Note: couldn't fix ++ // ( ++ // ""(foo).mockReturnValue(1);"", ++ // ""(jest.mocked(foo)).mockReturnValue(1);"", ++ // ), ++ (""(foo as jest.Mock).mockImplementation(1);"", ""(jest.mocked(foo)).mockImplementation(1);""), ++ ( ++ ""(foo as unknown as jest.Mock).mockReturnValue(1);"", ++ ""(jest.mocked(foo)).mockReturnValue(1);"", ++ ), ++ // Note: couldn't fix ++ // ( ++ // ""(foo as unknown).mockReturnValue(1);"", ++ // ""(jest.mocked(foo) as unknown).mockReturnValue(1);"", ++ // ), ++ ( ++ ""(Obj.foo as jest.Mock).mockReturnValue(1);"", ++ ""(jest.mocked(Obj.foo)).mockReturnValue(1);"", ++ ), ++ (""([].foo as jest.Mock).mockReturnValue(1);"", ""(jest.mocked([].foo)).mockReturnValue(1);""), ++ ( ++ ""(foo as jest.MockedFunction).mockReturnValue(1);"", ++ ""(jest.mocked(foo)).mockReturnValue(1);"", ++ ), ++ ( ++ ""(foo as jest.MockedFunction).mockImplementation(1);"", ++ ""(jest.mocked(foo)).mockImplementation(1);"", ++ ), ++ ( ++ ""(foo as unknown as jest.MockedFunction).mockReturnValue(1);"", ++ ""(jest.mocked(foo)).mockReturnValue(1);"", ++ ), ++ ( ++ ""(Obj.foo as jest.MockedFunction).mockReturnValue(1);"", ++ ""(jest.mocked(Obj.foo)).mockReturnValue(1);"", ++ ), ++ ( ++ ""(new Array(0).fill(null).foo as jest.MockedFunction).mockReturnValue(1);"", ++ ""(jest.mocked(new Array(0).fill(null).foo)).mockReturnValue(1);"", ++ ), ++ ( ++ ""(jest.fn(() => foo) as jest.MockedFunction).mockReturnValue(1);"", ++ ""(jest.mocked(jest.fn(() => foo))).mockReturnValue(1);"", ++ ), ++ ( ++ ""const mockedUseFocused = useFocused as jest.MockedFunction;"", ++ ""const mockedUseFocused = jest.mocked(useFocused);"", ++ ), ++ ( ++ ""const filter = (MessageService.getMessage as jest.Mock).mock.calls[0][0];"", ++ ""const filter = (jest.mocked(MessageService.getMessage)).mock.calls[0][0];"", ++ ), ++ ( ++ "" ++ class A {} ++ (foo as jest.MockedClass) ++ "", ++ "" ++ class A {} ++ (jest.mocked(foo)) ++ "", ++ ), ++ (""(foo as jest.MockedObject<{method: () => void}>)"", ""(jest.mocked(foo))""), ++ ( ++ ""(Obj['foo'] as jest.MockedFunction).mockReturnValue(1);"", ++ ""(jest.mocked(Obj['foo'])).mockReturnValue(1);"", ++ ), ++ ( ++ "" ++ ( ++ new Array(100) ++ .fill(undefined) ++ .map(x => x.value) ++ .filter(v => !!v).myProperty as jest.MockedFunction<{ ++ method: () => void; ++ }> ++ ).mockReturnValue(1); ++ "", ++ "" ++ ( ++ jest.mocked(new Array(100) ++ .fill(undefined) ++ .map(x => x.value) ++ .filter(v => !!v).myProperty) ++ ).mockReturnValue(1); ++ "", ++ ), ++ ]; ++ ++ Tester::new(PreferJestMocked::NAME, pass, fail) ++ .with_jest_plugin(true) ++ .expect_fix(fix) ++ .test_and_snapshot(); ++} +diff --git a/crates/oxc_linter/src/snapshots/prefer_jest_mocked.snap b/crates/oxc_linter/src/snapshots/prefer_jest_mocked.snap +new file mode 100644 +index 0000000000000..7cc7a8f947be3 +--- /dev/null ++++ b/crates/oxc_linter/src/snapshots/prefer_jest_mocked.snap +@@ -0,0 +1,159 @@ ++--- ++source: crates/oxc_linter/src/tester.rs ++assertion_line: 209 ++expression: prefer_jest_mocked ++--- ++ ⚠ eslint-plugin-jest(prefer-jest-mocked): Prefer `jest.mocked()` over `fn as jest.Mock`. ++ ╭─[prefer_jest_mocked.tsx:1:2] ++ 1 │ (foo as jest.Mock).mockReturnValue(1); ++ · ──────────────── ++ ╰──── ++ help: Prefer `jest.mocked()` ++ ++ ⚠ eslint-plugin-jest(prefer-jest-mocked): Prefer `jest.mocked()` over `fn as jest.Mock`. ++ ╭─[prefer_jest_mocked.tsx:1:2] ++ 1 │ (foo as unknown as string as unknown as jest.Mock).mockReturnValue(1); ++ · ──────────────────────────────────────────────── ++ ╰──── ++ help: Prefer `jest.mocked()` ++ ++ ⚠ eslint-plugin-jest(prefer-jest-mocked): Prefer `jest.mocked()` over `fn as jest.Mock`. ++ ╭─[prefer_jest_mocked.tsx:1:2] ++ 1 │ (foo as unknown as jest.Mock as unknown as jest.Mock).mockReturnValue(1); ++ · ─────────────────────────────────────────────────── ++ ╰──── ++ help: Prefer `jest.mocked()` ++ ++ ⚠ eslint-plugin-jest(prefer-jest-mocked): Prefer `jest.mocked()` over `fn as jest.Mock`. ++ ╭─[prefer_jest_mocked.tsx:1:2] ++ 1 │ (foo).mockReturnValue(1); ++ · ────────────── ++ ╰──── ++ help: Prefer `jest.mocked()` ++ ++ ⚠ eslint-plugin-jest(prefer-jest-mocked): Prefer `jest.mocked()` over `fn as jest.Mock`. ++ ╭─[prefer_jest_mocked.tsx:1:2] ++ 1 │ (foo as jest.Mock).mockImplementation(1); ++ · ──────────────── ++ ╰──── ++ help: Prefer `jest.mocked()` ++ ++ ⚠ eslint-plugin-jest(prefer-jest-mocked): Prefer `jest.mocked()` over `fn as jest.Mock`. ++ ╭─[prefer_jest_mocked.tsx:1:2] ++ 1 │ (foo as unknown as jest.Mock).mockReturnValue(1); ++ · ─────────────────────────── ++ ╰──── ++ help: Prefer `jest.mocked()` ++ ++ ⚠ eslint-plugin-jest(prefer-jest-mocked): Prefer `jest.mocked()` over `fn as jest.Mock`. ++ ╭─[prefer_jest_mocked.tsx:1:2] ++ 1 │ (foo as unknown).mockReturnValue(1); ++ · ────────────── ++ ╰──── ++ help: Prefer `jest.mocked()` ++ ++ ⚠ eslint-plugin-jest(prefer-jest-mocked): Prefer `jest.mocked()` over `fn as jest.Mock`. ++ ╭─[prefer_jest_mocked.tsx:1:2] ++ 1 │ (Obj.foo as jest.Mock).mockReturnValue(1); ++ · ──────────────────── ++ ╰──── ++ help: Prefer `jest.mocked()` ++ ++ ⚠ eslint-plugin-jest(prefer-jest-mocked): Prefer `jest.mocked()` over `fn as jest.Mock`. ++ ╭─[prefer_jest_mocked.tsx:1:2] ++ 1 │ ([].foo as jest.Mock).mockReturnValue(1); ++ · ─────────────────── ++ ╰──── ++ help: Prefer `jest.mocked()` ++ ++ ⚠ eslint-plugin-jest(prefer-jest-mocked): Prefer `jest.mocked()` over `fn as jest.Mock`. ++ ╭─[prefer_jest_mocked.tsx:1:2] ++ 1 │ (foo as jest.MockedFunction).mockReturnValue(1); ++ · ────────────────────────── ++ ╰──── ++ help: Prefer `jest.mocked()` ++ ++ ⚠ eslint-plugin-jest(prefer-jest-mocked): Prefer `jest.mocked()` over `fn as jest.Mock`. ++ ╭─[prefer_jest_mocked.tsx:1:2] ++ 1 │ (foo as jest.MockedFunction).mockImplementation(1); ++ · ────────────────────────── ++ ╰──── ++ help: Prefer `jest.mocked()` ++ ++ ⚠ eslint-plugin-jest(prefer-jest-mocked): Prefer `jest.mocked()` over `fn as jest.Mock`. ++ ╭─[prefer_jest_mocked.tsx:1:2] ++ 1 │ (foo as unknown as jest.MockedFunction).mockReturnValue(1); ++ · ───────────────────────────────────── ++ ╰──── ++ help: Prefer `jest.mocked()` ++ ++ ⚠ eslint-plugin-jest(prefer-jest-mocked): Prefer `jest.mocked()` over `fn as jest.Mock`. ++ ╭─[prefer_jest_mocked.tsx:1:2] ++ 1 │ (Obj.foo as jest.MockedFunction).mockReturnValue(1); ++ · ────────────────────────────── ++ ╰──── ++ help: Prefer `jest.mocked()` ++ ++ ⚠ eslint-plugin-jest(prefer-jest-mocked): Prefer `jest.mocked()` over `fn as jest.Mock`. ++ ╭─[prefer_jest_mocked.tsx:1:2] ++ 1 │ (new Array(0).fill(null).foo as jest.MockedFunction).mockReturnValue(1); ++ · ────────────────────────────────────────────────── ++ ╰──── ++ help: Prefer `jest.mocked()` ++ ++ ⚠ eslint-plugin-jest(prefer-jest-mocked): Prefer `jest.mocked()` over `fn as jest.Mock`. ++ ╭─[prefer_jest_mocked.tsx:1:2] ++ 1 │ (jest.fn(() => foo) as jest.MockedFunction).mockReturnValue(1); ++ · ───────────────────────────────────────── ++ ╰──── ++ help: Prefer `jest.mocked()` ++ ++ ⚠ eslint-plugin-jest(prefer-jest-mocked): Prefer `jest.mocked()` over `fn as jest.Mock`. ++ ╭─[prefer_jest_mocked.tsx:1:26] ++ 1 │ const mockedUseFocused = useFocused as jest.MockedFunction; ++ · ──────────────────────────────────────────────────── ++ ╰──── ++ help: Prefer `jest.mocked()` ++ ++ ⚠ eslint-plugin-jest(prefer-jest-mocked): Prefer `jest.mocked()` over `fn as jest.Mock`. ++ ╭─[prefer_jest_mocked.tsx:1:17] ++ 1 │ const filter = (MessageService.getMessage as jest.Mock).mock.calls[0][0]; ++ · ────────────────────────────────────── ++ ╰──── ++ help: Prefer `jest.mocked()` ++ ++ ⚠ eslint-plugin-jest(prefer-jest-mocked): Prefer `jest.mocked()` over `fn as jest.Mock`. ++ ╭─[prefer_jest_mocked.tsx:3:18] ++ 2 │ class A {} ++ 3 │ (foo as jest.MockedClass) ++ · ────────────────────────── ++ 4 │ ++ ╰──── ++ help: Prefer `jest.mocked()` ++ ++ ⚠ eslint-plugin-jest(prefer-jest-mocked): Prefer `jest.mocked()` over `fn as jest.Mock`. ++ ╭─[prefer_jest_mocked.tsx:1:2] ++ 1 │ (foo as jest.MockedObject<{method: () => void}>) ++ · ────────────────────────────────────────────── ++ ╰──── ++ help: Prefer `jest.mocked()` ++ ++ ⚠ eslint-plugin-jest(prefer-jest-mocked): Prefer `jest.mocked()` over `fn as jest.Mock`. ++ ╭─[prefer_jest_mocked.tsx:1:2] ++ 1 │ (Obj['foo'] as jest.MockedFunction).mockReturnValue(1); ++ · ───────────���───────────────────── ++ ╰──── ++ help: Prefer `jest.mocked()` ++ ++ ⚠ eslint-plugin-jest(prefer-jest-mocked): Prefer `jest.mocked()` over `fn as jest.Mock`. ++ ╭─[prefer_jest_mocked.tsx:3:17] ++ 2 │ ( ++ 3 │ ╭─▶ new Array(100) ++ 4 │ │ .fill(undefined) ++ 5 │ │ .map(x => x.value) ++ 6 │ │ .filter(v => !!v).myProperty as jest.MockedFunction<{ ++ 7 │ │ method: () => void; ++ 8 │ ╰─▶ }> ++ 9 │ ).mockReturnValue(1); ++ ╰──── ++ help: Prefer `jest.mocked()`" +argo-cd,https://github.com/argoproj/argo-cd,8a6b759c4a8705f30aafa1081e5068819f2abce7,Leonardo Luz Almeida,2021-11-02 21:18:00,fix: address edge cases with sync windows (#7517),* fix: address edge cases with sync windows,"fix: address edge cases with sync windows (#7517) + +* fix: address edge cases with sync windows + +Signed-off-by: Leonardo Luz Almeida + +* trigger build + +Signed-off-by: Leonardo Luz Almeida + +* trigger build + +Signed-off-by: Leonardo Luz Almeida ","diff --git a/pkg/apis/application/v1alpha1/types.go b/pkg/apis/application/v1alpha1/types.go +index 8ab2ae03c8f92..0069517f0c312 100644 +--- a/pkg/apis/application/v1alpha1/types.go ++++ b/pkg/apis/application/v1alpha1/types.go +@@ -1684,7 +1684,7 @@ type SyncWindow struct { + ManualSync bool `json:""manualSync,omitempty"" protobuf:""bytes,7,opt,name=manualSync""` + } + +-// HasWindows returns true if any window is defined ++// HasWindows returns true if SyncWindows has one or more SyncWindow + func (s *SyncWindows) HasWindows() bool { + return s != nil && len(*s) > 0 + } +@@ -1718,7 +1718,9 @@ func (s *SyncWindows) active(currentTime time.Time) *SyncWindows { + return nil + } + +-// TODO: document this method ++// InactiveAllows will iterate over the SyncWindows and return all inactive allow windows ++// for the current time. If the current time is in an inactive allow window, syncs will ++// be denied. + func (s *SyncWindows) InactiveAllows() *SyncWindows { + return s.inactiveAllows(time.Now()) + } +@@ -1842,50 +1844,55 @@ func (w *SyncWindows) CanSync(isManual bool) bool { + return true + } + +- var allowActive, denyActive, manualEnabled bool + active := w.Active() +- denyActive, manualEnabled = active.hasDeny() +- allowActive = active.hasAllow() ++ hasActiveDeny, manualEnabled := active.hasDeny() + +- if !denyActive { +- if !allowActive { +- if isManual && w.InactiveAllows().manualEnabled() { +- return true +- } +- } else { ++ if hasActiveDeny { ++ if isManual && manualEnabled { + return true ++ } else { ++ return false + } +- } else { +- if isManual && manualEnabled { ++ } ++ ++ inactiveAllows := w.InactiveAllows() ++ if inactiveAllows.HasWindows() { ++ if isManual && inactiveAllows.manualEnabled() { + return true ++ } else { ++ return false + } + } + +- return false ++ return true + } + ++// hasDeny will iterate over the SyncWindows and return if a deny window is found and if ++// manual sync is enabled. It returns true in the first return boolean value if it finds ++// any deny window. Will return true in the second return boolean value if all deny windows ++// have manual sync enabled. If one deny window has manual sync disabled it returns false in ++// the second return value. + func (w *SyncWindows) hasDeny() (bool, bool) { + if !w.HasWindows() { + return false, false + } +- var denyActive, manualEnabled bool ++ var denyFound, manualEnabled bool + for _, a := range *w { + if a.Kind == ""deny"" { +- if !denyActive { ++ if !denyFound { + manualEnabled = a.ManualSync + } else { + if manualEnabled { +- if !a.ManualSync { +- manualEnabled = a.ManualSync +- } ++ manualEnabled = a.ManualSync + } + } +- denyActive = true ++ denyFound = true + } + } +- return denyActive, manualEnabled ++ return denyFound, manualEnabled + } + ++// hasAllow will iterate over the SyncWindows and returns true if it find any allow window. + func (w *SyncWindows) hasAllow() bool { + if !w.HasWindows() { + return false +@@ -1898,16 +1905,19 @@ func (w *SyncWindows) hasAllow() bool { + return false + } + ++// manualEnabled will iterate over the SyncWindows and return true if all windows have ++// ManualSync set to true. Returns false if it finds at least one entry with ManualSync ++// set to false + func (w *SyncWindows) manualEnabled() bool { + if !w.HasWindows() { + return false + } + for _, s := range *w { +- if s.ManualSync { +- return true ++ if !s.ManualSync { ++ return false + } + } +- return false ++ return true + } + + // Active returns true if the sync window is currently active +diff --git a/pkg/apis/application/v1alpha1/types_test.go b/pkg/apis/application/v1alpha1/types_test.go +index 1e3071f46f855..25504ceaa20d7 100644 +--- a/pkg/apis/application/v1alpha1/types_test.go ++++ b/pkg/apis/application/v1alpha1/types_test.go +@@ -1,6 +1,7 @@ + package v1alpha1 + + import ( ++ fmt ""fmt"" + ""reflect"" + ""testing"" + ""time"" +@@ -1451,140 +1452,313 @@ func TestSyncWindows_Matches(t *testing.T) { + } + + func TestSyncWindows_CanSync(t *testing.T) { +- t.Run(""ManualSync_ActiveAllow"", func(t *testing.T) { +- proj := newTestProjectWithSyncWindows() +- deny := &SyncWindow{Kind: ""deny"", Schedule: ""0 0 1 * *"", Duration: ""1m""} +- proj.Spec.SyncWindows = append(proj.Spec.SyncWindows, deny) ++ t.Run(""will allow manual sync if inactive-deny-window set with manual true"", func(t *testing.T) { ++ // given ++ t.Parallel() ++ proj := newProjectBuilder().withInactiveDenyWindow(true).build() ++ ++ // when + canSync := proj.Spec.SyncWindows.CanSync(true) ++ ++ // then + assert.True(t, canSync) + }) +- t.Run(""AutoSync_ActiveAllow"", func(t *testing.T) { +- proj := newTestProjectWithSyncWindows() +- deny := &SyncWindow{Kind: ""deny"", Schedule: ""0 0 1 * *"", Duration: ""1m""} +- proj.Spec.SyncWindows = append(proj.Spec.SyncWindows, deny) ++ t.Run(""will allow manual sync if inactive-deny-window set with manual false"", func(t *testing.T) { ++ // given ++ t.Parallel() ++ proj := newProjectBuilder().withInactiveDenyWindow(false).build() ++ ++ // when ++ canSync := proj.Spec.SyncWindows.CanSync(true) ++ ++ // then ++ assert.True(t, canSync) ++ }) ++ t.Run(""will deny manual sync if one inactive-allow-windows set with manual false"", func(t *testing.T) { ++ // given ++ t.Parallel() ++ proj := newProjectBuilder(). ++ withInactiveAllowWindow(true). ++ withInactiveAllowWindow(false). ++ build() ++ ++ // when ++ canSync := proj.Spec.SyncWindows.CanSync(true) ++ ++ // then ++ assert.False(t, canSync) ++ }) ++ t.Run(""will allow manual sync if on active-allow-window set with manual true"", func(t *testing.T) { ++ // given ++ t.Parallel() ++ proj := newProjectBuilder(). ++ withActiveAllowWindow(true). ++ build() ++ ++ // when ++ canSync := proj.Spec.SyncWindows.CanSync(true) ++ ++ // then ++ assert.True(t, canSync) ++ }) ++ t.Run(""will allow manual sync if on active-allow-window set with manual false"", func(t *testing.T) { ++ // given ++ t.Parallel() ++ proj := newProjectBuilder(). ++ withActiveAllowWindow(false). ++ build() ++ ++ // when ++ canSync := proj.Spec.SyncWindows.CanSync(true) ++ ++ // then ++ assert.True(t, canSync) ++ }) ++ t.Run(""will allow auto sync if on active-allow-window"", func(t *testing.T) { ++ // given ++ t.Parallel() ++ proj := newProjectBuilder(). ++ withActiveAllowWindow(false). ++ build() ++ ++ // when + canSync := proj.Spec.SyncWindows.CanSync(false) ++ ++ // then + assert.True(t, canSync) + }) +- t.Run(""_ActiveAllowAndInactiveDeny"", func(t *testing.T) { +- proj := newTestProjectWithSyncWindows() ++ t.Run(""will allow manual sync active-allow and inactive-deny"", func(t *testing.T) { ++ // given ++ t.Parallel() ++ proj := newProjectBuilder(). ++ withActiveAllowWindow(false). ++ withInactiveDenyWindow(false). ++ build() ++ ++ // when + canSync := proj.Spec.SyncWindows.CanSync(true) ++ ++ // then + assert.True(t, canSync) + }) +- t.Run(""AutoSync_ActiveAllowAndInactiveDeny"", func(t *testing.T) { +- proj := newTestProjectWithSyncWindows() ++ t.Run(""will allow auto sync active-allow and inactive-deny"", func(t *testing.T) { ++ // given ++ t.Parallel() ++ proj := newProjectBuilder(). ++ withActiveAllowWindow(false). ++ withInactiveDenyWindow(false). ++ build() ++ ++ // when + canSync := proj.Spec.SyncWindows.CanSync(false) ++ ++ // then + assert.True(t, canSync) + }) +- t.Run(""ManualSync_InactiveAllow"", func(t *testing.T) { +- proj := newTestProjectWithSyncWindows() +- proj.Spec.SyncWindows[0].Schedule = ""0 0 1 * *"" +- proj.Spec.SyncWindows[0].Duration = ""1m"" ++ t.Run(""will deny manual sync inactive-allow"", func(t *testing.T) { ++ // given ++ t.Parallel() ++ proj := newProjectBuilder(). ++ withInactiveAllowWindow(false). ++ build() ++ ++ // when + canSync := proj.Spec.SyncWindows.CanSync(true) ++ ++ // then + assert.False(t, canSync) + }) +- t.Run(""AutoSync_InactiveAllow"", func(t *testing.T) { +- proj := newTestProjectWithSyncWindows() +- proj.Spec.SyncWindows[0].Schedule = ""0 0 1 * *"" +- proj.Spec.SyncWindows[0].Duration = ""1m"" ++ t.Run(""will deny auto sync inactive-allow"", func(t *testing.T) { ++ // given ++ t.Parallel() ++ proj := newProjectBuilder(). ++ withInactiveAllowWindow(false). ++ build() ++ ++ // when + canSync := proj.Spec.SyncWindows.CanSync(false) ++ ++ // then + assert.False(t, canSync) + }) +- t.Run(""ManualSync_InactiveAllowWithManualSyncEnabled"", func(t *testing.T) { +- proj := newTestProjectWithSyncWindows() +- proj.Spec.SyncWindows[0].Schedule = ""0 0 1 * *"" +- proj.Spec.SyncWindows[0].Duration = ""1m"" +- proj.Spec.SyncWindows[0].ManualSync = true ++ t.Run(""will allow manual sync inactive-allow with ManualSync enabled"", func(t *testing.T) { ++ // given ++ t.Parallel() ++ proj := newProjectBuilder(). ++ withInactiveAllowWindow(true). ++ build() ++ ++ // when + canSync := proj.Spec.SyncWindows.CanSync(true) ++ ++ // then + assert.True(t, canSync) + }) +- t.Run(""AutoSync_InactiveAllowWithManualSyncEnabled"", func(t *testing.T) { +- proj := newTestProjectWithSyncWindows() +- proj.Spec.SyncWindows[0].Schedule = ""0 0 1 * *"" +- proj.Spec.SyncWindows[0].Duration = ""1m"" +- proj.Spec.SyncWindows[0].ManualSync = true ++ t.Run(""will deny auto sync inactive-allow with ManualSync enabled"", func(t *testing.T) { ++ // given ++ t.Parallel() ++ proj := newProjectBuilder(). ++ withInactiveAllowWindow(true). ++ build() ++ ++ // when + canSync := proj.Spec.SyncWindows.CanSync(false) ++ ++ // then + assert.False(t, canSync) + }) +- t.Run(""ManualSync_InactiveAllowAndInactiveDeny"", func(t *testing.T) { +- proj := newTestProjectWithSyncWindows() +- proj.Spec.SyncWindows[0].Schedule = ""0 0 1 * *"" +- proj.Spec.SyncWindows[0].Duration = ""1m"" +- deny := &SyncWindow{Kind: ""deny"", Schedule: ""0 0 1 * *"", Duration: ""1m""} +- proj.Spec.SyncWindows = append(proj.Spec.SyncWindows, deny) ++ t.Run(""will deny manual sync with inactive-allow and inactive-deny"", func(t *testing.T) { ++ // given ++ t.Parallel() ++ proj := newProjectBuilder(). ++ withInactiveAllowWindow(false). ++ withInactiveDenyWindow(false). ++ build() ++ ++ // when + canSync := proj.Spec.SyncWindows.CanSync(true) ++ ++ // then + assert.False(t, canSync) + }) +- t.Run(""AutoSync_InactiveAllowAndInactiveDeny"", func(t *testing.T) { +- proj := newTestProjectWithSyncWindows() +- proj.Spec.SyncWindows[0].Schedule = ""0 0 1 * *"" +- proj.Spec.SyncWindows[0].Duration = ""1m"" +- deny := &SyncWindow{Kind: ""deny"", Schedule: ""0 0 1 * *"", Duration: ""1m""} +- proj.Spec.SyncWindows = append(proj.Spec.SyncWindows, deny) ++ t.Run(""will deny auto sync with inactive-allow and inactive-deny"", func(t *testing.T) { ++ // given ++ t.Parallel() ++ proj := newProjectBuilder(). ++ withInactiveAllowWindow(false). ++ withInactiveDenyWindow(false). ++ build() ++ ++ // when + canSync := proj.Spec.SyncWindows.CanSync(false) ++ ++ // then + assert.False(t, canSync) + }) +- t.Run(""ManualSync_ActiveDeny"", func(t *testing.T) { +- proj := newTestProjectWithSyncWindows() +- proj.Spec.SyncWindows[0].Kind = ""deny"" +- proj.Spec.SyncWindows[0].Schedule = ""* * * * *"" ++ t.Run(""will deny manual sync with active-deny"", func(t *testing.T) { ++ // given ++ t.Parallel() ++ proj := newProjectBuilder(). ++ withActiveDenyWindow(false). ++ build() ++ ++ // when + canSync := proj.Spec.SyncWindows.CanSync(true) ++ ++ // then + assert.False(t, canSync) + }) +- t.Run(""AutoSync_ActiveDeny"", func(t *testing.T) { +- proj := newTestProjectWithSyncWindows() +- proj.Spec.SyncWindows[0].Kind = ""deny"" +- proj.Spec.SyncWindows[0].Schedule = ""* * * * *"" ++ t.Run(""will deny auto sync with active-deny"", func(t *testing.T) { ++ // given ++ t.Parallel() ++ proj := newProjectBuilder(). ++ withActiveDenyWindow(false). ++ build() ++ ++ // when + canSync := proj.Spec.SyncWindows.CanSync(false) ++ ++ // then + assert.False(t, canSync) + }) +- t.Run(""ManualSync_ActiveDenyWithManualSyncEnabled"", func(t *testing.T) { +- proj := newTestProjectWithSyncWindows() +- proj.Spec.SyncWindows[0].Kind = ""deny"" +- proj.Spec.SyncWindows[0].Schedule = ""* * * * *"" +- proj.Spec.SyncWindows[0].ManualSync = true ++ t.Run(""will allow manual sync with active-deny with ManualSync enabled"", func(t *testing.T) { ++ // given ++ t.Parallel() ++ proj := newProjectBuilder(). ++ withActiveDenyWindow(true). ++ build() ++ ++ // when + canSync := proj.Spec.SyncWindows.CanSync(true) ++ ++ // then + assert.True(t, canSync) + }) +- t.Run(""AutoSync_ActiveDenyWithManualSyncEnabled"", func(t *testing.T) { +- proj := newTestProjectWithSyncWindows() +- proj.Spec.SyncWindows[0].Kind = ""deny"" +- proj.Spec.SyncWindows[0].Schedule = ""* * * * *"" +- proj.Spec.SyncWindows[0].ManualSync = true ++ t.Run(""will deny auto sync with active-deny with ManualSync enabled"", func(t *testing.T) { ++ // given ++ t.Parallel() ++ proj := newProjectBuilder(). ++ withActiveDenyWindow(true). ++ build() ++ ++ // when + canSync := proj.Spec.SyncWindows.CanSync(false) ++ ++ // then + assert.False(t, canSync) + }) +- t.Run(""ManualSync_MultipleActiveDenyWithManualSyncEnabledOnOne"", func(t *testing.T) { +- proj := newTestProjectWithSyncWindows() +- proj.Spec.SyncWindows[0].Kind = ""deny"" +- proj.Spec.SyncWindows[0].Schedule = ""* * * * *"" +- proj.Spec.SyncWindows[0].ManualSync = true +- deny2 := &SyncWindow{Kind: ""deny"", Schedule: ""* * * * *"", Duration: ""2h""} +- proj.Spec.SyncWindows = append(proj.Spec.SyncWindows, deny2) ++ t.Run(""will deny manual sync with many active-deny having one with ManualSync disabled"", func(t *testing.T) { ++ // given ++ t.Parallel() ++ proj := newProjectBuilder(). ++ withActiveDenyWindow(true). ++ withActiveDenyWindow(true). ++ withActiveDenyWindow(true). ++ withActiveDenyWindow(false). ++ build() ++ ++ // when + canSync := proj.Spec.SyncWindows.CanSync(true) ++ ++ // then + assert.False(t, canSync) + }) +- t.Run(""AutoSync_MultipleActiveDenyWithManualSyncEnabledOnOne"", func(t *testing.T) { +- proj := newTestProjectWithSyncWindows() +- proj.Spec.SyncWindows[0].Kind = ""deny"" +- proj.Spec.SyncWindows[0].Schedule = ""* * * * *"" +- proj.Spec.SyncWindows[0].ManualSync = true +- deny2 := &SyncWindow{Kind: ""deny"", Schedule: ""* * * * *"", Duration: ""2h""} +- proj.Spec.SyncWindows = append(proj.Spec.SyncWindows, deny2) ++ t.Run(""will deny auto sync with many active-deny having one with ManualSync disabled"", func(t *testing.T) { ++ // given ++ t.Parallel() ++ proj := newProjectBuilder(). ++ withActiveDenyWindow(true). ++ withActiveDenyWindow(true). ++ withActiveDenyWindow(true). ++ withActiveDenyWindow(false). ++ build() ++ ++ // when + canSync := proj.Spec.SyncWindows.CanSync(false) ++ ++ // then + assert.False(t, canSync) + }) +- t.Run(""ManualSync_ActiveDenyAndActiveAllow"", func(t *testing.T) { +- proj := newTestProjectWithSyncWindows() +- deny := &SyncWindow{Kind: ""deny"", Schedule: ""1 * * * *"", Duration: ""1h""} +- proj.Spec.SyncWindows = append(proj.Spec.SyncWindows, deny) ++ t.Run(""will deny manual sync with active-deny and active-allow windows with ManualSync disabled"", func(t *testing.T) { ++ // given ++ t.Parallel() ++ proj := newProjectBuilder(). ++ withActiveAllowWindow(false). ++ withActiveDenyWindow(false). ++ build() ++ ++ // when + canSync := proj.Spec.SyncWindows.CanSync(true) ++ ++ // then + assert.False(t, canSync) + }) +- t.Run(""AutoSync_ActiveDenyAndActiveAllow"", func(t *testing.T) { +- proj := newTestProjectWithSyncWindows() +- deny := &SyncWindow{Kind: ""deny"", Schedule: ""1 * * * *"", Duration: ""1h""} +- proj.Spec.SyncWindows = append(proj.Spec.SyncWindows, deny) ++ t.Run(""will allow manual sync with active-deny and active-allow windows with ManualSync enabled"", func(t *testing.T) { ++ // given ++ t.Parallel() ++ proj := newProjectBuilder(). ++ withActiveAllowWindow(false). ++ withActiveDenyWindow(true). ++ build() ++ ++ // when ++ canSync := proj.Spec.SyncWindows.CanSync(true) ++ ++ // then ++ assert.True(t, canSync) ++ }) ++ t.Run(""will deny auto sync with active-deny and active-allow windows with ManualSync enabled"", func(t *testing.T) { ++ // given ++ t.Parallel() ++ proj := newProjectBuilder(). ++ withActiveAllowWindow(false). ++ withActiveDenyWindow(true). ++ build() ++ ++ // when + canSync := proj.Spec.SyncWindows.CanSync(false) ++ ++ // then + assert.False(t, canSync) + }) + } +@@ -1792,20 +1966,62 @@ func TestApplicationStatus_GetConditions(t *testing.T) { + assert.EqualValues(t, []ApplicationCondition{{Type: ApplicationConditionInvalidSpecError}}, conditions) + } + +-func newTestProjectWithSyncWindows() *AppProject { +- p := &AppProject{ +- ObjectMeta: metav1.ObjectMeta{Name: ""my-proj""}, +- Spec: AppProjectSpec{SyncWindows: SyncWindows{}}} ++type projectBuilder struct { ++ proj *AppProject ++} ++ ++func newProjectBuilder() *projectBuilder { ++ return &projectBuilder{ ++ proj: newTestProject(), ++ } ++} ++ ++func (b *projectBuilder) build() *AppProject { ++ return b.proj ++} + +- window := &SyncWindow{ +- Kind: ""allow"", +- Schedule: ""* * * * *"", ++func (b *projectBuilder) withActiveAllowWindow(allowManual bool) *projectBuilder { ++ window := newSyncWindow(""allow"", ""* * * * *"", allowManual) ++ b.proj.Spec.SyncWindows = append(b.proj.Spec.SyncWindows, window) ++ return b ++} ++ ++func (b *projectBuilder) withInactiveAllowWindow(allowManual bool) *projectBuilder { ++ window := newSyncWindow(""allow"", inactiveCronSchedule(), allowManual) ++ b.proj.Spec.SyncWindows = append(b.proj.Spec.SyncWindows, window) ++ return b ++} ++ ++func (b *projectBuilder) withActiveDenyWindow(allowManual bool) *projectBuilder { ++ window := newSyncWindow(""deny"", ""* * * * *"", allowManual) ++ b.proj.Spec.SyncWindows = append(b.proj.Spec.SyncWindows, window) ++ return b ++} ++ ++func (b *projectBuilder) withInactiveDenyWindow(allowManual bool) *projectBuilder { ++ window := newSyncWindow(""deny"", inactiveCronSchedule(), allowManual) ++ b.proj.Spec.SyncWindows = append(b.proj.Spec.SyncWindows, window) ++ return b ++} ++ ++func inactiveCronSchedule() string { ++ hourPlus10, _, _ := time.Now().Add(10 * time.Hour).Clock() ++ return fmt.Sprintf(""0 %d * * *"", hourPlus10) ++} ++ ++func newSyncWindow(kind, schedule string, allowManual bool) *SyncWindow { ++ return &SyncWindow{ ++ Kind: kind, ++ Schedule: schedule, + Duration: ""1h"", + Applications: []string{""app1""}, + Namespaces: []string{""public""}, ++ ManualSync: allowManual, + } +- p.Spec.SyncWindows = append(p.Spec.SyncWindows, window) +- return p ++} ++ ++func newTestProjectWithSyncWindows() *AppProject { ++ return newProjectBuilder().withActiveAllowWindow(false).build() + } + + func newTestApp() *Application {" +kaniko,https://github.com/GoogleContainerTools/kaniko,a3fbaa9c079ed37aed64174465d888363e3f9ca1,dependabot[bot],2024-04-09 01:22:59,chore(deps): bump golang.org/x/sync from 0.6.0 to 0.7.0 (#3105),"Bumps [golang.org/x/sync](https://github.com/golang/sync) from 0.6.0 to 0.7.0. +- [Commits](https://github.com/golang/sync/compare/v0.6.0...v0.7.0) + +---","chore(deps): bump golang.org/x/sync from 0.6.0 to 0.7.0 (#3105) + +Bumps [golang.org/x/sync](https://github.com/golang/sync) from 0.6.0 to 0.7.0. +- [Commits](https://github.com/golang/sync/compare/v0.6.0...v0.7.0) + +--- +updated-dependencies: +- dependency-name: golang.org/x/sync + dependency-type: direct:production + update-type: version-update:semver-minor +... + +Signed-off-by: dependabot[bot] +Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>","diff --git a/go.mod b/go.mod +index 02ec3eb89b..facd31e7e0 100644 +--- a/go.mod ++++ b/go.mod +@@ -31,7 +31,7 @@ require ( + github.com/spf13/pflag v1.0.5 + golang.org/x/net v0.22.0 + golang.org/x/oauth2 v0.19.0 +- golang.org/x/sync v0.6.0 ++ golang.org/x/sync v0.7.0 + ) + + require ( +diff --git a/go.sum b/go.sum +index cf6afbc59e..334f4e03f0 100644 +--- a/go.sum ++++ b/go.sum +@@ -571,8 +571,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ + golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= + golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= + golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +-golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +-golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= ++golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= ++golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= + golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= + golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= + golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +diff --git a/vendor/golang.org/x/sync/semaphore/semaphore.go b/vendor/golang.org/x/sync/semaphore/semaphore.go +index 30f632c577..b618162aab 100644 +--- a/vendor/golang.org/x/sync/semaphore/semaphore.go ++++ b/vendor/golang.org/x/sync/semaphore/semaphore.go +@@ -35,11 +35,25 @@ type Weighted struct { + // Acquire acquires the semaphore with a weight of n, blocking until resources + // are available or ctx is done. On success, returns nil. On failure, returns + // ctx.Err() and leaves the semaphore unchanged. +-// +-// If ctx is already done, Acquire may still succeed without blocking. + func (s *Weighted) Acquire(ctx context.Context, n int64) error { ++ done := ctx.Done() ++ + s.mu.Lock() ++ select { ++ case <-done: ++ // ctx becoming done has ""happened before"" acquiring the semaphore, ++ // whether it became done before the call began or while we were ++ // waiting for the mutex. We prefer to fail even if we could acquire ++ // the mutex without blocking. ++ s.mu.Unlock() ++ return ctx.Err() ++ default: ++ } + if s.size-s.cur >= n && s.waiters.Len() == 0 { ++ // Since we hold s.mu and haven't synchronized since checking done, if ++ // ctx becomes done before we return here, it becoming done must have ++ // ""happened concurrently"" with this call - it cannot ""happen before"" ++ // we return in this branch. So, we're ok to always acquire here. + s.cur += n + s.mu.Unlock() + return nil +@@ -48,7 +62,7 @@ func (s *Weighted) Acquire(ctx context.Context, n int64) error { + if n > s.size { + // Don't make other Acquire calls block on one that's doomed to fail. + s.mu.Unlock() +- <-ctx.Done() ++ <-done + return ctx.Err() + } + +@@ -58,14 +72,14 @@ func (s *Weighted) Acquire(ctx context.Context, n int64) error { + s.mu.Unlock() + + select { +- case <-ctx.Done(): +- err := ctx.Err() ++ case <-done: + s.mu.Lock() + select { + case <-ready: +- // Acquired the semaphore after we were canceled. Rather than trying to +- // fix up the queue, just pretend we didn't notice the cancelation. +- err = nil ++ // Acquired the semaphore after we were canceled. ++ // Pretend we didn't and put the tokens back. ++ s.cur -= n ++ s.notifyWaiters() + default: + isFront := s.waiters.Front() == elem + s.waiters.Remove(elem) +@@ -75,9 +89,19 @@ func (s *Weighted) Acquire(ctx context.Context, n int64) error { + } + } + s.mu.Unlock() +- return err ++ return ctx.Err() + + case <-ready: ++ // Acquired the semaphore. Check that ctx isn't already done. ++ // We check the done channel instead of calling ctx.Err because we ++ // already have the channel, and ctx.Err is O(n) with the nesting ++ // depth of ctx. ++ select { ++ case <-done: ++ s.Release(n) ++ return ctx.Err() ++ default: ++ } + return nil + } + } +diff --git a/vendor/modules.txt b/vendor/modules.txt +index 3943f7175d..7dbf518efd 100644 +--- a/vendor/modules.txt ++++ b/vendor/modules.txt +@@ -1140,7 +1140,7 @@ golang.org/x/oauth2/google/internal/stsexchange + golang.org/x/oauth2/internal + golang.org/x/oauth2/jws + golang.org/x/oauth2/jwt +-# golang.org/x/sync v0.6.0 ++# golang.org/x/sync v0.7.0 + ## explicit; go 1.18 + golang.org/x/sync/errgroup + golang.org/x/sync/semaphore" +sway,https://github.com/FuelLabs/sway,594e09a859ebdaada053087f0b7aeaf0f60f6400,Kaya Gökalp,2023-07-05 16:42:33,ci: bump rust version to 1.70 (#4749),"## Description +rust v1.70 is +[released](https://blog.rust-lang.org/2023/06/01/Rust-1.70.0.html) and +probably most of us are using that version. This PR bumps CI to that +version.","ci: bump rust version to 1.70 (#4749) + +## Description +rust v1.70 is +[released](https://blog.rust-lang.org/2023/06/01/Rust-1.70.0.html) and +probably most of us are using that version. This PR bumps CI to that +version.","diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml +index 7f11ab1da31..60cb1a8e3e4 100644 +--- a/.github/workflows/ci.yml ++++ b/.github/workflows/ci.yml +@@ -15,7 +15,7 @@ concurrency: + env: + CARGO_TERM_COLOR: always + REGISTRY: ghcr.io +- RUST_VERSION: 1.69.0 ++ RUST_VERSION: 1.70.0 + NIGHTLY_RUST_VERSION: nightly-2023-02-08 + + jobs:" +youki,https://github.com/youki-dev/youki,de107959ab6f26ba9c73780206bb2f193c9f7ec8,dependabot[bot],2023-03-01 06:50:48,chore(deps): bump jobserver from 0.1.25 to 0.1.26,"Bumps [jobserver](https://github.com/alexcrichton/jobserver-rs) from 0.1.25 to 0.1.26. +- [Release notes](https://github.com/alexcrichton/jobserver-rs/releases) +- [Commits](https://github.com/alexcrichton/jobserver-rs/compare/0.1.25...0.1.26) + +---","chore(deps): bump jobserver from 0.1.25 to 0.1.26 + +Bumps [jobserver](https://github.com/alexcrichton/jobserver-rs) from 0.1.25 to 0.1.26. +- [Release notes](https://github.com/alexcrichton/jobserver-rs/releases) +- [Commits](https://github.com/alexcrichton/jobserver-rs/compare/0.1.25...0.1.26) + +--- +updated-dependencies: +- dependency-name: jobserver + dependency-type: indirect + update-type: version-update:semver-patch +... + +Signed-off-by: dependabot[bot] ","diff --git a/Cargo.lock b/Cargo.lock +index 6bc2437f8..0ab0e1f4a 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -1528,9 +1528,9 @@ dependencies = [ + + [[package]] + name = ""jobserver"" +-version = ""0.1.25"" ++version = ""0.1.26"" + source = ""registry+https://github.com/rust-lang/crates.io-index"" +-checksum = ""068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b"" ++checksum = ""936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2"" + dependencies = [ + ""libc"", + ]" +sentry,https://github.com/getsentry/sentry,d9b87d7a0da1957dfc4e970474190e1d32fefbc6,Nar Saynorath,2023-05-16 20:32:55,chore(perf-issues): Add is_early_adopter as detection tag (#49023),"Add an is_early_adopter tag in the detection tags because it would be +useful to estimate the EA and GA impact. If we have X new issues with Y +detections in EA, then we could get a very rough estimate of potential +GA impact by looking at the proportion of EA:GA detection","chore(perf-issues): Add is_early_adopter as detection tag (#49023) + +Add an is_early_adopter tag in the detection tags because it would be +useful to estimate the EA and GA impact. If we have X new issues with Y +detections in EA, then we could get a very rough estimate of potential +GA impact by looking at the proportion of EA:GA detection","diff --git a/src/sentry/utils/performance_issues/performance_detection.py b/src/sentry/utils/performance_issues/performance_detection.py +index 6fe785d4726207..f9059a12ee9cc8 100644 +--- a/src/sentry/utils/performance_issues/performance_detection.py ++++ b/src/sentry/utils/performance_issues/performance_detection.py +@@ -288,7 +288,7 @@ def _detect_performance_problems( + run_detector_on_data(detector, data) + + # Metrics reporting only for detection, not created issues. +- report_metrics_for_detectors(data, event_id, detectors, sdk_span) ++ report_metrics_for_detectors(data, event_id, detectors, sdk_span, project.organization) + + organization = cast(Organization, project.organization) + if project is None or organization is None: +@@ -339,7 +339,11 @@ def run_detector_on_data(detector, data): + + # Reports metrics and creates spans for detection + def report_metrics_for_detectors( +- event: Event, event_id: Optional[str], detectors: Sequence[PerformanceDetector], sdk_span: Any ++ event: Event, ++ event_id: Optional[str], ++ detectors: Sequence[PerformanceDetector], ++ sdk_span: Any, ++ organization: Organization, + ): + all_detected_problems = [i for d in detectors for i in d.stored_problems] + has_detected_problems = bool(all_detected_problems) +@@ -385,7 +389,10 @@ def report_metrics_for_detectors( + # Reduce cardinality in case there are custom browser name tags. + allowed_browser_name = browser_name + +- detected_tags = {""sdk_name"": sdk_name} ++ detected_tags = { ++ ""sdk_name"": sdk_name, ++ ""is_early_adopter"": organization.flags.early_adopter.is_set, ++ } + event_integrations = event.get(""sdk"", {}).get(""integrations"", []) or [] + + for integration_name in INTEGRATIONS_OF_INTEREST: +diff --git a/tests/sentry/utils/performance_issues/test_performance_detection.py b/tests/sentry/utils/performance_issues/test_performance_detection.py +index de88441213fac4..00ac862d23ea9a 100644 +--- a/tests/sentry/utils/performance_issues/test_performance_detection.py ++++ b/tests/sentry/utils/performance_issues/test_performance_detection.py +@@ -405,6 +405,7 @@ def test_reports_metrics_on_uncompressed_assets(self, incr_mock): + ""m_n_plus_one_db"": False, + ""uncompressed_assets"": True, + ""browser_name"": ""Chrome"", ++ ""is_early_adopter"": False, + }, + ) + in incr_mock.mock_calls" +shuttle,https://github.com/shuttle-hq/shuttle,37460c35050adabe754859e19fd8be5cf4f4462b,Oddbjørn Grødem,2022-10-11 17:15:28,feat(cargo-shuttle): better error messages (#391),"* feat(cargo-shuttle): better error messages + +return an error message that is more relevant to the user than ""failed to parse response to json"" on non-200 responses + +* fix(gateway): missing arg in end_to_end test","feat(cargo-shuttle): better error messages (#391) + +* feat(cargo-shuttle): better error messages + +return an error message that is more relevant to the user than ""failed to parse response to json"" on non-200 responses + +* fix(gateway): missing arg in end_to_end test","diff --git a/cargo-shuttle/src/client.rs b/cargo-shuttle/src/client.rs +index 1ed06eb9e..98bde1821 100644 +--- a/cargo-shuttle/src/client.rs ++++ b/cargo-shuttle/src/client.rs +@@ -11,7 +11,7 @@ use reqwest_retry::policies::ExponentialBackoff; + use reqwest_retry::RetryTransientMiddleware; + use serde::de::DeserializeOwned; + use serde::Deserialize; +-use shuttle_common::models::{deployment, project, secret, service, user}; ++use shuttle_common::models::{deployment, error, project, secret, service, user}; + use shuttle_common::project::ProjectName; + use shuttle_common::{ApiKey, ApiUrl, LogItem}; + use tokio::net::TcpStream; +@@ -39,7 +39,17 @@ impl ToJson for Response { + response = std::str::from_utf8(&full).unwrap_or_default(), + ""parsing response to json"" + ); +- serde_json::from_slice(&full).context(""failed to parse response to JSON"") ++ // try to deserialize into calling function response model ++ match serde_json::from_slice(&full) { ++ Ok(res) => Ok(res), ++ Err(_) => { ++ // if that doesn't work, try to deserialize into common error type ++ let res: error::ApiError = ++ serde_json::from_slice(&full).context(""failed to parse response to JSON"")?; ++ ++ Err(res.into()) ++ } ++ } + } + } + +@@ -63,7 +73,6 @@ impl Client { + .context(""failed to get API key from Shuttle server"")? + .to_json() + .await +- .context(""could not parse server json response for create project request"") + } + + pub async fn deploy( +@@ -147,7 +156,6 @@ impl Client { + .context(""failed to make create project request"")? + .to_json() + .await +- .context(""could not parse server json response for create project request"") + } + + pub async fn get_project(&self, project: &ProjectName) -> Result { +@@ -156,7 +164,7 @@ impl Client { + self.get(path).await + } + +- pub async fn delete_project(&self, project: &ProjectName) -> Result<()> { ++ pub async fn delete_project(&self, project: &ProjectName) -> Result { + let path = format!(""/projects/{}"", project.as_str()); + + self.delete(path).await +@@ -248,7 +256,6 @@ impl Client { + .context(""failed to make get request"")? + .to_json() + .await +- .context(""could not parse server json response for get request"") + } + + async fn post>( +@@ -285,7 +292,6 @@ impl Client { + .context(""failed to make delete request"")? + .to_json() + .await +- .context(""could not parse server json response for delete request"") + } + + fn set_builder_auth(&self, builder: RequestBuilder) -> RequestBuilder { +diff --git a/cargo-shuttle/src/lib.rs b/cargo-shuttle/src/lib.rs +index 4fbdc884e..7fed09414 100644 +--- a/cargo-shuttle/src/lib.rs ++++ b/cargo-shuttle/src/lib.rs +@@ -396,9 +396,9 @@ impl Shuttle { + } + + async fn project_delete(&self, client: &Client) -> Result<()> { +- client.delete_project(self.ctx.project_name()).await?; ++ let project = client.delete_project(self.ctx.project_name()).await?; + +- println!(""Project has been deleted""); ++ println!(""{project}""); + + Ok(()) + } +diff --git a/common/src/models/error.rs b/common/src/models/error.rs +new file mode 100644 +index 000000000..facd3b46d +--- /dev/null ++++ b/common/src/models/error.rs +@@ -0,0 +1,16 @@ ++use std::fmt::{Display, Formatter}; ++ ++use serde::{Deserialize, Serialize}; ++ ++#[derive(Serialize, Deserialize, Debug)] ++pub struct ApiError { ++ pub message: String, ++} ++ ++impl Display for ApiError { ++ fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { ++ write!(f, ""{}"", self.message) ++ } ++} ++ ++impl std::error::Error for ApiError {} +diff --git a/common/src/models/mod.rs b/common/src/models/mod.rs +index 2d5626bdd..cd7acedf6 100644 +--- a/common/src/models/mod.rs ++++ b/common/src/models/mod.rs +@@ -1,4 +1,5 @@ + pub mod deployment; ++pub mod error; + pub mod project; + pub mod resource; + pub mod secret; +diff --git a/deployer/src/handlers/error.rs b/deployer/src/handlers/error.rs +index 2aee33990..3893ab949 100644 +--- a/deployer/src/handlers/error.rs ++++ b/deployer/src/handlers/error.rs +@@ -5,7 +5,7 @@ use axum::response::{IntoResponse, Response}; + use axum::Json; + + use serde::{ser::SerializeMap, Serialize}; +-use serde_json::json; ++use shuttle_common::models::error::ApiError; + + #[derive(thiserror::Error, Debug)] + pub enum Error { +@@ -47,7 +47,9 @@ impl IntoResponse for Error { + header::CONTENT_TYPE, + HeaderValue::from_static(""application/json""), + )], +- Json(json!({ ""message"": self })), ++ Json(ApiError { ++ message: self.to_string(), ++ }), + ) + .into_response() + } +diff --git a/gateway/src/api/latest.rs b/gateway/src/api/latest.rs +index 5cb134a02..46072ddb3 100644 +--- a/gateway/src/api/latest.rs ++++ b/gateway/src/api/latest.rs +@@ -103,10 +103,16 @@ async fn delete_project( + user: User { name, .. }, + }: ScopedUser, + Path(project): Path, +-) -> Result<(), Error> { ++) -> Result, Error> { + let work = service.destroy_project(project, name).await?; + +- sender.send(work).await.map_err(Error::from) ++ let name = work.project_name.to_string(); ++ let state = work.work.clone().into(); ++ ++ sender.send(work).await?; ++ ++ let response = project::Response { name, state }; ++ Ok(AxumJson(response)) + } + + async fn route_project( +diff --git a/gateway/src/lib.rs b/gateway/src/lib.rs +index e050509fc..702ca2683 100644 +--- a/gateway/src/lib.rs ++++ b/gateway/src/lib.rs +@@ -17,7 +17,7 @@ use futures::prelude::*; + use once_cell::sync::Lazy; + use regex::Regex; + use serde::{Deserialize, Deserializer, Serialize}; +-use serde_json::json; ++use shuttle_common::models::error::ApiError; + use tokio::sync::mpsc::error::SendError; + use tracing::error; + +@@ -141,7 +141,13 @@ impl IntoResponse for Error { + ErrorKind::Forbidden => (StatusCode::FORBIDDEN, ""forbidden""), + ErrorKind::NotReady => (StatusCode::INTERNAL_SERVER_ERROR, ""service not ready""), + }; +- (status, Json(json!({ ""error"": error_message }))).into_response() ++ ( ++ status, ++ Json(ApiError { ++ message: error_message.to_string(), ++ }), ++ ) ++ .into_response() + } + } + +@@ -576,8 +582,11 @@ pub mod tests { + + let provisioner_host = ""provisioner"".to_string(); + ++ let docker_host = ""/var/run/docker.sock"".to_string(); ++ + let args = StartArgs { + control, ++ docker_host, + user, + image, + prefix," +nx,https://github.com/nrwl/nx,ec9ed17c9e9a9c884be5ab852243814e5968b1a4,Sven Röttering,2019-08-06 20:58:38,fix(jest): change reporters option to array type,Jest expects the reporters option to be an array of strings.,"fix(jest): change reporters option to array type + +Jest expects the reporters option to be an array of strings.","diff --git a/docs/api-jest/builders/jest.md b/docs/api-jest/builders/jest.md +index adae88fd7b0a5e..29d919a547aa5a 100644 +--- a/docs/api-jest/builders/jest.md ++++ b/docs/api-jest/builders/jest.md +@@ -44,6 +44,12 @@ Type: `boolean` + + Forces test results output highlighting even if stdout is not a TTY. (https://jestjs.io/docs/en/cli#colors) + ++### config ++ ++Type: `string` ++ ++The path to a Jest config file specifying how to find and execute tests. If no rootDir is set in the config, the directory containing the config file is assumed to be the rootDir for the project. This can also be a JSON-encoded value which Jest will use as configuration ++ + ### coverage + + Type: `boolean` +@@ -110,7 +116,7 @@ Will not fail if no tests are found (for example while using `--testPathPattern` + + ### reporters + +-Type: `string` ++Type: `array` + + Run tests with specified reporters. Reporter options are not available via CLI. Example with multiple reporters: jest --reporters=""default"" --reporters=""jest-junit"" (https://jestjs.io/docs/en/cli#reporters) + +diff --git a/packages/jest/src/builders/jest/jest.impl.spec.ts b/packages/jest/src/builders/jest/jest.impl.spec.ts +index 94160e9e82f0c6..d798c910698a66 100644 +--- a/packages/jest/src/builders/jest/jest.impl.spec.ts ++++ b/packages/jest/src/builders/jest/jest.impl.spec.ts +@@ -57,7 +57,8 @@ describe('Jest Builder', () => { + ] + } + }), +- watch: false ++ watch: false, ++ reporters: ['default'] + }, + ['/root/jest.config.js'] + ); +@@ -73,7 +74,7 @@ describe('Jest Builder', () => { + testNamePattern: 'should load', + testPathPattern: '/test/path', + colors: false, +- reporters: '/test/path', ++ reporters: ['/test/path'], + verbose: false, + coverage: false, + coverageReporters: 'test', +@@ -106,7 +107,7 @@ describe('Jest Builder', () => { + testNamePattern: 'should load', + testPathPattern: '/test/path', + colors: false, +- reporters: '/test/path', ++ reporters: ['/test/path'], + verbose: false, + coverageReporters: 'test', + coverageDirectory: '/test/path', +@@ -149,6 +150,7 @@ describe('Jest Builder', () => { + }), + coverage: false, + findRelatedTests: true, ++ reporters: ['default'], + runInBand: true, + testNamePattern: 'should load', + watch: false +@@ -174,7 +176,7 @@ describe('Jest Builder', () => { + testNamePattern: 'test', + testPathPattern: '/test/path', + colors: false, +- reporters: '/test/path', ++ reporters: ['/test/path'], + verbose: false, + coverage: false, + coverageReporters: 'test', +@@ -218,7 +220,7 @@ describe('Jest Builder', () => { + testPathPattern: '/test/path', + colors: false, + verbose: false, +- reporters: '/test/path', ++ reporters: ['/test/path'], + coverageReporters: 'test', + coverageDirectory: '/test/path', + updateSnapshot: true, +@@ -257,6 +259,7 @@ describe('Jest Builder', () => { + ] + } + }), ++ reporters: ['default'], + setupTestFrameworkScriptFile: '/root/test.ts', + watch: false + }, +diff --git a/packages/jest/src/builders/jest/jest.impl.ts b/packages/jest/src/builders/jest/jest.impl.ts +index c78d701547838c..bf8aca796bd28d 100644 +--- a/packages/jest/src/builders/jest/jest.impl.ts ++++ b/packages/jest/src/builders/jest/jest.impl.ts +@@ -18,6 +18,7 @@ const { runCLI } = require('jest'); + + export interface JestBuilderOptions extends JsonObject { + codeCoverage?: boolean; ++ config?: string; + jestConfig: string; + testFile?: string; + setupFile?: string; +@@ -37,7 +38,7 @@ export interface JestBuilderOptions extends JsonObject { + testNamePattern?: string; + testPathPattern?: string; + colors?: boolean; +- reporters?: string; ++ reporters?: string[]; + verbose?: false; + coverage?: false; + coverageReporters?: string; +@@ -77,6 +78,7 @@ function run( + + const config: any = { + _: [], ++ config: options.config, + coverage: options.codeCoverage, + bail: options.bail, + ci: options.ci, +@@ -125,6 +127,10 @@ function run( + config.clearCache = true; + } + ++ if (!options.reporters || !options.reporters.length) { ++ config.reporters = ['default']; ++ } ++ + return from(runCLI(config, [options.jestConfig])).pipe( + map((results: any) => { + return { +diff --git a/packages/jest/src/builders/jest/schema.json b/packages/jest/src/builders/jest/schema.json +index b28a7de047e596..5e19153714a95f 100644 +--- a/packages/jest/src/builders/jest/schema.json ++++ b/packages/jest/src/builders/jest/schema.json +@@ -7,6 +7,10 @@ + ""description"": ""Indicates that test coverage information should be collected and reported in the output. (https://jestjs.io/docs/en/cli#coverage)"", + ""type"": ""boolean"" + }, ++ ""config"": { ++ ""description"": ""The path to a Jest config file specifying how to find and execute tests. If no rootDir is set in the config, the directory containing the config file is assumed to be the rootDir for the project. This can also be a JSON-encoded value which Jest will use as configuration"", ++ ""type"": ""string"" ++ }, + ""clearCache"": { + ""description"": ""Deletes the Jest cache directory and then exits without running tests. Will delete Jest's default cache directory. _Note: clearing the cache will reduce performance_."", + ""type"": ""boolean"" +@@ -91,7 +95,10 @@ + }, + ""reporters"": { + ""description"": ""Run tests with specified reporters. Reporter options are not available via CLI. Example with multiple reporters: jest --reporters=\""default\"" --reporters=\""jest-junit\"" (https://jestjs.io/docs/en/cli#reporters)"", +- ""type"": ""string"" ++ ""type"": ""array"", ++ ""items"": { ++ ""type"": ""string"" ++ } + }, + ""verbose"": { + ""description"": ""Display individual test results with the test suite hierarchy. (https://jestjs.io/docs/en/cli#verbose)""" +paperless-ngx,https://github.com/paperless-ngx/paperless-ngx,2aced1c305786be6781238ec6bd19ca64c1cf129,dependabot[bot],2024-02-02 01:59:38,Chore(deps): Bump the actions group with 1 update (#5629),"Bumps the actions group with 1 update: [codecov/codecov-action](https://github.com/codecov/codecov-action). + + +Updates `codecov/codecov-action` from 3 to 4 +- [Release notes](https://github.com/codecov/codecov-action/releases) +- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) +- [Commits](https://github.com/codecov/codecov-action/compare/v3...v4) + +---","Chore(deps): Bump the actions group with 1 update (#5629) + +Bumps the actions group with 1 update: [codecov/codecov-action](https://github.com/codecov/codecov-action). + + +Updates `codecov/codecov-action` from 3 to 4 +- [Release notes](https://github.com/codecov/codecov-action/releases) +- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) +- [Commits](https://github.com/codecov/codecov-action/compare/v3...v4) + +--- +updated-dependencies: +- dependency-name: codecov/codecov-action + dependency-type: direct:production + update-type: version-update:semver-major + dependency-group: actions +... + +Signed-off-by: dependabot[bot] +Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>","diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml +index ec84076114c..6e19d03a497 100644 +--- a/.github/workflows/ci.yml ++++ b/.github/workflows/ci.yml +@@ -283,7 +283,7 @@ jobs: + merge-multiple: true + - + name: Upload frontend coverage to Codecov +- uses: codecov/codecov-action@v3 ++ uses: codecov/codecov-action@v4 + with: + # not required for public repos, but intermittently fails otherwise + token: ${{ secrets.CODECOV_TOKEN }} +@@ -299,7 +299,7 @@ jobs: + path: src/ + - + name: Upload coverage to Codecov +- uses: codecov/codecov-action@v3 ++ uses: codecov/codecov-action@v4 + with: + # not required for public repos, but intermittently fails otherwise + token: ${{ secrets.CODECOV_TOKEN }}" +generator-jhipster,https://github.com/jhipster/generator-jhipster,47b5f49d5835656f4b4a2faba98534848a37863e,dependabot[bot],2021-10-21 11:37:48,chore(deps-dev): bump @types/react-dom,"Bumps [@types/react-dom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-dom) from 17.0.9 to 17.0.10. +- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) +- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-dom) + +---","chore(deps-dev): bump @types/react-dom + +Bumps [@types/react-dom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-dom) from 17.0.9 to 17.0.10. +- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) +- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-dom) + +--- +updated-dependencies: +- dependency-name: ""@types/react-dom"" + dependency-type: direct:development + update-type: version-update:semver-patch +... + +Signed-off-by: dependabot[bot] ","diff --git a/generators/client/templates/react/package.json b/generators/client/templates/react/package.json +index 81d5d606e75a..11665dfeca2a 100644 +--- a/generators/client/templates/react/package.json ++++ b/generators/client/templates/react/package.json +@@ -32,7 +32,7 @@ + ""@types/lodash"": ""4.14.175"", + ""@types/node"": ""16.11.1"", + ""@types/react"": ""17.0.31"", +- ""@types/react-dom"": ""17.0.9"", ++ ""@types/react-dom"": ""17.0.10"", + ""@types/react-redux"": ""7.1.19"", + ""@types/react-router-dom"": ""5.3.1"", + ""@types/redux"": ""3.6.31""," +sentry,https://github.com/getsentry/sentry,d7db88d70f50ba8e1e21aae3ba15d1eb8233aba1,"Aniket Das ""Tekky",2021-08-19 05:23:01,fix(integrations): Allow azure devops service accounts to install (#28009),"Azure Devops allows service accounts to install an integration. We didn't allow it on our end due to using the `ownerId` query parameter instead of `memberId` in Azure Devop's API. Now any service account can install Azure Devops from sentry as long as they are an owner. +Non service account users will encounter a permission error from Azure Devops that propogates back to us. This is not an unexpected error, and as such does not result in an issue. Because we handle this differently from an integration error, a new error template is introduced specifically for provider errors. +Finally, There's a bugfix for an issue where having Azure Devops installed on orgs would allow other orgs to access it. The OrganizationIntegration check now also checks for a matching Organization. + +Fixes API-1981","fix(integrations): Allow azure devops service accounts to install (#28009) + +Azure Devops allows service accounts to install an integration. We didn't allow it on our end due to using the `ownerId` query parameter instead of `memberId` in Azure Devop's API. Now any service account can install Azure Devops from sentry as long as they are an owner. +Non service account users will encounter a permission error from Azure Devops that propogates back to us. This is not an unexpected error, and as such does not result in an issue. Because we handle this differently from an integration error, a new error template is introduced specifically for provider errors. +Finally, There's a bugfix for an issue where having Azure Devops installed on orgs would allow other orgs to access it. The OrganizationIntegration check now also checks for a matching Organization. + +Fixes API-1981","diff --git a/src/sentry/integrations/pipeline.py b/src/sentry/integrations/pipeline.py +index d19a32e561b37c..14f314693f8808 100644 +--- a/src/sentry/integrations/pipeline.py ++++ b/src/sentry/integrations/pipeline.py +@@ -10,7 +10,7 @@ + from sentry.constants import ObjectStatus + from sentry.models import Identity, IdentityProvider, IdentityStatus, Integration + from sentry.pipeline import Pipeline, PipelineAnalyticsEntry +-from sentry.shared_integrations.exceptions import IntegrationError ++from sentry.shared_integrations.exceptions import IntegrationError, IntegrationProviderError + from sentry.web.helpers import render_to_response + + from . import default_manager +@@ -52,6 +52,16 @@ def finish_pipeline(self): + }, + ) + return self.error(str(e)) ++ except IntegrationProviderError as e: ++ self.get_logger().info( ++ ""build-integration.provider-error"", ++ extra={ ++ ""error_message"": str(e), ++ ""error_status"": getattr(e, ""code"", None), ++ ""provider_key"": self.provider.key, ++ }, ++ ) ++ return self.render_warning(str(e)) + + response = self._finish_pipeline(data) + +diff --git a/src/sentry/integrations/vsts/integration.py b/src/sentry/integrations/vsts/integration.py +index cbab560ff36d9b..a583f196480004 100644 +--- a/src/sentry/integrations/vsts/integration.py ++++ b/src/sentry/integrations/vsts/integration.py +@@ -27,7 +27,11 @@ + Repository, + ) + from sentry.pipeline import NestedPipelineView, PipelineView +-from sentry.shared_integrations.exceptions import ApiError, IntegrationError ++from sentry.shared_integrations.exceptions import ( ++ ApiError, ++ IntegrationError, ++ IntegrationProviderError, ++) + from sentry.tasks.integrations import migrate_repo + from sentry.utils.http import absolute_uri + from sentry.web.helpers import render_to_response +@@ -394,7 +398,9 @@ def build_integration(self, state): + integration[""metadata""][""subscription""] = integration_model.metadata[""subscription""] + + assert OrganizationIntegration.objects.filter( +- integration_id=integration_model.id, status=ObjectStatus.VISIBLE ++ organization_id=self.pipeline.organization.id, ++ integration_id=integration_model.id, ++ status=ObjectStatus.VISIBLE, + ).exists() + + except (IntegrationModel.DoesNotExist, AssertionError, KeyError): +@@ -416,8 +422,8 @@ def create_subscription(self, instance, oauth_data): + auth_codes = (400, 401, 403) + permission_error = ""permission"" in str(e) or ""not authorized"" in str(e) + if e.code in auth_codes or permission_error: +- raise IntegrationError( +- ""You do not have sufficient account access to create webhooks "" ++ raise IntegrationProviderError( ++ ""You do not have sufficient account access to create webhooks\n"" + ""on the selected Azure DevOps organization.\n"" + ""Please check with the owner of this Azure DevOps account."" + ) +@@ -508,7 +514,9 @@ def get_account_from_id(self, account_id, accounts): + return None + + def get_accounts(self, access_token, user_id): +- url = f""https://app.vssps.visualstudio.com/_apis/accounts?ownerId={user_id}&api-version=4.1"" ++ url = ( ++ f""https://app.vssps.visualstudio.com/_apis/accounts?memberId={user_id}&api-version=4.1"" ++ ) + with http.build_session() as session: + response = session.get( + url, +diff --git a/src/sentry/pipeline/__init__.py b/src/sentry/pipeline/__init__.py +index 280acab1fedbdf..1ea373c2b7cead 100644 +--- a/src/sentry/pipeline/__init__.py ++++ b/src/sentry/pipeline/__init__.py +@@ -297,6 +297,11 @@ def error(self, message): + logger.error(""pipeline error"", extra=extra) + return render_to_response(""sentry/pipeline-error.html"", context, self.request) + ++ def render_warning(self, message): ++ """"""For situations when we want to display an error without triggering an issue"""""" ++ context = {""error"": message} ++ return render_to_response(""sentry/pipeline-provider-error.html"", context, self.request) ++ + def next_step(self, step_size=1): + """""" + Render the next step. +diff --git a/src/sentry/shared_integrations/exceptions.py b/src/sentry/shared_integrations/exceptions.py +index c282e42f2e802e..e410bcfbdd1d79 100644 +--- a/src/sentry/shared_integrations/exceptions.py ++++ b/src/sentry/shared_integrations/exceptions.py +@@ -83,6 +83,12 @@ class IntegrationError(Exception): + pass + + ++class IntegrationProviderError(Exception): ++ """"""Nonfatal errors generated by an external provider"""""" ++ ++ pass ++ ++ + class DuplicateDisplayNameError(IntegrationError): + pass + +diff --git a/src/sentry/templates/sentry/pipeline-provider-error.html b/src/sentry/templates/sentry/pipeline-provider-error.html +new file mode 100644 +index 00000000000000..eeeeb56bf1a675 +--- /dev/null ++++ b/src/sentry/templates/sentry/pipeline-provider-error.html +@@ -0,0 +1,35 @@ ++{% extends ""sentry/bases/modal.html"" %} ++ ++{% load i18n %} ++{% load sentry_assets %} ++ ++{% block wrapperclass %}narrow{% endblock %} ++{% block title %}{% trans ""Setup Error"" %} | {{ block.super }}{% endblock %} ++ ++{% block main %} ++
++
++ ++
++ ++

The installation could not complete due to a provider error.

++ ++
{{ error }}
++
++{% endblock %} ++ ++{% block scripts_bottom %} ++ {{ block.super }} ++ {% script %} ++ ++ {% endscript %} ++{% endblock %} +diff --git a/tests/sentry/integrations/vsts/test_integration.py b/tests/sentry/integrations/vsts/test_integration.py +index a52d89ba4304af..2e0de96694fd34 100644 +--- a/tests/sentry/integrations/vsts/test_integration.py ++++ b/tests/sentry/integrations/vsts/test_integration.py +@@ -12,7 +12,7 @@ + Repository, + ) + from sentry.plugins.base import plugins +-from sentry.shared_integrations.exceptions import IntegrationError ++from sentry.shared_integrations.exceptions import IntegrationError, IntegrationProviderError + from sentry.testutils.helpers import with_feature + from sentry.utils.compat.mock import Mock, patch + from tests.sentry.plugins.testutils import ( +@@ -150,7 +150,7 @@ def test_doesnt_disable_plugin_when_partially_migrated(self): + def test_accounts_list_failure(self): + responses.replace( + responses.GET, +- ""https://app.vssps.visualstudio.com/_apis/accounts?ownerId=%s&api-version=4.1"" ++ ""https://app.vssps.visualstudio.com/_apis/accounts?memberId=%s&api-version=4.1"" + % self.vsts_user_id, + status=403, + json={""$id"": 1, ""message"": ""Your account is not good""}, +@@ -185,7 +185,11 @@ def test_webhook_subscription_created_once(self, mock_get_scopes): + + # The above already created the Webhook, so subsequent calls to + # ``build_integration`` should omit that data. +- data = VstsIntegrationProvider().build_integration(state) ++ provider = VstsIntegrationProvider() ++ pipeline = Mock() ++ pipeline.organization = self.organization ++ provider.set_pipeline(pipeline) ++ data = provider.build_integration(state) + assert ""subscription"" in data[""metadata""] + assert ( + Integration.objects.get(provider=""vsts"").metadata[""subscription""] +@@ -271,7 +275,7 @@ def test_create_subscription_forbidden(self, mock_get_scopes): + + integration = VstsIntegrationProvider() + +- with pytest.raises(IntegrationError) as err: ++ with pytest.raises(IntegrationProviderError) as err: + integration.build_integration(state) + assert ""sufficient account access to create webhooks"" in str(err) + +@@ -304,7 +308,7 @@ def test_create_subscription_unauthorized(self, mock_get_scopes): + + integration = VstsIntegrationProvider() + +- with pytest.raises(IntegrationError) as err: ++ with pytest.raises(IntegrationProviderError) as err: + integration.build_integration(state) + assert ""sufficient account access to create webhooks"" in str(err) + +diff --git a/tests/sentry/integrations/vsts/testutils.py b/tests/sentry/integrations/vsts/testutils.py +index 096560a20ebf70..cc8788e6115a0a 100644 +--- a/tests/sentry/integrations/vsts/testutils.py ++++ b/tests/sentry/integrations/vsts/testutils.py +@@ -53,7 +53,7 @@ def _stub_vsts(self): + + responses.add( + responses.GET, +- ""https://app.vssps.visualstudio.com/_apis/accounts?ownerId=%s&api-version=4.1"" ++ ""https://app.vssps.visualstudio.com/_apis/accounts?memberId=%s&api-version=4.1"" + % self.vsts_user_id, + json={ + ""count"": 1, +@@ -179,9 +179,10 @@ def assert_installation(self): + + # User choosing which VSTS Account to use (AccountConfigView) + # Final step. +- return self.client.post( ++ resp = self.client.post( + self.setup_path, {""account"": self.vsts_account_id, ""provider"": ""vsts""} + ) ++ return resp + + + COMPARE_COMMITS_EXAMPLE = b""""""" +ext-saladict,https://github.com/crimx/ext-saladict,4b04382e0ec7ebfc730d3ff85602a69eab6f59e4,CRIMX,2018-01-31 23:07:18,refactor(config): improve app config,now only need to change one place when adding dicts,"refactor(config): improve app config + +now only need to change one place when adding dicts","diff --git a/src/app-config.ts b/src/app-config.ts +index fab98e12f..6ecf8fee5 100644 +--- a/src/app-config.ts ++++ b/src/app-config.ts +@@ -1,19 +1,22 @@ +-export type DictID = +- 'bing' | +- 'business' | +- 'cobuild' | +- 'dictcn' | +- 'etymonline' | +- 'eudic' | +- 'google' | +- 'guoyu' | +- 'howjsay' | +- 'liangan' | +- 'macmillan' | +- 'urban' | +- 'vocabulary' | +- 'wordreference' | +- 'zdic' ++const allDicts = { ++ bing: true, ++ business: true, ++ cobuild: true, ++ dictcn: true, ++ etymonline: true, ++ eudic: true, ++ google: true, ++ guoyu: true, ++ howjsay: true, ++ liangan: true, ++ macmillan: true, ++ urban: true, ++ vocabulary: true, ++ wordreference: true, ++ zdic: true, ++} ++ ++export type DictID = keyof typeof allDicts + + export type ContextMenuDictID = + 'baidu_search' | +@@ -63,6 +66,7 @@ export interface DictConfig { + } + + export interface AppConfig { ++ version: number, + /** activate app, won't affect triple-ctrl setting */ + active: boolean + +@@ -140,7 +144,9 @@ export interface AppConfig { + /** default selected dictionaries */ + selected: DictID[] + // settings of each dict will be auto-generated +- // all: {} ++ readonly all: { ++ readonly [id in DictID]: true ++ } + } + contextMenus: { + selected: ContextMenuDictID[] +@@ -154,6 +160,7 @@ export default appConfigFactory + + export function appConfigFactory (): AppConfig { + return { ++ version: 6, + active: true, + pdfSniff: true, + searhHistory: true, +@@ -205,6 +212,7 @@ export function appConfigFactory (): AppConfig { + dicts: { + selected: ['bing', 'urban', 'vocabulary', 'dictcn'], + // settings of each dict will be auto-generated ++ all: Object.assign({}, allDicts) as AppConfig['dicts']['all'] + }, + contextMenus: { + selected: ['oxford', 'google_translate', 'merriam_webster', 'cambridge', 'google_search', 'google_page_translate', 'youdao_page_translate']," +appium,https://github.com/appium/appium,dfe02ca98c73c0cf9863a7c7441d6a1a5d37ac33,Christopher Hiller,2023-03-07 04:51:58,feat(eslint-config-appium-ts): create new pkg @appium/eslint-config-appium-ts,"This adds a new package which consumers having TS sources can use. This does not affect current users of `@appium/eslint-config-appium`. + +Due to the nature of TS, it can be a little more bold with fixes (e.g., changing let to const). I changed the following rules from the recommended settings:","feat(eslint-config-appium-ts): create new pkg @appium/eslint-config-appium-ts + +This adds a new package which consumers having TS sources can use. This does not affect current users of `@appium/eslint-config-appium`. + +Due to the nature of TS, it can be a little more bold with fixes (e.g., changing let to const). I changed the following rules from the recommended settings: + +no-empty-function: Reduced to a warning. It's likely we want the functions, but perhaps they should not be empty. +no-empty-interface: Disabled; we use these to merge mixin interfaces with driver classes. +no-explicit-any: Disabled; while transitioning from an untyped codebase to a typed one, we still need to use any in places. Eventually these should all be replaced. +no-non-null-assertion: Disabled; This allows us to continue use of the ! operator, which is handy when working with untyped or loosely-typed code (especially in tests). +no-var-requires: Reduced to a warning. Occasionally we may need to use require() instead of import. +Since the configuration extends our shared config, the following rules have been disabled: + +import/no-unresolved: The eslint-plugin-import module cannot resolve TS modules. +no-unused-vars: This rule conflicts with typescript-eslint's rule, so it must be disabled per the documentation. +promise/no-native: In our TS-based packages, I haven't needed Bluebird, so it doesn't make sense to require it. +require-await: TS is much more aware of the return values of functions; this is not needed to avoid ambiguity (in TS code).","diff --git a/.eslintignore b/.eslintignore +index 9eef43e2e98..65b8bcadcb5 100644 +--- a/.eslintignore ++++ b/.eslintignore +@@ -4,8 +4,5 @@ examples/javascript-wd + **/build/** + **/*.min.js + sample-code +-**/*.d.ts + **/build-fixtures/** +-**/*.ts + packages/appium/docs/**/assets/** +-**/*.tsx +diff --git a/.eslintrc b/.eslintrc +index 0148a2eaf47..8c93d0419a3 100644 +--- a/.eslintrc ++++ b/.eslintrc +@@ -1,5 +1,5 @@ + { +- ""extends"": ""@appium/eslint-config-appium"", ++ ""extends"": [""@appium/eslint-config-appium"", ""@appium/eslint-config-appium-ts""], + ""overrides"": [ + { + ""files"": ""packages/fake-driver/**/*"", +diff --git a/package-lock.json b/package-lock.json +index 652523a294f..f7454ce9c79 100644 +--- a/package-lock.json ++++ b/package-lock.json +@@ -27,6 +27,8 @@ + ""@types/teen_process"": ""2.0.0"", + ""@types/ws"": ""8.5.4"", + ""@types/yargs"": ""17.0.22"", ++ ""@typescript-eslint/eslint-plugin"": ""5.54.1"", ++ ""@typescript-eslint/parser"": ""5.54.1"", + ""asyncbox"": ""2.9.4"", + ""chai"": ""4.3.7"", + ""chai-as-promised"": ""7.1.1"", +@@ -99,6 +101,10 @@ + ""resolved"": ""packages/eslint-config-appium"", + ""link"": true + }, ++ ""node_modules/@appium/eslint-config-appium-ts"": { ++ ""resolved"": ""packages/eslint-config-appium-ts"", ++ ""link"": true ++ }, + ""node_modules/@appium/execute-driver-plugin"": { + ""resolved"": ""packages/execute-driver-plugin"", + ""link"": true +@@ -2529,6 +2535,214 @@ + ""@types/node"": ""*"" + } + }, ++ ""node_modules/@typescript-eslint/eslint-plugin"": { ++ ""version"": ""5.54.1"", ++ ""resolved"": ""https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.54.1.tgz"", ++ ""integrity"": ""sha512-a2RQAkosH3d3ZIV08s3DcL/mcGc2M/UC528VkPULFxR9VnVPT8pBu0IyBAJJmVsCmhVfwQX1v6q+QGnmSe1bew=="", ++ ""dependencies"": { ++ ""@typescript-eslint/scope-manager"": ""5.54.1"", ++ ""@typescript-eslint/type-utils"": ""5.54.1"", ++ ""@typescript-eslint/utils"": ""5.54.1"", ++ ""debug"": ""^4.3.4"", ++ ""grapheme-splitter"": ""^1.0.4"", ++ ""ignore"": ""^5.2.0"", ++ ""natural-compare-lite"": ""^1.4.0"", ++ ""regexpp"": ""^3.2.0"", ++ ""semver"": ""^7.3.7"", ++ ""tsutils"": ""^3.21.0"" ++ }, ++ ""engines"": { ++ ""node"": ""^12.22.0 || ^14.17.0 || >=16.0.0"" ++ }, ++ ""funding"": { ++ ""type"": ""opencollective"", ++ ""url"": ""https://opencollective.com/typescript-eslint"" ++ }, ++ ""peerDependencies"": { ++ ""@typescript-eslint/parser"": ""^5.0.0"", ++ ""eslint"": ""^6.0.0 || ^7.0.0 || ^8.0.0"" ++ }, ++ ""peerDependenciesMeta"": { ++ ""typescript"": { ++ ""optional"": true ++ } ++ } ++ }, ++ ""node_modules/@typescript-eslint/parser"": { ++ ""version"": ""5.54.1"", ++ ""resolved"": ""https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.54.1.tgz"", ++ ""integrity"": ""sha512-8zaIXJp/nG9Ff9vQNh7TI+C3nA6q6iIsGJ4B4L6MhZ7mHnTMR4YP5vp2xydmFXIy8rpyIVbNAG44871LMt6ujg=="", ++ ""dependencies"": { ++ ""@typescript-eslint/scope-manager"": ""5.54.1"", ++ ""@typescript-eslint/types"": ""5.54.1"", ++ ""@typescript-eslint/typescript-estree"": ""5.54.1"", ++ ""debug"": ""^4.3.4"" ++ }, ++ ""engines"": { ++ ""node"": ""^12.22.0 || ^14.17.0 || >=16.0.0"" ++ }, ++ ""funding"": { ++ ""type"": ""opencollective"", ++ ""url"": ""https://opencollective.com/typescript-eslint"" ++ }, ++ ""peerDependencies"": { ++ ""eslint"": ""^6.0.0 || ^7.0.0 || ^8.0.0"" ++ }, ++ ""peerDependenciesMeta"": { ++ ""typescript"": { ++ ""optional"": true ++ } ++ } ++ }, ++ ""node_modules/@typescript-eslint/scope-manager"": { ++ ""version"": ""5.54.1"", ++ ""resolved"": ""https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.54.1.tgz"", ++ ""integrity"": ""sha512-zWKuGliXxvuxyM71UA/EcPxaviw39dB2504LqAmFDjmkpO8qNLHcmzlh6pbHs1h/7YQ9bnsO8CCcYCSA8sykUg=="", ++ ""dependencies"": { ++ ""@typescript-eslint/types"": ""5.54.1"", ++ ""@typescript-eslint/visitor-keys"": ""5.54.1"" ++ }, ++ ""engines"": { ++ ""node"": ""^12.22.0 || ^14.17.0 || >=16.0.0"" ++ }, ++ ""funding"": { ++ ""type"": ""opencollective"", ++ ""url"": ""https://opencollective.com/typescript-eslint"" ++ } ++ }, ++ ""node_modules/@typescript-eslint/type-utils"": { ++ ""version"": ""5.54.1"", ++ ""resolved"": ""https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.54.1.tgz"", ++ ""integrity"": ""sha512-WREHsTz0GqVYLIbzIZYbmUUr95DKEKIXZNH57W3s+4bVnuF1TKe2jH8ZNH8rO1CeMY3U4j4UQeqPNkHMiGem3g=="", ++ ""dependencies"": { ++ ""@typescript-eslint/typescript-estree"": ""5.54.1"", ++ ""@typescript-eslint/utils"": ""5.54.1"", ++ ""debug"": ""^4.3.4"", ++ ""tsutils"": ""^3.21.0"" ++ }, ++ ""engines"": { ++ ""node"": ""^12.22.0 || ^14.17.0 || >=16.0.0"" ++ }, ++ ""funding"": { ++ ""type"": ""opencollective"", ++ ""url"": ""https://opencollective.com/typescript-eslint"" ++ }, ++ ""peerDependencies"": { ++ ""eslint"": ""*"" ++ }, ++ ""peerDependenciesMeta"": { ++ ""typescript"": { ++ ""optional"": true ++ } ++ } ++ }, ++ ""node_modules/@typescript-eslint/types"": { ++ ""version"": ""5.54.1"", ++ ""resolved"": ""https://registry.npmjs.org/@typescript-eslint/types/-/types-5.54.1.tgz"", ++ ""integrity"": ""sha512-G9+1vVazrfAfbtmCapJX8jRo2E4MDXxgm/IMOF4oGh3kq7XuK3JRkOg6y2Qu1VsTRmWETyTkWt1wxy7X7/yLkw=="", ++ ""engines"": { ++ ""node"": ""^12.22.0 || ^14.17.0 || >=16.0.0"" ++ }, ++ ""funding"": { ++ ""type"": ""opencollective"", ++ ""url"": ""https://opencollective.com/typescript-eslint"" ++ } ++ }, ++ ""node_modules/@typescript-eslint/typescript-estree"": { ++ ""version"": ""5.54.1"", ++ ""resolved"": ""https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.54.1.tgz"", ++ ""integrity"": ""sha512-bjK5t+S6ffHnVwA0qRPTZrxKSaFYocwFIkZx5k7pvWfsB1I57pO/0M0Skatzzw1sCkjJ83AfGTL0oFIFiDX3bg=="", ++ ""dependencies"": { ++ ""@typescript-eslint/types"": ""5.54.1"", ++ ""@typescript-eslint/visitor-keys"": ""5.54.1"", ++ ""debug"": ""^4.3.4"", ++ ""globby"": ""^11.1.0"", ++ ""is-glob"": ""^4.0.3"", ++ ""semver"": ""^7.3.7"", ++ ""tsutils"": ""^3.21.0"" ++ }, ++ ""engines"": { ++ ""node"": ""^12.22.0 || ^14.17.0 || >=16.0.0"" ++ }, ++ ""funding"": { ++ ""type"": ""opencollective"", ++ ""url"": ""https://opencollective.com/typescript-eslint"" ++ }, ++ ""peerDependenciesMeta"": { ++ ""typescript"": { ++ ""optional"": true ++ } ++ } ++ }, ++ ""node_modules/@typescript-eslint/utils"": { ++ ""version"": ""5.54.1"", ++ ""resolved"": ""https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.54.1.tgz"", ++ ""integrity"": ""sha512-IY5dyQM8XD1zfDe5X8jegX6r2EVU5o/WJnLu/znLPWCBF7KNGC+adacXnt5jEYS9JixDcoccI6CvE4RCjHMzCQ=="", ++ ""dependencies"": { ++ ""@types/json-schema"": ""^7.0.9"", ++ ""@types/semver"": ""^7.3.12"", ++ ""@typescript-eslint/scope-manager"": ""5.54.1"", ++ ""@typescript-eslint/types"": ""5.54.1"", ++ ""@typescript-eslint/typescript-estree"": ""5.54.1"", ++ ""eslint-scope"": ""^5.1.1"", ++ ""eslint-utils"": ""^3.0.0"", ++ ""semver"": ""^7.3.7"" ++ }, ++ ""engines"": { ++ ""node"": ""^12.22.0 || ^14.17.0 || >=16.0.0"" ++ }, ++ ""funding"": { ++ ""type"": ""opencollective"", ++ ""url"": ""https://opencollective.com/typescript-eslint"" ++ }, ++ ""peerDependencies"": { ++ ""eslint"": ""^6.0.0 || ^7.0.0 || ^8.0.0"" ++ } ++ }, ++ ""node_modules/@typescript-eslint/utils/node_modules/eslint-scope"": { ++ ""version"": ""5.1.1"", ++ ""resolved"": ""https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz"", ++ ""integrity"": ""sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw=="", ++ ""dependencies"": { ++ ""esrecurse"": ""^4.3.0"", ++ ""estraverse"": ""^4.1.1"" ++ }, ++ ""engines"": { ++ ""node"": "">=8.0.0"" ++ } ++ }, ++ ""node_modules/@typescript-eslint/utils/node_modules/estraverse"": { ++ ""version"": ""4.3.0"", ++ ""resolved"": ""https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz"", ++ ""integrity"": ""sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw=="", ++ ""engines"": { ++ ""node"": "">=4.0"" ++ } ++ }, ++ ""node_modules/@typescript-eslint/visitor-keys"": { ++ ""version"": ""5.54.1"", ++ ""resolved"": ""https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.54.1.tgz"", ++ ""integrity"": ""sha512-q8iSoHTgwCfgcRJ2l2x+xCbu8nBlRAlsQ33k24Adj8eoVBE0f8dUeI+bAa8F84Mv05UGbAx57g2zrRsYIooqQg=="", ++ ""dependencies"": { ++ ""@typescript-eslint/types"": ""5.54.1"", ++ ""eslint-visitor-keys"": ""^3.3.0"" ++ }, ++ ""engines"": { ++ ""node"": ""^12.22.0 || ^14.17.0 || >=16.0.0"" ++ }, ++ ""funding"": { ++ ""type"": ""opencollective"", ++ ""url"": ""https://opencollective.com/typescript-eslint"" ++ } ++ }, ++ ""node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys"": { ++ ""version"": ""3.3.0"", ++ ""resolved"": ""https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz"", ++ ""integrity"": ""sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA=="", ++ ""engines"": { ++ ""node"": ""^12.22.0 || ^14.17.0 || >=16.0.0"" ++ } ++ }, + ""node_modules/@wdio/config"": { + ""version"": ""7.30.0"", + ""license"": ""MIT"", +@@ -3111,7 +3325,6 @@ + }, + ""node_modules/array-union"": { + ""version"": ""2.1.0"", +- ""dev"": true, + ""license"": ""MIT"", + ""engines"": { + ""node"": "">=8"" +@@ -5386,7 +5599,6 @@ + }, + ""node_modules/dir-glob"": { + ""version"": ""3.0.1"", +- ""dev"": true, + ""license"": ""MIT"", + ""dependencies"": { + ""path-type"": ""^4.0.0"" +@@ -6462,7 +6674,6 @@ + }, + ""node_modules/fast-glob"": { + ""version"": ""3.2.12"", +- ""dev"": true, + ""license"": ""MIT"", + ""dependencies"": { + ""@nodelib/fs.stat"": ""^2.0.2"", +@@ -7234,7 +7445,6 @@ + }, + ""node_modules/globby"": { + ""version"": ""11.1.0"", +- ""dev"": true, + ""license"": ""MIT"", + ""dependencies"": { + ""array-union"": ""^2.1.0"", +@@ -7253,7 +7463,6 @@ + }, + ""node_modules/globby/node_modules/slash"": { + ""version"": ""3.0.0"", +- ""dev"": true, + ""license"": ""MIT"", + ""engines"": { + ""node"": "">=8"" +@@ -10484,7 +10693,6 @@ + }, + ""node_modules/merge2"": { + ""version"": ""1.4.1"", +- ""dev"": true, + ""license"": ""MIT"", + ""engines"": { + ""node"": "">= 8"" +@@ -10523,7 +10731,6 @@ + }, + ""node_modules/micromatch"": { + ""version"": ""4.0.5"", +- ""dev"": true, + ""license"": ""MIT"", + ""dependencies"": { + ""braces"": ""^3.0.2"", +@@ -11251,6 +11458,11 @@ + ""version"": ""1.4.0"", + ""license"": ""MIT"" + }, ++ ""node_modules/natural-compare-lite"": { ++ ""version"": ""1.4.0"", ++ ""resolved"": ""https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz"", ++ ""integrity"": ""sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g=="" ++ }, + ""node_modules/ncp"": { + ""version"": ""2.0.0"", + ""license"": ""MIT"", +@@ -12941,7 +13153,6 @@ + }, + ""node_modules/path-type"": { + ""version"": ""4.0.0"", +- ""dev"": true, + ""license"": ""MIT"", + ""engines"": { + ""node"": "">=8"" +@@ -15331,6 +15542,25 @@ + ""version"": ""2.4.1"", + ""license"": ""0BSD"" + }, ++ ""node_modules/tsutils"": { ++ ""version"": ""3.21.0"", ++ ""resolved"": ""https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz"", ++ ""integrity"": ""sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA=="", ++ ""dependencies"": { ++ ""tslib"": ""^1.8.1"" ++ }, ++ ""engines"": { ++ ""node"": "">= 6"" ++ }, ++ ""peerDependencies"": { ++ ""typescript"": "">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta"" ++ } ++ }, ++ ""node_modules/tsutils/node_modules/tslib"": { ++ ""version"": ""1.14.1"", ++ ""resolved"": ""https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz"", ++ ""integrity"": ""sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="" ++ }, + ""node_modules/tty-browserify"": { + ""version"": ""0.0.0"", + ""dev"": true, +@@ -16788,6 +17018,25 @@ + ""eslint-plugin-promise"": ""^6.0.0"" + } + }, ++ ""packages/eslint-config-appium-ts"": { ++ ""name"": ""@appium/eslint-config-appium-ts"", ++ ""version"": ""0.1.0"", ++ ""license"": ""Apache-2.0"", ++ ""engines"": { ++ ""node"": ""^14.17.0 || ^16.13.0 || >=18.0.0"", ++ ""npm"": "">=8"" ++ }, ++ ""peerDependencies"": { ++ ""@appium/eslint-config-appium"": ""^8.0.0"", ++ ""@typescript-eslint/eslint-plugin"": ""^5.5.0"", ++ ""@typescript-eslint/parser"": ""^5.5.0"", ++ ""eslint"": ""^8.21.0"", ++ ""eslint-config-prettier"": ""^8.5.0"", ++ ""eslint-plugin-import"": ""^2.26.0"", ++ ""eslint-plugin-mocha"": ""^10.1.0"", ++ ""eslint-plugin-promise"": ""^6.0.0"" ++ } ++ }, + ""packages/execute-driver-plugin"": { + ""name"": ""@appium/execute-driver-plugin"", + ""version"": ""3.0.7"", +diff --git a/package.json b/package.json +index 57993953ce0..8f44a3e0a74 100644 +--- a/package.json ++++ b/package.json +@@ -52,7 +52,7 @@ + ""sync-pkgs"": ""run-p sync-pkgs:*"", + ""sync-pkgs:appium-readme"": ""sync-monorepo-packages --force --no-package-json --packages=packages/appium README.md"", + ""sync-pkgs:common-fields"": ""sync-monorepo-packages --fields=author,license,bugs,homepage,engines"", +- ""sync-pkgs:keywords"": ""sync-monorepo-packages --field=keywords --packages=\""packages/*\"" --packages=\""!packages/eslint-config-appium\"" --packages=\""!packages/types\"" --packages=\""!packages/typedoc-plugin-appium\"""", ++ ""sync-pkgs:keywords"": ""sync-monorepo-packages --field=keywords --packages=\""packages/*\"" --packages=\""!packages/eslint-config-appium\"" --packages=\""!packages/types\"" --packages=\""!packages/typedoc-plugin-appium\"" --packages=\""!packages/eslint-config-appium-ts\"" "", + ""sync-pkgs:license"": ""sync-monorepo-packages --force --no-package-json LICENSE"", + ""stage-synced-pkgs"": ""git add -A packages/appium/README.md \""packages/*/package.json\"""", + ""test"": ""npm-run-all -p lint build -s test:unit"", +@@ -88,6 +88,8 @@ + ""@types/teen_process"": ""2.0.0"", + ""@types/ws"": ""8.5.4"", + ""@types/yargs"": ""17.0.22"", ++ ""@typescript-eslint/eslint-plugin"": ""5.54.1"", ++ ""@typescript-eslint/parser"": ""5.54.1"", + ""asyncbox"": ""2.9.4"", + ""chai"": ""4.3.7"", + ""chai-as-promised"": ""7.1.1"", +diff --git a/packages/eslint-config-appium-ts/README.md b/packages/eslint-config-appium-ts/README.md +new file mode 100644 +index 00000000000..6931691c7cb +--- /dev/null ++++ b/packages/eslint-config-appium-ts/README.md +@@ -0,0 +1,44 @@ ++# @appium/eslint-config-appium ++ ++> Provides a reusable [ESLint](http://eslint.org/) [shared configuration](http://eslint.org/docs/developer-guide/shareable-configs) for [Appium](https://github.com/appium/appium) and Appium-adjacent projects (for TypeScript) ++ ++## Motivation ++ ++**If your package has no TypeScript sources, you don't need this.** However, if your package _does_ have TypeScript sources, you can't lint those files without this. ++ ++## Usage ++ ++Install the package with **`npm` v8 or newer**: ++ ++```bash ++npm install @appium/eslint-config-appium-ts --save-dev ++``` ++ ++And then, in your `.eslintrc` file, extend the configuration: ++ ++```json ++{ ++ ""extends"": ""@appium/eslint-config-appium-ts"" ++} ++``` ++ ++## Peer Dependencies ++ ++This config requires the following packages be installed (as peer dependencies) in your project. See the `package.json` for the required versions. ++ ++- [eslint](https://www.npmjs.com/package/eslint) ++- [eslint-config-prettier](https://www.npmjs.com/package/eslint-config-prettier) ++- [eslint-plugin-import](https://www.npmjs.com/package/eslint-plugin-import) ++- [eslint-plugin-mocha](https://www.npmjs.com/package/eslint-plugin-mocha) ++- [eslint-plugin-promise](https://www.npmjs.com/package/eslint-plugin-promise) ++- [@appium/eslint-config-appium](https://www.npmjs.com/package/@appium/eslint-config-appium) ++- [@typescript-eslint/eslint-plugin](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin) ++- [@typescript-eslint/parser](https://www.npmjs.com/package/@typescript-eslint/parser) ++ ++## Notes ++ ++- This configuration is intended to be used alongside [Prettier](https://www.npmjs.com/package/prettier). ++ ++## License ++ ++Copyright © 2023 OpenJS Foundation. Licensed Apache-2.0 +diff --git a/packages/eslint-config-appium-ts/index.json b/packages/eslint-config-appium-ts/index.json +new file mode 100644 +index 00000000000..32527c2dbeb +--- /dev/null ++++ b/packages/eslint-config-appium-ts/index.json +@@ -0,0 +1,22 @@ ++{ ++ ""$schema"": ""http://json.schemastore.org/eslintrc"", ++ ""overrides"": [ ++ { ++ ""files"": [""*.ts"", ""*.tsx""], ++ ""parser"": ""@typescript-eslint/parser"", ++ ""extends"": [""@appium/eslint-config-appium"", ""plugin:@typescript-eslint/recommended""], ++ ""rules"": { ++ ""@typescript-eslint/no-empty-function"": 1, ++ ""@typescript-eslint/no-empty-interface"": 0, ++ ""@typescript-eslint/no-explicit-any"": 0, ++ ""@typescript-eslint/no-non-null-assertion"": 0, ++ ""@typescript-eslint/no-var-requires"": 1, ++ ""import/no-duplicates"": 0, ++ ""import/no-unresolved"": 0, ++ ""no-unused-vars"": 0, ++ ""promise/no-native"": 0, ++ ""require-await"": 0 ++ } ++ } ++ ] ++} +diff --git a/packages/eslint-config-appium-ts/package.json b/packages/eslint-config-appium-ts/package.json +new file mode 100644 +index 00000000000..6feafcbd494 +--- /dev/null ++++ b/packages/eslint-config-appium-ts/package.json +@@ -0,0 +1,47 @@ ++{ ++ ""name"": ""@appium/eslint-config-appium-ts"", ++ ""version"": ""0.1.0"", ++ ""description"": ""Shared ESLint config for Appium projects (TypeScript version)"", ++ ""keywords"": [ ++ ""eslint"", ++ ""eslintconfig"", ++ ""appium"", ++ ""typescript"", ++ ""typescript-eslint"" ++ ], ++ ""homepage"": ""https://appium.io"", ++ ""bugs"": { ++ ""url"": ""https://github.com/appium/appium/issues"" ++ }, ++ ""repository"": { ++ ""type"": ""git"", ++ ""url"": ""https://github.com/appium/appium.git"", ++ ""directory"": ""packages/eslint-config-appium-ts"" ++ }, ++ ""license"": ""Apache-2.0"", ++ ""author"": ""https://github.com/appium"", ++ ""main"": ""index.json"", ++ ""files"": [ ++ ""index.json"" ++ ], ++ ""scripts"": { ++ ""test:smoke"": ""exit 0"" ++ }, ++ ""peerDependencies"": { ++ ""eslint"": ""^8.21.0"", ++ ""eslint-config-prettier"": ""^8.5.0"", ++ ""eslint-plugin-import"": ""^2.26.0"", ++ ""eslint-plugin-mocha"": ""^10.1.0"", ++ ""eslint-plugin-promise"": ""^6.0.0"", ++ ""@appium/eslint-config-appium"": ""^8.0.0"", ++ ""@typescript-eslint/eslint-plugin"": ""^5.5.0"", ++ ""@typescript-eslint/parser"": ""^5.5.0"" ++ }, ++ ""engines"": { ++ ""node"": ""^14.17.0 || ^16.13.0 || >=18.0.0"", ++ ""npm"": "">=8"" ++ }, ++ ""publishConfig"": { ++ ""access"": ""public"" ++ } ++}" +influxdb,https://github.com/influxdata/influxdb,1f8e07957956d9b53a082c1c9169381e28e53789,Michael Gattozzi,2024-03-13 01:21:23,fix: slow limits test (#24761),"This commit re-enables the limits test after making a fix that has it +run <1 second on my laptop vs the old behavior of >=30 seconds. It does +so by constructing one single write_lp request to create 1995 tables +rather than 1995 individual requests that make a table. This is far more +efficient.","fix: slow limits test (#24761) + +This commit re-enables the limits test after making a fix that has it +run <1 second on my laptop vs the old behavior of >=30 seconds. It does +so by constructing one single write_lp request to create 1995 tables +rather than 1995 individual requests that make a table. This is far more +efficient.","diff --git a/.circleci/config.yml b/.circleci/config.yml +index f7ad72c4ea0..afb45db0425 100644 +--- a/.circleci/config.yml ++++ b/.circleci/config.yml +@@ -159,8 +159,8 @@ jobs: + - checkout + - rust_components + - run: +- name: cargo test --workspace --features=limits +- command: cargo test --workspace --features=limits ++ name: cargo test --workspace ++ command: cargo test --workspace + + # end to end tests with Heappy (heap profiling enabled) + test_heappy: +diff --git a/influxdb3/Cargo.toml b/influxdb3/Cargo.toml +index 3426db7e347..159735271f2 100644 +--- a/influxdb3/Cargo.toml ++++ b/influxdb3/Cargo.toml +@@ -54,7 +54,6 @@ tikv-jemalloc-sys = { version = ""0.5.4"", optional = true, features = [""unprefixe + + [features] + default = [""jemalloc_replacing_malloc"", ""azure"", ""gcp"", ""aws""] +-limits = [] + + azure = [""clap_blocks/azure""] # Optional Azure Object store support + gcp = [""clap_blocks/gcp""] # Optional GCP object store support +diff --git a/influxdb3/tests/server/limits.rs b/influxdb3/tests/server/limits.rs +index cbede086469..2aca62f077d 100644 +--- a/influxdb3/tests/server/limits.rs ++++ b/influxdb3/tests/server/limits.rs +@@ -4,10 +4,6 @@ use influxdb3_client::Error; + use influxdb3_client::Precision; + + #[tokio::test] +-#[cfg_attr( +- not(feature = ""limits""), +- ignore = ""long running test, test with 'cargo test --features=limits'"" +-)] + async fn limits() -> Result<(), Error> { + let server = TestServer::spawn().await; + +@@ -36,15 +32,16 @@ async fn limits() -> Result<(), Error> { + + // Test that the server can't have more than 2000 tables + // First create the other needed 1995 tables +- for table in (0..1995).map(|i| format!(""cpu{i}"")) { +- server +- .write_lp_to_db( +- ""one"", +- &format!(""{table},host=s1,region=us-east usage=0.9 1\n""), +- Precision::Nanosecond, +- ) +- .await?; +- } ++ let table_lp = (0..1995).fold(String::new(), |mut acc, i| { ++ acc.push_str(""cpu""); ++ acc.push_str(&i.to_string()); ++ acc.push_str("",host=s1,region=us-east usage=0.9 1\n""); ++ acc ++ }); ++ ++ server ++ .write_lp_to_db(""one"", &table_lp, Precision::Nanosecond) ++ .await?; + + let Err(Error::ApiError { code, .. }) = server + .write_lp_to_db(" +superset,https://github.com/apache/superset,add35f9fe4b61679d108ec8323e1cdd177ff38d2,Einat Bertenthal,2021-05-25 19:14:28,fix: set table name width to not hide icons when name is too long (#14489),"* fix: set table name width to now hide icons when name is too long + +* fix: table style","fix: set table name width to not hide icons when name is too long (#14489) + +* fix: set table name width to now hide icons when name is too long + +* fix: table style + +Co-authored-by: einatnielsen ","diff --git a/superset-frontend/src/SqlLab/main.less b/superset-frontend/src/SqlLab/main.less +index 93bf91dc4e5ba..7e5cf6eebb4f1 100644 +--- a/superset-frontend/src/SqlLab/main.less ++++ b/superset-frontend/src/SqlLab/main.less +@@ -414,6 +414,7 @@ div.tablePopover { + display: flex; + flex: 1; + align-items: center; ++ width: 100%; + + .table-name { + white-space: nowrap;" +camel,https://github.com/apache/camel,bd0b5c2d809e8f8eeab40a2d837c81592e4967a8,dependabot[bot],2025-03-07 14:21:17,chore(deps): Bump huaweicloud-sdk-version from 3.1.137 to 3.1.138 (#17376),"Bumps `huaweicloud-sdk-version` from 3.1.137 to 3.1.138. + +Updates `com.huaweicloud.sdk:huaweicloud-sdk-core` from 3.1.137 to 3.1.138 +- [Release notes](https://github.com/huaweicloud/huaweicloud-sdk-java-v3/releases) +- [Commits](https://github.com/huaweicloud/huaweicloud-sdk-java-v3/compare/v3.1.137...v3.1.138) + +Updates `com.huaweicloud.sdk:huaweicloud-sdk-frs` from 3.1.137 to 3.1.138 + +Updates `com.huaweicloud.sdk:huaweicloud-sdk-functiongraph` from 3.1.137 to 3.1.138 + +Updates `com.huaweicloud.sdk:huaweicloud-sdk-iam` from 3.1.137 to 3.1.138 + +Updates `com.huaweicloud.sdk:huaweicloud-sdk-image` from 3.1.137 to 3.1.138 + +Updates `com.huaweicloud.sdk:huaweicloud-sdk-smn` from 3.1.137 to 3.1.138 + +---","chore(deps): Bump huaweicloud-sdk-version from 3.1.137 to 3.1.138 (#17376) + +Bumps `huaweicloud-sdk-version` from 3.1.137 to 3.1.138. + +Updates `com.huaweicloud.sdk:huaweicloud-sdk-core` from 3.1.137 to 3.1.138 +- [Release notes](https://github.com/huaweicloud/huaweicloud-sdk-java-v3/releases) +- [Commits](https://github.com/huaweicloud/huaweicloud-sdk-java-v3/compare/v3.1.137...v3.1.138) + +Updates `com.huaweicloud.sdk:huaweicloud-sdk-frs` from 3.1.137 to 3.1.138 + +Updates `com.huaweicloud.sdk:huaweicloud-sdk-functiongraph` from 3.1.137 to 3.1.138 + +Updates `com.huaweicloud.sdk:huaweicloud-sdk-iam` from 3.1.137 to 3.1.138 + +Updates `com.huaweicloud.sdk:huaweicloud-sdk-image` from 3.1.137 to 3.1.138 + +Updates `com.huaweicloud.sdk:huaweicloud-sdk-smn` from 3.1.137 to 3.1.138 + +--- +updated-dependencies: +- dependency-name: com.huaweicloud.sdk:huaweicloud-sdk-core + dependency-type: direct:production + update-type: version-update:semver-patch +- dependency-name: com.huaweicloud.sdk:huaweicloud-sdk-frs + dependency-type: direct:production + update-type: version-update:semver-patch +- dependency-name: com.huaweicloud.sdk:huaweicloud-sdk-functiongraph + dependency-type: direct:production + update-type: version-update:semver-patch +- dependency-name: com.huaweicloud.sdk:huaweicloud-sdk-iam + dependency-type: direct:production + update-type: version-update:semver-patch +- dependency-name: com.huaweicloud.sdk:huaweicloud-sdk-image + dependency-type: direct:production + update-type: version-update:semver-patch +- dependency-name: com.huaweicloud.sdk:huaweicloud-sdk-smn + dependency-type: direct:production + update-type: version-update:semver-patch +... + +Signed-off-by: dependabot[bot] +Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>","diff --git a/parent/pom.xml b/parent/pom.xml +index b162395a98e16..3f941f0a36f18 100644 +--- a/parent/pom.xml ++++ b/parent/pom.xml +@@ -227,7 +227,7 @@ + 4.5.14 + 4.1.5 + 3.24.12 +- 3.1.137 ++ 3.1.138 + 2.0.20 + 4.1.0 + 76.1" +MudBlazor,https://github.com/MudBlazor/MudBlazor,cad4f7dc82972c9ea117c3a4d20d24695f8ffad2,dependabot[bot],2022-10-17 23:22:30,Build(deps): Update Microsoft.AspNetCore.Components.WebAssembly.Server requirement (#5521),"Updates the requirements on [Microsoft.AspNetCore.Components.WebAssembly.Server](https://github.com/dotnet/aspnetcore) to permit the latest version. +- [Release notes](https://github.com/dotnet/aspnetcore/releases) +- [Changelog](https://github.com/dotnet/aspnetcore/blob/main/docs/ReleasePlanning.md) +- [Commits](https://github.com/dotnet/aspnetcore/compare/v6.0.9...v6.0.10) + +---","Build(deps): Update Microsoft.AspNetCore.Components.WebAssembly.Server requirement (#5521) + +Updates the requirements on [Microsoft.AspNetCore.Components.WebAssembly.Server](https://github.com/dotnet/aspnetcore) to permit the latest version. +- [Release notes](https://github.com/dotnet/aspnetcore/releases) +- [Changelog](https://github.com/dotnet/aspnetcore/blob/main/docs/ReleasePlanning.md) +- [Commits](https://github.com/dotnet/aspnetcore/compare/v6.0.9...v6.0.10) + +--- +updated-dependencies: +- dependency-name: Microsoft.AspNetCore.Components.WebAssembly.Server + dependency-type: direct:production +... + +Signed-off-by: dependabot[bot] + +Signed-off-by: dependabot[bot] +Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>","diff --git a/src/MudBlazor.Docs.WasmHost/MudBlazor.Docs.WasmHost.csproj b/src/MudBlazor.Docs.WasmHost/MudBlazor.Docs.WasmHost.csproj +index 6bdd419eedf2..e0ad2a46bcf0 100644 +--- a/src/MudBlazor.Docs.WasmHost/MudBlazor.Docs.WasmHost.csproj ++++ b/src/MudBlazor.Docs.WasmHost/MudBlazor.Docs.WasmHost.csproj +@@ -7,7 +7,7 @@ + + + +- ++ + + + " +AppFlowy,https://github.com/AppFlowy-IO/AppFlowy,7f74fd614903c457cfafb23170c904e6597840b0,Richard Shiue,2023-06-27 12:47:51,refactor: cover node widget code (#2899),"* chore: change initial cover type's name to none + +* chore: refactor cover node widget + +* chore: use a constant instead of magic value + +* fix: make the size of icon hover effect smaller + +* chore: improve appearance of selected color + +* test: add cover integration tests + +* fix: inner ring of selected color in dark mode + +* refactor: cover node to document header node + +* test: simplify tests + +* chore: rename files","refactor: cover node widget code (#2899) + +* chore: change initial cover type's name to none + +* chore: refactor cover node widget + +* chore: use a constant instead of magic value + +* fix: make the size of icon hover effect smaller + +* chore: improve appearance of selected color + +* test: add cover integration tests + +* fix: inner ring of selected color in dark mode + +* refactor: cover node to document header node + +* test: simplify tests + +* chore: rename files","diff --git a/frontend/appflowy_flutter/integration_test/database_row_page_test.dart b/frontend/appflowy_flutter/integration_test/database_row_page_test.dart +index 8a5175d388a4c..825cd315a7958 100644 +--- a/frontend/appflowy_flutter/integration_test/database_row_page_test.dart ++++ b/frontend/appflowy_flutter/integration_test/database_row_page_test.dart +@@ -6,6 +6,7 @@ import 'package:flutter_test/flutter_test.dart'; + import 'package:integration_test/integration_test.dart'; + + import 'util/database_test_op.dart'; ++import 'util/emoji.dart'; + import 'util/ime.dart'; + import 'util/util.dart'; + +diff --git a/frontend/appflowy_flutter/integration_test/document/cover_image_test.dart b/frontend/appflowy_flutter/integration_test/document/cover_image_test.dart +index 0d3708d1f2ae9..9b8695205b1f9 100644 +--- a/frontend/appflowy_flutter/integration_test/document/cover_image_test.dart ++++ b/frontend/appflowy_flutter/integration_test/document/cover_image_test.dart +@@ -1,6 +1,8 @@ ++import 'package:appflowy/plugins/document/presentation/editor_plugins/header/document_header_node_widget.dart'; + import 'package:flutter_test/flutter_test.dart'; + import 'package:integration_test/integration_test.dart'; + ++import '../util/emoji.dart'; + import '../util/util.dart'; + + void main() { +@@ -22,15 +24,109 @@ void main() { + await TestFolder.cleanTestLocation(null); + }); + +- testWidgets( +- 'hovering on cover image will display change and delete cover image buttons', +- (tester) async { ++ testWidgets('document cover tests', (tester) async { + await tester.initializeAppFlowy(); ++ await tester.tapGoButton(); ++ ++ tester.expectToSeeNoDocumentCover(); ++ ++ // Hover over cover toolbar to show 'Add Cover' and 'Add Icon' buttons ++ await tester.editor.hoverOnCoverToolbar(); ++ tester.expectToSeePluginAddCoverAndIconButton(); ++ ++ // Insert a document cover ++ await tester.editor.tapOnAddCover(); ++ tester.expectToSeeDocumentCover( ++ CoverType.asset, ++ ""assets/images/app_flowy_abstract_cover_1.jpg"", ++ ); ++ ++ // Hover over the cover to show the 'Change Cover' and delete buttons ++ await tester.editor.hoverOnCover(); ++ tester.expectChangeCoverAndDeleteButton(); ++ ++ // Change cover to a solid color background ++ await tester.editor.hoverOnCover(); ++ await tester.editor.tapOnChangeCover(); ++ await tester.editor.switchSolidColorBackground(); ++ await tester.editor.dismissCoverPicker(); ++ tester.expectToSeeDocumentCover(CoverType.color, ""ffe8e0ff""); + ++ // Remove the cover ++ await tester.editor.hoverOnCover(); ++ await tester.editor.tapOnRemoveCover(); ++ tester.expectToSeeNoDocumentCover(); ++ }); ++ ++ testWidgets('document icon tests', (tester) async { ++ await tester.initializeAppFlowy(); + await tester.tapGoButton(); +- await tester.editor.hoverOnCoverPluginAddButton(); + ++ tester.expectToSeeDocumentIcon(null); ++ ++ // Hover over cover toolbar to show the 'Add Cover' and 'Add Icon' buttons ++ await tester.editor.hoverOnCoverToolbar(); + tester.expectToSeePluginAddCoverAndIconButton(); ++ ++ // Insert a document icon ++ await tester.editor.tapAddIconButton(); ++ await tester.switchToEmojiList(); ++ await tester.tapEmoji('😀'); ++ tester.expectToSeeDocumentIcon('😀'); ++ ++ // Remove the document icon from the cover toolbar ++ await tester.editor.hoverOnCoverToolbar(); ++ await tester.editor.tapRemoveIconButton(); ++ tester.expectToSeeDocumentIcon(null); ++ ++ // Add the icon back for further testing ++ await tester.editor.hoverOnCoverToolbar(); ++ await tester.editor.tapAddIconButton(); ++ await tester.switchToEmojiList(); ++ await tester.tapEmoji('😀'); ++ tester.expectToSeeDocumentIcon('😀'); ++ ++ // Change the document icon ++ await tester.editor.tapOnIconWidget(); ++ await tester.switchToEmojiList(); ++ await tester.tapEmoji('😅'); ++ tester.expectToSeeDocumentIcon('😅'); ++ ++ // Remove the document icon from the icon picker ++ await tester.editor.tapOnIconWidget(); ++ await tester.editor.tapRemoveIconButton(isInPicker: true); ++ tester.expectToSeeDocumentIcon(null); ++ }); ++ ++ testWidgets('icon and cover at the same time', (tester) async { ++ await tester.initializeAppFlowy(); ++ await tester.tapGoButton(); ++ ++ tester.expectToSeeDocumentIcon(null); ++ tester.expectToSeeNoDocumentCover(); ++ ++ // Hover over cover toolbar to show the 'Add Cover' and 'Add Icon' buttons ++ await tester.editor.hoverOnCoverToolbar(); ++ tester.expectToSeePluginAddCoverAndIconButton(); ++ ++ // Insert a document icon ++ await tester.editor.tapAddIconButton(); ++ await tester.switchToEmojiList(); ++ await tester.tapEmoji('😀'); ++ ++ // Insert a document cover ++ await tester.editor.tapOnAddCover(); ++ ++ // Expect to see the icon and cover at the same time ++ tester.expectToSeeDocumentIcon('😀'); ++ tester.expectToSeeDocumentCover( ++ CoverType.asset, ++ ""assets/images/app_flowy_abstract_cover_1.jpg"", ++ ); ++ ++ // Hover over the cover toolbar and see that neither icons are shown ++ await tester.editor.hoverOnCoverToolbar(); ++ tester.expectToSeeEmptyDocumentHeaderToolbar(); + }); + }); + } +diff --git a/frontend/appflowy_flutter/integration_test/util/database_test_op.dart b/frontend/appflowy_flutter/integration_test/util/database_test_op.dart +index 8cc8bea4f7f68..61b6d981463ff 100644 +--- a/frontend/appflowy_flutter/integration_test/util/database_test_op.dart ++++ b/frontend/appflowy_flutter/integration_test/util/database_test_op.dart +@@ -461,17 +461,6 @@ extension AppFlowyDatabaseTest on WidgetTester { + await tapButton(find.byType(EmojiSelectionMenu)); + } + +- /// Must call [openEmojiPicker] first +- Future switchToEmojiList() async { +- final icon = find.byIcon(Icons.tag_faces); +- await tapButton(icon); +- } +- +- Future tapEmoji(String emoji) async { +- final emojiWidget = find.text(emoji); +- await tapButton(emojiWidget); +- } +- + Future tapDateCellInRowDetailPage() async { + final findDateCell = find.byType(GridDateCell); + await tapButton(findDateCell); +diff --git a/frontend/appflowy_flutter/integration_test/util/editor_test_operations.dart b/frontend/appflowy_flutter/integration_test/util/editor_test_operations.dart +index 31187e1fbc31f..9d2c14abb506f 100644 +--- a/frontend/appflowy_flutter/integration_test/util/editor_test_operations.dart ++++ b/frontend/appflowy_flutter/integration_test/util/editor_test_operations.dart +@@ -1,4 +1,13 @@ ++import 'dart:ui'; ++ ++import 'package:appflowy/generated/locale_keys.g.dart'; ++import 'package:appflowy/plugins/document/presentation/editor_plugins/header/cover_editor.dart'; ++import 'package:appflowy/plugins/document/presentation/editor_plugins/header/document_header_node_widget.dart'; ++import 'package:appflowy/plugins/document/presentation/editor_plugins/header/emoji_icon_widget.dart'; ++import 'package:appflowy/plugins/document/presentation/editor_plugins/header/emoji_popover.dart'; + import 'package:appflowy_editor/appflowy_editor.dart' hide Log; ++import 'package:easy_localization/easy_localization.dart'; ++import 'package:flutter/services.dart'; + import 'package:flutter_test/flutter_test.dart'; + + import 'ime.dart'; +@@ -26,14 +35,78 @@ class EditorOperations { + } + + /// Hover on cover plugin button above the document +- Future hoverOnCoverPluginAddButton() async { +- final editor = find.byWidgetPredicate( +- (widget) => widget is AppFlowyEditor, ++ Future hoverOnCoverToolbar() async { ++ final coverToolbar = find.byType(DocumentHeaderToolbar); ++ await tester.startGesture( ++ tester.getBottomLeft(coverToolbar).translate(5, -5), ++ kind: PointerDeviceKind.mouse, ++ ); ++ await tester.pumpAndSettle(); ++ } ++ ++ /// Taps on the 'Add Icon' button in the cover toolbar ++ Future tapAddIconButton() async { ++ await tester.tapButtonWithName( ++ LocaleKeys.document_plugins_cover_addIcon.tr(), ++ ); ++ expect(find.byType(EmojiPopover), findsOneWidget); ++ } ++ ++ /// Taps the 'Remove Icon' button in the cover toolbar and the icon popover ++ Future tapRemoveIconButton({bool isInPicker = false}) async { ++ Finder button = ++ find.text(LocaleKeys.document_plugins_cover_removeIcon.tr()); ++ if (isInPicker) { ++ button = find.descendant(of: find.byType(EmojiPopover), matching: button); ++ } ++ ++ await tester.tapButton(button); ++ } ++ ++ /// Requires that the document must already have an icon. This opens the icon ++ /// picker ++ Future tapOnIconWidget() async { ++ final iconWidget = find.byType(EmojiIconWidget); ++ await tester.tapButton(iconWidget); ++ } ++ ++ Future tapOnAddCover() async { ++ await tester.tapButtonWithName( ++ LocaleKeys.document_plugins_cover_addCover.tr(), + ); +- await tester.hoverOnWidget( +- editor, +- offset: tester.getTopLeft(editor).translate(20, 20), ++ } ++ ++ Future tapOnChangeCover() async { ++ await tester.tapButtonWithName( ++ LocaleKeys.document_plugins_cover_changeCover.tr(), ++ ); ++ } ++ ++ Future switchSolidColorBackground() async { ++ final findPurpleButton = find.byWidgetPredicate( ++ (widget) => widget is ColorItem && widget.option.colorHex == ""ffe8e0ff"", ++ ); ++ await tester.tapButton(findPurpleButton); ++ } ++ ++ Future tapOnRemoveCover() async { ++ await tester.tapButton(find.byType(DeleteCoverButton)); ++ } ++ ++ /// A cover must be present in the document to function properly since this ++ /// catches all cover types collectively ++ Future hoverOnCover() async { ++ final cover = find.byType(DocumentCover); ++ await tester.startGesture( ++ tester.getCenter(cover), ++ kind: PointerDeviceKind.mouse, + ); ++ await tester.pumpAndSettle(); ++ } ++ ++ Future dismissCoverPicker() async { ++ await tester.sendKeyEvent(LogicalKeyboardKey.escape); ++ await tester.pumpAndSettle(); + } + + /// trigger the slash command (selection menu) +diff --git a/frontend/appflowy_flutter/integration_test/util/emoji.dart b/frontend/appflowy_flutter/integration_test/util/emoji.dart +new file mode 100644 +index 0000000000000..616f3da6ecccb +--- /dev/null ++++ b/frontend/appflowy_flutter/integration_test/util/emoji.dart +@@ -0,0 +1,17 @@ ++import 'package:flutter/material.dart'; ++import 'package:flutter_test/flutter_test.dart'; ++ ++import 'base.dart'; ++ ++extension EmojiTestExtension on WidgetTester { ++ /// Must call [openEmojiPicker] first ++ Future switchToEmojiList() async { ++ final icon = find.byIcon(Icons.tag_faces); ++ await tapButton(icon); ++ } ++ ++ Future tapEmoji(String emoji) async { ++ final emojiWidget = find.text(emoji); ++ await tapButton(emojiWidget); ++ } ++} +diff --git a/frontend/appflowy_flutter/integration_test/util/expectation.dart b/frontend/appflowy_flutter/integration_test/util/expectation.dart +index 1f6c329d6627a..4de627cf80e98 100644 +--- a/frontend/appflowy_flutter/integration_test/util/expectation.dart ++++ b/frontend/appflowy_flutter/integration_test/util/expectation.dart +@@ -1,5 +1,7 @@ + import 'package:appflowy/generated/locale_keys.g.dart'; + import 'package:appflowy/plugins/document/presentation/banner.dart'; ++import 'package:appflowy/plugins/document/presentation/editor_plugins/header/document_header_node_widget.dart'; ++import 'package:appflowy/plugins/document/presentation/editor_plugins/header/emoji_icon_widget.dart'; + import 'package:appflowy/workspace/presentation/home/home_stack.dart'; + import 'package:appflowy/workspace/presentation/home/menu/app/section/item.dart'; + import 'package:easy_localization/easy_localization.dart'; +@@ -47,7 +49,7 @@ extension Expectation on WidgetTester { + expect(exportSuccess, findsOneWidget); + } + +- /// Expect to see the add button and icon button inside the document. ++ /// Expect to see the add button and icon button in the cover toolbar + void expectToSeePluginAddCoverAndIconButton() { + final addCover = find.textContaining( + LocaleKeys.document_plugins_cover_addCover.tr(), +@@ -59,6 +61,54 @@ extension Expectation on WidgetTester { + expect(addIcon, findsOneWidget); + } + ++ /// Expect to see the document header toolbar empty ++ void expectToSeeEmptyDocumentHeaderToolbar() { ++ final addCover = find.textContaining( ++ LocaleKeys.document_plugins_cover_addCover.tr(), ++ ); ++ final addIcon = find.textContaining( ++ LocaleKeys.document_plugins_cover_addIcon.tr(), ++ ); ++ expect(addCover, findsNothing); ++ expect(addIcon, findsNothing); ++ } ++ ++ void expectToSeeDocumentIcon(String? emoji) { ++ if (emoji == null) { ++ final iconWidget = find.byType(EmojiIconWidget); ++ expect(iconWidget, findsNothing); ++ return; ++ } ++ final iconWidget = find.byWidgetPredicate( ++ (widget) => widget is EmojiIconWidget && widget.emoji == emoji, ++ ); ++ expect(iconWidget, findsOneWidget); ++ } ++ ++ void expectToSeeDocumentCover(CoverType type, String details) { ++ final findCover = find.byWidgetPredicate( ++ (widget) => ++ widget is DocumentCover && ++ widget.coverType == type && ++ widget.coverDetails == details, ++ ); ++ expect(findCover, findsOneWidget); ++ } ++ ++ void expectToSeeNoDocumentCover() { ++ final findCover = find.byType(DocumentCover); ++ expect(findCover, findsNothing); ++ } ++ ++ void expectChangeCoverAndDeleteButton() { ++ final findChangeCover = find.text( ++ LocaleKeys.document_plugins_cover_changeCover.tr(), ++ ); ++ final findRemoveIcon = find.byType(DeleteCoverButton); ++ expect(findChangeCover, findsOneWidget); ++ expect(findRemoveIcon, findsOneWidget); ++ } ++ + /// Expect to see the user name on the home page + void expectToSeeUserName(String name) { + final userName = find.byWidgetPredicate( +diff --git a/frontend/appflowy_flutter/lib/plugins/document/document_page.dart b/frontend/appflowy_flutter/lib/plugins/document/document_page.dart +index 2e448c99bc479..19672d22eb898 100644 +--- a/frontend/appflowy_flutter/lib/plugins/document/document_page.dart ++++ b/frontend/appflowy_flutter/lib/plugins/document/document_page.dart +@@ -123,7 +123,7 @@ class _DocumentPageState extends State { + return const Placeholder(); + } + final page = editorState!.document.root; +- return CoverImageNodeWidget( ++ return DocumentHeaderNodeWidget( + node: page, + editorState: editorState!, + ); +diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/cover/cover_node_widget.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/cover/cover_node_widget.dart +deleted file mode 100644 +index 64d92e11251c5..0000000000000 +--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/cover/cover_node_widget.dart ++++ /dev/null +@@ -1,555 +0,0 @@ +-import 'dart:io'; +- +-import 'package:appflowy/generated/locale_keys.g.dart'; +-import 'package:appflowy/plugins/document/presentation/editor_plugins/cover/change_cover_popover.dart'; +-import 'package:appflowy/plugins/document/presentation/editor_plugins/cover/emoji_popover.dart'; +-import 'package:appflowy/plugins/document/presentation/editor_plugins/cover/emoji_icon_widget.dart'; +-import 'package:appflowy/workspace/presentation/widgets/emoji_picker/emoji_picker.dart'; +-import 'package:appflowy_editor/appflowy_editor.dart' hide FlowySvg; +-import 'package:appflowy_popover/appflowy_popover.dart'; +-import 'package:easy_localization/easy_localization.dart'; +-import 'package:flowy_infra/image.dart'; +-import 'package:flowy_infra/size.dart'; +-import 'package:flowy_infra_ui/flowy_infra_ui.dart'; +-import 'package:flowy_infra_ui/widget/rounded_button.dart'; +-import 'package:flutter/material.dart'; +- +-class CoverBlockKeys { +- const CoverBlockKeys._(); +- +- static const String selectionType = 'cover_selection_type'; +- static const String selection = 'cover_selection'; +- static const String iconSelection = 'selected_icon'; +-} +- +-enum CoverSelectionType { +- initial, +- color, +- file, +- asset; +- +- static CoverSelectionType fromString(String? value) { +- if (value == null) { +- return CoverSelectionType.initial; +- } +- return CoverSelectionType.values.firstWhere( +- (e) => e.toString() == value, +- orElse: () => CoverSelectionType.initial, +- ); +- } +-} +- +-class CoverNodeWidgetBuilder implements NodeWidgetBuilder { +- @override +- Widget build(NodeWidgetContext context) { +- return CoverImageNodeWidget( +- key: context.node.key, +- node: context.node, +- editorState: context.editorState, +- ); +- } +- +- @override +- NodeValidator get nodeValidator => (node) { +- return true; +- }; +-} +- +-class CoverImageNodeWidget extends StatefulWidget { +- const CoverImageNodeWidget({ +- Key? key, +- required this.node, +- required this.editorState, +- }) : super(key: key); +- +- final Node node; +- final EditorState editorState; +- +- @override +- State createState() => _CoverImageNodeWidgetState(); +-} +- +-class _CoverImageNodeWidgetState extends State { +- CoverSelectionType get selectionType => CoverSelectionType.fromString( +- widget.node.attributes[CoverBlockKeys.selectionType], +- ); +- +- @override +- void initState() { +- super.initState(); +- +- widget.node.addListener(_reload); +- } +- +- @override +- void dispose() { +- widget.node.removeListener(_reload); +- +- super.dispose(); +- } +- +- void _reload() { +- setState(() {}); +- } +- +- PopoverController iconPopoverController = PopoverController(); +- @override +- Widget build(BuildContext context) { +- return _CoverImage( +- editorState: widget.editorState, +- node: widget.node, +- onCoverChanged: (type, value) { +- _insertCover(type, value); +- }, +- ); +- } +- +- Future _insertCover(CoverSelectionType type, dynamic cover) async { +- final transaction = widget.editorState.transaction; +- transaction.updateNode(widget.node, { +- CoverBlockKeys.selectionType: type.toString(), +- CoverBlockKeys.selection: cover, +- CoverBlockKeys.iconSelection: +- widget.node.attributes[CoverBlockKeys.iconSelection] +- }); +- return widget.editorState.apply(transaction); +- } +-} +- +-class _AddCoverButton extends StatefulWidget { +- final Node node; +- final EditorState editorState; +- final bool hasIcon; +- final CoverSelectionType selectionType; +- +- final PopoverController iconPopoverController; +- const _AddCoverButton({ +- required this.onTap, +- required this.node, +- required this.editorState, +- required this.hasIcon, +- required this.selectionType, +- required this.iconPopoverController, +- }); +- +- final VoidCallback onTap; +- +- @override +- State<_AddCoverButton> createState() => _AddCoverButtonState(); +-} +- +-bool isPopoverOpen = false; +- +-class _AddCoverButtonState extends State<_AddCoverButton> { +- bool isHidden = true; +- PopoverMutex mutex = PopoverMutex(); +- bool isPopoverOpen = false; +- @override +- void initState() { +- super.initState(); +- } +- +- @override +- Widget build(BuildContext context) { +- return MouseRegion( +- onEnter: (event) { +- setHidden(false); +- }, +- onExit: (event) { +- setHidden(isPopoverOpen ? false : true); +- }, +- opaque: false, +- child: Container( +- height: widget.hasIcon ? 180 : 50.0, +- alignment: Alignment.bottomLeft, +- width: double.infinity, +- padding: const EdgeInsets.only( +- left: 80, +- top: 20, +- bottom: 5, +- ), +- child: isHidden +- ? Container() +- : Row( +- mainAxisSize: MainAxisSize.min, +- mainAxisAlignment: MainAxisAlignment.start, +- children: [ +- // Add Cover Button. +- widget.selectionType != CoverSelectionType.initial +- ? Container() +- : FlowyButton( +- key: UniqueKey(), +- leftIconSize: const Size.square(18), +- onTap: widget.onTap, +- useIntrinsicWidth: true, +- leftIcon: const FlowySvg(name: 'editor/image'), +- text: FlowyText.regular( +- LocaleKeys.document_plugins_cover_addCover.tr(), +- ), +- ), +- // Add Icon Button. +- widget.hasIcon +- ? FlowyButton( +- leftIconSize: const Size.square(18), +- onTap: () { +- _removeIcon(); +- }, +- useIntrinsicWidth: true, +- leftIcon: const Icon( +- Icons.emoji_emotions_outlined, +- size: 18, +- ), +- text: FlowyText.regular( +- LocaleKeys.document_plugins_cover_removeIcon.tr(), +- ), +- ) +- : AppFlowyPopover( +- mutex: mutex, +- asBarrier: true, +- onClose: () { +- isPopoverOpen = false; +- setHidden(true); +- }, +- offset: const Offset(120, 10), +- controller: widget.iconPopoverController, +- direction: PopoverDirection.bottomWithCenterAligned, +- constraints: +- BoxConstraints.loose(const Size(320, 380)), +- margin: EdgeInsets.zero, +- child: FlowyButton( +- leftIconSize: const Size.square(18), +- useIntrinsicWidth: true, +- leftIcon: const Icon( +- Icons.emoji_emotions_outlined, +- size: 18, +- ), +- text: FlowyText.regular( +- LocaleKeys.document_plugins_cover_addIcon.tr(), +- ), +- ), +- popupBuilder: (BuildContext popoverContext) { +- isPopoverOpen = true; +- return EmojiPopover( +- showRemoveButton: widget.hasIcon, +- removeIcon: _removeIcon, +- node: widget.node, +- editorState: widget.editorState, +- onEmojiChanged: (Emoji emoji) { +- _insertIcon(emoji); +- widget.iconPopoverController.close(); +- }, +- ); +- }, +- ) +- ], +- ), +- ), +- ); +- } +- +- Future _insertIcon(Emoji emoji) async { +- final transaction = widget.editorState.transaction; +- transaction.updateNode(widget.node, { +- CoverBlockKeys.selectionType: +- widget.node.attributes[CoverBlockKeys.selectionType], +- CoverBlockKeys.selection: +- widget.node.attributes[CoverBlockKeys.selection], +- CoverBlockKeys.iconSelection: emoji.emoji, +- }); +- return widget.editorState.apply(transaction); +- } +- +- Future _removeIcon() async { +- final transaction = widget.editorState.transaction; +- transaction.updateNode(widget.node, { +- CoverBlockKeys.iconSelection: """", +- CoverBlockKeys.selectionType: +- widget.node.attributes[CoverBlockKeys.selectionType], +- CoverBlockKeys.selection: +- widget.node.attributes[CoverBlockKeys.selection], +- }); +- return widget.editorState.apply(transaction); +- } +- +- void setHidden(bool value) { +- if (isHidden == value) return; +- setState(() { +- isHidden = value; +- }); +- } +-} +- +-class _CoverImage extends StatefulWidget { +- const _CoverImage({ +- required this.editorState, +- required this.node, +- required this.onCoverChanged, +- }); +- +- final Node node; +- final EditorState editorState; +- final Function( +- CoverSelectionType selectionType, +- dynamic selection, +- ) onCoverChanged; +- @override +- State<_CoverImage> createState() => _CoverImageState(); +-} +- +-class _CoverImageState extends State<_CoverImage> { +- final popoverController = PopoverController(); +- +- CoverSelectionType get selectionType => CoverSelectionType.fromString( +- widget.node.attributes[CoverBlockKeys.selectionType], +- ); +- Color get color { +- final hex = widget.node.attributes[CoverBlockKeys.selection] as String?; +- return hex?.toColor() ?? Colors.white; +- } +- +- bool get hasIcon => +- widget.node.attributes[CoverBlockKeys.iconSelection] == null +- ? false +- : widget.node.attributes[CoverBlockKeys.iconSelection].isNotEmpty; +- bool isOverlayButtonsHidden = true; +- PopoverController iconPopoverController = PopoverController(); +- bool get hasCover => +- selectionType == CoverSelectionType.initial ? false : true; +- +- @override +- Widget build(BuildContext context) { +- return Stack( +- alignment: Alignment.bottomLeft, +- children: [ +- Container( +- alignment: Alignment.topCenter, +- height: !hasCover +- ? 0 +- : hasIcon +- ? 320 +- : 280, +- child: _buildCoverImage(context, widget.editorState), +- ), +- hasIcon +- ? Positioned( +- left: 80, +- bottom: !hasCover ? 30 : 40, +- child: AppFlowyPopover( +- offset: const Offset(100, 0), +- controller: iconPopoverController, +- direction: PopoverDirection.bottomWithCenterAligned, +- constraints: BoxConstraints.loose(const Size(320, 380)), +- margin: EdgeInsets.zero, +- child: EmojiIconWidget( +- emoji: widget.node.attributes[CoverBlockKeys.iconSelection], +- ), +- popupBuilder: (BuildContext popoverContext) { +- return EmojiPopover( +- node: widget.node, +- showRemoveButton: hasIcon, +- removeIcon: _removeIcon, +- editorState: widget.editorState, +- onEmojiChanged: (Emoji emoji) { +- _insertIcon(emoji); +- iconPopoverController.close(); +- }, +- ); +- }, +- ), +- ) +- : Container(), +- hasIcon && selectionType != CoverSelectionType.initial +- ? Container() +- : _AddCoverButton( +- onTap: () { +- _insertCover( +- CoverSelectionType.asset, +- builtInAssetImages.first, +- ); +- }, +- node: widget.node, +- editorState: widget.editorState, +- hasIcon: hasIcon, +- selectionType: selectionType, +- iconPopoverController: iconPopoverController, +- ), +- ], +- ); +- } +- +- Future _insertCover(CoverSelectionType type, dynamic cover) async { +- final transaction = widget.editorState.transaction; +- transaction.updateNode(widget.node, { +- CoverBlockKeys.selectionType: type.toString(), +- CoverBlockKeys.selection: cover, +- CoverBlockKeys.iconSelection: +- widget.node.attributes[CoverBlockKeys.iconSelection] +- }); +- return widget.editorState.apply(transaction); +- } +- +- Future _insertIcon(Emoji emoji) async { +- final transaction = widget.editorState.transaction; +- transaction.updateNode(widget.node, { +- CoverBlockKeys.selectionType: +- widget.node.attributes[CoverBlockKeys.selectionType], +- CoverBlockKeys.selection: +- widget.node.attributes[CoverBlockKeys.selection], +- CoverBlockKeys.iconSelection: emoji.emoji, +- }); +- return widget.editorState.apply(transaction); +- } +- +- Future _removeIcon() async { +- final transaction = widget.editorState.transaction; +- transaction.updateNode(widget.node, { +- CoverBlockKeys.iconSelection: """", +- CoverBlockKeys.selectionType: +- widget.node.attributes[CoverBlockKeys.selectionType], +- CoverBlockKeys.selection: +- widget.node.attributes[CoverBlockKeys.selection], +- }); +- return widget.editorState.apply(transaction); +- } +- +- Widget _buildCoverOverlayButtons(BuildContext context) { +- return Positioned( +- bottom: 20, +- right: 50, +- child: Row( +- mainAxisSize: MainAxisSize.min, +- children: [ +- AppFlowyPopover( +- onClose: () { +- setOverlayButtonsHidden(true); +- }, +- offset: const Offset(-125, 10), +- controller: popoverController, +- direction: PopoverDirection.bottomWithCenterAligned, +- constraints: BoxConstraints.loose(const Size(380, 450)), +- margin: EdgeInsets.zero, +- child: Visibility( +- maintainState: true, +- maintainAnimation: true, +- maintainSize: true, +- visible: !isOverlayButtonsHidden, +- child: RoundedTextButton( +- onPressed: () { +- popoverController.show(); +- setOverlayButtonsHidden(true); +- }, +- hoverColor: Theme.of(context).colorScheme.surface, +- textColor: Theme.of(context).colorScheme.tertiary, +- fillColor: +- Theme.of(context).colorScheme.surface.withOpacity(0.5), +- width: 120, +- height: 28, +- title: LocaleKeys.document_plugins_cover_changeCover.tr(), +- ), +- ), +- popupBuilder: (BuildContext popoverContext) { +- return ChangeCoverPopover( +- node: widget.node, +- editorState: widget.editorState, +- onCoverChanged: widget.onCoverChanged, +- ); +- }, +- ), +- const SizedBox(width: 10), +- Visibility( +- maintainAnimation: true, +- maintainSize: true, +- maintainState: true, +- visible: !isOverlayButtonsHidden, +- child: FlowyIconButton( +- hoverColor: Theme.of(context).colorScheme.surface, +- fillColor: Theme.of(context).colorScheme.surface.withOpacity(0.5), +- iconPadding: const EdgeInsets.all(5), +- width: 28, +- icon: svgWidget( +- 'editor/delete', +- color: Theme.of(context).colorScheme.tertiary, +- ), +- onPressed: () { +- widget.onCoverChanged(CoverSelectionType.initial, null); +- }, +- ), +- ), +- ], +- ), +- ); +- } +- +- Widget _buildCoverImage(BuildContext context, EditorState editorState) { +- const height = 250.0; +- final Widget coverImage; +- switch (selectionType) { +- case CoverSelectionType.file: +- final imageFile = +- File(widget.node.attributes[CoverBlockKeys.selection]); +- if (!imageFile.existsSync()) { +- // reset cover state +- WidgetsBinding.instance.addPostFrameCallback((_) { +- widget.onCoverChanged(CoverSelectionType.initial, null); +- }); +- coverImage = const SizedBox(); +- break; +- } +- coverImage = Image.file( +- imageFile, +- fit: BoxFit.cover, +- ); +- break; +- case CoverSelectionType.asset: +- coverImage = Image.asset( +- widget.node.attributes[CoverBlockKeys.selection], +- fit: BoxFit.cover, +- ); +- break; +- case CoverSelectionType.color: +- coverImage = Container( +- decoration: BoxDecoration( +- color: color, +- borderRadius: Corners.s6Border, +- ), +- alignment: Alignment.center, +- ); +- break; +- case CoverSelectionType.initial: +- coverImage = const SizedBox(); +- break; +- } +-// OverflowBox needs to be wraped by a widget with constraints(or from its parent) first,otherwise it will occur an error +- return MouseRegion( +- onEnter: (event) { +- setOverlayButtonsHidden(false); +- }, +- onExit: (event) { +- setOverlayButtonsHidden(true); +- }, +- child: SizedBox( +- height: height, +- child: Stack( +- children: [ +- Container( +- padding: const EdgeInsets.only(bottom: 10), +- height: double.infinity, +- width: double.infinity, +- child: coverImage, +- ), +- hasCover +- ? _buildCoverOverlayButtons(context) +- : const SizedBox.shrink() +- ], +- ), +- ), +- ); +- } +- +- void setOverlayButtonsHidden(bool value) { +- if (isOverlayButtonsHidden == value) return; +- setState(() { +- isOverlayButtonsHidden = value; +- }); +- } +-} +diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/cover/change_cover_popover.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/cover_editor.dart +similarity index 90% +rename from frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/cover/change_cover_popover.dart +rename to frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/cover_editor.dart +index 639af1f979e16..77b5abc1f5315 100644 +--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/cover/change_cover_popover.dart ++++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/cover_editor.dart +@@ -25,7 +25,7 @@ class ChangeCoverPopover extends StatefulWidget { + final EditorState editorState; + final Node node; + final Function( +- CoverSelectionType selectionType, ++ CoverType selectionType, + String selection, + ) onCoverChanged; + +@@ -149,10 +149,10 @@ class _ChangeCoverPopoverState extends State { + LocaleKeys.document_plugins_cover_clearAll.tr(), + fontColor: Theme.of(context).colorScheme.tertiary, + onPressed: () async { +- final hasFileImageCover = CoverSelectionType.fromString( +- widget.node.attributes[CoverBlockKeys.selectionType], ++ final hasFileImageCover = CoverType.fromString( ++ widget.node.attributes[DocumentHeaderBlockKeys.coverType], + ) == +- CoverSelectionType.file; ++ CoverType.file; + final changeCoverBloc = context.read(); + if (hasFileImageCover) { + await showDialog( +@@ -196,7 +196,7 @@ class _ChangeCoverPopoverState extends State { + return InkWell( + onTap: () { + widget.onCoverChanged( +- CoverSelectionType.asset, ++ CoverType.asset, + builtInAssetImages[index], + ); + }, +@@ -220,14 +220,14 @@ class _ChangeCoverPopoverState extends State { + pickerBackgroundColor: theme.cardColor, + pickerItemHoverColor: theme.hoverColor, + selectedBackgroundColorHex: +- widget.node.attributes[CoverBlockKeys.selectionType] == +- CoverSelectionType.color.toString() +- ? widget.node.attributes[CoverBlockKeys.selection] ++ widget.node.attributes[DocumentHeaderBlockKeys.coverType] == ++ CoverType.color.toString() ++ ? widget.node.attributes[DocumentHeaderBlockKeys.coverDetails] + : 'ffffff', + backgroundColorOptions: + _generateBackgroundColorOptions(widget.editorState), + onSubmittedBackgroundColorHex: (color) { +- widget.onCoverChanged(CoverSelectionType.color, color); ++ widget.onCoverChanged(CoverType.color, color); + setState(() {}); + }, + ); +@@ -276,16 +276,16 @@ class _ChangeCoverPopoverState extends State { + return ImageGridItem( + onImageSelect: () { + widget.onCoverChanged( +- CoverSelectionType.file, ++ CoverType.file, + images[index - 1], + ); + }, + onImageDelete: () async { + final changeCoverBloc = + context.read(); +- final deletingCurrentCover = +- widget.node.attributes[CoverBlockKeys.selection] == +- images[index - 1]; ++ final deletingCurrentCover = widget.node ++ .attributes[DocumentHeaderBlockKeys.coverDetails] == ++ images[index - 1]; + if (deletingCurrentCover) { + await showDialog( + context: context, +@@ -481,36 +481,63 @@ class _CoverColorPickerState extends State { + scrollController.dispose(); + } + +- Widget _buildColorItem(ColorOption option, bool isChecked) { ++ Widget _buildColorItems(List options, String? selectedColor) { ++ return Row( ++ crossAxisAlignment: CrossAxisAlignment.start, ++ children: options ++ .map( ++ (e) => ColorItem( ++ option: e, ++ isChecked: e.colorHex == selectedColor, ++ hoverColor: widget.pickerItemHoverColor, ++ onTap: widget.onSubmittedBackgroundColorHex, ++ ), ++ ) ++ .toList(), ++ ); ++ } ++} ++ ++@visibleForTesting ++class ColorItem extends StatelessWidget { ++ final ColorOption option; ++ final bool isChecked; ++ final Color hoverColor; ++ final void Function(String) onTap; ++ const ColorItem({ ++ required this.option, ++ required this.isChecked, ++ required this.hoverColor, ++ required this.onTap, ++ super.key, ++ }); ++ ++ @override ++ Widget build(BuildContext context) { + return InkWell( + customBorder: const RoundedRectangleBorder( + borderRadius: Corners.s6Border, + ), +- hoverColor: widget.pickerItemHoverColor, +- onTap: () { +- widget.onSubmittedBackgroundColorHex(option.colorHex); +- }, ++ hoverColor: hoverColor, ++ onTap: () => onTap(option.colorHex), + child: Padding( + padding: const EdgeInsets.only(right: 10.0), + child: SizedBox.square( +- dimension: isChecked ? 24 : 25, ++ dimension: 25, + child: Container( + decoration: BoxDecoration( + color: option.colorHex.toColor(), +- border: isChecked +- ? Border.all( +- color: const Color(0xFFFFFFFF), +- width: 2.0, +- ) +- : null, + shape: BoxShape.circle, + ), + child: isChecked + ? SizedBox.square( +- dimension: 24, + child: Container( +- margin: const EdgeInsets.all(4), ++ margin: const EdgeInsets.all(1), + decoration: BoxDecoration( ++ border: Border.all( ++ color: Theme.of(context).cardColor, ++ width: 3.0, ++ ), + color: option.colorHex.toColor(), + shape: BoxShape.circle, + ), +@@ -522,14 +549,4 @@ class _CoverColorPickerState extends State { + ), + ); + } +- +- Widget _buildColorItems(List options, String? selectedColor) { +- return Row( +- crossAxisAlignment: CrossAxisAlignment.start, +- mainAxisAlignment: MainAxisAlignment.start, +- children: options +- .map((e) => _buildColorItem(e, e.colorHex == selectedColor)) +- .toList(), +- ); +- } + } +diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/cover/change_cover_popover_bloc.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/cover_editor_bloc.dart +similarity index 90% +rename from frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/cover/change_cover_popover_bloc.dart +rename to frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/cover_editor_bloc.dart +index 18e2abc019ee9..f82876c656333 100644 +--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/cover/change_cover_popover_bloc.dart ++++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/cover_editor_bloc.dart +@@ -1,14 +1,14 @@ + import 'dart:async'; + import 'dart:io'; + +-import 'package:appflowy/plugins/document/presentation/editor_plugins/cover/change_cover_popover.dart'; +-import 'package:appflowy/plugins/document/presentation/editor_plugins/cover/cover_node_widget.dart'; ++import 'package:appflowy/plugins/document/presentation/editor_plugins/header/cover_editor.dart'; ++import 'package:appflowy/plugins/document/presentation/editor_plugins/header/document_header_node_widget.dart'; + import 'package:appflowy_editor/appflowy_editor.dart'; + import 'package:flutter_bloc/flutter_bloc.dart'; + import 'package:freezed_annotation/freezed_annotation.dart'; + import 'package:shared_preferences/shared_preferences.dart'; + +-part 'change_cover_popover_bloc.freezed.dart'; ++part 'cover_editor_bloc.freezed.dart'; + + class ChangeCoverPopoverBloc + extends Bloc { +@@ -32,7 +32,7 @@ class ChangeCoverPopoverBloc + deleteImage: (DeleteImage deleteImage) async { + final currentState = state; + final currentlySelectedImage = +- node.attributes[CoverBlockKeys.selection]; ++ node.attributes[DocumentHeaderBlockKeys.coverDetails]; + if (currentState is Loaded) { + await _deleteImageInStorage(deleteImage.path); + if (currentlySelectedImage == deleteImage.path) { +@@ -48,7 +48,7 @@ class ChangeCoverPopoverBloc + clearAllImages: (ClearAllImages clearAllImages) async { + final currentState = state; + final currentlySelectedImage = +- node.attributes[CoverBlockKeys.selection]; ++ node.attributes[DocumentHeaderBlockKeys.coverDetails]; + + if (currentState is Loaded) { + for (final image in currentState.imageNames) { +@@ -90,9 +90,9 @@ class ChangeCoverPopoverBloc + Future _removeCoverImageFromNode() async { + final transaction = editorState.transaction; + transaction.updateNode(node, { +- CoverBlockKeys.selectionType: CoverSelectionType.initial.toString(), +- CoverBlockKeys.iconSelection: +- node.attributes[CoverBlockKeys.iconSelection] ++ DocumentHeaderBlockKeys.coverType: CoverType.none.toString(), ++ DocumentHeaderBlockKeys.icon: ++ node.attributes[DocumentHeaderBlockKeys.icon] + }); + return editorState.apply(transaction); + } +diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/cover/cover_image_picker.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/custom_cover_picker.dart +similarity index 99% +rename from frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/cover/cover_image_picker.dart +rename to frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/custom_cover_picker.dart +index e7acb61403fa7..b5460450a31a4 100644 +--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/cover/cover_image_picker.dart ++++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/custom_cover_picker.dart +@@ -1,6 +1,6 @@ + import 'dart:io'; + import 'package:appflowy/generated/locale_keys.g.dart'; +-import 'package:appflowy/plugins/document/presentation/editor_plugins/cover/cover_image_picker_bloc.dart'; ++import 'package:appflowy/plugins/document/presentation/editor_plugins/header/custom_cover_picker_bloc.dart'; + import 'package:easy_localization/easy_localization.dart'; + import 'package:flowy_infra_ui/style_widget/snap_bar.dart'; + import 'package:flutter_bloc/flutter_bloc.dart'; +diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/cover/cover_image_picker_bloc.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/custom_cover_picker_bloc.dart +similarity index 98% +rename from frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/cover/cover_image_picker_bloc.dart +rename to frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/custom_cover_picker_bloc.dart +index 68ffe4e966ed1..b239ecf4038ec 100644 +--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/cover/cover_image_picker_bloc.dart ++++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/custom_cover_picker_bloc.dart +@@ -13,9 +13,10 @@ import 'package:dartz/dartz.dart'; + import 'package:http/http.dart' as http; + import 'package:shared_preferences/shared_preferences.dart'; + import 'package:path/path.dart' as p; +-import 'change_cover_popover.dart'; + +-part 'cover_image_picker_bloc.freezed.dart'; ++import 'cover_editor.dart'; ++ ++part 'custom_cover_picker_bloc.freezed.dart'; + + class CoverImagePickerBloc + extends Bloc { +diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/document_header_node_widget.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/document_header_node_widget.dart +new file mode 100644 +index 0000000000000..3bd66ddc816fa +--- /dev/null ++++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/document_header_node_widget.dart +@@ -0,0 +1,507 @@ ++import 'dart:io'; ++ ++import 'package:appflowy/generated/locale_keys.g.dart'; ++import 'package:appflowy/workspace/presentation/widgets/emoji_picker/emoji_picker.dart'; ++import 'package:appflowy_editor/appflowy_editor.dart' hide FlowySvg; ++import 'package:appflowy_popover/appflowy_popover.dart'; ++import 'package:easy_localization/easy_localization.dart'; ++import 'package:flowy_infra/image.dart'; ++import 'package:flowy_infra_ui/flowy_infra_ui.dart'; ++import 'package:flowy_infra_ui/widget/rounded_button.dart'; ++import 'package:flutter/material.dart'; ++ ++import 'cover_editor.dart'; ++import 'emoji_icon_widget.dart'; ++import 'emoji_popover.dart'; ++ ++const double kCoverHeight = 250.0; ++const double kIconHeight = 60.0; ++const double kToolbarHeight = 40.0; // with padding to the top ++ ++class DocumentHeaderBlockKeys { ++ const DocumentHeaderBlockKeys._(); ++ ++ static const String coverType = 'cover_selection_type'; ++ static const String coverDetails = 'cover_selection'; ++ static const String icon = 'selected_icon'; ++} ++ ++enum CoverType { ++ none, ++ color, ++ file, ++ asset; ++ ++ static CoverType fromString(String? value) { ++ if (value == null) { ++ return CoverType.none; ++ } ++ return CoverType.values.firstWhere( ++ (e) => e.toString() == value, ++ orElse: () => CoverType.none, ++ ); ++ } ++} ++ ++class DocumentHeaderNodeWidgetBuilder implements NodeWidgetBuilder { ++ @override ++ Widget build(NodeWidgetContext context) { ++ return DocumentHeaderNodeWidget( ++ key: context.node.key, ++ node: context.node, ++ editorState: context.editorState, ++ ); ++ } ++ ++ @override ++ NodeValidator get nodeValidator => (_) => true; ++} ++ ++class DocumentHeaderNodeWidget extends StatefulWidget { ++ const DocumentHeaderNodeWidget({ ++ required this.node, ++ required this.editorState, ++ super.key, ++ }); ++ ++ final Node node; ++ final EditorState editorState; ++ ++ @override ++ State createState() => ++ _DocumentHeaderNodeWidgetState(); ++} ++ ++class _DocumentHeaderNodeWidgetState extends State { ++ CoverType get coverType => CoverType.fromString( ++ widget.node.attributes[DocumentHeaderBlockKeys.coverType], ++ ); ++ String? get coverDetails => ++ widget.node.attributes[DocumentHeaderBlockKeys.coverDetails]; ++ String get icon => widget.node.attributes[DocumentHeaderBlockKeys.icon]; ++ bool get hasIcon => ++ widget.node.attributes[DocumentHeaderBlockKeys.icon]?.isNotEmpty ?? false; ++ bool get hasCover => coverType != CoverType.none; ++ ++ @override ++ void initState() { ++ super.initState(); ++ widget.node.addListener(_reload); ++ } ++ ++ @override ++ void dispose() { ++ widget.node.removeListener(_reload); ++ super.dispose(); ++ } ++ ++ void _reload() => setState(() {}); ++ ++ @override ++ Widget build(BuildContext context) { ++ return Stack( ++ children: [ ++ SizedBox( ++ height: _calculateOverallHeight(), ++ child: DocumentHeaderToolbar( ++ onCoverChanged: _saveCover, ++ node: widget.node, ++ editorState: widget.editorState, ++ hasCover: hasCover, ++ hasIcon: hasIcon, ++ ), ++ ), ++ if (hasCover) ++ DocumentCover( ++ editorState: widget.editorState, ++ node: widget.node, ++ coverType: coverType, ++ coverDetails: coverDetails, ++ onCoverChanged: (type, details) => ++ _saveCover(cover: (type, details)), ++ ), ++ if (hasIcon) ++ Positioned( ++ left: 80, ++ // if hasCover, there shouldn't be icons present so the icon can ++ // be closer to the bottom. ++ bottom: ++ hasCover ? kToolbarHeight - kIconHeight / 2 : kToolbarHeight, ++ child: DocumentIcon( ++ editorState: widget.editorState, ++ node: widget.node, ++ icon: icon, ++ onIconChanged: (icon) => _saveCover(icon: icon), ++ ), ++ ), ++ ], ++ ); ++ } ++ ++ double _calculateOverallHeight() { ++ switch ((hasIcon, hasCover)) { ++ case (true, true): ++ return kCoverHeight + kToolbarHeight; ++ case (true, false): ++ return 50 + kIconHeight + kToolbarHeight; ++ case (false, true): ++ return kCoverHeight + kToolbarHeight; ++ case (false, false): ++ return kToolbarHeight; ++ } ++ } ++ ++ Future _saveCover({(CoverType, String?)? cover, String? icon}) { ++ final transaction = widget.editorState.transaction; ++ final Map attributes = { ++ DocumentHeaderBlockKeys.coverType: ++ widget.node.attributes[DocumentHeaderBlockKeys.coverType], ++ DocumentHeaderBlockKeys.coverDetails: ++ widget.node.attributes[DocumentHeaderBlockKeys.coverDetails], ++ DocumentHeaderBlockKeys.icon: ++ widget.node.attributes[DocumentHeaderBlockKeys.icon] ++ }; ++ if (cover != null) { ++ attributes[DocumentHeaderBlockKeys.coverType] = cover.$1.toString(); ++ attributes[DocumentHeaderBlockKeys.coverDetails] = cover.$2; ++ } ++ if (icon != null) { ++ attributes[DocumentHeaderBlockKeys.icon] = icon; ++ } ++ ++ transaction.updateNode(widget.node, attributes); ++ return widget.editorState.apply(transaction); ++ } ++} ++ ++@visibleForTesting ++class DocumentHeaderToolbar extends StatefulWidget { ++ final Node node; ++ final EditorState editorState; ++ final bool hasCover; ++ final bool hasIcon; ++ final Future Function({(CoverType, String?)? cover, String? icon}) ++ onCoverChanged; ++ ++ const DocumentHeaderToolbar({ ++ required this.node, ++ required this.editorState, ++ required this.hasCover, ++ required this.hasIcon, ++ required this.onCoverChanged, ++ super.key, ++ }); ++ ++ @override ++ State createState() => _DocumentHeaderToolbarState(); ++} ++ ++class _DocumentHeaderToolbarState extends State { ++ bool isHidden = true; ++ bool isPopoverOpen = false; ++ ++ final PopoverController _popoverController = PopoverController(); ++ ++ @override ++ Widget build(BuildContext context) { ++ return MouseRegion( ++ onEnter: (event) => setHidden(false), ++ onExit: (event) { ++ if (!isPopoverOpen) { ++ setHidden(true); ++ } ++ }, ++ opaque: false, ++ child: Container( ++ alignment: Alignment.bottomLeft, ++ width: double.infinity, ++ padding: const EdgeInsets.symmetric(horizontal: 80), ++ child: SizedBox( ++ height: 28, ++ child: Row( ++ crossAxisAlignment: CrossAxisAlignment.stretch, ++ children: buildRowChildren(), ++ ), ++ ), ++ ), ++ ); ++ } ++ ++ List buildRowChildren() { ++ if (isHidden || widget.hasCover && widget.hasIcon) { ++ return []; ++ } ++ final List children = []; ++ ++ if (!widget.hasCover) { ++ children.add( ++ FlowyButton( ++ leftIconSize: const Size.square(18), ++ onTap: () => widget.onCoverChanged( ++ cover: (CoverType.asset, builtInAssetImages.first), ++ ), ++ useIntrinsicWidth: true, ++ leftIcon: const FlowySvg(name: 'editor/image'), ++ text: FlowyText.regular( ++ LocaleKeys.document_plugins_cover_addCover.tr(), ++ ), ++ ), ++ ); ++ } ++ ++ if (widget.hasIcon) { ++ children.add( ++ FlowyButton( ++ leftIconSize: const Size.square(18), ++ onTap: () => widget.onCoverChanged(icon: """"), ++ useIntrinsicWidth: true, ++ leftIcon: const Icon( ++ Icons.emoji_emotions_outlined, ++ size: 18, ++ ), ++ text: FlowyText.regular( ++ LocaleKeys.document_plugins_cover_removeIcon.tr(), ++ ), ++ ), ++ ); ++ } else { ++ children.add( ++ AppFlowyPopover( ++ onClose: () => isPopoverOpen = false, ++ controller: _popoverController, ++ offset: const Offset(0, 8), ++ direction: PopoverDirection.bottomWithCenterAligned, ++ constraints: BoxConstraints.loose(const Size(320, 380)), ++ child: FlowyButton( ++ leftIconSize: const Size.square(18), ++ useIntrinsicWidth: true, ++ leftIcon: const Icon( ++ Icons.emoji_emotions_outlined, ++ size: 18, ++ ), ++ text: FlowyText.regular( ++ LocaleKeys.document_plugins_cover_addIcon.tr(), ++ ), ++ ), ++ popupBuilder: (BuildContext popoverContext) { ++ isPopoverOpen = true; ++ return EmojiPopover( ++ showRemoveButton: widget.hasIcon, ++ removeIcon: () { ++ widget.onCoverChanged(icon: """"); ++ _popoverController.close(); ++ }, ++ node: widget.node, ++ editorState: widget.editorState, ++ onEmojiChanged: (Emoji emoji) { ++ widget.onCoverChanged(icon: emoji.emoji); ++ _popoverController.close(); ++ }, ++ ); ++ }, ++ ), ++ ); ++ } ++ ++ return children; ++ } ++ ++ void setHidden(bool value) { ++ if (isHidden == value) return; ++ setState(() { ++ isHidden = value; ++ }); ++ } ++} ++ ++@visibleForTesting ++class DocumentCover extends StatefulWidget { ++ final Node node; ++ final EditorState editorState; ++ final CoverType coverType; ++ final String? coverDetails; ++ final Future Function(CoverType type, String? details) onCoverChanged; ++ ++ const DocumentCover({ ++ required this.editorState, ++ required this.node, ++ required this.coverType, ++ required this.onCoverChanged, ++ this.coverDetails, ++ super.key, ++ }); ++ ++ @override ++ State createState() => DocumentCoverState(); ++} ++ ++class DocumentCoverState extends State { ++ bool isOverlayButtonsHidden = true; ++ bool isPopoverOpen = false; ++ ++ @override ++ Widget build(BuildContext context) { ++ return SizedBox( ++ height: kCoverHeight, ++ child: MouseRegion( ++ onEnter: (event) => setOverlayButtonsHidden(false), ++ onExit: (event) => ++ setOverlayButtonsHidden(isPopoverOpen ? false : true), ++ child: Stack( ++ children: [ ++ SizedBox( ++ height: double.infinity, ++ width: double.infinity, ++ child: _buildCoverImage(), ++ ), ++ if (!isOverlayButtonsHidden) _buildCoverOverlayButtons(context) ++ ], ++ ), ++ ), ++ ); ++ } ++ ++ Widget _buildCoverImage() { ++ switch (widget.coverType) { ++ case CoverType.file: ++ final imageFile = File(widget.coverDetails ?? """"); ++ if (!imageFile.existsSync()) { ++ WidgetsBinding.instance.addPostFrameCallback((_) { ++ widget.onCoverChanged(CoverType.none, null); ++ }); ++ return const SizedBox.shrink(); ++ } ++ return Image.file( ++ imageFile, ++ fit: BoxFit.cover, ++ ); ++ case CoverType.asset: ++ return Image.asset( ++ widget.coverDetails!, ++ fit: BoxFit.cover, ++ ); ++ case CoverType.color: ++ final color = widget.coverDetails?.toColor() ?? Colors.white; ++ return Container(color: color); ++ case CoverType.none: ++ return const SizedBox.shrink(); ++ } ++ } ++ ++ Widget _buildCoverOverlayButtons(BuildContext context) { ++ return Positioned( ++ bottom: 20, ++ right: 50, ++ child: Row( ++ mainAxisSize: MainAxisSize.min, ++ children: [ ++ AppFlowyPopover( ++ offset: const Offset(0, 8), ++ direction: PopoverDirection.bottomWithCenterAligned, ++ constraints: BoxConstraints.loose(const Size(380, 450)), ++ margin: EdgeInsets.zero, ++ onClose: () => isPopoverOpen = false, ++ child: RoundedTextButton( ++ hoverColor: Theme.of(context).colorScheme.surface, ++ textColor: Theme.of(context).colorScheme.tertiary, ++ fillColor: Theme.of(context).colorScheme.surface.withOpacity(0.5), ++ width: 120, ++ height: 28, ++ title: LocaleKeys.document_plugins_cover_changeCover.tr(), ++ ), ++ popupBuilder: (BuildContext popoverContext) { ++ isPopoverOpen = true; ++ return ChangeCoverPopover( ++ node: widget.node, ++ editorState: widget.editorState, ++ onCoverChanged: (cover, selection) => ++ widget.onCoverChanged(cover, selection), ++ ); ++ }, ++ ), ++ const HSpace(10), ++ DeleteCoverButton( ++ onTap: () => widget.onCoverChanged(CoverType.none, null), ++ ), ++ ], ++ ), ++ ); ++ } ++ ++ void setOverlayButtonsHidden(bool value) { ++ if (isOverlayButtonsHidden == value) return; ++ setState(() { ++ isOverlayButtonsHidden = value; ++ }); ++ } ++} ++ ++@visibleForTesting ++class DeleteCoverButton extends StatelessWidget { ++ final VoidCallback onTap; ++ const DeleteCoverButton({required this.onTap, super.key}); ++ ++ @override ++ Widget build(BuildContext context) { ++ return FlowyIconButton( ++ hoverColor: Theme.of(context).colorScheme.surface, ++ fillColor: Theme.of(context).colorScheme.surface.withOpacity(0.5), ++ iconPadding: const EdgeInsets.all(5), ++ width: 28, ++ icon: svgWidget( ++ 'editor/delete', ++ color: Theme.of(context).colorScheme.tertiary, ++ ), ++ onPressed: onTap, ++ ); ++ } ++} ++ ++@visibleForTesting ++class DocumentIcon extends StatefulWidget { ++ final Node node; ++ final EditorState editorState; ++ final String icon; ++ final Future Function(String icon) onIconChanged; ++ ++ const DocumentIcon({ ++ required this.node, ++ required this.editorState, ++ required this.icon, ++ required this.onIconChanged, ++ super.key, ++ }); ++ ++ @override ++ State createState() => _DocumentIconState(); ++} ++ ++class _DocumentIconState extends State { ++ final PopoverController _popoverController = PopoverController(); ++ ++ @override ++ Widget build(BuildContext context) { ++ return AppFlowyPopover( ++ direction: PopoverDirection.bottomWithCenterAligned, ++ controller: _popoverController, ++ offset: const Offset(0, 8), ++ constraints: BoxConstraints.loose(const Size(320, 380)), ++ child: EmojiIconWidget(emoji: widget.icon), ++ popupBuilder: (BuildContext popoverContext) { ++ return EmojiPopover( ++ node: widget.node, ++ showRemoveButton: true, ++ removeIcon: () { ++ widget.onIconChanged(""""); ++ _popoverController.close(); ++ }, ++ editorState: widget.editorState, ++ onEmojiChanged: (Emoji emoji) { ++ widget.onIconChanged(emoji.emoji); ++ _popoverController.close(); ++ }, ++ ); ++ }, ++ ); ++ } ++} +diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/cover/emoji_icon_widget.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/emoji_icon_widget.dart +similarity index 87% +rename from frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/cover/emoji_icon_widget.dart +rename to frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/emoji_icon_widget.dart +index 2d3f3b5991063..1d1c99a26a571 100644 +--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/cover/emoji_icon_widget.dart ++++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/emoji_icon_widget.dart +@@ -5,12 +5,10 @@ class EmojiIconWidget extends StatefulWidget { + const EmojiIconWidget({ + super.key, + required this.emoji, +- this.size = 80, + this.emojiSize = 60, + }); + + final String emoji; +- final double size; + final double emojiSize; + + @override +@@ -25,12 +23,11 @@ class _EmojiIconWidgetState extends State { + return MouseRegion( + onEnter: (_) => setHidden(false), + onExit: (_) => setHidden(true), ++ cursor: SystemMouseCursors.click, + child: Container( +- height: widget.size, +- width: widget.size, + decoration: BoxDecoration( + color: !hover +- ? Theme.of(context).colorScheme.inverseSurface ++ ? Theme.of(context).colorScheme.inverseSurface.withOpacity(0.5) + : Colors.transparent, + borderRadius: BorderRadius.circular(8), + ), +diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/cover/emoji_popover.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/emoji_popover.dart +similarity index 50% +rename from frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/cover/emoji_popover.dart +rename to frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/emoji_popover.dart +index a58d89934da31..0216a8f56e49c 100644 +--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/cover/emoji_popover.dart ++++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/emoji_popover.dart +@@ -30,38 +30,35 @@ class EmojiPopover extends StatefulWidget { + class _EmojiPopoverState extends State { + @override + Widget build(BuildContext context) { +- return Padding( +- padding: const EdgeInsets.all(15), +- child: Column( +- children: [ +- if (widget.showRemoveButton) +- Padding( +- padding: const EdgeInsets.only(bottom: 4.0), +- child: Align( +- alignment: Alignment.centerRight, +- child: DeleteButton(onTap: widget.removeIcon), +- ), ++ return Column( ++ children: [ ++ if (widget.showRemoveButton) ++ Padding( ++ padding: const EdgeInsets.only(bottom: 4.0), ++ child: Align( ++ alignment: Alignment.centerRight, ++ child: DeleteButton(onTap: widget.removeIcon), + ), +- Expanded( +- child: EmojiPicker( +- onEmojiSelected: (category, emoji) { +- widget.onEmojiChanged(emoji); +- }, +- config: Config( +- columns: 8, +- emojiSizeMax: 28, +- bgColor: Colors.transparent, +- iconColor: Theme.of(context).iconTheme.color!, +- iconColorSelected: Theme.of(context).colorScheme.onSurface, +- selectedHoverColor: Theme.of(context).colorScheme.secondary, +- progressIndicatorColor: Theme.of(context).iconTheme.color!, +- buttonMode: ButtonMode.CUPERTINO, +- initCategory: Category.RECENT, +- ), ++ ), ++ Expanded( ++ child: EmojiPicker( ++ onEmojiSelected: (category, emoji) { ++ widget.onEmojiChanged(emoji); ++ }, ++ config: Config( ++ columns: 8, ++ emojiSizeMax: 28, ++ bgColor: Colors.transparent, ++ iconColor: Theme.of(context).iconTheme.color!, ++ iconColorSelected: Theme.of(context).colorScheme.onSurface, ++ selectedHoverColor: Theme.of(context).colorScheme.secondary, ++ progressIndicatorColor: Theme.of(context).iconTheme.color!, ++ buttonMode: ButtonMode.CUPERTINO, ++ initCategory: Category.RECENT, + ), + ), +- ], +- ), ++ ), ++ ], + ); + } + } +@@ -72,13 +69,16 @@ class DeleteButton extends StatelessWidget { + + @override + Widget build(BuildContext context) { +- return FlowyButton( +- onTap: onTap, +- useIntrinsicWidth: true, +- text: FlowyText( +- LocaleKeys.document_plugins_cover_removeIcon.tr(), ++ return SizedBox( ++ height: 28, ++ child: FlowyButton( ++ onTap: onTap, ++ useIntrinsicWidth: true, ++ text: FlowyText( ++ LocaleKeys.document_plugins_cover_removeIcon.tr(), ++ ), ++ leftIcon: const FlowySvg(name: 'editor/delete'), + ), +- leftIcon: const FlowySvg(name: 'editor/delete'), + ); + } + } +diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/plugins.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/plugins.dart +index 79267e2c32875..647ecdc032e09 100644 +--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/plugins.dart ++++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/plugins.dart +@@ -1,9 +1,9 @@ + export 'callout/callout_block_component.dart'; + export 'code_block/code_block_component.dart'; + export 'code_block/code_block_shortcut_event.dart'; +-export 'cover/change_cover_popover_bloc.dart'; +-export 'cover/cover_node_widget.dart'; +-export 'cover/cover_image_picker.dart'; ++export 'header/cover_editor_bloc.dart'; ++export 'header/document_header_node_widget.dart'; ++export 'header/custom_cover_picker.dart'; + export 'emoji_picker/emoji_menu_item.dart'; + export 'extensions/flowy_tint_extension.dart'; + export 'database/inline_database_menu_item.dart'; +diff --git a/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/icon_button.dart b/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/icon_button.dart +index c8d089799eecf..a0083df0e9aee 100644 +--- a/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/icon_button.dart ++++ b/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/icon_button.dart +@@ -81,7 +81,7 @@ class FlowyIconButton extends StatelessWidget { + hoverColor: hoverColor, + foregroundColorOnHover: + iconColorOnHover ?? Theme.of(context).iconTheme.color, +- backgroundColor: fillColor ?? Colors.transparent, ++ backgroundColor: Colors.transparent, + ), + child: Padding( + padding: iconPadding," +ToolJet,https://github.com/ToolJet/ToolJet,6e249bc54079e711da98cae8ef137fa216c729b6,Surendran,2023-06-15 13:32:33,fix: Added onKeyDown function for input field (#6699),"* Added onKeyDown function for input field + +* Updated CreateOrganization.jsx","fix: Added onKeyDown function for input field (#6699) + +* Added onKeyDown function for input field + +* Updated CreateOrganization.jsx","diff --git a/frontend/src/_components/OrganizationManager/CreateOrganization.jsx b/frontend/src/_components/OrganizationManager/CreateOrganization.jsx +index 7a2f91709b..adfd77ef71 100644 +--- a/frontend/src/_components/OrganizationManager/CreateOrganization.jsx ++++ b/frontend/src/_components/OrganizationManager/CreateOrganization.jsx +@@ -35,6 +35,13 @@ export const CreateOrganization = ({ showCreateOrg, setShowCreateOrg }) => { + } + }; + ++ const handleKeyDown = (e) => { ++ if (e.keyCode === 13) { ++ e.preventDefault(); ++ createOrganization(); ++ } ++ }; ++ + const handleInputChange = (e) => { + const value = e.target.value; + setErrorText(''); +@@ -62,6 +69,7 @@ export const CreateOrganization = ({ showCreateOrg, setShowCreateOrg }) => { + 0 { ++ return nil, status.Errorf(codes.FailedPrecondition, ""branch %q has child branches, please delete them first"", branchID) ++ } ++ } ++ + if err := s.store.DeleteBranch(ctx, project.ResourceID, branch.ResourceID); err != nil { + return nil, status.Errorf(codes.Internal, ""failed to delete branch, error %v"", err) + } +diff --git a/backend/store/branch.go b/backend/store/branch.go +index 4ac8379ebe6444..e91b5419c0f9dd 100644 +--- a/backend/store/branch.go ++++ b/backend/store/branch.go +@@ -39,6 +39,8 @@ type FindBranchMessage struct { + ResourceID *string + UID *int + LoadFull bool ++ ++ ParentBranchResourceID *string + } + + // UpdateBranchMessage is the message to update a branch. +@@ -86,6 +88,9 @@ func (s *Store) ListBranches(ctx context.Context, find *FindBranchMessage) ([]*B + if v := find.UID; v != nil { + where, args = append(where, fmt.Sprintf(""branch.id = $%d"", len(args)+1)), append(args, *v) + } ++ if v := find.ParentBranchResourceID; v != nil { ++ where, args = append(where, fmt.Sprintf(""branch.config->>'sourceBranch' = $%d"", len(args)+1)), append(args, *v) ++ } + + tx, err := s.db.BeginTx(ctx, &sql.TxOptions{ReadOnly: true}) + if err != nil { +diff --git a/frontend/src/store/modules/branch.ts b/frontend/src/store/modules/branch.ts +index fc66f5a62162ac..0523a966884f09 100644 +--- a/frontend/src/store/modules/branch.ts ++++ b/frontend/src/store/modules/branch.ts +@@ -105,6 +105,7 @@ export const useBranchStore = defineStore(""schema_design"", () => { + const deleteBranch = async (name: string) => { + await branchServiceClient.deleteBranch({ + name, ++ force: true, + }); + branchMapByName.delete(name); + };" +RSSHub,https://github.com/DIYgod/RSSHub,106341f4e62860642739207da9690a60dbbad559,dependabot[bot],2022-08-17 02:38:11,chore(deps): bump puppeteer from 16.1.0 to 16.1.1 (#10502),"Bumps [puppeteer](https://github.com/puppeteer/puppeteer) from 16.1.0 to 16.1.1. +- [Release notes](https://github.com/puppeteer/puppeteer/releases) +- [Changelog](https://github.com/puppeteer/puppeteer/blob/main/CHANGELOG.md) +- [Commits](https://github.com/puppeteer/puppeteer/compare/v16.1.0...v16.1.1) + +---","chore(deps): bump puppeteer from 16.1.0 to 16.1.1 (#10502) + +Bumps [puppeteer](https://github.com/puppeteer/puppeteer) from 16.1.0 to 16.1.1. +- [Release notes](https://github.com/puppeteer/puppeteer/releases) +- [Changelog](https://github.com/puppeteer/puppeteer/blob/main/CHANGELOG.md) +- [Commits](https://github.com/puppeteer/puppeteer/compare/v16.1.0...v16.1.1) + +--- +updated-dependencies: +- dependency-name: puppeteer + dependency-type: direct:production + update-type: version-update:semver-patch +... + +Signed-off-by: dependabot[bot] + +Signed-off-by: dependabot[bot] +Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>","diff --git a/package.json b/package.json +index 46df0a33908f04..8cba7826d9be79 100644 +--- a/package.json ++++ b/package.json +@@ -118,7 +118,7 @@ + ""parse-torrent"": ""9.1.5"", + ""pidusage"": ""3.0.0"", + ""plist"": ""3.0.6"", +- ""puppeteer"": ""16.1.0"", ++ ""puppeteer"": ""16.1.1"", + ""puppeteer-extra"": ""3.3.4"", + ""puppeteer-extra-plugin-stealth"": ""2.11.1"", + ""query-string"": ""7.1.1"", +diff --git a/yarn.lock b/yarn.lock +index ed7a4b0aa8c4c0..1fc0df53b7b596 100644 +--- a/yarn.lock ++++ b/yarn.lock +@@ -11559,10 +11559,10 @@ puppeteer-extra@3.3.4: + debug ""^4.1.1"" + deepmerge ""^4.2.2"" + +-puppeteer@16.1.0: +- version ""16.1.0"" +- resolved ""https://registry.yarnpkg.com/puppeteer/-/puppeteer-16.1.0.tgz#06a32dc347c94642601017fbf83e1d37379b9651"" +- integrity sha512-lhykJLbH2bbBaP3NfYI2Vj0T4ctrdfVdEVf8glZITPnLfqrJ0nfUzAYuIz5YcA79k5lmFKANIhEXex+jQChU3g== ++puppeteer@16.1.1: ++ version ""16.1.1"" ++ resolved ""https://registry.yarnpkg.com/puppeteer/-/puppeteer-16.1.1.tgz#1bb8ec3b86f755c34b913421b81e9cd2cfad3588"" ++ integrity sha512-lBneizsNF0zi1/iog9c0ogVnvDHJG4IWpkdIAgE2oiDKhr0MJRV8JeM2xbhUwCwhDJXjjVS2TNCZdLsMp9Ojdg== + dependencies: + cross-fetch ""3.1.5"" + debug ""4.3.4""" +hyper,https://github.com/hyperium/hyper,7d9a5806e146798d0cbe67672bbe3ad5ae680393,Ben Noordhuis,2020-12-15 03:27:32,refactor(http1): change HTTP2->1.1 warning to debug (#2354),"We use hyper in a proxy-like way where an incoming HTTP/2 request is +proxied to a HTTP/1 backend and it was reported that the protocol +coercion warnings were a limiting factor in the total throughput +of the system. + +While it can be worked around by explicitly setting the request version +to HTTP_11, it seems likely other people also hit this performance snag. +That's why this commit changes them from warnings to debug messages.","refactor(http1): change HTTP2->1.1 warning to debug (#2354) + +We use hyper in a proxy-like way where an incoming HTTP/2 request is +proxied to a HTTP/1 backend and it was reported that the protocol +coercion warnings were a limiting factor in the total throughput +of the system. + +While it can be worked around by explicitly setting the request version +to HTTP_11, it seems likely other people also hit this performance snag. +That's why this commit changes them from warnings to debug messages.","diff --git a/src/proto/h1/role.rs b/src/proto/h1/role.rs +index ad34d2f063..bfd5f8c75c 100644 +--- a/src/proto/h1/role.rs ++++ b/src/proto/h1/role.rs +@@ -333,7 +333,7 @@ impl Http1Transaction for Server { + Version::HTTP_10 => extend(dst, b""HTTP/1.0 ""), + Version::HTTP_11 => extend(dst, b""HTTP/1.1 ""), + Version::HTTP_2 => { +- warn!(""response with HTTP2 version coerced to HTTP/1.1""); ++ debug!(""response with HTTP2 version coerced to HTTP/1.1""); + extend(dst, b""HTTP/1.1 ""); + } + other => panic!(""unexpected response version: {:?}"", other), +@@ -757,7 +757,7 @@ impl Http1Transaction for Client { + Version::HTTP_10 => extend(dst, b""HTTP/1.0""), + Version::HTTP_11 => extend(dst, b""HTTP/1.1""), + Version::HTTP_2 => { +- warn!(""request with HTTP2 version coerced to HTTP/1.1""); ++ debug!(""request with HTTP2 version coerced to HTTP/1.1""); + extend(dst, b""HTTP/1.1""); + } + other => panic!(""unexpected request version: {:?}"", other)," +lima,https://github.com/lima-vm/lima,88f50ecfe9c4696744276a011e661ab4d78be26c,dependabot[bot],2024-04-18 06:49:27,build(deps): bump github.com/miekg/dns from 1.1.58 to 1.1.59,"Bumps [github.com/miekg/dns](https://github.com/miekg/dns) from 1.1.58 to 1.1.59. +- [Changelog](https://github.com/miekg/dns/blob/master/Makefile.release) +- [Commits](https://github.com/miekg/dns/compare/v1.1.58...v1.1.59) + +---","build(deps): bump github.com/miekg/dns from 1.1.58 to 1.1.59 + +Bumps [github.com/miekg/dns](https://github.com/miekg/dns) from 1.1.58 to 1.1.59. +- [Changelog](https://github.com/miekg/dns/blob/master/Makefile.release) +- [Commits](https://github.com/miekg/dns/compare/v1.1.58...v1.1.59) + +--- +updated-dependencies: +- dependency-name: github.com/miekg/dns + dependency-type: direct:production + update-type: version-update:semver-patch +... + +Signed-off-by: dependabot[bot] ","diff --git a/go.mod b/go.mod +index 31d3dfe859b0..078be87fb9ae 100644 +--- a/go.mod ++++ b/go.mod +@@ -28,7 +28,7 @@ require ( + github.com/mattn/go-isatty v0.0.20 + github.com/mattn/go-shellwords v1.0.12 + github.com/mdlayher/vsock v1.2.1 +- github.com/miekg/dns v1.1.58 ++ github.com/miekg/dns v1.1.59 + github.com/mikefarah/yq/v4 v4.43.1 + github.com/nxadm/tail v1.4.11 + github.com/opencontainers/go-digest v1.0.0 +@@ -107,11 +107,11 @@ require ( + go.uber.org/atomic v1.7.0 // indirect + go.uber.org/multierr v1.7.0 // indirect + golang.org/x/crypto v0.22.0 // indirect +- golang.org/x/mod v0.14.0 // indirect ++ golang.org/x/mod v0.16.0 // indirect + golang.org/x/oauth2 v0.17.0 // indirect + golang.org/x/term v0.19.0 // indirect + golang.org/x/time v0.3.0 // indirect +- golang.org/x/tools v0.17.0 // indirect ++ golang.org/x/tools v0.19.0 // indirect + golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect + google.golang.org/appengine v1.6.8 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect +diff --git a/go.sum b/go.sum +index 771e8583abce..6c311cb778e2 100644 +--- a/go.sum ++++ b/go.sum +@@ -198,8 +198,8 @@ github.com/mdlayher/vsock v1.2.1/go.mod h1:NRfCibel++DgeMD8z/hP+PPTjlNJsdPOmxcnE + github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4= + github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= + github.com/miekg/dns v1.1.57/go.mod h1:uqRjCRUuEAA6qsOiJvDd+CFo/vW+y5WR6SNmHE55hZk= +-github.com/miekg/dns v1.1.58 h1:ca2Hdkz+cDg/7eNF6V56jjzuZ4aCAE+DbVkILdQWG/4= +-github.com/miekg/dns v1.1.58/go.mod h1:Ypv+3b/KadlvW9vJfXOTf300O4UqaHFzFCuHz+rPkBY= ++github.com/miekg/dns v1.1.59 h1:C9EXc/UToRwKLhK5wKU/I4QVsBUc8kE6MkHBkeypWZs= ++github.com/miekg/dns v1.1.59/go.mod h1:nZpewl5p6IvctfgrckopVx2OlSEHPRO/U4SYkRklrEk= + github.com/mikefarah/yq/v4 v4.43.1 h1:1bCrQwVDhjGnPboQidy30hu6U2TCd8sUQTy1hKCHOGI= + github.com/mikefarah/yq/v4 v4.43.1/go.mod h1:jcSqtyUKbPWvwaa8cNw8Ej4rmPb3iWE8zYvpkTvM7oc= + github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +@@ -297,8 +297,9 @@ golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= + golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= + golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= + golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +-golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= + golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= ++golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= ++golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= + golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= + golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= + golang.org/x/net v0.0.0-20190419010253-1f3472d942ba/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +@@ -408,8 +409,8 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc + golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= + golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= + golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk= +-golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= +-golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= ++golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= ++golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= + golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= + golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= + golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=" +electron-react-boilerplate,https://github.com/electron-react-boilerplate/electron-react-boilerplate,8aa6ff54cf9127e17c6956b54ab2d237096ec383,Snyk bot,2022-03-16 09:16:48,fix: upgrade history from 5.2.0 to 5.3.0 (#3166),"Snyk has created this PR to upgrade history from 5.2.0 to 5.3.0. + +See this package in npm:","fix: upgrade history from 5.2.0 to 5.3.0 (#3166) + +Snyk has created this PR to upgrade history from 5.2.0 to 5.3.0. + +See this package in npm: +https://www.npmjs.com/package/history + +See this project in Snyk: +https://app.snyk.io/org/amilajack/project/0589cba3-8c84-471b-b332-8826f7ce5730?utm_source=github&utm_medium=referral&page=upgrade-pr","diff --git a/package-lock.json b/package-lock.json +index 932edd4a69..083230d9a3 100644 +--- a/package-lock.json ++++ b/package-lock.json +@@ -11,7 +11,7 @@ + ""electron-debug"": ""^3.2.0"", + ""electron-log"": ""^4.4.6"", + ""electron-updater"": ""^4.6.5"", +- ""history"": ""^5.2.0"", ++ ""history"": ""^5.3.0"", + ""react"": ""^17.0.2"", + ""react-dom"": ""^17.0.2"", + ""react-router-dom"": ""^6.2.1"" +@@ -9056,9 +9056,9 @@ + } + }, + ""node_modules/history"": { +- ""version"": ""5.2.0"", +- ""resolved"": ""https://registry.npmjs.org/history/-/history-5.2.0.tgz"", +- ""integrity"": ""sha512-uPSF6lAJb3nSePJ43hN3eKj1dTWpN9gMod0ZssbFTIsen+WehTmEadgL+kg78xLJFdRfrrC//SavDzmRVdE+Ig=="", ++ ""version"": ""5.3.0"", ++ ""resolved"": ""https://registry.npmjs.org/history/-/history-5.3.0.tgz"", ++ ""integrity"": ""sha512-ZqaKwjjrAYUYfLG+htGaIIZ4nioX2L70ZUMIFysS3xvBsSG4x/n1V6TXV3N8ZYNuFGlDirFg32T7B6WOUPDYcQ=="", + ""dependencies"": { + ""@babel/runtime"": ""^7.7.6"" + } +@@ -23796,9 +23796,9 @@ + ""dev"": true + }, + ""history"": { +- ""version"": ""5.2.0"", +- ""resolved"": ""https://registry.npmjs.org/history/-/history-5.2.0.tgz"", +- ""integrity"": ""sha512-uPSF6lAJb3nSePJ43hN3eKj1dTWpN9gMod0ZssbFTIsen+WehTmEadgL+kg78xLJFdRfrrC//SavDzmRVdE+Ig=="", ++ ""version"": ""5.3.0"", ++ ""resolved"": ""https://registry.npmjs.org/history/-/history-5.3.0.tgz"", ++ ""integrity"": ""sha512-ZqaKwjjrAYUYfLG+htGaIIZ4nioX2L70ZUMIFysS3xvBsSG4x/n1V6TXV3N8ZYNuFGlDirFg32T7B6WOUPDYcQ=="", + ""requires"": { + ""@babel/runtime"": ""^7.7.6"" + } +diff --git a/package.json b/package.json +index f881ace4f9..f69ea27372 100644 +--- a/package.json ++++ b/package.json +@@ -229,7 +229,7 @@ + ""electron-debug"": ""^3.2.0"", + ""electron-log"": ""^4.4.6"", + ""electron-updater"": ""^4.6.5"", +- ""history"": ""^5.2.0"", ++ ""history"": ""^5.3.0"", + ""react"": ""^17.0.2"", + ""react-dom"": ""^17.0.2"", + ""react-router-dom"": ""^6.2.1""" +coder,https://github.com/coder/coder,e5cc17af92ac11de2a3c9feb52f7592c47de8c17,Ammar Bandukwala,2024-03-18 19:39:26,chore(cli): hide --organization (#12626),It's potentially confusing to users since we aren't fleshing out organizations right now.,"chore(cli): hide --organization (#12626) + +It's potentially confusing to users since we aren't fleshing out organizations right now.","diff --git a/cli/root.go b/cli/root.go +index 27330c856fd4b..a5c77417bf335 100644 +--- a/cli/root.go ++++ b/cli/root.go +@@ -447,6 +447,7 @@ func (r *RootCmd) Command(subcommands []*serpent.Command) (*serpent.Command, err + Env: ""CODER_ORGANIZATION"", + Description: ""Select which organization (uuid or name) to use This overrides what is present in the config file."", + Value: serpent.StringOf(&r.organizationSelect), ++ Hidden: true, + Group: globalGroup, + }, + { +diff --git a/cli/testdata/coder_--help.golden b/cli/testdata/coder_--help.golden +index fc0785ee92814..501a336915128 100644 +--- a/cli/testdata/coder_--help.golden ++++ b/cli/testdata/coder_--help.golden +@@ -82,10 +82,6 @@ variables or flags. + --no-version-warning bool, $CODER_NO_VERSION_WARNING + Suppress warning when client and server versions do not match. + +- -z, --organization string, $CODER_ORGANIZATION +- Select which organization (uuid or name) to use This overrides what is +- present in the config file. +- + --token string, $CODER_SESSION_TOKEN + Specify an authentication token. For security reasons setting + CODER_SESSION_TOKEN is preferred. +diff --git a/docs/cli.md b/docs/cli.md +index 96d0fc635852c..93236d5c5e3a4 100644 +--- a/docs/cli.md ++++ b/docs/cli.md +@@ -157,13 +157,3 @@ Disable direct (P2P) connections to workspaces. + | Default | ~/.config/coderv2 | + + Path to the global `coder` config directory. +- +-### -z, --organization +- +-| | | +-| ----------- | -------------------------------- | +-| Type | string | +-| Environment | $CODER_ORGANIZATION | +- +-Select which organization (uuid or name) to use This overrides what is present +-in the config file. +diff --git a/enterprise/cli/testdata/coder_--help.golden b/enterprise/cli/testdata/coder_--help.golden +index c8612392972f0..7c2ff5c835dff 100644 +--- a/enterprise/cli/testdata/coder_--help.golden ++++ b/enterprise/cli/testdata/coder_--help.golden +@@ -48,10 +48,6 @@ variables or flags. + --no-version-warning bool, $CODER_NO_VERSION_WARNING + Suppress warning when client and server versions do not match. + +- -z, --organization string, $CODER_ORGANIZATION +- Select which organization (uuid or name) to use This overrides what is +- present in the config file. +- + --token string, $CODER_SESSION_TOKEN + Specify an authentication token. For security reasons setting + CODER_SESSION_TOKEN is preferred." +oxc,https://github.com/oxc-project/oxc,618e89ecf72b50bc1730c92bc9e8a654a23ded83,overlookmotel,2024-09-23 13:22:44,perf(transformer): arrow function transform: reduce stack memory usage (#5940),"Arrow function transform maintains a stack for blocks which may (or may not) need a `var _this = this;` statement added to them. + +This stack was `Vec>` (24 bytes per block). Most blocks won't need a statement added, so most entries are `None`. + +Introduce an abstraction `SparseStack`. This stores the stack split into 2 arrays. First array is `Vec` indicating if a statement needs to be added or not. Only if a statement *does* need to be added, then its details are pushed to a separate array `Vec`. + +This means the memory taken up by the stack will be roughly 1 byte per block, instead of 24 bytes per block (assuming very few blocks need statements added).","perf(transformer): arrow function transform: reduce stack memory usage (#5940) + +Arrow function transform maintains a stack for blocks which may (or may not) need a `var _this = this;` statement added to them. + +This stack was `Vec>` (24 bytes per block). Most blocks won't need a statement added, so most entries are `None`. + +Introduce an abstraction `SparseStack`. This stores the stack split into 2 arrays. First array is `Vec` indicating if a statement needs to be added or not. Only if a statement *does* need to be added, then its details are pushed to a separate array `Vec`. + +This means the memory taken up by the stack will be roughly 1 byte per block, instead of 24 bytes per block (assuming very few blocks need statements added).","diff --git a/crates/oxc_transformer/src/es2015/arrow_functions.rs b/crates/oxc_transformer/src/es2015/arrow_functions.rs +index 010723e29a486..4489dc263527e 100644 +--- a/crates/oxc_transformer/src/es2015/arrow_functions.rs ++++ b/crates/oxc_transformer/src/es2015/arrow_functions.rs +@@ -82,7 +82,10 @@ use oxc_syntax::{ + use oxc_traverse::{Ancestor, Traverse, TraverseCtx}; + use serde::Deserialize; + +-use crate::{context::Ctx, helpers::bindings::BoundIdentifier}; ++use crate::{ ++ context::Ctx, ++ helpers::{bindings::BoundIdentifier, stack::SparseStack}, ++}; + + #[derive(Debug, Default, Clone, Deserialize)] + pub struct ArrowFunctionsOptions { +@@ -97,17 +100,16 @@ pub struct ArrowFunctionsOptions { + pub struct ArrowFunctions<'a> { + ctx: Ctx<'a>, + _options: ArrowFunctionsOptions, +- this_var_stack: std::vec::Vec>>, ++ this_var_stack: SparseStack>, + } + + impl<'a> ArrowFunctions<'a> { + pub fn new(options: ArrowFunctionsOptions, ctx: Ctx<'a>) -> Self { +- Self { +- ctx, +- _options: options, +- // Initial entry for `Program` scope +- this_var_stack: vec![None], +- } ++ // Init stack with empty entry for `Program` (instead of pushing entry in `enter_program`) ++ let mut this_var_stack = SparseStack::new(); ++ this_var_stack.push(None); ++ ++ Self { ctx, _options: options, this_var_stack } + } + } + +@@ -118,10 +120,10 @@ impl<'a> Traverse<'a> for ArrowFunctions<'a> { + /// Insert `var _this = this;` for the global scope. + fn exit_program(&mut self, program: &mut Program<'a>, _ctx: &mut TraverseCtx<'a>) { + assert!(self.this_var_stack.len() == 1); +- let this_var = self.this_var_stack.pop().unwrap(); +- if let Some(this_var) = this_var { ++ if let Some(this_var) = self.this_var_stack.take() { + self.insert_this_var_statement_at_the_top_of_statements(&mut program.body, &this_var); + } ++ debug_assert!(self.this_var_stack.len() == 1); + } + + fn enter_function(&mut self, _func: &mut Function<'a>, _ctx: &mut TraverseCtx<'a>) { +@@ -140,8 +142,7 @@ impl<'a> Traverse<'a> for ArrowFunctions<'a> { + /// ``` + /// Insert the var _this = this; statement outside the arrow function + fn exit_function(&mut self, func: &mut Function<'a>, _ctx: &mut TraverseCtx<'a>) { +- let this_var = self.this_var_stack.pop().unwrap(); +- if let Some(this_var) = this_var { ++ if let Some(this_var) = self.this_var_stack.pop() { + let Some(body) = &mut func.body else { unreachable!() }; + + self.insert_this_var_statement_at_the_top_of_statements( +@@ -156,8 +157,7 @@ impl<'a> Traverse<'a> for ArrowFunctions<'a> { + } + + fn exit_static_block(&mut self, block: &mut StaticBlock<'a>, _ctx: &mut TraverseCtx<'a>) { +- let this_var = self.this_var_stack.pop().unwrap(); +- if let Some(this_var) = this_var { ++ if let Some(this_var) = self.this_var_stack.pop() { + self.insert_this_var_statement_at_the_top_of_statements(&mut block.body, &this_var); + } + } +@@ -221,8 +221,7 @@ impl<'a> ArrowFunctions<'a> { + // `this` can be in scope at a time. We could create a single `_this` UID and reuse it in each + // scope. But this does not match output for some of Babel's test cases. + // +- let this_var = self.this_var_stack.last_mut().unwrap(); +- if this_var.is_none() { ++ let this_var = self.this_var_stack.get_or_init(|| { + let target_scope_id = ctx + .scopes() + .ancestors(arrow_scope_id) +@@ -236,14 +235,13 @@ impl<'a> ArrowFunctions<'a> { + }) + .unwrap(); + +- this_var.replace(BoundIdentifier::new_uid( ++ BoundIdentifier::new_uid( + ""this"", + target_scope_id, + SymbolFlags::FunctionScopedVariable, + ctx, +- )); +- } +- let this_var = this_var.as_ref().unwrap(); ++ ) ++ }); + Some(this_var.create_spanned_read_reference(span, ctx)) + } + +diff --git a/crates/oxc_transformer/src/helpers/stack.rs b/crates/oxc_transformer/src/helpers/stack.rs +new file mode 100644 +index 0000000000000..53ca9b039398c +--- /dev/null ++++ b/crates/oxc_transformer/src/helpers/stack.rs +@@ -0,0 +1,115 @@ ++/// Stack which is sparsely filled. ++/// ++/// Functionally equivalent to a stack implemented as `Vec>`, but more memory-efficient ++/// in cases where majority of entries in the stack will be empty (`None`). ++/// ++/// The stack is stored as 2 arrays: ++/// 1. `has_values` - Records whether an entry on the stack has a value or not (`Some` or `None`). ++/// 2. `values` - Where the stack entry *does* have a value, it's stored in this array. ++/// ++/// Memory is only consumed for values where values exist. ++/// ++/// Where value (`T`) is large, and most entries have no value, this will be a significant memory saving. ++/// ++/// e.g. if `T` is 24 bytes, and 90% of stack entries have no values: ++/// * `Vec>` is 24 bytes per entry (or 32 bytes if `T` has no niche). ++/// * `SparseStack` is 4 bytes per entry. ++/// ++/// When the stack grows and reallocates, `SparseStack` has less memory to copy, which is a performance ++/// win too. ++pub struct SparseStack { ++ has_values: Vec, ++ values: Vec, ++} ++ ++impl SparseStack { ++ /// Create new `SparseStack`. ++ pub fn new() -> Self { ++ Self { has_values: vec![], values: vec![] } ++ } ++ ++ /// Push an entry to the stack. ++ #[inline] ++ pub fn push(&mut self, value: Option) { ++ let has_value = if let Some(value) = value { ++ self.values.push(value); ++ true ++ } else { ++ false ++ }; ++ self.has_values.push(has_value); ++ } ++ ++ /// Pop last entry from the stack. ++ /// ++ /// # Panics ++ /// Panics if the stack is empty. ++ pub fn pop(&mut self) -> Option { ++ let has_value = self.has_values.pop().unwrap(); ++ if has_value { ++ debug_assert!(!self.values.is_empty()); ++ // SAFETY: Last `self.has_values` is only `true` if there's a corresponding value in `self.values`. ++ // This invariant is maintained in `push`, `take`, and `get_or_init`. ++ // We maintain it here too because we just popped from `self.has_values`, so that `true` ++ // has been consumed at the same time we consume its corresponding value from `self.values`. ++ let value = unsafe { self.values.pop().unwrap_unchecked() }; ++ Some(value) ++ } else { ++ None ++ } ++ } ++ ++ /// Take value from last entry on the stack. ++ /// ++ /// # Panics ++ /// Panics if the stack is empty. ++ pub fn take(&mut self) -> Option { ++ let has_value = self.has_values.last_mut().unwrap(); ++ if *has_value { ++ *has_value = false; ++ ++ debug_assert!(!self.values.is_empty()); ++ // SAFETY: Last `self.has_values` is only `true` if there's a corresponding value in `self.values`. ++ // This invariant is maintained in `push`, `pop`, and `get_or_init`. ++ // We maintain it here too because we just set last `self.has_values` to `false` ++ // at the same time as we consume the corresponding value from `self.values`. ++ let value = unsafe { self.values.pop().unwrap_unchecked() }; ++ Some(value) ++ } else { ++ None ++ } ++ } ++ ++ /// Initialize the value for top entry on the stack, if it has no value already. ++ /// Return reference to value. ++ /// ++ /// # Panics ++ /// Panics if the stack is empty. ++ pub fn get_or_init T>(&mut self, init: I) -> &T { ++ let has_value = self.has_values.last_mut().unwrap(); ++ if !*has_value { ++ *has_value = true; ++ self.values.push(init()); ++ } ++ ++ debug_assert!(!self.values.is_empty()); ++ // SAFETY: Last `self.has_values` is only `true` if there's a corresponding value in `self.values`. ++ // This invariant is maintained in `push`, `pop`, and `take`. ++ // Here either last `self.has_values` was already `true`, or it's just been set to `true` ++ // and a value pushed to `self.values` above. ++ unsafe { self.values.last().unwrap_unchecked() } ++ } ++ ++ /// Get number of entries on the stack. ++ #[inline] ++ pub fn len(&self) -> usize { ++ self.has_values.len() ++ } ++ ++ /// Returns `true` if stack is empty. ++ #[inline] ++ #[expect(dead_code)] ++ pub fn is_empty(&self) -> bool { ++ self.has_values.is_empty() ++ } ++} +diff --git a/crates/oxc_transformer/src/lib.rs b/crates/oxc_transformer/src/lib.rs +index 6f191a6efaad9..f995ae719c6f0 100644 +--- a/crates/oxc_transformer/src/lib.rs ++++ b/crates/oxc_transformer/src/lib.rs +@@ -27,6 +27,7 @@ mod typescript; + mod helpers { + pub mod bindings; + pub mod module_imports; ++ pub mod stack; + } + + use std::{path::Path, rc::Rc};" +core,https://github.com/adonisjs/core,a3a4397af0d954568bda22d7fed9048d09b83585,Harminder Virk,2016-08-05 18:32:21,refactor(env): remove event provider dep from env,env provider cannot inject event provider due to backward compatibility,"refactor(env): remove event provider dep from env + +env provider cannot inject event provider due to backward compatibility","diff --git a/providers/EnvProvider.js b/providers/EnvProvider.js +index deb91a49..b6f54f2f 100644 +--- a/providers/EnvProvider.js ++++ b/providers/EnvProvider.js +@@ -14,8 +14,7 @@ class EnvProvider extends ServiceProvider { + this.app.singleton('Adonis/Src/Env', function (app) { + const Env = require('../src/Env') + const Helpers = app.use('Adonis/Src/Helpers') +- const Event = app.use('Adonis/Src/Event') +- return new Env(Helpers, Event) ++ return new Env(Helpers) + }) + } + } +diff --git a/src/Env/index.js b/src/Env/index.js +index 7420e987..db251ae6 100644 +--- a/src/Env/index.js ++++ b/src/Env/index.js +@@ -20,7 +20,7 @@ const util = require('../../lib/util') + */ + class Env { + +- constructor (Helpers, Event) { ++ constructor (Helpers) { + const envLocation = this.envPath() + const options = { + path: path.isAbsolute(envLocation) ? envLocation : path.join(Helpers.basePath(), envLocation), +@@ -28,7 +28,6 @@ class Env { + encoding: process.env.ENV_ENCODING || 'utf8' + } + dotenv.load(options) +- Event.fire('env:loaded') + } + + /** +diff --git a/test/functional/providers.spec.js b/test/functional/providers.spec.js +index b5793a78..a8715e60 100644 +--- a/test/functional/providers.spec.js ++++ b/test/functional/providers.spec.js +@@ -66,18 +66,13 @@ describe('Providers', function () { + }) + + context('Env', function () { +- it('should inject Helpers and Event providers', function () { ++ it('should inject Helpers provider', function () { + const Helpers = Ioc.use('Adonis/Src/Helpers') +- const Event = Ioc.use('Adonis/Src/Event') + sinon.spy(Helpers, 'basePath') +- sinon.spy(Event, 'fire') + const Env = require('../../src/Env') + const env = Ioc.use('Adonis/Src/Env') + expect(env).to.be.an.instanceof(Env) + expect(Helpers.basePath.calledOnce).to.equal(true) +- expect(Event.fire.calledOnce).to.equal(true) +- expect(Event.fire.calledWith('env:loaded')).to.equal(true) +- Event.fire.restore() + Helpers.basePath.restore() + }) + }) +diff --git a/test/unit/env.spec.js b/test/unit/env.spec.js +index 0a3379e1..d6799b9e 100644 +--- a/test/unit/env.spec.js ++++ b/test/unit/env.spec.js +@@ -53,18 +53,6 @@ describe('Env', function () { + expect(env.get('APP_PORT')).to.equal('3000') + }) + +- it('should fire an event when able to load .env file', function () { +- let eventName = null +- class Event { +- static fire (name) { +- eventName = name +- } +- } +- /*eslint-disable no-new*/ +- new Env(Helpers, Event) +- expect(eventName).to.equal('env:loaded') +- }) +- + it('should return default value when it does exists in .env file', function () { + const env = new Env(Helpers, Event) + expect(env.get('APP_KEY', 'foo')).to.equal('foo')" +deno,https://github.com/denoland/deno,0dcaea72aeec52a566764b41b10d8fd1854d6fa4,Yoshiya Hinosawa,2020-10-13 19:01:59,"feat: add alert, confirm, and prompt (#7507)","This commit adds ""alert"", ""confirm"" and ""prompt"" functions from web standards.","feat: add alert, confirm, and prompt (#7507) + +This commit adds ""alert"", ""confirm"" and ""prompt"" functions from web standards.","diff --git a/cli/dts/lib.deno.window.d.ts b/cli/dts/lib.deno.window.d.ts +index 03341636f30456..541eee370e60b4 100644 +--- a/cli/dts/lib.deno.window.d.ts ++++ b/cli/dts/lib.deno.window.d.ts +@@ -15,6 +15,9 @@ declare class Window extends EventTarget { + onunload: ((this: Window, ev: Event) => any) | null; + close: () => void; + readonly closed: boolean; ++ alert: (message?: string) => void; ++ confirm: (message?: string) => boolean; ++ prompt: (message?: string, defaultValue?: string) => string | null; + Deno: typeof Deno; + } + +@@ -23,4 +26,30 @@ declare var self: Window & typeof globalThis; + declare var onload: ((this: Window, ev: Event) => any) | null; + declare var onunload: ((this: Window, ev: Event) => any) | null; + ++/** ++ * Shows the given message and waits for the enter key pressed. ++ * If the stdin is not interactive, it does nothing. ++ * @param message ++ */ ++declare function alert(message?: string): void; ++ ++/** ++ * Shows the given message and waits for the answer. Returns the user's answer as boolean. ++ * Only `y` and `Y` are considered as true. ++ * If the stdin is not interactive, it returns false. ++ * @param message ++ */ ++declare function confirm(message?: string): boolean; ++ ++/** ++ * Shows the given message and waits for the user's input. Returns the user's input as string. ++ * If the default value is given and the user inputs the empty string, then it returns the given ++ * default value. ++ * If the default value is not given and the user inputs the empty string, it returns null. ++ * If the stdin is not interactive, it returns null. ++ * @param message ++ * @param defaultValue ++ */ ++declare function prompt(message?: string, defaultValue?: string): string | null; ++ + /* eslint-enable @typescript-eslint/no-explicit-any */ +diff --git a/cli/rt/41_prompt.js b/cli/rt/41_prompt.js +new file mode 100644 +index 00000000000000..5a588def15bdd8 +--- /dev/null ++++ b/cli/rt/41_prompt.js +@@ -0,0 +1,66 @@ ++// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. ++((window) => { ++ const { stdin, stdout } = window.__bootstrap.files; ++ const { isatty } = window.__bootstrap.tty; ++ const LF = ""\n"".charCodeAt(0); ++ const encoder = new TextEncoder(); ++ const decoder = new TextDecoder(); ++ ++ function alert(message = ""Alert"") { ++ if (!isatty(stdin.rid)) { ++ return; ++ } ++ ++ stdout.writeSync(encoder.encode(`${message} [Enter] `)); ++ ++ readLineFromStdinSync(); ++ } ++ ++ function confirm(message = ""Confirm"") { ++ if (!isatty(stdin.rid)) { ++ return false; ++ } ++ ++ stdout.writeSync(encoder.encode(`${message} [y/N] `)); ++ ++ const answer = readLineFromStdinSync(); ++ ++ return answer === ""Y"" || answer === ""y""; ++ } ++ ++ function prompt(message = ""Prompt"", defaultValue) { ++ defaultValue ??= null; ++ ++ if (!isatty(stdin.rid)) { ++ return null; ++ } ++ ++ stdout.writeSync(encoder.encode(`${message} `)); ++ ++ if (defaultValue) { ++ stdout.writeSync(encoder.encode(`[${defaultValue}] `)); ++ } ++ ++ return readLineFromStdinSync() || defaultValue; ++ } ++ ++ function readLineFromStdinSync() { ++ const c = new Uint8Array(1); ++ const buf = []; ++ ++ while (true) { ++ const n = stdin.readSync(c); ++ if (n === 0 || c[0] === LF) { ++ break; ++ } ++ buf.push(c[0]); ++ } ++ return decoder.decode(new Uint8Array(buf)); ++ } ++ ++ window.__bootstrap.prompt = { ++ alert, ++ confirm, ++ prompt, ++ }; ++})(this); +diff --git a/cli/rt/99_main.js b/cli/rt/99_main.js +index d8c34bcb35a7a9..e332647267bd07 100644 +--- a/cli/rt/99_main.js ++++ b/cli/rt/99_main.js +@@ -27,6 +27,7 @@ delete Object.prototype.__proto__; + const fileReader = window.__bootstrap.fileReader; + const webSocket = window.__bootstrap.webSocket; + const fetch = window.__bootstrap.fetch; ++ const prompt = window.__bootstrap.prompt; + const denoNs = window.__bootstrap.denoNs; + const denoNsUnstable = window.__bootstrap.denoNsUnstable; + const errors = window.__bootstrap.errors.errors; +@@ -285,6 +286,9 @@ delete Object.prototype.__proto__; + onunload: util.writable(null), + close: util.writable(windowClose), + closed: util.getterOnly(() => windowIsClosing), ++ alert: util.writable(prompt.alert), ++ confirm: util.writable(prompt.confirm), ++ prompt: util.writable(prompt.prompt), + }; + + const workerRuntimeGlobalProperties = { +diff --git a/cli/tests/066_prompt.ts b/cli/tests/066_prompt.ts +new file mode 100644 +index 00000000000000..1c4a11f989e4cb +--- /dev/null ++++ b/cli/tests/066_prompt.ts +@@ -0,0 +1,17 @@ ++const name0 = prompt(""What is your name?"", ""Jane Doe""); // Answer John Doe ++console.log(`Your name is ${name0}.`); ++const name1 = prompt(""What is your name?"", ""Jane Doe""); // Answer with default ++console.log(`Your name is ${name1}.`); ++const input = prompt(); // Answer foo ++console.log(`Your input is ${input}.`); ++const answer0 = confirm(""Question 0""); // Answer y ++console.log(`Your answer is ${answer0}`); ++const answer1 = confirm(""Question 1""); // Answer n ++console.log(`Your answer is ${answer1}`); ++const answer2 = confirm(""Question 2""); // Answer with yes (returns false) ++console.log(`Your answer is ${answer2}`); ++const answer3 = confirm(); // Answer with default ++console.log(`Your answer is ${answer3}`); ++alert(""Hi""); ++alert(); ++console.log(""The end of test""); +diff --git a/cli/tests/066_prompt.ts.out b/cli/tests/066_prompt.ts.out +new file mode 100644 +index 00000000000000..88d73f34fdac19 +--- /dev/null ++++ b/cli/tests/066_prompt.ts.out +@@ -0,0 +1,8 @@ ++[WILDCARD]What is your name? [Jane Doe] Your name is John Doe. ++What is your name? [Jane Doe] Your name is Jane Doe. ++Prompt Your input is foo. ++Question 0 [y/N] Your answer is true ++Question 1 [y/N] Your answer is false ++Question 2 [y/N] Your answer is false ++Confirm [y/N] Your answer is false ++Hi [Enter] Alert [Enter] The end of test +diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs +index 1a5e48adafdd3f..90dc5a4a894e30 100644 +--- a/cli/tests/integration_tests.rs ++++ b/cli/tests/integration_tests.rs +@@ -1917,6 +1917,17 @@ itest!(_065_import_map_info { + output: ""065_import_map_info.out"", + }); + ++#[cfg(unix)] ++#[test] ++fn _066_prompt() { ++ let args = ""run --unstable 066_prompt.ts""; ++ let output = ""066_prompt.ts.out""; ++ // These are answers to prompt, confirm, and alert calls. ++ let input = b""John Doe\n\nfoo\nY\nN\nyes\n\n\n\n""; ++ ++ util::test_pty(args, output, input); ++} ++ + itest!(js_import_detect { + args: ""run --quiet --reload js_import_detect.ts"", + output: ""js_import_detect.ts.out""," +sentry,https://github.com/getsentry/sentry,ed6ab34a4eb4119eac5e1d5ab6f3638da3a9dbc5,Ryan Albrecht,2022-06-30 05:11:07,feat(replays): Create a demo page to showing the replay details page using height:100vh (#36078),"Create a new url + layout for the Replay Details + +This layout has draggable panels that can be resized to adjust what information is displayed on the screen. + +Component layout can be toggled between a 'sidebar' mode and a 'topbar' mode. In both cases the Timeline is across the top of the page.","feat(replays): Create a demo page to showing the replay details page using height:100vh (#36078) + +Create a new url + layout for the Replay Details + +This layout has draggable panels that can be resized to adjust what information is displayed on the screen. + +Component layout can be toggled between a 'sidebar' mode and a 'topbar' mode. In both cases the Timeline is across the top of the page. + +Fixes #35048","diff --git a/package.json b/package.json +index c5ff560ad22946..e3ecdb6e6660c3 100644 +--- a/package.json ++++ b/package.json +@@ -126,6 +126,7 @@ + ""react-lazyload"": ""^2.3.0"", + ""react-mentions"": ""4.4.2"", + ""react-popper"": ""^2.3.0"", ++ ""react-resize-panel"": ""^0.3.5"", + ""react-router"": ""3.2.0"", + ""react-select"": ""3.1.0"", + ""react-select-event"": ""5.5.0"", +diff --git a/static/app/components/replays/header/detailsPageBreadcrumbs.tsx b/static/app/components/replays/header/detailsPageBreadcrumbs.tsx +new file mode 100644 +index 00000000000000..abf3ec02f2c2ef +--- /dev/null ++++ b/static/app/components/replays/header/detailsPageBreadcrumbs.tsx +@@ -0,0 +1,47 @@ ++import {Fragment} from 'react'; ++ ++import Breadcrumbs from 'sentry/components/breadcrumbs'; ++import FeatureBadge from 'sentry/components/featureBadge'; ++import {t} from 'sentry/locale'; ++import {Event} from 'sentry/types/event'; ++ ++type Props = { ++ eventSlug: string; ++ orgId: string; ++ event?: Event; ++}; ++ ++function getUsernameFromEvent({eventSlug, event}: Pick) { ++ const user = event?.user; ++ ++ if (!user) { ++ return eventSlug; ++ } ++ ++ return user.name || user.email || user.username || user.ip_address; ++} ++ ++function DetailsPageBreadcrumbs({orgId, event, eventSlug}: Props) { ++ const username = getUsernameFromEvent({event, eventSlug}); ++ ++ return ( ++ ++ {username} ++ ++ ++ ), ++ }, ++ ]} ++ /> ++ ); ++} ++ ++export default DetailsPageBreadcrumbs; +diff --git a/static/app/routes.tsx b/static/app/routes.tsx +index 79c4645f367782..2e0fc2fab44636 100644 +--- a/static/app/routes.tsx ++++ b/static/app/routes.tsx +@@ -1041,6 +1041,10 @@ function buildRoutes() { + path="":eventSlug/"" + component={make(() => import('sentry/views/replays/details'))} + /> ++ import('sentry/views/replays/details_v2'))} ++ /> + + ); + +diff --git a/static/app/views/replays/detail/focusTabs.tsx b/static/app/views/replays/detail/focusTabs.tsx +index 74e03b61a4baa0..86168ad807adba 100644 +--- a/static/app/views/replays/detail/focusTabs.tsx ++++ b/static/app/views/replays/detail/focusTabs.tsx +@@ -1,4 +1,5 @@ + import React from 'react'; ++import styled from '@emotion/styled'; + + import NavTabs from 'sentry/components/navTabs'; + import {t} from 'sentry/locale'; +@@ -20,12 +21,16 @@ function FocusTabs({}: Props) { + return ( + + {TABS.map(tab => ( +-
  • ++ + {tab} +-
  • ++ + ))} + + ); + } + ++const Tab = styled('li')` ++ z-index: ${p => p.theme.zIndex.initial + 1}; ++`; ++ + export default FocusTabs; +diff --git a/static/app/views/replays/detail/layout/container.tsx b/static/app/views/replays/detail/layout/container.tsx +new file mode 100644 +index 00000000000000..438532e99e38d9 +--- /dev/null ++++ b/static/app/views/replays/detail/layout/container.tsx +@@ -0,0 +1,83 @@ ++import styled from '@emotion/styled'; ++ ++import space from 'sentry/styles/space'; ++import theme from 'sentry/utils/theme'; ++ ++import {CLASSNAMES} from './resizePanel'; ++ ++// This is the generated SVG from https://github.com/getsentry/sentry/blob/master/static/app/icons/iconGrabbable.tsx ++// I couldn't sort out how to extract it from the react component. I think it ++// could be done react-dom-server or to render it inside an unmounted dom node ++// then copy the html content. All that seemed slower to build and slower to ++// exec compared to having an encoded svg. ++const GrabberColor = encodeURIComponent(theme.gray300); ++const GrabberSVG = ++ `url('data:image/svg+xml,` + ++ `%3Csvg xmlns=""http://www.w3.org/2000/svg"" viewBox=""0 0 16 16"" fill=""${GrabberColor}"" height=""16px"" width=""16px""%3E` + ++ '%3Ccircle cx=""4.73"" cy=""8"" r=""1.31""%3E%3C/circle%3E' + ++ '%3Ccircle cx=""4.73"" cy=""1.31"" r=""1.31""%3E%3C/circle%3E' + ++ '%3Ccircle cx=""11.27"" cy=""8"" r=""1.31""%3E%3C/circle%3E' + ++ '%3Ccircle cx=""11.27"" cy=""1.31"" r=""1.31""%3E%3C/circle%3E' + ++ '%3Ccircle cx=""4.73"" cy=""14.69"" r=""1.31""%3E%3C/circle%3E' + ++ '%3Ccircle cx=""11.27"" cy=""14.69"" r=""1.31""%3E%3C/circle%3E' + ++ '%3C/svg%3E' + ++ `')`; ++ ++const Container = styled('div')` ++ width: 100%; ++ height: 100%; ++ max-height: 100%; ++ display: flex; ++ flex-flow: nowrap column; ++ overflow: hidden; ++ padding: ${space(2)}; ++ ++ .${CLASSNAMES.bar.width} { ++ cursor: ew-resize; ++ height: 100%; ++ width: ${space(2)}; ++ } ++ ++ .${CLASSNAMES.bar.height} { ++ cursor: ns-resize; ++ height: ${space(2)}; ++ width: 100%; ++ } ++ .${CLASSNAMES.bar.height}.overlapDown { ++ height: calc(16px + 34px); /* Spacing between components + height of */ ++ margin-bottom: -34px; /* The height of the text + border */ ++ z-index: ${p => p.theme.zIndex.initial}; ++ } ++ ++ .${CLASSNAMES.bar.height}, .${CLASSNAMES.bar.width} { ++ background: transparent; ++ display: flex; ++ align-items: center; ++ align-content: center; ++ justify-content: center; ++ } ++ .${CLASSNAMES.bar.height}:hover, .${CLASSNAMES.bar.width}:hover { ++ background: ${p => p.theme.hover}; ++ } ++ ++ .${CLASSNAMES.handle.width} { ++ height: ${space(3)}; ++ width: ${space(2)}; ++ } ++ ++ .${CLASSNAMES.handle.height} { ++ height: ${space(2)}; ++ width: ${space(3)}; ++ transform: rotate(90deg); ++ } ++ ++ .${CLASSNAMES.handle.height} > span, ++ .${CLASSNAMES.handle.width} > span { ++ display: block; ++ background: transparent ${GrabberSVG} center center no-repeat; ++ width: 100%; ++ height: 100%; ++ } ++`; ++ ++export default Container; +diff --git a/static/app/views/replays/detail/layout/index.tsx b/static/app/views/replays/detail/layout/index.tsx +new file mode 100644 +index 00000000000000..1fe8be3e7c0420 +--- /dev/null ++++ b/static/app/views/replays/detail/layout/index.tsx +@@ -0,0 +1,173 @@ ++import styled from '@emotion/styled'; ++ ++import ErrorBoundary from 'sentry/components/errorBoundary'; ++import ReplayTimeline from 'sentry/components/replays/breadcrumbs/replayTimeline'; ++import ReplayView from 'sentry/components/replays/replayView'; ++import space from 'sentry/styles/space'; ++import useFullscreen from 'sentry/utils/replays/hooks/useFullscreen'; ++import Breadcrumbs from 'sentry/views/replays/detail/breadcrumbs'; ++import FocusArea from 'sentry/views/replays/detail/focusArea'; ++import FocusTabs from 'sentry/views/replays/detail/focusTabs'; ++ ++import Container from './container'; ++import ResizePanel from './resizePanel'; ++ ++type Layout = ++ /** ++ * ### Sidebar ++ * ┌───────────────────┐ ++ * │ Timeline │ ++ * ├──────────┬────────┤ ++ * │ Details > Video │ ++ * │ > │ ++ * │ >^^^^^^^^┤ ++ * │ > Crumbs │ ++ * │ > │ ++ * └──────────┴────────┘ ++ */ ++ | 'sidebar' ++ /** ++ * ### Topbar ++ *┌────────────────────┐ ++ *│ Timeline │ ++ *├───────────┬────────┤ ++ *│ Video │ Crumbs │ ++ *│ │ │ ++ *├^^^^^^^^^^^^^^^^^^^^┤ ++ *│ Details │ ++ *│ │ ++ *└────────────────────┘ ++ */ ++ | 'topbar'; ++ ++const SIDEBAR_MIN_WIDTH = 325; ++const TOPBAR_MIN_HEIGHT = 325; ++ ++type Props = { ++ layout?: Layout; ++ showCrumbs?: boolean; ++ showTimeline?: boolean; ++ showVideo?: boolean; ++}; ++ ++function ReplayLayout({ ++ layout = 'topbar', ++ showCrumbs = true, ++ showTimeline = true, ++ showVideo = true, ++}: Props) { ++ const {ref: fullscreenRef, isFullscreen, toggle: toggleFullscreen} = useFullscreen(); ++ ++ const timeline = showTimeline ? ( ++ ++ ++ ++ ++ ++ ) : null; ++ ++ const video = showVideo ? ( ++ ++ ++ ++ ++ ++ ) : null; ++ ++ const crumbs = showCrumbs ? ( ++ ++ ++ ++ ++ ++ ) : null; ++ ++ const content = ( ++ ++ ++ ++ ++ ++ ++ ); ++ ++ if (layout === 'sidebar') { ++ return ( ++ ++ {timeline} ++ ++ {content} ++ ++ ++ {video ? {video} : null} ++ {crumbs} ++ ++ ++ ++ ++ ); ++ } ++ ++ // layout === 'topbar' or default ++ return ( ++ ++ {timeline} ++ ++ ++ {video} ++ {crumbs} ++ ++ ++ {content} ++ ++ ); ++} ++ ++const PageColumn = styled('section')` ++ display: flex; ++ flex-grow: 1; ++ flex-wrap: nowrap; ++ flex-direction: column; ++`; ++ ++const PageRow = styled(PageColumn)` ++ flex-direction: row; ++`; ++ ++const TimelineSection = styled(PageColumn)` ++ flex-grow: 0; ++`; ++ ++const ContentSection = styled(PageColumn)` ++ flex-grow: 3; /* Higher growth than SidebarSection or TopVideoSection */ ++ ++ height: 100%; ++ min-height: 300px; ++ width: 100%; ++`; ++ ++const VideoSection = styled(PageColumn)` ++ flex-grow: 2; ++`; ++ ++const BreadcrumbSection = styled(PageColumn)``; ++ ++const SidebarSection = styled(PageColumn)` ++ min-width: ${SIDEBAR_MIN_WIDTH}px; ++`; ++ ++const TopbarSection = styled(PageRow)` ++ height: ${TOPBAR_MIN_HEIGHT}px; ++ min-height: ${TOPBAR_MIN_HEIGHT}px; ++ ++ ${BreadcrumbSection} { ++ max-width: ${SIDEBAR_MIN_WIDTH}px; ++ margin-left: ${space(2)}; ++ } ++`; ++ ++export default ReplayLayout; +diff --git a/static/app/views/replays/detail/layout/resizePanel.tsx b/static/app/views/replays/detail/layout/resizePanel.tsx +new file mode 100644 +index 00000000000000..5a948411f98430 +--- /dev/null ++++ b/static/app/views/replays/detail/layout/resizePanel.tsx +@@ -0,0 +1,43 @@ ++import BaseResizePanel from 'react-resize-panel'; ++import styled from '@emotion/styled'; ++ ++type Props = { ++ direction: 'n' | 'e' | 's' | 'w'; ++ minHeight?: number; ++ minWidth?: number; ++ modifierClass?: string; ++}; ++ ++export const CLASSNAMES = { ++ bar: { ++ height: 'resizeHeightBar', ++ width: 'resizeWidthBar', ++ }, ++ handle: { ++ height: 'resizeHeightHandle', ++ width: 'resizeWidthHandle', ++ }, ++}; ++ ++const ResizePanel = styled(function ResizePanelContent({ ++ direction, ++ modifierClass = '', ++ ...props ++}: Props) { ++ const movesUpDown = ['n', 's'].includes(direction); ++ const borderClass = movesUpDown ? CLASSNAMES.bar.height : CLASSNAMES.bar.width; ++ const handleClass = movesUpDown ? CLASSNAMES.handle.height : CLASSNAMES.handle.width; ++ ++ return ( ++ ++ ); ++})` ++ position: relative; ++`; ++ ++export default ResizePanel; +diff --git a/static/app/views/replays/detail/page.tsx b/static/app/views/replays/detail/page.tsx +new file mode 100644 +index 00000000000000..11c0eea13a22ce +--- /dev/null ++++ b/static/app/views/replays/detail/page.tsx +@@ -0,0 +1,70 @@ ++import {ReactNode} from 'react'; ++import styled from '@emotion/styled'; ++ ++import {FeatureFeedback} from 'sentry/components/featureFeedback'; ++import * as Layout from 'sentry/components/layouts/thirds'; ++import DetailsPageBreadcrumbs from 'sentry/components/replays/header/detailsPageBreadcrumbs'; ++import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle'; ++import space from 'sentry/styles/space'; ++import {Event} from 'sentry/types/event'; ++ ++type Props = { ++ children: ReactNode; ++ eventSlug: string; ++ orgId: string; ++ event?: Event; ++}; ++ ++function Page({children, event, orgId, eventSlug}: Props) { ++ const title = event ? `${event.id} - Replays - ${orgId}` : `Replays - ${orgId}`; ++ ++ return ( ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ {children} ++ ++ ++ ); ++} ++ ++// TODO(replay); This could make a lot of sense to put inside HeaderActions by default ++const ButtonActionsWrapper = styled(Layout.HeaderActions)` ++ display: grid; ++ grid-template-columns: repeat(2, max-content); ++ justify-content: flex-end; ++ gap: ${space(1)}; ++`; ++ ++const FullViewport = styled('div')` ++ height: 100vh; ++ width: 100%; ++ ++ display: flex; ++ flex-flow: nowrap column; ++ flex-direction: column; ++ overflow: hidden; ++ ++ /* ++ * The footer component is a sibling of this div. ++ * Remove it so the replay can take up the ++ * entire screen. ++ */ ++ ~ footer { ++ display: none; ++ } ++`; ++ ++const FullViewportContent = styled('section')` ++ flex-grow: 1; ++ background: ${p => p.theme.background}; ++`; ++ ++export default Page; +diff --git a/static/app/views/replays/details_v2.tsx b/static/app/views/replays/details_v2.tsx +new file mode 100644 +index 00000000000000..e2e6ae4449e334 +--- /dev/null ++++ b/static/app/views/replays/details_v2.tsx +@@ -0,0 +1,69 @@ ++import {Fragment} from 'react'; ++ ++import DetailedError from 'sentry/components/errors/detailedError'; ++import NotFound from 'sentry/components/errors/notFound'; ++import {Provider as ReplayContextProvider} from 'sentry/components/replays/replayContext'; ++import {t} from 'sentry/locale'; ++import {PageContent} from 'sentry/styles/organization'; ++import useReplayData from 'sentry/utils/replays/hooks/useReplayData'; ++import {useRouteContext} from 'sentry/utils/useRouteContext'; ++import Layout from 'sentry/views/replays/detail/layout'; ++import Page from 'sentry/views/replays/detail/page'; ++ ++function ReplayDetails() { ++ const { ++ location, ++ params: {eventSlug, orgId}, ++ } = useRouteContext(); ++ ++ const { ++ t: initialTimeOffset, // Time, in seconds, where the video should start ++ } = location.query; ++ ++ const {fetching, onRetry, replay} = useReplayData({ ++ eventSlug, ++ orgId, ++ }); ++ ++ if (!fetching && !replay) { ++ return ( ++ ++ ++ ++ ++ ++ ); ++ } ++ ++ if (!fetching && replay && replay.getRRWebEvents().length < 2) { ++ return ( ++ ++ ++

    {t('This Replay may not have captured any user actions.')}

    ++

    ++ {t( ++ 'Or there may be an issue loading the actions from the server, click to try loading the Replay again.' ++ )} ++

    ++ ++ } ++ /> ++
    ++ ); ++ } ++ ++ return ( ++ ++ ++ ++ ++ ++ ); ++} ++ ++export default ReplayDetails; +diff --git a/yarn.lock b/yarn.lock +index a7e4f81933bb78..20fdaba5f28acc 100644 +--- a/yarn.lock ++++ b/yarn.lock +@@ -6152,6 +6152,11 @@ case-sensitive-paths-webpack-plugin@^2.3.0: + resolved ""https://registry.yarnpkg.com/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.4.0.tgz#db64066c6422eed2e08cc14b986ca43796dbc6d4"" + integrity sha512-roIFONhcxog0JSSWbvVAh3OocukmSgpqOH6YpMkCvav/ySIV3JKg4Dc8vYtQjYi/UxpNE36r/9v+VqTQqgkYmw== + ++cash-dom@^4.1.5: ++ version ""4.1.5"" ++ resolved ""https://registry.yarnpkg.com/cash-dom/-/cash-dom-4.1.5.tgz#0ef0cf205bc7603aa4e2dfada5808442a7a0e6ca"" ++ integrity sha512-E6MO0A6ms5iZPtexznQXWRkFEvqdPqCmdx/SiJr2PnhOQNhZNfALkLG5t83Hk3J5JELzED7PJuzhMoS2tT64XA== ++ + cbor-web@^8.1.0: + version ""8.1.0"" + resolved ""https://registry.yarnpkg.com/cbor-web/-/cbor-web-8.1.0.tgz#c1148e91ca6bfc0f5c07c1df164854596e2e33d6"" +@@ -13087,6 +13092,16 @@ react-resizable@^3.0.4: + prop-types ""15.x"" + react-draggable ""^4.0.3"" + ++react-resize-panel@^0.3.5: ++ version ""0.3.5"" ++ resolved ""https://registry.yarnpkg.com/react-resize-panel/-/react-resize-panel-0.3.5.tgz#43aa3450bf5b5a2566b40c4201445ced96c2a905"" ++ integrity sha512-iyHOFTrSt+WV4Ilzi81x6KH3FU7VsGP736rmxepwGrgAEATmCvXzZdluTm3NpsptP7aC3hLODmXwnxusyA393A== ++ dependencies: ++ cash-dom ""^4.1.5"" ++ classnames ""^2.2.6"" ++ lodash.debounce ""^4.0.8"" ++ react-draggable ""^4.0.3"" ++ + react-router@3.2.0: + version ""3.2.0"" + resolved ""https://registry.yarnpkg.com/react-router/-/react-router-3.2.0.tgz#62b6279d589b70b34e265113e4c0a9261a02ed36""" +bootstrap-vue,https://github.com/bootstrap-vue/bootstrap-vue,fbf3cc06f0e5f327a0fafbefbef4039234907a7c,dependabot[bot],2021-01-27 18:07:13,chore(deps-dev): bump marked from 1.2.7 to 1.2.8 (#6364),"Bumps [marked](https://github.com/markedjs/marked) from 1.2.7 to 1.2.8. +- [Release notes](https://github.com/markedjs/marked/releases) +- [Changelog](https://github.com/markedjs/marked/blob/master/release.config.js) +- [Commits](https://github.com/markedjs/marked/compare/v1.2.7...v1.2.8)","chore(deps-dev): bump marked from 1.2.7 to 1.2.8 (#6364) + +Bumps [marked](https://github.com/markedjs/marked) from 1.2.7 to 1.2.8. +- [Release notes](https://github.com/markedjs/marked/releases) +- [Changelog](https://github.com/markedjs/marked/blob/master/release.config.js) +- [Commits](https://github.com/markedjs/marked/compare/v1.2.7...v1.2.8) + +Signed-off-by: dependabot[bot] + +Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>","diff --git a/package.json b/package.json +index 648d95c47ea..2760e5c43dd 100644 +--- a/package.json ++++ b/package.json +@@ -137,7 +137,7 @@ + ""lint-staged"": ""^10.5.3"", + ""loader-utils"": ""^2.0.0"", + ""lodash"": ""^4.17.20"", +- ""marked"": ""^1.2.7"", ++ ""marked"": ""^1.2.8"", + ""nuxt"": ""^2.14.12"", + ""postcss"": ""^8.2.4"", + ""postcss-cli"": ""^8.3.1"", +diff --git a/yarn.lock b/yarn.lock +index 7a991b794d5..8bd8773d0a1 100644 +--- a/yarn.lock ++++ b/yarn.lock +@@ -8950,10 +8950,10 @@ markdown-table@^2.0.0: + dependencies: + repeat-string ""^1.0.0"" + +-marked@^1.2.7: +- version ""1.2.7"" +- resolved ""https://registry.yarnpkg.com/marked/-/marked-1.2.7.tgz#6e14b595581d2319cdcf033a24caaf41455a01fb"" +- integrity sha512-No11hFYcXr/zkBvL6qFmAp1z6BKY3zqLMHny/JN/ey+al7qwCM2+CMBL9BOgqMxZU36fz4cCWfn2poWIf7QRXA== ++marked@^1.2.8: ++ version ""1.2.8"" ++ resolved ""https://registry.yarnpkg.com/marked/-/marked-1.2.8.tgz#5008ece15cfa43e653e85845f3525af4beb6bdd4"" ++ integrity sha512-lzmFjGnzWHkmbk85q/ILZjFoHHJIQGF+SxGEfIdGk/XhiTPhqGs37gbru6Kkd48diJnEyYwnG67nru0Z2gQtuQ== + + md5.js@^1.3.4: + version ""1.3.5""" +nocobase,https://github.com/nocobase/nocobase,0f48897fa7c2fb49c64a5ee899399cabd2f3c5ff,Katherine,2024-09-19 08:47:09,fix: error in configuration block under the newly added tab in the action panel popup action (#5285),"* refactor: style improve + +* fix: bug + +* style: improve + +* style: style improve","fix: error in configuration block under the newly added tab in the action panel popup action (#5285) + +* refactor: style improve + +* fix: bug + +* style: improve + +* style: style improve","diff --git a/packages/core/client/src/schema-initializer/buttons/TabPaneInitializers.tsx b/packages/core/client/src/schema-initializer/buttons/TabPaneInitializers.tsx +index ae5e08d913931..bbc6b88f49f7e 100644 +--- a/packages/core/client/src/schema-initializer/buttons/TabPaneInitializers.tsx ++++ b/packages/core/client/src/schema-initializer/buttons/TabPaneInitializers.tsx +@@ -7,25 +7,36 @@ + * For more information, please refer to: https://www.nocobase.com/agreement. + */ + +-import { useForm } from '@formily/react'; ++import { useFieldSchema, useForm } from '@formily/react'; + import React, { useMemo } from 'react'; + import { SchemaComponent, useActionContext, useDesignable, useRecord } from '../..'; + import { SchemaInitializer } from '../../application/schema-initializer/SchemaInitializer'; + import { useGetAriaLabelOfSchemaInitializer } from '../hooks/useGetAriaLabelOfSchemaInitializer'; ++import { useOpenModeContext } from '../../modules/popup/OpenModeProvider'; ++import { useCollection } from '../../data-source'; + + const TabPaneInitializers = (props?: any) => { + const { designable, insertBeforeEnd } = useDesignable(); + const { isCreate, isBulkEdit, options } = props; + const { gridInitializer } = options; + const { getAriaLabel } = useGetAriaLabelOfSchemaInitializer(); ++ const { isMobile } = useOpenModeContext() || {}; + const record = useRecord(); ++ const collection = useCollection(); + + const useSubmitAction = () => { + const form = useForm(); + const ctx = useActionContext(); + let initializer = gridInitializer; ++ if (!collection) { ++ initializer = 'page:addBlock'; ++ if (isMobile) { ++ initializer = 'mobile:addBlock'; ++ } ++ } + if (!initializer) { + initializer = 'popup:common:addBlock'; ++ + if (isCreate || !record) { + initializer = 'popup:addNew:addBlock'; + } else if (isBulkEdit) { +diff --git a/packages/plugins/@nocobase/plugin-block-workbench/src/client/WorkbenchAction.tsx b/packages/plugins/@nocobase/plugin-block-workbench/src/client/WorkbenchAction.tsx +index c708539cdfb7d..db76743c3fe61 100644 +--- a/packages/plugins/@nocobase/plugin-block-workbench/src/client/WorkbenchAction.tsx ++++ b/packages/plugins/@nocobase/plugin-block-workbench/src/client/WorkbenchAction.tsx +@@ -37,8 +37,8 @@ function Button() { + const { layout } = useContext(WorkbenchBlockContext); + const { styles, cx } = useStyles(); + return layout === WorkbenchLayout.Grid ? ( +-
    +- } /> ++
    ++ } /> +
    {fieldSchema.title}
    +
    + ) : ( +diff --git a/packages/plugins/@nocobase/plugin-block-workbench/src/client/WorkbenchBlock.tsx b/packages/plugins/@nocobase/plugin-block-workbench/src/client/WorkbenchBlock.tsx +index a058088a0d564..aeb7e701ba09a 100644 +--- a/packages/plugins/@nocobase/plugin-block-workbench/src/client/WorkbenchBlock.tsx ++++ b/packages/plugins/@nocobase/plugin-block-workbench/src/client/WorkbenchBlock.tsx +@@ -19,7 +19,7 @@ import { + } from '@nocobase/client'; + import { css, cx } from '@emotion/css'; + import { Space, List, Avatar } from 'antd'; +-import React, { createContext } from 'react'; ++import React, { createContext, useState, useEffect } from 'react'; + import { WorkbenchLayout } from './workbenchBlockSettings'; + + const ConfigureActionsButton = observer( +@@ -35,11 +35,41 @@ const InternalIcons = () => { + const fieldSchema = useFieldSchema(); + const { designable } = useDesignable(); + const { layout = WorkbenchLayout.Grid } = fieldSchema.parent['x-component-props'] || {}; ++ const [gap, setGap] = useState(8); // 初始 gap 值 ++ ++ useEffect(() => { ++ const calculateGap = () => { ++ const container = document.getElementsByClassName('mobile-page-content')[0] as any; ++ if (container) { ++ const containerWidth = container.offsetWidth - 48; ++ const itemWidth = 100; // 每个 item 的宽度 ++ const itemsPerRow = Math.floor(containerWidth / itemWidth); // 每行能容纳的 item 数 ++ // 计算实际需要的 gap 值 ++ const totalItemWidth = itemsPerRow * itemWidth; ++ const totalAvailableWidth = containerWidth; ++ const totalGapsWidth = totalAvailableWidth - totalItemWidth; ++ ++ if (totalGapsWidth > 0) { ++ setGap(totalGapsWidth / (itemsPerRow - 1)); ++ } else { ++ setGap(0); // 如果没有足够的空间,则设置 gap 为 0 ++ } ++ } ++ }; ++ ++ window.addEventListener('resize', calculateGap); ++ calculateGap(); // 初始化时计算 gap ++ ++ return () => { ++ window.removeEventListener('resize', calculateGap); ++ }; ++ }, [Object.keys(fieldSchema?.properties || {}).length]); ++ console.log(gap); + return ( +
    + + {layout === WorkbenchLayout.Grid ? ( +- ++ + {fieldSchema.mapProperties((s, key) => ( + + ))}" +node,https://github.com/nodejs/node,e4bff131cae5239b5ffd1c705005f29ba7bf6fa9,Sam Roberts,2020-01-10 05:01:32,test: check that --insecure-http-parser works,"Test that using --insecure-http-parser will disable validation of +invalid characters in HTTP headers.","test: check that --insecure-http-parser works + +Test that using --insecure-http-parser will disable validation of +invalid characters in HTTP headers. + +See: +- https://github.com/nodejs/node/pull/30567 + +PR-URL: https://github.com/nodejs/node/pull/31253 +Reviewed-By: Richard Lau +Reviewed-By: Ruben Bridgewater ","diff --git a/test/parallel/test-http-insecure-parser.js b/test/parallel/test-http-insecure-parser.js +new file mode 100644 +index 00000000000000..c9a3aa23c142d9 +--- /dev/null ++++ b/test/parallel/test-http-insecure-parser.js +@@ -0,0 +1,35 @@ ++// Flags: --insecure-http-parser ++ ++'use strict'; ++const common = require('../common'); ++const assert = require('assert'); ++const http = require('http'); ++const net = require('net'); ++ ++const server = http.createServer(function(req, res) { ++ assert.strictEqual(req.headers['content-type'], 'text/te\bt'); ++ req.pipe(res); ++}); ++ ++server.listen(0, common.mustCall(function() { ++ const bufs = []; ++ const client = net.connect( ++ this.address().port, ++ function() { ++ client.write( ++ 'GET / HTTP/1.1\r\n' + ++ 'Content-Type: text/te\x08t\r\n' + ++ 'Connection: close\r\n\r\n'); ++ } ++ ); ++ client.on('data', function(chunk) { ++ bufs.push(chunk); ++ }); ++ client.on('end', common.mustCall(function() { ++ const head = Buffer.concat(bufs) ++ .toString('latin1') ++ .split('\r\n')[0]; ++ assert.strictEqual(head, 'HTTP/1.1 200 OK'); ++ server.close(); ++ })); ++}));" +kratos,https://github.com/ory/kratos,a6672554b02378eb2dac7b1af99ea2915395867b,Avinash Dwarapu,2021-08-02 19:30:30,fix: skip prompt on discord authorization by default (#1594),"When a value for prompt is not provided, Discord defaults to `prompt=""consent""`. This change makes it so that if the request is not forced, prompt is explicitly set to ""none"".","fix: skip prompt on discord authorization by default (#1594) + +When a value for prompt is not provided, Discord defaults to `prompt=""consent""`. This change makes it so that if the request is not forced, prompt is explicitly set to ""none"".","diff --git a/selfservice/strategy/oidc/provider_discord.go b/selfservice/strategy/oidc/provider_discord.go +index e5c501afb9ee..350c956a00c8 100644 +--- a/selfservice/strategy/oidc/provider_discord.go ++++ b/selfservice/strategy/oidc/provider_discord.go +@@ -56,7 +56,9 @@ func (d *ProviderDiscord) AuthCodeURLOptions(r ider) []oauth2.AuthCodeOption { + oauth2.SetAuthURLParam(""prompt"", ""consent""), + } + } +- return []oauth2.AuthCodeOption{} ++ return []oauth2.AuthCodeOption{ ++ oauth2.SetAuthURLParam(""prompt"", ""none""), ++ } + } + + func (d *ProviderDiscord) Claims(ctx context.Context, exchange *oauth2.Token) (*Claims, error) {" +medusa,https://github.com/medusajs/medusa,3578ff6364eacaf4b2381fff84c8c5316431aa12,Sebastian Rindom,2021-02-09 14:53:50,chore(release): Publish,- medusa-payment-paypal@1.0.2,"chore(release): Publish + + - medusa-payment-paypal@1.0.2","diff --git a/packages/medusa-payment-paypal/CHANGELOG.md b/packages/medusa-payment-paypal/CHANGELOG.md +index 5826a432f057a..29c97be52e5c7 100644 +--- a/packages/medusa-payment-paypal/CHANGELOG.md ++++ b/packages/medusa-payment-paypal/CHANGELOG.md +@@ -3,6 +3,14 @@ + All notable changes to this project will be documented in this file. + See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ++## [1.0.2](https://github.com/medusajs/medusa/compare/medusa-payment-paypal@1.0.1...medusa-payment-paypal@1.0.2) (2021-02-09) ++ ++**Note:** Version bump only for package medusa-payment-paypal ++ ++ ++ ++ ++ + ## 1.0.1 (2021-02-08) + + +diff --git a/packages/medusa-payment-paypal/package.json b/packages/medusa-payment-paypal/package.json +index fd9dd0ca7ff00..f69d4df858ada 100644 +--- a/packages/medusa-payment-paypal/package.json ++++ b/packages/medusa-payment-paypal/package.json +@@ -1,6 +1,6 @@ + { + ""name"": ""medusa-payment-paypal"", +- ""version"": ""1.0.1"", ++ ""version"": ""1.0.2"", + ""description"": ""Paypal Payment provider for Meduas Commerce"", + ""main"": ""index.js"", + ""repository"": {" +mumble,https://github.com/mumble-voip/mumble,ca29279df9cd160561ce1ef60be70ba102008b98,Hartmnt,2024-04-04 18:35:19,FIX(a11y): Improve accessibility of the edit shortcut dialog,"This commit switches the label in the shortcut dialog from +""Add"" to ""Listening to input"" when the button is pressed. +This is supposed to indicate to screen readers that +the dialog is now in a different state, which is actually +listening for new key presses.","FIX(a11y): Improve accessibility of the edit shortcut dialog + +This commit switches the label in the shortcut dialog from +""Add"" to ""Listening to input"" when the button is pressed. +This is supposed to indicate to screen readers that +the dialog is now in a different state, which is actually +listening for new key presses.","diff --git a/src/mumble/GlobalShortcutButtons.cpp b/src/mumble/GlobalShortcutButtons.cpp +index 7debe51a114..d96bc06fb6c 100644 +--- a/src/mumble/GlobalShortcutButtons.cpp ++++ b/src/mumble/GlobalShortcutButtons.cpp +@@ -93,10 +93,12 @@ void GlobalShortcutButtons::toggleCapture(const bool enabled) { + GlobalShortcutEngine::engine->resetMap(); + connect(GlobalShortcutEngine::engine, &GlobalShortcutEngine::buttonPressed, this, + &GlobalShortcutButtons::updateButtons); ++ m_ui->addButton->setText(QObject::tr(""Listening for input"")); + } else { + disconnect(GlobalShortcutEngine::engine, &GlobalShortcutEngine::buttonPressed, this, + &GlobalShortcutButtons::updateButtons); + removeEventFilter(this); ++ m_ui->addButton->setText(QObject::tr(""Add"")); + } + } + +diff --git a/src/mumble/GlobalShortcutButtons.ui b/src/mumble/GlobalShortcutButtons.ui +index cee8061cf75..da8ad5ea822 100644 +--- a/src/mumble/GlobalShortcutButtons.ui ++++ b/src/mumble/GlobalShortcutButtons.ui +@@ -45,6 +45,9 @@ + + <html><head/><body><p>Starts the capture process: all buttons you press will be added to the tree.</p><p>Once all buttons are released, the capture process stops automatically.</p></body></html> + ++ ++ Toggling this button will make the application listen for a shortcut. Once the shortcut is entered, the application stops listening for a shortcut. Multiple shortcuts can be assigned to the current action. Navigate to the shortcut list above to review the shortcuts currently assigned to the current action. ++ + + Add + +@@ -58,6 +61,9 @@ + + Remove the currently selected items + ++ ++ This button will remove the selected shortcut for the current action. Note that you will have to select a shortcut from the list above first before this button has any effect. ++ + + Remove + " +erpnext,https://github.com/frappe/erpnext,7137b0b67035a799986a7b37782a3f33936d4a8c,Anupam Kumar,2020-07-23 15:58:47,refactor: shopping cart (#22617),"* refactoring shopping cart settings + +* adding column_break in shopping cart settings","refactor: shopping cart (#22617) + +* refactoring shopping cart settings + +* adding column_break in shopping cart settings","diff --git a/erpnext/public/js/shopping_cart.js b/erpnext/public/js/shopping_cart.js +index 44a8cd0067bd..6a923ae42346 100644 +--- a/erpnext/public/js/shopping_cart.js ++++ b/erpnext/public/js/shopping_cart.js +@@ -55,6 +55,7 @@ frappe.ready(function() { + shopping_cart.show_shoppingcart_dropdown(); + shopping_cart.set_cart_count(); + shopping_cart.bind_dropdown_cart_buttons(); ++ shopping_cart.show_cart_navbar(); + }); + + $.extend(shopping_cart, { +@@ -177,4 +178,12 @@ $.extend(shopping_cart, { + + }, + ++ show_cart_navbar: function () { ++ frappe.call({ ++ method: ""erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings.is_cart_enabled"", ++ callback: function(r) { ++ $("".shopping-cart"").toggleClass('hidden', r.message ? false : true); ++ } ++ }); ++ } + }); +diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.js b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.js +index ffc5daba62f3..14500ba6b3dc 100644 +--- a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.js ++++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.js +@@ -1,31 +1,16 @@ + // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors + // License: GNU General Public License v3. See license.txt + +-$.extend(cur_frm.cscript, { +- onload: function() { +- if(cur_frm.doc.__onload && cur_frm.doc.__onload.quotation_series) { +- cur_frm.fields_dict.quotation_series.df.options = cur_frm.doc.__onload.quotation_series; +- cur_frm.refresh_field(""quotation_series""); ++frappe.ui.form.on(""Shopping Cart Settings"", { ++ onload: function(frm) { ++ if(frm.doc.__onload && frm.doc.__onload.quotation_series) { ++ frm.fields_dict.quotation_series.df.options = frm.doc.__onload.quotation_series; ++ frm.refresh_field(""quotation_series""); + } + }, +- refresh: function(){ +- toggle_mandatory(cur_frm) +- }, +- enable_checkout: function(){ +- toggle_mandatory(cur_frm) +- }, +- enabled: function() { +- if (cur_frm.doc.enabled === 1) { +- cur_frm.doc.show_configure_button = 1; +- cur_frm.refresh_field('show_configure_button'); ++ enabled: function(frm) { ++ if (frm.doc.enabled === 1) { ++ frm.set_value('enable_variants', 1); + } + } + }); +- +- +-function toggle_mandatory (cur_frm){ +- cur_frm.toggle_reqd(""payment_gateway_account"", false); +- if(cur_frm.doc.enabled && cur_frm.doc.enable_checkout) { +- cur_frm.toggle_reqd(""payment_gateway_account"", true); +- } +-} +diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.json b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.json +index e828f54878b6..c574afa68c61 100644 +--- a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.json ++++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.json +@@ -1,750 +1,192 @@ + { +- ""allow_copy"": 0, +- ""allow_events_in_timeline"": 0, +- ""allow_guest_to_view"": 0, +- ""allow_import"": 0, +- ""allow_rename"": 0, +- ""beta"": 0, +- ""creation"": ""2013-06-19 15:57:32"", +- ""custom"": 0, +- ""description"": ""Default settings for Shopping Cart"", +- ""docstatus"": 0, +- ""doctype"": ""DocType"", +- ""document_type"": ""System"", +- ""editable_grid"": 0, +- ""fields"": [ +- { +- ""allow_bulk_edit"": 0, +- ""allow_in_quick_entry"": 0, +- ""allow_on_submit"": 0, +- ""bold"": 0, +- ""collapsible"": 0, +- ""columns"": 0, +- ""fieldname"": ""enabled"", +- ""fieldtype"": ""Check"", +- ""hidden"": 0, +- ""ignore_user_permissions"": 0, +- ""ignore_xss_filter"": 0, +- ""in_filter"": 0, +- ""in_global_search"": 0, +- ""in_list_view"": 1, +- ""in_standard_filter"": 0, +- ""label"": ""Enable Shopping Cart"", +- ""length"": 0, +- ""no_copy"": 0, +- ""permlevel"": 0, +- ""print_hide"": 0, +- ""print_hide_if_no_value"": 0, +- ""read_only"": 0, +- ""remember_last_selected_value"": 0, +- ""report_hide"": 0, +- ""reqd"": 0, +- ""search_index"": 0, +- ""set_only_once"": 0, +- ""translatable"": 0, +- ""unique"": 0 +- }, +- { +- ""allow_bulk_edit"": 0, +- ""allow_in_quick_entry"": 0, +- ""allow_on_submit"": 0, +- ""bold"": 0, +- ""collapsible"": 0, +- ""columns"": 0, +- ""depends_on"": """", +- ""description"": """", +- ""fieldname"": ""display_settings"", +- ""fieldtype"": ""Section Break"", +- ""hidden"": 0, +- ""ignore_user_permissions"": 0, +- ""ignore_xss_filter"": 0, +- ""in_filter"": 0, +- ""in_global_search"": 0, +- ""in_list_view"": 0, +- ""in_standard_filter"": 0, +- ""label"": ""Display Settings"", +- ""length"": 0, +- ""no_copy"": 0, +- ""permlevel"": 0, +- ""precision"": """", +- ""print_hide"": 0, +- ""print_hide_if_no_value"": 0, +- ""read_only"": 0, +- ""remember_last_selected_value"": 0, +- ""report_hide"": 0, +- ""reqd"": 0, +- ""search_index"": 0, +- ""set_only_once"": 0, +- ""translatable"": 0, +- ""unique"": 0 +- }, +- { +- ""allow_bulk_edit"": 0, +- ""allow_in_quick_entry"": 0, +- ""allow_on_submit"": 0, +- ""bold"": 0, +- ""collapsible"": 0, +- ""columns"": 0, +- ""depends_on"": """", +- ""description"": """", +- ""fieldname"": ""show_attachments"", +- ""fieldtype"": ""Check"", +- ""hidden"": 0, +- ""ignore_user_permissions"": 0, +- ""ignore_xss_filter"": 0, +- ""in_filter"": 0, +- ""in_global_search"": 0, +- ""in_list_view"": 0, +- ""in_standard_filter"": 0, +- ""label"": ""Show Public Attachments"", +- ""length"": 0, +- ""no_copy"": 0, +- ""permlevel"": 0, +- ""precision"": """", +- ""print_hide"": 0, +- ""print_hide_if_no_value"": 0, +- ""read_only"": 0, +- ""remember_last_selected_value"": 0, +- ""report_hide"": 0, +- ""reqd"": 0, +- ""search_index"": 0, +- ""set_only_once"": 0, +- ""translatable"": 0, +- ""unique"": 0 +- }, +- { +- ""allow_bulk_edit"": 0, +- ""allow_in_quick_entry"": 0, +- ""allow_on_submit"": 0, +- ""bold"": 0, +- ""collapsible"": 0, +- ""columns"": 0, +- ""depends_on"": """", +- ""description"": """", +- ""fieldname"": ""show_price"", +- ""fieldtype"": ""Check"", +- ""hidden"": 0, +- ""ignore_user_permissions"": 0, +- ""ignore_xss_filter"": 0, +- ""in_filter"": 0, +- ""in_global_search"": 0, +- ""in_list_view"": 0, +- ""in_standard_filter"": 0, +- ""label"": ""Show Price"", +- ""length"": 0, +- ""no_copy"": 0, +- ""permlevel"": 0, +- ""precision"": """", +- ""print_hide"": 0, +- ""print_hide_if_no_value"": 0, +- ""read_only"": 0, +- ""remember_last_selected_value"": 0, +- ""report_hide"": 0, +- ""reqd"": 0, +- ""search_index"": 0, +- ""set_only_once"": 0, +- ""translatable"": 0, +- ""unique"": 0 +- }, +- { +- ""allow_bulk_edit"": 0, +- ""allow_in_quick_entry"": 0, +- ""allow_on_submit"": 0, +- ""bold"": 0, +- ""collapsible"": 0, +- ""columns"": 0, +- ""fieldname"": ""show_stock_availability"", +- ""fieldtype"": ""Check"", +- ""hidden"": 0, +- ""ignore_user_permissions"": 0, +- ""ignore_xss_filter"": 0, +- ""in_filter"": 0, +- ""in_global_search"": 0, +- ""in_list_view"": 0, +- ""in_standard_filter"": 0, +- ""label"": ""Show Stock Availability"", +- ""length"": 0, +- ""no_copy"": 0, +- ""permlevel"": 0, +- ""precision"": """", +- ""print_hide"": 0, +- ""print_hide_if_no_value"": 0, +- ""read_only"": 0, +- ""remember_last_selected_value"": 0, +- ""report_hide"": 0, +- ""reqd"": 0, +- ""search_index"": 0, +- ""set_only_once"": 0, +- ""translatable"": 0, +- ""unique"": 0 +- }, +- { +- ""allow_bulk_edit"": 0, +- ""allow_in_quick_entry"": 0, +- ""allow_on_submit"": 0, +- ""bold"": 0, +- ""collapsible"": 0, +- ""columns"": 0, +- ""fieldname"": ""show_configure_button"", +- ""fieldtype"": ""Check"", +- ""hidden"": 0, +- ""ignore_user_permissions"": 0, +- ""ignore_xss_filter"": 0, +- ""in_filter"": 0, +- ""in_global_search"": 0, +- ""in_list_view"": 0, +- ""in_standard_filter"": 0, +- ""label"": ""Show Configure Button"", +- ""length"": 0, +- ""no_copy"": 0, +- ""permlevel"": 0, +- ""precision"": """", +- ""print_hide"": 0, +- ""print_hide_if_no_value"": 0, +- ""read_only"": 0, +- ""remember_last_selected_value"": 0, +- ""report_hide"": 0, +- ""reqd"": 0, +- ""search_index"": 0, +- ""set_only_once"": 0, +- ""translatable"": 0, +- ""unique"": 0 +- }, +- { +- ""allow_bulk_edit"": 0, +- ""allow_in_quick_entry"": 0, +- ""allow_on_submit"": 0, +- ""bold"": 0, +- ""collapsible"": 0, +- ""columns"": 0, +- ""fieldname"": ""show_contact_us_button"", +- ""fieldtype"": ""Check"", +- ""hidden"": 0, +- ""ignore_user_permissions"": 0, +- ""ignore_xss_filter"": 0, +- ""in_filter"": 0, +- ""in_global_search"": 0, +- ""in_list_view"": 0, +- ""in_standard_filter"": 0, +- ""label"": ""Show Contact Us Button"", +- ""length"": 0, +- ""no_copy"": 0, +- ""permlevel"": 0, +- ""precision"": """", +- ""print_hide"": 0, +- ""print_hide_if_no_value"": 0, +- ""read_only"": 0, +- ""remember_last_selected_value"": 0, +- ""report_hide"": 0, +- ""reqd"": 0, +- ""search_index"": 0, +- ""set_only_once"": 0, +- ""translatable"": 0, +- ""unique"": 0 +- }, +- { +- ""allow_bulk_edit"": 0, +- ""allow_in_quick_entry"": 0, +- ""allow_on_submit"": 0, +- ""bold"": 0, +- ""collapsible"": 0, +- ""columns"": 0, +- ""depends_on"": ""show_stock_availability"", +- ""fieldname"": ""show_quantity_in_website"", +- ""fieldtype"": ""Check"", +- ""hidden"": 0, +- ""ignore_user_permissions"": 0, +- ""ignore_xss_filter"": 0, +- ""in_filter"": 0, +- ""in_global_search"": 0, +- ""in_list_view"": 0, +- ""in_standard_filter"": 0, +- ""label"": ""Show Stock Quantity"", +- ""length"": 0, +- ""no_copy"": 0, +- ""permlevel"": 0, +- ""precision"": """", +- ""print_hide"": 0, +- ""print_hide_if_no_value"": 0, +- ""read_only"": 0, +- ""remember_last_selected_value"": 0, +- ""report_hide"": 0, +- ""reqd"": 0, +- ""search_index"": 0, +- ""set_only_once"": 0, +- ""translatable"": 0, +- ""unique"": 0 +- }, +- { +- ""allow_bulk_edit"": 0, +- ""allow_in_quick_entry"": 0, +- ""allow_on_submit"": 0, +- ""bold"": 0, +- ""collapsible"": 0, +- ""columns"": 0, +- ""depends_on"": """", +- ""fetch_if_empty"": 0, +- ""fieldname"": ""show_apply_coupon_code_in_website"", +- ""fieldtype"": ""Check"", +- ""hidden"": 0, +- ""ignore_user_permissions"": 0, +- ""ignore_xss_filter"": 0, +- ""in_filter"": 0, +- ""in_global_search"": 0, +- ""in_list_view"": 0, +- ""in_standard_filter"": 0, +- ""label"": ""Show Apply Coupon Code"", +- ""length"": 0, +- ""no_copy"": 0, +- ""permlevel"": 0, +- ""precision"": """", +- ""print_hide"": 0, +- ""print_hide_if_no_value"": 0, +- ""read_only"": 0, +- ""remember_last_selected_value"": 0, +- ""report_hide"": 0, +- ""reqd"": 0, +- ""search_index"": 0, +- ""set_only_once"": 0, +- ""translatable"": 0, +- ""unique"": 0 +- }, +- { +- ""allow_bulk_edit"": 0, +- ""allow_in_quick_entry"": 0, +- ""allow_on_submit"": 0, +- ""bold"": 0, +- ""collapsible"": 0, +- ""columns"": 0, +- ""fetch_if_empty"": 0, +- ""fieldname"": ""allow_items_not_in_stock"", +- ""fieldtype"": ""Check"", +- ""hidden"": 0, +- ""ignore_user_permissions"": 0, +- ""ignore_xss_filter"": 0, +- ""in_filter"": 0, +- ""in_global_search"": 0, +- ""in_list_view"": 0, +- ""in_standard_filter"": 0, +- ""label"": ""Allow items not in stock to be added to cart"", +- ""length"": 0, +- ""no_copy"": 0, +- ""permlevel"": 0, +- ""precision"": """", +- ""print_hide"": 0, +- ""print_hide_if_no_value"": 0, +- ""read_only"": 0, +- ""remember_last_selected_value"": 0, +- ""report_hide"": 0, +- ""reqd"": 0, +- ""search_index"": 0, +- ""set_only_once"": 0, +- ""translatable"": 0, +- ""unique"": 0 +- }, +- { +- ""allow_bulk_edit"": 0, +- ""allow_in_quick_entry"": 0, +- ""allow_on_submit"": 0, +- ""bold"": 0, +- ""collapsible"": 0, +- ""columns"": 0, +- ""depends_on"": ""enabled"", +- ""fieldname"": ""section_break_2"", +- ""fieldtype"": ""Section Break"", +- ""hidden"": 0, +- ""ignore_user_permissions"": 0, +- ""ignore_xss_filter"": 0, +- ""in_filter"": 0, +- ""in_global_search"": 0, +- ""in_list_view"": 0, +- ""in_standard_filter"": 0, +- ""length"": 0, +- ""no_copy"": 0, +- ""permlevel"": 0, +- ""print_hide"": 0, +- ""print_hide_if_no_value"": 0, +- ""read_only"": 0, +- ""remember_last_selected_value"": 0, +- ""report_hide"": 0, +- ""reqd"": 0, +- ""search_index"": 0, +- ""set_only_once"": 0, +- ""translatable"": 0, +- ""unique"": 0 +- }, +- { +- ""allow_bulk_edit"": 0, +- ""allow_in_quick_entry"": 0, +- ""allow_on_submit"": 0, +- ""bold"": 0, +- ""collapsible"": 0, +- ""columns"": 0, +- ""depends_on"": """", +- ""fieldname"": ""company"", +- ""fieldtype"": ""Link"", +- ""hidden"": 0, +- ""ignore_user_permissions"": 0, +- ""ignore_xss_filter"": 0, +- ""in_filter"": 0, +- ""in_global_search"": 0, +- ""in_list_view"": 1, +- ""in_standard_filter"": 0, +- ""label"": ""Company"", +- ""length"": 0, +- ""no_copy"": 0, +- ""options"": ""Company"", +- ""permlevel"": 0, +- ""print_hide"": 0, +- ""print_hide_if_no_value"": 0, +- ""read_only"": 0, +- ""remember_last_selected_value"": 1, +- ""report_hide"": 0, +- ""reqd"": 1, +- ""search_index"": 0, +- ""set_only_once"": 0, +- ""translatable"": 0, +- ""unique"": 0 +- }, +- { +- ""allow_bulk_edit"": 0, +- ""allow_in_quick_entry"": 0, +- ""allow_on_submit"": 0, +- ""bold"": 0, +- ""collapsible"": 0, +- ""columns"": 0, +- ""description"": ""Prices will not be shown if Price List is not set"", +- ""fieldname"": ""price_list"", +- ""fieldtype"": ""Link"", +- ""hidden"": 0, +- ""ignore_user_permissions"": 0, +- ""ignore_xss_filter"": 0, +- ""in_filter"": 0, +- ""in_global_search"": 0, +- ""in_list_view"": 0, +- ""in_standard_filter"": 0, +- ""label"": ""Price List"", +- ""length"": 0, +- ""no_copy"": 0, +- ""options"": ""Price List"", +- ""permlevel"": 0, +- ""precision"": """", +- ""print_hide"": 0, +- ""print_hide_if_no_value"": 0, +- ""read_only"": 0, +- ""remember_last_selected_value"": 0, +- ""report_hide"": 0, +- ""reqd"": 0, +- ""search_index"": 0, +- ""set_only_once"": 0, +- ""translatable"": 0, +- ""unique"": 0 +- }, +- { +- ""allow_bulk_edit"": 0, +- ""allow_in_quick_entry"": 0, +- ""allow_on_submit"": 0, +- ""bold"": 0, +- ""collapsible"": 0, +- ""columns"": 0, +- ""fieldname"": ""column_break_4"", +- ""fieldtype"": ""Column Break"", +- ""hidden"": 0, +- ""ignore_user_permissions"": 0, +- ""ignore_xss_filter"": 0, +- ""in_filter"": 0, +- ""in_global_search"": 0, +- ""in_list_view"": 0, +- ""in_standard_filter"": 0, +- ""length"": 0, +- ""no_copy"": 0, +- ""permlevel"": 0, +- ""print_hide"": 0, +- ""print_hide_if_no_value"": 0, +- ""read_only"": 0, +- ""remember_last_selected_value"": 0, +- ""report_hide"": 0, +- ""reqd"": 0, +- ""search_index"": 0, +- ""set_only_once"": 0, +- ""translatable"": 0, +- ""unique"": 0 +- }, +- { +- ""allow_bulk_edit"": 0, +- ""allow_in_quick_entry"": 0, +- ""allow_on_submit"": 0, +- ""bold"": 0, +- ""collapsible"": 0, +- ""columns"": 0, +- ""description"": """", +- ""fieldname"": ""default_customer_group"", +- ""fieldtype"": ""Link"", +- ""hidden"": 0, +- ""ignore_user_permissions"": 1, +- ""ignore_xss_filter"": 0, +- ""in_filter"": 0, +- ""in_global_search"": 0, +- ""in_list_view"": 0, +- ""in_standard_filter"": 0, +- ""label"": ""Default Customer Group"", +- ""length"": 0, +- ""no_copy"": 0, +- ""options"": ""Customer Group"", +- ""permlevel"": 0, +- ""print_hide"": 0, +- ""print_hide_if_no_value"": 0, +- ""read_only"": 0, +- ""remember_last_selected_value"": 0, +- ""report_hide"": 0, +- ""reqd"": 1, +- ""search_index"": 0, +- ""set_only_once"": 0, +- ""translatable"": 0, +- ""unique"": 0 +- }, +- { +- ""allow_bulk_edit"": 0, +- ""allow_in_quick_entry"": 0, +- ""allow_on_submit"": 0, +- ""bold"": 0, +- ""collapsible"": 0, +- ""columns"": 0, +- ""fieldname"": ""quotation_series"", +- ""fieldtype"": ""Select"", +- ""hidden"": 0, +- ""ignore_user_permissions"": 0, +- ""ignore_xss_filter"": 0, +- ""in_filter"": 0, +- ""in_global_search"": 0, +- ""in_list_view"": 0, +- ""in_standard_filter"": 0, +- ""label"": ""Quotation Series"", +- ""length"": 0, +- ""no_copy"": 0, +- ""permlevel"": 0, +- ""print_hide"": 0, +- ""print_hide_if_no_value"": 0, +- ""read_only"": 0, +- ""remember_last_selected_value"": 0, +- ""report_hide"": 0, +- ""reqd"": 1, +- ""search_index"": 0, +- ""set_only_once"": 0, +- ""translatable"": 0, +- ""unique"": 0 +- }, +- { +- ""allow_bulk_edit"": 0, +- ""allow_in_quick_entry"": 0, +- ""allow_on_submit"": 0, +- ""bold"": 0, +- ""collapsible"": 1, +- ""collapsible_depends_on"": ""eval:doc.enable_checkout"", +- ""columns"": 0, +- ""depends_on"": ""enabled"", +- ""fieldname"": ""section_break_8"", +- ""fieldtype"": ""Section Break"", +- ""hidden"": 0, +- ""ignore_user_permissions"": 0, +- ""ignore_xss_filter"": 0, +- ""in_filter"": 0, +- ""in_global_search"": 0, +- ""in_list_view"": 0, +- ""in_standard_filter"": 0, +- ""label"": ""Checkout Settings"", +- ""length"": 0, +- ""no_copy"": 0, +- ""permlevel"": 0, +- ""precision"": """", +- ""print_hide"": 0, +- ""print_hide_if_no_value"": 0, +- ""read_only"": 0, +- ""remember_last_selected_value"": 0, +- ""report_hide"": 0, +- ""reqd"": 0, +- ""search_index"": 0, +- ""set_only_once"": 0, +- ""translatable"": 0, +- ""unique"": 0 +- }, +- { +- ""allow_bulk_edit"": 0, +- ""allow_in_quick_entry"": 0, +- ""allow_on_submit"": 0, +- ""bold"": 0, +- ""collapsible"": 0, +- ""collapsible_depends_on"": """", +- ""columns"": 0, +- ""depends_on"": """", +- ""fieldname"": ""enable_checkout"", +- ""fieldtype"": ""Check"", +- ""hidden"": 0, +- ""ignore_user_permissions"": 0, +- ""ignore_xss_filter"": 0, +- ""in_filter"": 0, +- ""in_global_search"": 0, +- ""in_list_view"": 0, +- ""in_standard_filter"": 0, +- ""label"": ""Enable Checkout"", +- ""length"": 0, +- ""no_copy"": 0, +- ""permlevel"": 0, +- ""precision"": """", +- ""print_hide"": 0, +- ""print_hide_if_no_value"": 0, +- ""read_only"": 0, +- ""remember_last_selected_value"": 0, +- ""report_hide"": 0, +- ""reqd"": 0, +- ""search_index"": 0, +- ""set_only_once"": 0, +- ""translatable"": 0, +- ""unique"": 0 +- }, +- { +- ""allow_bulk_edit"": 0, +- ""allow_in_quick_entry"": 0, +- ""allow_on_submit"": 0, +- ""bold"": 0, +- ""collapsible"": 0, +- ""columns"": 0, +- ""default"": ""Orders"", +- ""description"": ""After payment completion redirect user to selected page."", +- ""fieldname"": ""payment_success_url"", +- ""fieldtype"": ""Select"", +- ""hidden"": 0, +- ""ignore_user_permissions"": 0, +- ""ignore_xss_filter"": 0, +- ""in_filter"": 0, +- ""in_global_search"": 0, +- ""in_list_view"": 0, +- ""in_standard_filter"": 0, +- ""label"": ""Payment Success Url"", +- ""length"": 0, +- ""no_copy"": 0, +- ""options"": ""\nOrders\nInvoices\nMy Account"", +- ""permlevel"": 0, +- ""precision"": """", +- ""print_hide"": 0, +- ""print_hide_if_no_value"": 0, +- ""read_only"": 0, +- ""remember_last_selected_value"": 0, +- ""report_hide"": 0, +- ""reqd"": 0, +- ""search_index"": 0, +- ""set_only_once"": 0, +- ""translatable"": 0, +- ""unique"": 0 +- }, +- { +- ""allow_bulk_edit"": 0, +- ""allow_in_quick_entry"": 0, +- ""allow_on_submit"": 0, +- ""bold"": 0, +- ""collapsible"": 0, +- ""columns"": 0, +- ""fieldname"": ""column_break_11"", +- ""fieldtype"": ""Column Break"", +- ""hidden"": 0, +- ""ignore_user_permissions"": 0, +- ""ignore_xss_filter"": 0, +- ""in_filter"": 0, +- ""in_global_search"": 0, +- ""in_list_view"": 0, +- ""in_standard_filter"": 0, +- ""length"": 0, +- ""no_copy"": 0, +- ""permlevel"": 0, +- ""precision"": """", +- ""print_hide"": 0, +- ""print_hide_if_no_value"": 0, +- ""read_only"": 0, +- ""remember_last_selected_value"": 0, +- ""report_hide"": 0, +- ""reqd"": 0, +- ""search_index"": 0, +- ""set_only_once"": 0, +- ""translatable"": 0, +- ""unique"": 0 +- }, +- { +- ""allow_bulk_edit"": 0, +- ""allow_in_quick_entry"": 0, +- ""allow_on_submit"": 0, +- ""bold"": 0, +- ""collapsible"": 0, +- ""columns"": 0, +- ""fieldname"": ""payment_gateway_account"", +- ""fieldtype"": ""Link"", +- ""hidden"": 0, +- ""ignore_user_permissions"": 0, +- ""ignore_xss_filter"": 0, +- ""in_filter"": 0, +- ""in_global_search"": 0, +- ""in_list_view"": 0, +- ""in_standard_filter"": 0, +- ""label"": ""Payment Gateway Account"", +- ""length"": 0, +- ""no_copy"": 0, +- ""options"": ""Payment Gateway Account"", +- ""permlevel"": 0, +- ""precision"": """", +- ""print_hide"": 0, +- ""print_hide_if_no_value"": 0, +- ""read_only"": 0, +- ""remember_last_selected_value"": 0, +- ""report_hide"": 0, +- ""reqd"": 0, +- ""search_index"": 0, +- ""set_only_once"": 0, +- ""translatable"": 0, +- ""unique"": 0 +- } +- ], +- ""has_web_view"": 0, +- ""hide_heading"": 0, +- ""hide_toolbar"": 0, +- ""icon"": ""fa fa-shopping-cart"", +- ""idx"": 1, +- ""image_view"": 0, +- ""in_create"": 0, +- ""is_submittable"": 0, +- ""issingle"": 1, +- ""istable"": 0, +- ""max_attachments"": 0, +- ""modified"": ""2019-10-14 13:54:24.575322"", +- ""modified_by"": ""Administrator"", +- ""module"": ""Shopping Cart"", +- ""name"": ""Shopping Cart Settings"", +- ""owner"": ""Administrator"", +- ""permissions"": [ +- { +- ""amend"": 0, +- ""cancel"": 0, +- ""create"": 1, +- ""delete"": 0, +- ""email"": 1, +- ""export"": 0, +- ""if_owner"": 0, +- ""import"": 0, +- ""permlevel"": 0, +- ""print"": 1, +- ""read"": 1, +- ""report"": 0, +- ""role"": ""Website Manager"", +- ""set_user_permissions"": 0, +- ""share"": 1, +- ""submit"": 0, +- ""write"": 1 +- } +- ], +- ""quick_entry"": 0, +- ""read_only"": 0, +- ""read_only_onload"": 0, +- ""show_name_in_global_search"": 0, +- ""sort_order"": ""ASC"", +- ""track_changes"": 0, +- ""track_seen"": 0, +- ""track_views"": 0 +- } +\ No newline at end of file ++ ""actions"": [], ++ ""creation"": ""2013-06-19 15:57:32"", ++ ""description"": ""Default settings for Shopping Cart"", ++ ""doctype"": ""DocType"", ++ ""document_type"": ""System"", ++ ""engine"": ""InnoDB"", ++ ""field_order"": [ ++ ""enabled"", ++ ""display_settings"", ++ ""show_attachments"", ++ ""show_price"", ++ ""show_stock_availability"", ++ ""enable_variants"", ++ ""column_break_7"", ++ ""show_contact_us_button"", ++ ""show_quantity_in_website"", ++ ""show_apply_coupon_code_in_website"", ++ ""allow_items_not_in_stock"", ++ ""section_break_2"", ++ ""company"", ++ ""price_list"", ++ ""column_break_4"", ++ ""default_customer_group"", ++ ""quotation_series"", ++ ""section_break_8"", ++ ""enable_checkout"", ++ ""payment_success_url"", ++ ""column_break_11"", ++ ""payment_gateway_account"" ++ ], ++ ""fields"": [ ++ { ++ ""default"": ""0"", ++ ""fieldname"": ""enabled"", ++ ""fieldtype"": ""Check"", ++ ""in_list_view"": 1, ++ ""label"": ""Enable Shopping Cart"" ++ }, ++ { ++ ""fieldname"": ""display_settings"", ++ ""fieldtype"": ""Section Break"", ++ ""label"": ""Display Settings"" ++ }, ++ { ++ ""default"": ""0"", ++ ""fieldname"": ""show_attachments"", ++ ""fieldtype"": ""Check"", ++ ""label"": ""Show Public Attachments"" ++ }, ++ { ++ ""default"": ""0"", ++ ""fieldname"": ""show_price"", ++ ""fieldtype"": ""Check"", ++ ""label"": ""Show Price"" ++ }, ++ { ++ ""default"": ""0"", ++ ""fieldname"": ""show_stock_availability"", ++ ""fieldtype"": ""Check"", ++ ""label"": ""Show Stock Availability"" ++ }, ++ { ++ ""default"": ""0"", ++ ""fieldname"": ""show_contact_us_button"", ++ ""fieldtype"": ""Check"", ++ ""label"": ""Show Contact Us Button"" ++ }, ++ { ++ ""default"": ""0"", ++ ""depends_on"": ""show_stock_availability"", ++ ""fieldname"": ""show_quantity_in_website"", ++ ""fieldtype"": ""Check"", ++ ""label"": ""Show Stock Quantity"" ++ }, ++ { ++ ""default"": ""0"", ++ ""fieldname"": ""show_apply_coupon_code_in_website"", ++ ""fieldtype"": ""Check"", ++ ""label"": ""Show Apply Coupon Code"" ++ }, ++ { ++ ""default"": ""0"", ++ ""fieldname"": ""allow_items_not_in_stock"", ++ ""fieldtype"": ""Check"", ++ ""label"": ""Allow items not in stock to be added to cart"" ++ }, ++ { ++ ""depends_on"": ""enabled"", ++ ""fieldname"": ""section_break_2"", ++ ""fieldtype"": ""Section Break"" ++ }, ++ { ++ ""fieldname"": ""company"", ++ ""fieldtype"": ""Link"", ++ ""in_list_view"": 1, ++ ""label"": ""Company"", ++ ""options"": ""Company"", ++ ""remember_last_selected_value"": 1, ++ ""reqd"": 1 ++ }, ++ { ++ ""description"": ""Prices will not be shown if Price List is not set"", ++ ""fieldname"": ""price_list"", ++ ""fieldtype"": ""Link"", ++ ""label"": ""Price List"", ++ ""options"": ""Price List"" ++ }, ++ { ++ ""fieldname"": ""column_break_4"", ++ ""fieldtype"": ""Column Break"" ++ }, ++ { ++ ""fieldname"": ""default_customer_group"", ++ ""fieldtype"": ""Link"", ++ ""ignore_user_permissions"": 1, ++ ""label"": ""Default Customer Group"", ++ ""options"": ""Customer Group"", ++ ""reqd"": 1 ++ }, ++ { ++ ""fieldname"": ""quotation_series"", ++ ""fieldtype"": ""Select"", ++ ""label"": ""Quotation Series"", ++ ""reqd"": 1 ++ }, ++ { ++ ""collapsible"": 1, ++ ""collapsible_depends_on"": ""eval:doc.enable_checkout"", ++ ""depends_on"": ""enabled"", ++ ""fieldname"": ""section_break_8"", ++ ""fieldtype"": ""Section Break"", ++ ""label"": ""Checkout Settings"" ++ }, ++ { ++ ""default"": ""0"", ++ ""fieldname"": ""enable_checkout"", ++ ""fieldtype"": ""Check"", ++ ""label"": ""Enable Checkout"" ++ }, ++ { ++ ""default"": ""Orders"", ++ ""description"": ""After payment completion redirect user to selected page."", ++ ""fieldname"": ""payment_success_url"", ++ ""fieldtype"": ""Select"", ++ ""label"": ""Payment Success Url"", ++ ""options"": ""\nOrders\nInvoices\nMy Account"" ++ }, ++ { ++ ""fieldname"": ""column_break_11"", ++ ""fieldtype"": ""Column Break"" ++ }, ++ { ++ ""fieldname"": ""payment_gateway_account"", ++ ""fieldtype"": ""Link"", ++ ""label"": ""Payment Gateway Account"", ++ ""options"": ""Payment Gateway Account"" ++ }, ++ { ++ ""fieldname"": ""column_break_7"", ++ ""fieldtype"": ""Column Break"" ++ }, ++ { ++ ""default"": ""0"", ++ ""fieldname"": ""enable_variants"", ++ ""fieldtype"": ""Check"", ++ ""label"": ""Enable Variants"" ++ } ++ ], ++ ""icon"": ""fa fa-shopping-cart"", ++ ""idx"": 1, ++ ""issingle"": 1, ++ ""links"": [], ++ ""modified"": ""2020-07-17 17:53:22.667228"", ++ ""modified_by"": ""Administrator"", ++ ""module"": ""Shopping Cart"", ++ ""name"": ""Shopping Cart Settings"", ++ ""owner"": ""Administrator"", ++ ""permissions"": [ ++ { ++ ""create"": 1, ++ ""email"": 1, ++ ""print"": 1, ++ ""read"": 1, ++ ""role"": ""Website Manager"", ++ ""share"": 1, ++ ""write"": 1 ++ } ++ ], ++ ""sort_field"": ""modified"", ++ ""sort_order"": ""ASC"" ++} +\ No newline at end of file +diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py +index 3098190383b3..c069b90e9868 100644 +--- a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py ++++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py +@@ -80,6 +80,7 @@ def get_shopping_cart_settings(): + + return frappe.local.shopping_cart_settings + ++@frappe.whitelist(allow_guest=True) + def is_cart_enabled(): + return get_shopping_cart_settings().enabled + +diff --git a/erpnext/templates/generators/item/item_configure.html b/erpnext/templates/generators/item/item_configure.html +index 04f89eca9dbb..b8b0d98bdc20 100644 +--- a/erpnext/templates/generators/item/item_configure.html ++++ b/erpnext/templates/generators/item/item_configure.html +@@ -2,7 +2,7 @@ + {% set cart_settings = shopping_cart.cart_settings %} + +
    +- {% if cart_settings.show_configure_button | int %} ++ {% if cart_settings.enable_variants | int %} + +- ++ +
    + ) + } +@@ -79,7 +79,7 @@ export const UnAuthenticated = (): JSX.Element => { +
    +
    The toolbar should show up now!
    + +- ++ +
    + ) + } +diff --git a/frontend/src/toolbar/index.tsx b/frontend/src/toolbar/index.tsx +index 32d24055b303a..33d26940958d4 100644 +--- a/frontend/src/toolbar/index.tsx ++++ b/frontend/src/toolbar/index.tsx +@@ -5,10 +5,10 @@ import ReactDOM from 'react-dom' + import Simmer from '@posthog/simmerjs' + import { initKea } from '~/initKea' + import { ToolbarApp } from '~/toolbar/ToolbarApp' +-import { EditorProps } from '~/types' ++import { ToolbarParams } from '~/types' + import { PostHog } from 'posthog-js' + ;(window as any)['simmer'] = new Simmer(window, { depth: 8 }) +-;(window as any)['ph_load_editor'] = function (editorParams: EditorProps, posthog: PostHog) { ++;(window as any)['ph_load_toolbar'] = function (toolbarParams: ToolbarParams, posthog: PostHog) { + initKea() + const container = document.createElement('div') + document.body.appendChild(container) +@@ -21,11 +21,13 @@ import { PostHog } from 'posthog-js' + + ReactDOM.render( + , + container + ) + } ++/** @deprecated, use ""ph_load_toolbar"" instead */ ++;(window as any)['ph_load_editor'] = (window as any)['ph_load_toolbar'] +diff --git a/frontend/src/toolbar/toolbarLogic.ts b/frontend/src/toolbar/toolbarLogic.ts +index ca418adf34308..910f808041ae7 100644 +--- a/frontend/src/toolbar/toolbarLogic.ts ++++ b/frontend/src/toolbar/toolbarLogic.ts +@@ -1,4 +1,4 @@ +-import { kea } from 'kea' ++import { actions, afterMount, kea, listeners, path, props, reducers, selectors } from 'kea' + import type { toolbarLogicType } from './toolbarLogicType' + import { ToolbarProps } from '~/types' + import { clearSessionToolbarToken } from '~/toolbar/utils' +@@ -6,12 +6,13 @@ import { posthog } from '~/toolbar/posthog' + import { actionsTabLogic } from '~/toolbar/actions/actionsTabLogic' + import { toolbarButtonLogic } from '~/toolbar/button/toolbarButtonLogic' + import type { PostHog } from 'posthog-js' ++import { lemonToast } from 'lib/components/lemonToast' + +-export const toolbarLogic = kea({ +- path: ['toolbar', 'toolbarLogic'], +- props: {} as ToolbarProps, ++export const toolbarLogic = kea([ ++ path(['toolbar', 'toolbarLogic']), ++ props({} as ToolbarProps), + +- actions: () => ({ ++ actions({ + authenticate: true, + logout: true, + tokenExpired: true, +@@ -21,27 +22,29 @@ export const toolbarLogic = kea({ + hideButton: true, + }), + +- reducers: ({ props }) => ({ ++ reducers(({ props }) => ({ + rawApiURL: [props.apiURL as string], + rawJsURL: [(props.jsURL || props.apiURL) as string], + temporaryToken: [props.temporaryToken || null, { logout: () => null, tokenExpired: () => null }], + actionId: [props.actionId || null, { logout: () => null, clearUserIntent: () => null }], + userIntent: [props.userIntent || null, { logout: () => null, clearUserIntent: () => null }], ++ source: [props.source || null, { logout: () => null }], + buttonVisible: [true, { showButton: () => true, hideButton: () => false, logout: () => false }], + dataAttributes: [(props.dataAttributes || []) as string[]], + posthog: [(props.posthog ?? null) as PostHog | null], +- }), ++ })), + +- selectors: ({ selectors }) => ({ +- apiURL: [ +- () => [selectors.rawApiURL], +- (apiURL) => `${apiURL.endsWith('/') ? apiURL.replace(/\/+$/, '') : apiURL}`, ++ selectors({ ++ apiURL: [(s) => [s.rawApiURL], (apiURL) => `${apiURL.endsWith('/') ? apiURL.replace(/\/+$/, '') : apiURL}`], ++ jsURL: [ ++ (s) => [s.rawJsURL, s.apiURL], ++ (rawJsURL, apiUrl) => ++ `${rawJsURL ? (rawJsURL.endsWith('/') ? rawJsURL.replace(/\/+$/, '') : rawJsURL) : apiUrl}`, + ], +- jsURL: [() => [selectors.rawJsURL], (jsURL) => `${jsURL.endsWith('/') ? jsURL.replace(/\/+$/, '') : jsURL}`], +- isAuthenticated: [() => [selectors.temporaryToken], (temporaryToken) => !!temporaryToken], ++ isAuthenticated: [(s) => [s.temporaryToken], (temporaryToken) => !!temporaryToken], + }), + +- listeners: ({ values, props }) => ({ ++ listeners(({ values, props }) => ({ + authenticate: () => { + posthog.capture('toolbar authenticate', { is_authenticated: values.isAuthenticated }) + const encodedUrl = encodeURIComponent(window.location.href) +@@ -55,6 +58,9 @@ export const toolbarLogic = kea({ + tokenExpired: () => { + posthog.capture('toolbar token expired') + console.log('PostHog Toolbar API token expired. Clearing session.') ++ if (values.source !== 'localstorage') { ++ lemonToast.error('PostHog Toolbar API token expired.') ++ } + clearSessionToolbarToken() + }, + processUserIntent: async () => { +@@ -64,21 +70,19 @@ export const toolbarLogic = kea({ + // the right view will next be opened in `actionsTabLogic` on `getActionsSuccess` + } + }, +- }), ++ })), + +- events: ({ props, actions, values }) => ({ +- afterMount() { +- if (props.instrument) { +- const distinctId = props.distinctId +- if (distinctId) { +- posthog.identify(distinctId, props.userEmail ? { email: props.userEmail } : {}) +- } +- posthog.optIn() ++ afterMount(({ props, actions, values }) => { ++ if (props.instrument) { ++ const distinctId = props.distinctId ++ if (distinctId) { ++ posthog.identify(distinctId, props.userEmail ? { email: props.userEmail } : {}) + } +- if (props.userIntent) { +- actions.processUserIntent() +- } +- posthog.capture('toolbar loaded', { is_authenticated: values.isAuthenticated }) +- }, ++ posthog.optIn() ++ } ++ if (props.userIntent) { ++ actions.processUserIntent() ++ } ++ posthog.capture('toolbar loaded', { is_authenticated: values.isAuthenticated }) + }), +-}) ++]) +diff --git a/frontend/src/toolbar/utils.ts b/frontend/src/toolbar/utils.ts +index 93b70ac031eb4..fdb1d00e7d771 100644 +--- a/frontend/src/toolbar/utils.ts ++++ b/frontend/src/toolbar/utils.ts +@@ -323,6 +323,9 @@ export function stepToDatabaseFormat(step: ActionStepForm): ActionStepType { + } + + export function clearSessionToolbarToken(): void { ++ window.sessionStorage?.removeItem('_postHogToolbarParams') ++ window.localStorage?.removeItem('_postHogToolbarParams') ++ // keeping these around for compatibility, should be eventually removed + window.sessionStorage?.removeItem('_postHogEditorParams') + window.localStorage?.removeItem('_postHogEditorParams') + } +diff --git a/frontend/src/types.ts b/frontend/src/types.ts +index 242469416d433..de356b9a481d4 100644 +--- a/frontend/src/types.ts ++++ b/frontend/src/types.ts +@@ -330,13 +330,19 @@ export interface ElementType { + } + + export type ToolbarUserIntent = 'add-action' | 'edit-action' ++export type ToolbarSource = 'url' | 'localstorage' ++export type ToolbarVersion = 'toolbar' + +-export interface EditorProps { ++/* sync with posthog-js */ ++export interface ToolbarParams { + apiURL?: string + jsURL?: string +- temporaryToken?: string ++ token?: string /** public posthog-js token */ ++ temporaryToken?: string /** private temporary user token */ + actionId?: number + userIntent?: ToolbarUserIntent ++ source?: ToolbarSource ++ toolbarVersion?: ToolbarVersion + instrument?: boolean + distinctId?: string + userEmail?: string +@@ -344,7 +350,7 @@ export interface EditorProps { + featureFlags?: Record + } + +-export interface ToolbarProps extends EditorProps { ++export interface ToolbarProps extends ToolbarParams { + posthog?: PostHog + disableExternalStyles?: boolean + } +diff --git a/posthog/api/decide.py b/posthog/api/decide.py +index c7fee50f740c6..776b582a1dc0a 100644 +--- a/posthog/api/decide.py ++++ b/posthog/api/decide.py +@@ -62,7 +62,7 @@ def get_decide(request: HttpRequest): + + response = { + ""config"": {""enable_collect_everything"": True}, +- ""editorParams"": {}, ++ ""toolbarParams"": {}, + ""isAuthenticated"": False, + ""supportedCompression"": [""gzip"", ""gzip-js"", ""lz64""], + } +diff --git a/posthog/api/test/test_decide.py b/posthog/api/test/test_decide.py +index 201243c16adea..337755f050d3b 100644 +--- a/posthog/api/test/test_decide.py ++++ b/posthog/api/test/test_decide.py +@@ -73,7 +73,7 @@ def test_user_on_evil_site(self): + self.team.save() + response = self.client.get(""/decide/"", HTTP_ORIGIN=""https://evilsite.com"").json() + self.assertEqual(response[""isAuthenticated""], False) +- self.assertIsNone(response[""editorParams""].get(""toolbarVersion"", None)) ++ self.assertIsNone(response[""toolbarParams""].get(""toolbarVersion"", None)) + + def test_user_session_recording_opt_in(self): + # :TRICKY: Test for regression around caching" +core,https://github.com/stenciljs/core,37bbd8ce651e599232c1e6370903b8242808f3ee,Christian Bromann,2024-03-06 21:29:55,feat(compiler): update glob and minimatch dependencies (#5436),"* feat(compiler): update glob and minimatch dependencies + +STENCIL-912 + +* update renovate","feat(compiler): update glob and minimatch dependencies (#5436) + +* feat(compiler): update glob and minimatch dependencies + +STENCIL-912 + +* update renovate","diff --git a/package-lock.json b/package-lock.json +index 27c7ed0b87d..9b6ccad8750 100644 +--- a/package-lock.json ++++ b/package-lock.json +@@ -21,7 +21,6 @@ + ""@types/eslint"": ""^8.4.6"", + ""@types/exit"": ""^0.1.31"", + ""@types/fs-extra"": ""^11.0.0"", +- ""@types/glob"": ""^8.0.0"", + ""@types/graceful-fs"": ""^4.1.5"", + ""@types/jest"": ""^27.0.3"", + ""@types/listr"": ""^0.14.4"", +@@ -50,7 +49,7 @@ + ""execa"": ""8.0.1"", + ""exit"": ""^0.1.2"", + ""fs-extra"": ""^11.0.0"", +- ""glob"": ""8.1.0"", ++ ""glob"": ""10.3.10"", + ""graceful-fs"": ""~4.2.6"", + ""jest"": ""^27.4.5"", + ""jest-cli"": ""^27.4.5"", +@@ -60,7 +59,7 @@ + ""magic-string"": ""^0.30.0"", + ""merge-source-map"": ""^1.1.0"", + ""mime-db"": ""^1.46.0"", +- ""minimatch"": ""5.1.6"", ++ ""minimatch"": ""9.0.3"", + ""node-fetch"": ""3.3.2"", + ""open"": ""^9.0.0"", + ""open-in-editor"": ""2.2.0"", +@@ -2868,16 +2867,6 @@ + ""@types/node"": ""*"" + } + }, +- ""node_modules/@types/glob"": { +- ""version"": ""8.1.0"", +- ""resolved"": ""https://registry.npmjs.org/@types/glob/-/glob-8.1.0.tgz"", +- ""integrity"": ""sha512-IO+MJPVhoqz+28h1qLAcBEH2+xHMK6MTyHJc7MTnnYb6wsoLR29POVGJ7LycmVXIqyy/4/2ShP5sUwTXuOwb/w=="", +- ""dev"": true, +- ""dependencies"": { +- ""@types/minimatch"": ""^5.1.2"", +- ""@types/node"": ""*"" +- } +- }, + ""node_modules/@types/graceful-fs"": { + ""version"": ""4.1.9"", + ""resolved"": ""https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz"", +@@ -2946,12 +2935,6 @@ + ""rxjs"": ""^6.5.1"" + } + }, +- ""node_modules/@types/minimatch"": { +- ""version"": ""5.1.2"", +- ""resolved"": ""https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz"", +- ""integrity"": ""sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA=="", +- ""dev"": true +- }, + ""node_modules/@types/node"": { + ""version"": ""20.11.24"", + ""resolved"": ""https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz"", +@@ -3210,21 +3193,6 @@ + } + } + }, +- ""node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch"": { +- ""version"": ""9.0.3"", +- ""resolved"": ""https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz"", +- ""integrity"": ""sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg=="", +- ""dev"": true, +- ""dependencies"": { +- ""brace-expansion"": ""^2.0.1"" +- }, +- ""engines"": { +- ""node"": "">=16 || 14 >=14.17"" +- }, +- ""funding"": { +- ""url"": ""https://github.com/sponsors/isaacs"" +- } +- }, + ""node_modules/@typescript-eslint/utils"": { + ""version"": ""7.1.0"", + ""resolved"": ""https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.1.0.tgz"", +@@ -6274,43 +6242,6 @@ + ""node"": "">=16"" + } + }, +- ""node_modules/file-entry-cache/node_modules/glob"": { +- ""version"": ""10.3.10"", +- ""resolved"": ""https://registry.npmjs.org/glob/-/glob-10.3.10.tgz"", +- ""integrity"": ""sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g=="", +- ""dev"": true, +- ""dependencies"": { +- ""foreground-child"": ""^3.1.0"", +- ""jackspeak"": ""^2.3.5"", +- ""minimatch"": ""^9.0.1"", +- ""minipass"": ""^5.0.0 || ^6.0.2 || ^7.0.0"", +- ""path-scurry"": ""^1.10.1"" +- }, +- ""bin"": { +- ""glob"": ""dist/esm/bin.mjs"" +- }, +- ""engines"": { +- ""node"": "">=16 || 14 >=14.17"" +- }, +- ""funding"": { +- ""url"": ""https://github.com/sponsors/isaacs"" +- } +- }, +- ""node_modules/file-entry-cache/node_modules/minimatch"": { +- ""version"": ""9.0.3"", +- ""resolved"": ""https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz"", +- ""integrity"": ""sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg=="", +- ""dev"": true, +- ""dependencies"": { +- ""brace-expansion"": ""^2.0.1"" +- }, +- ""engines"": { +- ""node"": "">=16 || 14 >=14.17"" +- }, +- ""funding"": { +- ""url"": ""https://github.com/sponsors/isaacs"" +- } +- }, + ""node_modules/file-entry-cache/node_modules/rimraf"": { + ""version"": ""5.0.5"", + ""resolved"": ""https://registry.npmjs.org/rimraf/-/rimraf-5.0.5.tgz"", +@@ -6637,19 +6568,22 @@ + } + }, + ""node_modules/glob"": { +- ""version"": ""8.1.0"", +- ""resolved"": ""https://registry.npmjs.org/glob/-/glob-8.1.0.tgz"", +- ""integrity"": ""sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ=="", ++ ""version"": ""10.3.10"", ++ ""resolved"": ""https://registry.npmjs.org/glob/-/glob-10.3.10.tgz"", ++ ""integrity"": ""sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g=="", + ""dev"": true, + ""dependencies"": { +- ""fs.realpath"": ""^1.0.0"", +- ""inflight"": ""^1.0.4"", +- ""inherits"": ""2"", +- ""minimatch"": ""^5.0.1"", +- ""once"": ""^1.3.0"" ++ ""foreground-child"": ""^3.1.0"", ++ ""jackspeak"": ""^2.3.5"", ++ ""minimatch"": ""^9.0.1"", ++ ""minipass"": ""^5.0.0 || ^6.0.2 || ^7.0.0"", ++ ""path-scurry"": ""^1.10.1"" ++ }, ++ ""bin"": { ++ ""glob"": ""dist/esm/bin.mjs"" + }, + ""engines"": { +- ""node"": "">=12"" ++ ""node"": "">=16 || 14 >=14.17"" + }, + ""funding"": { + ""url"": ""https://github.com/sponsors/isaacs"" +@@ -9900,15 +9834,18 @@ + } + }, + ""node_modules/minimatch"": { +- ""version"": ""5.1.6"", +- ""resolved"": ""https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz"", +- ""integrity"": ""sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g=="", ++ ""version"": ""9.0.3"", ++ ""resolved"": ""https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz"", ++ ""integrity"": ""sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg=="", + ""dev"": true, + ""dependencies"": { + ""brace-expansion"": ""^2.0.1"" + }, + ""engines"": { +- ""node"": "">=10"" ++ ""node"": "">=16 || 14 >=14.17"" ++ }, ++ ""funding"": { ++ ""url"": ""https://github.com/sponsors/isaacs"" + } + }, + ""node_modules/minimist"": { +diff --git a/package.json b/package.json +index b9e6c5f1bb9..f5ccb0d3662 100644 +--- a/package.json ++++ b/package.json +@@ -67,7 +67,6 @@ + ""@types/eslint"": ""^8.4.6"", + ""@types/exit"": ""^0.1.31"", + ""@types/fs-extra"": ""^11.0.0"", +- ""@types/glob"": ""^8.0.0"", + ""@types/graceful-fs"": ""^4.1.5"", + ""@types/jest"": ""^27.0.3"", + ""@types/listr"": ""^0.14.4"", +@@ -96,7 +95,7 @@ + ""execa"": ""8.0.1"", + ""exit"": ""^0.1.2"", + ""fs-extra"": ""^11.0.0"", +- ""glob"": ""8.1.0"", ++ ""glob"": ""10.3.10"", + ""graceful-fs"": ""~4.2.6"", + ""jest"": ""^27.4.5"", + ""jest-cli"": ""^27.4.5"", +@@ -106,7 +105,7 @@ + ""magic-string"": ""^0.30.0"", + ""merge-source-map"": ""^1.1.0"", + ""mime-db"": ""^1.46.0"", +- ""minimatch"": ""5.1.6"", ++ ""minimatch"": ""9.0.3"", + ""node-fetch"": ""3.3.2"", + ""open"": ""^9.0.0"", + ""open-in-editor"": ""2.2.0"", +diff --git a/renovate.json5 b/renovate.json5 +index 72642842547..b7c326f65cc 100644 +--- a/renovate.json5 ++++ b/renovate.json5 +@@ -13,9 +13,6 @@ + 'rollup', + '@rollup/plugin-commonjs', + '@rollup/plugin-node-resolve', +- // TODO(STENCIL-912): Upgrade these two dependencies +- 'glob', +- 'minimatch', + ], + ignorePaths: [ + 'test/package.json', +diff --git a/scripts/bundles/internal-platform-client.ts b/scripts/bundles/internal-platform-client.ts +index 1f678ff339c..4ef09ccb9af 100644 +--- a/scripts/bundles/internal-platform-client.ts ++++ b/scripts/bundles/internal-platform-client.ts +@@ -1,5 +1,5 @@ + import fs from 'fs-extra'; +-import glob from 'glob'; ++import { glob } from 'glob'; + import { basename, join } from 'path'; + import { RollupOptions } from 'rollup'; + +diff --git a/scripts/esbuild/internal-platform-client.ts b/scripts/esbuild/internal-platform-client.ts +index aab98239599..d22b8e474c3 100644 +--- a/scripts/esbuild/internal-platform-client.ts ++++ b/scripts/esbuild/internal-platform-client.ts +@@ -1,7 +1,7 @@ + import type { BuildOptions as ESBuildOptions, Plugin } from 'esbuild'; + import { replace } from 'esbuild-plugin-replace'; + import fs from 'fs-extra'; +-import glob from 'glob'; ++import { glob } from 'glob'; + import { join } from 'path'; + + import { getBanner } from '../utils/banner'; +diff --git a/src/compiler/build/build-hmr.ts b/src/compiler/build/build-hmr.ts +index 62877ff92dd..50f0d6002b5 100644 +--- a/src/compiler/build/build-hmr.ts ++++ b/src/compiler/build/build-hmr.ts +@@ -1,5 +1,5 @@ + import { isGlob, isOutputTargetWww, normalizePath, sortBy } from '@utils'; +-import minimatch from 'minimatch'; ++import { minimatch } from 'minimatch'; + import { basename } from 'path'; + + import type * as d from '../../declarations'; +diff --git a/src/compiler/output-targets/copy/output-copy.ts b/src/compiler/output-targets/copy/output-copy.ts +index 32c934e21d3..41f7b70fa1f 100644 +--- a/src/compiler/output-targets/copy/output-copy.ts ++++ b/src/compiler/output-targets/copy/output-copy.ts +@@ -1,5 +1,5 @@ + import { buildError, isGlob, isOutputTargetCopy, join, normalizePath } from '@utils'; +-import minimatch from 'minimatch'; ++import { minimatch } from 'minimatch'; + + import type * as d from '../../../declarations'; + import { canSkipAssetsCopy, getComponentAssetsCopyTasks } from './assets-copy-tasks'; +diff --git a/src/sys/node/node-copy-tasks.ts b/src/sys/node/node-copy-tasks.ts +index b9298632065..36de70268db 100644 +--- a/src/sys/node/node-copy-tasks.ts ++++ b/src/sys/node/node-copy-tasks.ts +@@ -1,5 +1,5 @@ + import { buildError, catchError, flatOne, isGlob, normalizePath } from '@utils'; +-import glob from 'glob'; ++import { glob } from 'glob'; + import path from 'path'; + + import type * as d from '../../declarations'; +@@ -177,14 +177,5 @@ function shouldIgnore(filePath: string) { + const IGNORE = ['.ds_store', '.gitignore', 'desktop.ini', 'thumbs.db']; + + export function asyncGlob(pattern: string, opts: any) { +- return new Promise((resolve, reject) => { +- const g: typeof glob = (glob as any).glob; +- g(pattern, opts, (err: any, files: string[]) => { +- if (err) { +- reject(err); +- } else { +- resolve(files); +- } +- }); +- }); ++ return glob(pattern, opts); + }" +label-studio,https://github.com/HumanSignal/label-studio,f1eabb125916472d7448bd8d21ef65272ae387e7,Max Tkachenko,2023-04-03 20:21:30,feat: LSDV-4896: Show DM actions to reviewers (#3961),"* feat: LSDV-4896: Show DM actions to reviewers + +* ci: Update Feature Flags","feat: LSDV-4896: Show DM actions to reviewers (#3961) + +* feat: LSDV-4896: Show DM actions to reviewers + +* ci: Update Feature Flags","diff --git a/label_studio/data_manager/actions/__init__.py b/label_studio/data_manager/actions/__init__.py +index a0ee7c10ee2a..2b98dba9ac47 100644 +--- a/label_studio/data_manager/actions/__init__.py ++++ b/label_studio/data_manager/actions/__init__.py +@@ -84,7 +84,7 @@ def register_actions_from_dir(base_module, action_dir): + """""" + for path in os.listdir(action_dir): + # skip non module files +- if '__init__' in path or path.startswith('.'): ++ if '__init__' in path or '__pycache' in path or path.startswith('.'): + continue + + name = path[0:path.find('.py')] # get only module name to read *.py and *.pyc +diff --git a/label_studio/data_manager/actions/experimental.py b/label_studio/data_manager/actions/experimental.py +index 4e871a8427d5..7aa49028482b 100644 +--- a/label_studio/data_manager/actions/experimental.py ++++ b/label_studio/data_manager/actions/experimental.py +@@ -346,7 +346,7 @@ def add_data_field_form(user, project): + actions = [ + { + 'entry_point': add_data_field, +- 'permission': all_permissions.tasks_change, ++ 'permission': all_permissions.projects_change, + 'title': 'Add Or Modify Data Field', + 'order': 1, + 'experimental': True, +@@ -378,7 +378,7 @@ def add_data_field_form(user, project): + + { + 'entry_point': remove_duplicates, +- 'permission': all_permissions.tasks_change, ++ 'permission': all_permissions.projects_change, + 'title': 'Remove Duplicated Tasks', + 'order': 1, + 'experimental': True, +diff --git a/label_studio/feature_flags.json b/label_studio/feature_flags.json +index 8f9cceed53ef..d31d7f939098 100644 +--- a/label_studio/feature_flags.json ++++ b/label_studio/feature_flags.json +@@ -2769,6 +2769,33 @@ + ""version"": 2, + ""deleted"": false + }, ++ ""fflag_fix_back_lsdv_4826_annotation_history_20230331_short"": { ++ ""key"": ""fflag_fix_back_lsdv_4826_annotation_history_20230331_short"", ++ ""on"": false, ++ ""prerequisites"": [], ++ ""targets"": [], ++ ""contextTargets"": [], ++ ""rules"": [], ++ ""fallthrough"": { ++ ""variation"": 0 ++ }, ++ ""offVariation"": 1, ++ ""variations"": [ ++ true, ++ false ++ ], ++ ""clientSideAvailability"": { ++ ""usingMobileKey"": false, ++ ""usingEnvironmentId"": false ++ }, ++ ""clientSide"": false, ++ ""salt"": ""4f718ebf33a749b596b408d6b04798d8"", ++ ""trackEvents"": false, ++ ""trackEventsFallthrough"": false, ++ ""debugEventsUntilDate"": null, ++ ""version"": 2, ++ ""deleted"": false ++ }, + ""fflag_fix_font_lsdv_1148_hotkeys_namespaces_01022023_short"": { + ""key"": ""fflag_fix_font_lsdv_1148_hotkeys_namespaces_01022023_short"", + ""on"": true, +@@ -3256,4 +3283,4 @@ + ""deleted"": false + } + } +-} +\ No newline at end of file ++}" +gping,https://github.com/orf/gping,fd0269964cee01a41a3e70c0e2326faf5c8000bd,dependabot[bot],2023-10-25 16:18:28,chore(deps): bump const_format from 0.2.31 to 0.2.32,"Bumps [const_format](https://github.com/rodrimati1992/const_format_crates) from 0.2.31 to 0.2.32. +- [Release notes](https://github.com/rodrimati1992/const_format_crates/releases) +- [Changelog](https://github.com/rodrimati1992/const_format_crates/blob/master/Changelog.md) +- [Commits](https://github.com/rodrimati1992/const_format_crates/commits) + +---","chore(deps): bump const_format from 0.2.31 to 0.2.32 + +Bumps [const_format](https://github.com/rodrimati1992/const_format_crates) from 0.2.31 to 0.2.32. +- [Release notes](https://github.com/rodrimati1992/const_format_crates/releases) +- [Changelog](https://github.com/rodrimati1992/const_format_crates/blob/master/Changelog.md) +- [Commits](https://github.com/rodrimati1992/const_format_crates/commits) + +--- +updated-dependencies: +- dependency-name: const_format + dependency-type: direct:production + update-type: version-update:semver-patch +... + +Signed-off-by: dependabot[bot] ","diff --git a/Cargo.lock b/Cargo.lock +index 56a3fbb3..cef60bbc 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -193,18 +193,18 @@ checksum = ""fbdcdcb6d86f71c5e97409ad45898af11cbc995b4ee8112d59095a28d376c935"" + + [[package]] + name = ""const_format"" +-version = ""0.2.31"" ++version = ""0.2.32"" + source = ""registry+https://github.com/rust-lang/crates.io-index"" +-checksum = ""c990efc7a285731f9a4378d81aff2f0e85a2c8781a05ef0f8baa8dac54d0ff48"" ++checksum = ""e3a214c7af3d04997541b18d432afaff4c455e79e2029079647e72fc2bd27673"" + dependencies = [ + ""const_format_proc_macros"", + ] + + [[package]] + name = ""const_format_proc_macros"" +-version = ""0.2.31"" ++version = ""0.2.32"" + source = ""registry+https://github.com/rust-lang/crates.io-index"" +-checksum = ""e026b6ce194a874cb9cf32cd5772d1ef9767cc8fcb5765948d74f37a9d8b2bf6"" ++checksum = ""c7f6ff08fd20f4f299298a28e2dfa8a8ba1036e6cd2460ac1de7b425d76f2500"" + dependencies = [ + ""proc-macro2"", + ""quote"", +diff --git a/gping/Cargo.toml b/gping/Cargo.toml +index b35b7fde..b6d3317d 100644 +--- a/gping/Cargo.toml ++++ b/gping/Cargo.toml +@@ -18,7 +18,7 @@ dns-lookup = ""2.0.0"" + chrono = ""0.4.31"" + itertools = ""0.11.0"" + shadow-rs = ""0.24.1"" +-const_format = ""0.2.31"" ++const_format = ""0.2.32"" + clap = { version = ""4.4.7"", features = [""derive""] } + + [build-dependencies]" +go-cqhttp,https://github.com/Mrs4s/go-cqhttp,9f7e31766bedf0c47f530b2dab561dd85de7f5a2,wdvxdr,2021-05-30 11:35:50,refactor(server): replace gin with net/http,reduce binary size about 2M,"refactor(server): replace gin with net/http + +reduce binary size about 2M","diff --git a/coolq/event.go b/coolq/event.go +index d3351b6f9..c9302a82f 100644 +--- a/coolq/event.go ++++ b/coolq/event.go +@@ -2,6 +2,7 @@ package coolq + + import ( + ""encoding/hex"" ++ ""fmt"" + ""io/ioutil"" + ""path"" + ""strconv"" +@@ -40,6 +41,7 @@ func (bot *CQBot) privateMessageEvent(c *client.QQClient, m *message.PrivateMess + bot.oneWayMsgCache.Store(m.Sender.Uin, """") + } + id := m.Id ++ fmt.Println(m) + if bot.db != nil { + id = bot.InsertPrivateMessage(m) + } +diff --git a/global/param.go b/global/param.go +index 535ddf17e..0eed41bc8 100644 +--- a/global/param.go ++++ b/global/param.go +@@ -11,18 +11,6 @@ import ( + ""github.com/tidwall/gjson"" + ) + +-var trueSet = map[string]struct{}{ +- ""true"": {}, +- ""yes"": {}, +- ""1"": {}, +-} +- +-var falseSet = map[string]struct{}{ +- ""false"": {}, +- ""no"": {}, +- ""0"": {}, +-} +- + // EnsureBool 判断给定的p是否可表示为合法Bool类型,否则返回defaultVal + // + // 支持的合法类型有 +@@ -55,13 +43,14 @@ func EnsureBool(p interface{}, defaultVal bool) bool { + str = s + } + str = strings.ToLower(str) +- if _, ok := trueSet[str]; ok { ++ switch str { ++ case ""true"", ""yes"", ""1"": + return true +- } +- if _, ok := falseSet[str]; ok { ++ case ""false"", ""no"", ""0"": + return false ++ default: ++ return defaultVal + } +- return defaultVal + } + + // VersionNameCompare 检查版本名是否需要更新, 仅适用于 go-cqhttp 的版本命名规则 +diff --git a/go.mod b/go.mod +index 696520f0f..5b16ac57a 100644 +--- a/go.mod ++++ b/go.mod +@@ -6,8 +6,7 @@ require ( + github.com/Baozisoftware/qrcode-terminal-go v0.0.0-20170407111555-c0650d8dff0f + github.com/Mrs4s/MiraiGo v0.0.0-20210525010101-8f0cd9494d64 + github.com/dustin/go-humanize v1.0.0 +- github.com/gin-contrib/pprof v1.3.0 +- github.com/gin-gonic/gin v1.7.1 ++ github.com/gin-gonic/gin v1.7.1 // indirect + github.com/gorilla/websocket v1.4.2 + github.com/guonaihong/gout v0.1.9 + github.com/jonboulle/clockwork v0.2.2 // indirect +diff --git a/go.sum b/go.sum +index e423e2942..f106a5e3b 100644 +--- a/go.sum ++++ b/go.sum +@@ -14,15 +14,11 @@ github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25Kn + github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= + github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= + github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +-github.com/gin-contrib/pprof v1.3.0 h1:G9eK6HnbkSqDZBYbzG4wrjCsA4e+cvYAHUZw6W+W9K0= +-github.com/gin-contrib/pprof v1.3.0/go.mod h1:waMjT1H9b179t3CxuG1cV3DHpga6ybizwfBaM5OXaB0= + github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= + github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= + github.com/gin-gonic/gin v1.6.0/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= +-github.com/gin-gonic/gin v1.6.2/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= + github.com/gin-gonic/gin v1.7.1 h1:qC89GU3p8TvKWMAVhEpmpB2CIb1hnqt2UdKZaP93mS8= + github.com/gin-gonic/gin v1.7.1/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= +-github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= + github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= + github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= + github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +diff --git a/server/http.go b/server/http.go +index c77ae13e8..dca14843e 100644 +--- a/server/http.go ++++ b/server/http.go +@@ -7,29 +7,32 @@ import ( + ""crypto/sha1"" + ""encoding/hex"" + ""fmt"" ++ ""io"" + ""net/http"" ++ ""net/url"" + ""os"" + ""strings"" + ""time"" + +- ""github.com/Mrs4s/go-cqhttp/coolq"" +- ""github.com/Mrs4s/go-cqhttp/global/config"" +- + ""github.com/Mrs4s/MiraiGo/utils"" +- ""github.com/gin-gonic/gin"" + ""github.com/guonaihong/gout"" + ""github.com/guonaihong/gout/dataflow"" ++ jsoniter ""github.com/json-iterator/go"" + log ""github.com/sirupsen/logrus"" + ""github.com/tidwall/gjson"" ++ ++ ""github.com/Mrs4s/go-cqhttp/coolq"" ++ ""github.com/Mrs4s/go-cqhttp/global/config"" + ) + + type httpServer struct { +- engine *gin.Engine +- bot *coolq.CQBot +- HTTP *http.Server +- api *apiCaller ++ HTTP *http.Server ++ api *apiCaller ++ accessToken string + } + ++var json = jsoniter.ConfigCompatibleWithStandardLibrary ++ + // HTTPClient 反向HTTP上报客户端 + type HTTPClient struct { + bot *coolq.CQBot +@@ -39,8 +42,102 @@ type HTTPClient struct { + timeout int32 + } + +-type httpContext struct { +- ctx *gin.Context ++type httpCtx struct { ++ json gjson.Result ++ query url.Values ++ postForm url.Values ++ ++ headerAuth string ++} ++ ++func (h *httpCtx) Get(s string) gjson.Result { ++ j := h.json.Get(s) ++ if j.Exists() { ++ return j ++ } ++ if h.postForm != nil { ++ if form := h.postForm.Get(s); form != """" { ++ return gjson.Result{Type: gjson.String, Str: form} ++ } ++ } ++ if h.query != nil { ++ if query := h.query.Get(s); query != """" { ++ return gjson.Result{Type: gjson.String, Str: query} ++ } ++ } ++ return gjson.Result{} ++} ++ ++func (s *httpServer) ServeHTTP(writer http.ResponseWriter, request *http.Request) { ++ var ctx httpCtx ++ contentType := request.Header.Get(""Content-Type"") ++ ctx.headerAuth = request.Header.Get(""Authorization"") ++ switch request.Method { ++ case http.MethodPost: ++ if strings.Contains(contentType, ""application/json"") { ++ body, err := io.ReadAll(request.Body) ++ if err != nil { ++ log.Warnf(""获取请求 %v 的Body时出现错误: %v"", request.RequestURI, err) ++ writer.WriteHeader(http.StatusBadRequest) ++ return ++ } ++ if !gjson.ValidBytes(body) { ++ log.Warnf(""已拒绝客户端 %v 的请求: 非法Json"", request.RemoteAddr) ++ writer.WriteHeader(http.StatusBadRequest) ++ return ++ } ++ ctx.json = gjson.Parse(utils.B2S(body)) ++ } ++ if strings.Contains(contentType, ""application/x-www-form-urlencoded"") { ++ ctx.postForm = request.PostForm ++ } ++ fallthrough ++ case http.MethodGet: ++ ctx.query = request.URL.Query() ++ ++ default: ++ log.Warnf(""已拒绝客户端 %v 的请求: 方法错误"", request.RemoteAddr) ++ writer.WriteHeader(http.StatusNotFound) ++ return ++ } ++ ++ if s.accessToken != """" { ++ if status := checkAuth(ctx, s.accessToken); status != http.StatusOK { ++ writer.WriteHeader(status) ++ return ++ } ++ } ++ ++ action := strings.TrimPrefix(request.URL.Path, ""/"") ++ action = strings.TrimSuffix(action, ""_async"") ++ log.Debugf(""HTTPServer接收到API调用: %v"", action) ++ ret := s.api.callAPI(action, &ctx) ++ ++ writer.Header().Set(""Content-Type"", ""application/json; charset=utf-8"") ++ writer.WriteHeader(http.StatusOK) ++ _ = json.NewEncoder(writer).Encode(ret) ++} ++ ++func checkAuth(ctx httpCtx, token string) int { ++ auth := ctx.headerAuth ++ if auth == """" { ++ auth = ctx.query.Get(""access_token"") ++ switch { ++ case auth == """": ++ return http.StatusUnauthorized ++ case auth != token: ++ return http.StatusForbidden ++ } ++ } else { ++ auth := strings.SplitN(auth, "" "", 2) ++ switch { ++ case len(auth) != 2 || auth[1] == """": ++ return http.StatusUnauthorized ++ case auth[1] != token: ++ return http.StatusForbidden ++ } ++ } ++ return http.StatusOK + } + + // RunHTTPServerAndClients 启动HTTP服务器与HTTP上报客户端 +@@ -49,78 +146,24 @@ func RunHTTPServerAndClients(bot *coolq.CQBot, conf *config.HTTPServer) { + return + } + var ( +- s = new(httpServer) +- authToken = conf.AccessToken +- addr string ++ s = new(httpServer) ++ addr string + ) ++ s.accessToken = conf.AccessToken + if conf.Host == """" || conf.Port == 0 { + goto client + } + addr = fmt.Sprintf(""%s:%d"", conf.Host, conf.Port) +- gin.SetMode(gin.ReleaseMode) +- s.engine = gin.New() +- s.bot = bot +- s.api = newAPICaller(s.bot) ++ s.api = newAPICaller(bot) + if conf.RateLimit.Enabled { + s.api.use(rateLimit(conf.RateLimit.Frequency, conf.RateLimit.Bucket)) + } +- s.engine.Use(func(c *gin.Context) { +- if c.Request.Method != ""GET"" && c.Request.Method != ""POST"" { +- log.Warnf(""已拒绝客户端 %v 的请求: 方法错误"", c.Request.RemoteAddr) +- c.Status(404) +- return +- } +- if c.Request.Method == ""POST"" && strings.Contains(c.Request.Header.Get(""Content-Type""), ""application/json"") { +- d, err := c.GetRawData() +- if err != nil { +- log.Warnf(""获取请求 %v 的Body时出现错误: %v"", c.Request.RequestURI, err) +- c.Status(400) +- return +- } +- if !gjson.ValidBytes(d) { +- log.Warnf(""已拒绝客户端 %v 的请求: 非法Json"", c.Request.RemoteAddr) +- c.Status(400) +- return +- } +- c.Set(""json_body"", gjson.ParseBytes(d)) +- } +- c.Next() +- }) +- +- if authToken != """" { +- s.engine.Use(func(c *gin.Context) { +- auth := c.Request.Header.Get(""Authorization"") +- if auth == """" { +- headAuth := c.Query(""access_token"") +- switch { +- case headAuth == """": +- c.AbortWithStatus(401) +- return +- case headAuth != authToken: +- c.AbortWithStatus(403) +- return +- } +- } else { +- auth := strings.SplitN(auth, "" "", 2) +- switch { +- case len(auth) != 2 || auth[1] == """": +- c.AbortWithStatus(401) +- return +- case auth[1] != authToken: +- c.AbortWithStatus(403) +- return +- } +- } +- }) +- } +- +- s.engine.Any(""/:action"", s.HandleActions) + + go func() { + log.Infof(""CQ HTTP 服务器已启动: %v"", addr) + s.HTTP = &http.Server{ + Addr: addr, +- Handler: s.engine, ++ Handler: s, + } + if err := s.HTTP.ListenAndServe(); err != nil && err != http.ErrServerClosed { + log.Error(err) +@@ -202,34 +245,6 @@ func (c *HTTPClient) onBotPushEvent(m *bytes.Buffer) { + } + } + +-func (s *httpServer) HandleActions(c *gin.Context) { +- action := strings.TrimSuffix(c.Param(""action""), ""_async"") +- log.Debugf(""HTTPServer接收到API调用: %v"", action) +- c.JSON(200, s.api.callAPI(action, httpContext{ctx: c})) +-} +- +-func (h httpContext) Get(k string) gjson.Result { +- c := h.ctx +- if q := c.Query(k); q != """" { +- return gjson.Result{Type: gjson.String, Str: q} +- } +- if c.Request.Method == ""POST"" { +- if h := c.Request.Header.Get(""Content-Type""); h != """" { +- if strings.Contains(h, ""application/x-www-form-urlencoded"") { +- if p, ok := c.GetPostForm(k); ok { +- return gjson.Result{Type: gjson.String, Str: p} +- } +- } +- if strings.Contains(h, ""application/json"") { +- if obj, ok := c.Get(""json_body""); ok { +- return obj.(gjson.Result).Get(k) +- } +- } +- } +- } +- return gjson.Result{Type: gjson.Null, Str: """"} +-} +- + func (s *httpServer) ShutDown() { + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() +diff --git a/server/pprof.go b/server/pprof.go +index 6ccb13738..0b6b95aec 100644 +--- a/server/pprof.go ++++ b/server/pprof.go +@@ -3,11 +3,10 @@ package server + import ( + ""fmt"" + ""net/http"" ++ ""net/http/pprof"" + ""os"" + ""time"" + +- ""github.com/gin-contrib/pprof"" +- ""github.com/gin-gonic/gin"" + log ""github.com/sirupsen/logrus"" + + ""github.com/Mrs4s/go-cqhttp/global/config"" +@@ -18,14 +17,18 @@ func RunPprofServer(conf *config.PprofServer) { + if conf.Disabled { + return + } +- gin.SetMode(gin.ReleaseMode) +- engine := gin.New() + addr := fmt.Sprintf(""%s:%d"", conf.Host, conf.Port) +- pprof.Register(engine) ++ mux := http.NewServeMux() ++ mux.HandleFunc(""/debug/pprof/"", pprof.Index) ++ mux.HandleFunc(""/debug/pprof/cmdline"", pprof.Cmdline) ++ mux.HandleFunc(""/debug/pprof/profile"", pprof.Profile) ++ mux.HandleFunc(""/debug/pprof/symbol"", pprof.Symbol) ++ mux.HandleFunc(""/debug/pprof/trace"", pprof.Trace) ++ server := http.Server{Addr: addr, Handler: mux} + go func() { + log.Infof(""pprof debug 服务器已启动: %v/debug/pprof"", addr) + log.Warnf(""警告: pprof 服务不支持鉴权, 请不要运行在公网."") +- if err := engine.Run(addr); err != nil && err != http.ErrServerClosed { ++ if err := server.ListenAndServe(); err != nil && err != http.ErrServerClosed { + log.Error(err) + log.Infof(""pprof 服务启动失败, 请检查端口是否被占用."") + log.Warnf(""将在五秒后退出."")" +tui.editor,https://github.com/nhn/tui.editor,74cf4f6bccb624c3d96a406dd8843d3172767f1c,dependabot[bot],2022-02-04 23:27:41,chore(deps-dev): bump @types/node from 16.11.6 to 17.0.14 (#2259),"Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.11.6 to 17.0.14. +- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) +- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) + +---","chore(deps-dev): bump @types/node from 16.11.6 to 17.0.14 (#2259) + +Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.11.6 to 17.0.14. +- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) +- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) + +--- +updated-dependencies: +- dependency-name: ""@types/node"" + dependency-type: direct:development + update-type: version-update:semver-major +... + +Signed-off-by: dependabot[bot] + +Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>","diff --git a/package-lock.json b/package-lock.json +index 3f0b0ab4f8..b472308a14 100644 +--- a/package-lock.json ++++ b/package-lock.json +@@ -21,7 +21,7 @@ + ""@testing-library/jest-dom"": ""^5.11.9"", + ""@types/common-tags"": ""^1.8.0"", + ""@types/jest"": ""^27.4.0"", +- ""@types/node"": ""^16.11.1"", ++ ""@types/node"": ""^17.0.14"", + ""@types/prosemirror-commands"": ""^1.0.3"", + ""@types/prosemirror-history"": ""^1.0.1"", + ""@types/prosemirror-inputrules"": ""^1.0.4"", +@@ -6501,9 +6501,9 @@ + ""dev"": true + }, + ""node_modules/@types/node"": { +- ""version"": ""16.11.6"", +- ""resolved"": ""https://registry.npmjs.org/@types/node/-/node-16.11.6.tgz"", +- ""integrity"": ""sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w=="", ++ ""version"": ""17.0.14"", ++ ""resolved"": ""https://registry.npmjs.org/@types/node/-/node-17.0.14.tgz"", ++ ""integrity"": ""sha512-SbjLmERksKOGzWzPNuW7fJM7fk3YXVTFiZWB/Hs99gwhk+/dnrQRPBQjPW9aO+fi1tAffi9PrwFvsmOKmDTyng=="", + ""dev"": true + }, + ""node_modules/@types/normalize-package-data"": { +@@ -33785,9 +33785,9 @@ + ""dev"": true + }, + ""@types/node"": { +- ""version"": ""16.11.6"", +- ""resolved"": ""https://registry.npmjs.org/@types/node/-/node-16.11.6.tgz"", +- ""integrity"": ""sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w=="", ++ ""version"": ""17.0.14"", ++ ""resolved"": ""https://registry.npmjs.org/@types/node/-/node-17.0.14.tgz"", ++ ""integrity"": ""sha512-SbjLmERksKOGzWzPNuW7fJM7fk3YXVTFiZWB/Hs99gwhk+/dnrQRPBQjPW9aO+fi1tAffi9PrwFvsmOKmDTyng=="", + ""dev"": true + }, + ""@types/normalize-package-data"": { +diff --git a/package.json b/package.json +index 5487edfff6..3fbeadb562 100644 +--- a/package.json ++++ b/package.json +@@ -12,7 +12,7 @@ + ""@testing-library/jest-dom"": ""^5.11.9"", + ""@types/common-tags"": ""^1.8.0"", + ""@types/jest"": ""^27.4.0"", +- ""@types/node"": ""^16.11.1"", ++ ""@types/node"": ""^17.0.14"", + ""@types/prosemirror-commands"": ""^1.0.3"", + ""@types/prosemirror-history"": ""^1.0.1"", + ""@types/prosemirror-inputrules"": ""^1.0.4""," +mise,https://github.com/jdx/mise,65c10ed0f1bd81da08c51de53298121116650e01,Jeff Dickey,2023-02-28 09:54:28,chore: remove lefthook scripts,these should not have been added,"chore: remove lefthook scripts + +these should not have been added","diff --git a/.husky/pre-commit b/.husky/pre-commit +deleted file mode 100755 +index dc93a034be..0000000000 +--- a/.husky/pre-commit ++++ /dev/null +@@ -1,42 +0,0 @@ +-#!/bin/sh +- +-if [ ""$LEFTHOOK"" = ""0"" ]; then +- exit 0 +-fi +- +-call_lefthook() +-{ +- dir=""$(git rev-parse --show-toplevel)"" +- osArch=$(echo ""$(uname)"" | tr '[:upper:]' '[:lower:]') +- cpuArch=$(echo ""$(uname -m)"" | sed 's/aarch64/arm64/') +- +- if lefthook -h >/dev/null 2>&1 +- then +- eval lefthook $@ +- elif test -f ""$dir/node_modules/lefthook/bin/index.js"" +- then +- eval ""\""$dir/node_modules/lefthook/bin/index.js\"" $@"" +- elif test -f ""$dir/node_modules/@evilmartians/lefthook/bin/lefthook_${osArch}_${cpuArch}/lefthook"" +- then +- eval ""\""$dir/node_modules/@evilmartians/lefthook/bin/lefthook_${osArch}_${cpuArch}/lefthook\"" $@"" +- elif test -f ""$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook_${osArch}_${cpuArch}/lefthook"" +- then +- eval ""\""$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook_${osArch}_${cpuArch}/lefthook\"" $@"" +- elif bundle exec lefthook -h >/dev/null 2>&1 +- then +- bundle exec lefthook $@ +- elif yarn lefthook -h >/dev/null 2>&1 +- then +- yarn lefthook $@ +- elif pnpm lefthook -h >/dev/null 2>&1 +- then +- pnpm lefthook $@ +- elif npx @evilmartians/lefthook -h >/dev/null 2>&1 +- then +- npx @evilmartians/lefthook $@ +- else +- echo ""Can't find lefthook in PATH"" +- fi +-} +- +-call_lefthook ""run pre-commit $@"" +diff --git a/.husky/prepare-commit-msg b/.husky/prepare-commit-msg +deleted file mode 100755 +index ea81fa9013..0000000000 +--- a/.husky/prepare-commit-msg ++++ /dev/null +@@ -1,42 +0,0 @@ +-#!/bin/sh +- +-if [ ""$LEFTHOOK"" = ""0"" ]; then +- exit 0 +-fi +- +-call_lefthook() +-{ +- dir=""$(git rev-parse --show-toplevel)"" +- osArch=$(echo ""$(uname)"" | tr '[:upper:]' '[:lower:]') +- cpuArch=$(echo ""$(uname -m)"" | sed 's/aarch64/arm64/') +- +- if lefthook -h >/dev/null 2>&1 +- then +- eval lefthook $@ +- elif test -f ""$dir/node_modules/lefthook/bin/index.js"" +- then +- eval ""\""$dir/node_modules/lefthook/bin/index.js\"" $@"" +- elif test -f ""$dir/node_modules/@evilmartians/lefthook/bin/lefthook_${osArch}_${cpuArch}/lefthook"" +- then +- eval ""\""$dir/node_modules/@evilmartians/lefthook/bin/lefthook_${osArch}_${cpuArch}/lefthook\"" $@"" +- elif test -f ""$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook_${osArch}_${cpuArch}/lefthook"" +- then +- eval ""\""$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook_${osArch}_${cpuArch}/lefthook\"" $@"" +- elif bundle exec lefthook -h >/dev/null 2>&1 +- then +- bundle exec lefthook $@ +- elif yarn lefthook -h >/dev/null 2>&1 +- then +- yarn lefthook $@ +- elif pnpm lefthook -h >/dev/null 2>&1 +- then +- pnpm lefthook $@ +- elif npx @evilmartians/lefthook -h >/dev/null 2>&1 +- then +- npx @evilmartians/lefthook $@ +- else +- echo ""Can't find lefthook in PATH"" +- fi +-} +- +-call_lefthook ""run prepare-commit-msg $@""" +rolldown,https://github.com/rolldown/rolldown,7b38ac3b3aaa620108d4cfbf036a919a4fcc4a0e,dalaoshu,2024-09-01 16:11:18,chore(ci): add autofix (#2103)," + +### Description","chore(ci): add autofix (#2103) + + + +### Description + +closes #2003 + + + +--------- + +Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>","diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml +new file mode 100644 +index 000000000000..3d0a6b713807 +--- /dev/null ++++ b/.github/workflows/autofix.yml +@@ -0,0 +1,24 @@ ++name: autofix.ci # needed to securely identify the workflow ++ ++on: ++ pull_request: ++ branches: ++ - main ++ ++jobs: ++ autofix: ++ runs-on: ubuntu-latest ++ steps: ++ - uses: actions/checkout@v4 ++ ++ - uses: ./.github/actions/setup-node ++ ++ - uses: ./.github/actions/setup-rust ++ with: ++ tools: just, taplo-cli, cargo-shear ++ cache-key: debug-build ++ components: clippy rustfmt ++ ++ - run: just fix ++ ++ - uses: autofix-ci/action@dd55f44df8f7cdb7a6bf74c78677eb8acd40cd0a" +coreutils,https://github.com/uutils/coreutils,2024cc37e63ef9b1cd7ccc52ba2b44dd9514d5c3,dependabot[bot],2022-03-21 22:20:55,build(deps): bump ouroboros from 0.14.2 to 0.15.0,"Bumps [ouroboros](https://github.com/joshua-maros/ouroboros) from 0.14.2 to 0.15.0. +- [Release notes](https://github.com/joshua-maros/ouroboros/releases) +- [Commits](https://github.com/joshua-maros/ouroboros/compare/0.14.2...0.15.0) + +---","build(deps): bump ouroboros from 0.14.2 to 0.15.0 + +Bumps [ouroboros](https://github.com/joshua-maros/ouroboros) from 0.14.2 to 0.15.0. +- [Release notes](https://github.com/joshua-maros/ouroboros/releases) +- [Commits](https://github.com/joshua-maros/ouroboros/compare/0.14.2...0.15.0) + +--- +updated-dependencies: +- dependency-name: ouroboros + dependency-type: direct:production + update-type: version-update:semver-minor +... + +Signed-off-by: dependabot[bot] ","diff --git a/Cargo.lock b/Cargo.lock +index 3c57717b8c8..8e159029a9f 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -1065,9 +1065,9 @@ checksum = ""830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"" + + [[package]] + name = ""libc"" +-version = ""0.2.113"" ++version = ""0.2.121"" + source = ""registry+https://github.com/rust-lang/crates.io-index"" +-checksum = ""eef78b64d87775463c549fbd80e19249ef436ea3bf1de2a1eb7e717ec7fab1e9"" ++checksum = ""efaa7b300f3b5fe8eb6bf21ce3895e1751d9665086af2d64b42f19701015ff4f"" + + [[package]] + name = ""libloading"" +@@ -1375,9 +1375,9 @@ dependencies = [ + + [[package]] + name = ""ouroboros"" +-version = ""0.14.2"" ++version = ""0.15.0"" + source = ""registry+https://github.com/rust-lang/crates.io-index"" +-checksum = ""71643f290d126e18ac2598876d01e1d57aed164afc78fdb6e2a0c6589a1f6662"" ++checksum = ""9f31a3b678685b150cba82b702dcdc5e155893f63610cf388d30cd988d4ca2bf"" + dependencies = [ + ""aliasable"", + ""ouroboros_macro"", +@@ -1386,9 +1386,9 @@ dependencies = [ + + [[package]] + name = ""ouroboros_macro"" +-version = ""0.14.2"" ++version = ""0.15.0"" + source = ""registry+https://github.com/rust-lang/crates.io-index"" +-checksum = ""ed9a247206016d424fe8497bc611e510887af5c261fbbf977877c4bb55ca4d82"" ++checksum = ""084fd65d5dd8b3772edccb5ffd1e4b7eba43897ecd0f9401e330e8c542959408"" + dependencies = [ + ""Inflector"", + ""proc-macro-error"", +diff --git a/src/uu/sort/Cargo.toml b/src/uu/sort/Cargo.toml +index 2adf49c447b..b1c152acf99 100644 +--- a/src/uu/sort/Cargo.toml ++++ b/src/uu/sort/Cargo.toml +@@ -22,7 +22,7 @@ ctrlc = { version = ""3.0"", features = [""termination""] } + fnv = ""1.0.7"" + itertools = ""0.10.0"" + memchr = ""2.4.0"" +-ouroboros = ""0.14.2"" ++ouroboros = ""0.15.0"" + rand = ""0.8"" + rayon = ""1.5"" + tempfile = ""3""" +angular,https://github.com/angular/angular,8343133e94711b3e8b5c27901923516eeb14c292,Andrew Kushnir,2022-08-16 23:06:53,refactor(common): add missing format error call in NgOptimizedImage (#47082),"This commit adds the missing `formatRuntimeError` function to the code that makes sure there is no image distortion. + +PR Close #47082","refactor(common): add missing format error call in NgOptimizedImage (#47082) + +This commit adds the missing `formatRuntimeError` function to the code that makes sure there is no image distortion. + +PR Close #47082","diff --git a/packages/common/src/directives/ng_optimized_image/ng_optimized_image.ts b/packages/common/src/directives/ng_optimized_image/ng_optimized_image.ts +index 06278a89a389eb..1aa4ed0f040db2 100644 +--- a/packages/common/src/directives/ng_optimized_image/ng_optimized_image.ts ++++ b/packages/common/src/directives/ng_optimized_image/ng_optimized_image.ts +@@ -6,7 +6,7 @@ + * found in the LICENSE file at https://angular.io/license + */ + +-import {Directive, ElementRef, Inject, Injector, Input, NgModule, NgZone, OnChanges, OnDestroy, OnInit, Renderer2, SimpleChanges, ɵ_sanitizeUrl as sanitizeUrl, ɵRuntimeError as RuntimeError} from '@angular/core'; ++import {Directive, ElementRef, Inject, Injector, Input, NgModule, NgZone, OnChanges, OnDestroy, OnInit, Renderer2, SimpleChanges, ɵ_sanitizeUrl as sanitizeUrl, ɵformatRuntimeError as formatRuntimeError, ɵRuntimeError as RuntimeError} from '@angular/core'; + + import {RuntimeErrorCode} from '../../errors'; + +@@ -451,7 +451,7 @@ function assertNoImageDistortion( + const stylingDistortion = nonZeroRenderedDimensions && + Math.abs(intrinsicAspectRatio - renderedAspectRatio) > ASPECT_RATIO_TOLERANCE; + if (inaccurateDimensions) { +- console.warn( ++ console.warn(formatRuntimeError( + RuntimeErrorCode.INVALID_INPUT, + `${imgDirectiveDetails(dir.rawSrc)} has detected that the aspect ratio of the ` + + `image does not match the aspect ratio indicated by the width and height attributes. ` + +@@ -459,10 +459,10 @@ function assertNoImageDistortion( + intrinsicAspectRatio}). ` + + `Supplied width and height attributes: ${suppliedWidth}w x ${ + suppliedHeight}h (aspect-ratio: ${suppliedAspectRatio}). ` + +- `To fix this, update the width and height attributes.`); ++ `To fix this, update the width and height attributes.`)); + } else { + if (stylingDistortion) { +- console.warn( ++ console.warn(formatRuntimeError( + RuntimeErrorCode.INVALID_INPUT, + `${imgDirectiveDetails(dir.rawSrc)} has detected that the aspect ratio of the ` + + `rendered image does not match the image's intrinsic aspect ratio. ` + +@@ -472,7 +472,7 @@ function assertNoImageDistortion( + renderedAspectRatio}). ` + + `This issue can occur if ""width"" and ""height"" attributes are added to an image ` + + `without updating the corresponding image styling. In most cases, ` + +- `adding ""height: auto"" or ""width: auto"" to the image styling will fix this issue.`); ++ `adding ""height: auto"" or ""width: auto"" to the image styling will fix this issue.`)); + } + } + });" +sentry,https://github.com/getsentry/sentry,35f4787a62b04ad2c17f5c92e7a0bef697bde446,Josh Ferge,2025-03-08 00:06:11,feat(issue-details): add xbox platform icon (#86525),"Fixes https://github.com/getsentry/sentry/issues/86524 + +looks like the xbox logo is already in [platform +icons](https://www.npmjs.com/package/platformicons), so i just copied +over into the icons folder","feat(issue-details): add xbox platform icon (#86525) + +Fixes https://github.com/getsentry/sentry/issues/86524 + +looks like the xbox logo is already in [platform +icons](https://www.npmjs.com/package/platformicons), so i just copied +over into the icons folder","diff --git a/src/sentry/static/sentry/images/logos/logo-xbox.svg b/src/sentry/static/sentry/images/logos/logo-xbox.svg +new file mode 100644 +index 00000000000000..13fb219fe9af59 +--- /dev/null ++++ b/src/sentry/static/sentry/images/logos/logo-xbox.svg +@@ -0,0 +1 @@ ++ +diff --git a/static/app/components/events/contexts/contextIcon.tsx b/static/app/components/events/contexts/contextIcon.tsx +index 96ee32fecf2a95..969bd9fbcc2c10 100644 +--- a/static/app/components/events/contexts/contextIcon.tsx ++++ b/static/app/components/events/contexts/contextIcon.tsx +@@ -44,6 +44,7 @@ import logoUnity from 'sentry-logos/logo-unity.svg'; + import logoUnknown from 'sentry-logos/logo-unknown.svg'; + import logoVercel from 'sentry-logos/logo-vercel.svg'; + import logoWindows from 'sentry-logos/logo-windows.svg'; ++import logoXbox from 'sentry-logos/logo-xbox.svg'; + + import ConfigStore from 'sentry/stores/configStore'; + import {useLegacyStore} from 'sentry/stores/useLegacyStore'; +@@ -107,6 +108,7 @@ const LOGO_MAPPING = { + watch: logoAppleWatch, + watchos: logoApple, + windows: logoWindows, ++ xbox: logoXbox, + }; + + export const NAMES = Object.keys(LOGO_MAPPING);" +dagger,https://github.com/dagger/dagger,fe2c2bcde2e4cc1403026a91f71e7a3902d2cb49,dependabot[bot],2022-05-12 00:35:58,build(deps): bump golang from 1.18.1-alpine to 1.18.2-alpine,"Bumps golang from 1.18.1-alpine to 1.18.2-alpine. + +---","build(deps): bump golang from 1.18.1-alpine to 1.18.2-alpine + +Bumps golang from 1.18.1-alpine to 1.18.2-alpine. + +--- +updated-dependencies: +- dependency-name: golang + dependency-type: direct:production + update-type: version-update:semver-patch +... + +Signed-off-by: dependabot[bot] ","diff --git a/Dockerfile b/Dockerfile +index 2831b2a8617..5d48b7c1133 100644 +--- a/Dockerfile ++++ b/Dockerfile +@@ -1,6 +1,6 @@ + # syntax = docker/dockerfile:1.2 + +-FROM golang:1.18.1-alpine AS build ++FROM golang:1.18.2-alpine AS build + WORKDIR /src + RUN apk add --no-cache file git + ENV GOMODCACHE /root/.cache/gocache" +grafana,https://github.com/grafana/grafana,d912703634995f1176dae4c5a9e8526e79b63e99,Andrej Ocenas,2024-05-10 18:29:44,Chore: Updated go.work.sum file (#87622),"* Updated file + +* fix quote character issue in workspace check + +---------","Chore: Updated go.work.sum file (#87622) + +* Updated file + +* fix quote character issue in workspace check + +--------- + +Co-authored-by: Todd Treece ","diff --git a/.github/workflows/pr-go-workspace-check.yml b/.github/workflows/pr-go-workspace-check.yml +index 0de90a6a8d8fa..998ffca8241f9 100644 +--- a/.github/workflows/pr-go-workspace-check.yml ++++ b/.github/workflows/pr-go-workspace-check.yml +@@ -33,7 +33,7 @@ jobs: + echo ""Changes detected:"" + git diff + echo ""Please run 'go work sync' and commit the changes."" +- echo ""If there is a change in enterprise dependencies, please update pkg/extensions/main.go.” ++ echo ""If there is a change in enterprise dependencies, please update pkg/extensions/main.go."" + exit 1 + fi + +@@ -46,6 +46,6 @@ jobs: + echo ""Changes detected:"" + git diff + echo ""Please run 'make build-go' and commit the changes."" +- echo ""If there is a change in enterprise dependencies, please update pkg/extensions/main.go.” ++ echo ""If there is a change in enterprise dependencies, please update pkg/extensions/main.go."" + exit 1 + fi +diff --git a/go.work.sum b/go.work.sum +index 35fa15d0a942c..76661cbdbb611 100644 +--- a/go.work.sum ++++ b/go.work.sum +@@ -1,3 +1,4 @@ ++buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.31.0-20230802163732-1c33ebd9ecfa.1 h1:tdpHgTbmbvEIARu+bixzmleMi14+3imnpoFXz+Qzjp4= + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.31.0-20230802163732-1c33ebd9ecfa.1/go.mod h1:xafc+XIsTxTy76GJQ1TKgvJWsSugFBqMaN27WhUblew= + buf.build/gen/go/grpc-ecosystem/grpc-gateway/bufbuild/connect-go v1.4.1-20221127060915-a1ecdc58eccd.1 h1:vp9EaPFSb75qe/793x58yE5fY1IJ/gdxb/kcDUzavtI= + buf.build/gen/go/grpc-ecosystem/grpc-gateway/bufbuild/connect-go v1.4.1-20221127060915-a1ecdc58eccd.1/go.mod h1:YDq2B5X5BChU0lxAG5MxHpDb8mx1fv9OGtF2mwOe7hY= +@@ -452,15 +453,19 @@ github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQ + github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932 h1:mXoPYz/Ul5HYEDvkta6I8/rnYM5gSdSV2tJ6XbZuEtY= + github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= + github.com/boombuler/barcode v1.0.1 h1:NDBbPmhS+EqABEs5Kg3n/5ZNjy73Pz7SIV+KCeqyXcs= ++github.com/bufbuild/protovalidate-go v0.2.1 h1:pJr07sYhliyfj/STAM7hU4J3FKpVeLVKvOBmOTN8j+s= + github.com/bufbuild/protovalidate-go v0.2.1/go.mod h1:e7XXDtlxj5vlEyAgsrxpzayp4cEMKCSSb8ZCkin+MVA= + github.com/bwesterb/go-ristretto v1.2.3 h1:1w53tCkGhCQ5djbat3+MH0BAQ5Kfgbt56UZQ/JMzngw= ++github.com/bytedance/sonic v1.10.0-rc3 h1:uNSnscRapXTwUgTyOF0GVljYD08p9X/Lbr9MweSV3V0= + github.com/bytedance/sonic v1.10.0-rc3/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4= + github.com/casbin/casbin/v2 v2.37.0 h1:/poEwPSovi4bTOcP752/CsTQiRz2xycyVKFG7GUhbDw= + github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= + github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g= + github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= + github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927/go.mod h1:h/aW8ynjgkuj+NQRlZcDbAbM1ORAbXjXX77sX7T289U= ++github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0= + github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d/go.mod h1:8EPpVsBuRksnlj1mLy4AWzRNQYxauNi62uWcE3to6eA= ++github.com/chenzhuoyu/iasm v0.9.0 h1:9fhXjVzq5hUy2gkhhgHl95zG2cEAhw9OSGs8toWWAwo= + github.com/chenzhuoyu/iasm v0.9.0/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog= + github.com/chromedp/cdproto v0.0.0-20220208224320-6efb837e6bc2/go.mod h1:At5TxYYdxkbQL0TSefRjhLE3Q0lgvqKKMSFUglJ7i1U= + github.com/chromedp/chromedp v0.9.2 h1:dKtNz4kApb06KuSXoTQIyUC2TrA0fhGDwNZf3bcgfKw= +@@ -645,7 +650,6 @@ github.com/grafana/dataplane/sdata v0.0.7 h1:CImITypIyS1jxijCR6xqKx71JnYAxcwpH9C + github.com/grafana/dataplane/sdata v0.0.7/go.mod h1:Jvs5ddpGmn6vcxT7tCTWAZ1mgi4sbcdFt9utQx5uMAU= + github.com/grafana/e2e v0.1.1-0.20221018202458-cffd2bb71c7b h1:Ha+kSIoTutf4ytlVw/SaEclDUloYx0+FXDKJWKhNbE4= + github.com/grafana/e2e v0.1.1-0.20221018202458-cffd2bb71c7b/go.mod h1:3UsooRp7yW5/NJQBlXcTsAHOoykEhNUYXkQ3r6ehEEY= +-github.com/grafana/gomemcache v0.0.0-20231023152154-6947259a0586/go.mod h1:PGk3RjYHpxMM8HFPhKKo+vve3DdlPUELZLSDEFehPuU= + github.com/grafana/grafana-plugin-sdk-go v0.212.0/go.mod h1:qsI4ktDf0lig74u8SLPJf9zRdVxWV/W4Wi+Ox6gifgs= + github.com/grafana/grafana-plugin-sdk-go v0.215.0/go.mod h1:nBsh3jRItKQUXDF2BQkiQCPxqrsSQeb+7hiFyJTO1RE= + github.com/grafana/grafana-plugin-sdk-go v0.216.0/go.mod h1:FdvSvOliqpVLnytM7e89zCFyYPDE6VOn9SIjVQRvVxM= +@@ -659,9 +663,16 @@ github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWet + github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1/go.mod h1:YvJ2f6MplWDhfxiUC3KpyTy76kYUZA4W3pTv/wdKQ9Y= + github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 h1:MJG/KsmcqMwFAkh8mTnAwhyKoB+sTAnY4CACC110tbU= + github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw= ++github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed h1:5upAirOpQc1Q53c0bnx2ufif5kANL7bfZWcc6VJWJd8= ++github.com/hamba/avro/v2 v2.17.2 h1:6PKpEWzJfNnvBgn7m2/8WYaDOUASxfDU+Jyb4ojDgFY= + github.com/hamba/avro/v2 v2.17.2/go.mod h1:Q9YK+qxAhtVrNqOhwlZTATLgLA8qxG2vtvkhK8fJ7Jo= ++github.com/hanwen/go-fuse v1.0.0 h1:GxS9Zrn6c35/BnfiVsZVWmsG803xwE7eVRDvcf/BEVc= ++github.com/hanwen/go-fuse/v2 v2.1.0 h1:+32ffteETaLYClUj0a3aHjZ1hOPxxaNEHiZiujuDaek= ++github.com/hashicorp/consul/sdk v0.15.0 h1:2qK9nDrr4tiJKRoxPGhm6B7xJjLVIQqkjiab2M4aKjU= + github.com/hashicorp/go-hclog v0.16.1 h1:IVQwpTGNRRIHafnTs2dQLIk4ENtneRIEEJWOVDqz99o= + github.com/hashicorp/go-hclog v0.16.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= ++github.com/hashicorp/go-syslog v1.0.0 h1:KaodqZuhUoZereWVIYmpUgZysurB1kBLX2j0MwMrUAE= ++github.com/hashicorp/go.net v0.0.1 h1:sNCoNyDEvN1xa+X0baata4RdcpKwcMS6DH+xwfqPgjw= + github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= + github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= + github.com/hashicorp/mdns v1.0.4 h1:sY0CMhFmjIPDMlTB+HfymFHCaYLhgifZ0QhjaYKD/UQ= +@@ -711,6 +722,11 @@ github.com/joho/godotenv v1.4.0/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwA + github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= + github.com/jsternberg/zap-logfmt v1.2.0 h1:1v+PK4/B48cy8cfQbxL4FmmNZrjnIMr2BsnyEmXqv2o= + github.com/jsternberg/zap-logfmt v1.2.0/go.mod h1:kz+1CUmCutPWABnNkOu9hOHKdT2q3TDYCcsFy9hpqb0= ++github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d h1:c93kUJDtVAXFEhsCh5jSxyOJmFHuzcihnslQiX8Urwo= ++github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U= ++github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5 h1:PJr+ZMXIecYc1Ey2zucXdR73SMBtgjPgwa31099IMv0= ++github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 h1:iQTw/8FWTuc7uiaSepXwyf3o52HaUYcV+Tu66S3F5GA= ++github.com/karrick/godirwalk v1.10.3 h1:lOpSw2vJP0y5eLBW906QwKsUK/fe/QDyoqM5rnnuPDY= + github.com/kataras/blocks v0.0.7 h1:cF3RDY/vxnSRezc7vLFlQFTYXG/yAr1o7WImJuZbzC4= + github.com/kataras/blocks v0.0.7/go.mod h1:UJIU97CluDo0f+zEjbnbkeMRlvYORtmc1304EeyXf4I= + github.com/kataras/golog v0.1.9 h1:vLvSDpP7kihFGKFAvBSofYo7qZNULYSHOH2D7rPTKJk= +@@ -725,8 +741,12 @@ github.com/kataras/sitemap v0.0.6 h1:w71CRMMKYMJh6LR2wTgnk5hSgjVNB9KL60n5e2KHvLY + github.com/kataras/sitemap v0.0.6/go.mod h1:dW4dOCNs896OR1HmG+dMLdT7JjDk7mYBzoIRwuj5jA4= + github.com/kataras/tunnel v0.0.4 h1:sCAqWuJV7nPzGrlb0os3j49lk2JhILT0rID38NHNLpA= + github.com/kataras/tunnel v0.0.4/go.mod h1:9FkU4LaeifdMWqZu7o20ojmW4B7hdhv2CMLwfnHGpYw= ++github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= ++github.com/kisielk/errcheck v1.5.0 h1:e8esj/e4R+SAOwFwN+n3zr0nYeCyeweozKfO23MvHzY= ++github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= + github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= + github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= ++github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs= + github.com/knadh/koanf v1.5.0/go.mod h1:Hgyjp4y8v44hpZtPzs7JZfRAW5AhN7KfZcwv1RYggDs= + github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= + github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= +@@ -901,6 +921,9 @@ github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5I + github.com/sony/gobreaker v0.4.1 h1:oMnRNZXX5j85zso6xCPRNPtmAycat+WcoKbklScLDgQ= + github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= + github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= ++github.com/spf13/afero v1.9.2 h1:j49Hj62F0n+DaZ1dDCvhABaPNSGNkt32oRFxI33IEMw= ++github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= ++github.com/spf13/viper v1.14.0 h1:Rg7d3Lo706X9tHsJMUjdiwMpHB7W8WnSVOssIY+JElU= + github.com/spf13/viper v1.14.0/go.mod h1:WT//axPky3FdvXHzGw33dNdXXXfFQqmEalje+egj8As= + github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad h1:fiWzISvDn0Csy5H0iwgAuJGQTUpVfEMJJd4nRFXogbc= + github.com/streadway/amqp v1.0.0 h1:kuuDrUJFZL1QYL9hUNuCxNObNzB0bV/ZG5jV3RWAQgo= +@@ -913,9 +936,13 @@ github.com/tdewolff/minify/v2 v2.12.9 h1:dvn5MtmuQ/DFMwqf5j8QhEVpPX6fi3WGImhv8RU + github.com/tdewolff/minify/v2 v2.12.9/go.mod h1:qOqdlDfL+7v0/fyymB+OP497nIxJYSvX4MQWA8OoiXU= + github.com/tdewolff/parse/v2 v2.6.8 h1:mhNZXYCx//xG7Yq2e/kVLNZw4YfYmeHbhx+Zc0OvFMA= + github.com/tdewolff/parse/v2 v2.6.8/go.mod h1:XHDhaU6IBgsryfdnpzUXBlT6leW/l25yrFBTEb4eIyM= ++github.com/tidwall/gjson v1.14.2 h1:6BBkirS0rAHjumnjHF6qgy5d2YAJ1TLIaFE2lzfOLqo= + github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= ++github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= + github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= ++github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= + github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= ++github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= + github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= + github.com/tinylib/msgp v1.1.8/go.mod h1:qkpG+2ldGg4xRFmx+jfTvZPxfGFhi64BcnL9vkCm/Tw= + github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM= +@@ -925,6 +952,7 @@ github.com/tklauser/numcpus v0.6.0 h1:kebhY2Qt+3U6RNK7UqpYNA+tJ23IBEGKkB7JQBfDYm + github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ5UVIcaL4= + github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= + github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926 h1:G3dpKMzFDjgEh2q1Z7zUUtKa8ViPtH+ocF0bE0g00O8= ++github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= + github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= + github.com/uber-go/atomic v1.4.0 h1:yOuPqEq4ovnhEjpHmfFwsqBXDYbQeT6Nb0bwD6XnD5o= + github.com/uber-go/atomic v1.4.0/go.mod h1:/Ct5t2lcmbJ4OSe/waGBoaVvVqtO0bmtfVNex1PFV8g= +@@ -1023,6 +1051,7 @@ go.uber.org/mock v0.2.0/go.mod h1:J0y0rp9L3xiff1+ZBfKxlC1fz2+aO16tw0tsDOixfuM= + go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= + go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= + go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= ++golang.org/x/arch v0.4.0 h1:A8WCeEWhLwPBKNbFi5Wv5UTCBx5zzubnXDlMOFAzFMc= + golang.org/x/arch v0.4.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= + golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= + golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= +@@ -1063,9 +1092,14 @@ gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI + gopkg.in/square/go-jose.v2 v2.6.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= + gopkg.in/src-d/go-billy.v4 v4.3.2 h1:0SQA1pRztfTFx2miS8sA97XvooFeNOmvUenF4o0EcVg= + gopkg.in/src-d/go-billy.v4 v4.3.2/go.mod h1:nDjArDMp+XMs1aFAESLRjfGSgfvoYN0hDfzEk0GjC98= ++gopkg.in/telebot.v3 v3.2.1 h1:3I4LohaAyJBiivGmkfB+CiVu7QFOWkuZ4+KHgO/G3rs= ++gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= ++honnef.co/go/tools v0.1.3 h1:qTakTkI6ni6LFD5sBwwsdSO+AQqbSIxOauHTTQKZ/7o= + k8s.io/component-base v0.0.0-20240417101527-62c04b35eff6 h1:WN8Lymy+dCTDHgn4vhUSNIB6U+0sDiv/c9Zdr0UeAnI= + k8s.io/component-base v0.0.0-20240417101527-62c04b35eff6/go.mod h1:l0ukbPS0lwFxOzSq5ZqjutzF+5IL2TLp495PswRPSZk= ++k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 h1:pWEwq4Asjm4vjW7vcsmijwBhOr1/shsbSYiWXmNGlks= + k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= ++k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 h1:NGrVE502P0s0/1hudf8zjgwki1X/TByhmAoILTarmzo= + k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= + k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= + k8s.io/kms v0.29.0/go.mod h1:mB0f9HLxRXeXUfHfn1A7rpwOlzXI1gIWu86z6buNoYA=" +zsh-vi-mode,https://github.com/jeffreytse/zsh-vi-mode,d354b6d85e1d82f5a9f5246ff99aa78b86fc5c22,jeffreytse,2021-03-15 16:43:27,fix: binding ctrl- does not work (#57),"This commit fixed the issue that `ctrl-`, that is the control +character `^@` could not be escaped to a printable character.","fix: binding ctrl- does not work (#57) + +This commit fixed the issue that `ctrl-`, that is the control +character `^@` could not be escaped to a printable character.","diff --git a/zsh-vi-mode.zsh b/zsh-vi-mode.zsh +index 9b96b8f..f6449e2 100644 +--- a/zsh-vi-mode.zsh ++++ b/zsh-vi-mode.zsh +@@ -537,6 +537,8 @@ function zvm_escape_non_printed_characters() { + str=""${str}^${c}"" + elif [[ ""$c"" == '' ]]; then + str=""${str}^?"" ++ elif [[ ""$c"" == '" +kratos,https://github.com/go-kratos/kratos,186ab88a628cf73cb85f74a59150206ab6f7634d,jessetang,2024-10-08 08:58:00,chore: upgrade golangci-lint version to v1.60.3 and fix lint (#3414),"* chore: upgrade golangci-lint version to v1.60.3 + +* fix lint","chore: upgrade golangci-lint version to v1.60.3 and fix lint (#3414) + +* chore: upgrade golangci-lint version to v1.60.3 + +* fix lint","diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml +index e6ee064202f..75a267acea0 100644 +--- a/.github/workflows/lint.yml ++++ b/.github/workflows/lint.yml +@@ -31,6 +31,6 @@ jobs: + - name: Lint + uses: golangci/golangci-lint-action@v6 + with: +- version: v1.54.2 ++ version: v1.60.3 + working-directory: ${{ matrix.workdir }} + skip-pkg-cache: true +diff --git a/.golangci.yml b/.golangci.yml +index 556fcfbc4aa..57b20dd7612 100644 +--- a/.golangci.yml ++++ b/.golangci.yml +@@ -17,7 +17,7 @@ linters: + - gofumpt + - goconst + - goimports +- - gomnd ++ - mnd + - gocyclo + - ineffassign + - lll +@@ -54,9 +54,9 @@ linters-settings: + multi-func: true + lll: + line-length: 160 +- gomnd: ++ mnd: + # don't include the ""operation"", ""argument"" and ""assign"" +- checks: ++ checks: + - case + - condition + - return +diff --git a/app.go b/app.go +index 1fa23132e87..86a6cb5bf91 100644 +--- a/app.go ++++ b/app.go +@@ -9,12 +9,12 @@ import ( + ""syscall"" + ""time"" + ++ ""github.com/google/uuid"" ++ ""golang.org/x/sync/errgroup"" ++ + ""github.com/go-kratos/kratos/v2/log"" + ""github.com/go-kratos/kratos/v2/registry"" + ""github.com/go-kratos/kratos/v2/transport"" +- +- ""github.com/google/uuid"" +- ""golang.org/x/sync/errgroup"" + ) + + // AppInfo is application context value. +diff --git a/cmd/kratos/internal/proto/client/client.go b/cmd/kratos/internal/proto/client/client.go +index cb3f4a76d56..07e4b490941 100644 +--- a/cmd/kratos/internal/proto/client/client.go ++++ b/cmd/kratos/internal/proto/client/client.go +@@ -72,7 +72,7 @@ func walk(dir string, args []string) error { + if dir == """" { + dir = ""."" + } +- return filepath.Walk(dir, func(path string, info os.FileInfo, err error) error { ++ return filepath.Walk(dir, func(path string, _ os.FileInfo, _ error) error { + if ext := filepath.Ext(path); ext != "".proto"" || strings.HasPrefix(path, ""third_party"") { + return nil + } +diff --git a/cmd/kratos/internal/run/run.go b/cmd/kratos/internal/run/run.go +index 2def97a1f99..3137016fcf1 100644 +--- a/cmd/kratos/internal/run/run.go ++++ b/cmd/kratos/internal/run/run.go +@@ -98,7 +98,7 @@ func findCMD(base string) (map[string]string, error) { + var root bool + next := func(dir string) (map[string]string, error) { + cmdPath := make(map[string]string) +- err := filepath.Walk(dir, func(walkPath string, info os.FileInfo, err error) error { ++ err := filepath.Walk(dir, func(walkPath string, info os.FileInfo, _ error) error { + // multi level directory is not allowed under the cmdPath directory, so it is judged that the path ends with cmdPath. + if strings.HasSuffix(walkPath, ""cmd"") { + paths, err := os.ReadDir(walkPath) +diff --git a/config/config_test.go b/config/config_test.go +index ab234dd4863..ec7fc9f7f76 100644 +--- a/config/config_test.go ++++ b/config/config_test.go +@@ -154,8 +154,7 @@ func TestConfig(t *testing.T) { + t.Fatal(""databaseDriver is not equal to val"") + } + +- err = cf.Watch(""endpoints"", func(key string, value Value) { +- }) ++ err = cf.Watch(""endpoints"", func(string, Value) {}) + if err != nil { + t.Fatal(err) + } +diff --git a/config/env/env.go b/config/env/env.go +index cdd30e1b70e..ecd5c6ffa8d 100644 +--- a/config/env/env.go ++++ b/config/env/env.go +@@ -23,7 +23,7 @@ func (e *env) load(envs []string) []*config.KeyValue { + var kv []*config.KeyValue + for _, env := range envs { + var k, v string +- subs := strings.SplitN(env, ""="", 2) //nolint:gomnd ++ subs := strings.SplitN(env, ""="", 2) //nolint:mnd + k = subs[0] + if len(subs) > 1 { + v = subs[1] +diff --git a/config/options.go b/config/options.go +index 95d6f6d31d9..7395660d5ba 100644 +--- a/config/options.go ++++ b/config/options.go +@@ -137,7 +137,7 @@ func resolver(input map[string]interface{}, mapper func(name string) string, toT + + func mapper(input map[string]interface{}) func(name string) string { + mapper := func(name string) string { +- args := strings.SplitN(strings.TrimSpace(name), "":"", 2) //nolint:gomnd ++ args := strings.SplitN(strings.TrimSpace(name), "":"", 2) //nolint:mnd + if v, has := readValue(input, args[0]); has { + s, _ := v.String() + return s +@@ -183,7 +183,7 @@ func expand(s string, mapping func(string) string, toType bool) interface{} { + re := r.FindAllStringSubmatch(s, -1) + var ct interface{} + for _, i := range re { +- if len(i) == 2 { //nolint:gomnd ++ if len(i) == 2 { //nolint:mnd + m := mapping(i[1]) + if toType { + ct = convertToType(m) +diff --git a/config/options_test.go b/config/options_test.go +index 83f62b85901..348471d3f70 100644 +--- a/config/options_test.go ++++ b/config/options_test.go +@@ -387,7 +387,7 @@ func TestExpand(t *testing.T) { + + func TestWithMergeFunc(t *testing.T) { + c := &options{} +- a := func(dst, src interface{}) error { ++ a := func(any, any) error { + return nil + } + WithMergeFunc(a)(c) +diff --git a/contrib/config/nacos/config_test.go b/contrib/config/nacos/config_test.go +index 2d290803795..1667e99dfcc 100644 +--- a/contrib/config/nacos/config_test.go ++++ b/contrib/config/nacos/config_test.go +@@ -166,13 +166,13 @@ func TestConfig_Watch(t *testing.T) { + source: source, + }, + wantErr: false, +- processFunc: func(t *testing.T, w config.Watcher) { ++ processFunc: func(t *testing.T, _ config.Watcher) { + _, pErr := client.PublishConfig(vo.ConfigParam{DataId: ""test.yaml"", Group: ""test"", Content: ""test: test""}) + if pErr != nil { + t.Error(pErr) + } + }, +- deferFunc: func(t *testing.T, w config.Watcher) { ++ deferFunc: func(t *testing.T, _ config.Watcher) { + _, dErr := client.DeleteConfig(vo.ConfigParam{DataId: ""test.yaml"", Group: ""test""}) + if dErr != nil { + t.Error(dErr) +diff --git a/contrib/opensergo/opensergo_test.go b/contrib/opensergo/opensergo_test.go +index 0a2165fb602..322c2c7e36c 100644 +--- a/contrib/opensergo/opensergo_test.go ++++ b/contrib/opensergo/opensergo_test.go +@@ -309,7 +309,7 @@ func TestOpenSergo(t *testing.T) { + args: args{ + opts: []Option{}, + }, +- preFunc: func(t *testing.T) { ++ preFunc: func(_ *testing.T) { + err := os.Setenv(""OPENSERGO_ENDPOINT"", ""127.0.0.1:9090"") + if err != nil { + panic(err) +@@ -322,7 +322,7 @@ func TestOpenSergo(t *testing.T) { + args: args{ + opts: []Option{}, + }, +- preFunc: func(t *testing.T) { ++ preFunc: func(_ *testing.T) { + err := os.Setenv(""OPENSERGO_BOOTSTRAP"", `{""endpoint"": ""127.0.0.1:9090""}`) + if err != nil { + panic(err) +diff --git a/contrib/polaris/router.go b/contrib/polaris/router.go +index 2478b58b823..93202eb5dad 100644 +--- a/contrib/polaris/router.go ++++ b/contrib/polaris/router.go +@@ -139,7 +139,7 @@ func buildPolarisInstance(namespace string, nodes []selector.Node) *pb.ServiceIn + Service: &v1.Service{Name: wrapperspb.String(nodes[0].ServiceName()), Namespace: wrapperspb.String(""default"")}, + Instances: ins, + } +- return pb.NewServiceInstancesInProto(d, func(s string) local.InstanceLocalValue { ++ return pb.NewServiceInstancesInProto(d, func(string) local.InstanceLocalValue { + return local.NewInstanceLocalValue() + }, &pb.SvcPluginValues{Routers: nil, Loadbalancer: nil}, nil) + } +diff --git a/contrib/registry/consul/registry_test.go b/contrib/registry/consul/registry_test.go +index d6799b693ce..9adc89ecaee 100644 +--- a/contrib/registry/consul/registry_test.go ++++ b/contrib/registry/consul/registry_test.go +@@ -329,8 +329,7 @@ func TestRegistry_Watch(t *testing.T) { + }, + want: []*registry.ServiceInstance{instance1}, + wantErr: false, +- preFunc: func(t *testing.T) { +- }, ++ preFunc: func(*testing.T) {}, + }, + { + name: ""ctx has been canceled"", +@@ -344,8 +343,7 @@ func TestRegistry_Watch(t *testing.T) { + }, + want: nil, + wantErr: true, +- preFunc: func(t *testing.T) { +- }, ++ preFunc: func(*testing.T) {}, + }, + { + name: ""register with healthCheck"", +diff --git a/contrib/registry/etcd/registry.go b/contrib/registry/etcd/registry.go +index 476436e2ee6..1a931153fe9 100644 +--- a/contrib/registry/etcd/registry.go ++++ b/contrib/registry/etcd/registry.go +@@ -162,7 +162,7 @@ func (r *Registry) heartBeat(ctx context.Context, leaseID clientv3.LeaseID, key + if err != nil { + curLeaseID = 0 + } +- rand.Seed(time.Now().Unix()) ++ randSource := rand.New(rand.NewSource(time.Now().Unix())) + + for { + if curLeaseID == 0 { +@@ -200,7 +200,7 @@ func (r *Registry) heartBeat(ctx context.Context, leaseID clientv3.LeaseID, key + break + } + retreat = append(retreat, 1< +Co-authored-by: Paul D'Ambra ","diff --git a/package.json b/package.json +index 41d9274bd1031..c2b3d28e1e216 100644 +--- a/package.json ++++ b/package.json +@@ -99,7 +99,7 @@ + ""kea-window-values"": ""^3.0.0"", + ""md5"": ""^2.3.0"", + ""monaco-editor"": ""^0.23.0"", +- ""posthog-js"": ""1.39.2"", ++ ""posthog-js"": ""1.39.4"", + ""posthog-js-lite"": ""2.0.0-alpha5"", + ""prettier"": ""^2.3.1"", + ""prop-types"": ""^15.7.2"", +diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml +index ea143a9c414f1..7cddda4104a1a 100644 +--- a/pnpm-lock.yaml ++++ b/pnpm-lock.yaml +@@ -135,7 +135,7 @@ specifiers: + pngjs: ^6.0.0 + postcss: ^8.4.14 + postcss-loader: ^4.3.0 +- posthog-js: 1.39.2 ++ posthog-js: 1.39.4 + posthog-js-lite: 2.0.0-alpha5 + prettier: ^2.3.1 + prop-types: ^15.7.2 +@@ -234,7 +234,7 @@ dependencies: + kea-window-values: 3.0.0_kea@3.1.0 + md5: 2.3.0 + monaco-editor: 0.23.0 +- posthog-js: 1.39.2 ++ posthog-js: 1.39.4 + posthog-js-lite: 2.0.0-alpha5 + prettier: 2.7.1 + prop-types: 15.8.1 +@@ -5872,6 +5872,7 @@ packages: + + /bindings/1.5.0: + resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} ++ requiresBuild: true + dependencies: + file-uri-to-path: 1.0.0 + dev: true +@@ -9182,6 +9183,7 @@ packages: + + /file-uri-to-path/1.0.0: + resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} ++ requiresBuild: true + dev: true + optional: true + +@@ -9766,7 +9768,7 @@ packages: + source-map: 0.6.1 + wordwrap: 1.0.0 + optionalDependencies: +- uglify-js: 3.15.2 ++ uglify-js: 3.17.4 + dev: true + + /has-bigints/1.0.2: +@@ -11681,7 +11683,7 @@ packages: + image-size: 0.5.5 + make-dir: 2.1.0 + mime: 1.6.0 +- native-request: 1.0.8 ++ native-request: 1.1.0 + source-map: 0.6.1 + dev: true + +@@ -11699,7 +11701,7 @@ packages: + image-size: 0.5.5 + make-dir: 2.1.0 + mime: 1.6.0 +- needle: 3.1.0 ++ needle: 3.2.0 + source-map: 0.6.1 + transitivePeerDependencies: + - supports-color +@@ -12475,6 +12477,7 @@ packages: + + /nan/2.17.0: + resolution: {integrity: sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==} ++ requiresBuild: true + dev: true + optional: true + +@@ -12521,8 +12524,8 @@ packages: + - supports-color + dev: true + +- /native-request/1.0.8: +- resolution: {integrity: sha512-vU2JojJVelUGp6jRcLwToPoWGxSx23z/0iX+I77J3Ht17rf2INGjrhOoQnjVo60nQd8wVsgzKkPfRXBiVdD2ag==} ++ /native-request/1.1.0: ++ resolution: {integrity: sha512-uZ5rQaeRn15XmpgE0xoPL8YWqcX90VtCFglYwAgkvKM5e8fog+vePLAhHxuuv/gRkrQxIeh5U3q9sMNUrENqWw==} + requiresBuild: true + dev: true + optional: true +@@ -12531,8 +12534,8 @@ packages: + resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + dev: true + +- /needle/3.1.0: +- resolution: {integrity: sha512-gCE9weDhjVGCRqS8dwDR/D3GTAeyXLXuqp7I8EzH6DllZGXSUyxuqqLh+YX9rMAWaaTFyVAg6rHGL25dqvczKw==} ++ /needle/3.2.0: ++ resolution: {integrity: sha512-oUvzXnyLiVyVGoianLijF9O/RecZUf7TkBfimjGrLM4eQhXyeJwM6GeAWccwfQ9aa4gMCZKqhAOuLaMIcQxajQ==} + engines: {node: '>= 4.4.x'} + hasBin: true + requiresBuild: true +@@ -13657,8 +13660,8 @@ packages: + resolution: {integrity: sha512-tlkBdypJuvK/s00n4EiQjwYVfuuZv6vt8BF3g1ooIQa2Gz9Vz80p8q3qsPLZ0V5ErGRy6i3Q4fWC9TDzR7GNRQ==} + dev: false + +- /posthog-js/1.39.2: +- resolution: {integrity: sha512-IKdG5smnezeq0VHyx6JmIF2UjUvkKCpwvK5OOhwwhv4J5oq9+dpfI88B7eF07sSwc77uuGwE6+RhX1vhCYddew==} ++ /posthog-js/1.39.4: ++ resolution: {integrity: sha512-Elpf1gwyuObueXi89iH+9pP+WhpkiivP8Qwej4RzOLwSTa7Floaa4rgAw7rnCnX1PtRoJ3F0kqb6q9T+aZjRiA==} + dependencies: + '@sentry/types': 7.22.0 + fflate: 0.4.8 +@@ -16749,8 +16752,8 @@ packages: + resolution: {integrity: sha512-f9BESNVhzlhEFf2CHMSj40NWOjYPl1YKYbrvIr/hFTDEmLq7SRbWvm7FcdcpCYT95zrOhC7gZSxjdnnTpBcwVw==} + dev: false + +- /uglify-js/3.15.2: +- resolution: {integrity: sha512-peeoTk3hSwYdoc9nrdiEJk+gx1ALCtTjdYuKSXMTDqq7n1W7dHPqWDdSi+BPL0ni2YMeHD7hKUSdbj3TZauY2A==} ++ /uglify-js/3.17.4: ++ resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==} + engines: {node: '>=0.8.0'} + hasBin: true + requiresBuild: true +diff --git a/posthog/templates/demo.html b/posthog/templates/demo.html +index 8f3c9e72ae97c..ad5f31f94e8de 100644 +--- a/posthog/templates/demo.html ++++ b/posthog/templates/demo.html +@@ -3,18 +3,6 @@ + + Hogflix + +- + + + +@@ -47,7 +35,18 @@ + + + +- ++ +
    +
    +
    " +uno,https://github.com/unoplatform/uno,877efe88a020837fd15c31e655f3279d76560d39,dependabot-preview[bot],2020-06-22 17:24:13,chore(deps): bump Moq from 4.14.1 to 4.14.3,"Bumps [Moq](https://github.com/moq/moq4) from 4.14.1 to 4.14.3. +- [Release notes](https://github.com/moq/moq4/releases) +- [Changelog](https://github.com/moq/moq4/blob/master/CHANGELOG.md) +- [Commits](https://github.com/moq/moq4/compare/v4.14.1...v4.14.3)","chore(deps): bump Moq from 4.14.1 to 4.14.3 + +Bumps [Moq](https://github.com/moq/moq4) from 4.14.1 to 4.14.3. +- [Release notes](https://github.com/moq/moq4/releases) +- [Changelog](https://github.com/moq/moq4/blob/master/CHANGELOG.md) +- [Commits](https://github.com/moq/moq4/compare/v4.14.1...v4.14.3) + +Signed-off-by: dependabot-preview[bot] ","diff --git a/src/Uno.UI.Tests.Performance/Uno.UI.Tests.Performance.csproj b/src/Uno.UI.Tests.Performance/Uno.UI.Tests.Performance.csproj +index b56d18f6c73d..579a9a4d0f63 100644 +--- a/src/Uno.UI.Tests.Performance/Uno.UI.Tests.Performance.csproj ++++ b/src/Uno.UI.Tests.Performance/Uno.UI.Tests.Performance.csproj +@@ -35,7 +35,7 @@ + 5.10.3 + + +- 4.14.1 ++ 4.14.3 + + + 1.7.0 +diff --git a/src/Uno.UI.Tests/Uno.UI.Tests.csproj b/src/Uno.UI.Tests/Uno.UI.Tests.csproj +index b1aa7067c6d3..8c3fada2670c 100644 +--- a/src/Uno.UI.Tests/Uno.UI.Tests.csproj ++++ b/src/Uno.UI.Tests/Uno.UI.Tests.csproj +@@ -33,7 +33,7 @@ + 5.10.3 + + +- 4.14.1 ++ 4.14.3 + + + 1.7.0" +bytebase,https://github.com/bytebase/bytebase,468af883a1f481f5a721dbb26083d8f130daa4dd,Liu Ji,2022-04-08 08:37:50,refactor: re-implement policy store module with pinia (#1042),"* refactor: implement policy store module with pinia + +* refactor: use pinia policy module and remove vuex version + +* chore: extract local variable","refactor: re-implement policy store module with pinia (#1042) + +* refactor: implement policy store module with pinia + +* refactor: use pinia policy module and remove vuex version + +* chore: extract local variable","diff --git a/frontend/src/components/DatabaseBackupPanel.vue b/frontend/src/components/DatabaseBackupPanel.vue +index 5f3af9cd0deab3..40cbc421d30c0d 100644 +--- a/frontend/src/components/DatabaseBackupPanel.vue ++++ b/frontend/src/components/DatabaseBackupPanel.vue +@@ -141,7 +141,6 @@ import { + PropType, + defineComponent, + } from ""vue""; +-import { useStore } from ""vuex""; + import { + Backup, + BackupCreate, +@@ -158,7 +157,7 @@ import BackupTable from ""../components/BackupTable.vue""; + import DatabaseBackupCreateForm from ""../components/DatabaseBackupCreateForm.vue""; + import { cloneDeep, isEqual } from ""lodash-es""; + import { useI18n } from ""vue-i18n""; +-import { pushNotification, useBackupStore } from ""@/store""; ++import { pushNotification, useBackupStore, usePolicyStore } from ""@/store""; + + interface LocalState { + showCreateBackupModal: boolean; +@@ -191,9 +190,9 @@ export default defineComponent({ + }, + }, + setup(props) { +- const store = useStore(); +- const { t } = useI18n(); + const backupStore = useBackupStore(); ++ const policyStore = usePolicyStore(); ++ const { t } = useI18n(); + + const state = reactive({ + showCreateBackupModal: false, +@@ -217,7 +216,7 @@ export default defineComponent({ + watchEffect(prepareBackupList); + + const prepareBackupPolicy = () => { +- store.dispatch(""policy/fetchPolicyByEnvironmentAndType"", { ++ policyStore.fetchPolicyByEnvironmentAndType({ + environmentId: props.database.instance.environment.id, + type: ""bb.policy.backup-plan"", + }); +@@ -296,11 +295,12 @@ export default defineComponent({ + }); + + const backupPolicy = computed(() => { +- const policy = store.getters[""policy/policyByEnvironmentIdAndType""]( ++ const policy = policyStore.getPolicyByEnvironmentIdAndType( + props.database.instance.environment.id, + ""bb.policy.backup-plan"" + ); +- return (policy.payload as PolicyBackupPlanPolicyPayload).schedule; ++ const payload = policy?.payload; ++ return (payload as PolicyBackupPlanPolicyPayload | undefined)?.schedule; + }); + + const allowDisableAutoBackup = computed(() => { +diff --git a/frontend/src/store/modules/environment.ts b/frontend/src/store/modules/environment.ts +index 288f119a9fadd9..5c9a40ac68f14c 100644 +--- a/frontend/src/store/modules/environment.ts ++++ b/frontend/src/store/modules/environment.ts +@@ -11,6 +11,7 @@ import { + RowStatus, + unknown, + } from ""../../types""; ++import { usePolicyStore } from ""../pinia-modules""; + import { getPrincipalFromIncludedList } from ""./principal""; + + function convert( +@@ -91,17 +92,12 @@ const actions = { + + commit(""upsertEnvironmentList"", environmentList); + ++ const policyStore = usePolicyStore(); + for (const environment of environmentList) { +- await dispatch( +- ""policy/fetchPolicyByEnvironmentAndType"", +- { +- environmentId: environment.id, +- type: ""bb.policy.pipeline-approval"", +- }, +- { +- root: true, +- } +- ); ++ await policyStore.fetchPolicyByEnvironmentAndType({ ++ environmentId: environment.id, ++ type: ""bb.policy.pipeline-approval"", ++ }); + } + + return environmentList; +@@ -123,16 +119,10 @@ const actions = { + + commit(""upsertEnvironmentList"", [createdEnvironment]); + +- await dispatch( +- ""policy/fetchPolicyByEnvironmentAndType"", +- { +- environmentId: createdEnvironment.id, +- type: ""bb.policy.pipeline-approval"", +- }, +- { +- root: true, +- } +- ); ++ await usePolicyStore().fetchPolicyByEnvironmentAndType({ ++ environmentId: createdEnvironment.id, ++ type: ""bb.policy.pipeline-approval"", ++ }); + + return createdEnvironment; + }, +diff --git a/frontend/src/store/modules/policy.ts b/frontend/src/store/modules/policy.ts +deleted file mode 100644 +index bc4a9d14b5de16..00000000000000 +--- a/frontend/src/store/modules/policy.ts ++++ /dev/null +@@ -1,145 +0,0 @@ +-import axios from ""axios""; +-import { +- Environment, +- EnvironmentId, +- PolicyState, +- ResourceIdentifier, +- ResourceObject, +- unknown, +-} from ""../../types""; +-import { Policy, PolicyType, PolicyUpsert } from ""../../types/policy""; +-import { getPrincipalFromIncludedList } from ""./principal""; +- +-function convert( +- policy: ResourceObject, +- includedList: ResourceObject[], +- rootGetters: any +-): Policy { +- const environmentId = ( +- policy.relationships!.environment.data as ResourceIdentifier +- ).id; +- let environment: Environment = unknown(""ENVIRONMENT"") as Environment; +- environment.id = parseInt(environmentId); +- +- for (const item of includedList || []) { +- if ( +- item.type == ""environment"" && +- (policy.relationships!.environment.data as ResourceIdentifier).id == +- item.id +- ) { +- environment = rootGetters[""environment/convert""](item, includedList); +- } +- } +- +- return { +- ...(policy.attributes as Omit< +- Policy, +- ""id"" | ""environment"" | ""payload"" | ""creator"" | ""updater"" +- >), +- id: parseInt(policy.id), +- creator: getPrincipalFromIncludedList( +- policy.relationships!.creator.data, +- includedList +- ), +- updater: getPrincipalFromIncludedList( +- policy.relationships!.updater.data, +- includedList +- ), +- environment, +- payload: JSON.parse((policy.attributes.payload as string) || ""{}""), +- }; +-} +- +-const state: () => PolicyState = () => ({ +- policyMapByEnvironmentId: new Map(), +-}); +- +-const getters = { +- policyByEnvironmentIdAndType: +- (state: PolicyState) => +- (environmentId: EnvironmentId, type: PolicyType): Policy | undefined => { +- const map = state.policyMapByEnvironmentId.get(environmentId); +- if (map) { +- return map.get(type); +- } +- return undefined; +- }, +-}; +- +-const actions = { +- async fetchPolicyByEnvironmentAndType( +- { commit, rootGetters }: any, +- { environmentId, type }: { environmentId: EnvironmentId; type: PolicyType } +- ): Promise { +- const data = ( +- await axios.get(`/api/policy/environment/${environmentId}?type=${type}`) +- ).data; +- const policy = convert(data.data, data.included, rootGetters); +- commit(""setPolicyByEnvironmentId"", { environmentId, policy }); +- +- return policy; +- }, +- +- async upsertPolicyByEnvironmentAndType( +- { commit, rootGetters }: any, +- { +- environmentId, +- type, +- policyUpsert, +- }: { +- environmentId: EnvironmentId; +- type: PolicyType; +- policyUpsert: PolicyUpsert; +- } +- ): Promise { +- const data = ( +- await axios.patch( +- `/api/policy/environment/${environmentId}?type=${type}`, +- { +- data: { +- type: ""policyUpsert"", +- attributes: { +- payload: JSON.stringify(policyUpsert.payload), +- }, +- }, +- } +- ) +- ).data; +- const policy = convert(data.data, data.included, rootGetters); +- +- commit(""setPolicyByEnvironmentId"", { environmentId, policy }); +- +- return policy; +- }, +-}; +- +-const mutations = { +- setPolicyByEnvironmentId( +- state: PolicyState, +- { +- environmentId, +- policy, +- }: { +- environmentId: EnvironmentId; +- policy: Policy; +- } +- ) { +- const map = state.policyMapByEnvironmentId.get(environmentId); +- if (map) { +- map.set(policy.type, policy); +- } else { +- state.policyMapByEnvironmentId.set( +- environmentId, +- new Map([[policy.type, policy]]) +- ); +- } +- }, +-}; +- +-export default { +- namespaced: true, +- state, +- getters, +- actions, +- mutations, +-}; +diff --git a/frontend/src/store/pinia-modules/index.ts b/frontend/src/store/pinia-modules/index.ts +index adc28fff5df245..fae2197d3a4766 100644 +--- a/frontend/src/store/pinia-modules/index.ts ++++ b/frontend/src/store/pinia-modules/index.ts +@@ -8,6 +8,7 @@ export * from ""./issueSubscriber""; + export * from ""./label""; + export * from ""./notification""; + export * from ""./oauth""; ++export * from ""./policy""; + export * from ""./router""; + export * from ""./setting""; + export * from ""./subscription""; +diff --git a/frontend/src/store/pinia-modules/policy.ts b/frontend/src/store/pinia-modules/policy.ts +new file mode 100644 +index 00000000000000..ab51788d3eeb5e +--- /dev/null ++++ b/frontend/src/store/pinia-modules/policy.ts +@@ -0,0 +1,130 @@ ++import axios from ""axios""; ++import { ++ Environment, ++ EnvironmentId, ++ PolicyState, ++ ResourceIdentifier, ++ ResourceObject, ++ unknown, ++} from ""@/types""; ++import { Policy, PolicyType, PolicyUpsert } from ""@/types/policy""; ++import { getPrincipalFromIncludedList } from ""../modules/principal""; ++import { store } from ""../index""; ++import { defineStore } from ""pinia""; ++ ++function convert( ++ policy: ResourceObject, ++ includedList: ResourceObject[] ++): Policy { ++ const environmentId = ( ++ policy.relationships!.environment.data as ResourceIdentifier ++ ).id; ++ let environment: Environment = unknown(""ENVIRONMENT"") as Environment; ++ environment.id = parseInt(environmentId); ++ ++ for (const item of includedList || []) { ++ if ( ++ item.type == ""environment"" && ++ (policy.relationships!.environment.data as ResourceIdentifier).id == ++ item.id ++ ) { ++ environment = store.getters[""environment/convert""](item, includedList); ++ } ++ } ++ ++ return { ++ ...(policy.attributes as Omit< ++ Policy, ++ ""id"" | ""environment"" | ""payload"" | ""creator"" | ""updater"" ++ >), ++ id: parseInt(policy.id), ++ creator: getPrincipalFromIncludedList( ++ policy.relationships!.creator.data, ++ includedList ++ ), ++ updater: getPrincipalFromIncludedList( ++ policy.relationships!.updater.data, ++ includedList ++ ), ++ environment, ++ payload: JSON.parse((policy.attributes.payload as string) || ""{}""), ++ }; ++} ++ ++export const usePolicyStore = defineStore(""policy"", { ++ state: (): PolicyState => ({ ++ policyMapByEnvironmentId: new Map(), ++ }), ++ actions: { ++ getPolicyByEnvironmentIdAndType( ++ environmentId: EnvironmentId, ++ type: PolicyType ++ ): Policy | undefined { ++ const map = this.policyMapByEnvironmentId.get(environmentId); ++ if (map) { ++ return map.get(type); ++ } ++ return undefined; ++ }, ++ setPolicyByEnvironmentId({ ++ environmentId, ++ policy, ++ }: { ++ environmentId: EnvironmentId; ++ policy: Policy; ++ }) { ++ const map = this.policyMapByEnvironmentId.get(environmentId); ++ if (map) { ++ map.set(policy.type, policy); ++ } else { ++ this.policyMapByEnvironmentId.set( ++ environmentId, ++ new Map([[policy.type, policy]]) ++ ); ++ } ++ }, ++ async fetchPolicyByEnvironmentAndType({ ++ environmentId, ++ type, ++ }: { ++ environmentId: EnvironmentId; ++ type: PolicyType; ++ }): Promise { ++ const data = ( ++ await axios.get(`/api/policy/environment/${environmentId}?type=${type}`) ++ ).data; ++ const policy = convert(data.data, data.included); ++ this.setPolicyByEnvironmentId({ environmentId, policy }); ++ ++ return policy; ++ }, ++ async upsertPolicyByEnvironmentAndType({ ++ environmentId, ++ type, ++ policyUpsert, ++ }: { ++ environmentId: EnvironmentId; ++ type: PolicyType; ++ policyUpsert: PolicyUpsert; ++ }): Promise { ++ const data = ( ++ await axios.patch( ++ `/api/policy/environment/${environmentId}?type=${type}`, ++ { ++ data: { ++ type: ""policyUpsert"", ++ attributes: { ++ payload: JSON.stringify(policyUpsert.payload), ++ }, ++ }, ++ } ++ ) ++ ).data; ++ const policy = convert(data.data, data.included); ++ ++ this.setPolicyByEnvironmentId({ environmentId, policy }); ++ ++ return policy; ++ }, ++ }, ++}); +diff --git a/frontend/src/views/EnvironmentDashboard.vue b/frontend/src/views/EnvironmentDashboard.vue +index b58939ce05e939..a517276a048f6a 100644 +--- a/frontend/src/views/EnvironmentDashboard.vue ++++ b/frontend/src/views/EnvironmentDashboard.vue +@@ -89,9 +89,16 @@ import { + PolicyUpsert, + DefaultApporvalPolicy, + DefaultSchedulePolicy, ++ PipelineApporvalPolicyPayload, ++ PolicyBackupPlanPolicyPayload, + } from ""../types""; + import { BBTabItem } from ""../bbkit/types""; +-import { useRegisterCommand, useUIStateStore, hasFeature } from ""@/store""; ++import { ++ useRegisterCommand, ++ useUIStateStore, ++ hasFeature, ++ usePolicyStore, ++} from ""@/store""; + + const DEFAULT_NEW_ENVIRONMENT: EnvironmentCreate = { + name: ""New Env"", +@@ -132,6 +139,7 @@ export default defineComponent({ + setup() { + const store = useStore(); + const uiStateStore = useUIStateStore(); ++ const policyStore = usePolicyStore(); + const router = useRouter(); + + const state = reactive({ +@@ -228,14 +236,16 @@ export default defineComponent({ + backupPolicy: Policy + ) => { + if ( +- approvalPolicy.payload.value !== DefaultApporvalPolicy && ++ (approvalPolicy.payload as PipelineApporvalPolicyPayload).value !== ++ DefaultApporvalPolicy && + !hasFeature(""bb.feature.approval-policy"") + ) { + state.missingRequiredFeature = ""bb.feature.approval-policy""; + return; + } + if ( +- backupPolicy.payload.schedule !== DefaultSchedulePolicy && ++ (backupPolicy.payload as PolicyBackupPlanPolicyPayload).schedule !== ++ DefaultSchedulePolicy && + !hasFeature(""bb.feature.backup-policy"") + ) { + state.missingRequiredFeature = ""bb.feature.backup-policy""; +@@ -246,12 +256,12 @@ export default defineComponent({ + .dispatch(""environment/createEnvironment"", newEnvironment) + .then((environment: Environment) => { + Promise.all([ +- store.dispatch(""policy/upsertPolicyByEnvironmentAndType"", { ++ policyStore.upsertPolicyByEnvironmentAndType({ + environmentId: environment.id, + type: ""bb.policy.pipeline-approval"", + policyUpsert: { payload: approvalPolicy.payload }, + }), +- store.dispatch(""policy/upsertPolicyByEnvironmentAndType"", { ++ policyStore.upsertPolicyByEnvironmentAndType({ + environmentId: environment.id, + type: ""bb.policy.backup-plan"", + policyUpsert: { payload: backupPolicy.payload }, +diff --git a/frontend/src/views/EnvironmentDetail.vue b/frontend/src/views/EnvironmentDetail.vue +index 65d196440dbd23..28cb43a2d9c3c0 100644 +--- a/frontend/src/views/EnvironmentDetail.vue ++++ b/frontend/src/views/EnvironmentDetail.vue +@@ -32,9 +32,11 @@ import { + PolicyType, + DefaultApporvalPolicy, + DefaultSchedulePolicy, ++ PipelineApporvalPolicyPayload, ++ PolicyBackupPlanPolicyPayload, + } from ""../types""; + import { idFromSlug } from ""../utils""; +-import { hasFeature } from ""@/store""; ++import { hasFeature, usePolicyStore } from ""@/store""; + + interface LocalState { + environment: Environment; +@@ -61,6 +63,7 @@ export default defineComponent({ + emits: [""archive""], + setup(props, { emit }) { + const store = useStore(); ++ const policyStore = usePolicyStore(); + + const state = reactive({ + environment: store.getters[""environment/environmentById""]( +@@ -70,8 +73,8 @@ export default defineComponent({ + }); + + const preparePolicy = () => { +- store +- .dispatch(""policy/fetchPolicyByEnvironmentAndType"", { ++ policyStore ++ .fetchPolicyByEnvironmentAndType({ + environmentId: (state.environment as Environment).id, + type: ""bb.policy.pipeline-approval"", + }) +@@ -79,8 +82,8 @@ export default defineComponent({ + state.approvalPolicy = policy; + }); + +- store +- .dispatch(""policy/fetchPolicyByEnvironmentAndType"", { ++ policyStore ++ .fetchPolicyByEnvironmentAndType({ + environmentId: (state.environment as Environment).id, + type: ""bb.policy.backup-plan"", + }) +@@ -140,7 +143,8 @@ export default defineComponent({ + ) => { + if ( + type === ""bb.policy.pipeline-approval"" && +- policy.payload.value !== DefaultApporvalPolicy && ++ (policy.payload as PipelineApporvalPolicyPayload).value !== ++ DefaultApporvalPolicy && + !hasFeature(""bb.feature.approval-policy"") + ) { + state.missingRequiredFeature = ""bb.feature.approval-policy""; +@@ -148,14 +152,15 @@ export default defineComponent({ + } + if ( + type === ""bb.policy.backup-plan"" && +- policy.payload.schedule !== DefaultSchedulePolicy && ++ (policy.payload as PolicyBackupPlanPolicyPayload).schedule !== ++ DefaultSchedulePolicy && + !hasFeature(""bb.feature.backup-policy"") + ) { + state.missingRequiredFeature = ""bb.feature.backup-policy""; + return; + } +- store +- .dispatch(""policy/upsertPolicyByEnvironmentAndType"", { ++ policyStore ++ .upsertPolicyByEnvironmentAndType({ + environmentId, + type: type, + policyUpsert: {" +cheerio,https://github.com/cheeriojs/cheerio,80e6c51046166cddc5193fb7b4398a9fd89ab6d3,dependabot[bot],2024-12-17 08:49:19,build(deps-dev): bump @crowdin/cli from 4.4.1 to 4.5.0 in /website (#4304),"Bumps [@crowdin/cli](https://github.com/crowdin/crowdin-cli) from 4.4.1 to 4.5.0. +- [Release notes](https://github.com/crowdin/crowdin-cli/releases) +- [Changelog](https://github.com/crowdin/crowdin-cli/blob/main/CHANGELOG.md) +- [Commits](https://github.com/crowdin/crowdin-cli/compare/4.4.1...4.5.0) + +---","build(deps-dev): bump @crowdin/cli from 4.4.1 to 4.5.0 in /website (#4304) + +Bumps [@crowdin/cli](https://github.com/crowdin/crowdin-cli) from 4.4.1 to 4.5.0. +- [Release notes](https://github.com/crowdin/crowdin-cli/releases) +- [Changelog](https://github.com/crowdin/crowdin-cli/blob/main/CHANGELOG.md) +- [Commits](https://github.com/crowdin/crowdin-cli/compare/4.4.1...4.5.0) + +--- +updated-dependencies: +- dependency-name: ""@crowdin/cli"" + dependency-type: direct:development + update-type: version-update:semver-minor +... + +Signed-off-by: dependabot[bot] +Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>","diff --git a/website/package-lock.json b/website/package-lock.json +index 74c691e462..22d1350785 100644 +--- a/website/package-lock.json ++++ b/website/package-lock.json +@@ -25,7 +25,7 @@ + ""typedoc-plugin-mdn-links"": ""^3.3.8"" + }, + ""devDependencies"": { +- ""@crowdin/cli"": ""^4.4.1"", ++ ""@crowdin/cli"": ""^4.5.0"", + ""@tsconfig/docusaurus"": ""^2.0.3"", + ""typescript"": ""^5.7.2"" + }, +@@ -2080,9 +2080,9 @@ + } + }, + ""node_modules/@crowdin/cli"": { +- ""version"": ""4.4.1"", +- ""resolved"": ""https://registry.npmjs.org/@crowdin/cli/-/cli-4.4.1.tgz"", +- ""integrity"": ""sha512-xMKpEnROB+TD2cvkjCmgt/vhxp9V/mraAeD5Mqocev6eUutQW7JfqX7Q2dOE9H1SIoXs7UzNpzpaZ64YdxVcZg=="", ++ ""version"": ""4.5.0"", ++ ""resolved"": ""https://registry.npmjs.org/@crowdin/cli/-/cli-4.5.0.tgz"", ++ ""integrity"": ""sha512-faj84fCXT8GcM0CwZ6KuXQ6ckwRHj2OKFFib048RobykRoMFJxXJnu6P/OBjWpcqFFbxWJB0QL0VkS42hqdMng=="", + ""dev"": true, + ""dependencies"": { + ""command-exists-promise"": ""^2.0.2"", +diff --git a/website/package.json b/website/package.json +index dcaa368b3e..5b23f00f47 100644 +--- a/website/package.json ++++ b/website/package.json +@@ -33,7 +33,7 @@ + ""typedoc-plugin-mdn-links"": ""^3.3.8"" + }, + ""devDependencies"": { +- ""@crowdin/cli"": ""^4.4.1"", ++ ""@crowdin/cli"": ""^4.5.0"", + ""@tsconfig/docusaurus"": ""^2.0.3"", + ""typescript"": ""^5.7.2"" + }," +tree-sitter,https://github.com/tree-sitter/tree-sitter,4278e03b1138d0171a40145cd89bd0486fc733c1,Andrew Hlynskyi,2023-08-21 05:26:14,feat: generate Rust bindings during build process,"It can be used as: +> cargo build -p tree-sitter -F bindgen","feat: generate Rust bindings during build process + +It can be used as: + > cargo build -p tree-sitter -F bindgen","diff --git a/Cargo.lock b/Cargo.lock +index 3c444391a0..80a4e28d0f 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -43,6 +43,29 @@ dependencies = [ + ""winapi"", + ] + ++[[package]] ++name = ""bindgen"" ++version = ""0.66.1"" ++source = ""registry+https://github.com/rust-lang/crates.io-index"" ++checksum = ""f2b84e06fc203107bfbad243f4aba2af864eb7db3b1cf46ea0a023b0b433d2a7"" ++dependencies = [ ++ ""bitflags 2.4.0"", ++ ""cexpr"", ++ ""clang-sys"", ++ ""lazy_static"", ++ ""lazycell"", ++ ""log"", ++ ""peeking_take_while"", ++ ""prettyplease"", ++ ""proc-macro2"", ++ ""quote"", ++ ""regex"", ++ ""rustc-hash"", ++ ""shlex"", ++ ""syn 2.0.29"", ++ ""which"", ++] ++ + [[package]] + name = ""bitflags"" + version = ""1.3.2"" +@@ -82,6 +105,15 @@ version = ""1.1.0"" + source = ""registry+https://github.com/rust-lang/crates.io-index"" + checksum = ""6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c"" + ++[[package]] ++name = ""cexpr"" ++version = ""0.6.0"" ++source = ""registry+https://github.com/rust-lang/crates.io-index"" ++checksum = ""6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766"" ++dependencies = [ ++ ""nom"", ++] ++ + [[package]] + name = ""cfg-if"" + version = ""1.0.0"" +@@ -94,6 +126,17 @@ version = ""1.4.1"" + source = ""registry+https://github.com/rust-lang/crates.io-index"" + checksum = ""cca491388666e04d7248af3f60f0c40cfb0991c72205595d7c396e3510207d1a"" + ++[[package]] ++name = ""clang-sys"" ++version = ""1.6.1"" ++source = ""registry+https://github.com/rust-lang/crates.io-index"" ++checksum = ""c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f"" ++dependencies = [ ++ ""glob"", ++ ""libc"", ++ ""libloading"", ++] ++ + [[package]] + name = ""clap"" + version = ""2.34.0"" +@@ -381,6 +424,12 @@ version = ""1.4.0"" + source = ""registry+https://github.com/rust-lang/crates.io-index"" + checksum = ""e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"" + ++[[package]] ++name = ""lazycell"" ++version = ""1.3.0"" ++source = ""registry+https://github.com/rust-lang/crates.io-index"" ++checksum = ""830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"" ++ + [[package]] + name = ""libc"" + version = ""0.2.147"" +@@ -424,6 +473,12 @@ version = ""2.5.0"" + source = ""registry+https://github.com/rust-lang/crates.io-index"" + checksum = ""2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"" + ++[[package]] ++name = ""minimal-lexical"" ++version = ""0.2.1"" ++source = ""registry+https://github.com/rust-lang/crates.io-index"" ++checksum = ""68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"" ++ + [[package]] + name = ""ndk-context"" + version = ""0.1.1"" +@@ -442,6 +497,16 @@ dependencies = [ + ""static_assertions"", + ] + ++[[package]] ++name = ""nom"" ++version = ""7.1.3"" ++source = ""registry+https://github.com/rust-lang/crates.io-index"" ++checksum = ""d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"" ++dependencies = [ ++ ""memchr"", ++ ""minimal-lexical"", ++] ++ + [[package]] + name = ""objc"" + version = ""0.2.7"" +@@ -469,6 +534,12 @@ version = ""0.2.1"" + source = ""registry+https://github.com/rust-lang/crates.io-index"" + checksum = ""1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42"" + ++[[package]] ++name = ""peeking_take_while"" ++version = ""0.1.2"" ++source = ""registry+https://github.com/rust-lang/crates.io-index"" ++checksum = ""19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"" ++ + [[package]] + name = ""percent-encoding"" + version = ""2.3.0"" +@@ -491,6 +562,16 @@ dependencies = [ + ""yansi"", + ] + ++[[package]] ++name = ""prettyplease"" ++version = ""0.2.12"" ++source = ""registry+https://github.com/rust-lang/crates.io-index"" ++checksum = ""6c64d9ba0963cdcea2e1b2230fbae2bab30eb25a174be395c41e764bfb65dd62"" ++dependencies = [ ++ ""proc-macro2"", ++ ""syn 2.0.29"", ++] ++ + [[package]] + name = ""proc-macro2"" + version = ""1.0.66"" +@@ -684,6 +765,12 @@ dependencies = [ + ""serde"", + ] + ++[[package]] ++name = ""shlex"" ++version = ""1.1.0"" ++source = ""registry+https://github.com/rust-lang/crates.io-index"" ++checksum = ""43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3"" ++ + [[package]] + name = ""smallbitvec"" + version = ""2.5.1"" +@@ -831,6 +918,7 @@ dependencies = [ + name = ""tree-sitter"" + version = ""0.20.10"" + dependencies = [ ++ ""bindgen"", + ""cc"", + ""regex"", + ] +diff --git a/lib/Cargo.toml b/lib/Cargo.toml +index 5e1f355971..592521fdc0 100644 +--- a/lib/Cargo.toml ++++ b/lib/Cargo.toml +@@ -26,6 +26,7 @@ include = [ + regex = ""1.9.1"" + + [build-dependencies] ++bindgen = { version = ""^0.66.1"", optional = true } + cc = ""^1.0.79"" + + [lib] +diff --git a/lib/binding_rust/build.rs b/lib/binding_rust/build.rs +index ec367980c8..a74bdb2729 100644 +--- a/lib/binding_rust/build.rs ++++ b/lib/binding_rust/build.rs +@@ -17,6 +17,9 @@ fn main() { + } + } + ++ #[cfg(feature = ""bindgen"")] ++ generate_bindings(); ++ + let src_path = Path::new(""src""); + for entry in fs::read_dir(&src_path).unwrap() { + let entry = entry.unwrap(); +@@ -34,6 +37,44 @@ fn main() { + .compile(""tree-sitter""); + } + ++#[cfg(feature = ""bindgen"")] ++fn generate_bindings() { ++ const HEADER_PATH: &str = ""include/tree_sitter/api.h""; ++ ++ println!(""cargo:rerun-if-changed={}"", HEADER_PATH); ++ ++ let no_copy = [ ++ ""TSInput"", ++ ""TSLanguage"", ++ ""TSLogger"", ++ ""TSLookaheadIterator"", ++ ""TSParser"", ++ ""TSTree"", ++ ""TSQuery"", ++ ""TSQueryCursor"", ++ ""TSQueryCapture"", ++ ""TSQueryMatch"", ++ ""TSQueryPredicateStep"", ++ ]; ++ ++ let bindings = bindgen::Builder::default() ++ .header(HEADER_PATH) ++ .layout_tests(false) ++ .allowlist_type(""^TS.*"") ++ .allowlist_function(""^ts_.*"") ++ .allowlist_var(""^TREE_SITTER.*"") ++ .no_copy(no_copy.join(""|"")) ++ .generate() ++ .expect(""Failed to generate bindings""); ++ ++ let out_dir = PathBuf::from(env::var(""OUT_DIR"").unwrap()); ++ let bindings_rs = out_dir.join(""bindings.rs""); ++ ++ bindings.write_to_file(&bindings_rs).expect(&*format!( ++ ""Failed to write bindings into path: {bindings_rs:?}"" ++ )); ++} ++ + fn which(exe_name: impl AsRef) -> Option { + env::var_os(""PATH"").and_then(|paths| { + env::split_paths(&paths).find_map(|dir| { +diff --git a/lib/binding_rust/ffi.rs b/lib/binding_rust/ffi.rs +index ac4da98b62..a99d2afed0 100644 +--- a/lib/binding_rust/ffi.rs ++++ b/lib/binding_rust/ffi.rs +@@ -2,6 +2,10 @@ + #![allow(non_upper_case_globals)] + #![allow(non_camel_case_types)] + ++#[cfg(feature = ""bindgen"")] ++include!(concat!(env!(""OUT_DIR""), ""/bindings.rs"")); ++ ++#[cfg(not(feature = ""bindgen""))] + include!(""./bindings.rs""); + + extern ""C"" { +diff --git a/lib/binding_rust/lib.rs b/lib/binding_rust/lib.rs +index 932fc452ac..de3065d2d7 100644 +--- a/lib/binding_rust/lib.rs ++++ b/lib/binding_rust/lib.rs +@@ -27,12 +27,13 @@ use std::{ + /// The Tree-sitter library is generally backwards-compatible with languages + /// generated using older CLI versions, but is not forwards-compatible. + #[doc(alias = ""TREE_SITTER_LANGUAGE_VERSION"")] +-pub const LANGUAGE_VERSION: usize = ffi::TREE_SITTER_LANGUAGE_VERSION; ++pub const LANGUAGE_VERSION: usize = ffi::TREE_SITTER_LANGUAGE_VERSION as usize; + + /// The earliest ABI version that is supported by the current version of the + /// library. + #[doc(alias = ""TREE_SITTER_MIN_COMPATIBLE_LANGUAGE_VERSION"")] +-pub const MIN_COMPATIBLE_LANGUAGE_VERSION: usize = ffi::TREE_SITTER_MIN_COMPATIBLE_LANGUAGE_VERSION; ++pub const MIN_COMPATIBLE_LANGUAGE_VERSION: usize = ++ ffi::TREE_SITTER_MIN_COMPATIBLE_LANGUAGE_VERSION as usize; + + pub const PARSER_HEADER: &'static str = include_str!(""../include/tree_sitter/parser.h"");" +sentry,https://github.com/getsentry/sentry,dab313eef7e1f38feac67d02c1dd88f4b2c4535e,edwardgou-sentry,2023-02-01 00:14:55,feat(tags): updates tag values to link correctly (#43877),Updates the tag value legends in the tag summary with more relevant,"feat(tags): updates tag values to link correctly (#43877) + +Updates the tag value legends in the tag summary with more relevant +links: +- in issue tags, clicking on a tag value goes to the all events tab, +prefiltered by the selected tag value +- in issue tags, clicking on other goes to the tags tab on the selected +tag key +- in performance and discover, clicking on a tag value appends the tag +value to the current query (no change here) +- in performance and discover, clicking on other excludes top tag values +from the current query","diff --git a/static/app/components/group/tagFacets/index.spec.tsx b/static/app/components/group/tagFacets/index.spec.tsx +index 930c56dfcff5b1..be67754a2fbdf1 100644 +--- a/static/app/components/group/tagFacets/index.spec.tsx ++++ b/static/app/components/group/tagFacets/index.spec.tsx +@@ -3,7 +3,19 @@ import {render, screen, userEvent, waitFor} from 'sentry-test/reactTestingLibrar + + import TagFacets, {TAGS_FORMATTER} from 'sentry/components/group/tagFacets'; + +-const {organization} = initializeOrg(); ++const mockProject = TestStubs.Project(); ++const {router, organization, routerContext} = initializeOrg({ ++ organization: {}, ++ project: mockProject, ++ projects: [mockProject], ++ router: { ++ routes: [], ++ location: { ++ pathname: '/organizations/org-slug/issues/1/', ++ query: {}, ++ }, ++ }, ++}); + describe('Tag Facets', function () { + let tagsMock; + const project = TestStubs.Project(); +@@ -177,5 +189,67 @@ describe('Tag Facets', function () { + screen.getByRole('button', {name: 'Expand os tag distribution'}) + ).toBeInTheDocument(); + }); ++ ++ it('links to events with selected tag value', async function () { ++ render( ++ , ++ { ++ context: routerContext, ++ organization, ++ router, ++ } ++ ); ++ await waitFor(() => { ++ expect(tagsMock).toHaveBeenCalled(); ++ }); ++ userEvent.click( ++ screen.getByRole('button', {name: 'Expand device tag distribution'}) ++ ); ++ expect( ++ screen.getByRole('link', { ++ name: 'device, iPhone10, 27% of all events. View events with this tag value.', ++ }) ++ ).toHaveAttribute( ++ 'href', ++ '/organizations/org-slug/issues/1/events/?query=device%3AiPhone10' ++ ); ++ }); ++ ++ it('links to tags tab', async function () { ++ render( ++ , ++ { ++ context: routerContext, ++ organization, ++ router, ++ } ++ ); ++ await waitFor(() => { ++ expect(tagsMock).toHaveBeenCalled(); ++ }); ++ userEvent.click( ++ screen.getByRole('button', {name: 'Expand device tag distribution'}) ++ ); ++ expect( ++ screen.getByRole('link', { ++ name: 'Other device tag values, 13% of all events. View other tags.', ++ }) ++ ).toHaveAttribute( ++ 'href', ++ '/organizations/org-slug/issues/1/tags/device/?referrer=tag-distribution-meter' ++ ); ++ }); + }); + }); +diff --git a/static/app/components/group/tagFacets/index.tsx b/static/app/components/group/tagFacets/index.tsx +index 379eab9facb31b..951fbaae2cd731 100644 +--- a/static/app/components/group/tagFacets/index.tsx ++++ b/static/app/components/group/tagFacets/index.tsx +@@ -1,5 +1,6 @@ + import {Fragment, ReactNode, useEffect, useState} from 'react'; + import styled from '@emotion/styled'; ++import {LocationDescriptor} from 'history'; + import keyBy from 'lodash/keyBy'; + + import Placeholder from 'sentry/components/placeholder'; +@@ -8,7 +9,9 @@ import {t} from 'sentry/locale'; + import space from 'sentry/styles/space'; + import {Environment, Event, Organization, Project, TagWithTopValues} from 'sentry/types'; + import {formatVersion} from 'sentry/utils/formatters'; ++import {appendTagCondition} from 'sentry/utils/queryString'; + import useApi from 'sentry/utils/useApi'; ++import {useLocation} from 'sentry/utils/useLocation'; + import useOrganization from 'sentry/utils/useOrganization'; + + import TagFacetsDistributionMeter from './tagFacetsDistributionMeter'; +@@ -175,6 +178,8 @@ function TagFacetsDistributionMeterWrapper({ + tagsData: Record; + expandFirstTag?: boolean; + }) { ++ const location = useLocation(); ++ const query = {...location.query}; + return ( + + {tagKeys.map((tagKey, index) => { +@@ -182,13 +187,26 @@ function TagFacetsDistributionMeterWrapper({ + const topValues = tagWithTopValues ? tagWithTopValues.topValues : []; + const topValuesTotal = tagWithTopValues ? tagWithTopValues.totalValues : 0; + +- const url = `/organizations/${organization.slug}/issues/${groupId}/tags/${tagKey}/?referrer=tag-distribution-meter`; ++ const otherTagValuesUrl = `/organizations/${organization.slug}/issues/${groupId}/tags/${tagKey}/?referrer=tag-distribution-meter`; ++ const eventsPath = `/organizations/${organization.slug}/issues/${groupId}/events/`; + + const segments = topValues +- ? topValues.map(value => ({ +- ...value, +- url, +- })) ++ ? topValues.map(value => { ++ // Create a link to the events page with a tag condition on the selected value ++ const url: LocationDescriptor = { ++ ...location, ++ query: { ++ ...query, ++ query: appendTagCondition(null, tagKey, value.value), ++ }, ++ pathname: eventsPath, ++ }; ++ ++ return { ++ ...value, ++ url, ++ }; ++ }) + : []; + + return ( +@@ -200,6 +218,7 @@ function TagFacetsDistributionMeterWrapper({ + onTagClick={() => undefined} + project={project} + expandByDefault={expandFirstTag && index === 0} ++ otherUrl={otherTagValuesUrl} + /> + + ); +diff --git a/static/app/components/group/tagFacets/tagFacetsDistributionMeter.tsx b/static/app/components/group/tagFacets/tagFacetsDistributionMeter.tsx +index 1202b632e6dddb..d92dd9b09fcf8f 100644 +--- a/static/app/components/group/tagFacets/tagFacetsDistributionMeter.tsx ++++ b/static/app/components/group/tagFacets/tagFacetsDistributionMeter.tsx +@@ -1,6 +1,7 @@ + import {useState} from 'react'; + import isPropValid from '@emotion/is-prop-valid'; + import styled from '@emotion/styled'; ++import {LocationDescriptor} from 'history'; + import debounce from 'lodash/debounce'; + + import {TagSegment} from 'sentry/actionCreators/events'; +@@ -13,6 +14,8 @@ import {Organization, Project} from 'sentry/types'; + import {percent} from 'sentry/utils'; + import trackAdvancedAnalyticsEvent from 'sentry/utils/analytics/trackAdvancedAnalyticsEvent'; + import {isMobilePlatform} from 'sentry/utils/platform'; ++import {appendExcludeTagValuesCondition} from 'sentry/utils/queryString'; ++import {useLocation} from 'sentry/utils/useLocation'; + import useOrganization from 'sentry/utils/useOrganization'; + + const COLORS = ['#402A65', '#694D99', '#9A81C4', '#BBA6DF', '#EAE2F8']; +@@ -25,6 +28,7 @@ type Props = { + colors?: string[]; + expandByDefault?: boolean; + onTagClick?: (title: string, value: TagSegment) => void; ++ otherUrl?: LocationDescriptor; + project?: Project; + }; + +@@ -61,7 +65,9 @@ function TagFacetsDistributionMeter({ + onTagClick, + project, + expandByDefault, ++ otherUrl, + }: Props) { ++ const location = useLocation(); + const organization = useOrganization(); + const multiValueTag = segments.length > 1; + const [expanded, setExpanded] = useState(multiValueTag && !!expandByDefault); +@@ -173,7 +179,7 @@ function TagFacetsDistributionMeter({ + index === topSegments.length - 1 && segment.value === 'other'; + const linkLabel = isOtherSegment + ? t( +- 'Other %s tag values, %s of all events. View all tags.', ++ 'Other %s tag values, %s of all events. View other tags.', + title, + `${pctLabel}%` + ) +@@ -207,13 +213,23 @@ function TagFacetsDistributionMeter({ + const totalVisible = topSegments.reduce((sum, value) => sum + value.count, 0); + const hasOther = totalVisible < totalValues; + ++ const query = appendExcludeTagValuesCondition( ++ location.query.query, ++ title, ++ topSegments.map(({value}) => value) ++ ); ++ const excludeTopSegmentsUrl: LocationDescriptor = { ++ ...location, ++ query: {...location.query, query}, ++ }; ++ + if (hasOther) { + topSegments.push({ + isOther: true, + name: t('Other'), + value: 'other', + count: totalValues - totalVisible, +- url: '', ++ url: otherUrl ?? excludeTopSegmentsUrl ?? '', + }); + } + +diff --git a/static/app/utils/queryString.spec.tsx b/static/app/utils/queryString.spec.tsx +index ec72011f4a4eab..5b128e9e68dfe7 100644 +--- a/static/app/utils/queryString.spec.tsx ++++ b/static/app/utils/queryString.spec.tsx +@@ -76,6 +76,34 @@ describe('appendTagCondition', function () { + }); + }); + ++describe('appendExcludeTagValuesCondition', function () { ++ it('excludes tag values', function () { ++ const result = utils.appendExcludeTagValuesCondition(null, 'color', [ ++ 'red', ++ 'blue', ++ 'green', ++ ]); ++ expect(result).toEqual('!color:[red, blue, green]'); ++ }); ++ it('excludes tag values on an existing query', function () { ++ const result = utils.appendExcludeTagValuesCondition('user.id:123', 'color', [ ++ 'red', ++ 'blue', ++ 'green', ++ ]); ++ expect(result).toEqual('user.id:123 !color:[red, blue, green]'); ++ }); ++ it('wraps double quotes when a space exists in the tag value', function () { ++ const result = utils.appendExcludeTagValuesCondition(null, 'color', [ ++ 'red', ++ 'ocean blue', ++ '""green""', ++ '""sky blue""', ++ ]); ++ expect(result).toEqual('!color:[red, ""ocean blue"", ""\\""green\\"""", ""\\""sky blue\\""""]'); ++ }); ++}); ++ + describe('decodeScalar()', function () { + it('unwraps array values', function () { + expect(utils.decodeScalar(['one', 'two'])).toEqual('one'); +diff --git a/static/app/utils/queryString.tsx b/static/app/utils/queryString.tsx +index 0cf89e45b785f1..e34fc719741ed5 100644 +--- a/static/app/utils/queryString.tsx ++++ b/static/app/utils/queryString.tsx +@@ -55,6 +55,30 @@ export function appendTagCondition( + return currentQuery; + } + ++export function appendExcludeTagValuesCondition( ++ query: QueryValue, ++ key: string, ++ values: string[] ++): string { ++ let currentQuery = Array.isArray(query) ? query.pop() : isString(query) ? query : ''; ++ const filteredValuesCondition = `[${values ++ .map(value => { ++ if (typeof value === 'string' && /[\s""]/g.test(value)) { ++ value = `""${escapeDoubleQuotes(value)}""`; ++ } ++ return value; ++ }) ++ .join(', ')}]`; ++ ++ if (currentQuery) { ++ currentQuery += ` !${key}:${filteredValuesCondition}`; ++ } else { ++ currentQuery = `!${key}:${filteredValuesCondition}`; ++ } ++ ++ return currentQuery; ++} ++ + // This function has multiple signatures to help with typing in callers. + export function decodeScalar(value: QueryValue): string | undefined; + export function decodeScalar(value: QueryValue, fallback: string): string; +@@ -102,6 +126,7 @@ const queryString = { + formatQueryString, + addQueryParamsToExistingUrl, + appendTagCondition, ++ appendExcludeTagValuesCondition, + }; + + export default queryString; +diff --git a/static/app/views/discover/tags.spec.jsx b/static/app/views/discover/tags.spec.jsx +index ec595769081a61..1371520f0a93a0 100644 +--- a/static/app/views/discover/tags.spec.jsx ++++ b/static/app/views/discover/tags.spec.jsx +@@ -22,18 +22,24 @@ describe('Tags', function () { + body: [ + { + key: 'release', +- topValues: [{count: 3, value: '123abcd', name: '123abcd'}], ++ topValues: [{count: 30, value: '123abcd', name: '123abcd'}], + }, + { + key: 'environment', + topValues: [ +- {count: 2, value: 'abcd123', name: 'abcd123'}, +- {count: 1, value: 'anotherOne', name: 'anotherOne'}, ++ {count: 20, value: 'abcd123', name: 'abcd123'}, ++ {count: 10, value: 'anotherOne', name: 'anotherOne'}, + ], + }, + { + key: 'color', +- topValues: [{count: 3, value: 'red', name: 'red'}], ++ topValues: [ ++ {count: 10, value: 'red', name: 'red'}, ++ {count: 5, value: 'blue', name: 'blue'}, ++ {count: 5, value: 'green', name: 'green'}, ++ {count: 5, value: 'yellow', name: 'yellow'}, ++ {count: 5, value: 'orange', name: 'orange'}, ++ ], + }, + ], + }); +@@ -56,7 +62,7 @@ describe('Tags', function () { + , ++ {context: initialData.routerContext} ++ ); ++ ++ await waitForElementToBeRemoved( ++ () => screen.queryAllByTestId('loading-placeholder')[0] ++ ); ++ userEvent.click(screen.getByRole('button', {name: 'Expand color tag distribution'})); ++ expect( ++ screen.getByRole('link', { ++ name: 'Other color tag values, 16% of all events. View other tags.', ++ }) ++ ).toHaveAttribute( ++ 'href', ++ '/organizations/org-slug/discover/homepage/?query=%21color%3A%5Bred%2C%20blue%2C%20green%2C%20yellow%5D' ++ ); ++ }); + });" +cypress,https://github.com/cypress-io/cypress,b65371a6a12aa18d9cd187b5bbf9b006a49cabc7,Lachlan Miller,2022-04-29 05:54:01,fix: subscribe to changes in cypress.config.js in app (#21160),"* chore: work on build + +* subscribe to config changes + +* add test + +* extract required values from legacy config + +* add testingType and isComponentTesting to config + +* update cypress config + +* update runner config on window and re-execute after config changes + +* revert change + +* revert code + +* revert + +* revert file + +* update stub types","fix: subscribe to changes in cypress.config.js in app (#21160) + +* chore: work on build + +* subscribe to config changes + +* add test + +* extract required values from legacy config + +* add testingType and isComponentTesting to config + +* update cypress config + +* update runner config on window and re-execute after config changes + +* revert change + +* revert code + +* revert + +* revert file + +* update stub types","diff --git a/packages/app/cypress/e2e/subscriptions/configChange-subscription.cy.ts b/packages/app/cypress/e2e/subscriptions/configChange-subscription.cy.ts +new file mode 100644 +index 000000000000..a5f63cb61cce +--- /dev/null ++++ b/packages/app/cypress/e2e/subscriptions/configChange-subscription.cy.ts +@@ -0,0 +1,53 @@ ++function updateProjectIdInCypressConfig (value: string) { ++ return cy.withCtx((ctx, o) => { ++ let config = ctx.actions.file.readFileInProject('cypress.config.js') ++ ++ config = config.replace(`projectId: 'abc123'`, `projectId: '${o.value}'`) ++ ctx.actions.file.writeFileInProject('cypress.config.js', config) ++ }, { value }) ++} ++ ++function updateViewportHeightInCypressConfig (value: number) { ++ return cy.withCtx((ctx, o) => { ++ let config = ctx.actions.file.readFileInProject('cypress.config.js') ++ ++ config = config.replace(`e2e: {`, `e2e: {\n viewportHeight: ${o.value},\n`) ++ ctx.actions.file.writeFileInProject('cypress.config.js', config) ++ }, { value }) ++} ++ ++describe('specChange subscription', () => { ++ beforeEach(() => { ++ cy.scaffoldProject('cypress-in-cypress') ++ cy.openProject('cypress-in-cypress') ++ cy.startAppServer() ++ cy.visitApp() ++ }) ++ ++ describe('on config page', () => { ++ it('responds to configChange event when viewport is changed', () => { ++ cy.get('a').contains('Settings').click() ++ cy.get('[data-cy=""collapsible-header""]').contains('Project Settings').click() ++ cy.contains(`projectId: 'abc123'`) ++ updateProjectIdInCypressConfig('foo456') ++ cy.contains(`projectId: 'foo456'`) ++ }) ++ }) ++ ++ describe('on runner page', () => { ++ it('responds to configChange event and re-runs spec', () => { ++ // run spec ++ cy.contains('dom-content.spec').click() ++ ++ // wait until it has passed ++ cy.get('[data-model-state=""passed""]').should('contain', 'renders the test content') ++ cy.get('button').contains('1000x660') ++ ++ // update the config - the spec should re-execute with the new viewportHeight ++ updateViewportHeightInCypressConfig(777) ++ ++ cy.get('[data-model-state=""passed""]').should('contain', 'renders the test content') ++ cy.get('button').contains('1000x777') ++ }) ++ }) ++}) +diff --git a/packages/app/cypress/e2e/subscriptions/specChange-subscription.cy.ts b/packages/app/cypress/e2e/subscriptions/specChange-subscription.cy.ts +index 83265af88033..6930e11763c5 100644 +--- a/packages/app/cypress/e2e/subscriptions/specChange-subscription.cy.ts ++++ b/packages/app/cypress/e2e/subscriptions/specChange-subscription.cy.ts +@@ -22,8 +22,8 @@ describe('specChange subscription', () => { + .should('contain', 'dom-content.spec.js') + .should('contain', 'dom-list.spec.js') + +- cy.withCtx(async (ctx, o) => { +- await ctx.actions.file.writeFileInProject(o.path, '') ++ cy.withCtx((ctx, o) => { ++ ctx.actions.file.writeFileInProject(o.path, '') + }, { path: getPathForPlatform('cypress/e2e/new-file.spec.js') }) + + cy.get('[data-cy=""spec-item-link""]') +diff --git a/packages/app/src/pages/Settings.vue b/packages/app/src/pages/Settings.vue +index 936fae4e4a98..63b80f2cd19c 100644 +--- a/packages/app/src/pages/Settings.vue ++++ b/packages/app/src/pages/Settings.vue +@@ -6,15 +6,25 @@ + + + +diff --git a/packages/app/src/pages/Specs/Runner.vue b/packages/app/src/pages/Specs/Runner.vue +index 8895db57473d..e8c6a4778f6d 100644 +--- a/packages/app/src/pages/Specs/Runner.vue ++++ b/packages/app/src/pages/Specs/Runner.vue +@@ -25,10 +25,12 @@ + + + ++ ++ + + + +@@ -166,6 +174,10 @@ + hideWatermark: parseConfig(""__APPSMITH_HIDE_WATERMARK__""), + disableIframeWidgetSandbox: parseConfig(""__APPSMITH_DISABLE_IFRAME_WIDGET_SANDBOX__""), + }; ++ ++ gapiLoaded = () => { ++ window.googleAPIsLoaded = true; ++ } + + + +diff --git a/app/client/src/actions/datasourceActions.ts b/app/client/src/actions/datasourceActions.ts +index b388092abcfc..d9e061d5ea7e 100644 +--- a/app/client/src/actions/datasourceActions.ts ++++ b/app/client/src/actions/datasourceActions.ts +@@ -366,6 +366,19 @@ export const initializeDatasourceFormDefaults = (pluginType: string) => { + }; + }; + ++// In case of access to specific sheets in google sheet datasource, this action ++// is used for handling file picker callback, when user selects files/cancels the selection ++// this callback action will be triggered ++export const filePickerCallbackAction = (data: { ++ action: string; ++ datasourceId: string; ++}) => { ++ return { ++ type: ReduxActionTypes.FILE_PICKER_CALLBACK_ACTION, ++ payload: data, ++ }; ++}; ++ + export default { + fetchDatasources, + initDatasourcePane, +diff --git a/app/client/src/ce/constants/ReduxActionConstants.tsx b/app/client/src/ce/constants/ReduxActionConstants.tsx +index 16188e662f46..bb4625edcbcf 100644 +--- a/app/client/src/ce/constants/ReduxActionConstants.tsx ++++ b/app/client/src/ce/constants/ReduxActionConstants.tsx +@@ -760,6 +760,8 @@ export const ReduxActionTypes = { + AUTOLAYOUT_REORDER_WIDGETS: ""AUTOLAYOUT_REORDER_WIDGETS"", + AUTOLAYOUT_ADD_NEW_WIDGETS: ""AUTOLAYOUT_ADD_NEW_WIDGETS"", + RECALCULATE_COLUMNS: ""RECALCULATE_COLUMNS"", ++ SET_GSHEET_TOKEN: ""SET_GSHEET_TOKEN"", ++ FILE_PICKER_CALLBACK_ACTION: ""FILE_PICKER_CALLBACK_ACTION"", + }; + + export type ReduxActionType = typeof ReduxActionTypes[keyof typeof ReduxActionTypes]; +diff --git a/app/client/src/entities/Datasource/index.ts b/app/client/src/entities/Datasource/index.ts +index b8bce27d78b2..a2b0b79fb259 100644 +--- a/app/client/src/entities/Datasource/index.ts ++++ b/app/client/src/entities/Datasource/index.ts +@@ -11,6 +11,7 @@ export enum AuthenticationStatus { + NONE = ""NONE"", + IN_PROGRESS = ""IN_PROGRESS"", + SUCCESS = ""SUCCESS"", ++ FAILURE = ""FAILURE"", + } + export interface DatasourceAuthentication { + authType?: string; +@@ -104,6 +105,11 @@ export interface Datasource extends BaseDatasource { + success?: boolean; + } + ++export interface TokenResponse { ++ datasource: Datasource; ++ token: string; ++} ++ + export interface MockDatasource { + name: string; + description: string; +diff --git a/app/client/src/pages/Editor/SaaSEditor/DatasourceForm.tsx b/app/client/src/pages/Editor/SaaSEditor/DatasourceForm.tsx +index 5eb3e9fd268c..37474d384dfc 100644 +--- a/app/client/src/pages/Editor/SaaSEditor/DatasourceForm.tsx ++++ b/app/client/src/pages/Editor/SaaSEditor/DatasourceForm.tsx +@@ -34,6 +34,7 @@ import Connected from ""../DataSourceEditor/Connected""; + + import { + getCurrentApplicationId, ++ getGsheetToken, + getPagePermissions, + } from ""selectors/editorSelectors""; + import DatasourceAuth from ""pages/common/datasourceAuth""; +@@ -88,6 +89,7 @@ interface StateProps extends JSONtoFormProps { + isDatasourceBeingSaved: boolean; + isDatasourceBeingSavedFromPopup: boolean; + isFormDirty: boolean; ++ gsheetToken?: string; + } + interface DatasourceFormFunctions { + discardTempDatasource: () => void; +@@ -260,6 +262,7 @@ class DatasourceSaaSEditor extends JSONtoForm { + datasourceButtonConfiguration, + datasourceId, + formData, ++ gsheetToken, + hiddenHeader, + pageId, + plugin, +@@ -376,6 +379,7 @@ class DatasourceSaaSEditor extends JSONtoForm { + datasourceDeleteTrigger={this.datasourceDeleteTrigger} + formData={formData} + getSanitizedFormData={_.memoize(this.getSanitizedData)} ++ gsheetToken={gsheetToken} + isInvalid={this.validate()} + pageId={pageId} + shouldDisplayAuthMessage={!isGoogleSheetPlugin} +@@ -436,6 +440,8 @@ const mapStateToProps = (state: AppState, props: any) => { + ...pagePermissions, + ]); + ++ const gsheetToken = getGsheetToken(state); ++ + return { + datasource, + datasourceButtonConfiguration, +@@ -464,6 +470,7 @@ const mapStateToProps = (state: AppState, props: any) => { + isFormDirty, + canCreateDatasourceActions, + featureFlags: selectFeatureFlags(state), ++ gsheetToken, + }; + }; + +diff --git a/app/client/src/pages/common/datasourceAuth/index.tsx b/app/client/src/pages/common/datasourceAuth/index.tsx +index e8d3afa1a0f8..eb43c447a359 100644 +--- a/app/client/src/pages/common/datasourceAuth/index.tsx ++++ b/app/client/src/pages/common/datasourceAuth/index.tsx +@@ -16,6 +16,7 @@ import { + setDatasourceViewMode, + createDatasourceFromForm, + toggleSaveActionFlag, ++ filePickerCallbackAction, + } from ""actions/datasourceActions""; + import AnalyticsUtil from ""utils/AnalyticsUtil""; + import { getCurrentApplicationId } from ""selectors/editorSelectors""; +@@ -46,6 +47,7 @@ import { + hasDeleteDatasourcePermission, + hasManageDatasourcePermission, + } from ""@appsmith/utils/permissionHelpers""; ++import { getAppsmithConfigs } from ""ce/configs""; + + interface Props { + datasource: Datasource; +@@ -59,6 +61,7 @@ interface Props { + triggerSave?: boolean; + isFormDirty?: boolean; + datasourceDeleteTrigger: () => void; ++ gsheetToken?: string; + } + + export type DatasourceFormButtonTypes = Record; +@@ -119,6 +122,7 @@ function DatasourceAuth({ + shouldDisplayAuthMessage = true, + triggerSave, + isFormDirty, ++ gsheetToken, + }: Props) { + const authType = + formData && ""authType"" in formData +@@ -148,9 +152,18 @@ function DatasourceAuth({ + + const pageId = (pageIdQuery || pageIdProp) as string; + const [confirmDelete, setConfirmDelete] = useState(false); ++ ++ const [scriptLoadedFlag] = useState( ++ (window as any).googleAPIsLoaded, ++ ); ++ const [pickerInitiated, setPickerInitiated] = useState(false); + const dsName = datasource?.name; + const orgId = datasource?.workspaceId; + ++ // objects gapi and google are set, when google apis script is loaded ++ const gapi: any = (window as any).gapi; ++ const google: any = (window as any).google; ++ + useEffect(() => { + if (confirmDelete) { + delayConfirmDeleteToFalse(); +@@ -285,6 +298,50 @@ function DatasourceAuth({ + } + }; + ++ useEffect(() => { ++ // This loads the picker object in gapi script ++ if (!!gsheetToken && !!gapi) { ++ gapi.load(""client:picker"", async () => { ++ await gapi.client.load( ++ ""https://www.googleapis.com/discovery/v1/apis/drive/v3/rest"", ++ ); ++ setPickerInitiated(true); ++ }); ++ } ++ }, [scriptLoadedFlag, gsheetToken]); ++ ++ useEffect(() => { ++ if (!!gsheetToken && scriptLoadedFlag && pickerInitiated && !!google) { ++ createPicker(gsheetToken); ++ } ++ }, [gsheetToken, scriptLoadedFlag, pickerInitiated]); ++ ++ const createPicker = async (accessToken: string) => { ++ const { enableGoogleOAuth } = getAppsmithConfigs(); ++ const googleOAuthClientId: string = enableGoogleOAuth + """"; ++ const APP_ID = googleOAuthClientId.split(""-"")[0]; ++ const view = new google.picker.View(google.picker.ViewId.SPREADSHEETS); ++ view.setMimeTypes(""application/vnd.google-apps.spreadsheet""); ++ const picker = new google.picker.PickerBuilder() ++ .enableFeature(google.picker.Feature.NAV_HIDDEN) ++ .enableFeature(google.picker.Feature.MULTISELECT_ENABLED) ++ .setAppId(APP_ID) ++ .setOAuthToken(accessToken) ++ .addView(view) ++ .setCallback(pickerCallback) ++ .build(); ++ picker.setVisible(true); ++ }; ++ ++ const pickerCallback = async (data: any) => { ++ dispatch( ++ filePickerCallbackAction({ ++ action: data.action, ++ datasourceId: datasourceId, ++ }), ++ ); ++ }; ++ + const createMode = datasourceId === TEMP_DATASOURCE_ID; + + const datasourceButtonsComponentMap = (buttonType: string): JSX.Element => { +diff --git a/app/client/src/reducers/entityReducers/datasourceReducer.ts b/app/client/src/reducers/entityReducers/datasourceReducer.ts +index f7cdb0597fa4..a1e2076b7148 100644 +--- a/app/client/src/reducers/entityReducers/datasourceReducer.ts ++++ b/app/client/src/reducers/entityReducers/datasourceReducer.ts +@@ -26,6 +26,7 @@ export interface DatasourceDataState { + unconfiguredList: Datasource[]; + isDatasourceBeingSaved: boolean; + isDatasourceBeingSavedFromPopup: boolean; ++ gsheetToken: string; + } + + const initialState: DatasourceDataState = { +@@ -43,6 +44,7 @@ const initialState: DatasourceDataState = { + unconfiguredList: [], + isDatasourceBeingSaved: false, + isDatasourceBeingSavedFromPopup: false, ++ gsheetToken: """", + }; + + const datasourceReducer = createReducer(initialState, { +@@ -455,6 +457,15 @@ const datasourceReducer = createReducer(initialState, { + isDatasourceBeingSavedFromPopup: action.payload.isDSSavedFromPopup, + }; + }, ++ [ReduxActionTypes.SET_GSHEET_TOKEN]: ( ++ state: DatasourceDataState, ++ action: ReduxAction<{ gsheetToken: string }>, ++ ) => { ++ return { ++ ...state, ++ gsheetToken: action.payload.gsheetToken, ++ }; ++ }, + }); + + export default datasourceReducer; +diff --git a/app/client/src/sagas/DatasourcesSagas.ts b/app/client/src/sagas/DatasourcesSagas.ts +index 4437a9f5bb54..7f6afa1e5f14 100644 +--- a/app/client/src/sagas/DatasourcesSagas.ts ++++ b/app/client/src/sagas/DatasourcesSagas.ts +@@ -13,7 +13,7 @@ import { + getFormValues, + initialize, + } from ""redux-form""; +-import _, { merge, isEmpty, get, set } from ""lodash""; ++import { merge, isEmpty, get, set, partition, omit } from ""lodash""; + import equal from ""fast-deep-equal/es6""; + import { + ReduxAction, +@@ -47,10 +47,15 @@ import { + removeTempDatasource, + createDatasourceSuccess, + resetDefaultKeyValPairFlag, ++ updateDatasource, + } from ""actions/datasourceActions""; + import { ApiResponse } from ""api/ApiResponses""; + import DatasourcesApi, { CreateDatasourceConfig } from ""api/DatasourcesApi""; +-import { Datasource } from ""entities/Datasource""; ++import { ++ AuthenticationStatus, ++ Datasource, ++ TokenResponse, ++} from ""entities/Datasource""; + + import { INTEGRATION_EDITOR_MODES, INTEGRATION_TABS } from ""constants/routes""; + import history from ""utils/history""; +@@ -332,7 +337,7 @@ function* updateDatasourceSaga( + ) { + try { + const queryParams = getQueryParams(); +- const datasourcePayload = _.omit(actionPayload.payload, ""name""); ++ const datasourcePayload = omit(actionPayload.payload, ""name""); + datasourcePayload.isConfigured = true; // when clicking save button, it should be changed as configured + + const response: ApiResponse = yield DatasourcesApi.updateDatasource( +@@ -458,7 +463,7 @@ function* getOAuthAccessTokenSaga( + } + try { + // Get access token for datasource +- const response: ApiResponse = yield OAuthApi.getAccessToken( ++ const response: ApiResponse = yield OAuthApi.getAccessToken( + datasourceId, + appsmithToken, + ); +@@ -466,12 +471,22 @@ function* getOAuthAccessTokenSaga( + // Update the datasource object + yield put({ + type: ReduxActionTypes.UPDATE_DATASOURCE_SUCCESS, +- payload: response.data, +- }); +- Toaster.show({ +- text: OAUTH_AUTHORIZATION_SUCCESSFUL, +- variant: Variant.success, ++ payload: response.data.datasource, + }); ++ ++ if (!!response.data.token) { ++ yield put({ ++ type: ReduxActionTypes.SET_GSHEET_TOKEN, ++ payload: { ++ gsheetToken: response.data.token, ++ }, ++ }); ++ } else { ++ Toaster.show({ ++ text: OAUTH_AUTHORIZATION_SUCCESSFUL, ++ variant: Variant.success, ++ }); ++ } + // Remove the token because it is supposed to be short lived + localStorage.removeItem(APPSMITH_TOKEN_STORAGE_KEY); + } +@@ -702,7 +717,7 @@ function* createDatasourceFromFormSaga( + formConfig, + ); + +- const payload = _.omit(merge(initialValues, actionPayload.payload), [ ++ const payload = omit(merge(initialValues, actionPayload.payload), [ + ""id"", + ""new"", + ""type"", +@@ -778,12 +793,12 @@ function* changeDatasourceSaga( + const draft: Record = yield select(getDatasourceDraft, id); + const pageId: string = yield select(getCurrentPageId); + let data; +- if (_.isEmpty(draft)) { ++ if (isEmpty(draft)) { + data = datasource; + } else { + data = draft; + } +- yield put(initialize(DATASOURCE_DB_FORM, _.omit(data, [""name""]))); ++ yield put(initialize(DATASOURCE_DB_FORM, omit(data, [""name""]))); + // on reconnect modal, it shouldn't be redirected to datasource edit page + if (shouldNotRedirect) return; + // this redirects to the same route, so checking first. +@@ -804,7 +819,7 @@ function* changeDatasourceSaga( + ); + yield put( + // @ts-expect-error: data is of type unknown +- updateReplayEntity(data.id, _.omit(data, [""name""]), ENTITY_TYPE.DATASOURCE), ++ updateReplayEntity(data.id, omit(data, [""name""]), ENTITY_TYPE.DATASOURCE), + ); + } + +@@ -859,10 +874,10 @@ function* storeAsDatasourceSaga() { + const { values } = yield select(getFormData, API_EDITOR_FORM_NAME); + const applicationId: string = yield select(getCurrentApplicationId); + const pageId: string | undefined = yield select(getCurrentPageId); +- let datasource = _.get(values, ""datasource""); +- datasource = _.omit(datasource, [""name""]); +- const originalHeaders = _.get(values, ""actionConfiguration.headers"", []); +- const [datasourceHeaders, actionHeaders] = _.partition( ++ let datasource = get(values, ""datasource""); ++ datasource = omit(datasource, [""name""]); ++ const originalHeaders = get(values, ""actionConfiguration.headers"", []); ++ const [datasourceHeaders, actionHeaders] = partition( + originalHeaders, + ({ key, value }: { key: string; value: string }) => { + return !(isDynamicValue(key) || isDynamicValue(value)); +@@ -881,11 +896,7 @@ function* storeAsDatasourceSaga() { + (d) => !(d.key === """" && d.key === """"), + ); + +- _.set( +- datasource, +- ""datasourceConfiguration.headers"", +- filteredDatasourceHeaders, +- ); ++ set(datasource, ""datasourceConfiguration.headers"", filteredDatasourceHeaders); + + yield put(createTempDatasourceFromForm(datasource)); + const createDatasourceSuccessAction: unknown = yield take( +@@ -912,7 +923,7 @@ function* storeAsDatasourceSaga() { + + function* updateDatasourceSuccessSaga(action: UpdateDatasourceSuccessAction) { + const state: AppState = yield select(); +- const actionRouteInfo = _.get(state, ""ui.datasourcePane.actionRouteInfo""); ++ const actionRouteInfo = get(state, ""ui.datasourcePane.actionRouteInfo""); + const generateCRUDSupportedPlugin: GenerateCRUDEnabledPluginMap = yield select( + getGenerateCRUDEnabledPluginMap, + ); +@@ -1153,6 +1164,30 @@ function* initializeFormWithDefaults( + } + } + ++function* filePickerActionCallbackSaga( ++ actionPayload: ReduxAction<{ action: string; datasourceId: string }>, ++) { ++ try { ++ const { action, datasourceId } = actionPayload.payload; ++ yield put({ ++ type: ReduxActionTypes.SET_GSHEET_TOKEN, ++ payload: { ++ gsheetToken: """", ++ }, ++ }); ++ ++ if (action === ""cancel"") { ++ const datasource: Datasource = yield select(getDatasource, datasourceId); ++ set( ++ datasource, ++ ""datasourceConfiguration.authentication.authenticationStatus"", ++ AuthenticationStatus.FAILURE, ++ ); ++ yield put(updateDatasource(datasource)); ++ } ++ } catch (error) {} ++} ++ + export function* watchDatasourcesSagas() { + yield all([ + takeEvery(ReduxActionTypes.FETCH_DATASOURCES_INIT, fetchDatasourcesSaga), +@@ -1215,5 +1250,9 @@ export function* watchDatasourcesSagas() { + takeEvery(ReduxFormActionTypes.VALUE_CHANGE, formValueChangeSaga), + takeEvery(ReduxFormActionTypes.ARRAY_PUSH, formValueChangeSaga), + takeEvery(ReduxFormActionTypes.ARRAY_REMOVE, formValueChangeSaga), ++ takeEvery( ++ ReduxActionTypes.FILE_PICKER_CALLBACK_ACTION, ++ filePickerActionCallbackSaga, ++ ), + ]); + } +diff --git a/app/client/src/selectors/editorSelectors.tsx b/app/client/src/selectors/editorSelectors.tsx +index b46ca791ce16..e94ef76d8bdc 100644 +--- a/app/client/src/selectors/editorSelectors.tsx ++++ b/app/client/src/selectors/editorSelectors.tsx +@@ -856,3 +856,6 @@ export const showCanvasTopSectionSelector = createSelector( + return true; + }, + ); ++ ++export const getGsheetToken = (state: AppState) => ++ state.entities.datasources.gsheetToken; +diff --git a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/OAuthResponseDTO.java b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/OAuthResponseDTO.java +new file mode 100644 +index 000000000000..9c5a9c70938f +--- /dev/null ++++ b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/OAuthResponseDTO.java +@@ -0,0 +1,15 @@ ++package com.appsmith.external.models; ++ ++import lombok.Getter; ++import lombok.NoArgsConstructor; ++import lombok.Setter; ++import lombok.ToString; ++ ++@Getter ++@Setter ++@ToString ++@NoArgsConstructor ++public class OAuthResponseDTO { ++ Datasource datasource; ++ String token; ++} +diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/SaasControllerCE.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/SaasControllerCE.java +index 7c3083ec1608..81f51deaf63e 100644 +--- a/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/SaasControllerCE.java ++++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/SaasControllerCE.java +@@ -15,6 +15,7 @@ + import org.springframework.web.bind.annotation.RequestParam; + import org.springframework.web.server.ServerWebExchange; + import reactor.core.publisher.Mono; ++import com.appsmith.external.models.OAuthResponseDTO; + + @Slf4j + @RequestMapping(Url.SAAS_URL) +@@ -40,7 +41,7 @@ public Mono> getAppsmithToken(@PathVariable String datasourc + } + + @PostMapping(""/{datasourceId}/token"") +- public Mono> getAccessToken(@PathVariable String datasourceId, @RequestParam String appsmithToken, ServerWebExchange serverWebExchange) { ++ public Mono> getAccessToken(@PathVariable String datasourceId, @RequestParam String appsmithToken, ServerWebExchange serverWebExchange) { + + log.debug(""Received callback for an OAuth2 authorization request""); + return authenticationService.getAccessTokenFromCloud(datasourceId, appsmithToken) +diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/AuthenticationServiceCE.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/AuthenticationServiceCE.java +index 742909568a8c..a3ab2053d93a 100644 +--- a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/AuthenticationServiceCE.java ++++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/AuthenticationServiceCE.java +@@ -1,6 +1,7 @@ + package com.appsmith.server.solutions.ce; + + import com.appsmith.external.models.Datasource; ++import com.appsmith.external.models.OAuthResponseDTO; + import com.appsmith.server.dtos.AuthorizationCodeCallbackDTO; + import org.springframework.http.server.reactive.ServerHttpRequest; + import reactor.core.publisher.Mono; +@@ -30,7 +31,7 @@ public interface AuthenticationServiceCE { + + Mono getAppsmithToken(String datasourceId, String pageId, String branchName, ServerHttpRequest request, String importForGit); + +- Mono getAccessTokenFromCloud(String datasourceId, String appsmithToken); ++ Mono getAccessTokenFromCloud(String datasourceId, String appsmithToken); + + Mono refreshAuthentication(Datasource datasource); + +diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/AuthenticationServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/AuthenticationServiceCEImpl.java +index 99d082bd6dba..550a7bd30172 100644 +--- a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/AuthenticationServiceCEImpl.java ++++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/AuthenticationServiceCEImpl.java +@@ -8,6 +8,7 @@ + import com.appsmith.external.models.AuthenticationDTO; + import com.appsmith.external.models.AuthenticationResponse; + import com.appsmith.external.models.Datasource; ++import com.appsmith.external.models.OAuthResponseDTO; + import com.appsmith.external.models.DefaultResources; + import com.appsmith.external.models.OAuth2; + import com.appsmith.server.configurations.CloudServicesConfig; +@@ -85,6 +86,8 @@ public class AuthenticationServiceCEImpl implements AuthenticationServiceCE { + private final ConfigService configService; + private final DatasourcePermission datasourcePermission; + private final PagePermission pagePermission; ++ private static final String FILE_SPECIFIC_DRIVE_SCOPE = ""https://www.googleapis.com/auth/drive.file""; ++ private static final String ACCESS_TOKEN_KEY = ""access_token""; + + /** + * This method is used by the generic OAuth2 implementation that is used by REST APIs. Here, we only populate all the required fields +@@ -385,7 +388,7 @@ public Mono getAppsmithToken(String datasourceId, String pageId, String + })); + } + +- public Mono getAccessTokenFromCloud(String datasourceId, String appsmithToken) { ++ public Mono getAccessTokenFromCloud(String datasourceId, String appsmithToken) { + // Check if user has access to manage datasource + // If yes, check if datasource is in intermediate state + // If yes, request for token and store in datasource +@@ -437,10 +440,21 @@ public Mono getAccessTokenFromCloud(String datasourceId, String apps + } + } + datasource.getDatasourceConfiguration().setAuthentication(oAuth2); +- return Mono.just(datasource); ++ String accessToken = """"; ++ if (oAuth2.getScope() != null && oAuth2.getScope().contains(FILE_SPECIFIC_DRIVE_SCOPE)) { ++ accessToken = (String) tokenResponse.get(ACCESS_TOKEN_KEY); ++ } ++ return Mono.zip(Mono.just(datasource), Mono.just(accessToken)); + }); + }) +- .flatMap(datasource -> datasourceService.update(datasource.getId(), datasource)) ++ .flatMap(tuple -> { ++ Datasource datasource = tuple.getT1(); ++ String accessToken = tuple.getT2(); ++ OAuthResponseDTO response = new OAuthResponseDTO(); ++ response.setDatasource(datasource); ++ response.setToken(accessToken); ++ return datasourceService.update(datasource.getId(), datasource).thenReturn(response); ++ }) + .onErrorMap(ConnectException.class, + error -> new AppsmithException( + AppsmithError.AUTHENTICATION_FAILURE," +keda,https://github.com/kedacore/keda,df36d7a29021fad4aad729ca25cd3cbaf0838252,Jorge Turrado Ferrero,2022-09-09 13:28:38,chore: bump Golang to 1.18.6 for **build-tools** (#3654),* chore: bump Golang to 1.18.6 for build-tools,"chore: bump Golang to 1.18.6 for **build-tools** (#3654) + +* chore: bump Golang to 1.18.6 for build-tools + +Signed-off-by: Jorge Turrado + +* add Makefile changes detection to build-tools CI + +Signed-off-by: Jorge Turrado + +Signed-off-by: Jorge Turrado ","diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml +index d687d24ef3a..80f522b6b12 100644 +--- a/.github/workflows/pr-validation.yml ++++ b/.github/workflows/pr-validation.yml +@@ -116,6 +116,7 @@ jobs: + filters: | + tools: + - 'tools/**' ++ - 'Makefile' + + - name: Set up QEMU + if: steps.filter.outputs.tools == 'true' +diff --git a/Makefile b/Makefile +index 65a197da549..20fcf776aef 100644 +--- a/Makefile ++++ b/Makefile +@@ -21,7 +21,7 @@ IMAGE_REPO ?= kedacore + IMAGE_CONTROLLER = $(IMAGE_REGISTRY)/$(IMAGE_REPO)/keda$(SUFFIX):$(VERSION) + IMAGE_ADAPTER = $(IMAGE_REGISTRY)/$(IMAGE_REPO)/keda-metrics-apiserver$(SUFFIX):$(VERSION) + +-BUILD_TOOLS_GO_VERSION = 1.17.13 ++BUILD_TOOLS_GO_VERSION = 1.18.6 + IMAGE_BUILD_TOOLS = $(IMAGE_REGISTRY)/$(IMAGE_REPO)/build-tools:$(BUILD_TOOLS_GO_VERSION) + + ARCH ?=amd64" +lance,https://github.com/lancedb/lance,7651740bec399ef5617705414c383199b104e443,Weston Pace,2024-08-19 20:18:18,fix: fix two cases in the v2 decoder where the decode order didn't match the scheduling priority (#2754),"This could lead to deadlocks when the io_buffer_size is small (or when +page sizes are very large). + +Unfortunately, this is not the ideal scheduling algorithm, it uses too +much RAM, but it's better to do that than deadlock. Details in #2753","fix: fix two cases in the v2 decoder where the decode order didn't match the scheduling priority (#2754) + +This could lead to deadlocks when the io_buffer_size is small (or when +page sizes are very large). + +Unfortunately, this is not the ideal scheduling algorithm, it uses too +much RAM, but it's better to do that than deadlock. Details in #2753","diff --git a/python/python/tests/test_dataset.py b/python/python/tests/test_dataset.py +index 8a3828b6b1..605e60c321 100644 +--- a/python/python/tests/test_dataset.py ++++ b/python/python/tests/test_dataset.py +@@ -1626,6 +1626,65 @@ def datagen(): + schema=schema, + data_storage_version=""stable"", + max_rows_per_file=2 * 1024 * 1024, ++ mode=""overwrite"", ++ ) ++ ++ dataset.scanner(batch_size=2 * 1024 * 1024, io_buffer_size=5000).to_table() ++ ++ # This test is similar but the first column is a list column. The I/O to grab ++ # the list items will span multiple requests and it is important that all of ++ # those requests share the priority of the parent list ++ ++ def datagen(): ++ for i in range(2): ++ yield pa.record_batch( ++ [ ++ pa.array([[0]] * 1024 * 1024, pa.list_(pa.uint64())), ++ pa.array(range(1024 * 1024), pa.uint64()), ++ ], ++ names=[""a"", ""b""], ++ ) ++ ++ schema = pa.schema({""a"": pa.list_(pa.uint64()), ""b"": pa.uint64()}) ++ ++ dataset = lance.write_dataset( ++ datagen(), ++ base_dir, ++ schema=schema, ++ data_storage_version=""stable"", ++ max_rows_per_file=2 * 1024 * 1024, ++ mode=""overwrite"", ++ ) ++ ++ dataset.scanner(batch_size=2 * 1024 * 1024, io_buffer_size=5000).to_table() ++ ++ # Next we consider the case where the column is a struct column and we want to ++ # make sure we don't decode too deeply into the struct child ++ ++ def datagen(): ++ for i in range(2): ++ yield pa.record_batch( ++ [ ++ pa.array( ++ [{""foo"": i} for i in range(1024 * 1024)], ++ pa.struct([pa.field(""foo"", pa.uint64())]), ++ ), ++ pa.array(range(1024 * 1024), pa.uint64()), ++ ], ++ names=[""a"", ""b""], ++ ) ++ ++ schema = pa.schema( ++ {""a"": pa.struct([pa.field(""foo"", pa.uint64())]), ""b"": pa.uint64()} ++ ) ++ ++ dataset = lance.write_dataset( ++ datagen(), ++ base_dir, ++ schema=schema, ++ data_storage_version=""stable"", ++ max_rows_per_file=2 * 1024 * 1024, ++ mode=""overwrite"", + ) + + dataset.scanner(batch_size=2 * 1024 * 1024, io_buffer_size=5000).to_table() +diff --git a/rust/lance-encoding/src/decoder.rs b/rust/lance-encoding/src/decoder.rs +index 506a321240..64bdddc7dc 100644 +--- a/rust/lance-encoding/src/decoder.rs ++++ b/rust/lance-encoding/src/decoder.rs +@@ -921,14 +921,21 @@ impl DecodeBatchScheduler { + filter: &FilterExpression, + io: Arc, + mut schedule_action: impl FnMut(Result) -> bool, ++ // If specified, this will be used as the top_level_row for all scheduling ++ // tasks. This is used by list scheduling to ensure all items scheduling ++ // tasks are scheduled at the same top level row. ++ top_level_row_override: Option, + ) { + let rows_requested = ranges.iter().map(|r| r.end - r.start).sum::(); + trace!( +- ""Scheduling {} ranges across {}..{} ({} rows)"", ++ ""Scheduling {} ranges across {}..{} ({} rows){}"", + ranges.len(), + ranges.first().unwrap().start, + ranges.last().unwrap().end, +- rows_requested ++ rows_requested, ++ top_level_row_override ++ .map(|o| format!("" (top_level_row_override={})"", o)) ++ .unwrap_or_default() + ); + + let mut context = SchedulerContext::new(io); +@@ -942,7 +949,8 @@ impl DecodeBatchScheduler { + let mut rows_to_schedule = root_job.num_rows(); + trace!(""Scheduled ranges refined to {} rows"", rows_to_schedule); + while rows_to_schedule > 0 { +- let maybe_next_scan_line = root_job.schedule_next(&mut context, num_rows_scheduled); ++ let top_level_row = top_level_row_override.unwrap_or(num_rows_scheduled); ++ let maybe_next_scan_line = root_job.schedule_next(&mut context, top_level_row); + if let Err(schedule_next_err) = maybe_next_scan_line { + schedule_action(Err(schedule_next_err)); + return; +@@ -974,12 +982,19 @@ impl DecodeBatchScheduler { + ranges: &[Range], + filter: &FilterExpression, + io: Arc, ++ top_level_row_override: Option, + ) -> Result> { + let mut decode_messages = Vec::new(); +- self.do_schedule_ranges(ranges, filter, io, |msg| { +- decode_messages.push(msg); +- true +- }); ++ self.do_schedule_ranges( ++ ranges, ++ filter, ++ io, ++ |msg| { ++ decode_messages.push(msg); ++ true ++ }, ++ top_level_row_override, ++ ); + decode_messages.into_iter().collect::>>() + } + +@@ -1000,19 +1015,25 @@ impl DecodeBatchScheduler { + sink: mpsc::UnboundedSender>, + scheduler: Arc, + ) { +- self.do_schedule_ranges(ranges, filter, scheduler, |msg| { +- match sink.send(msg) { +- Ok(_) => true, +- Err(SendError { .. }) => { +- // The receiver has gone away. We can't do anything about it +- // so just ignore the error. +- debug!( ++ self.do_schedule_ranges( ++ ranges, ++ filter, ++ scheduler, ++ |msg| { ++ match sink.send(msg) { ++ Ok(_) => true, ++ Err(SendError { .. }) => { ++ // The receiver has gone away. We can't do anything about it ++ // so just ignore the error. ++ debug!( + ""schedule_ranges aborting early since decoder appears to have been dropped"" + ); +- false ++ false ++ } + } +- } +- }) ++ }, ++ None, ++ ) + } + + /// Schedules the load of a range of rows +@@ -1187,15 +1208,13 @@ impl BatchDecodeStream { + return Ok(None); + } + +- let avail = self.root_decoder.avail(); +- trace!(""Top level page has {} rows already available"", avail); +- if avail < to_take { +- trace!( +- ""Top level page waiting for an additional {} rows"", +- to_take - avail +- ); +- self.root_decoder.wait(to_take).await?; +- } ++ let loaded_need = self.rows_drained + to_take; ++ trace!( ++ ""Waiting for I/O (desire at least {} loaded rows)"", ++ loaded_need ++ ); ++ self.root_decoder.wait_for_loaded(loaded_need).await?; ++ + let next_task = self.root_decoder.drain(to_take)?; + self.rows_drained += to_take; + Ok(Some(next_task)) +@@ -1549,14 +1568,24 @@ pub trait LogicalPageDecoder: std::fmt::Debug + Send { + location: location!(), + }) + } +- /// Waits for enough data to be loaded to decode `num_rows` of data +- fn wait(&mut self, num_rows: u64) -> BoxFuture>; ++ /// Waits until at least `num_rows` have been loaded ++ fn wait_for_loaded(&mut self, num_rows: u64) -> BoxFuture>; ++ /// The number of rows loaded so far ++ fn rows_loaded(&self) -> u64; ++ /// The number of rows that still need loading ++ fn rows_unloaded(&self) -> u64 { ++ self.num_rows() - self.rows_loaded() ++ } ++ /// The total number of rows in the field ++ fn num_rows(&self) -> u64; ++ /// The number of rows that have been drained so far ++ fn rows_drained(&self) -> u64; ++ /// The number of rows that are still available to drain ++ fn rows_left(&self) -> u64 { ++ self.num_rows() - self.rows_drained() ++ } + /// Creates a task to decode `num_rows` of data into an array + fn drain(&mut self, num_rows: u64) -> Result; +- /// The number of rows that are in the page but haven't yet been ""waited"" +- fn unawaited(&self) -> u64; +- /// The number of rows that have been ""waited"" but not yet decoded +- fn avail(&self) -> u64; + /// The data type of the decoded data + fn data_type(&self) -> &DataType; + } +diff --git a/rust/lance-encoding/src/encodings/logical/list.rs b/rust/lance-encoding/src/encodings/logical/list.rs +index 001fa82fe4..39bc7a7275 100644 +--- a/rust/lance-encoding/src/encodings/logical/list.rs ++++ b/rust/lance-encoding/src/encodings/logical/list.rs +@@ -318,11 +318,12 @@ async fn indirect_schedule_task( + items_scheduler: Arc, + items_type: DataType, + io: Arc, ++ top_level_row: u64, + ) -> Result { +- let num_offsets = offsets_decoder.unawaited(); ++ let num_offsets = offsets_decoder.num_rows(); + // We know the offsets are a primitive array and thus will not need additional + // pages. We can use a dummy receiver to match the decoder API +- offsets_decoder.wait(num_offsets).await?; ++ offsets_decoder.wait_for_loaded(num_offsets).await?; + let decode_task = offsets_decoder.drain(num_offsets)?; + let offsets = decode_task.task.decode()?; + +@@ -359,6 +360,7 @@ async fn indirect_schedule_task( + // Can't push filters into list items + &FilterExpression::no_filter(), + io, ++ Some(top_level_row), + )?; + + for message in indirect_messages { +@@ -440,6 +442,7 @@ impl<'a> SchedulingJob for ListFieldSchedulingJob<'a> { + items_scheduler, + items_type, + io, ++ top_level_row, + )); + + // Return a decoder +@@ -448,7 +451,7 @@ impl<'a> SchedulingJob for ListFieldSchedulingJob<'a> { + validity: BooleanBuffer::new(Buffer::from_vec(Vec::::default()), 0, 0), + item_decoder: None, + rows_drained: 0, +- lists_available: 0, ++ rows_loaded: 0, + item_field_name: self.scheduler.item_field_name.clone(), + num_rows, + unloaded: Some(indirect_fut), +@@ -568,9 +571,9 @@ struct ListPageDecoder { + offsets: Vec, + validity: BooleanBuffer, + item_decoder: Option, +- lists_available: u64, + num_rows: u64, + rows_drained: u64, ++ rows_loaded: u64, + item_field_name: String, + items_type: DataType, + offset_type: DataType, +@@ -646,7 +649,7 @@ impl DecodeArrayTask for ListDecodeTask { + } + + impl LogicalPageDecoder for ListPageDecoder { +- fn wait(&mut self, num_rows: u64) -> BoxFuture> { ++ fn wait_for_loaded(&mut self, loaded_need: u64) -> BoxFuture> { + async move { + // wait for the indirect I/O to finish, run the scheduler for the indirect + // I/O and then wait for enough items to arrive +@@ -665,42 +668,39 @@ impl LogicalPageDecoder for ListPageDecoder { + self.validity = indirectly_loaded.validity; + self.item_decoder = indirectly_loaded.root_decoder; + } +- trace!( +- ""List decoder is waiting for {} rows and {} are already available and {} are unawaited"", +- num_rows, +- self.lists_available, +- self.num_rows - self.rows_drained +- ); +- if self.lists_available >= num_rows { +- self.lists_available -= num_rows; ++ if self.rows_loaded >= loaded_need { + return Ok(()); + } +- let num_rows = num_rows - self.lists_available; +- self.lists_available = 0; +- let offset_wait_start = self.rows_drained + self.lists_available; +- let item_start = self.offsets[offset_wait_start as usize]; +- let items_needed = +- self.offsets[offset_wait_start as usize + num_rows as usize] - item_start; +- if items_needed > 0 { +- trace!(""Waiting on list items page for {} items"", items_needed); +- self.item_decoder.as_mut().unwrap().wait(items_needed).await?; +- } +- // This is technically undercounting a little. It's possible that we loaded a big items +- // page with many items and then only needed a few of them for the requested lists. However, +- // to find the exact number of lists that are available we would need to walk through the item +- // lengths and it's faster to just undercount here. +- self.lists_available += num_rows; ++ ++ // Ideally this would be self.offsets[loaded_need] but it would be very difficult for ++ // the scheduler to schedule things in that order. Unfortantely, when scheduling lists, ++ // we schedule and entire page of lists at the same priority. As a result, we need to ++ // decode the entire page of lists all at once. ++ let items_loaded_need = *self.offsets.last().unwrap(); ++ trace!( ++ ""List decoder is waiting for {} rows to be loaded and {}/{} are already loaded. To satisfy this we need {} loaded items"", ++ loaded_need, ++ self.rows_loaded, ++ self.num_rows, ++ items_loaded_need, ++ ); ++ ++ let items_loaded = if items_loaded_need > 0 { ++ self.item_decoder.as_mut().unwrap().wait_for_loaded(items_loaded_need).await?; ++ self.item_decoder.as_ref().unwrap().rows_loaded() ++ } else { ++ 0 ++ }; ++ ++ self.rows_loaded = self.num_rows; ++ trace!(""List decoder now has {} loaded items which corresponds to {} loaded rows"", items_loaded, self.rows_loaded); ++ + Ok(()) + } + .boxed() + } + +- fn unawaited(&self) -> u64 { +- self.num_rows - self.lists_available - self.rows_drained +- } +- + fn drain(&mut self, num_rows: u64) -> Result { +- self.lists_available -= num_rows; + // We already have the offsets but need to drain the item pages + let mut actual_num_rows = num_rows; + let item_start = self.offsets[self.rows_drained as usize]; +@@ -745,8 +745,9 @@ impl LogicalPageDecoder for ListPageDecoder { + }; + + self.rows_drained += num_rows; ++ let has_more = self.rows_left() > 0; + Ok(NextDecodeTask { +- has_more: self.avail() > 0 || self.unawaited() > 0, ++ has_more, + num_rows, + task: Box::new(ListDecodeTask { + offsets, +@@ -759,8 +760,16 @@ impl LogicalPageDecoder for ListPageDecoder { + }) + } + +- fn avail(&self) -> u64 { +- self.lists_available ++ fn num_rows(&self) -> u64 { ++ self.num_rows ++ } ++ ++ fn rows_loaded(&self) -> u64 { ++ self.rows_loaded ++ } ++ ++ fn rows_drained(&self) -> u64 { ++ self.rows_drained + } + + fn data_type(&self) -> &DataType { +diff --git a/rust/lance-encoding/src/encodings/logical/primitive.rs b/rust/lance-encoding/src/encodings/logical/primitive.rs +index 81a254a51e..f6db9b27b6 100644 +--- a/rust/lance-encoding/src/encodings/logical/primitive.rs ++++ b/rust/lance-encoding/src/encodings/logical/primitive.rs +@@ -276,10 +276,10 @@ impl DecodeArrayTask for PrimitiveFieldDecodeTask { + impl LogicalPageDecoder for PrimitiveFieldDecoder { + // TODO: In the future, at some point, we may consider partially waiting for primitive pages by + // breaking up large I/O into smaller I/O as a way to accelerate the ""time-to-first-decode"" +- fn wait(&mut self, num_rows: u64) -> BoxFuture> { ++ fn wait_for_loaded(&mut self, loaded_need: u64) -> BoxFuture> { + log::trace!( + ""PrimitiveFieldDecoder::wait for {} rows on column {} (page has {} rows)"", +- num_rows, ++ loaded_need, + self.column_index, + self.num_rows + ); +@@ -319,22 +319,26 @@ impl LogicalPageDecoder for PrimitiveFieldDecoder { + }) + } + +- fn unawaited(&self) -> u64 { ++ fn rows_loaded(&self) -> u64 { + if self.unloaded_physical_decoder.is_some() { +- self.num_rows +- } else { + 0 ++ } else { ++ self.num_rows + } + } + +- fn avail(&self) -> u64 { ++ fn rows_drained(&self) -> u64 { + if self.unloaded_physical_decoder.is_some() { + 0 + } else { +- self.num_rows - self.rows_drained ++ self.rows_drained + } + } + ++ fn num_rows(&self) -> u64 { ++ self.num_rows ++ } ++ + fn data_type(&self) -> &DataType { + &self.data_type + } +diff --git a/rust/lance-encoding/src/encodings/logical/struct.rs b/rust/lance-encoding/src/encodings/logical/struct.rs +index 3625360e5f..1a23547577 100644 +--- a/rust/lance-encoding/src/encodings/logical/struct.rs ++++ b/rust/lance-encoding/src/encodings/logical/struct.rs +@@ -215,12 +215,12 @@ struct ChildState { + // or pages are very small + // TODO: Test this case + scheduled: VecDeque>, +- // Rows that should still be coming over the channel source but haven't yet been +- // put into the awaited queue +- rows_unawaited: u64, +- // Rows that have been pulled out of the channel source, awaited, and are ready to +- // be drained +- rows_available: u64, ++ // Rows that have been awaited ++ rows_loaded: u64, ++ // Rows that have drained ++ rows_drained: u64, ++ // Total number of rows in the struct ++ num_rows: u64, + // The field index in the struct (used for debugging / logging) + field_index: u32, + } +@@ -254,71 +254,71 @@ impl ChildState { + fn new(num_rows: u64, field_index: u32) -> Self { + Self { + scheduled: VecDeque::new(), +- rows_unawaited: num_rows, +- rows_available: 0, ++ rows_loaded: 0, ++ rows_drained: 0, ++ num_rows, + field_index, + } + } + + // Wait for the next set of rows to arrive + // +- // Wait until we have at least `num_rows` available but stop if +- // rows_awaited reaches `awaited_limit` (because we need to wait from +- // other columns at that point) +- async fn wait(&mut self, num_rows: u64, unawaited_limit: u64) -> Result<()> { ++ // Wait until we have at least `loaded_need` loaded and stop as soon as we ++ // go above that limit. ++ async fn wait_for_loaded(&mut self, loaded_need: u64) -> Result<()> { + trace!( +- ""Struct child {} waiting for {} rows and {} are available already (but stop if unawaited passes {})"", ++ ""Struct child {} waiting for at least {} rows to be loaded and {} are loaded already"", + self.field_index, +- num_rows, +- self.rows_available, +- unawaited_limit, ++ loaded_need, ++ self.rows_loaded, + ); +- let mut remaining = num_rows.saturating_sub(self.rows_available); +- for next_decoder in &mut self.scheduled { +- if next_decoder.unawaited() > 0 { +- let rows_to_wait = remaining.min(next_decoder.unawaited()); ++ let mut current_need = loaded_need; ++ let mut loaded = 0; ++ for (page_idx, next_decoder) in self.scheduled.iter_mut().enumerate() { ++ if next_decoder.rows_unloaded() > 0 { ++ let need_for_page = next_decoder.num_rows().min(current_need); + trace!( +- ""Struct child {} await an additional {} rows from the current page"", ++ ""Struct child {} page {} will wait until {} rows loaded"", + self.field_index, +- rows_to_wait ++ page_idx, ++ need_for_page + ); + // Even though we wait for X rows we might actually end up + // loading more than that +- let previously_avail = next_decoder.avail(); ++ let previously_loaded = next_decoder.rows_loaded(); + // We might only await part of a page. This is important for things + // like the struct> case where we have one outer page, one + // middle page, and then a bunch of inner pages. If we await the entire + // middle page then we will have to wait for all the inner pages to arrive + // before we can start decoding. +- next_decoder.wait(rows_to_wait).await?; +- let newly_avail = next_decoder.avail() - previously_avail; +- self.rows_available += newly_avail; ++ next_decoder.wait_for_loaded(need_for_page).await?; ++ let newly_loaded = next_decoder.rows_loaded() - previously_loaded; ++ self.rows_loaded += newly_loaded; ++ loaded += newly_loaded; + trace!( +- ""Struct child {} await loaded {} rows and now {} are available"", ++ ""Struct child {} page {} await loaded {} rows and now {} are loaded"", + self.field_index, +- newly_avail, +- self.rows_available ++ page_idx, ++ newly_loaded, ++ self.rows_loaded + ); +- self.rows_unawaited = self.rows_unawaited.checked_sub(newly_avail).unwrap(); +- remaining -= rows_to_wait; +- if remaining == 0 || self.rows_unawaited < unawaited_limit { +- break; +- } ++ } ++ current_need = current_need.saturating_sub(next_decoder.rows_loaded()); ++ if current_need == 0 { ++ break; + } + } +- let awaited = num_rows - remaining; + trace!( +- ""Struct child {} awaited {} new rows and now {} are available and {} remain unawaited"", ++ ""Struct child {} loaded {} new rows and now {} are loaded"", + self.field_index, +- awaited, +- self.rows_available, +- self.rows_unawaited, ++ loaded, ++ self.rows_loaded + ); +- if awaited == 0 { ++ if loaded == 0 { + return Err(Error::Internal { + message: format!( + ""Ran out of page decoders before satisfying request for {} rows"", +- num_rows ++ loaded_need + ), + location: location!(), + }); +@@ -330,12 +330,10 @@ impl ChildState { + trace!(""Struct draining {} rows"", num_rows); + + trace!( +- ""Draining {} rows from struct page with {} rows available"", ++ ""Draining {} rows from struct page with {} rows already drained"", + num_rows, +- self.rows_available ++ self.rows_drained + ); +- assert!(self.rows_available >= num_rows); +- self.rows_available -= num_rows; + let mut remaining = num_rows; + let mut composite = CompositeDecodeTask { + tasks: Vec::new(), +@@ -344,9 +342,9 @@ impl ChildState { + }; + while remaining > 0 { + let next = self.scheduled.front_mut().unwrap(); +- let rows_to_take = remaining.min(next.avail()); ++ let rows_to_take = remaining.min(next.rows_left()); + let next_task = next.drain(rows_to_take)?; +- if next.avail() == 0 && next.unawaited() == 0 { ++ if next.rows_left() == 0 { + trace!(""Completely drained page""); + self.scheduled.pop_front(); + } +@@ -354,7 +352,8 @@ impl ChildState { + composite.tasks.push(next_task.task); + composite.num_rows += next_task.num_rows; + } +- composite.has_more = self.rows_available != 0 || self.rows_unawaited != 0; ++ self.rows_drained += num_rows; ++ composite.has_more = self.rows_drained != self.num_rows; + Ok(composite) + } + } +@@ -365,12 +364,13 @@ struct WaitOrder<'a>(&'a mut ChildState); + impl Eq for WaitOrder<'_> {} + impl PartialEq for WaitOrder<'_> { + fn eq(&self, other: &Self) -> bool { +- self.0.rows_unawaited == other.0.rows_unawaited ++ self.0.rows_loaded == other.0.rows_loaded + } + } + impl Ord for WaitOrder<'_> { + fn cmp(&self, other: &Self) -> std::cmp::Ordering { +- self.0.rows_unawaited.cmp(&other.0.rows_unawaited) ++ // Note: this is inverted so we have a min-heap ++ other.0.rows_loaded.cmp(&self.0.rows_loaded) + } + } + impl PartialOrd for WaitOrder<'_> { +@@ -384,6 +384,7 @@ pub struct SimpleStructDecoder { + children: Vec, + child_fields: Fields, + data_type: DataType, ++ num_rows: u64, + } + + impl SimpleStructDecoder { +@@ -397,15 +398,16 @@ impl SimpleStructDecoder { + .collect(), + child_fields, + data_type, ++ num_rows, + } + } + +- async fn do_wait(&mut self, num_rows: u64) -> Result<()> { ++ async fn do_waited_for_loaded(&mut self, loaded_need: u64) -> Result<()> { + let mut wait_orders = self + .children + .iter_mut() + .filter_map(|child| { +- if child.rows_available < num_rows { ++ if child.rows_loaded < loaded_need { + Some(WaitOrder(child)) + } else { + None +@@ -414,14 +416,20 @@ impl SimpleStructDecoder { + .collect::>(); + while !wait_orders.is_empty() { + let next_waiter = wait_orders.pop().unwrap(); +- let next_limit = wait_orders.peek().map(|w| w.0.rows_unawaited).unwrap_or(0); +- next_waiter.0.wait(num_rows, next_limit).await?; ++ let next_highest = wait_orders ++ .peek() ++ .map(|w| w.0.rows_loaded) ++ .unwrap_or(u64::MAX - 1); ++ // Wait until you have the number of rows needed, or at least more than the ++ // next highest waiter ++ let limit = loaded_need.min(next_highest + 1); ++ next_waiter.0.wait_for_loaded(limit).await?; + log::trace!( +- ""Struct child {} finished await pass and now {} are available"", ++ ""Struct child {} finished await pass and now {} are loaded"", + next_waiter.0.field_index, +- next_waiter.0.rows_available ++ next_waiter.0.rows_loaded + ); +- if next_waiter.0.rows_available < num_rows { ++ if next_waiter.0.rows_loaded < loaded_need { + wait_orders.push(next_waiter); + } + } +@@ -446,8 +454,8 @@ impl LogicalPageDecoder for SimpleStructDecoder { + Ok(()) + } + +- fn wait(&mut self, num_rows: u64) -> BoxFuture> { +- self.do_wait(num_rows).boxed() ++ fn wait_for_loaded(&mut self, loaded_need: u64) -> BoxFuture> { ++ self.do_waited_for_loaded(loaded_need).boxed() + } + + fn drain(&mut self, num_rows: u64) -> Result { +@@ -470,22 +478,21 @@ impl LogicalPageDecoder for SimpleStructDecoder { + }) + } + +- // Rows are available only if they are available in every child column +- fn avail(&self) -> u64 { +- self.children +- .iter() +- .map(|c| c.rows_available) +- .min() +- .unwrap() ++ fn rows_loaded(&self) -> u64 { ++ self.children.iter().map(|c| c.rows_loaded).min().unwrap() + } + +- // Rows are unawaited if they are unawaited in any child column +- fn unawaited(&self) -> u64 { +- self.children ++ fn rows_drained(&self) -> u64 { ++ // All children should have the same number of rows drained ++ debug_assert!(self ++ .children + .iter() +- .map(|c| c.rows_unawaited) +- .max() +- .unwrap() ++ .all(|c| c.rows_drained == self.children[0].rows_drained)); ++ self.children[0].rows_drained ++ } ++ ++ fn num_rows(&self) -> u64 { ++ self.num_rows + } + + fn data_type(&self) -> &DataType { +diff --git a/rust/lance-encoding/src/testing.rs b/rust/lance-encoding/src/testing.rs +index 24f95bf994..7e1cae836a 100644 +--- a/rust/lance-encoding/src/testing.rs ++++ b/rust/lance-encoding/src/testing.rs +@@ -39,27 +39,32 @@ impl SimulatedScheduler { + pub fn new(data: Bytes) -> Self { + Self { data } + } +- +- fn satisfy_request(&self, req: Range) -> Bytes { +- if req.is_empty() { +- // Some filesystems (e.g. S3 will return an error if an empty request is made and so we need to avoid those) +- panic!(""Empty request"") +- } +- self.data.slice(req.start as usize..req.end as usize) +- } + } + + impl EncodingsIo for SimulatedScheduler { + fn submit_request( + &self, + ranges: Vec>, +- _priority: u64, ++ priority: u64, + ) -> BoxFuture<'static, Result>> { +- std::future::ready(Ok(ranges ++ let data = ranges + .into_iter() +- .map(|range| self.satisfy_request(range)) +- .collect::>())) +- .boxed() ++ .map(|range| { ++ if range.is_empty() { ++ // Some filesystems (e.g. S3 will return an error if an empty request is made and so we need to avoid those) ++ panic!(""Empty request"") ++ } ++ self.data.slice(range.start as usize..range.end as usize) ++ }) ++ .collect(); ++ ++ log::trace!(""Scheduled request with priority {}"", priority); ++ std::future::ready(data) ++ .map(move |data| { ++ log::trace!(""Decoded request with priority {}"", priority); ++ Ok(data) ++ }) ++ .boxed() + } + }" +sentry,https://github.com/getsentry/sentry,b3ab1a55dd76adfa488c041a40bb9d16d5cb6de1,Kev,2022-11-17 01:46:40,fix(mep): Reintroduce histograms in the UI (#41461),"### Summary +This fixes the flagged code to re-introduce histograms on processed +events in the UI","fix(mep): Reintroduce histograms in the UI (#41461) + +### Summary +This fixes the flagged code to re-introduce histograms on processed +events in the UI","diff --git a/static/app/views/performance/landing/widgets/utils.tsx b/static/app/views/performance/landing/widgets/utils.tsx +index 33417dc06076f7..abec198da1d5b7 100644 +--- a/static/app/views/performance/landing/widgets/utils.tsx ++++ b/static/app/views/performance/landing/widgets/utils.tsx +@@ -136,9 +136,7 @@ export function filterAllowedChartsMetrics( + ) { + if ( + !canUseMetricsData(organization) || +- organization.features.includes( +- 'organizations:performance-mep-reintroduce-histograms' +- ) || ++ organization.features.includes('performance-mep-reintroduce-histograms') || + mepSetting.metricSettingState === MEPState.transactionsOnly + ) { + return allowedCharts;" +quivr,https://github.com/QuivrHQ/quivr,56a5c81fe41209301d6e8745e1966f0dab0cca13,Stan Girard,2023-11-27 14:38:00,fix: 🐛 sentry (#1716),"reduce sampling + +# Description + +Please include a summary of the changes and the related issue. Please +also include relevant motivation and context. + +## Checklist before requesting a review + +Please delete options that are not relevant. + +- [ ] My code follows the style guidelines of this project +- [ ] I have performed a self-review of my code +- [ ] I have commented hard-to-understand areas +- [ ] I have ideally added tests that prove my fix is effective or that +my feature works +- [ ] New and existing unit tests pass locally with my changes +- [ ] Any dependent changes have been merged + +## Screenshots (if appropriate):","fix: 🐛 sentry (#1716) + +reduce sampling + +# Description + +Please include a summary of the changes and the related issue. Please +also include relevant motivation and context. + +## Checklist before requesting a review + +Please delete options that are not relevant. + +- [ ] My code follows the style guidelines of this project +- [ ] I have performed a self-review of my code +- [ ] I have commented hard-to-understand areas +- [ ] I have ideally added tests that prove my fix is effective or that +my feature works +- [ ] New and existing unit tests pass locally with my changes +- [ ] Any dependent changes have been merged + +## Screenshots (if appropriate):","diff --git a/backend/chat_service.py b/backend/chat_service.py +index 673166a2e509..ba540bbc9956 100644 +--- a/backend/chat_service.py ++++ b/backend/chat_service.py +@@ -20,14 +20,6 @@ + + logger = get_logger(__name__) + +-sentry_dsn = os.getenv(""SENTRY_DSN"") +-if sentry_dsn: +- sentry_sdk.init( +- dsn=sentry_dsn, +- traces_sample_rate=0.1, +- profiles_sample_rate=0.1, +- ) +- + app = FastAPI() + + add_cors_middleware(app) +diff --git a/backend/crawl_service.py b/backend/crawl_service.py +index b9537f49afd5..6c7988df5345 100644 +--- a/backend/crawl_service.py ++++ b/backend/crawl_service.py +@@ -1,4 +1,3 @@ +-import os + + from packages.utils import handle_request_validation_error + +@@ -8,7 +7,6 @@ + from dotenv import load_dotenv # type: ignore + + load_dotenv() +-import sentry_sdk + from fastapi import FastAPI, HTTPException + from fastapi.responses import JSONResponse + from logger import get_logger +@@ -17,15 +15,6 @@ + from routes.misc_routes import misc_router + + logger = get_logger(__name__) +- +-sentry_dsn = os.getenv(""SENTRY_DSN"") +-if sentry_dsn: +- sentry_sdk.init( +- dsn=sentry_dsn, +- traces_sample_rate=0.1, +- profiles_sample_rate=0.1, +- ) +- + app = FastAPI() + + add_cors_middleware(app) +diff --git a/backend/main.py b/backend/main.py +index 55b60b17e76d..51fcd5bbc6a2 100644 +--- a/backend/main.py ++++ b/backend/main.py +@@ -27,6 +27,8 @@ + from routes.notification_routes import notification_router + from routes.subscription_routes import subscription_router + from routes.upload_routes import upload_router ++from sentry_sdk.integrations.starlette import StarletteIntegration ++from sentry_sdk.integrations.fastapi import FastApiIntegration + + logger = get_logger(__name__) + +@@ -41,8 +43,18 @@ + if sentry_dsn: + sentry_sdk.init( + dsn=sentry_dsn, +- traces_sample_rate=0.1, +- profiles_sample_rate=0.1, ++ traces_sample_rate=0.1, ++ profiles_sample_rate=0.1, ++ sample_rate=0.1, ++ enable_tracing=True, ++ integrations=[ ++ StarletteIntegration( ++ transaction_style=""endpoint"" ++ ), ++ FastApiIntegration( ++ transaction_style=""endpoint"" ++ ), ++ ] + ) + + app = FastAPI() +diff --git a/backend/requirements.txt b/backend/requirements.txt +index 148bb6093180..eb4730a74e63 100644 +--- a/backend/requirements.txt ++++ b/backend/requirements.txt +@@ -13,13 +13,13 @@ fastapi==0.95.2 + python-multipart==0.0.6 + uvicorn==0.22.0 + pypandoc==1.11 +- + docx2txt==0.8 + python-jose==3.3.0 + asyncpg==0.27.0 + flake8==6.0.0 + flake8-black==0.3.6 +-sentry-sdk==1.26.0 ++sentry-sdk==1.37.1 ++sentry-sdk[fastapi]==1.37.1 + pyright==1.1.316 + resend==0.5.1 + html5lib==1.1 +diff --git a/backend/upload_service.py b/backend/upload_service.py +index b2cbb526754b..d776c07ac4af 100644 +--- a/backend/upload_service.py ++++ b/backend/upload_service.py +@@ -18,15 +18,6 @@ + from routes.upload_routes import upload_router + + logger = get_logger(__name__) +- +-sentry_dsn = os.getenv(""SENTRY_DSN"") +-if sentry_dsn: +- sentry_sdk.init( +- dsn=sentry_dsn, +- traces_sample_rate=0.1, +- profiles_sample_rate=0.1, +- ) +- + app = FastAPI()" +aws-cdk,https://github.com/aws/aws-cdk,4b56d03a47c937b5e3a3f8f4d8ed0beea06c0124,Rico Hermans,2023-04-13 02:46:15,chore: rename aws-msk → aws-msk-alpha (#25069),"This PR is part of a refactor to make all directory names equal to the package name of the package inside it. + +It is a re-roll of #24930, but split into parts (one PR per package), so that we will cut down on merge conflicts. + +---- + +*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*","chore: rename aws-msk → aws-msk-alpha (#25069) + +This PR is part of a refactor to make all directory names equal to the package name of the package inside it. + +It is a re-roll of #24930, but split into parts (one PR per package), so that we will cut down on merge conflicts. + +---- + +*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*","diff --git a/packages/@aws-cdk/aws-msk/.eslintrc.js b/packages/@aws-cdk/aws-msk-alpha/.eslintrc.js +similarity index 100% +rename from packages/@aws-cdk/aws-msk/.eslintrc.js +rename to packages/@aws-cdk/aws-msk-alpha/.eslintrc.js +diff --git a/packages/@aws-cdk/aws-msk/.gitignore b/packages/@aws-cdk/aws-msk-alpha/.gitignore +similarity index 100% +rename from packages/@aws-cdk/aws-msk/.gitignore +rename to packages/@aws-cdk/aws-msk-alpha/.gitignore +diff --git a/packages/@aws-cdk/aws-msk/.npmignore b/packages/@aws-cdk/aws-msk-alpha/.npmignore +similarity index 100% +rename from packages/@aws-cdk/aws-msk/.npmignore +rename to packages/@aws-cdk/aws-msk-alpha/.npmignore +diff --git a/packages/@aws-cdk/aws-msk/LICENSE b/packages/@aws-cdk/aws-msk-alpha/LICENSE +similarity index 100% +rename from packages/@aws-cdk/aws-msk/LICENSE +rename to packages/@aws-cdk/aws-msk-alpha/LICENSE +diff --git a/packages/@aws-cdk/aws-msk/NOTICE b/packages/@aws-cdk/aws-msk-alpha/NOTICE +similarity index 100% +rename from packages/@aws-cdk/aws-msk/NOTICE +rename to packages/@aws-cdk/aws-msk-alpha/NOTICE +diff --git a/packages/@aws-cdk/aws-msk/README.md b/packages/@aws-cdk/aws-msk-alpha/README.md +similarity index 100% +rename from packages/@aws-cdk/aws-msk/README.md +rename to packages/@aws-cdk/aws-msk-alpha/README.md +diff --git a/packages/@aws-cdk/aws-msk/jest.config.js b/packages/@aws-cdk/aws-msk-alpha/jest.config.js +similarity index 100% +rename from packages/@aws-cdk/aws-msk/jest.config.js +rename to packages/@aws-cdk/aws-msk-alpha/jest.config.js +diff --git a/packages/@aws-cdk/aws-msk/lib/cluster-version.ts b/packages/@aws-cdk/aws-msk-alpha/lib/cluster-version.ts +similarity index 100% +rename from packages/@aws-cdk/aws-msk/lib/cluster-version.ts +rename to packages/@aws-cdk/aws-msk-alpha/lib/cluster-version.ts +diff --git a/packages/@aws-cdk/aws-msk/lib/cluster.ts b/packages/@aws-cdk/aws-msk-alpha/lib/cluster.ts +similarity index 100% +rename from packages/@aws-cdk/aws-msk/lib/cluster.ts +rename to packages/@aws-cdk/aws-msk-alpha/lib/cluster.ts +diff --git a/packages/@aws-cdk/aws-msk/lib/index.ts b/packages/@aws-cdk/aws-msk-alpha/lib/index.ts +similarity index 100% +rename from packages/@aws-cdk/aws-msk/lib/index.ts +rename to packages/@aws-cdk/aws-msk-alpha/lib/index.ts +diff --git a/packages/@aws-cdk/aws-msk/package.json b/packages/@aws-cdk/aws-msk-alpha/package.json +similarity index 98% +rename from packages/@aws-cdk/aws-msk/package.json +rename to packages/@aws-cdk/aws-msk-alpha/package.json +index 237e949f7820b..20235129e51c8 100644 +--- a/packages/@aws-cdk/aws-msk/package.json ++++ b/packages/@aws-cdk/aws-msk-alpha/package.json +@@ -45,7 +45,7 @@ + ""repository"": { + ""type"": ""git"", + ""url"": ""https://github.com/aws/aws-cdk.git"", +- ""directory"": ""packages/@aws-cdk/aws-msk"" ++ ""directory"": ""packages/@aws-cdk/aws-msk-alpha"" + }, + ""homepage"": ""https://github.com/aws/aws-cdk"", + ""scripts"": { +diff --git a/packages/@aws-cdk/aws-msk/rosetta/default.ts-fixture b/packages/@aws-cdk/aws-msk-alpha/rosetta/default.ts-fixture +similarity index 100% +rename from packages/@aws-cdk/aws-msk/rosetta/default.ts-fixture +rename to packages/@aws-cdk/aws-msk-alpha/rosetta/default.ts-fixture +diff --git a/packages/@aws-cdk/aws-msk/test/__snapshots__/cluster.test.js.snap b/packages/@aws-cdk/aws-msk-alpha/test/__snapshots__/cluster.test.js.snap +similarity index 100% +rename from packages/@aws-cdk/aws-msk/test/__snapshots__/cluster.test.js.snap +rename to packages/@aws-cdk/aws-msk-alpha/test/__snapshots__/cluster.test.js.snap +diff --git a/packages/@aws-cdk/aws-msk/test/cluster.test.ts b/packages/@aws-cdk/aws-msk-alpha/test/cluster.test.ts +similarity index 100% +rename from packages/@aws-cdk/aws-msk/test/cluster.test.ts +rename to packages/@aws-cdk/aws-msk-alpha/test/cluster.test.ts +diff --git a/packages/@aws-cdk/aws-msk/test/integ.cluster.js.snapshot/MskLoggingDefaultTestDeployAssertC2F074AF.assets.json b/packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.js.snapshot/MskLoggingDefaultTestDeployAssertC2F074AF.assets.json +similarity index 100% +rename from packages/@aws-cdk/aws-msk/test/integ.cluster.js.snapshot/MskLoggingDefaultTestDeployAssertC2F074AF.assets.json +rename to packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.js.snapshot/MskLoggingDefaultTestDeployAssertC2F074AF.assets.json +diff --git a/packages/@aws-cdk/aws-msk/test/integ.cluster.js.snapshot/MskLoggingDefaultTestDeployAssertC2F074AF.template.json b/packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.js.snapshot/MskLoggingDefaultTestDeployAssertC2F074AF.template.json +similarity index 100% +rename from packages/@aws-cdk/aws-msk/test/integ.cluster.js.snapshot/MskLoggingDefaultTestDeployAssertC2F074AF.template.json +rename to packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.js.snapshot/MskLoggingDefaultTestDeployAssertC2F074AF.template.json +diff --git a/packages/@aws-cdk/aws-msk/test/integ.cluster.js.snapshot/asset.33e2651435a0d472a75c1e033c9832b21321d9e56711926b04c5705e5f63874c/__entrypoint__.js b/packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.js.snapshot/asset.33e2651435a0d472a75c1e033c9832b21321d9e56711926b04c5705e5f63874c/__entrypoint__.js +similarity index 100% +rename from packages/@aws-cdk/aws-msk/test/integ.cluster.js.snapshot/asset.33e2651435a0d472a75c1e033c9832b21321d9e56711926b04c5705e5f63874c/__entrypoint__.js +rename to packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.js.snapshot/asset.33e2651435a0d472a75c1e033c9832b21321d9e56711926b04c5705e5f63874c/__entrypoint__.js +diff --git a/packages/@aws-cdk/aws-msk/test/integ.cluster.js.snapshot/asset.33e2651435a0d472a75c1e033c9832b21321d9e56711926b04c5705e5f63874c/index.js b/packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.js.snapshot/asset.33e2651435a0d472a75c1e033c9832b21321d9e56711926b04c5705e5f63874c/index.js +similarity index 100% +rename from packages/@aws-cdk/aws-msk/test/integ.cluster.js.snapshot/asset.33e2651435a0d472a75c1e033c9832b21321d9e56711926b04c5705e5f63874c/index.js +rename to packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.js.snapshot/asset.33e2651435a0d472a75c1e033c9832b21321d9e56711926b04c5705e5f63874c/index.js +diff --git a/packages/@aws-cdk/aws-msk/test/integ.cluster.js.snapshot/asset.73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.bundle/index.js b/packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.js.snapshot/asset.73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.bundle/index.js +similarity index 100% +rename from packages/@aws-cdk/aws-msk/test/integ.cluster.js.snapshot/asset.73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.bundle/index.js +rename to packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.js.snapshot/asset.73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.bundle/index.js +diff --git a/packages/@aws-cdk/aws-msk/test/integ.cluster.js.snapshot/aws-cdk-msk-integ.assets.json b/packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.js.snapshot/aws-cdk-msk-integ.assets.json +similarity index 100% +rename from packages/@aws-cdk/aws-msk/test/integ.cluster.js.snapshot/aws-cdk-msk-integ.assets.json +rename to packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.js.snapshot/aws-cdk-msk-integ.assets.json +diff --git a/packages/@aws-cdk/aws-msk/test/integ.cluster.js.snapshot/aws-cdk-msk-integ.template.json b/packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.js.snapshot/aws-cdk-msk-integ.template.json +similarity index 100% +rename from packages/@aws-cdk/aws-msk/test/integ.cluster.js.snapshot/aws-cdk-msk-integ.template.json +rename to packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.js.snapshot/aws-cdk-msk-integ.template.json +diff --git a/packages/@aws-cdk/aws-msk/test/integ.cluster.js.snapshot/cdk.out b/packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.js.snapshot/cdk.out +similarity index 100% +rename from packages/@aws-cdk/aws-msk/test/integ.cluster.js.snapshot/cdk.out +rename to packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.js.snapshot/cdk.out +diff --git a/packages/@aws-cdk/aws-msk/test/integ.cluster.js.snapshot/integ.json b/packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.js.snapshot/integ.json +similarity index 100% +rename from packages/@aws-cdk/aws-msk/test/integ.cluster.js.snapshot/integ.json +rename to packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.js.snapshot/integ.json +diff --git a/packages/@aws-cdk/aws-msk/test/integ.cluster.js.snapshot/manifest.json b/packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.js.snapshot/manifest.json +similarity index 100% +rename from packages/@aws-cdk/aws-msk/test/integ.cluster.js.snapshot/manifest.json +rename to packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.js.snapshot/manifest.json +diff --git a/packages/@aws-cdk/aws-msk/test/integ.cluster.js.snapshot/tree.json b/packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.js.snapshot/tree.json +similarity index 100% +rename from packages/@aws-cdk/aws-msk/test/integ.cluster.js.snapshot/tree.json +rename to packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.js.snapshot/tree.json +diff --git a/packages/@aws-cdk/aws-msk/test/integ.cluster.ts b/packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.ts +similarity index 100% +rename from packages/@aws-cdk/aws-msk/test/integ.cluster.ts +rename to packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.ts +diff --git a/packages/@aws-cdk/aws-msk/test/integ.cluster.ts.snapshot/MskLoggingDefaultTestDeployAssertC2F074AF.assets.json b/packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.ts.snapshot/MskLoggingDefaultTestDeployAssertC2F074AF.assets.json +similarity index 100% +rename from packages/@aws-cdk/aws-msk/test/integ.cluster.ts.snapshot/MskLoggingDefaultTestDeployAssertC2F074AF.assets.json +rename to packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.ts.snapshot/MskLoggingDefaultTestDeployAssertC2F074AF.assets.json +diff --git a/packages/@aws-cdk/aws-msk/test/integ.cluster.ts.snapshot/MskLoggingDefaultTestDeployAssertC2F074AF.template.json b/packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.ts.snapshot/MskLoggingDefaultTestDeployAssertC2F074AF.template.json +similarity index 100% +rename from packages/@aws-cdk/aws-msk/test/integ.cluster.ts.snapshot/MskLoggingDefaultTestDeployAssertC2F074AF.template.json +rename to packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.ts.snapshot/MskLoggingDefaultTestDeployAssertC2F074AF.template.json +diff --git a/packages/@aws-cdk/aws-msk/test/integ.cluster.ts.snapshot/asset.1f3c2cfb18e102edc713fe4c4b4d87572f4297ee4a5e80a5960adf526ee9ea28.bundle/index.js b/packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.ts.snapshot/asset.1f3c2cfb18e102edc713fe4c4b4d87572f4297ee4a5e80a5960adf526ee9ea28.bundle/index.js +similarity index 100% +rename from packages/@aws-cdk/aws-msk/test/integ.cluster.ts.snapshot/asset.1f3c2cfb18e102edc713fe4c4b4d87572f4297ee4a5e80a5960adf526ee9ea28.bundle/index.js +rename to packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.ts.snapshot/asset.1f3c2cfb18e102edc713fe4c4b4d87572f4297ee4a5e80a5960adf526ee9ea28.bundle/index.js +diff --git a/packages/@aws-cdk/aws-msk/test/integ.cluster.ts.snapshot/asset.33e2651435a0d472a75c1e033c9832b21321d9e56711926b04c5705e5f63874c/__entrypoint__.js b/packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.ts.snapshot/asset.33e2651435a0d472a75c1e033c9832b21321d9e56711926b04c5705e5f63874c/__entrypoint__.js +similarity index 100% +rename from packages/@aws-cdk/aws-msk/test/integ.cluster.ts.snapshot/asset.33e2651435a0d472a75c1e033c9832b21321d9e56711926b04c5705e5f63874c/__entrypoint__.js +rename to packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.ts.snapshot/asset.33e2651435a0d472a75c1e033c9832b21321d9e56711926b04c5705e5f63874c/__entrypoint__.js +diff --git a/packages/@aws-cdk/aws-msk/test/integ.cluster.ts.snapshot/asset.33e2651435a0d472a75c1e033c9832b21321d9e56711926b04c5705e5f63874c/index.js b/packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.ts.snapshot/asset.33e2651435a0d472a75c1e033c9832b21321d9e56711926b04c5705e5f63874c/index.js +similarity index 100% +rename from packages/@aws-cdk/aws-msk/test/integ.cluster.ts.snapshot/asset.33e2651435a0d472a75c1e033c9832b21321d9e56711926b04c5705e5f63874c/index.js +rename to packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.ts.snapshot/asset.33e2651435a0d472a75c1e033c9832b21321d9e56711926b04c5705e5f63874c/index.js +diff --git a/packages/@aws-cdk/aws-msk/test/integ.cluster.ts.snapshot/asset.a268caa53756f51bda8ad5f499be4ed8484a81b314811806fbb66f874837c476/index.js b/packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.ts.snapshot/asset.a268caa53756f51bda8ad5f499be4ed8484a81b314811806fbb66f874837c476/index.js +similarity index 100% +rename from packages/@aws-cdk/aws-msk/test/integ.cluster.ts.snapshot/asset.a268caa53756f51bda8ad5f499be4ed8484a81b314811806fbb66f874837c476/index.js +rename to packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.ts.snapshot/asset.a268caa53756f51bda8ad5f499be4ed8484a81b314811806fbb66f874837c476/index.js +diff --git a/packages/@aws-cdk/aws-msk/test/integ.cluster.ts.snapshot/aws-cdk-msk-integ.assets.json b/packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.ts.snapshot/aws-cdk-msk-integ.assets.json +similarity index 100% +rename from packages/@aws-cdk/aws-msk/test/integ.cluster.ts.snapshot/aws-cdk-msk-integ.assets.json +rename to packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.ts.snapshot/aws-cdk-msk-integ.assets.json +diff --git a/packages/@aws-cdk/aws-msk/test/integ.cluster.ts.snapshot/aws-cdk-msk-integ.template.json b/packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.ts.snapshot/aws-cdk-msk-integ.template.json +similarity index 100% +rename from packages/@aws-cdk/aws-msk/test/integ.cluster.ts.snapshot/aws-cdk-msk-integ.template.json +rename to packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.ts.snapshot/aws-cdk-msk-integ.template.json +diff --git a/packages/@aws-cdk/aws-msk/test/integ.cluster.ts.snapshot/cdk.out b/packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.ts.snapshot/cdk.out +similarity index 100% +rename from packages/@aws-cdk/aws-msk/test/integ.cluster.ts.snapshot/cdk.out +rename to packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.ts.snapshot/cdk.out +diff --git a/packages/@aws-cdk/aws-msk/test/integ.cluster.ts.snapshot/integ.json b/packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.ts.snapshot/integ.json +similarity index 100% +rename from packages/@aws-cdk/aws-msk/test/integ.cluster.ts.snapshot/integ.json +rename to packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.ts.snapshot/integ.json +diff --git a/packages/@aws-cdk/aws-msk/test/integ.cluster.ts.snapshot/manifest.json b/packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.ts.snapshot/manifest.json +similarity index 100% +rename from packages/@aws-cdk/aws-msk/test/integ.cluster.ts.snapshot/manifest.json +rename to packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.ts.snapshot/manifest.json +diff --git a/packages/@aws-cdk/aws-msk/test/integ.cluster.ts.snapshot/tree.json b/packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.ts.snapshot/tree.json +similarity index 100% +rename from packages/@aws-cdk/aws-msk/test/integ.cluster.ts.snapshot/tree.json +rename to packages/@aws-cdk/aws-msk-alpha/test/integ.cluster.ts.snapshot/tree.json" +materialize,https://github.com/MaterializeInc/materialize,3357416f64d1ede804fca2b238791f26eda360a0,dependabot[bot],2025-03-17 15:02:32,build(deps): bump ryu from 1.0.17 to 1.0.20 (#31904),"Bumps [ryu](https://github.com/dtolnay/ryu) from 1.0.17 to 1.0.20. +
    +Release notes +

    Sourced from ryu's +releases.

    +
    +

    1.0.20

    +
      +
    • Documentation improvements
    • +
    +

    1.0.19

    +
      +
    • Update rand dev dependency to 0.9 (#58)
    • +
    +

    1.0.18

    +
      +
    • Resolve unexpected_cfgs warning (#55)
    • +
    +
    +
    +
    +Commits +
      +
    • 02237f8 +Release 1.0.20
    • +
    • d6d5367 +Point standard library links to stable
    • +
    • ce04e72 +Convert html links to intra-doc links
    • +
    • f030f26 +Unset doc-scrape-examples for lib target
    • +
    • 81d9ec4 +Release 1.0.19
    • +
    • 7bb6da1 +Merge pull request #58 from +dtolnay/rand
    • +
    • 7e4b85e +Update rand crate to 0.9
    • +
    • d12f8d0 +More precise gitignore patterns
    • +
    • 631e145 +Remove **/*.rs.bk from project-specific gitignore
    • +
    • d3f7415 +Prevent upload-artifact step from causing CI failure
    • +
    • Additional commits viewable in compare +view
    • +
    +
    +
    + + +[![Dependabot compatibility +score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ryu&package-manager=cargo&previous-version=1.0.17&new-version=1.0.20)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) + +Dependabot will resolve any conflicts with this PR as long as you don't +alter it yourself. You can also trigger a rebase manually by commenting +`@dependabot rebase`. + +[//]: # (dependabot-automerge-start) +[//]: # (dependabot-automerge-end) + +--- + +
    +Dependabot commands and options +
    + +You can trigger Dependabot actions by commenting on this PR: +- `@dependabot rebase` will rebase this PR +- `@dependabot recreate` will recreate this PR, overwriting any edits +that have been made to it +- `@dependabot merge` will merge this PR after your CI passes on it +- `@dependabot squash and merge` will squash and merge this PR after +your CI passes on it +- `@dependabot cancel merge` will cancel a previously requested merge +and block automerging +- `@dependabot reopen` will reopen this PR if it is closed +- `@dependabot close` will close this PR and stop Dependabot recreating +it. You can achieve the same result by closing it manually +- `@dependabot show ignore conditions` will show all +of the ignore conditions of the specified dependency +- `@dependabot ignore this major version` will close this PR and stop +Dependabot creating any more for this major version (unless you reopen +the PR or upgrade to it yourself) +- `@dependabot ignore this minor version` will close this PR and stop +Dependabot creating any more for this minor version (unless you reopen +the PR or upgrade to it yourself) +- `@dependabot ignore this dependency` will close this PR and stop +Dependabot creating any more for this dependency (unless you reopen the +PR or upgrade to it yourself) + + +
    ","build(deps): bump ryu from 1.0.17 to 1.0.20 (#31904) + +Bumps [ryu](https://github.com/dtolnay/ryu) from 1.0.17 to 1.0.20. +
    +Release notes +

    Sourced from ryu's +releases.

    +
    +

    1.0.20

    +
      +
    • Documentation improvements
    • +
    +

    1.0.19

    +
      +
    • Update rand dev dependency to 0.9 (#58)
    • +
    +

    1.0.18

    +
      +
    • Resolve unexpected_cfgs warning (#55)
    • +
    +
    +
    +
    +Commits +
      +
    • 02237f8 +Release 1.0.20
    • +
    • d6d5367 +Point standard library links to stable
    • +
    • ce04e72 +Convert html links to intra-doc links
    • +
    • f030f26 +Unset doc-scrape-examples for lib target
    • +
    • 81d9ec4 +Release 1.0.19
    • +
    • 7bb6da1 +Merge pull request #58 from +dtolnay/rand
    • +
    • 7e4b85e +Update rand crate to 0.9
    • +
    • d12f8d0 +More precise gitignore patterns
    • +
    • 631e145 +Remove **/*.rs.bk from project-specific gitignore
    • +
    • d3f7415 +Prevent upload-artifact step from causing CI failure
    • +
    • Additional commits viewable in compare +view
    • +
    +
    +
    + + +[![Dependabot compatibility +score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ryu&package-manager=cargo&previous-version=1.0.17&new-version=1.0.20)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) + +Dependabot will resolve any conflicts with this PR as long as you don't +alter it yourself. You can also trigger a rebase manually by commenting +`@dependabot rebase`. + +[//]: # (dependabot-automerge-start) +[//]: # (dependabot-automerge-end) + +--- + +
    +Dependabot commands and options +
    + +You can trigger Dependabot actions by commenting on this PR: +- `@dependabot rebase` will rebase this PR +- `@dependabot recreate` will recreate this PR, overwriting any edits +that have been made to it +- `@dependabot merge` will merge this PR after your CI passes on it +- `@dependabot squash and merge` will squash and merge this PR after +your CI passes on it +- `@dependabot cancel merge` will cancel a previously requested merge +and block automerging +- `@dependabot reopen` will reopen this PR if it is closed +- `@dependabot close` will close this PR and stop Dependabot recreating +it. You can achieve the same result by closing it manually +- `@dependabot show ignore conditions` will show all +of the ignore conditions of the specified dependency +- `@dependabot ignore this major version` will close this PR and stop +Dependabot creating any more for this major version (unless you reopen +the PR or upgrade to it yourself) +- `@dependabot ignore this minor version` will close this PR and stop +Dependabot creating any more for this minor version (unless you reopen +the PR or upgrade to it yourself) +- `@dependabot ignore this dependency` will close this PR and stop +Dependabot creating any more for this dependency (unless you reopen the +PR or upgrade to it yourself) + + +
    + +Signed-off-by: dependabot[bot] +Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>","diff --git a/Cargo.lock b/Cargo.lock +index c816f437d375b..422ca55147eea 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -9566,9 +9566,9 @@ checksum = ""97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8"" + + [[package]] + name = ""ryu"" +-version = ""1.0.17"" ++version = ""1.0.20"" + source = ""registry+https://github.com/rust-lang/crates.io-index"" +-checksum = ""e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1"" ++checksum = ""28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"" + + [[package]] + name = ""same-file"" +diff --git a/src/repr/Cargo.toml b/src/repr/Cargo.toml +index 684d6ed70e025..8b867df8629b6 100644 +--- a/src/repr/Cargo.toml ++++ b/src/repr/Cargo.toml +@@ -60,7 +60,7 @@ ordered-float = { version = ""4.6.0"", features = [""serde""] } + postgres-protocol = { version = ""0.6.5"" } + prost = { version = ""0.13.5"", features = [""no-recursion-limit""] } + regex = ""1.10.6"" +-ryu = ""1.0.12"" ++ryu = ""1.0.20"" + serde = { version = ""1.0.218"", features = [""derive""] } + serde_json = { version = ""1.0.125"", features = [""arbitrary_precision"", ""preserve_order""] } + smallvec = { version = ""1.14.0"", features = [""serde"", ""union""] }" +RSSHub,https://github.com/DIYgod/RSSHub,925fe9de6d489422a799c63ba328ad079adbfc1a,syrinka,2022-08-26 21:18:05,fix(route): 路由在 Thumbnail 布局下无效 (#10622),"* support thumbnail layout + +* add author + +* add maintainer + +* docs + +* fix","fix(route): 路由在 Thumbnail 布局下无效 (#10622) + +* support thumbnail layout + +* add author + +* add maintainer + +* docs + +* fix","diff --git a/lib/v2/ehentai/ehapi.js b/lib/v2/ehentai/ehapi.js +index b1b974e682deb6..29f5e0a32e103d 100644 +--- a/lib/v2/ehentai/ehapi.js ++++ b/lib/v2/ehentai/ehapi.js +@@ -45,22 +45,41 @@ function ehgot_thumb(cache, thumb_url) { + + async function parsePage(cache, data, get_bittorrent = false, embed_thumb = false) { + const $ = cheerio.load(data); +- const table = $('table[class^=""itg glt""] tbody'); +- if (!table) { +- return []; ++ // ""m"" for Minimal ++ // ""p"" for Minimal+ ++ // ""l"" for Compact ++ // ""e"" for Extended ++ // ""t"" for Thumbnail ++ const layout = $('div#dms option[selected]').attr('value'); ++ ++ let galleries; ++ if (layout !== 't') { ++ galleries = $('table[class^=""itg glt""] tbody'); ++ } else { ++ // Thumbnail layout has different page structure ++ // resolve it here ++ galleries = $('div[class^=""itg gld""]'); + } + +- async function parseTableRow(cache, element) { ++ async function parseElement(cache, element) { + const el = $(element); + const title = el.find('div.glink').html(); + const pubDate = el.find('div[id^=""posted_""]').html(); +- // match ""Minimal"", ""Minimal+"" and ""Compact"" +- let el_a = el.find('td[class^=""gl3""] a'); +- let el_img = el.find('td[class^=gl2] div.glthumb div img'); +- // if not, match ""Extended"" +- if (!(el_a.length && el_img.length)) { ++ let el_a; ++ let el_img; ++ // match layout ++ if ('mpl'.includes(layout)) { ++ // Minimal, Minimal+, Compact ++ el_a = el.find('td[class^=""gl3""] a'); ++ el_img = el.find('td[class^=gl2] div.glthumb div img'); ++ } else if (layout === 'e') { ++ // Extended + el_a = el.find('td[class^=""gl1""] a'); + el_img = el_a.find('img'); ++ } else if (layout === 't') { ++ // Thumbnail ++ el_a = el.find('div[class^=""gl3t""] a'); ++ el_img = el_a.find('img'); + } + const link = el_a.attr('href'); + let thumbnail = el_img.attr('data-src') ? el_img.attr('data-src') : el_img.attr('src'); +@@ -86,13 +105,23 @@ async function parsePage(cache, data, get_bittorrent = false, embed_thumb = fals + } + } + } ++ if ('le'.includes(layout)) { ++ // artist tags will only show in Compact or Extended layout ++ // get artist names as author ++ const artist = $(el) ++ .find('div.gt[title^=""artist:""]') ++ .toArray() ++ .map((i, tag) => $(tag).text()) ++ .join(' / '); ++ item.author = artist; ++ } + return item; + } + } + + const item_Promises = []; +- table.children('tr').each((index, element) => { +- item_Promises.push(parseTableRow(cache, element)); ++ galleries.children().each((index, element) => { ++ item_Promises.push(parseElement(cache, element)); + }); + const items_with_null = await Promise.all(item_Promises); + +diff --git a/lib/v2/ehentai/maintainer.js b/lib/v2/ehentai/maintainer.js +index 92834b355a0660..4719d7f9ff5209 100644 +--- a/lib/v2/ehentai/maintainer.js ++++ b/lib/v2/ehentai/maintainer.js +@@ -1,5 +1,5 @@ + module.exports = { +- '/favorites/:favcat?/:order?/:page?/:routeParams?': ['yindaheng98'], +- '/search/:params?/:page?/:routeParams?': ['yindaheng98'], +- '/tag/:tag/:page?/:routeParams?': ['yindaheng98'], ++ '/favorites/:favcat?/:order?/:page?/:routeParams?': ['yindaheng98', 'syrinka'], ++ '/search/:params?/:page?/:routeParams?': ['yindaheng98', 'syrinka'], ++ '/tag/:tag/:page?/:routeParams?': ['yindaheng98', 'syrinka'], + };" +starship,https://github.com/starship/starship,75730e9bcb6d5aed12fa0cf41f9e606b32cd09eb,dependabot-preview[bot],2021-01-12 07:36:40,build(deps-dev): bump @vuepress/plugin-google-analytics in /docs (#2120),"Bumps [@vuepress/plugin-google-analytics](https://github.com/vuejs/vuepress/tree/HEAD/packages/@vuepress/plugin-google-analytics) from 1.7.1 to 1.8.0. +- [Release notes](https://github.com/vuejs/vuepress/releases) +- [Changelog](https://github.com/vuejs/vuepress/blob/master/CHANGELOG.md) +- [Commits](https://github.com/vuejs/vuepress/commits/v1.8.0/packages/@vuepress/plugin-google-analytics)","build(deps-dev): bump @vuepress/plugin-google-analytics in /docs (#2120) + +Bumps [@vuepress/plugin-google-analytics](https://github.com/vuejs/vuepress/tree/HEAD/packages/@vuepress/plugin-google-analytics) from 1.7.1 to 1.8.0. +- [Release notes](https://github.com/vuejs/vuepress/releases) +- [Changelog](https://github.com/vuejs/vuepress/blob/master/CHANGELOG.md) +- [Commits](https://github.com/vuejs/vuepress/commits/v1.8.0/packages/@vuepress/plugin-google-analytics) + +Signed-off-by: dependabot-preview[bot] + +Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>","diff --git a/docs/package-lock.json b/docs/package-lock.json +index 69372d66d55d..cb650d67bf00 100644 +--- a/docs/package-lock.json ++++ b/docs/package-lock.json +@@ -1405,9 +1405,9 @@ + } + }, + ""@vuepress/plugin-google-analytics"": { +- ""version"": ""1.7.1"", +- ""resolved"": ""https://registry.npmjs.org/@vuepress/plugin-google-analytics/-/plugin-google-analytics-1.7.1.tgz"", +- ""integrity"": ""sha512-27fQzRMsqGYpMf+ruyhsdfLv/n6z6b6LutFLE/pH66Itlh6ox9ew31x0pqYBbWIC/a4lBfXYUwFvi+DEvlb1EQ=="", ++ ""version"": ""1.8.0"", ++ ""resolved"": ""https://registry.npmjs.org/@vuepress/plugin-google-analytics/-/plugin-google-analytics-1.8.0.tgz"", ++ ""integrity"": ""sha512-1aILIrGjyGOtNROZhNRezrnAsTq3RA4Q9/euTkpdNDyRs4etmW6hWm5yx43Sp+upREMycpbXZ/QoOWmahGwMNA=="", + ""dev"": true + }, + ""@vuepress/plugin-last-updated"": { +diff --git a/docs/package.json b/docs/package.json +index 5e4b46680178..895f89db454e 100644 +--- a/docs/package.json ++++ b/docs/package.json +@@ -4,7 +4,7 @@ + ""build"": ""vuepress build"" + }, + ""devDependencies"": { +- ""@vuepress/plugin-google-analytics"": ""^1.7.1"", ++ ""@vuepress/plugin-google-analytics"": ""^1.8.0"", + ""vuepress"": ""^1.8.0"", + ""vuepress-theme-default-prefers-color-scheme"": ""^1.1.2"", + ""vuepress-plugin-sitemap"": ""^2.3.1""" +typescript-eslint,https://github.com/typescript-eslint/typescript-eslint,42289143a7144327728f8177abf57cd843964a11,RahulGautamSingh,2022-10-10 07:29:56,chore: update renovate config (#5773),"* fix: renovate.json + +* Update .github/renovate.json","chore: update renovate config (#5773) + +* fix: renovate.json + +* Update .github/renovate.json + +Co-authored-by: Josh Goldberg ","diff --git a/.github/renovate.json b/.github/renovate.json +index 180dd0004d6e..afa6e92523af 100644 +--- a/.github/renovate.json ++++ b/.github/renovate.json +@@ -2,19 +2,18 @@ + ""automerge"": true, + ""enabledManagers"": [""github-actions"", ""npm""], + ""ignoreDeps"": [""cypress""], +- ""internalChecksFilters"": ""strict"", ++ ""internalChecksFilter"": ""strict"", + ""labels"": [""dependencies""], + ""packageRules"": [ + { +- ""addLabels"": [""github-actions""], +- ""manager"": ""github-actions"" ++ ""matchManagers"": [""npm""], ++ ""addLabels"": [""javascript""] + }, + { +- ""addLabels"": [""javascript""], +- ""manager"": ""npm"" ++ ""matchManagers"": [""github-actions""], ++ ""addLabels"": [""github-actions""] + } + ], +- ""matchUpdateTypes"": [""minor"", ""patch"", ""pin"", ""digest""], +- ""stabilityDays"": 3, +- ""postUpdateOptions"": [""yarnDedupeHighest""] ++ ""postUpdateOptions"": [""yarnDedupeHighest""], ++ ""stabilityDays"": 3 + }" +react-bootstrap,https://github.com/react-bootstrap/react-bootstrap,4bebc7a32022795ad6e0a4fb840a8daf4524aeb6,dependabot[bot],2023-04-17 04:25:31,chore(deps): bump ua-parser-js from 0.7.32 to 0.7.35 in /www (#6585),"Bumps [ua-parser-js](https://github.com/faisalman/ua-parser-js) from 0.7.32 to 0.7.35. +- [Release notes](https://github.com/faisalman/ua-parser-js/releases) +- [Changelog](https://github.com/faisalman/ua-parser-js/blob/master/changelog.md) +- [Commits](https://github.com/faisalman/ua-parser-js/compare/0.7.32...0.7.35) + +---","chore(deps): bump ua-parser-js from 0.7.32 to 0.7.35 in /www (#6585) + +Bumps [ua-parser-js](https://github.com/faisalman/ua-parser-js) from 0.7.32 to 0.7.35. +- [Release notes](https://github.com/faisalman/ua-parser-js/releases) +- [Changelog](https://github.com/faisalman/ua-parser-js/blob/master/changelog.md) +- [Commits](https://github.com/faisalman/ua-parser-js/compare/0.7.32...0.7.35) + +--- +updated-dependencies: +- dependency-name: ua-parser-js + dependency-type: indirect +... + +Signed-off-by: dependabot[bot] +Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>","diff --git a/www/yarn.lock b/www/yarn.lock +index 6130803062..11506b5f61 100644 +--- a/www/yarn.lock ++++ b/www/yarn.lock +@@ -7514,9 +7514,9 @@ typescript@^5.0.4: + integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw== + + ua-parser-js@^0.7.30: +- version ""0.7.32"" +- resolved ""https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.32.tgz"" +- integrity sha512-f9BESNVhzlhEFf2CHMSj40NWOjYPl1YKYbrvIr/hFTDEmLq7SRbWvm7FcdcpCYT95zrOhC7gZSxjdnnTpBcwVw== ++ version ""0.7.35"" ++ resolved ""https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.35.tgz#8bda4827be4f0b1dda91699a29499575a1f1d307"" ++ integrity sha512-veRf7dawaj9xaWEu9HoTVn5Pggtc/qj+kqTOFvNiN1l0YdxwC1kvel57UCjThjGa3BHBihE8/UJAHI+uQHmd/g== + + unescape@^1.0.1: + version ""1.0.1""" +redwood,https://github.com/redwoodjs/redwood,bd6b29df928171c5d521262705371bdd2d48e228,Dominic Saadi,2023-05-04 02:45:43,fix(v5 react codemod): handle custom web index (#8211),"* fix(v5 react codemod): handle custom web index + +* style: move exports to the bottom of the file","fix(v5 react codemod): handle custom web index (#8211) + +* fix(v5 react codemod): handle custom web index + +* style: move exports to the bottom of the file","diff --git a/packages/codemods/src/codemods/v5.x.x/upgradeToReact18/upgradeToReact18.ts b/packages/codemods/src/codemods/v5.x.x/upgradeToReact18/upgradeToReact18.ts +index 08cf9ef26c5a..da73c25fdf36 100644 +--- a/packages/codemods/src/codemods/v5.x.x/upgradeToReact18/upgradeToReact18.ts ++++ b/packages/codemods/src/codemods/v5.x.x/upgradeToReact18/upgradeToReact18.ts +@@ -80,4 +80,55 @@ async function upgradeReactDepsTo18() { + }) + } + +-export { checkAndTransformReactRoot, upgradeReactDepsTo18 } ++async function checkAndUpdateCustomWebIndex(taskContext: TaskInnerAPI) { ++ // First check if the custom web index exists. If it doesn't, this is a no-op. ++ const redwoodProjectPaths = getRWPaths() ++ ++ const bundlerToCustomWebIndex = { ++ vite: path.join(redwoodProjectPaths.web.src, 'entry-client.jsx'), ++ webpack: path.join(redwoodProjectPaths.web.src, 'index.js'), ++ } ++ ++ const customWebIndexFound = Object.entries(bundlerToCustomWebIndex).find( ++ ([, filepath]) => fs.existsSync(filepath) ++ ) ++ ++ if (!customWebIndexFound) { ++ return ++ } ++ ++ fs.writeFileSync(customWebIndexFound[1], customWebIndexTemplate) ++ ++ taskContext.setWarning( ++ [ ++ `We updated the custom web index for you at ${customWebIndexFound[1]}.`, ++ "" If you made manual changes to this file, you'll have to copy them over manually from the diff."", ++ ].join('\n') ++ ) ++} ++ ++const customWebIndexTemplate = `\ ++import { hydrateRoot, createRoot } from 'react-dom/client' ++ ++import App from './App' ++/** ++ * When \`#redwood-app\` isn't empty then it's very likely that you're using ++ * prerendering. So React attaches event listeners to the existing markup ++ * rather than replacing it. ++ * https://reactjs.org/docs/react-dom-client.html#hydrateroot ++ */ ++const redwoodAppElement = document.getElementById('redwood-app') ++ ++if (redwoodAppElement.children?.length > 0) { ++ hydrateRoot(redwoodAppElement, ) ++} else { ++ const root = createRoot(redwoodAppElement) ++ root.render() ++} ++` ++ ++export { ++ checkAndTransformReactRoot, ++ upgradeReactDepsTo18, ++ checkAndUpdateCustomWebIndex, ++} +diff --git a/packages/codemods/src/codemods/v5.x.x/upgradeToReact18/upgradeToReact18.yargs.ts b/packages/codemods/src/codemods/v5.x.x/upgradeToReact18/upgradeToReact18.yargs.ts +index b3ea3197280f..92c514a96c4b 100644 +--- a/packages/codemods/src/codemods/v5.x.x/upgradeToReact18/upgradeToReact18.yargs.ts ++++ b/packages/codemods/src/codemods/v5.x.x/upgradeToReact18/upgradeToReact18.yargs.ts +@@ -3,6 +3,7 @@ import task from 'tasuku' + import { + checkAndTransformReactRoot, + upgradeReactDepsTo18, ++ checkAndUpdateCustomWebIndex, + } from './upgradeToReact18' + + export const command = 'upgrade-to-react-18' +@@ -15,6 +16,10 @@ export const handler = () => { + checkAndTransformReactRoot(taskContext) + }) + ++ task('Check and update custom web index', async (taskContext) => { ++ await checkAndUpdateCustomWebIndex(taskContext) ++ }) ++ + task('Update react deps', async () => { + await upgradeReactDepsTo18() + })" +nest,https://github.com/nestjs/nest,0af750a57021c8a0ed3c360c9331ce7c306bea26,dependabot[bot],2023-06-12 07:28:05,chore(deps-dev): bump concurrently from 8.1.0 to 8.2.0,"Bumps [concurrently](https://github.com/open-cli-tools/concurrently) from 8.1.0 to 8.2.0. +- [Release notes](https://github.com/open-cli-tools/concurrently/releases) +- [Commits](https://github.com/open-cli-tools/concurrently/compare/v8.1.0...v8.2.0) + +---","chore(deps-dev): bump concurrently from 8.1.0 to 8.2.0 + +Bumps [concurrently](https://github.com/open-cli-tools/concurrently) from 8.1.0 to 8.2.0. +- [Release notes](https://github.com/open-cli-tools/concurrently/releases) +- [Commits](https://github.com/open-cli-tools/concurrently/compare/v8.1.0...v8.2.0) + +--- +updated-dependencies: +- dependency-name: concurrently + dependency-type: direct:development + update-type: version-update:semver-minor +... + +Signed-off-by: dependabot[bot] ","diff --git a/package-lock.json b/package-lock.json +index 3d7d050c3b1..146b11cba4f 100644 +--- a/package-lock.json ++++ b/package-lock.json +@@ -539,6 +539,15 @@ + ""integrity"": ""sha512-PApSXlNMJyB4JiGVhCOlzKIif+TKFTvu0aQAhnTvfP/z3vVSN6ZypH5bfUNwFXXjRQtUEBNFd2PtmCmG2Py3qQ=="", + ""dev"": true + }, ++ ""@babel/runtime"": { ++ ""version"": ""7.22.5"", ++ ""resolved"": ""https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.5.tgz"", ++ ""integrity"": ""sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA=="", ++ ""dev"": true, ++ ""requires"": { ++ ""regenerator-runtime"": ""^0.13.11"" ++ } ++ }, + ""@babel/template"": { + ""version"": ""7.10.1"", + ""resolved"": ""https://registry.npmjs.org/@babel/template/-/template-7.10.1.tgz"", +@@ -6499,20 +6508,20 @@ + } + }, + ""concurrently"": { +- ""version"": ""8.1.0"", +- ""resolved"": ""https://registry.npmjs.org/concurrently/-/concurrently-8.1.0.tgz"", +- ""integrity"": ""sha512-0AB6eOAtaW/r/kX2lCdolaWtT191ICeuJjEJvI9hT3zbPFuZ/iZaJwMRKwbuwADome7OKxk73L7od+fsveZ7tA=="", ++ ""version"": ""8.2.0"", ++ ""resolved"": ""https://registry.npmjs.org/concurrently/-/concurrently-8.2.0.tgz"", ++ ""integrity"": ""sha512-nnLMxO2LU492mTUj9qX/az/lESonSZu81UznYDoXtz1IQf996ixVqPAgHXwvHiHCAef/7S8HIK+fTFK7Ifk8YA=="", + ""dev"": true, + ""requires"": { + ""chalk"": ""^4.1.2"", +- ""date-fns"": ""^2.29.3"", ++ ""date-fns"": ""^2.30.0"", + ""lodash"": ""^4.17.21"", +- ""rxjs"": ""^7.8.0"", +- ""shell-quote"": ""^1.8.0"", +- ""spawn-command"": ""0.0.2-1"", ++ ""rxjs"": ""^7.8.1"", ++ ""shell-quote"": ""^1.8.1"", ++ ""spawn-command"": ""0.0.2"", + ""supports-color"": ""^8.1.1"", + ""tree-kill"": ""^1.2.2"", +- ""yargs"": ""^17.7.1"" ++ ""yargs"": ""^17.7.2"" + }, + ""dependencies"": { + ""ansi-regex"": { +@@ -6577,6 +6586,15 @@ + ""integrity"": ""sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="", + ""dev"": true + }, ++ ""date-fns"": { ++ ""version"": ""2.30.0"", ++ ""resolved"": ""https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz"", ++ ""integrity"": ""sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw=="", ++ ""dev"": true, ++ ""requires"": { ++ ""@babel/runtime"": ""^7.21.0"" ++ } ++ }, + ""get-caller-file"": { + ""version"": ""2.0.5"", + ""resolved"": ""https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz"", +@@ -20657,6 +20675,12 @@ + ""resolved"": ""https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz"", + ""integrity"": ""sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg=="" + }, ++ ""regenerator-runtime"": { ++ ""version"": ""0.13.11"", ++ ""resolved"": ""https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz"", ++ ""integrity"": ""sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg=="", ++ ""dev"": true ++ }, + ""regex-cache"": { + ""version"": ""0.4.4"", + ""resolved"": ""https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz"", +@@ -21658,33 +21682,6 @@ + } + } + }, +- ""socket.io-parser"": { +- ""version"": ""4.2.3"", +- ""resolved"": ""https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.3.tgz"", +- ""integrity"": ""sha512-JMafRntWVO2DCJimKsRTh/wnqVvO4hrfwOqtO7f+uzwsQMuxO6VwImtYxaQ+ieoyshWOTJyV0fA21lccEXRPpQ=="", +- ""dev"": true, +- ""requires"": { +- ""@socket.io/component-emitter"": ""~3.1.0"", +- ""debug"": ""~4.3.1"" +- }, +- ""dependencies"": { +- ""debug"": { +- ""version"": ""4.3.4"", +- ""resolved"": ""https://registry.npmjs.org/debug/-/debug-4.3.4.tgz"", +- ""integrity"": ""sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ=="", +- ""dev"": true, +- ""requires"": { +- ""ms"": ""2.1.2"" +- } +- }, +- ""ms"": { +- ""version"": ""2.1.2"", +- ""resolved"": ""https://registry.npmjs.org/ms/-/ms-2.1.2.tgz"", +- ""integrity"": ""sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="", +- ""dev"": true +- } +- } +- }, + ""socketio-wildcard"": { + ""version"": ""2.0.0"", + ""resolved"": ""https://registry.npmjs.org/socketio-wildcard/-/socketio-wildcard-2.0.0.tgz"", +@@ -21816,9 +21813,9 @@ + } + }, + ""spawn-command"": { +- ""version"": ""0.0.2-1"", +- ""resolved"": ""https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2-1.tgz"", +- ""integrity"": ""sha512-n98l9E2RMSJ9ON1AKisHzz7V42VDiBQGY6PB1BwRglz99wpVsSuGzQ+jOi6lFXBGVTCrRpltvjm+/XA+tpeJrg=="", ++ ""version"": ""0.0.2"", ++ ""resolved"": ""https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2.tgz"", ++ ""integrity"": ""sha512-zC8zGoGkmc8J9ndvml8Xksr1Amk9qBujgbF0JAIWO7kXr43w0h/0GJNM/Vustixu+YE8N/MTrQ7N31FvHUACxQ=="", + ""dev"": true + }, + ""spawn-wrap"": { +diff --git a/package.json b/package.json +index e058c327303..c9b6ebb126d 100644 +--- a/package.json ++++ b/package.json +@@ -120,7 +120,7 @@ + ""chai-as-promised"": ""7.1.1"", + ""clang-format"": ""1.8.0"", + ""commitlint-circle"": ""1.0.0"", +- ""concurrently"": ""8.1.0"", ++ ""concurrently"": ""8.2.0"", + ""conventional-changelog"": ""3.1.25"", + ""core-js"": ""3.30.2"", + ""coveralls"": ""3.1.1""," +news_toolkit,https://github.com/flutter/news_toolkit,134d3dae82abe8a1533bd759f40dae41e4bfdcee,Bart Selwesiuk,2022-04-21 12:10:05,chore(app_ui): add app colors and text styles (#6),"* chore: add fonts + +* chore: exclude generated files from analyzer + +* chore: add app text styles + +* chore: add some app colors + +* chore: add missing words to cspell + +* chore: remove image assets from pubspec + +* chore: update flutter_svg version + +* chore: update pubspec.lock + +* test: add AppTextStyle tests","chore(app_ui): add app colors and text styles (#6) + +* chore: add fonts + +* chore: exclude generated files from analyzer + +* chore: add app text styles + +* chore: add some app colors + +* chore: add missing words to cspell + +* chore: remove image assets from pubspec + +* chore: update flutter_svg version + +* chore: update pubspec.lock + +* test: add AppTextStyle tests + +Co-authored-by: Bart Selwesiuk ","diff --git a/.vscode/cspell.json b/.vscode/cspell.json +index a795fee1d..fbebf8fc9 100644 +--- a/.vscode/cspell.json ++++ b/.vscode/cspell.json +@@ -58,6 +58,7 @@ + ""msgsend"", + ""negatable"", + ""nonnull"", ++ ""Noto"", + ""objc"", + ""onone"", + ""página"", +diff --git a/packages/app_ui/analysis_options.yaml b/packages/app_ui/analysis_options.yaml +index 44aef9aca..94ff57160 100644 +--- a/packages/app_ui/analysis_options.yaml ++++ b/packages/app_ui/analysis_options.yaml +@@ -1 +1,5 @@ + include: package:very_good_analysis/analysis_options.2.4.0.yaml ++ ++analyzer: ++ exclude: ++ - lib/src/generated/** +diff --git a/packages/app_ui/assets/fonts/Futura-Bold-Italic.otf b/packages/app_ui/assets/fonts/Futura-Bold-Italic.otf +deleted file mode 100644 +index 25dcc6b68..000000000 +Binary files a/packages/app_ui/assets/fonts/Futura-Bold-Italic.otf and /dev/null differ +diff --git a/packages/app_ui/assets/fonts/Futura-Bold.otf b/packages/app_ui/assets/fonts/Futura-Bold.otf +deleted file mode 100644 +index 43f2cad00..000000000 +Binary files a/packages/app_ui/assets/fonts/Futura-Bold.otf and /dev/null differ +diff --git a/packages/app_ui/assets/fonts/Futura-Medium-Italic.otf b/packages/app_ui/assets/fonts/Futura-Medium-Italic.otf +deleted file mode 100644 +index 64a308de4..000000000 +Binary files a/packages/app_ui/assets/fonts/Futura-Medium-Italic.otf and /dev/null differ +diff --git a/packages/app_ui/assets/fonts/Futura-Medium.otf b/packages/app_ui/assets/fonts/Futura-Medium.otf +deleted file mode 100644 +index c98f6c3c9..000000000 +Binary files a/packages/app_ui/assets/fonts/Futura-Medium.otf and /dev/null differ +diff --git a/packages/app_ui/assets/fonts/Montserrat-Medium.ttf b/packages/app_ui/assets/fonts/Montserrat-Medium.ttf +new file mode 100644 +index 000000000..20fb4638d +Binary files /dev/null and b/packages/app_ui/assets/fonts/Montserrat-Medium.ttf differ +diff --git a/packages/app_ui/assets/fonts/NotoSansDisplay-Regular.ttf b/packages/app_ui/assets/fonts/NotoSansDisplay-Regular.ttf +new file mode 100644 +index 000000000..ce836caab +Binary files /dev/null and b/packages/app_ui/assets/fonts/NotoSansDisplay-Regular.ttf differ +diff --git a/packages/app_ui/assets/fonts/NotoSansDisplay-SemiBold.ttf b/packages/app_ui/assets/fonts/NotoSansDisplay-SemiBold.ttf +new file mode 100644 +index 000000000..187d3f3a1 +Binary files /dev/null and b/packages/app_ui/assets/fonts/NotoSansDisplay-SemiBold.ttf differ +diff --git a/packages/app_ui/assets/fonts/NotoSerif-Bold.ttf b/packages/app_ui/assets/fonts/NotoSerif-Bold.ttf +new file mode 100644 +index 000000000..487bdbe23 +Binary files /dev/null and b/packages/app_ui/assets/fonts/NotoSerif-Bold.ttf differ +diff --git a/packages/app_ui/assets/fonts/NotoSerif-Medium.ttf b/packages/app_ui/assets/fonts/NotoSerif-Medium.ttf +new file mode 100644 +index 000000000..73f0109e6 +Binary files /dev/null and b/packages/app_ui/assets/fonts/NotoSerif-Medium.ttf differ +diff --git a/packages/app_ui/assets/fonts/NotoSerif-Regular.ttf b/packages/app_ui/assets/fonts/NotoSerif-Regular.ttf +new file mode 100644 +index 000000000..892423b57 +Binary files /dev/null and b/packages/app_ui/assets/fonts/NotoSerif-Regular.ttf differ +diff --git a/packages/app_ui/assets/fonts/NotoSerif-SemiBold.ttf b/packages/app_ui/assets/fonts/NotoSerif-SemiBold.ttf +new file mode 100644 +index 000000000..2341196b6 +Binary files /dev/null and b/packages/app_ui/assets/fonts/NotoSerif-SemiBold.ttf differ +diff --git a/packages/app_ui/lib/src/colors/app_colors.dart b/packages/app_ui/lib/src/colors/app_colors.dart +index 41806a339..1aaa7ef2e 100644 +--- a/packages/app_ui/lib/src/colors/app_colors.dart ++++ b/packages/app_ui/lib/src/colors/app_colors.dart +@@ -37,4 +37,22 @@ abstract class AppColors { + + /// The red primary color and swatch. + static const MaterialColor red = Colors.red; ++ ++ /// The background color. ++ static const Color background = Color(0xFFFFFFFF); ++ ++ /// The dark background color. ++ static const Color darkBackground = Color(0xFF001F28); ++ ++ /// The on-background color. ++ static const Color onBackground = Color(0xFF1A1A1A); ++ ++ /// The dark on-background color. ++ static const Color darkOnBackground = Color(0xFFFFFFFF); ++ ++ /// The primary container color. ++ static const Color primaryContainer = Color(0xFFB1EBFF); ++ ++ /// The dark text 1 color. ++ static const Color darkText1 = Color(0xFFFCFCFC); + } +diff --git a/packages/app_ui/lib/src/theme/app_theme.dart b/packages/app_ui/lib/src/theme/app_theme.dart +index 6e951ccae..3fdde3965 100644 +--- a/packages/app_ui/lib/src/theme/app_theme.dart ++++ b/packages/app_ui/lib/src/theme/app_theme.dart +@@ -60,7 +60,9 @@ class AppTheme { + } + + IconThemeData get _iconTheme { +- return const IconThemeData(color: AppColors.black); ++ return const IconThemeData( ++ color: AppColors.onBackground, ++ ); + } + + DividerThemeData get _dividerTheme { +diff --git a/packages/app_ui/lib/src/typography/app_text_styles.dart b/packages/app_ui/lib/src/typography/app_text_styles.dart +index d7e211a7b..2a0a8593c 100644 +--- a/packages/app_ui/lib/src/typography/app_text_styles.dart ++++ b/packages/app_ui/lib/src/typography/app_text_styles.dart +@@ -7,85 +7,133 @@ abstract class AppTextStyle { + fontWeight: AppFontWeight.regular, + height: 1.5, + package: 'app_ui', +- fontFamily: 'Futura', ++ fontFamily: 'NotoSerif', ++ ); ++ ++ /// Display 1 Text Style ++ static final TextStyle display1 = _baseTextStyle.copyWith( ++ fontSize: 64, ++ fontWeight: AppFontWeight.bold, ++ height: 1.18, ++ letterSpacing: -0.5, ++ ); ++ ++ /// Display 2 Text Style ++ static final TextStyle display2 = _baseTextStyle.copyWith( ++ fontSize: 57, ++ fontWeight: AppFontWeight.bold, ++ height: 1.12, ++ letterSpacing: -0.25, ++ ); ++ ++ /// Display 3 Text Style ++ static final TextStyle display3 = _baseTextStyle.copyWith( ++ fontSize: 45, ++ fontWeight: AppFontWeight.bold, ++ height: 1.15, + ); + + /// Headline 1 Text Style + static final TextStyle headline1 = _baseTextStyle.copyWith( +- fontSize: 32, +- fontWeight: AppFontWeight.bold, +- height: 1.25, ++ fontSize: 36, ++ fontWeight: AppFontWeight.semiBold, ++ height: 1.22, + ); + + /// Headline 2 Text Style + static final TextStyle headline2 = _baseTextStyle.copyWith( +- fontSize: 26, +- fontWeight: AppFontWeight.extraBold, ++ fontSize: 32, ++ fontWeight: AppFontWeight.medium, + height: 1.25, + ); + + /// Headline 3 Text Style + static final TextStyle headline3 = _baseTextStyle.copyWith( +- fontSize: 22, +- fontWeight: AppFontWeight.extraBold, +- height: 1.25, ++ fontSize: 28, ++ fontWeight: AppFontWeight.medium, ++ height: 1.28, + ); + + /// Headline 4 Text Style + static final TextStyle headline4 = _baseTextStyle.copyWith( +- fontSize: 20, +- fontWeight: AppFontWeight.extraBold, +- height: 1.25, ++ fontSize: 24, ++ fontWeight: AppFontWeight.semiBold, ++ height: 1.33, + ); + + /// Headline 5 Text Style + static final TextStyle headline5 = _baseTextStyle.copyWith( +- fontSize: 18, +- fontWeight: AppFontWeight.extraBold, +- height: 1.25, ++ fontSize: 22, ++ height: 1.27, + ); + + /// Headline 6 Text Style + static final TextStyle headline6 = _baseTextStyle.copyWith( +- fontSize: 14, +- fontWeight: AppFontWeight.bold, ++ fontSize: 18, ++ fontWeight: AppFontWeight.semiBold, + height: 1.25, + ); + + /// Subtitle 1 Text Style + static final TextStyle subtitle1 = _baseTextStyle.copyWith( + fontSize: 16, ++ height: 1.5, ++ letterSpacing: 0.1, + ); + + /// Subtitle 2 Text Style + static final TextStyle subtitle2 = _baseTextStyle.copyWith( + fontSize: 14, ++ fontWeight: AppFontWeight.medium, ++ height: 1.42, ++ letterSpacing: 0.1, + ); + + /// Body Text 1 Text Style + static final TextStyle bodyText1 = _baseTextStyle.copyWith( +- fontSize: 14, ++ fontSize: 16, ++ height: 1.5, ++ letterSpacing: 0.5, + ); + + /// Body Text 2 Text Style (the default) + static final TextStyle bodyText2 = _baseTextStyle.copyWith( +- fontSize: 16, ++ fontSize: 14, ++ height: 1.42, ++ letterSpacing: 0.25, + ); + + /// Button Text Style + static final TextStyle button = _baseTextStyle.copyWith( +- fontSize: 16, +- fontWeight: AppFontWeight.bold, ++ fontFamily: 'Montserrat', ++ fontSize: 14, ++ fontWeight: AppFontWeight.medium, ++ height: 1.42, ++ letterSpacing: 0.1, + ); + + /// Caption Text Style + static final TextStyle caption = _baseTextStyle.copyWith( ++ fontFamily: 'NotoSansDisplay', + fontSize: 12, ++ height: 1.33, ++ letterSpacing: 0.4, + ); + + /// Overline Text Style + static final TextStyle overline = _baseTextStyle.copyWith( +- fontSize: 10, +- fontWeight: AppFontWeight.medium, ++ fontFamily: 'NotoSansDisplay', ++ fontWeight: AppFontWeight.semiBold, ++ fontSize: 12, ++ height: 1.33, ++ letterSpacing: 0.5, ++ ); ++ ++ /// Label Small Text Style ++ static final TextStyle labelSmall = _baseTextStyle.copyWith( ++ fontFamily: 'NotoSansDisplay', ++ fontSize: 11, ++ height: 1.45, ++ letterSpacing: 0.5, + ); + } +diff --git a/packages/app_ui/pubspec.yaml b/packages/app_ui/pubspec.yaml +index 9f0874022..ba7dee5e4 100644 +--- a/packages/app_ui/pubspec.yaml ++++ b/packages/app_ui/pubspec.yaml +@@ -8,7 +8,7 @@ environment: + dependencies: + flutter: + sdk: flutter +- flutter_svg: ^0.22.0 ++ flutter_svg: ^1.0.3 + + dev_dependencies: + flutter_test: +@@ -18,28 +18,26 @@ dev_dependencies: + flutter: + uses-material-design: true + fonts: +- - family: Futura ++ - family: NotoSerif + fonts: +- - asset: assets/fonts/Futura-Bold.otf +- weight: 900 +- - asset: assets/fonts/Futura-Bold-Italic.otf +- weight: 900 +- style: italic +- - asset: assets/fonts/Futura-Bold.otf ++ - asset: assets/fonts/NotoSerif-Bold.ttf + weight: 700 +- - asset: assets/fonts/Futura-Bold-Italic.otf +- weight: 700 +- style: italic +- - asset: assets/fonts/Futura-Medium.otf +- weight: 500 +- - asset: assets/fonts/Futura-Medium-Italic.otf ++ - asset: assets/fonts/NotoSerif-SemiBold.ttf ++ weight: 600 ++ - asset: assets/fonts/NotoSerif-Medium.ttf + weight: 500 +- style: italic +- - asset: assets/fonts/Futura-Medium.otf ++ - asset: assets/fonts/NotoSerif-Regular.ttf + weight: 400 +- - asset: assets/fonts/Futura-Medium-Italic.otf ++ - family: NotoSansDisplay ++ fonts: ++ - asset: assets/fonts/NotoSansDisplay-Regular.ttf + weight: 400 +- style: italic ++ - asset: assets/fonts/NotoSansDisplay-SemiBold.ttf ++ weight: 600 ++ - family: Montserrat ++ fonts: ++ - asset: assets/fonts/Montserrat-Medium.ttf ++ weight: 500 + + flutter_gen: + assets: +diff --git a/packages/app_ui/test/src/typography/app_text_styles_test.dart b/packages/app_ui/test/src/typography/app_text_styles_test.dart +new file mode 100644 +index 000000000..e0cde4426 +--- /dev/null ++++ b/packages/app_ui/test/src/typography/app_text_styles_test.dart +@@ -0,0 +1,75 @@ ++import 'package:app_ui/src/typography/typography.dart'; ++import 'package:flutter/material.dart'; ++import 'package:flutter_test/flutter_test.dart'; ++ ++void main() { ++ group('AppTextStyles', () { ++ test('display1 returns TextStyle', () { ++ expect(AppTextStyle.display1, isA()); ++ }); ++ ++ test('display2 returns TextStyle', () { ++ expect(AppTextStyle.display2, isA()); ++ }); ++ ++ test('display3 returns TextStyle', () { ++ expect(AppTextStyle.display3, isA()); ++ }); ++ ++ test('headline1 returns TextStyle', () { ++ expect(AppTextStyle.headline1, isA()); ++ }); ++ ++ test('headline2 returns TextStyle', () { ++ expect(AppTextStyle.headline2, isA()); ++ }); ++ ++ test('headline3 returns TextStyle', () { ++ expect(AppTextStyle.headline3, isA()); ++ }); ++ ++ test('headline4 returns TextStyle', () { ++ expect(AppTextStyle.headline4, isA()); ++ }); ++ ++ test('headline5 returns TextStyle', () { ++ expect(AppTextStyle.headline5, isA()); ++ }); ++ ++ test('headline6 returns TextStyle', () { ++ expect(AppTextStyle.headline6, isA()); ++ }); ++ ++ test('subtitle1 returns TextStyle', () { ++ expect(AppTextStyle.subtitle1, isA()); ++ }); ++ ++ test('subtitle2 returns TextStyle', () { ++ expect(AppTextStyle.subtitle2, isA()); ++ }); ++ ++ test('bodyText1 returns TextStyle', () { ++ expect(AppTextStyle.bodyText1, isA()); ++ }); ++ ++ test('bodyText2 returns TextStyle', () { ++ expect(AppTextStyle.bodyText2, isA()); ++ }); ++ ++ test('button returns TextStyle', () { ++ expect(AppTextStyle.button, isA()); ++ }); ++ ++ test('caption returns TextStyle', () { ++ expect(AppTextStyle.caption, isA()); ++ }); ++ ++ test('overline returns TextStyle', () { ++ expect(AppTextStyle.overline, isA()); ++ }); ++ ++ test('labelSmall returns TextStyle', () { ++ expect(AppTextStyle.labelSmall, isA()); ++ }); ++ }); ++} +diff --git a/pubspec.lock b/pubspec.lock +index 521ae2622..1244a70f0 100644 +--- a/pubspec.lock ++++ b/pubspec.lock +@@ -416,7 +416,7 @@ packages: + name: flutter_svg + url: ""https://pub.dartlang.org"" + source: hosted +- version: ""0.22.0"" ++ version: ""1.0.3"" + flutter_test: + dependency: ""direct dev"" + description: flutter +@@ -629,14 +629,14 @@ packages: + name: path_drawing + url: ""https://pub.dartlang.org"" + source: hosted +- version: ""0.5.1+1"" ++ version: ""1.0.0"" + path_parsing: + dependency: transitive + description: + name: path_parsing + url: ""https://pub.dartlang.org"" + source: hosted +- version: ""0.2.1"" ++ version: ""1.0.0"" + path_provider: + dependency: ""direct main"" + description: +diff --git a/pubspec.yaml b/pubspec.yaml +index 4d7733e0a..be8b4eba6 100644 +--- a/pubspec.yaml ++++ b/pubspec.yaml +@@ -22,7 +22,7 @@ dependencies: + flutter_bloc: ^8.0.1 + flutter_localizations: + sdk: flutter +- flutter_svg: ^0.22.0 ++ flutter_svg: ^1.0.3 + font_awesome_flutter: ^9.0.0 + form_inputs: + path: packages/form_inputs" +Rocket.Chat,https://github.com/RocketChat/Rocket.Chat,5e0653ac691c55f1fe2ad04903770ca38e65b5e6,Matheus Barbosa Silva,2024-10-17 09:58:15,"fix!: ""Forgot Password"" e-mail is not translated correctly (#32212)","* fix: Update translation key used by 'Forgot Password' e-mail body setting + +---------","fix!: ""Forgot Password"" e-mail is not translated correctly (#32212) + +* fix: Update translation key used by 'Forgot Password' e-mail body setting + +--------- + +Co-authored-by: Marcos Spessatto Defendi ","diff --git a/.changeset/chilly-flowers-brake.md b/.changeset/chilly-flowers-brake.md +new file mode 100644 +index 0000000000000..d23c7867cb257 +--- /dev/null ++++ b/.changeset/chilly-flowers-brake.md +@@ -0,0 +1,5 @@ ++--- ++""@rocket.chat/meteor"": major ++--- ++ ++Fixed broken translation in ""Forgot Password"" e-mail +diff --git a/apps/meteor/server/startup/migrations/index.ts b/apps/meteor/server/startup/migrations/index.ts +index bd17b46189347..2dadd2102360e 100644 +--- a/apps/meteor/server/startup/migrations/index.ts ++++ b/apps/meteor/server/startup/migrations/index.ts +@@ -42,5 +42,6 @@ import './v306'; + import './v307'; + import './v308'; + import './v309'; ++import './v310'; + + export * from './xrun'; +diff --git a/apps/meteor/server/startup/migrations/v310.ts b/apps/meteor/server/startup/migrations/v310.ts +new file mode 100644 +index 0000000000000..6905b37293d36 +--- /dev/null ++++ b/apps/meteor/server/startup/migrations/v310.ts +@@ -0,0 +1,27 @@ ++import type { ISetting } from '@rocket.chat/core-typings'; ++import { Settings } from '@rocket.chat/models'; ++ ++import { addMigration } from '../../lib/migrations'; ++ ++addMigration({ ++ version: 310, ++ name: 'Update translation key on ""Forgot password"" e-mail body setting', ++ async up() { ++ const forgotPasswordEmail = await Settings.findOneById>('Forgot_Password_Email', { projection: { value: 1 } }); ++ if (!forgotPasswordEmail) { ++ return; ++ } ++ const newPackageValue = ++ '

    {Forgot_password}

    {Lets_get_you_new_one_}

    {Reset}

    {If_you_didnt_ask_for_reset_ignore_this_email}

    '; ++ ++ await Settings.updateOne( ++ { _id: 'Forgot_Password_Email' }, ++ { ++ $set: { ++ packageValue: newPackageValue, ++ value: (forgotPasswordEmail.value as string).replace(/{Lets_get_you_new_one}/g, '{Lets_get_you_new_one_}'), ++ }, ++ }, ++ ); ++ }, ++});" +MaaAssistantArknights,https://github.com/MaaAssistantArknights/MaaAssistantArknights,37dcb6fb1284f546ddc42d9f9e9ac784b47cf9f2,LambdaLe,2023-02-12 18:06:49,feat: 生息演算 MAACore添加刷粗制赤金参数,"生息演算集成文档 + +修复mainModel变量名更改导致的编译错误","feat: 生息演算 MAACore添加刷粗制赤金参数 + +生息演算集成文档 + +修复mainModel变量名更改导致的编译错误","diff --git ""a/docs/3.1-\351\233\206\346\210\220\346\226\207\346\241\243.md"" ""b/docs/3.1-\351\233\206\346\210\220\346\226\207\346\241\243.md"" +index ed963a8f705..0abf741933a 100644 +--- ""a/docs/3.1-\351\233\206\346\210\220\346\226\207\346\241\243.md"" ++++ ""b/docs/3.1-\351\233\206\346\210\220\346\226\207\346\241\243.md"" +@@ -235,7 +235,10 @@ AsstTaskId ASSTAPI AsstAppendTask(AsstHandle handle, const char* type, const cha + + ```jsonc + { +- ""enable"": bool ++ ""enable"": bool, ++ ""mode"": int, // 模式,可选项。默认 0 ++ // 0 - 刷分与建造点,进入战斗直接退出 ++ // 1 - 刷赤金,联络员买水后基地锻造 + } + ``` + +diff --git a/docs/en-us/3.1-INTEGRATION.md b/docs/en-us/3.1-INTEGRATION.md +index bb855219a98..fa2b0829705 100644 +--- a/docs/en-us/3.1-INTEGRATION.md ++++ b/docs/en-us/3.1-INTEGRATION.md +@@ -223,7 +223,8 @@ For more details about auto-copilot JSON, please refer to [Copilot Schema](3.3-C + + ```jsonc + { +- ""enable"": bool ++ ""enable"": bool, ++ ""mode"": int, + } + ``` + +diff --git ""a/docs/ja-jp/3.1-\347\265\261\345\220\210\343\203\211\343\202\255\343\203\245\343\203\241\343\203\263\343\203\210.md"" ""b/docs/ja-jp/3.1-\347\265\261\345\220\210\343\203\211\343\202\255\343\203\245\343\203\241\343\203\263\343\203\210.md"" +index 423d7f4e668..8d638a0c5cb 100644 +--- ""a/docs/ja-jp/3.1-\347\265\261\345\220\210\343\203\211\343\202\255\343\203\245\343\203\241\343\203\263\343\203\210.md"" ++++ ""b/docs/ja-jp/3.1-\347\265\261\345\220\210\343\203\211\343\202\255\343\203\245\343\203\241\343\203\263\343\203\210.md"" +@@ -220,7 +220,8 @@ TaskId ASSTAPI AsstAppendTask(AsstHandle handle, const char* type, const char* p + + ```jsonc + { +- ""enable"": bool ++ ""enable"": bool, ++ ""mode"": int, + } + ``` + +diff --git ""a/docs/zh-tw/3.1-\351\233\206\346\210\220\346\226\207\344\273\266.md"" ""b/docs/zh-tw/3.1-\351\233\206\346\210\220\346\226\207\344\273\266.md"" +index b55827a57f8..ad1db9ec0c6 100644 +--- ""a/docs/zh-tw/3.1-\351\233\206\346\210\220\346\226\207\344\273\266.md"" ++++ ""b/docs/zh-tw/3.1-\351\233\206\346\210\220\346\226\207\344\273\266.md"" +@@ -221,7 +221,8 @@ TaskId ASSTAPI AsstAppendTask(AsstHandle handle, const char* type, const char* p + + ```jsonc + { +- ""enable"": bool ++ ""enable"": bool, ++ ""mode"": int, + } + ``` + +diff --git a/resource/tasks.json b/resource/tasks.json +index fa407d255bf..60a7aa78dd6 100644 +--- a/resource/tasks.json ++++ b/resource/tasks.json +@@ -10092,6 +10092,19 @@ + ""Reclamation@AtMapFlag"" + ] + }, ++ ""Reclamation@ClickBlackMarketCorner"":{ ++ ""roi"": [ ++ 318, 40, 115, 113 ++ ], ++ ""action"": ""ClickSelf"" ++ }, ++ ""Reclamation@ClickBlackMarket"":{ ++ ""roi"": [ ++ 302, 28, 146, 126 ++ ], ++ ""cache"": false, ++ ""action"": ""ClickSelf"" ++ }, + ""Reclamation@ClickCenterBase"": { + ""roi"": [ + 557, +@@ -10221,10 +10234,7 @@ + ""baseTask"": ""Reclamation@BattlePackIconTemplate"", + ""template"": ""Reclamation@ClickExitLevel.png"", + ""specificRect"": [ +- 46, +- 28, +- 59, +- 61 ++ 49, 30, 58, 54 + ] + }, + ""Reclamation@ExitLevelConfirm"": { +@@ -10532,20 +10542,46 @@ + ], + ""action"": ""ClickSelf"", + ""next"": [ +- ""Reclamation@EnterResearchLab"", +- ""Reclamation@ClickCmdCenter"", +- ""Reclamation@CmdCenterSwipeRight"" ++ ""Reclamation@AtCmdCenterFlag"", ++ ""Reclamation@ClickCmdCenter"" + ] + }, +- ""Reclamation@CmdCenterSwipeRight"": { +- ""baseTask"": ""SwipeToTheRight"", +- ""postDelay"": 1500, ++ ""Reclamation@AtCmdCenterFlag"":{ ++ ""algorithm"": ""OcrDetect"", ++ ""roi"": [ ++ 68, 0, 326, 137 ++ ], ++ ""cache"": false, ++ ""text"": [ ++ ""COM"", ++ ""MAND"", ++ ""ENTER"" ++ ], + ""next"": [ +- ""Reclamation@EnterResearchLab"", +- ""Reclamation@CmdCenterSwipeRight"" ++ ""Stop"" + ] + }, +- ""Reclamation@EnterResearchLab"": { ++ ""Reclamation@CmdCenterSwipeRight"":{ ++ ""baseTask"": ""SwipeToTheRight"", ++ ""postDelay"": 1000 ++ }, ++ ""Reclamation@CmdCenterSwipeLeft"":{ ++ ""baseTask"": ""SwipeToTheLeft"", ++ ""postDelay"": 1000 ++ }, ++ ""Reclamation@EnterSmeltGoldPage"":{ ++ ""algorithm"": ""OcrDetect"", ++ ""cache"": false, ++ ""roi"": [ ++ 0, 31, 1280, 175 ++ ], ++ ""text"": [ ++ ""粗制"", ++ ""赤金"" ++ ], ++ ""action"": ""ClickSelf"" ++ }, ++ ""Reclamation@EnterResearchLab"":{ + ""algorithm"": ""OcrDetect"", + ""roi"": [ + 0, +@@ -10559,11 +10595,7 @@ + ""所"" + ], + ""action"": ""ClickSelf"", +- ""postDelay"": 500, +- ""next"": [ +- ""Reclamation@LabClickDetailView"", +- ""Reclamation@EnterResearchLab"" +- ] ++ ""postDelay"": 500 + }, + ""Reclamation@LabClickDetailView"": { + ""algorithm"": ""OcrDetect"", +@@ -10580,11 +10612,7 @@ + ""图"" + ], + ""postDelay"": 500, +- ""action"": ""ClickSelf"", +- ""next"": [ +- ""Reclamation@LabClickAssembleable"", +- ""Reclamation@LabReturnToMap"" +- ] ++ ""action"": ""ClickSelf"" + }, + ""Reclamation@LabClickAssembleable"": { + ""algorithm"": ""OcrDetect"", +@@ -10596,15 +10624,10 @@ + ], + ""action"": ""ClickSelf"", + ""text"": [ +- ""可"", +- ""组"", +- ""装"" +- ], +- ""next"": [ +- ""Reclamation@LabAssembleIncrease"" ++ ""可"", ""组"", ""装"" + ] + }, +- ""Reclamation@LabAssembleStatus"": { ++ ""Reclamation@ManufactureStatus"":{ + ""Doc"": ""base_task"", + ""algorithm"": ""OcrDetect"", + ""roi"": [ +@@ -10615,8 +10638,8 @@ + ], + ""text"": [] + }, +- ""Reclamation@LabAssembleIncrease"": { +- ""baseTask"": ""Reclamation@LabAssembleStatus"", ++ ""Reclamation@ManufactureIncrease"": { ++ ""baseTask"": ""Reclamation@ManufactureStatus"", + ""action"": ""ClickRect"", + ""specificRect"": [ + 1120, +@@ -10625,18 +10648,11 @@ + 26 + ], + ""text"": [ +- ""开"", +- ""始"", +- ""组"", +- ""装"" +- ], +- ""next"": [ +- ""Reclamation@LabAssembleIncrease"", +- ""Reclamation@LabAssembleDecrease"" ++ ""开"", ""始"" + ] + }, +- ""Reclamation@LabAssembleDecrease"": { +- ""baseTask"": ""Reclamation@LabAssembleStatus"", ++ ""Reclamation@ManufactureDecrease"": { ++ ""baseTask"": ""Reclamation@ManufactureStatus"", + ""action"": ""ClickRect"", + ""specificRect"": [ + 1096, +@@ -10645,69 +10661,27 @@ + 28 + ], + ""text"": [ +- ""材"", +- ""料"", +- ""不"", +- ""足"" +- ], +- ""next"": [ +- ""Reclamation@LabDoAssemble"", +- ""Reclamation@LabAssembleDecrease"" ++ ""材"", ""料"", ""不"", ""足"" + ] + }, +- ""Reclamation@LabDoAssemble"": { +- ""baseTask"": ""Reclamation@LabAssembleStatus"", ++ ""Reclamation@DoManufacture"":{ ++ ""baseTask"": ""Reclamation@ManufactureStatus"", + ""action"": ""ClickSelf"", + ""text"": [ +- ""开"", +- ""始"", +- ""组"", +- ""装"" ++ ""开"", ""始"" + ], +- ""postDelay"": 1000, +- ""next"": [ +- ""Reclamation@LabClickDetailView"" +- ] ++ ""postDelay"": 1000 + }, +- ""Reclamation@LabInsufficientMaterial"": { +- ""algorithm"": ""OcrDetect"", +- ""roi"": [ +- 1080, +- 320, +- 200, +- 139 +- ], +- ""action"": ""DoNothing"", ++ ""Reclamation@ManufactureInsufficientMaterial"": { ++ ""baseTask"": ""Reclamation@ManufactureStatus"", + ""text"": [ +- ""材"", +- ""料"", +- ""不"", +- ""足"" +- ], +- ""next"": [ +- ""Reclamation@LabClickDetailView"" ++ ""材"", ""料"", ""不"", ""足"" + ] + }, +- ""Reclamation@LabReturnToMap"": { +- ""roi"": [ +- 0, +- 0, +- 148, +- 148 +- ], +- ""templThreshold"": 0.7, +- ""action"": ""ClickSelf"", +- ""next"": [ +- ""Reclamation@LabArriveMap"", +- ""Reclamation@LabReturnToMap"", +- ""Reclamation@AtHomePageFlag"" +- ] +- }, +- ""Reclamation@LabArriveMap"": { +- ""baseTask"": ""Reclamation@AtMapFlag"", +- ""template"": ""Reclamation@ResetScope.png"", +- ""next"": [ +- ""Reclamation@ExitAlgorithm"" ++ ""Reclamation@ManufactureSufficientMaterial"": { ++ ""baseTask"": ""Reclamation@ManufactureStatus"", ++ ""text"": [ ++ ""开"", ""始"" + ] + }, + ""Reclamation@Liaison"":{ +diff --git a/resource/template/Reclamation@ClickBlackMarket.png b/resource/template/Reclamation@ClickBlackMarket.png +new file mode 100644 +index 00000000000..c32e887b391 +Binary files /dev/null and b/resource/template/Reclamation@ClickBlackMarket.png differ +diff --git a/resource/template/Reclamation@ClickBlackMarketCorner.png b/resource/template/Reclamation@ClickBlackMarketCorner.png +new file mode 100644 +index 00000000000..3c847410676 +Binary files /dev/null and b/resource/template/Reclamation@ClickBlackMarketCorner.png differ +diff --git a/src/MaaCore/Task/Reclamation/ReclamationBattlePlugin.cpp b/src/MaaCore/Task/Reclamation/ReclamationBattlePlugin.cpp +index cab4f6b9312..9a1b73ed7d8 100644 +--- a/src/MaaCore/Task/Reclamation/ReclamationBattlePlugin.cpp ++++ b/src/MaaCore/Task/Reclamation/ReclamationBattlePlugin.cpp +@@ -26,19 +26,9 @@ bool asst::ReclamationBattlePlugin::verify(AsstMsg, const json::value&) const + return false; + } + +-ReclamationBattlePlugin& asst::ReclamationBattlePlugin::set_task_mode(const ReclamationTaskMode& mode) ++ReclamationBattlePlugin& asst::ReclamationBattlePlugin::set_battle_mode(const ReclamationBattleMode& mode) + { +- switch (mode) { +- case ReclamationTaskMode::GiveupUponFight: +- m_task_mode = ReclamationBattleMode::Giveup; +- break; +- case ReclamationTaskMode::SmeltGold: +- m_task_mode = ReclamationBattleMode::BuyWater; +- break; +- default: +- Log.error(__FUNCTION__, "" | "", ""unknown task mode""); +- break; +- } ++ m_battle_mode = mode; + return *this; + } + +@@ -48,12 +38,14 @@ bool asst::ReclamationBattlePlugin::_run() + + wait_until_start(false); + +- if (m_task_mode == ReclamationBattleMode::Giveup) { ++ if (m_battle_mode == ReclamationBattleMode::Giveup) { + return quit_action(); + } +- else if (m_task_mode == ReclamationBattleMode::BuyWater) { +- buy_water(); +- return quit_action(); ++ else if (m_battle_mode == ReclamationBattleMode::BuyWater) { ++ sleep(1500); // 等待技能图标 ++ bool result = buy_water(); ++ quit_action(); ++ return result; + } + + return false; +@@ -77,7 +69,7 @@ bool asst::ReclamationBattlePlugin::quit_action() + if ((!stage1 && !stage2) || retry > 5) { + // 已经到了结算界面,或是用户手动操作了 + Log.error(__FUNCTION__, ""| fail to operate""); +- return ProcessTask(*this, { ""Reclamation@Begin"" }).run(); ++ return false; + } + } + +diff --git a/src/MaaCore/Task/Reclamation/ReclamationBattlePlugin.h b/src/MaaCore/Task/Reclamation/ReclamationBattlePlugin.h +index d2730303539..77f29e17332 100644 +--- a/src/MaaCore/Task/Reclamation/ReclamationBattlePlugin.h ++++ b/src/MaaCore/Task/Reclamation/ReclamationBattlePlugin.h +@@ -21,7 +21,7 @@ namespace asst + + virtual bool verify(AsstMsg msg, const json::value& details) const override; + +- ReclamationBattlePlugin& set_task_mode(const ReclamationTaskMode& mode); ++ ReclamationBattlePlugin& set_battle_mode(const ReclamationBattleMode& mode); + + protected: + virtual bool _run() override; +@@ -36,6 +36,6 @@ namespace asst + std::function orderComp); + bool do_dialog_procedure(const std::vector& procedure); + +- ReclamationBattleMode m_task_mode = ReclamationBattleMode::Giveup; ++ ReclamationBattleMode m_battle_mode = ReclamationBattleMode::Giveup; + }; + } +diff --git a/src/MaaCore/Task/Reclamation/ReclamationControlTask.cpp b/src/MaaCore/Task/Reclamation/ReclamationControlTask.cpp +index f34ef99422c..3bcadc26f4c 100644 +--- a/src/MaaCore/Task/Reclamation/ReclamationControlTask.cpp ++++ b/src/MaaCore/Task/Reclamation/ReclamationControlTask.cpp +@@ -9,8 +9,10 @@ + + #include ""ReclamationBattlePlugin.h"" + +-#define RunCheckSuccess(func) \ +- do { if (!func()) return false; } while(false); ++#define RunCheckSuccess(func, ...) \ ++ do { \ ++ if (!func(__VA_ARGS__)) return false; \ ++ } while (false); + + bool asst::ReclamationControlTask::_run() + { +@@ -24,7 +26,12 @@ bool asst::ReclamationControlTask::_run() + } + } + else if (m_task_mode == ReclamationTaskMode::SmeltGold) { +- return false; ++ m_total_gold = 0; ++ int times = 0; ++ while (!need_exit()) { ++ procedure_start_callback(++times); ++ run_smelt_gold_procedure(); ++ } + } + + return false; +@@ -47,7 +54,9 @@ bool asst::ReclamationControlTask::run_giveup_upon_fight_procedure() + RunCheckSuccess(click_any_zone); + RunCheckSuccess(start_action_enter); + RunCheckSuccess(battle_default_formation_start); +- RunCheckSuccess(ReclamationBattlePlugin(m_callback, m_inst, m_task_chain).set_task_mode(m_task_mode).run); ++ RunCheckSuccess(ReclamationBattlePlugin(m_callback, m_inst, m_task_chain) ++ .set_battle_mode(ReclamationBattleMode::Giveup) ++ .run); + RunCheckSuccess(level_complete_comfirm); + + if (enter_next_day_if_useup()) { +@@ -58,6 +67,45 @@ bool asst::ReclamationControlTask::run_giveup_upon_fight_procedure() + return navigate_to_reclamation_home(); + } + ++bool asst::ReclamationControlTask::run_smelt_gold_procedure() ++{ ++ LogTraceFunction; ++ ++ RunCheckSuccess(navigate_to_reclamation_home); ++ give_up_last_algorithm_if(); ++ RunCheckSuccess(start_with_default_formation); ++ ++ RunCheckSuccess(wait_between_day); ++ skip_announce_report(); ++ ++ bool buy_result = false; ++ while (!need_exit() && !buy_result) { ++ ++ RunCheckSuccess(reset_scope); ++ RunCheckSuccess(click_corner_black_market); ++ RunCheckSuccess(click_black_market); ++ RunCheckSuccess(start_action_enter); ++ buy_result = ReclamationBattlePlugin(m_callback, m_inst, m_task_chain) ++ .set_battle_mode(ReclamationBattleMode::BuyWater) ++ .set_retry_times(0) ++ .run(); ++ RunCheckSuccess(level_complete_comfirm); ++ } ++ ++ RunCheckSuccess(enter_command_center); ++ for (int i = 0; i < 2; ++i) ++ swipe_right(); ++ RunCheckSuccess(ProcessTask(*this, { ""Reclamation@EnterSmeltGoldPage"" }).run); ++ ++ if (check_manufacture_status() != 1) return false; ++ while (!need_exit() && check_manufacture_status() == 1) { ++ smelt_gold_callback(++m_total_gold); ++ do_manufacture(); ++ } ++ ++ return navigate_to_reclamation_home(); ++} ++ + bool asst::ReclamationControlTask::navigate_to_reclamation_home() + { + return ProcessTask(*this, { ""NavigateHome@Reclamation@Begin"" }).run(); +@@ -121,6 +169,16 @@ bool asst::ReclamationControlTask::reset_scope() + return ProcessTask(*this, { ""ResetScope@Reclamation@Begin"" }).run(); + } + ++bool asst::ReclamationControlTask::enter_command_center() ++{ ++ return ProcessTask(*this, { ""Reclamation@ClickCmdCenter"" }).run(); ++} ++ ++bool asst::ReclamationControlTask::do_manufacture() ++{ ++ return ProcessTask(*this, { ""Reclamation@DoManufacture"" }).run(); ++} ++ + bool asst::ReclamationControlTask::check_next_day() + { + return ProcessTask(*this, { ""CheckNextDay@Reclamation@NextDay"" }).set_retry_times(0).run(); +@@ -131,20 +189,56 @@ bool asst::ReclamationControlTask::check_emergency() + return ProcessTask(*this, { ""CheckEmergency@Reclamation@Emergency"" }).set_retry_times(0).run(); + } + ++int asst::ReclamationControlTask::check_manufacture_status() ++{ ++ if (ProcessTask(*this, { ""Reclamation@ManufactureInsufficientMaterial"" }).set_retry_times(0).run()) ++ return 0; ++ else if (ProcessTask(*this, { ""Reclamation@ManufactureSufficientMaterial"" }).set_retry_times(0).run()) ++ return 1; ++ else ++ return -1; ++} ++ + bool asst::ReclamationControlTask::click_center_base() + { + return ProcessTask(*this, { ""ClickCenterBase@Reclamation@Begin"" }).run(); + } + ++bool asst::ReclamationControlTask::click_corner_black_market() ++{ ++ return ProcessTask(*this, { ""Reclamation@ClickBlackMarketCorner"" }).run(); ++} ++ + bool asst::ReclamationControlTask::click_any_zone() + { + return ProcessTask(*this, { ""ClickAnyZone@Reclamation@Begin"" }).run(); + } + ++bool asst::ReclamationControlTask::click_black_market() ++{ ++ return ProcessTask(*this, { ""Reclamation@ClickBlackMarket"" }).run(); ++} ++ ++bool asst::ReclamationControlTask::swipe_right() ++{ ++ return ProcessTask(*this, { ""Reclamation@CmdCenterSwipeRight"" }).run(); ++} ++ ++bool asst::ReclamationControlTask::swipe_left() ++{ ++ return ProcessTask(*this, { ""Reclamation@CmdCenterSwipeLeft"" }).run(); ++} ++ + void asst::ReclamationControlTask::procedure_start_callback(int times) { + json::value info = basic_info_with_what(""ReclamationProcedureStart""); + json::value& details = info[""details""]; + details[""times""] = times; + callback(AsstMsg::SubTaskExtraInfo, info); ++} + ++void asst::ReclamationControlTask::smelt_gold_callback(int times) { ++ json::value info = basic_info_with_what(""ReclamationSmeltGold""); ++ json::value& details = info[""details""]; ++ details[""times""] = times; ++ callback(AsstMsg::SubTaskExtraInfo, info); + } +diff --git a/src/MaaCore/Task/Reclamation/ReclamationControlTask.h b/src/MaaCore/Task/Reclamation/ReclamationControlTask.h +index 2198258928a..09e1a417a35 100644 +--- a/src/MaaCore/Task/Reclamation/ReclamationControlTask.h ++++ b/src/MaaCore/Task/Reclamation/ReclamationControlTask.h +@@ -20,7 +20,7 @@ namespace asst + private: + virtual bool _run() override; + bool run_giveup_upon_fight_procedure(); +- //bool run_smelt_gold_procedure(); ++ bool run_smelt_gold_procedure(); + + bool navigate_to_reclamation_home(); // 导航至生息演算主界面 + bool give_up_last_algorithm_if(); // 如果有,放弃上次演算 +@@ -32,17 +32,25 @@ namespace asst + bool enter_next_day_if_useup(); // 如果决断点耗尽,进入下一天 + bool wait_between_day(); // 等待日期转换动画结束 + bool reset_scope(); // 重置地图大小 ++ bool enter_command_center(); // 进入侧边栏的命令中心 ++ bool do_manufacture(); // 点击制作按钮 + + bool check_next_day(); // 决断点消耗完进入下一天的标志 + bool check_emergency(); // 敌袭到达 ++ int check_manufacture_status(); // 制造界面是否材料充足,0不足,1充足,-1非建造页面 + + bool click_center_base(); // 点击中心基地图标 +- //bool click_corner_black_market(); // 点击左上角黑市图标 ++ bool click_corner_black_market(); // 点击左上角黑市图标 + bool click_any_zone(); // 点击奇遇外任意区 +- //bool click_black_market(); // 点击黑市 +- ++ bool click_black_market(); // 点击黑市 ++ ++ bool swipe_right(); ++ bool swipe_left(); ++ + void procedure_start_callback(int times); ++ void smelt_gold_callback(int times); + + ReclamationTaskMode m_task_mode = ReclamationTaskMode::GiveupUponFight; ++ int m_total_gold = 0; // 制作赤金的次数 + }; + } +diff --git a/src/MaaWpfGui/Main/AsstProxy.cs b/src/MaaWpfGui/Main/AsstProxy.cs +index d185fd08f18..ff1e26869a9 100644 +--- a/src/MaaWpfGui/Main/AsstProxy.cs ++++ b/src/MaaWpfGui/Main/AsstProxy.cs +@@ -997,12 +997,15 @@ private void ProcSubTaskExtraInfo(JObject details) + + /* 生息演算 */ + case ""ReclamationReport"": +- mainModel.AddLog(Localization.GetString(""AlgorithmFinish"") + ""\n"" + ++ _taskQueueViewModel.AddLog(Localization.GetString(""AlgorithmFinish"") + ""\n"" + + Localization.GetString(""AlgorithmBadge"") + "": "" + $""{(int)subTaskDetails[""total_badges""]}(+{(int)subTaskDetails[""badges""]})"" + ""\n"" + + Localization.GetString(""AlgorithmConstructionPoint"") + "": "" + $""{(int)subTaskDetails[""total_construction_points""]}(+{(int)subTaskDetails[""construction_points""]})""); + break; + case ""ReclamationProcedureStart"": +- mainModel.AddLog(Localization.GetString(""MissionStart"") + $"" {(int)subTaskDetails[""times""]} "" + Localization.GetString(""UnitTime""), UILogColor.Info); ++ _taskQueueViewModel.AddLog(Localization.GetString(""MissionStart"") + $"" {(int)subTaskDetails[""times""]} "" + Localization.GetString(""UnitTime""), UILogColor.Info); ++ break; ++ case ""ReclamationSmeltGold"": ++ _taskQueueViewModel.AddLog(Localization.GetString(""AlgorithmDoneSmeltGold"") + $"" {(int)subTaskDetails[""times""]} "" + Localization.GetString(""UnitTime"")); + break; + } + } +diff --git a/src/MaaWpfGui/Res/Localizations/zh-cn.xaml b/src/MaaWpfGui/Res/Localizations/zh-cn.xaml +index f0b6de2821f..2e2c203ece6 100644 +--- a/src/MaaWpfGui/Res/Localizations/zh-cn.xaml ++++ b/src/MaaWpfGui/Res/Localizations/zh-cn.xaml +@@ -103,6 +103,9 @@ + 演算结束 + 繁荣证章 + 建造点数 ++ 锻造赤金 ++ ++ + + 不选择 + 官服" +LinuxGSM,https://github.com/GameServerManagers/LinuxGSM,e7df8b6a6e26a2e17543007340e3102561c84a71,Daniel Gibbs,2018-12-16 00:06:13,refactor(check): deprecate glibc fixes (#2118),* glibc fixes only fixes 15 out of 85 servers with only centos 6 still supported by vendors. It has been decided to remove support for glibc fixes,"refactor(check): deprecate glibc fixes (#2118) + +* glibc fixes only fixes 15 out of 85 servers with only centos 6 still supported by vendors. It has been decided to remove support for glibc fixes","diff --git a/lgsm/functions/check_glibc.sh b/lgsm/functions/check_glibc.sh +index 07ad6adb7a..d353ed8aff 100644 +--- a/lgsm/functions/check_glibc.sh ++++ b/lgsm/functions/check_glibc.sh +@@ -11,31 +11,14 @@ info_distro.sh + + if [ ""${glibcrequired}"" == ""NOT REQUIRED"" ]; then + : +-elif [ ""${glibcrequired}"" == ""UNKNOWN"" ]; then +- fn_print_dots ""Glibc fix"" +- sleep 0.5 +- fn_print_error_nl ""Glibc fix: ${red}${glibcrequired}${default}"" +- echo -e "" * glibc required: ${red}${glibcrequired}${default}"" +- echo -e "" * glibc installed: ${glibcversion}"" +-elif [ ""$(printf '%s\n'${glibcrequired}'\n' ""${glibcversion}"" | sort -V | head -n 1)"" != ""${glibcrequired}"" ]; then +- if [ ""${glibcfix}"" == ""yes"" ]; then +- if [ ""${function_selfname}"" != ""command_install.sh"" ]; then +- fn_print_dots ""Glibc fix"" +- sleep 0.5 +- fn_print_info_nl ""Glibc fix: ${green}Using Glibc fix${default}"" +- echo -e "" * glibc required: ${red}${glibcrequired}${default}"" +- echo -e "" * glibc installed: ${glibcversion}"" +- fix_glibc.sh +- fi +- else +- fn_print_dots ""Glibc fix"" +- sleep 0.5 +- fn_print_error_nl ""Glibc fix: ${red}No Glibc fix available!${default}"" +- echo -en ""\n"" +- echo -e "" * glibc required: ${glibcrequired}"" +- echo -e "" * glibc installed: ${red}${glibcversion}${default}"" +- echo -en ""\n"" +- fn_print_information ""The game server will probably not work. A distro upgrade is required!"" +- sleep 2 +- fi ++elif [ ""$(printf '%s\n'${glibcrequired}'\n' ""${glibcversion}"" | sort -V | head -n 1)"" != ""${glibcrequired}"" ]||[ ""${glibcrequired}"" == ""UNKNOWN"" ]; then ++ fn_print_dots ""Glibc"" ++ sleep 0.5 ++ fn_print_error_nl ""glibc: ${red}glibc distro version ${glibcversion} too old${default}"" ++ echo -en ""\n"" ++ echo -e "" * glibc required: ${glibcrequired}"" ++ echo -e "" * glibc installed: ${red}${glibcversion}${default}"" ++ echo -en ""\n"" ++ fn_print_information ""The game server will probably not work. A distro upgrade is required!"" ++ sleep 2 + fi +\ No newline at end of file +diff --git a/lgsm/functions/command_debug.sh b/lgsm/functions/command_debug.sh +index 23cb49f4bf..40b527b107 100644 +--- a/lgsm/functions/command_debug.sh ++++ b/lgsm/functions/command_debug.sh +@@ -34,20 +34,16 @@ echo -e ""${blue}tmux:\t${default}${tmuxv}"" + echo -e ""${blue}Avg Load:\t${default}${load}"" + echo -e ""${blue}Free Memory:\t${default}${physmemfree}"" + echo -e ""${blue}Free Disk:\t${default}${availspace}"" +-# GLIBC required ++# glibc required + if [ -n ""${glibcrequired}"" ]; then + if [ ""${glibcrequired}"" == ""NOT REQUIRED"" ]; then + : + elif [ ""${glibcrequired}"" == ""UNKNOWN"" ]; then +- echo -e ""${blue}GLIBC required:\t${red}${glibcrequired}"" ++ echo -e ""${blue}glibc required:\t${red}${glibcrequired}"" + elif [ ""$(printf '%s\n'${glibcrequired}'\n' ""${glibcversion}"" | sort -V | head -n 1)"" != ""${glibcrequired}"" ]; then +- if [ ""${glibcfix}"" == ""yes"" ]; then +- echo -e ""${blue}GLIBC required:\t${red}${glibcrequired} ${default}(${green}Using GLIBC fix${default})"" +- else +- echo -e ""${blue}GLIBC required:\t${red}${glibcrequired} ${default}(${red}GLIBC distro version ${glibcversion} too old${default})"" +- fi ++ echo -e ""${blue}glibc required:\t${red}${glibcrequired} ${default}(${red}glibc distro version ${glibcversion} too old${default})"" + else +- echo -e ""${blue}GLIBC required:\t${green}${glibcrequired}${default}"" ++ echo -e ""${blue}glibc required:\t${green}${glibcrequired}${default}"" + fi + fi + # Server ip +diff --git a/lgsm/functions/command_dev_detect_glibc.sh b/lgsm/functions/command_dev_detect_glibc.sh +index d288464022..7f0fc409c5 100644 +--- a/lgsm/functions/command_dev_detect_glibc.sh ++++ b/lgsm/functions/command_dev_detect_glibc.sh +@@ -10,7 +10,7 @@ local commandaction=""Detect-Glibc"" + local function_selfname=""$(basename ""$(readlink -f ""${BASH_SOURCE[0]}"")"")"" + + echo ""================================="" +-echo ""GLIBC Requirements Checker"" ++echo ""glibc Requirements Checker"" + echo ""================================="" + + if [ -z ""$(command -v objdump)"" ]; then +@@ -58,10 +58,10 @@ do + done + echo """" + echo """" +- echo ""${glibc_check_name} GLIBC Requirements"" ++ echo ""${glibc_check_name} glibc Requirements"" + echo ""================================="" + if [ -f ""${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp"" ]; then +- echo ""Required GLIBC"" ++ echo ""Required glibc"" + cat ""${tmpdir}/detect_glibc_${glibc_check_var}.tmp"" | sort | uniq | sort -r --version-sort | head -1 |tee -a ""${tmpdir}/detect_glibc_highest.tmp"" + echo """" + echo ""Files requiring GLIBC"" +@@ -73,19 +73,19 @@ do + rm ""${tmpdir}/detect_glibc_${glibc_check_var}.tmp"" + rm ""${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp"" + else +- fn_print_information_nl ""GLIBC is not required"" ++ fn_print_information_nl ""glibc is not required"" + fi + else + fn_print_information_nl ""${glibc_check_name} is not installed"" + fi + done + echo """" +-echo ""Final GLIBC Requirement"" ++echo ""Final glibc Requirement"" + echo ""================================="" + if [ -f ""${tmpdir}/detect_glibc_highest.tmp"" ]; then + cat ""${tmpdir}/detect_glibc_highest.tmp"" | sort | uniq | sort -r --version-sort | head -1 + rm ""${tmpdir}/detect_glibc_highest.tmp"" + else +- fn_print_information_nl ""GLIBC is not required"" ++ fn_print_information_nl ""glibc is not required"" + fi + core_exit.sh +diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh +index 6aef2fca42..614b70817f 100644 +--- a/lgsm/functions/core_functions.sh ++++ b/lgsm/functions/core_functions.sh +@@ -322,12 +322,6 @@ functionfile=""${FUNCNAME}"" + fn_fetch_function + } + +-fix_glibc.sh(){ +-functionfile=""${FUNCNAME}"" +-fn_fetch_function +-} +- +- + fix_kf.sh(){ + functionfile=""${FUNCNAME}"" + fn_fetch_function +diff --git a/lgsm/functions/fix_glibc.sh b/lgsm/functions/fix_glibc.sh +deleted file mode 100644 +index b5da964dec..0000000000 +--- a/lgsm/functions/fix_glibc.sh ++++ /dev/null +@@ -1,69 +0,0 @@ +-#!/bin/bash +-# LinuxGSM fix_glibc.sh function +-# Author: Daniel Gibbs +-# Website: https://linuxgsm.com +-# Description: Downloads required Glibc files and applies the Glibc fix if required. +- +-local commandname=""FIX"" +-local commandaction=""Fix"" +-local function_selfname=""$(basename ""$(readlink -f ""${BASH_SOURCE[0]}"")"")"" +- +-## i386 +- +-# libstdc++.so.6 +-local libstdc_servers_array=( ""ARMA 3"" ""Blade Symphony"" ""Counter-Strike: Global Offensive"" ""Garry's Mod"" ""GoldenEye: Source"" ""Just Cause 2"" ""Team Fortress 2"" ) +-for libstdc_server in ""${libstdc_servers_array[@]}"" +-do +- if [ ""${gamename}"" == ""${libstdc_server}"" ]; then +- fn_fetch_file_github ""lgsm/lib/ubuntu12.04/i386"" ""libstdc++.so.6"" ""${lgsmdir}/lib"" ""nochmodx"" ""norun"" ""noforce"" ""nomd5"" +- fi +-done +- +-# libm.so.6 +-local libm_servers_array=( ""Black Mesa: Deathmatch"" ""Codename CURE"" ""Day of Infamy"" ""Double Action: Boogaloo"" ""Empires Mod"" ""Fistful of Frags"" ""Garry's Mod"" ""GoldenEye: Source"" ""Insurgency"" ""Natural Selection 2"" ""NS2: Combat"" ""No More Room in Hell"" ""Pirates, Vikings, and Knights II"" ""Team Fortress 2"" ) +-for libm_server in ""${libm_servers_array[@]}"" +-do +- if [ ""${gamename}"" == ""${libm_server}"" ]; then +- fn_fetch_file_github ""lgsm/lib/ubuntu12.04/i386"" ""libm.so.6"" ""${lgsmdir}/lib"" ""nochmodx"" ""norun"" ""noforce"" ""nomd5"" +- fi +-done +- +-# libc.so.6 +-local libc_servers_array=( ""Black Mesa: Deathmatch"" ""Blade Symphony"" ""Garry's Mod"" ""GoldenEye: Source"" ""Team Fortress 2"" ) +-for libc_server in ""${libc_servers_array[@]}"" +-do +- if [ ""${gamename}"" == ""${libc_server}"" ]; then +- fn_fetch_file_github ""lgsm/lib/ubuntu12.04/i386"" ""libc.so.6"" ""${lgsmdir}/lib"" ""nochmodx"" ""norun"" ""noforce"" ""nomd5"" +- fi +-done +- +-# libpthread.so.0 +-local libpthread_servers_array=( ""Black Mesa: Deathmatch"" ""Blade Symphony"" ""Garry's Mod"" ) +-for libpthread_server in ""${libpthread_servers_array[@]}"" +-do +- if [ ""${gamename}"" == ""${libpthread_server}"" ]; then +- fn_fetch_file_github ""lgsm/lib/ubuntu12.04/i386"" ""libpthread.so.0"" ""${lgsmdir}/lib"" ""nochmodx"" ""norun"" ""noforce"" ""nomd5"" +- fi +-done +- +-## amd64 +- +-# libm.so.6 +-local libm_servers_array=( ""Factorio"" ) +-for libm_server in ""${libm_servers_array[@]}"" +-do +- if [ ""${gamename}"" == ""${libm_server}"" ]; then +- fn_fetch_file_github ""lgsm/lib/ubuntu12.04/amd64"" ""libm.so.6"" ""${lgsmdir}/lib"" ""nochmodx"" ""norun"" ""noforce"" ""nomd5"" +- fi +-done +- +-# libc.so.6 +-local libc_servers_array=( ""Factorio"" ) +-for libc_server in ""${libc_servers_array[@]}"" +-do +- if [ ""${gamename}"" == ""${libc_server}"" ]; then +- fn_fetch_file_github ""lgsm/lib/ubuntu12.04/amd64"" ""libc.so.6"" ""${lgsmdir}/lib"" ""nochmodx"" ""norun"" ""noforce"" ""nomd5"" +- fi +-done +- +-export LD_LIBRARY_PATH=:""${libdir}"" +\ No newline at end of file +diff --git a/lgsm/functions/info_glibc.sh b/lgsm/functions/info_glibc.sh +index d383daab69..412688973f 100644 +--- a/lgsm/functions/info_glibc.sh ++++ b/lgsm/functions/info_glibc.sh +@@ -212,7 +212,7 @@ else + glibcfix=""no"" + fi + +-# Sets the SteamCMD GLIBC requirement if the game server requirement is less or not required. ++# Sets the SteamCMD glibc requirement if the game server requirement is less or not required. + if [ -n ""${appid}"" ]; then + if [ ""${glibcrequired}"" = ""NOT REQUIRED"" ]||[ -z ""${glibcrequired}"" ]||[ ""$(printf '%s\n'${glibcrequired}'\n' ""2.14"" | sort -V | head -n 1)"" != ""2.14"" ]; then + glibcrequired=""2.14"" +diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh +index 24821c9cd9..db73b5a854 100644 +--- a/lgsm/functions/info_messages.sh ++++ b/lgsm/functions/info_messages.sh +@@ -40,7 +40,7 @@ fn_info_message_distro(){ + # Kernel: 3.13.0-79-generic + # Hostname: hostname + # tmux: tmux 1.8 +- # GLIBC: 2.19 ++ # glibc: 2.19 + + echo -e """" + echo -e ""${lightyellow}Distro Details${default}"" +@@ -51,7 +51,7 @@ fn_info_message_distro(){ + echo -e ""${blue}Kernel:\t${default}${kernel}"" + echo -e ""${blue}Hostname:\t${default}${HOSTNAME}"" + echo -e ""${blue}tmux:\t${default}${tmuxv}"" +- echo -e ""${blue}GLIBC:\t${default}${glibcversion}"" ++ echo -e ""${blue}glibc:\t${default}${glibcversion}"" + } | column -s $'\t' -t + } + +@@ -362,20 +362,16 @@ fn_info_message_script(){ + # User + echo -e ""${blue}User:\t${default}$(whoami)"" + +- # GLIBC required ++ # glibc required + if [ -n ""${glibcrequired}"" ]; then + if [ ""${glibcrequired}"" == ""NOT REQUIRED"" ]; then + : + elif [ ""${glibcrequired}"" == ""UNKNOWN"" ]; then +- echo -e ""${blue}GLIBC required:\t${red}${glibcrequired}"" ++ echo -e ""${blue}glibc required:\t${red}${glibcrequired}"" + elif [ ""$(printf '%s\n'${glibcrequired}'\n' ${glibcversion} | sort -V | head -n 1)"" != ""${glibcrequired}"" ]; then +- if [ ""${glibcfix}"" == ""yes"" ]; then +- echo -e ""${blue}GLIBC required:\t${red}${glibcrequired} ${default}(${green}Using GLIBC fix${default})"" +- else +- echo -e ""${blue}GLIBC required:\t${red}${glibcrequired} ${default}(${red}GLIBC version too old${default})"" +- fi ++ echo -e ""${blue}glibc required:\t${red}${glibcrequired} ${default}(${red}glibc distro version ${glibcversion} too old${default})"" + else +- echo -e ""${blue}GLIBC required:\t${green}${glibcrequired}${default}"" ++ echo -e ""${blue}glibc required:\t${green}${glibcrequired}${default}"" + fi + fi" +unleash,https://github.com/Unleash/unleash,661cbf2b917735ed5edbf643ad6c595db9fa758a,Gastón Fournier,2023-07-05 15:21:27,fix: some security vulnerabilities (#4143),"## About the changes +This should address:","fix: some security vulnerabilities (#4143) + +## About the changes +This should address: +https://github.com/Unleash/unleash/security/code-scanning/1, +https://github.com/Unleash/unleash/security/code-scanning/49 and +https://github.com/Unleash/unleash/security/code-scanning/52 + +Refs: +- +https://securitylab.github.com/research/github-actions-untrusted-input/ +- +https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS +- https://datatracker.ietf.org/doc/html/rfc5321#section-4.5.3.1.1 + +--------- + +Co-authored-by: Christopher Kolstad ","diff --git a/.github/workflows/notify_enterprise.yaml b/.github/workflows/notify_enterprise.yaml +index cedcb0aada59..e70d7c4303b8 100644 +--- a/.github/workflows/notify_enterprise.yaml ++++ b/.github/workflows/notify_enterprise.yaml +@@ -24,12 +24,6 @@ jobs: + + steps: + - uses: actions/checkout@v3 +- - run: | +- echo ""github.event.head_commit.committer.name: ${{ github.event.head_commit.committer.name }}"" +- echo ""github.event.head_commit.committer.email: ${{ github.event.head_commit.committer.email }}"" +- echo ""github.actor: ${{ github.actor }}"" +- echo ""github.event.commits[0].author.name ${{ github.event.commits[0].author.name }}"" +- echo ""github.event.commits[0].author.email ${{ github.event.commits[0].author.email }}"" + - name: Trigger sync + uses: actions/github-script@v6 + with: +diff --git a/src/lib/util/is-email.ts b/src/lib/util/is-email.ts +index b0be23895782..3f83a09fc893 100644 +--- a/src/lib/util/is-email.ts ++++ b/src/lib/util/is-email.ts +@@ -5,11 +5,19 @@ const matcher = + + /** + * Loosely validate an email address. ++ * Max length of an email address is 320 characters: 64 for the local part + 1 for the @ + ++ * 255 for the domain part. ++ * See https://datatracker.ietf.org/doc/html/rfc5321#section-4.5.3.1.1 ++ * ++ * Being a bit extra cautious here and limiting the max length to 500 characters, which prevents ++ * [Regular expression Denial of Service - ReDoS](https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS) attacks ++ * due to polynomial regular expression used on uncontrolled data. + * + * @param {string} string + * @return {boolean} + */ + function isEmail(value: string): boolean { ++ if (value.length > 500) return false; + return matcher.test(value); + }" +opendal,https://github.com/apache/opendal,c78b26e87302db061e7bfb1f83a05e3a7ded13d2,Xuanwo,2022-10-01 17:40:50,ci: Enable IPFS NoFecth to avoid networking timeout (#780),* ci: Enable IPFS NoFecth to avoid networking timeout,"ci: Enable IPFS NoFecth to avoid networking timeout (#780) + +* ci: Enable IPFS NoFecth to avoid networking timeout + +Signed-off-by: Xuanwo + +* Remove cron job + +Signed-off-by: Xuanwo + +* Retry ipfs 408 + +Signed-off-by: Xuanwo + +Signed-off-by: Xuanwo ","diff --git a/.github/workflows/service_test_ipfs.yml b/.github/workflows/service_test_ipfs.yml +index 23e010f39dce..1a2433986437 100644 +--- a/.github/workflows/service_test_ipfs.yml ++++ b/.github/workflows/service_test_ipfs.yml +@@ -9,9 +9,6 @@ on: + - main + paths-ignore: + - ""docs/**"" +- # Run this test every hour to keep our testdata warm in ipfs network. +- schedule: +- - cron: ""0 * * * *"" + + concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} +@@ -28,7 +25,10 @@ jobs: + with: + # ipfs v0.15 seems can't pass our tests, need investigate. + ipfs_version: ""v0.14.0"" +- run_daemon: true ++ - name: Start IPFS Daemon ++ run: | ++ ipfs config --json Gateway.NoFetch true ++ ipfs daemon & + - name: IPFS add speed up tests + run: ipfs add -r ./testdata + +diff --git a/src/services/ipfs/error.rs b/src/services/ipfs/error.rs +index 5420bebd1225..c701e46937f2 100644 +--- a/src/services/ipfs/error.rs ++++ b/src/services/ipfs/error.rs +@@ -35,6 +35,8 @@ pub fn parse_error(op: Operation, path: &str, er: ErrorResponse) -> Error { + | StatusCode::BAD_GATEWAY + | StatusCode::SERVICE_UNAVAILABLE + | StatusCode::GATEWAY_TIMEOUT => ErrorKind::Interrupted, ++ // IPFS Gateway will return `408 REQUEST_TIMEOUT` while `ipfs resolve -r` failed. ++ StatusCode::REQUEST_TIMEOUT => ErrorKind::Interrupted, + _ => ErrorKind::Other, + };" +go-ethereum,https://github.com/ethereum/go-ethereum,9bc97a5785d3d350a084b46fc77a8439b8dc533b,Péter Szilágyi,2016-11-09 03:25:39,build: NSIS based Windows installer (#3240),This commit adds support for creating Windows installers to ci.go,"build: NSIS based Windows installer (#3240) + +This commit adds support for creating Windows installers to ci.go","diff --git a/appveyor.yml b/appveyor.yml +index ef2731951832..03ffdca9da84 100644 +--- a/appveyor.yml ++++ b/appveyor.yml +@@ -1,39 +1,40 @@ + os: Visual Studio 2015 + + # Clone directly into GOPATH. +-clone_folder: c:\gopath\src\github.com\ethereum\go-ethereum ++clone_folder: C:\gopath\src\github.com\ethereum\go-ethereum + clone_depth: 5 + version: ""{branch}.{build}"" + environment: + global: +- GOPATH: c:\gopath ++ GOPATH: C:\gopath + CC: gcc.exe + matrix: + - GETH_ARCH: amd64 + MSYS2_ARCH: x86_64 + MSYS2_BITS: 64 + MSYSTEM: MINGW64 +- PATH: C:\msys64\mingw64\bin\;%PATH% ++ PATH: C:\msys64\mingw64\bin\;C:\Program Files (x86)\NSIS\;%PATH% + - GETH_ARCH: 386 + MSYS2_ARCH: i686 + MSYS2_BITS: 32 + MSYSTEM: MINGW32 +- PATH: C:\msys64\mingw32\bin\;%PATH% ++ PATH: C:\msys64\mingw32\bin\;C:\Program Files (x86)\NSIS\;%PATH% + + install: +- - rmdir c:\go /s /q ++ - rmdir C:\go /s /q + - appveyor DownloadFile https://storage.googleapis.com/golang/go1.7.3.windows-amd64.zip + - 7z x go1.7.3.windows-amd64.zip -y -oC:\ > NUL + - go version + - gcc --version + + build_script: +- - go run build\\ci.go install -arch %GETH_ARCH% ++ - go run build\ci.go install -arch %GETH_ARCH% + + after_build: +- - go run build\\ci.go archive -arch %GETH_ARCH% -type zip -signer WINDOWS_SIGNING_KEY -upload gethstore/builds ++ - go run build\ci.go archive -arch %GETH_ARCH% -type zip -signer WINDOWS_SIGNING_KEY -upload gethstore/builds ++ - go run build\ci.go nsis -arch %GETH_ARCH% -signer WINDOWS_SIGNING_KEY -upload gethstore/builds + + test_script: + - set GOARCH=%GETH_ARCH% + - set CGO_ENABLED=1 +- - go run build\\ci.go test -vet -coverage ++ - go run build\ci.go test -vet -coverage +diff --git a/build/ci.go b/build/ci.go +index 2c6e918a6ab7..f5ef54b7545d 100644 +--- a/build/ci.go ++++ b/build/ci.go +@@ -28,6 +28,7 @@ Available commands are: + archive [-arch architecture] [ -type zip|tar ] [ -signer key-envvar ] [ -upload dest ] -- archives build artefacts + importkeys -- imports signing keys from env + debsrc [ -signer key-id ] [ -upload dest ] -- creates a debian source package ++ nsis -- creates a Windows NSIS installer + xgo [ options ] -- cross builds according to options + + For all commands, -n prevents execution of external programs (dry run mode). +@@ -122,6 +123,8 @@ func main() { + doArchive(os.Args[2:]) + case ""debsrc"": + doDebianSource(os.Args[2:]) ++ case ""nsis"": ++ doWindowsInstaller(os.Args[2:]) + case ""xgo"": + doXgo(os.Args[2:]) + default: +@@ -429,7 +432,7 @@ func makeWorkdir(wdflag string) string { + if wdflag != """" { + err = os.MkdirAll(wdflag, 0744) + } else { +- wdflag, err = ioutil.TempDir("""", ""eth-deb-build-"") ++ wdflag, err = ioutil.TempDir("""", ""geth-build-"") + } + if err != nil { + log.Fatal(err) +@@ -559,6 +562,76 @@ func stageDebianSource(tmpdir string, meta debMetadata) (pkgdir string) { + return pkgdir + } + ++// Windows installer ++ ++func doWindowsInstaller(cmdline []string) { ++ // Parse the flags and make skip installer generation on PRs ++ var ( ++ arch = flag.String(""arch"", runtime.GOARCH, ""Architecture for cross build packaging"") ++ signer = flag.String(""signer"", """", `Environment variable holding the signing key (e.g. WINDOWS_SIGNING_KEY)`) ++ upload = flag.String(""upload"", """", `Destination to upload the archives (usually ""gethstore/builds"")`) ++ workdir = flag.String(""workdir"", """", `Output directory for packages (uses temp dir if unset)`) ++ ) ++ flag.CommandLine.Parse(cmdline) ++ *workdir = makeWorkdir(*workdir) ++ env := build.Env() ++ maybeSkipArchive(env) ++ ++ // Aggregate binaries that are included in the installer ++ var ( ++ devTools []string ++ allTools []string ++ gethTool string ++ ) ++ for _, file := range allToolsArchiveFiles { ++ if file == ""COPYING"" { // license, copied later ++ continue ++ } ++ allTools = append(allTools, filepath.Base(file)) ++ if filepath.Base(file) == ""geth.exe"" { ++ gethTool = file ++ } else { ++ devTools = append(devTools, file) ++ } ++ } ++ ++ // Render NSIS scripts: Installer NSIS contains two installer sections, ++ // first section contains the geth binary, second section holds the dev tools. ++ templateData := map[string]interface{}{ ++ ""License"": ""COPYING"", ++ ""Geth"": gethTool, ++ ""DevTools"": devTools, ++ } ++ build.Render(""build/nsis.geth.nsi"", filepath.Join(*workdir, ""geth.nsi""), 0644, nil) ++ build.Render(""build/nsis.install.nsh"", filepath.Join(*workdir, ""install.nsh""), 0644, templateData) ++ build.Render(""build/nsis.uninstall.nsh"", filepath.Join(*workdir, ""uninstall.nsh""), 0644, allTools) ++ build.Render(""build/nsis.envvarupdate.nsh"", filepath.Join(*workdir, ""EnvVarUpdate.nsh""), 0644, nil) ++ build.CopyFile(filepath.Join(*workdir, ""SimpleFC.dll""), ""build/nsis.simplefc.dll"", 0755) ++ build.CopyFile(filepath.Join(*workdir, ""COPYING""), ""COPYING"", 0755) ++ ++ // Build the installer. This assumes that all the needed files have been previously ++ // built (don't mix building and packaging to keep cross compilation complexity to a ++ // minimum). ++ version := strings.Split(build.VERSION(), ""."") ++ if env.Commit != """" { ++ version[2] += ""-"" + env.Commit[:8] ++ } ++ installer, _ := filepath.Abs(""geth-"" + archiveBasename(*arch, env) + "".exe"") ++ build.MustRunCommand(""makensis.exe"", ++ ""/DOUTPUTFILE=""+installer, ++ ""/DMAJORVERSION=""+version[0], ++ ""/DMINORVERSION=""+version[1], ++ ""/DBUILDVERSION=""+version[2], ++ ""/DARCH=""+*arch, ++ filepath.Join(*workdir, ""geth.nsi""), ++ ) ++ ++ // Sign and publish installer. ++ if err := archiveUpload(installer, *upload, *signer); err != nil { ++ log.Fatal(err) ++ } ++} ++ + // Cross compilation + + func doXgo(cmdline []string) { +diff --git a/build/nsis.envvarupdate.nsh b/build/nsis.envvarupdate.nsh +new file mode 100644 +index 000000000000..9c3ecbe3372f +--- /dev/null ++++ b/build/nsis.envvarupdate.nsh +@@ -0,0 +1,327 @@ ++/** ++ * EnvVarUpdate.nsh ++ * : Environmental Variables: append, prepend, and remove entries ++ * ++ * WARNING: If you use StrFunc.nsh header then include it before this file ++ * with all required definitions. This is to avoid conflicts ++ * ++ * Usage: ++ * ${EnvVarUpdate} ""ResultVar"" ""EnvVarName"" ""Action"" ""RegLoc"" ""PathString"" ++ * ++ * Credits: ++ * Version 1.0 ++ * * Cal Turney (turnec2) ++ * * Amir Szekely (KiCHiK) and e-circ for developing the forerunners of this ++ * function: AddToPath, un.RemoveFromPath, AddToEnvVar, un.RemoveFromEnvVar, ++ * WriteEnvStr, and un.DeleteEnvStr ++ * * Diego Pedroso (deguix) for StrTok ++ * * Kevin English (kenglish_hi) for StrContains ++ * * Hendri Adriaens (Smile2Me), Diego Pedroso (deguix), and Dan Fuhry ++ * (dandaman32) for StrReplace ++ * ++ * Version 1.1 (compatibility with StrFunc.nsh) ++ * * techtonik ++ * ++ * http://nsis.sourceforge.net/Environmental_Variables:_append%2C_prepend%2C_and_remove_entries ++ * ++ */ ++ ++ ++!ifndef ENVVARUPDATE_FUNCTION ++!define ENVVARUPDATE_FUNCTION ++!verbose push ++!verbose 3 ++!include ""LogicLib.nsh"" ++!include ""WinMessages.NSH"" ++!include ""StrFunc.nsh"" ++ ++; ---- Fix for conflict if StrFunc.nsh is already includes in main file ----------------------- ++!macro _IncludeStrFunction StrFuncName ++ !ifndef ${StrFuncName}_INCLUDED ++ ${${StrFuncName}} ++ !endif ++ !ifndef Un${StrFuncName}_INCLUDED ++ ${Un${StrFuncName}} ++ !endif ++ !define un.${StrFuncName} ""${Un${StrFuncName}}"" ++!macroend ++ ++!insertmacro _IncludeStrFunction StrTok ++!insertmacro _IncludeStrFunction StrStr ++!insertmacro _IncludeStrFunction StrRep ++ ++; ---------------------------------- Macro Definitions ---------------------------------------- ++!macro _EnvVarUpdateConstructor ResultVar EnvVarName Action Regloc PathString ++ Push ""${EnvVarName}"" ++ Push ""${Action}"" ++ Push ""${RegLoc}"" ++ Push ""${PathString}"" ++ Call EnvVarUpdate ++ Pop ""${ResultVar}"" ++!macroend ++!define EnvVarUpdate '!insertmacro ""_EnvVarUpdateConstructor""' ++ ++!macro _unEnvVarUpdateConstructor ResultVar EnvVarName Action Regloc PathString ++ Push ""${EnvVarName}"" ++ Push ""${Action}"" ++ Push ""${RegLoc}"" ++ Push ""${PathString}"" ++ Call un.EnvVarUpdate ++ Pop ""${ResultVar}"" ++!macroend ++!define un.EnvVarUpdate '!insertmacro ""_unEnvVarUpdateConstructor""' ++; ---------------------------------- Macro Definitions end------------------------------------- ++ ++;----------------------------------- EnvVarUpdate start---------------------------------------- ++!define hklm_all_users 'HKLM ""SYSTEM\CurrentControlSet\Control\Session Manager\Environment""' ++!define hkcu_current_user 'HKCU ""Environment""' ++ ++!macro EnvVarUpdate UN ++ ++Function ${UN}EnvVarUpdate ++ ++ Push $0 ++ Exch 4 ++ Exch $1 ++ Exch 3 ++ Exch $2 ++ Exch 2 ++ Exch $3 ++ Exch ++ Exch $4 ++ Push $5 ++ Push $6 ++ Push $7 ++ Push $8 ++ Push $9 ++ Push $R0 ++ ++ /* After this point: ++ ------------------------- ++ $0 = ResultVar (returned) ++ $1 = EnvVarName (input) ++ $2 = Action (input) ++ $3 = RegLoc (input) ++ $4 = PathString (input) ++ $5 = Orig EnvVar (read from registry) ++ $6 = Len of $0 (temp) ++ $7 = tempstr1 (temp) ++ $8 = Entry counter (temp) ++ $9 = tempstr2 (temp) ++ $R0 = tempChar (temp) */ ++ ++ ; Step 1: Read contents of EnvVarName from RegLoc ++ ; ++ ; Check for empty EnvVarName ++ ${If} $1 == """" ++ SetErrors ++ DetailPrint ""ERROR: EnvVarName is blank"" ++ Goto EnvVarUpdate_Restore_Vars ++ ${EndIf} ++ ++ ; Check for valid Action ++ ${If} $2 != ""A"" ++ ${AndIf} $2 != ""P"" ++ ${AndIf} $2 != ""R"" ++ SetErrors ++ DetailPrint ""ERROR: Invalid Action - must be A, P, or R"" ++ Goto EnvVarUpdate_Restore_Vars ++ ${EndIf} ++ ++ ${If} $3 == HKLM ++ ReadRegStr $5 ${hklm_all_users} $1 ; Get EnvVarName from all users into $5 ++ ${ElseIf} $3 == HKCU ++ ReadRegStr $5 ${hkcu_current_user} $1 ; Read EnvVarName from current user into $5 ++ ${Else} ++ SetErrors ++ DetailPrint 'ERROR: Action is [$3] but must be ""HKLM"" or HKCU""' ++ Goto EnvVarUpdate_Restore_Vars ++ ${EndIf} ++ ++ ; Check for empty PathString ++ ${If} $4 == """" ++ SetErrors ++ DetailPrint ""ERROR: PathString is blank"" ++ Goto EnvVarUpdate_Restore_Vars ++ ${EndIf} ++ ++ ; Make sure we've got some work to do ++ ${If} $5 == """" ++ ${AndIf} $2 == ""R"" ++ SetErrors ++ DetailPrint ""$1 is empty - Nothing to remove"" ++ Goto EnvVarUpdate_Restore_Vars ++ ${EndIf} ++ ++ ; Step 2: Scrub EnvVar ++ ; ++ StrCpy $0 $5 ; Copy the contents to $0 ++ ; Remove spaces around semicolons (NOTE: spaces before the 1st entry or ++ ; after the last one are not removed here but instead in Step 3) ++ ${If} $0 != """" ; If EnvVar is not empty ... ++ ${Do} ++ ${${UN}StrStr} $7 $0 "" ;"" ++ ${If} $7 == """" ++ ${ExitDo} ++ ${EndIf} ++ ${${UN}StrRep} $0 $0 "" ;"" "";"" ; Remove ';' ++ ${Loop} ++ ${Do} ++ ${${UN}StrStr} $7 $0 ""; "" ++ ${If} $7 == """" ++ ${ExitDo} ++ ${EndIf} ++ ${${UN}StrRep} $0 $0 ""; "" "";"" ; Remove ';' ++ ${Loop} ++ ${Do} ++ ${${UN}StrStr} $7 $0 "";;"" ++ ${If} $7 == """" ++ ${ExitDo} ++ ${EndIf} ++ ${${UN}StrRep} $0 $0 "";;"" "";"" ++ ${Loop} ++ ++ ; Remove a leading or trailing semicolon from EnvVar ++ StrCpy $7 $0 1 0 ++ ${If} $7 == "";"" ++ StrCpy $0 $0 """" 1 ; Change ';' to '' ++ ${EndIf} ++ StrLen $6 $0 ++ IntOp $6 $6 - 1 ++ StrCpy $7 $0 1 $6 ++ ${If} $7 == "";"" ++ StrCpy $0 $0 $6 ; Change ';' to '' ++ ${EndIf} ++ ; DetailPrint ""Scrubbed $1: [$0]"" ; Uncomment to debug ++ ${EndIf} ++ ++ /* Step 3. Remove all instances of the target path/string (even if ""A"" or ""P"") ++ $6 = bool flag (1 = found and removed PathString) ++ $7 = a string (e.g. path) delimited by semicolon(s) ++ $8 = entry counter starting at 0 ++ $9 = copy of $0 ++ $R0 = tempChar */ ++ ++ ${If} $5 != """" ; If EnvVar is not empty ... ++ StrCpy $9 $0 ++ StrCpy $0 """" ++ StrCpy $8 0 ++ StrCpy $6 0 ++ ++ ${Do} ++ ${${UN}StrTok} $7 $9 "";"" $8 ""0"" ; $7 = next entry, $8 = entry counter ++ ++ ${If} $7 == """" ; If we've run out of entries, ++ ${ExitDo} ; were done ++ ${EndIf} ; ++ ++ ; Remove leading and trailing spaces from this entry (critical step for Action=Remove) ++ ${Do} ++ StrCpy $R0 $7 1 ++ ${If} $R0 != "" "" ++ ${ExitDo} ++ ${EndIf} ++ StrCpy $7 $7 """" 1 ; Remove leading space ++ ${Loop} ++ ${Do} ++ StrCpy $R0 $7 1 -1 ++ ${If} $R0 != "" "" ++ ${ExitDo} ++ ${EndIf} ++ StrCpy $7 $7 -1 ; Remove trailing space ++ ${Loop} ++ ${If} $7 == $4 ; If string matches, remove it by not appending it ++ StrCpy $6 1 ; Set 'found' flag ++ ${ElseIf} $7 != $4 ; If string does NOT match ++ ${AndIf} $0 == """" ; and the 1st string being added to $0, ++ StrCpy $0 $7 ; copy it to $0 without a prepended semicolon ++ ${ElseIf} $7 != $4 ; If string does NOT match ++ ${AndIf} $0 != """" ; and this is NOT the 1st string to be added to $0, ++ StrCpy $0 $0;$7 ; append path to $0 with a prepended semicolon ++ ${EndIf} ; ++ ++ IntOp $8 $8 + 1 ; Bump counter ++ ${Loop} ; Check for duplicates until we run out of paths ++ ${EndIf} ++ ++ ; Step 4: Perform the requested Action ++ ; ++ ${If} $2 != ""R"" ; If Append or Prepend ++ ${If} $6 == 1 ; And if we found the target ++ DetailPrint ""Target is already present in $1. It will be removed and"" ++ ${EndIf} ++ ${If} $0 == """" ; If EnvVar is (now) empty ++ StrCpy $0 $4 ; just copy PathString to EnvVar ++ ${If} $6 == 0 ; If found flag is either 0 ++ ${OrIf} $6 == """" ; or blank (if EnvVarName is empty) ++ DetailPrint ""$1 was empty and has been updated with the target"" ++ ${EndIf} ++ ${ElseIf} $2 == ""A"" ; If Append (and EnvVar is not empty), ++ StrCpy $0 $0;$4 ; append PathString ++ ${If} $6 == 1 ++ DetailPrint ""appended to $1"" ++ ${Else} ++ DetailPrint ""Target was appended to $1"" ++ ${EndIf} ++ ${Else} ; If Prepend (and EnvVar is not empty), ++ StrCpy $0 $4;$0 ; prepend PathString ++ ${If} $6 == 1 ++ DetailPrint ""prepended to $1"" ++ ${Else} ++ DetailPrint ""Target was prepended to $1"" ++ ${EndIf} ++ ${EndIf} ++ ${Else} ; If Action = Remove ++ ${If} $6 == 1 ; and we found the target ++ DetailPrint ""Target was found and removed from $1"" ++ ${Else} ++ DetailPrint ""Target was NOT found in $1 (nothing to remove)"" ++ ${EndIf} ++ ${If} $0 == """" ++ DetailPrint ""$1 is now empty"" ++ ${EndIf} ++ ${EndIf} ++ ++ ; Step 5: Update the registry at RegLoc with the updated EnvVar and announce the change ++ ; ++ ClearErrors ++ ${If} $3 == HKLM ++ WriteRegExpandStr ${hklm_all_users} $1 $0 ; Write it in all users section ++ ${ElseIf} $3 == HKCU ++ WriteRegExpandStr ${hkcu_current_user} $1 $0 ; Write it to current user section ++ ${EndIf} ++ ++ IfErrors 0 +4 ++ MessageBox MB_OK|MB_ICONEXCLAMATION ""Could not write updated $1 to $3"" ++ DetailPrint ""Could not write updated $1 to $3"" ++ Goto EnvVarUpdate_Restore_Vars ++ ++ ; ""Export"" our change ++ SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 ""STR:Environment"" /TIMEOUT=5000 ++ ++ EnvVarUpdate_Restore_Vars: ++ ; ++ ; Restore the user's variables and return ResultVar ++ Pop $R0 ++ Pop $9 ++ Pop $8 ++ Pop $7 ++ Pop $6 ++ Pop $5 ++ Pop $4 ++ Pop $3 ++ Pop $2 ++ Pop $1 ++ Push $0 ; Push my $0 (ResultVar) ++ Exch ++ Pop $0 ; Restore his $0 ++ ++FunctionEnd ++ ++!macroend ; EnvVarUpdate UN ++!insertmacro EnvVarUpdate """" ++!insertmacro EnvVarUpdate ""un."" ++;----------------------------------- EnvVarUpdate end---------------------------------------- ++ ++!verbose pop ++!endif +\ No newline at end of file +diff --git a/build/nsis.geth.nsi b/build/nsis.geth.nsi +new file mode 100644 +index 000000000000..dbeb9319c9c3 +--- /dev/null ++++ b/build/nsis.geth.nsi +@@ -0,0 +1,65 @@ ++# Builds a Windows installer with NSIS. ++# It expects the following command line arguments: ++# - OUTPUTFILE, filename of the installer (without extension) ++# - MAJORVERSION, major build version ++# - MINORVERSION, minor build version ++# - BUILDVERSION, build id version ++# ++# The created installer executes the following steps: ++# 1. install geth for all users ++# 2. install optional development tools such as abigen ++# 3. create an uninstaller ++# 4. configures the Windows firewall for geth ++# 5. create geth, attach and uninstall start menu entries ++# 6. configures the registry that allows Windows to manage the package through its platform tools ++# 7. adds the environment system wide variable ETHEREUM_SOCKET ++# 8. adds the install directory to %PATH% ++# ++# Requirements: ++# - NSIS, http://nsis.sourceforge.net/Main_Page ++# - SFP, http://nsis.sourceforge.net/NSIS_Simple_Firewall_Plugin (put dll in NSIS\Plugins\x86-ansi) ++# ++# based on: http://nsis.sourceforge.net/A_simple_installer_with_start_menu_shortcut_and_uninstaller ++# ++# TODO: ++# - sign installer ++CRCCheck on ++ ++!define GROUPNAME ""Ethereum"" ++!define APPNAME ""Geth"" ++!define DESCRIPTION ""Official Go implementation of the Ethereum protocol"" ++!addplugindir .\ ++ ++# Require admin rights on NT6+ (When UAC is turned on) ++RequestExecutionLevel admin ++ ++# Use LZMA compression ++SetCompressor /SOLID lzma ++ ++!include LogicLib.nsh ++!include EnvVarUpdate.nsh ++ ++!macro VerifyUserIsAdmin ++UserInfo::GetAccountType ++pop $0 ++${If} $0 != ""admin"" # Require admin rights on NT4+ ++ messageBox mb_iconstop ""Administrator rights required!"" ++ setErrorLevel 740 # ERROR_ELEVATION_REQUIRED ++ quit ++${EndIf} ++!macroend ++ ++function .onInit ++ # make vars are global for all users since geth is installed global ++ setShellVarContext all ++ !insertmacro VerifyUserIsAdmin ++ ++ ${If} ${ARCH} == ""amd64"" ++ StrCpy $InstDir ""$PROGRAMFILES64\${APPNAME}"" ++ ${Else} ++ StrCpy $InstDir ""$PROGRAMFILES32\${APPNAME}"" ++ ${Endif} ++functionEnd ++ ++!include install.nsh ++!include uninstall.nsh +diff --git a/build/nsis.install.nsh b/build/nsis.install.nsh +new file mode 100644 +index 000000000000..f9ad8e95e1ec +--- /dev/null ++++ b/build/nsis.install.nsh +@@ -0,0 +1,102 @@ ++Name ""geth ${MAJORVERSION}.${MINORVERSION}.${BUILDVERSION}"" # VERSION variables set through command line arguments ++InstallDir ""$InstDir"" ++OutFile ""${OUTPUTFILE}"" # set through command line arguments ++ ++# Links for ""Add/Remove Programs"" ++!define HELPURL ""https://github.com/ethereum/go-ethereum/issues"" ++!define UPDATEURL ""https://github.com/ethereum/go-ethereum/releases"" ++!define ABOUTURL ""https://github.com/ethereum/go-ethereum#ethereum-go"" ++!define /date NOW ""%Y%m%d"" ++ ++PageEx license ++ LicenseData {{.License}} ++PageExEnd ++ ++# Install geth binary ++Section ""Geth"" GETH_IDX ++ SetOutPath $INSTDIR ++ file {{.Geth}} ++ ++ # Create start menu launcher ++ createDirectory ""$SMPROGRAMS\${APPNAME}"" ++ createShortCut ""$SMPROGRAMS\${APPNAME}\${APPNAME}.lnk"" ""$INSTDIR\geth.exe"" ""--fast"" ""--cache=512"" ++ createShortCut ""$SMPROGRAMS\${APPNAME}\Attach.lnk"" ""$INSTDIR\geth.exe"" ""attach"" """" """" ++ createShortCut ""$SMPROGRAMS\${APPNAME}\Uninstall.lnk"" ""$INSTDIR\uninstall.exe"" """" """" """" ++ ++ # Firewall - remove rules (if exists) ++ SimpleFC::AdvRemoveRule ""Geth incoming peers (TCP:30303)"" ++ SimpleFC::AdvRemoveRule ""Geth outgoing peers (TCP:30303)"" ++ SimpleFC::AdvRemoveRule ""Geth UDP discovery (UDP:30303)"" ++ ++ # Firewall - add rules ++ SimpleFC::AdvAddRule ""Geth incoming peers (TCP:30303)"" """" 6 1 1 2147483647 1 ""$INSTDIR\geth.exe"" """" """" ""Ethereum"" 30303 """" """" """" ++ SimpleFC::AdvAddRule ""Geth outgoing peers (TCP:30303)"" """" 6 2 1 2147483647 1 ""$INSTDIR\geth.exe"" """" """" ""Ethereum"" """" 30303 """" """" ++ SimpleFC::AdvAddRule ""Geth UDP discovery (UDP:30303)"" """" 17 2 1 2147483647 1 ""$INSTDIR\geth.exe"" """" """" ""Ethereum"" """" 30303 """" """" ++ ++ # Set default IPC endpoint (https://github.com/ethereum/EIPs/issues/147) ++ ${EnvVarUpdate} $0 ""ETHEREUM_SOCKET"" ""R"" ""HKLM"" ""\\.\pipe\geth.ipc"" ++ ${EnvVarUpdate} $0 ""ETHEREUM_SOCKET"" ""A"" ""HKLM"" ""\\.\pipe\geth.ipc"" ++ ++ # Add geth to PATH ++ ${EnvVarUpdate} $0 ""PATH"" ""A"" ""HKLM"" $INSTDIR ++SectionEnd ++ ++# Install optional develop tools. ++Section /o ""Development tools"" DEV_TOOLS_IDX ++ SetOutPath $INSTDIR ++ {{range .DevTools}}file {{.}} ++ {{end}} ++SectionEnd ++ ++# Return on top of stack the total size (as DWORD) of the selected/installed sections. ++Var GetInstalledSize.total ++Function GetInstalledSize ++ StrCpy $GetInstalledSize.total 0 ++ ++ ${if} ${SectionIsSelected} ${GETH_IDX} ++ SectionGetSize ${GETH_IDX} $0 ++ IntOp $GetInstalledSize.total $GetInstalledSize.total + $0 ++ ${endif} ++ ++ ${if} ${SectionIsSelected} ${DEV_TOOLS_IDX} ++ SectionGetSize ${DEV_TOOLS_IDX} $0 ++ IntOp $GetInstalledSize.total $GetInstalledSize.total + $0 ++ ${endif} ++ ++ IntFmt $GetInstalledSize.total ""0x%08X"" $GetInstalledSize.total ++ Push $GetInstalledSize.total ++FunctionEnd ++ ++# Write registry, Windows uses these values in various tools such as add/remove program. ++# PowerShell: Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, InstallLocation, InstallDate | Format-Table –AutoSize ++function .onInstSuccess ++ # Save information in registry in HKEY_LOCAL_MACHINE branch, Windows add/remove functionality depends on this ++ WriteRegStr HKLM ""Software\Microsoft\Windows\CurrentVersion\Uninstall\${GROUPNAME} ${APPNAME}"" ""DisplayName"" ""${GROUPNAME} - ${APPNAME} - ${DESCRIPTION}"" ++ WriteRegStr HKLM ""Software\Microsoft\Windows\CurrentVersion\Uninstall\${GROUPNAME} ${APPNAME}"" ""UninstallString"" ""$\""$INSTDIR\uninstall.exe$\"""" ++ WriteRegStr HKLM ""Software\Microsoft\Windows\CurrentVersion\Uninstall\${GROUPNAME} ${APPNAME}"" ""QuietUninstallString"" ""$\""$INSTDIR\uninstall.exe$\"" /S"" ++ WriteRegStr HKLM ""Software\Microsoft\Windows\CurrentVersion\Uninstall\${GROUPNAME} ${APPNAME}"" ""InstallLocation"" ""$INSTDIR"" ++ WriteRegStr HKLM ""Software\Microsoft\Windows\CurrentVersion\Uninstall\${GROUPNAME} ${APPNAME}"" ""InstallDate"" ""${NOW}"" ++ # Wait for Alex ++ #WriteRegStr HKLM ""Software\Microsoft\Windows\CurrentVersion\Uninstall\${GROUPNAME} ${APPNAME}"" ""DisplayIcon"" ""$\""$INSTDIR\logo.ico$\"""" ++ WriteRegStr HKLM ""Software\Microsoft\Windows\CurrentVersion\Uninstall\${GROUPNAME} ${APPNAME}"" ""Publisher"" ""${GROUPNAME}"" ++ WriteRegStr HKLM ""Software\Microsoft\Windows\CurrentVersion\Uninstall\${GROUPNAME} ${APPNAME}"" ""HelpLink"" ""${HELPURL}"" ++ WriteRegStr HKLM ""Software\Microsoft\Windows\CurrentVersion\Uninstall\${GROUPNAME} ${APPNAME}"" ""URLUpdateInfo"" ""${UPDATEURL}"" ++ WriteRegStr HKLM ""Software\Microsoft\Windows\CurrentVersion\Uninstall\${GROUPNAME} ${APPNAME}"" ""URLInfoAbout"" ""${ABOUTURL}"" ++ WriteRegStr HKLM ""Software\Microsoft\Windows\CurrentVersion\Uninstall\${GROUPNAME} ${APPNAME}"" ""DisplayVersion"" ""${MAJORVERSION}.${MINORVERSION}.${BUILDVERSION}"" ++ WriteRegDWORD HKLM ""Software\Microsoft\Windows\CurrentVersion\Uninstall\${GROUPNAME} ${APPNAME}"" ""VersionMajor"" ${MAJORVERSION} ++ WriteRegDWORD HKLM ""Software\Microsoft\Windows\CurrentVersion\Uninstall\${GROUPNAME} ${APPNAME}"" ""VersionMinor"" ${MINORVERSION} ++ # There is no option for modifying or repairing the install ++ WriteRegDWORD HKLM ""Software\Microsoft\Windows\CurrentVersion\Uninstall\${GROUPNAME} ${APPNAME}"" ""NoModify"" 1 ++ WriteRegDWORD HKLM ""Software\Microsoft\Windows\CurrentVersion\Uninstall\${GROUPNAME} ${APPNAME}"" ""NoRepair"" 1 ++ ++ Call GetInstalledSize ++ Pop $0 ++ WriteRegDWORD HKLM ""Software\Microsoft\Windows\CurrentVersion\Uninstall\${GROUPNAME} ${APPNAME}"" ""EstimatedSize"" ""$0"" ++ ++ # Create uninstaller ++ writeUninstaller ""$INSTDIR\uninstall.exe"" ++functionEnd ++ ++Page components ++Page directory ++Page instfiles +diff --git a/build/nsis.simplefc.dll b/build/nsis.simplefc.dll +new file mode 100644 +index 000000000000..73b7d9634ded +Binary files /dev/null and b/build/nsis.simplefc.dll differ +diff --git a/build/nsis.simplefc.source.zip b/build/nsis.simplefc.source.zip +new file mode 100644 +index 000000000000..d7476022ad99 +Binary files /dev/null and b/build/nsis.simplefc.source.zip differ +diff --git a/build/nsis.uninstall.nsh b/build/nsis.uninstall.nsh +new file mode 100644 +index 000000000000..ea7d5e2981e6 +--- /dev/null ++++ b/build/nsis.uninstall.nsh +@@ -0,0 +1,32 @@ ++Section ""Uninstall"" ++ # uninstall for all users ++ setShellVarContext all ++ ++ # Delete (optionally) installed files ++ {{range $}}Delete $INSTDIR\{{.}} ++ {{end}} ++ Delete $INSTDIR\uninstall.exe ++ ++ # Delete install directory ++ rmDir $INSTDIR ++ ++ # Delete start menu launcher ++ Delete ""$SMPROGRAMS\${APPNAME}\${APPNAME}.lnk"" ++ Delete ""$SMPROGRAMS\${APPNAME}\Attach.lnk"" ++ Delete ""$SMPROGRAMS\${APPNAME}\Uninstall.lnk"" ++ rmDir ""$SMPROGRAMS\${APPNAME}"" ++ ++ # Firewall - remove rules if exists ++ SimpleFC::AdvRemoveRule ""Geth incoming peers (TCP:30303)"" ++ SimpleFC::AdvRemoveRule ""Geth outgoing peers (TCP:30303)"" ++ SimpleFC::AdvRemoveRule ""Geth UDP discovery (UDP:30303)"" ++ ++ # Remove IPC endpoint (https://github.com/ethereum/EIPs/issues/147) ++ ${un.EnvVarUpdate} $0 ""ETHEREUM_SOCKET"" ""R"" ""HKLM"" ""\\.\pipe\geth.ipc"" ++ ++ # Remove install directory from PATH ++ ${un.EnvVarUpdate} $0 ""PATH"" ""R"" ""HKLM"" $INSTDIR ++ ++ # Cleanup registry (deletes all sub keys) ++ DeleteRegKey HKLM ""Software\Microsoft\Windows\CurrentVersion\Uninstall\${GROUPNAME} ${APPNAME}"" ++SectionEnd +diff --git a/internal/build/util.go b/internal/build/util.go +index a821cd7f2320..ce17ce220be0 100644 +--- a/internal/build/util.go ++++ b/internal/build/util.go +@@ -20,6 +20,7 @@ import ( + ""bytes"" + ""flag"" + ""fmt"" ++ ""io"" + ""io/ioutil"" + ""log"" + ""os"" +@@ -117,3 +118,25 @@ func render(tpl *template.Template, outputFile string, outputPerm os.FileMode, x + log.Fatal(err) + } + } ++ ++// CopyFile copies a file. ++func CopyFile(dst, src string, mode os.FileMode) { ++ if err := os.MkdirAll(filepath.Dir(dst), 0755); err != nil { ++ log.Fatal(err) ++ } ++ destFile, err := os.OpenFile(dst, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, mode) ++ if err != nil { ++ log.Fatal(err) ++ } ++ defer destFile.Close() ++ ++ srcFile, err := os.Open(src) ++ if err != nil { ++ log.Fatal(err) ++ } ++ defer srcFile.Close() ++ ++ if _, err := io.Copy(destFile, srcFile); err != nil { ++ log.Fatal(err) ++ } ++}" +posthog,https://github.com/PostHog/posthog,480b9724dc9f5bb5ad6acc902abc122990b657bb,Harry Waye,2023-06-19 01:06:33,chore: simplify message size too large ingestion test (#16125),"We didn't need to test with so many events. And we add a check on the +DLQ just to make sure we actually did error out.","chore: simplify message size too large ingestion test (#16125) + +We didn't need to test with so many events. And we add a check on the +DLQ just to make sure we actually did error out.","diff --git a/plugin-server/functional_tests/analytics-ingestion/error-handling.test.ts b/plugin-server/functional_tests/analytics-ingestion/error-handling.test.ts +new file mode 100644 +index 0000000000000..5ecff26ad89c0 +--- /dev/null ++++ b/plugin-server/functional_tests/analytics-ingestion/error-handling.test.ts +@@ -0,0 +1,70 @@ ++import { Consumer, Kafka, KafkaMessage, logLevel } from 'kafkajs' ++ ++import { defaultConfig } from '../../src/config/config' ++import { UUIDT } from '../../src/utils/utils' ++import { capture, createOrganization, createTeam } from '../api' ++import { waitForExpect } from '../expectations' ++ ++let kafka: Kafka ++let organizationId: string ++ ++let dlq: KafkaMessage[] ++let dlqConsumer: Consumer ++ ++beforeAll(async () => { ++ kafka = new Kafka({ brokers: [defaultConfig.KAFKA_HOSTS], logLevel: logLevel.NOTHING }) ++ ++ dlq = [] ++ dlqConsumer = kafka.consumer({ groupId: 'events_plugin_ingestion_test' }) ++ await dlqConsumer.subscribe({ topic: 'events_plugin_ingestion_dlq', fromBeginning: true }) ++ await dlqConsumer.run({ ++ eachMessage: ({ message }) => { ++ dlq.push(message) ++ return Promise.resolve() ++ }, ++ }) ++ ++ organizationId = await createOrganization() ++}) ++ ++test.concurrent('consumer handles messages just less than 1MB gracefully', async () => { ++ // For this we basically want the plugin-server to try and produce a new ++ // message larger than 1MB. We do this by creating a person with a lot of ++ // properties. We will end up denormalizing the person properties onto the ++ // event, which already has the properties as $set therefore resulting in a ++ // message that's larger than 1MB. There may also be other attributes that ++ // are added to the event which pushes it over the limit. ++ // ++ // We verify that at least some error has happened by checking that there is ++ // a message in the DLQ. ++ const token = new UUIDT().toString() ++ const teamId = await createTeam(organizationId, undefined, token) ++ const distinctId = new UUIDT().toString() ++ ++ const personProperties = { ++ distinct_id: distinctId, ++ $set: {}, ++ } ++ ++ for (let i = 0; i < 10000; i++) { ++ personProperties.$set[new UUIDT().toString()] = new UUIDT().toString() ++ } ++ ++ const personEventUuid = new UUIDT().toString() ++ await capture({ ++ teamId, ++ distinctId, ++ uuid: personEventUuid, ++ event: '$identify', ++ properties: personProperties, ++ }) ++ ++ // Verify we have a message in the DLQ, along a Sentry event id in the ++ // header `sentry-event-id`. ++ const message = await waitForExpect(() => { ++ const [message] = dlq.filter((message) => message.headers?.['event-id']?.toString() === personEventUuid) ++ expect(message).toBeDefined() ++ return message ++ }) ++ expect(message.headers?.['sentry-event-id']).toBeDefined() ++}) +diff --git a/plugin-server/functional_tests/ingestion.test.ts b/plugin-server/functional_tests/analytics-ingestion/happy-path.test.ts +similarity index 92% +rename from plugin-server/functional_tests/ingestion.test.ts +rename to plugin-server/functional_tests/analytics-ingestion/happy-path.test.ts +index 132f503be6cb0..c8b3020c72d04 100644 +--- a/plugin-server/functional_tests/ingestion.test.ts ++++ b/plugin-server/functional_tests/analytics-ingestion/happy-path.test.ts +@@ -1,6 +1,6 @@ +-import { UUIDT } from '../src/utils/utils' +-import { capture, createOrganization, createTeam, fetchEvents, fetchPersons, getMetric } from './api' +-import { waitForExpect } from './expectations' ++import { UUIDT } from '../../src/utils/utils' ++import { capture, createOrganization, createTeam, fetchEvents, fetchPersons, getMetric } from '../api' ++import { waitForExpect } from '../expectations' + + let organizationId: string + +@@ -391,62 +391,6 @@ test.concurrent(`event ingestion: events without a team_id get processed correct + }) + }) + +-test.concurrent('consumer handles messages just less than 1MB gracefully', async () => { +- // For this we basically want the plugin-server to try and produce a new +- // message larger than 1MB. We can do this by sending two messages, one with +- // person_properties that are just under 1MB, and another event with +- // `properties` that are just under 1MB. The resulting message should be +- // larger than 1MB after denormalizing the person properties onto the event. +- // Note that we use compression when producing to Kafka, so we want to try +- // to produce a message that is just under 1MB *after* compression. To do +- // this we use random strings for keys and values which will hopefully be +- // incompressible. +- const teamId = await createTeam(organizationId) +- const distinctId = new UUIDT().toString() +- +- const personProperties = { +- distinct_id: distinctId, +- $set: {}, +- } +- +- for (let i = 0; i < 10000; i++) { +- personProperties.$set[new UUIDT().toString()] = new UUIDT().toString() +- } +- +- const personEventUuid = new UUIDT().toString() +- await capture({ +- teamId, +- distinctId, +- uuid: personEventUuid, +- event: '$identify', +- properties: personProperties, +- }) +- +- const eventProperties = { +- distinct_id: distinctId, +- } +- +- for (let i = 0; i < 10000; i++) { +- eventProperties[new UUIDT().toString()] = new UUIDT().toString() +- } +- +- const eventUuid = new UUIDT().toString() +- await capture({ teamId, distinctId, uuid: eventUuid, event: 'custom event', properties: eventProperties }) +- +- // Now push through an event that we think will get processed, with the same +- // distinct_id. We are relying on this event being processed in order to be +- // a good indicator that the processing hasn't stalled. +- const eventUuid2 = new UUIDT().toString() +- await capture({ teamId, distinctId, uuid: eventUuid2, event: 'custom event', properties: {} }) +- +- await waitForExpect(async () => { +- const [event] = await fetchEvents(teamId, eventUuid2) +- expect(event).toBeDefined() +- }) +- +- // TODO: verify we produce to the DLQ topic +-}) +- + test.concurrent('consumer updates timestamp exported to prometheus', async () => { + // NOTE: it may be another event other than the one we emit here that causes + // the gauge to increase, but pushing this event through should at least +diff --git a/plugin-server/src/main/ingestion-queues/batch-processing/each-batch-ingestion.ts b/plugin-server/src/main/ingestion-queues/batch-processing/each-batch-ingestion.ts +index e8ca23c66c6b2..27a43f7fb2923 100644 +--- a/plugin-server/src/main/ingestion-queues/batch-processing/each-batch-ingestion.ts ++++ b/plugin-server/src/main/ingestion-queues/batch-processing/each-batch-ingestion.ts +@@ -134,7 +134,14 @@ export async function eachBatchParallelIngestion( + await queue.pluginsServer.kafkaProducer.queueMessage({ + topic: KAFKA_EVENTS_PLUGIN_INGESTION_DLQ, + messages: [ +- { ...message, headers: { ...message.headers, 'sentry-event-id': sentryEventId } }, ++ { ++ ...message, ++ headers: { ++ ...message.headers, ++ 'sentry-event-id': sentryEventId, ++ 'event-id': pluginEvent.uuid, ++ }, ++ }, + ], + }) + } else {" +sentry,https://github.com/getsentry/sentry,40be8887f060dca4cb2212c55173ea348c855e2f,Ryan Albrecht,2022-12-06 02:05:48,perf: Do not clone api response objects so often in the js api client (#41893),"I noticed that the javascript API client is calling `clone()` an +unnecessarily number of times. This creates overhead to any api response +because the entire response payload is going to be cloned in memory in +order to create the new object. The perf impact of this is most obvious +when the response payload is large. + +Here's an example of how a large payload is handled: + +![SCR-20221130-d6v](https://user-images.githubusercontent.com/187460/204869370-1f56912e-74a6-4533-b751-8ab1fe1ed535.png) + +This flamechart ^ shows the cpu time spent processing a paginated api +response and then moving on to fetch the next page. The core +page-fetching loop is:","perf: Do not clone api response objects so often in the js api client (#41893) + +I noticed that the javascript API client is calling `clone()` an +unnecessarily number of times. This creates overhead to any api response +because the entire response payload is going to be cloned in memory in +order to create the new object. The perf impact of this is most obvious +when the response payload is large. + +Here's an example of how a large payload is handled: + +![SCR-20221130-d6v](https://user-images.githubusercontent.com/187460/204869370-1f56912e-74a6-4533-b751-8ab1fe1ed535.png) + +This flamechart ^ shows the cpu time spent processing a paginated api +response and then moving on to fetch the next page. The core +page-fetching loop is: + +https://github.com/getsentry/sentry/blob/cc28c9ff0f5692928ba40a8c9ff157abbedbc17e/static/app/utils/replays/hooks/useReplayData.tsx#L150-L159 + +We can see from the flamechart that most of the time is spent inside the +anonymous api response handler: + +https://github.com/getsentry/sentry/blob/62918c7873ca7415a0ff62174dfeef16a1a0bf9a/static/app/api.tsx#L453-L522 + + +After making the change we can zoom in again and look at how much CPU +time is spent between the 1st ajax response being returned, and the 2nd +page of data being requested: + + +![SCR-20221130-ds1](https://user-images.githubusercontent.com/187460/204874077-296c8eab-2418-4997-9447-74544b1096f8.png) + +This is most noticeable on this single request because of it's large +payload, but the gain compounds across all the ajax calls made on each +page. + +The profiles are from using `yarn dev-ui`, so the overall pageload times +are not representative of what we'll see in prod, but I believe this +kind of change won't be affected by webpack hot reload differences. + +References https://github.com/getsentry/sentry/issues/41792","diff --git a/static/app/__mocks__/api.tsx b/static/app/__mocks__/api.tsx +index 218fe086e144d8..286cd350e0c8e9 100644 +--- a/static/app/__mocks__/api.tsx ++++ b/static/app/__mocks__/api.tsx +@@ -122,30 +122,6 @@ class Client implements ApiNamespace.Client { + ...response, + headers: response.headers ?? {}, + getResponseHeader: (key: string) => response.headers?.[key] ?? null, +- rawResponse: { +- headers: new Headers(), +- ok: true, +- redirected: false, +- status: 200, +- statusText: 'OK', +- url: 'http://localhost', +- bodyUsed: false, +- body: { +- locked: false, +- cancel: jest.fn(), +- getReader: jest.fn(), +- pipeThrough: jest.fn(), +- pipeTo: jest.fn(), +- tee: jest.fn(), +- }, +- blob: jest.fn(), +- arrayBuffer: jest.fn(), +- json: jest.fn(), +- text: jest.fn(), +- formData: jest.fn(), +- clone: jest.fn(), +- type: 'basic', +- }, + }, + mock, + ]); +diff --git a/static/app/api.tsx b/static/app/api.tsx +index 2ceffc478f98d4..46fc7972013287 100644 +--- a/static/app/api.tsx ++++ b/static/app/api.tsx +@@ -48,10 +48,6 @@ export type ResponseMeta = { + * Get a header value from the response + */ + getResponseHeader: (header: string) => string | null; +- /** +- * The raw response +- */ +- rawResponse: Response; + /** + * The response body decoded from json + */ +@@ -463,7 +459,7 @@ export class Client { + + // Try to get text out of the response no matter the status + try { +- responseText = await response.clone().text(); ++ responseText = await response.text(); + } catch (error) { + ok = false; + if (error.name === 'AbortError') { +@@ -473,13 +469,13 @@ export class Client { + } + } + +- const responseContentType = response.clone().headers.get('content-type'); ++ const responseContentType = response.headers.get('content-type'); + const isResponseJSON = responseContentType?.includes('json'); + + const isStatus3XX = status >= 300 && status < 400; + if (status !== 204 && !isStatus3XX) { + try { +- responseJSON = await response.clone().json(); ++ responseJSON = JSON.parse(responseText); + } catch (error) { + if (error.name === 'AbortError') { + ok = false; +@@ -499,7 +495,6 @@ export class Client { + responseJSON, + responseText, + getResponseHeader: (header: string) => response.headers.get(header), +- rawResponse: response.clone(), + }; + + // Respect the response content-type header" +appsmith,https://github.com/appsmithorg/appsmith,ce2cf1ba3a327f7065e2dc7c431b09ee6ab836a7,Abhijeet,2022-02-15 16:28:02,fix: Fix error code for application controller test case(#11161),"* Fix error code for the application controller TCs + +* Fix import-export TCs","fix: Fix error code for application controller test case(#11161) + +* Fix error code for the application controller TCs + +* Fix import-export TCs","diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/ImportExportApplicationServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/ImportExportApplicationServiceCEImpl.java +index 44069ac37e04..129a7a0465d4 100644 +--- a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/ImportExportApplicationServiceCEImpl.java ++++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/ImportExportApplicationServiceCEImpl.java +@@ -499,7 +499,12 @@ public Mono extractFileAndSaveApplication(String orgId, Part filePa + ApplicationJson jsonFile = gson.fromJson(data, fileType); + return importApplicationInOrganization(orgId, jsonFile); + }) +- .onErrorResume(error -> Mono.error(new AppsmithException(AppsmithError.GENERIC_JSON_IMPORT_ERROR, orgId, error.getMessage()))); ++ .onErrorResume(error -> { ++ if (error instanceof AppsmithException) { ++ return Mono.error(error); ++ } ++ return Mono.error(new AppsmithException(AppsmithError.GENERIC_JSON_IMPORT_ERROR, orgId, error.getMessage())); ++ }); + + return Mono.create(sink -> importedApplicationMono + .subscribe(sink::success, sink::error, null, sink.currentContext()) +diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/controllers/ApplicationControllerTest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/controllers/ApplicationControllerTest.java +index 43fa23da853a..121a9e460176 100644 +--- a/app/server/appsmith-server/src/test/java/com/appsmith/server/controllers/ApplicationControllerTest.java ++++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/controllers/ApplicationControllerTest.java +@@ -94,7 +94,7 @@ public void whenFileUploadedWithLongHeader_thenVerifyErrorStatus() throws IOExce + "" \""status\"": 500,\n"" + + "" \""success\"": false,\n"" + + "" \""error\"": {\n"" + +- "" \""code\"": 5016,\n"" + ++ "" \""code\"": 5017,\n"" + + "" \""message\"": \""Failed to upload file with error: Part headers exceeded the memory usage limit of 131072 bytes\""\n"" + + "" }\n"" + + "" }\n"" +" +fluentui,https://github.com/microsoft/fluentui,816ce1e01693083e6e651f4b2f3912acc5dd6832,Charles Assunção,2021-03-29 22:23:53,feat(Pill): add PillImage and PillIcon component (#17600),"* feat(Pill): add PillImage component + +* feat(Pill): update image usage + +* feat(Pill): add changelog + +* feat(Pill): add PillIcon + +* feat(Pill): change example name + +* feat(Pill): reexport styles types + +* Update packages/fluentui/react-northstar/src/components/Pill/Pill.tsx","feat(Pill): add PillImage and PillIcon component (#17600) + +* feat(Pill): add PillImage component + +* feat(Pill): update image usage + +* feat(Pill): add changelog + +* feat(Pill): add PillIcon + +* feat(Pill): change example name + +* feat(Pill): reexport styles types + +* Update packages/fluentui/react-northstar/src/components/Pill/Pill.tsx + +Co-authored-by: Oleksandr Fediashov + +* Update packages/fluentui/react-northstar/src/components/Pill/Pill.tsx + +Co-authored-by: Oleksandr Fediashov + +Co-authored-by: Oleksandr Fediashov ","diff --git a/packages/fluentui/CHANGELOG.md b/packages/fluentui/CHANGELOG.md +index c10126087df0e..8fce9d52fd14d 100644 +--- a/packages/fluentui/CHANGELOG.md ++++ b/packages/fluentui/CHANGELOG.md +@@ -22,6 +22,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm + - Add `borderActive4` color slot @notandrew ([#17391](https://github.com/microsoft/fluentui/pull/17391)) + - Add `Pill` base componet @assuncaocharles ([#17500](https://github.com/microsoft/fluentui/pull/17500)) + - Add `PillAction` base componet @assuncaocharles ([#17548](https://github.com/microsoft/fluentui/pull/17548)) ++- Add `PillImage` base componet @assuncaocharles ([#17600](https://github.com/microsoft/fluentui/pull/17600)) ++- Add `PillIcon` base componet @assuncaocharles ([#17600](https://github.com/microsoft/fluentui/pull/17600)) + + ## Fixes + - Add success to AlertDismissAction propTypes @jurokapsiar ([#17542](https://github.com/microsoft/fluentui/pull/17542)) +diff --git a/packages/fluentui/docs/src/examples/components/Pill/Variations/PillExampleIcon.tsx b/packages/fluentui/docs/src/examples/components/Pill/Variations/PillExampleIcon.tsx +new file mode 100644 +index 0000000000000..5fd210b4cf7ec +--- /dev/null ++++ b/packages/fluentui/docs/src/examples/components/Pill/Variations/PillExampleIcon.tsx +@@ -0,0 +1,6 @@ ++import * as React from 'react'; ++import { Pill, CalendarIcon } from '@fluentui/react-northstar'; ++ ++const PillIconExample = () => }>Pill with Icon; ++ ++export default PillIconExample; +diff --git a/packages/fluentui/docs/src/examples/components/Pill/Variations/PillExampleImage.tsx b/packages/fluentui/docs/src/examples/components/Pill/Variations/PillExampleImage.tsx +new file mode 100644 +index 0000000000000..a9a342a105e35 +--- /dev/null ++++ b/packages/fluentui/docs/src/examples/components/Pill/Variations/PillExampleImage.tsx +@@ -0,0 +1,10 @@ ++import * as React from 'react'; ++import { Pill } from '@fluentui/react-northstar'; ++ ++const PillImageExample = () => ( ++ ++ Pill with image ++ ++); ++ ++export default PillImageExample; +diff --git a/packages/fluentui/docs/src/examples/components/Pill/Variations/index.tsx b/packages/fluentui/docs/src/examples/components/Pill/Variations/index.tsx +index 9c356c0a19f91..9736c7a0cb68e 100644 +--- a/packages/fluentui/docs/src/examples/components/Pill/Variations/index.tsx ++++ b/packages/fluentui/docs/src/examples/components/Pill/Variations/index.tsx +@@ -25,6 +25,16 @@ const Variations = () => ( + description=""A Pill can be actionable."" + examplePath=""components/Pill/Variations/PillExampleActionable"" + /> ++ ++ + + ); + +diff --git a/packages/fluentui/react-northstar/src/components/Pill/Pill.tsx b/packages/fluentui/react-northstar/src/components/Pill/Pill.tsx +index e4ed23e6812aa..15b07596dc8b7 100644 +--- a/packages/fluentui/react-northstar/src/components/Pill/Pill.tsx ++++ b/packages/fluentui/react-northstar/src/components/Pill/Pill.tsx +@@ -18,6 +18,8 @@ import { + } from '@fluentui/react-bindings'; + import { PillContent } from './PillContent'; + import { PillActionProps, PillAction } from './PillAction'; ++import { PillImageProps, PillImage } from './PillImage'; ++import { PillIcon, PillIconProps } from './PillIcon'; + + export interface PillProps extends UIComponentProps, ContentComponentProps> { + /** +@@ -55,6 +57,16 @@ export interface PillProps extends UIComponentProps, ContentComponentProps; + ++ /** ++ * A PillAction shorthand for the action slot. ++ */ ++ icon?: ShorthandValue; ++ ++ /** ++ * A PillImage shorthand for the image slot. ++ */ ++ image?: ShorthandValue; ++ + /** + * Called after user will dismiss the Pill. + * @param event - React's original SyntheticEvent. +@@ -89,6 +101,8 @@ export const Pill: ComponentWithAs<'span', PillProps> & FluentComponentStaticPro + disabled, + action, + actionable, ++ image, ++ icon, + } = props; + + const ElementType = getElementType(props); +@@ -133,6 +147,12 @@ export const Pill: ComponentWithAs<'span', PillProps> & FluentComponentStaticPro + ...unhandledProps, + })} + > ++ {createShorthand(PillImage, image, { ++ defaultProps: () => ({ size }), ++ })} ++ {createShorthand(PillIcon, icon, { ++ defaultProps: () => ({ size }), ++ })} + {createShorthand(PillContent, content || {}, { + defaultProps: () => ({ + children, +diff --git a/packages/fluentui/react-northstar/src/components/Pill/PillIcon.tsx b/packages/fluentui/react-northstar/src/components/Pill/PillIcon.tsx +new file mode 100644 +index 0000000000000..50c2185973636 +--- /dev/null ++++ b/packages/fluentui/react-northstar/src/components/Pill/PillIcon.tsx +@@ -0,0 +1,90 @@ ++import * as React from 'react'; ++import { Accessibility } from '@fluentui/accessibility'; ++import { ++ ComponentWithAs, ++ getElementType, ++ useUnhandledProps, ++ useAccessibility, ++ useFluentContext, ++ useStyles, ++ useTelemetry, ++} from '@fluentui/react-bindings'; ++import { ++ childrenExist, ++ UIComponentProps, ++ ChildrenComponentProps, ++ ContentComponentProps, ++ commonPropTypes, ++ rtlTextContainer, ++ SizeValue, ++} from '../../utils'; ++import { FluentComponentStaticProps } from '../../types'; ++ ++export interface PillIconProps extends UIComponentProps, ChildrenComponentProps, ContentComponentProps { ++ /** ++ * Accessibility behavior if overridden by the user. ++ */ ++ accessibility?: Accessibility; ++ ++ /** ++ * A Pill Icon can be sized. ++ */ ++ size?: Extract; ++} ++ ++export type PillIconStylesProps = Required>; ++export const pillIconClassName = 'ui-pill__icon'; ++ ++/** ++ * A PillIcon allows user set an icon. ++ */ ++export const PillIcon: ComponentWithAs<'div', PillIconProps> & FluentComponentStaticProps = props => { ++ const context = useFluentContext(); ++ const { setStart, setEnd } = useTelemetry(PillIcon.displayName, context.telemetry); ++ setStart(); ++ ++ const { accessibility, children, className, content, design, styles, variables, size } = props; ++ ++ const getA11Props = useAccessibility(accessibility, { ++ debugName: PillIcon.displayName, ++ rtl: context.rtl, ++ }); ++ ++ const { classes } = useStyles(PillIcon.displayName, { ++ className: pillIconClassName, ++ mapPropsToStyles: () => ({ size }), ++ mapPropsToInlineStyles: () => ({ className, design, styles, variables }), ++ rtl: context.rtl, ++ }); ++ ++ const ElementType = getElementType(props); ++ const unhandledProps = useUnhandledProps(PillIcon.handledProps, props); ++ ++ const element = ( ++ ++ {childrenExist(children) ? children : content} ++ ++ ); ++ ++ setEnd(); ++ ++ return element; ++}; ++ ++PillIcon.displayName = 'PillIcon'; ++ ++PillIcon.propTypes = { ++ ...commonPropTypes.createCommon(), ++}; ++ ++PillIcon.handledProps = Object.keys(PillIcon.propTypes) as any; ++ ++PillIcon.shorthandConfig = { ++ mappedProp: 'content', ++}; +diff --git a/packages/fluentui/react-northstar/src/components/Pill/PillImage.tsx b/packages/fluentui/react-northstar/src/components/Pill/PillImage.tsx +new file mode 100644 +index 0000000000000..0f8defa0d83d8 +--- /dev/null ++++ b/packages/fluentui/react-northstar/src/components/Pill/PillImage.tsx +@@ -0,0 +1,92 @@ ++import { Accessibility } from '@fluentui/accessibility'; ++import { ++ ComponentWithAs, ++ getElementType, ++ useUnhandledProps, ++ useAccessibility, ++ useFluentContext, ++ useStyles, ++ useTelemetry, ++} from '@fluentui/react-bindings'; ++import * as React from 'react'; ++ ++import { UIComponentProps, commonPropTypes, SizeValue } from '../../utils'; ++import { FluentComponentStaticProps } from '../../types'; ++ ++export interface PillImageProps extends UIComponentProps { ++ /** Accessibility behavior if overridden by the user. */ ++ accessibility?: Accessibility; ++ ++ /** ++ * A PillImage can be sized. ++ */ ++ size?: Extract; ++ ++ /** PillImage source URL. */ ++ src?: string; ++} ++ ++export type PillImageStylesProps = Required>; ++ ++export const pillImageClassName = 'ui-pill__image'; ++ ++/** ++ * An PillImage is a graphic representation used by Pill. ++ */ ++export const PillImage: ComponentWithAs<'img', PillImageProps> & FluentComponentStaticProps = props => { ++ const context = useFluentContext(); ++ ++ const { setStart, setEnd } = useTelemetry(PillImage.displayName, context.telemetry); ++ ++ setStart(); ++ ++ const { accessibility, className, design, styles, variables, size } = props; ++ ++ const getA11Props = useAccessibility(accessibility, { ++ debugName: PillImage.displayName, ++ rtl: context.rtl, ++ }); ++ ++ const { classes } = useStyles(PillImage.displayName, { ++ className: pillImageClassName, ++ mapPropsToStyles: () => ({ ++ size, ++ }), ++ mapPropsToInlineStyles: () => ({ ++ className, ++ design, ++ styles, ++ variables, ++ }), ++ rtl: context.rtl, ++ }); ++ ++ const ElementType = getElementType(props); ++ const unhandledProps = useUnhandledProps(PillImage.handledProps, props); ++ ++ const result = ; ++ ++ setEnd(); ++ ++ return result; ++}; ++ ++PillImage.displayName = 'PillImage'; ++ ++PillImage.defaultProps = { ++ as: 'img', ++}; ++ ++PillImage.propTypes = { ++ ...commonPropTypes.createCommon({ ++ children: false, ++ content: false, ++ }), ++}; ++ ++PillImage.handledProps = Object.keys(PillImage.propTypes) as any; ++ ++PillImage.shorthandConfig = { ++ mappedProp: 'src', ++ allowsJSX: false, ++}; +diff --git a/packages/fluentui/react-northstar/src/index.ts b/packages/fluentui/react-northstar/src/index.ts +index 23df5eff0b9e4..4eddd1dc4115b 100644 +--- a/packages/fluentui/react-northstar/src/index.ts ++++ b/packages/fluentui/react-northstar/src/index.ts +@@ -75,6 +75,8 @@ export * from './components/MenuButton/MenuButton'; + export * from './components/Pill/Pill'; + export * from './components/Pill/PillContent'; + export * from './components/Pill/PillAction'; ++export * from './components/Pill/PillImage'; ++export * from './components/Pill/PillIcon'; + + export * from './components/Divider/Divider'; + export * from './components/Divider/DividerContent'; +diff --git a/packages/fluentui/react-northstar/src/themes/teams/componentStyles.ts b/packages/fluentui/react-northstar/src/themes/teams/componentStyles.ts +index 3c74568651249..d8f6b2825744a 100644 +--- a/packages/fluentui/react-northstar/src/themes/teams/componentStyles.ts ++++ b/packages/fluentui/react-northstar/src/themes/teams/componentStyles.ts +@@ -100,6 +100,8 @@ export { menuButtonStyles as MenuButton } from './components/MenuButton/menuButt + export { pillStyles as Pill } from './components/Pill/pillStyles'; + export { pillContentStyles as PillContent } from './components/Pill/pillContentStyles'; + export { pillActionStyles as PillAction } from './components/Pill/pillActionStyles'; ++export { pillImageStyles as PillImage } from './components/Pill/pillImageStyles'; ++export { pillIconStyles as PillIcon } from './components/Pill/pillIconStyles'; + + export { popupContentStyles as PopupContent } from './components/Popup/popupContentStyles'; + +diff --git a/packages/fluentui/react-northstar/src/themes/teams/componentVariables.ts b/packages/fluentui/react-northstar/src/themes/teams/componentVariables.ts +index af1bf55610af1..0d240cd1d8d57 100644 +--- a/packages/fluentui/react-northstar/src/themes/teams/componentVariables.ts ++++ b/packages/fluentui/react-northstar/src/themes/teams/componentVariables.ts +@@ -93,6 +93,8 @@ export { menuDividerVariables as MenuDivider } from './components/Menu/menuDivid + export { pillVariables as Pill } from './components/Pill/pillVariables'; + export { pillVariables as PillContent } from './components/Pill/pillVariables'; + export { pillVariables as PillAction } from './components/Pill/pillVariables'; ++export { pillVariables as PillImage } from './components/Pill/pillVariables'; ++export { pillVariables as PillIcon } from './components/Pill/pillVariables'; + + export { popupContentVariables as PopupContent } from './components/Popup/popupContentVariables'; + +diff --git a/packages/fluentui/react-northstar/src/themes/teams/components/Pill/pillIconStyles.ts b/packages/fluentui/react-northstar/src/themes/teams/components/Pill/pillIconStyles.ts +new file mode 100644 +index 0000000000000..d40a3c94fd548 +--- /dev/null ++++ b/packages/fluentui/react-northstar/src/themes/teams/components/Pill/pillIconStyles.ts +@@ -0,0 +1,27 @@ ++import { ComponentSlotStylesPrepared, ICSSInJSStyle } from '@fluentui/styles'; ++import { PillIconStylesProps } from '../../../../components/Pill/PillIcon'; ++import { PillVariables } from './pillVariables'; ++import { svgIconClassName } from '@fluentui/react-icons-northstar'; ++ ++export const pillIconStyles: ComponentSlotStylesPrepared = { ++ root: ({ props: p, variables: v }): ICSSInJSStyle => ({ ++ border: 'none', ++ background: 'transparent', ++ margin: v.iconMargin, ++ width: v.iconWidth, ++ cursor: 'pointer', ++ outline: 'none', ++ ...((p.size === 'small' || p.size === 'smaller') && { ++ width: v.smallOrSmallerIconWidth, ++ }), ++ ++ [`& .${svgIconClassName}`]: { ++ height: '100%', ++ width: '100%', ++ '& svg': { ++ height: '100%', ++ width: '100%', ++ }, ++ }, ++ }), ++}; +diff --git a/packages/fluentui/react-northstar/src/themes/teams/components/Pill/pillImageStyles.ts b/packages/fluentui/react-northstar/src/themes/teams/components/Pill/pillImageStyles.ts +new file mode 100644 +index 0000000000000..832437bc22aa1 +--- /dev/null ++++ b/packages/fluentui/react-northstar/src/themes/teams/components/Pill/pillImageStyles.ts +@@ -0,0 +1,19 @@ ++import { ComponentSlotStylesPrepared, ICSSInJSStyle } from '@fluentui/styles'; ++import { PillImageStylesProps } from '../../../../components/Pill/PillImage'; ++import { PillVariables } from './pillVariables'; ++ ++export const pillImageStyles: ComponentSlotStylesPrepared = { ++ root: ({ props: p, variables: v }): ICSSInJSStyle => ({ ++ width: v.imageWidth, ++ height: v.imageHeight, ++ borderRadius: '50%', ++ ...(p.size === 'small' && { ++ width: v.smallImageWidth, ++ height: v.smallImageHeight, ++ }), ++ ...(p.size === 'smaller' && { ++ width: v.smallerImageWidth, ++ height: v.smallerImageHeight, ++ }), ++ }), ++}; +diff --git a/packages/fluentui/react-northstar/src/themes/teams/components/Pill/pillVariables.ts b/packages/fluentui/react-northstar/src/themes/teams/components/Pill/pillVariables.ts +index 85f0fced3caf5..7a560a587e0c6 100644 +--- a/packages/fluentui/react-northstar/src/themes/teams/components/Pill/pillVariables.ts ++++ b/packages/fluentui/react-northstar/src/themes/teams/components/Pill/pillVariables.ts +@@ -51,6 +51,19 @@ export interface PillVariables { + actionMargin: string; + actionWidth: string; + smallOrSmallerActionWidth: string; ++ ++ // Icon ++ iconMargin: string; ++ iconWidth: string; ++ smallOrSmallerIconWidth: string; ++ ++ // Image ++ imageWidth: string; ++ imageHeight: string; ++ smallImageWidth: string; ++ smallImageHeight: string; ++ smallerImageWidth: string; ++ smallerImageHeight: string; + } + + export const pillVariables = (siteVars: SiteVariablesPrepared): PillVariables => ({ +@@ -105,4 +118,17 @@ export const pillVariables = (siteVars: SiteVariablesPrepared): PillVariables => + actionMargin: `0 ${pxToRem(8)}`, + actionWidth: pxToRem(16), + smallOrSmallerActionWidth: pxToRem(12), ++ ++ // Icon Pill ++ iconMargin: `0 0 0 ${pxToRem(8)}`, ++ iconWidth: pxToRem(20), ++ smallOrSmallerIconWidth: pxToRem(16), ++ ++ // Image Pill ++ imageWidth: pxToRem(32), ++ imageHeight: pxToRem(32), ++ smallImageWidth: pxToRem(24), ++ smallImageHeight: pxToRem(24), ++ smallerImageWidth: pxToRem(20), ++ smallerImageHeight: pxToRem(20), + }); +diff --git a/packages/fluentui/react-northstar/src/themes/teams/types.ts b/packages/fluentui/react-northstar/src/themes/teams/types.ts +index 13252725c9b5b..5cd062bc6308c 100644 +--- a/packages/fluentui/react-northstar/src/themes/teams/types.ts ++++ b/packages/fluentui/react-northstar/src/themes/teams/types.ts +@@ -107,6 +107,8 @@ import { SplitButtonToggleStylesProps } from '../../components/SplitButton/Split + import { AttachmentBodyStylesProps } from '../../components/Attachment/AttachmentBody'; + import { PillStylesProps } from '../../components/Pill/Pill'; + import { PillContentStylesProps } from '../../components/Pill/PillContent'; ++import { PillImageStylesProps } from '../../components/Pill/PillImage'; ++import { PillIconStylesProps } from '../../components/Pill/PillIcon'; + + export type TeamsThemeStylesProps = { + Accordion: AccordionStylesProps; +@@ -166,6 +168,8 @@ export type TeamsThemeStylesProps = { + MenuDivider: MenuDividerStylesProps; + Pill: PillStylesProps; + PillContent: PillContentStylesProps; ++ PillIcon: PillIconStylesProps; ++ PillImage: PillImageStylesProps; + Portal: PortalProps; + PopupContent: PopupContentStylesProps; + RadioGroup: RadioGroupProps;" +gatsby,https://github.com/gatsbyjs/gatsby,026d2a956296cb01936bcf45d2be1066dd844d00,Jake Lumetta,2019-01-26 04:30:47,feat(docs): add guide for ButterCMS (#11244),"## Description + +Adds a comprehensive guide for using Gatsby with ButterCMS and related changes. I think I covered all the updates I need to make (i.e. updating the nav links) but if I missed any please let me know. I also added an entry + link to our Gatsby Starter project and source plugin. + +Looking forward to your feedback! + +## Related Issues","feat(docs): add guide for ButterCMS (#11244) + +## Description + +Adds a comprehensive guide for using Gatsby with ButterCMS and related changes. I think I covered all the updates I need to make (i.e. updating the nav links) but if I missed any please let me know. I also added an entry + link to our Gatsby Starter project and source plugin. + +Looking forward to your feedback! + +## Related Issues + +https://github.com/gatsbyjs/gatsby/issues/9757","diff --git a/docs/docs/headless-cms.md b/docs/docs/headless-cms.md +index b1fc424e062aa..708b833033780 100644 +--- a/docs/docs/headless-cms.md ++++ b/docs/docs/headless-cms.md +@@ -26,7 +26,7 @@ Other CMS systems you can connect to include: + - DatoCMS [docs](/packages/gatsby-source-datocms), [business case](https://www.gatsbyjs.com/guides/datocms/) + - [Sanity](/packages/gatsby-source-sanity/) + - Contentstack [docs](/packages/gatsby-source-contentstack), [guide](https://www.contentstack.com/docs/example-apps/build-a-sample-website-using-gatsby-and-contentstack), [starter](/starters/contentstack/gatsby-starter-contentstack/) +-- [ButterCMS](/packages/gatsby-source-buttercms) ++- [ButterCMS](https://buttercms.com) [source plugin](/packages/gatsby-source-buttercms), [guide](https://www.gatsbyjs.org/docs/sourcing-from-buttercms/), [starter](https://github.com/ButterCMS/gatsby-starter-buttercms) + - Ghost [docs[(/packages/gatsby-source-ghost), [guide[(/blog/2019-01-14-modern-publications-with-gatsby-ghost/), [starter](/starters/TryGhost/gatsby-starter-ghost/) + - Kentico Cloud [docs](/packages/gatsby-source-kentico-cloud), [guide](/blog/2018-12-19-kentico-cloud-and-gatsby-take-you-beyond-static-websites/), [starter](/starters/Kentico/gatsby-starter-kentico-cloud/) + - [Directus](/packages/gatsby-source-directus) +diff --git a/docs/docs/sourcing-from-buttercms.md b/docs/docs/sourcing-from-buttercms.md +new file mode 100644 +index 0000000000000..7b8ec06aba862 +--- /dev/null ++++ b/docs/docs/sourcing-from-buttercms.md +@@ -0,0 +1,1000 @@ ++## Overview ++ ++In this guide we'll be setting up a CMS powered Gatsby site that uses [ButterCMS](https://buttercms.com/) as its content management system. ++ ++To complete this tutorial, you'll need your own ButterCMS auth token which you can [get yours free here](https://buttercms.com/#signup). ++ ++ButterCMS is a headless CMS that lets you manage content using their dashboard and integrate it into your tech stack of choice with their content APIs. You can use ButterCMS for new projects as well as add it to existing codebases. ++ ++ButterCMS provides a user-friendly UI for managing marketing sites, blogging, and custom content scenarios. We can be used for SEO landing pages, customer case studies, company news & updates, events + webinar pages, education center, location pages, knowledgebases, and more. ++ ++ButterCMS is different from a traditional CMS like Drupal or Wordpress in that they're not a large piece of software you need to download, host, customize, and maintain. Instead they provide easy to consume, performant content API's that you add to your application. ++ ++For example, if you wanted to enable a non-technical person to be able to add customer case study pages to your marketing site, you might create a Case Study Page Type to represent these pages. The non-technical person would be able to manage these pages from their dashboard and the JSON API output would look something like this: ++ ++``` ++{ ++ ""data"": { ++ ""slug"": ""acme-co-case-study"", ++ ""fields"": { ++ ""seo_title"": ""Acme Co Customer Case Study"", ++ ""seo_description"": ""Acme Co saved 200% on Anvil costs with ButterCMS"", ++ ""title"": ""Acme Co loves ButterCMS"", ++ ""body"": ""

    We've been able to make anvils faster than ever before! - Chief Anvil Maker

    "" ++ } ++ } ++} ++``` ++ ++# Setup ++ ++## Create a new Gatsby site with the [default starter](https://github.com/gatsbyjs/gatsby-starter-default) ++ ++Run this in your terminal: ++ ++`gatsby new butter-site` ++ ++## Install the source plugin ++ ++`npm install gatsby-source-buttercms` ++ ++## Adding Configuration ++ ++Here you'll specify the config that will be needed to pull down data from butter. ++make sure to add your **API_TOKEN** from your dashboard, in this guide we would be creating `faq_items`, `faq_headline`, `homepage` , `customer_case_study` as stated in the config below. Do well to change it if you named it something differently. ++ ++`gatsby-config.js` ++ ++```javascript ++module.exports = { ++{ ++ resolve: `gatsby-source-buttercms`, ++ options: { ++ authToken: `your_auth_token`, ++ // Optional. Returns values for the supplied content field keys. ++ contentFields: { ++ keys: [`faq_items`, `faq_headline`], ++ // Optional. Set to 1 to enable test mode for viewing draft content. ++ test: 0, ++ }, ++ // Optional. Array of page slugs. ++ pages: [`homepage`], ++ // Optional. Array of page types. ++ pageTypes: [`customer_case_study`], ++ }, ++ }, ++} ++``` ++ ++More details [here](https://github.com/buttercms/gatsby-source-buttercms) ++ ++## ButterCMS Starter Template ++ ++To see a fully complete Gatsby+ButterCMS project check out this [Gatsby ButterCMS Starter Project](https://github.com/ButterCMS/gatsby-starter-buttercms). It contains real world examples of how to use Pages, Posts, and ContentFields. ++ ++# Usage ++ ++## Webhooks ++ ++Webhooks are a powerful feature that allow you to notify your internal systems whenever content in ButterCMS has changed. ++Your host platform need to be notified so that gatsby can create fresh pages from the new data. You can learn more about Webhooks in this [blog post](https://buttercms.com/blog/webhook-vs-api-whats-the-difference). Checkout your host platform form incoming webhooks so we can hit it anytime your content changes. Netlify lets you generate a build hook that will be triggered by butter on certain event e.g when we create or update a blog post more details here [here](https://buttercms.com/docs/api/#webhooks) ++ ++![Webhook](https://buttercms.com/static/images/docs/guides/OverviewWebhooks.caade716f770.png ""Webhook"") ++ ++## Image Transformation ++ ++ButterCMS has integrated with a rich image transformation API called Filestack. This allows you to modify your uploaded images in dozens of ways. Everything from resizing, cropping, effects, filters, applying watermarks and more. Check out Filestack full documentation for more detail. ++ ++After you upload an image to ButterCMS, it's stored on our CDN. To create a thumbnail, here's an example: ++ ++Original URL = https://cdn.buttercms.com/zjypya5tRny63LqhHQrv ++ ++Thumbnail URL = https://fs.buttercms.com/resize=width:200,height:200/zjypya5tRny63LqhHQrv ++ ++Resizing is just one of the many different transformations you can do to your images. Refer to the [Filestack docs](https://www.filestack.com/docs/) for full details. ++ ++## Localization ++ ++ButterCMS has full support for localization of your content. Locale names and keys are completely customizable and there's no limit to the number of locales you can have. View their [API Reference](https://buttercms.com/docs/api/) to learn how to query by locale. ++ ++![locales](https://buttercms.com/static/images/docs/guides/Localization.54a005530001.png) ++ ++# Creating pages ++ ++### Introduction ++ ++Quickly launch a new marketing site or add CMS-powered pages to your existing site using our Pages. ++ ++## Creating a Single page(Home Page) ++ ++### Introduction ++ ++Quickly launch a new marketing site or add [CMS-powered pages](https://buttercms.com/gatsbyjs-cms/) to your existing site using our Pages. ++ ++### Create a Single Page ++ ++Adding a CMS-powered page to your app involves three easy steps: ++ ++1. Create the Page structure ++1. Populate the content ++1. Integrate into your application ++ ++If you need help after reading this, contact us via email or livechat. ++ ++#### Create the Page structure ++ ++Create a new Page and define it's structure using our Page Builder. Let's create an example homepage. ++ ++![image](https://buttercms.com/static/images/docs/guides/PagesNewSinglePage.d6038e2b75a0.png) ++ ++#### Populate the Content ++ ++Then populate our new page with content. In the next step, we'll call the ButterCMS API to retrieve this content from our app. ++ ++![image](https://buttercms.com/static/images/docs/guides/PagesNewSinglePageContent.c582e2451f7f.png) ++ ++### Integrate into your application ++ ++With your homepage defined, the ButterCMS our graphql query will return some data that looks like this: ++ ++``` ++{ ++ ""data"": { ++ ""slug"": ""homepage"", ++ ""fields"": { ++ ""seo_title"": ""Anvils and Dynamite | Acme Co"", ++ ""headline"": ""Acme Co provides supplies to your favorite cartoon heroes."", ++ ""hero_image"": ""https://cdn.buttercms.com/c8oSTGcwQDC5I58km5WV"", ++ ""call_to_action"": ""Buy Now"", ++ ""customer_logos"": [ ++ { ++ ""logo_image"": ""https://cdn.buttercms.com/c8oSTGcwQDC5I58km5WV"" ++ }, ++ { ++ ""logo_image"": ""https://cdn.buttercms.com/c8oSTGcwQDC5I58km5WV"" ++ } ++ ] ++ } ++ } ++} ++``` ++ ++Now lets create the home page `src/pages/index.js` ++ ++``` ++import React from 'react' ++import { graphql, Link } from 'gatsby' ++import Layout from '../components/layout' ++import SEO from '../components/seo' ++ ++const IndexPage = ({ data }) => { ++ const home = data.home.edges[0].node ++ ++ return ( ++ ++ ++
    ++

    ++ {home.headline} ++

    ++ ++
    ++ ++ {/*

    {page.hero_image}

    */} ++ ++

    Our Customers

    ++
    ++ {home.customer_logos.map(({ logo_image }) => ( ++ ++ ))} ++
    ++
    ++ ) ++} ++ ++//GraphQl query to fetch homepage data ++export const query = graphql` ++ { ++ home: allButterPage(filter: { slug: { eq: ""homepage"" } }) { ++ edges { ++ node { ++ slug ++ headline ++ seo_title ++ customer_logos { ++ logo_image ++ } ++ hero_image ++ call_to_action ++ } ++ } ++ } ++ } ++` ++ ++export default IndexPage ++``` ++ ++in your terminal, run ++ ++``` ++> gatsby develop ++``` ++ ++Now open up [localhost:8000/home](http://localhost:8000/home) to see the home page populated with the content you created on butter. ++ ++## Create multiple pages using Page Types ++ ++Let's say you want to add a set of customer case study pages to your marketing site. They all have the same structure but the content is different. Page Types are perfect for this scenario and involves three easy steps: ++ ++1. Create the Page Type structure ++2. Populate the content ++3. Integrate into your application ++ ++If you need help after reading this, contact us via email or livechat. ++ ++## Create the Page Type structure ++ ++Create a Page Type to represent your Customer Case Study pages: ++![page structure](https://buttercms.com/static/images/docs/guides/PagesNewPageType1.18834db5cf0b.png) ++ ++After saving, return to the configuration page by clicking the gear icon: ++![image](https://buttercms.com/static/images/docs/guides/PagesNewPageType2.6fa0dea4872c.png) ++ ++Then click on Create Page Type and name it ""Customer Case Study"". This will allow us to reuse this field configuration across multiple customer case study pages: ++ ++![saving](https://buttercms.com/static/images/docs/guides/PagesNewPageType3.70f0c287ae91.png) ++ ++## Populate the Content ++ ++Then populate our new page with content. In the next step, we'll call the ButterCMS API to retrieve this content from our app. ++ ++![](https://buttercms.com/static/images/docs/guides/PagesNewPageTypeCreateContent.6164c9b9cf19.png) ++ ++To Pull down content into gatsby run: ++ ++``` ++> gatsby develop ++``` ++ ++### Testing with GrapiQl ++ ++You can test out your Graphql queries with GrahiQl( A graphql debugger) fire up Graphiql on [http://localhost:8000/\_\_\_graphql](http://localhost:8000/___graphql) ++ ++Once graphiql is opened paste the query below : ++ ++``` ++{ ++ allButterPage(filter: {page_type: {eq: ""customer_case_study""}}) { ++ edges { ++ node { ++ id ++ facebook_open_graph_title ++ seo_title ++ headline ++ customer_logo ++ testimonial ++ } ++ } ++ } ++} ++``` ++ ++## Integrate into your application ++ ++Now lets refactor our home page to display link(s) to each customer case study page ++ ++`src/pages/index.js` ++ ++``` ++import React from 'react' ++import { graphql, Link } from 'gatsby' ++import Layout from '../components/layout' ++import SEO from '../components/seo' ++ ++const IndexPage = ({ data }) => { ++ console.log(data) ++ const home = data.home.edges[0].node ++ const case_studies = data.case_studies.edges ++ ++ return ( ++ ++ ++
    ++

    ++ {home.headline} ++

    ++ ++
    ++ ++

    Our Customers

    ++
    ++ {home.customer_logos.map(({ logo_image }) => ( ++ ++ ))} ++ ++

    Case Studies

    ++ {case_studies.map(({ node: { id, slug, headline } }) => ( ++
    ++ {headline} ++
    ++ ))} ++
    ++
    ++ ) ++} ++ ++export const query = graphql` ++ { ++ home: allButterPage(filter: { slug: { eq: ""homepage"" } }) { ++ edges { ++ node { ++ slug ++ headline ++ seo_title ++ customer_logos { ++ logo_image ++ } ++ hero_image ++ call_to_action ++ } ++ } ++ } ++ case_studies: allButterPage( ++ filter: { page_type: { eq: ""customer_case_study"" } } ++ ) { ++ edges { ++ node { ++ id ++ slug ++ facebook_open_graph_title ++ seo_title ++ headline ++ testimony ++ customer_logo ++ } ++ } ++ } ++ } ++` ++ ++export default IndexPage ++``` ++ ++Next we'll refactor `gatsby-node-js` to programatically create customer case study pages with gatsby create pages API. First we need to define a customer case study template ++ ++`src/templates/customer-case-study.js` ++ ++``` ++import React from 'react' ++import { graphql } from 'gatsby' ++import Layout from '../components/layout' ++import SEO from '../components/seo' ++ ++ ++function CustomerCaseStudy({ data }) { ++ const page = data.allButterPage.edges[0].node ++ ++ return ( ++ ++ ++
    ++

    {page.seo_title}

    ++

    {page.headline}

    ++ ++

    {page.testimonial}

    ++
    ++
    ++ ) ++} ++ ++export const pageQuery = graphql` ++ query CaseStudyPageBySlug($slug: String!) { ++ allButterPage(filter: { slug: { eq: $slug } }) { ++ edges { ++ node { ++ id ++ slug ++ facebook_open_graph_title ++ seo_title ++ headline ++ testimony ++ customer_logo ++ } ++ } ++ } ++ } ++` ++ ++export default CustomerCaseStudy ++``` ++ ++Now Let's programatically Create customer case study pages based on the template we defined in `src/template/customer-case-study.js` ++ ++`gatsby-node.js` ++ ++``` ++const path = require(`path`) ++ ++exports.createPages = async ({ graphql, actions }) => { ++ const { createPage } = actions ++ ++ // Blog post template ++ const blogPost = path.resolve(`./src/templates/blog-post.js`) ++ ++ //customer case study template ++ const customerCaseStudy = path.resolve( ++ `./src/templates/customer-case-study.js` ++ ) ++ ++ let posts ++ try { ++ posts = await graphql(` ++ { ++ allButterPost { ++ edges { ++ node { ++ id ++ seo_title ++ slug ++ categories { ++ name ++ slug ++ } ++ author { ++ first_name ++ last_name ++ email ++ slug ++ profile_image ++ } ++ body ++ } ++ } ++ } ++ } ++ `) ++ } catch (error) { ++ console.log(`Error Running Querying Posts`, error) ++ } ++ ++ posts = posts.data.allButterPost.edges; ++ ++ posts.forEach((post, index) => { ++ const previous = index === posts.length - 1 ? null : posts[index + 1].node ++ const next = index === 0 ? null : posts[index - 1].node ++ ++ // Create blog posts pages. ++ createPage({ ++ path: `/blog/${post.node.slug}`, ++ component: blogPost, ++ context: { ++ slug: post.node.slug, ++ previous, ++ next, ++ }, ++ }) ++ }) ++ ++ // Fetch Customer Case study pages ++ let pages ++ try { ++ pages = await graphql(` ++ { ++ allButterPage(filter: { page_type: { eq: ""customer_case_study"" } }) { ++ edges { ++ node { ++ id ++ slug ++ facebook_open_graph_title ++ seo_title ++ headline ++ testimony ++ customer_logo ++ } ++ } ++ } ++ } ++ `) ++ } catch (error) { ++ console.log(`Error Running Querying Pages`, error) ++ } ++ ++ //Create Customer Case study pages ++ pages.data.allButterPage.edges.forEach(page => { ++ createPage({ ++ path: `/case-study/${page.node.slug}`, ++ component: customerCaseStudy, ++ context: { ++ slug: page.node.slug, ++ }, ++ }) ++ }) ++} ++``` ++ ++That's it! now stop the server and run: ++ ++``` ++> gatsby develop ++``` ++ ++Now the home page should contain links to customer case study pages, Click around ++you'll notice that the template we defined in `src/template/customer_case_study.js` ++was use by gatsby to create each case study page. ++ ++## Setup content fields ++ ++Let's suppose we want to add a CMS to a static FAQ page with a title and a list of questions with answers. Most websites have a FAQ(Frequently Asked Question) Page. ButterCMS make it dead easy to create such content with Collections . Now we'll create a collection named `FAQs`having a `question` and `answer` field. ++ ++Making your content dynamic with Butter is a two-step process: ++ ++1. **Setup custom content fields in Butter** ++2. **Integrate the fields into your application** ++3. **To setup custom content fields, first sign in to the Butter dashboard.** ++ ++Create a new workspace or click on an existing one. Workspaces let you organize content fields in a friendly way for content editors and have no effect on development or the API. For example, a real-estate website might have a workspace called ""Properties"" and another called ""About Page"". ++ ++![create workspace](https://buttercms.com/static/images/docs/guides/FaqCreateWorkspace.png) ++ ++Once you're in a workspace click the button to create a new content field. Choose the ""Object"" type and name the field ""FAQ Headline"": ++ ++![new contentfield](https://buttercms.com/static/images/docs/guides/FaqCreateHeadline.png) ++ ++After saving, add another field but this time choose the ""Collection"" type and name the field FAQ Items: ++ ++![Add items](https://buttercms.com/static/images/docs/guides/FaqCreateItems.png) ++ ++On the next screen setup two properties for items in the collection: ++ ++![properties](https://buttercms.com/static/images/docs/guides/FaqCollectionProperties.png) ++ ++Now go back to your workspace and update your heading and FAQ items. ++ ++[workspace content](https://buttercms.com/static/images/docs/guides/FaqWorkspace.png) ++ ++## Integrate into your application ++ ++`/src/pages/faq.js` ++ ++``` ++import React from 'react' ++import { graphql } from 'gatsby' ++ ++import Layout from '../components/layout' ++import SEO from '../components/seo' ++ ++const Faq = ({ data }) => { ++ const FAQs = data.allButterCollection.edges[0].node.value ++ const headline = data.allButterContentField.edges[0].node.value ++ ++ return ( ++ ++ ++

    ++ {headline} ++

    ++
    ++ {FAQs.map(faq => ( ++
    ++

    {faq.question}

    ++

    {faq.answer}

    ++
    ++ ))} ++
    ++
    ++ ) ++} ++ ++export const query = graphql` ++ { ++ allButterCollection(filter: { id: { eq: ""faq_items"" } }) { ++ edges { ++ node { ++ id ++ value { ++ question ++ answer ++ } ++ } ++ } ++ } ++ ++ allButterContentField(filter: { id: { eq: ""faq_headline"" } }) { ++ edges { ++ node { ++ id ++ value ++ } ++ } ++ } ++ } ++` ++export default Faq ++``` ++ ++# Blog ++ ++## Introduction ++ ++Butter CMS is also a great feat if you want to spin up a blog, it's pretty easy as they provide a [blog engine](https://buttercms.com/gatsbyjs-blog-engine/) that helps you manage content in one place. Gatsby then pulls down the data at build time and create static pages off that data. ++ ++# Blog Home Page ++ ++Now we would create a home page for our blog posts. It basically lists all blog posts. ++ ++`src/pages/blog.js` ++ ++``` ++import React from 'react' ++import { Link, graphql } from 'gatsby' ++import Layout from '../components/Layout' ++import SEO from '../components/seo' ++ ++class BlogIndex extends React.Component { ++ render() { ++ const { data } = this.props ++ const siteTitle = data.site.siteMetadata.title ++ const posts = data.allButterPost.edges ++ ++ return ( ++ ++ ++ ++
    ++
    ++ {posts.map(({ node }) => { ++ const title = node.seo_title || node.slug ++ return ( ++
    ++

    ++ ++ {title} ++ ++

    ++ {node.date} ++

    ++

    ++ ) ++ })} ++
    ++
    ++
    ++ ) ++ } ++} ++ ++export default BlogIndex ++ ++export const pageQuery = graphql` ++ query { ++ site { ++ siteMetadata { ++ title ++ } ++ } ++ allButterPost { ++ edges { ++ node { ++ id ++ seo_title ++ meta_description ++ slug ++ categories { ++ name ++ slug ++ } ++ author { ++ first_name ++ last_name ++ email ++ slug ++ bio ++ title ++ linkedin_url ++ facebook_url ++ instagram_url ++ pinterest_url ++ twitter_handle ++ profile_image ++ } ++ body ++ } ++ } ++ } ++ } ++` ++``` ++ ++## Creating a blog template ++ ++Now we've listed our blog posts in `src/pages/blog.js`, using gatsby [createpages](https://www.gatsbyjs.org/docs/node-apis/#createPages) API we would generate blog post pages using a template: ++ ++`src/pages/template/blog-post.js` ++ ++``` ++import React from 'react' ++import { Link, graphql } from 'gatsby' ++ ++import Bio from '../components/Bio' ++import Layout from '../components/Layout' ++import SEO from '../components/seo' ++ ++class BlogPostTemplate extends React.Component { ++ render() { ++ const post = this.props.data.allButterPost.edges[0].node ++ const siteTitle = this.props.data.site.siteMetadata.title ++ const { previous, next } = this.props.pageContext ++ ++ return ( ++ ++ ++
    ++
    ++

    {post.seo_title}

    {post.date} • ++ {post.categories.map(category => ( ++ {category.name} ++ ))} ++
    ++
    ++
    ++ ++
      ++
    • ++ {previous && ( ++ ++ ← {previous.seo_title} ++ ++ )} ++
    • ++
    • ++ {next && ( ++ ++ {next.seo_title} → ++ ++ )} ++
    • ++
    ++
    ++
    ++ ++ ) ++ } ++} ++ ++export default BlogPostTemplate ++ ++export const pageQuery = graphql` ++ query BlogPostBySlug($slug: String!) { ++ site { ++ siteMetadata { ++ title ++ author ++ } ++ } ++ allButterPost(filter: { slug: { eq: $slug } }) { ++ edges { ++ node { ++ id ++ body ++ seo_title ++ date ++ categories { ++ name ++ } ++ } ++ } ++ } ++ } ++` ++``` ++ ++## Generate Blog Pages ++ ++Now we'll use the blog template defined in `src/templates/blog-post.js` to generate blog pages. ++ ++`gatsby-node.js` ++ ++``` ++const path = require(`path`) ++ ++exports.createPages = async ({ graphql, actions }) => { ++ const { createPage } = actions ++ ++ const blogPost = path.resolve(`./src/templates/blog-post.js`) ++ ++ let posts ++ try { ++ posts = await graphql(` ++ { ++ allButterPost { ++ edges { ++ node { ++ id ++ seo_title ++ slug ++ categories { ++ name ++ slug ++ } ++ author { ++ first_name ++ last_name ++ email ++ slug ++ profile_image ++ } ++ body ++ } ++ } ++ } ++ } ++ `) ++ } catch (error) { ++ console.log(`Error Running Querying Posts`, error) ++ } ++ ++ posts = posts.data.allButterPost.edges; ++ ++ posts.forEach((post, index) => { ++ const previous = index === posts.length - 1 ? null : posts[index + 1].node ++ const next = index === 0 ? null : posts[index - 1].node ++} ++``` ++ ++## Categories, Tags, and Authors ++ ++Use Butter's APIs for categories, tags, and authors to feature and filter content on your blog. ++See their [API reference](https://buttercms.com/docs/api/) for more information about these objects: ++ ++## Easy as Butter ++ ++This was an example meant to help you understand how ButterCMS works with Gatsby. You're now able to: ++ ++- Create a ButterCMS repository and setting it up together with the Gatsby plugin ++- Query data from ButterCMS for single pages, multiple pages, blog posts, and custom content fields ++ ++If you got stuck, you can compare your code to the [gatsby-starter-buttercms](https://github.com/ButterCMS/gatsby-starter-buttercms). To learn more about ButterCMS, check out their [blog](https://buttercms.com/blog/). Their latest updates can be found [here](https://buttercms.com/blog/category/new-to-butter/). +diff --git a/docs/starters.yml b/docs/starters.yml +index 7efc3522f8e3b..db456fc9fa42f 100644 +--- a/docs/starters.yml ++++ b/docs/starters.yml +@@ -1685,6 +1685,19 @@ + - Full setup instructions included + - Documented to get you set up with Craft CMS quickly + - Code referenced in repo ++- url: https://gatsby-starter-buttercms.netlify.com/ ++ repo: https://github.com/ButterCMS/gatsby-starter-buttercms ++ description: A starter template for spinning up a Gatsby+ ButterCMS site ++ tags: ++ - Blog ++ - SEO ++ - ButterCMS ++ features: ++ - Fully functioning blog ++ - Navigation between posts with a previous/next post button ++ - FAQ Knowledge Base ++ - CMS Powered Homepage ++ - Customer Case Study example marketing pages + - url: https://master.d2f5ek3dnwfe9v.amplifyapp.com/ + repo: https://github.com/dabit3/gatsby-auth-starter-aws-amplify + description: This Gatsby starter uses AWS Amplify to implement authentication flow for signing up/signing in users as well as protected client side routing." +nocobase,https://github.com/nocobase/nocobase,9f7cc39a3d3b1078e26c5331d4a6fa0ea2f6fee8,Zeke Zhang,2025-02-10 18:12:12,fix(page): improve document title handling and remove unused request (#6188),"* fix(page): improve document title handling and remove unused request + +* fix(tests): remove unused remote schema request test for Page component","fix(page): improve document title handling and remove unused request (#6188) + +* fix(page): improve document title handling and remove unused request + +* fix(tests): remove unused remote schema request test for Page component","diff --git a/packages/core/client/src/schema-component/antd/page/Page.tsx b/packages/core/client/src/schema-component/antd/page/Page.tsx +index 6ed61b3a0cef7..36ecbadd4d76f 100644 +--- a/packages/core/client/src/schema-component/antd/page/Page.tsx ++++ b/packages/core/client/src/schema-component/antd/page/Page.tsx +@@ -21,7 +21,6 @@ import { useTranslation } from 'react-i18next'; + import { NavigateFunction, Outlet, useOutletContext } from 'react-router-dom'; + import { FormDialog } from '..'; + import { antTableCell } from '../../../acl/style'; +-import { useRequest } from '../../../api-client'; + import { + CurrentTabUidContext, + useCurrentSearchParams, +@@ -392,25 +391,12 @@ const NocoBasePageHeader = React.memo(({ activeKey, className }: { activeKey: st + const hidePageTitle = fieldSchema['x-component-props']?.hidePageTitle; + + useEffect(() => { +- if (fieldSchema.title) { +- const title = t(fieldSchema.title); ++ const title = t(fieldSchema.title) || t(currentRoute?.title); ++ if (title) { + setDocumentTitle(title); + setPageTitle(title); + } +- }, [fieldSchema.title, pageTitle, setDocumentTitle, t]); +- +- useRequest( +- { +- url: `/uiSchemas:getParentJsonSchema/${fieldSchema['x-uid']}`, +- }, +- { +- ready: !hidePageTitle && !fieldSchema.title, +- onSuccess(data) { +- setPageTitle(data.data.title); +- setDocumentTitle(data.data.title); +- }, +- }, +- ); ++ }, [fieldSchema.title, pageTitle, setDocumentTitle, t, currentRoute?.title]); + + return ( + <> +diff --git a/packages/core/client/src/schema-component/antd/page/__tests__/page.test.tsx b/packages/core/client/src/schema-component/antd/page/__tests__/page.test.tsx +index 814b327639d3b..01654a8784e61 100644 +--- a/packages/core/client/src/schema-component/antd/page/__tests__/page.test.tsx ++++ b/packages/core/client/src/schema-component/antd/page/__tests__/page.test.tsx +@@ -46,28 +46,6 @@ describe('Page', () => { + expect(screen.queryByText('Test Title')).not.toBeInTheDocument(); + }); + +- test('should request remote schema when no title', async () => { +- await renderAppOptions({ +- schema: { +- type: 'void', +- 'x-uid': 'test', +- 'x-component': Page, +- 'x-decorator': DocumentTitleProvider, +- }, +- apis: { +- '/uiSchemas:getParentJsonSchema/test': { +- data: { +- title: 'remote title', +- }, +- }, +- }, +- }); +- +- await waitFor(() => { +- expect(screen.getByText('remote title')).toBeInTheDocument(); +- }); +- }); +- + // TODO: This works normally in the actual page, but the test fails here + test.skip('add tab', async () => { + await renderAppOptions({" +beats,https://github.com/elastic/beats,9e4204bcfa2f4925b9faaac1547d4eab696e8d29,Andrzej Stencel,2025-02-17 13:19:41,docs: fix table formatting in Filebeat metrics descriptions (#42709),"* docs: fix table formatting in Filebeat metrics descriptions + +* docs: fix table formatting for `libbeat.pipeline.*` metrics","docs: fix table formatting in Filebeat metrics descriptions (#42709) + +* docs: fix table formatting in Filebeat metrics descriptions + +* docs: fix table formatting for `libbeat.pipeline.*` metrics","diff --git a/libbeat/docs/metrics-in-logs.asciidoc b/libbeat/docs/metrics-in-logs.asciidoc +index 27d27ef9d43d..f6168ad462fc 100644 +--- a/libbeat/docs/metrics-in-logs.asciidoc ++++ b/libbeat/docs/metrics-in-logs.asciidoc +@@ -188,18 +188,18 @@ endif::[] + | `.output.events.total` | Integer | Number of events currently being processed by the output. | If this number grows over time, it may indicate that the output destination (e.g. {ls} pipeline or {es} cluster) is not able to accept events at the same or faster rate than what {beatname_uc} is sending to it. + | `.output.events.acked` | Integer | Number of events acknowledged by the output destination. | Generally, we want this number to be the same as `.output.events.total` as this indicates that the output destination has reliably received all the events sent to it. + | `.output.events.failed` | Integer | Number of events that {beatname_uc} tried to send to the output destination, but the destination failed to receive them. | Generally, we want this field to be absent or its value to be zero. When the value is greater than zero, it's useful to check {beatname_uc}'s logs right before this log entry's `@timestamp` to see if there are any connectivity issues with the output destination. Note that failed events are not lost or dropped; they will be sent back to the publisher pipeline for retrying later. +-| `.output.events.dropped` | Integer | Number of events that {beatname_uc} gave up sending to the output destination because of a permanent (non-retryable) error. +-| `.output.events.dead_letter` | Integer | Number of events that {beatname_uc} successfully sent to a configured dead letter index after they failed to ingest in the primary index. +-| `.output.write.latency` | Object | Reports statistics on the time to send an event to the connected output, in milliseconds. This can be used to diagnose delays and performance issues caused by I/O or output configuration. This metric is available for the Elasticsearch, file, redis, and logstash outputs. ++| `.output.events.dropped` | Integer | Number of events that {beatname_uc} gave up sending to the output destination because of a permanent (non-retryable) error. | ++| `.output.events.dead_letter` | Integer | Number of events that {beatname_uc} successfully sent to a configured dead letter index after they failed to ingest in the primary index. | ++| `.output.write.latency` | Object | Reports statistics on the time to send an event to the connected output, in milliseconds. This can be used to diagnose delays and performance issues caused by I/O or output configuration. This metric is available for the Elasticsearch, file, redis, and logstash outputs. | + |=== + + [cols=""1,1,2,2""] + |=== + | Field path (relative to `.monitoring.metrics.libbeat.pipeline`) | Type | Meaning | Troubleshooting hints + +-| `.queue.max_events` | Integer (gauge) | The queue's maximum event count if it has one, otherwise zero. +-| `.queue.max_bytes` | Integer (gauge) | The queue's maximum byte count if it has one, otherwise zero. +-| `.queue.filled.events` | Integer (gauge) | Number of events currently stored by the queue. | ++| `.queue.max_events` | Integer (gauge) | The queue's maximum event count if it has one, otherwise zero. | ++| `.queue.max_bytes` | Integer (gauge) | The queue's maximum byte count if it has one, otherwise zero. | ++| `.queue.filled.events` | Integer (gauge) | Number of events currently stored by the queue. | + | `.queue.filled.bytes` | Integer (gauge) | Number of bytes currently stored by the queue. | + | `.queue.filled.pct` | Float (gauge) | How full the queue is relative to its maximum size, as a fraction from 0 to 1. | Low throughput while `queue.filled.pct` is low means congestion in the input. Low throughput while `queue.filled.pct` is high means congestion in the output. + | `.queue.added.events` | Integer | Number of events added to the queue by input workers. |" +socket.io,https://github.com/socketio/socket.io,19836d9abf371cb9635952623a6cfca580f8dfd4,Gray Zhang,2021-12-28 14:52:45,chore: add types to exports field to be compatible with nodenext module resolution (#1522),"See [1] for detail, in `nodenext` module resolution it requires a +`types` field in `exports` with full filename including extension. + +[1]: https://github.com/microsoft/TypeScript/issues/46770#issuecomment-966612103","chore: add types to exports field to be compatible with nodenext module resolution (#1522) + +See [1] for detail, in `nodenext` module resolution it requires a +`types` field in `exports` with full filename including extension. + +[1]: https://github.com/microsoft/TypeScript/issues/46770#issuecomment-966612103 + +Reference: https://www.typescriptlang.org/tsconfig/#module","diff --git a/package.json b/package.json +index 20fb706cb3..7240f8fca0 100644 +--- a/package.json ++++ b/package.json +@@ -26,7 +26,8 @@ + ""node"": ""./build/esm-debug/index.js"", + ""default"": ""./build/esm/index.js"" + }, +- ""require"": ""./build/cjs/index.js"" ++ ""require"": ""./build/cjs/index.js"", ++ ""types"": ""./build/esm/index.d.ts"" + } + }, + ""types"": ""./build/esm/index.d.ts""," +openpilot,https://github.com/commaai/openpilot,15b18c2eee595bf3facf9cd42565099b3de81596,Willem Melching,2022-07-25 20:30:42,docs: add svg images (#25273),"* docs: add svg images + +* important whitespace","docs: add svg images (#25273) + +* docs: add svg images + +* important whitespace +old-commit-hash: 4d8f40aa2d60400c808fa276ef40f8f3d6c10fc5","diff --git a/docs/Makefile b/docs/Makefile +index 02db7db2d3e809..d0aa841c4ddcc4 100644 +--- a/docs/Makefile ++++ b/docs/Makefile +@@ -32,7 +32,7 @@ clean: + @echo ""Copying docs & config to build folder..."" + cp -a ""$(DOCSDIR)"" ""$(BUILDDIR)"" + cd ""$(OPENPILOT_ROOT)"" && \ +- find . -type f \( -name ""*.md"" -o -name ""*.rst"" -o -name ""*.png"" -o -name ""*.jpg"" \) \ ++ find . -type f \( -name ""*.md"" -o -name ""*.rst"" -o -name ""*.png"" -o -name ""*.jpg"" -o -name ""*.svg"" \) \ + -not -path ""*/.*"" \ + -not -path ""./build/*"" \ + -not -path ""./docs/*"" \" +Anki-Android,https://github.com/ankidroid/Anki-Android,925d1b9327e3248069c66ed4dd200c5bd4db68a1,David Allison,2023-12-21 00:09:24,fix: allow seeking videos,"This implements HTTP 206 partial content responses + +We accept a range header, determine the start/end +that the client would like, and return that subset +of the file + +Fixes 14490","fix: allow seeking videos + +This implements HTTP 206 partial content responses + +We accept a range header, determine the start/end + that the client would like, and return that subset + of the file + +Fixes 14490","diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/ReviewerServer.kt b/AnkiDroid/src/main/java/com/ichi2/anki/ReviewerServer.kt +index ecddb3c52b00..d23ef852c7e7 100644 +--- a/AnkiDroid/src/main/java/com/ichi2/anki/ReviewerServer.kt ++++ b/AnkiDroid/src/main/java/com/ichi2/anki/ReviewerServer.kt +@@ -18,6 +18,8 @@ package com.ichi2.anki + + import anki.frontend.SetSchedulingStatesRequest + import com.ichi2.anki.pages.AnkiServer ++import com.ichi2.anki.pages.RangeHeader ++import com.ichi2.anki.pages.toInputStream + import com.ichi2.utils.AssetHelper + import timber.log.Timber + import java.io.File +@@ -58,10 +60,24 @@ class ReviewerServer(activity: AbstractFlashcardViewer, private val mediaDir: St + // fall back to looking in media folder + val file = File(mediaDir, uri.substring(1)) + if (file.exists()) { +- val inputStream = FileInputStream(file) ++ val rangeHeader = RangeHeader.from(session, defaultEnd = file.length() - 1) + val mimeType = AssetHelper.guessMimeType(uri) +- Timber.v(""OK: $uri"") +- return newChunkedResponse(Response.Status.OK, mimeType, inputStream) ++ return if (rangeHeader != null) { ++ val (start, end) = rangeHeader ++ newFixedLengthResponse( ++ Response.Status.PARTIAL_CONTENT, ++ mimeType, ++ file.toInputStream(rangeHeader), ++ rangeHeader.contentLength ++ ).apply { ++ addHeader(""Content-Range"", ""bytes $start-$end/${file.length()}"") ++ addHeader(""Accept-Ranges"", ""bytes"") ++ } ++ } else { ++ val inputStream = FileInputStream(file) ++ Timber.v(""OK: $uri"") ++ newChunkedResponse(Response.Status.OK, mimeType, inputStream) ++ } + // probably don't need this anymore + // resp.addHeader(""Access-Control-Allow-Origin"", ""*"") + } +diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/pages/RangeHeader.kt b/AnkiDroid/src/main/java/com/ichi2/anki/pages/RangeHeader.kt +new file mode 100644 +index 000000000000..d614dad4514c +--- /dev/null ++++ b/AnkiDroid/src/main/java/com/ichi2/anki/pages/RangeHeader.kt +@@ -0,0 +1,50 @@ ++/* ++ * Copyright (c) 2023 David Allison ++ * ++ * This program is free software; you can redistribute it and/or modify it under ++ * the terms of the GNU General Public License as published by the Free Software ++ * Foundation; either version 3 of the License, or (at your option) any later ++ * version. ++ * ++ * This program is distributed in the hope that it will be useful, but WITHOUT ANY ++ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A ++ * PARTICULAR PURPOSE. See the GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License along with ++ * this program. If not, see . ++ */ ++ ++package com.ichi2.anki.pages ++ ++import fi.iki.elonen.NanoHTTPD.IHTTPSession ++import java.io.File ++import java.io.InputStream ++import java.io.RandomAccessFile ++import java.nio.channels.Channels ++ ++/** ++ * Handles the ""range"" header in a HTTP Request ++ */ ++data class RangeHeader(val start: Long, val end: Long) { ++ val contentLength: Long get() = end - start + 1 ++ ++ companion object { ++ fun from(session: IHTTPSession, defaultEnd: Long): RangeHeader? { ++ val range = session.headers[""range""]?.trim() ?: return null ++ val numbers = range.substring(""bytes="".length).split('-') ++ val unspecifiedEnd = numbers.getOrNull(1).isNullOrEmpty() ++ return RangeHeader( ++ start = numbers[0].toLong(), ++ end = if (unspecifiedEnd) defaultEnd else numbers[1].toLong() ++ ) ++ } ++ } ++} ++ ++fun File.toInputStream(header: RangeHeader): InputStream { ++ // PERF: Test to see if a custom FileInputStream + available() would be faster ++ val randomAccessFile = RandomAccessFile(this, ""r"") ++ return Channels.newInputStream(randomAccessFile.channel).also { ++ it.skip(header.start) ++ } ++}" +ant-design-blazor,https://github.com/ant-design-blazor/ant-design-blazor,65ae78f904b54bceaf7ad233aeb78f82f3c6a1be,James Yeung,2024-09-13 20:09:40,fix(module: tabs): draggable and contextmenu incottectly (#4199),"* fix(module: tabs): draggable and context menu + +* update position after exchange + +* only update scroll list position when active tab is not the last one + +* refactor navigate + +* update doc + +* fix test","fix(module: tabs): draggable and contextmenu incottectly (#4199) + +* fix(module: tabs): draggable and context menu + +* update position after exchange + +* only update scroll list position when active tab is not the last one + +* refactor navigate + +* update doc + +* fix test","diff --git a/components/tabs/TabPane.razor b/components/tabs/TabPane.razor +index 093ca8a211..25bf19388d 100644 +--- a/components/tabs/TabPane.razor ++++ b/components/tabs/TabPane.razor +@@ -8,18 +8,32 @@ + if (_hasClosed) + return; + +- var ondragoverPreventDefault = _isActive; ++ @if (Parent.Draggable) ++ { ++ var ondragoverPreventDefault = _isActive; ++ ++
    (e => Parent.HandleDragStart(e, this)))"" ++ @ondrop=""@(()=> Parent.HandleDrop(this))""> ++ @RenderTabInner ++
    ++ } ++ else ++ { ++ @RenderTabInner ++ } ++ } ++ ++ internal void RenderTabInner(RenderTreeBuilder __builder) ++ { + var onclickStopPropagation = !_isActive; + +
    Parent.HandleTabClick(this))"" +- @ondragover:preventDefault=""@ondragoverPreventDefault"" +- @ondragstart=""@(EventUtil.AsNonRenderingEventHandler(e => Parent.HandleDragStart(e, this)))"" +- @ondrop=""@(()=> Parent.HandleDrop(this))"" +- class=""@ClassMapper.Class"" +- draggable=""@Parent.Draggable.ToString()"" ++ class=""@_tabClassMapper.Class"" + id=""@TabId"" + ondragover=""event.preventDefault();""> +
    _tabBtnRef; + +- private ClassMapper _tabPaneClassMapper = new(); ++ private ClassMapper _tabClassMapper = new(); + + private const string PrefixCls = ""ant-tabs-tab""; + private const string TabPanePrefixCls = ""ant-tabs-tabpane""; +@@ -86,6 +86,8 @@ public partial class TabPane : AntDomComponentBase + private bool _hasRendered; + private int _tabIndex; + ++ private string TabStyles => $""margin-right:{(Parent.Type == TabType.Line ? ""24px;"" : ""2px;"")}; order:{TabIndex};""; ++ + protected override void OnInitialized() + { + base.OnInitialized(); +@@ -117,13 +119,13 @@ public override async Task SetParametersAsync(ParameterView parameters) + + private void SetClass() + { +- ClassMapper ++ _tabClassMapper + .Add(PrefixCls) + .If($""{PrefixCls}-active"", () => _isActive) + .If($""{PrefixCls}-with-remove"", () => Closable) + .If($""{PrefixCls}-disabled"", () => Disabled); + +- _tabPaneClassMapper ++ ClassMapper + .Add(TabPanePrefixCls) + .If($""{TabPanePrefixCls}-active"", () => _isActive) + .If($""{TabPanePrefixCls}-hidden"", () => !_isActive) +diff --git a/components/tabs/Tabs.razor b/components/tabs/Tabs.razor +index f3f6387ddc..ac3e48c029 100644 +--- a/components/tabs/Tabs.razor ++++ b/components/tabs/Tabs.razor +@@ -33,7 +33,7 @@ + +
    +
    +- @foreach (var tab in _tabs.OrderBy(x => x.TabIndex)) ++ @foreach (var tab in _tabs) + { + @tab.RenderTab + } +@@ -90,13 +90,14 @@ +
    + + } ++ + internal void RenderTabPanels(RenderTreeBuilder __builder) + { +
    +
    + @foreach (var tab in _tabs) + { +- @tab.RenderPane ++ __builder.AddContent(tab.GetHashCode(), tab.RenderPane); + } +
    +
    +diff --git a/components/tabs/Tabs.razor.cs b/components/tabs/Tabs.razor.cs +index 601bb2a4c9..14123769f2 100644 +--- a/components/tabs/Tabs.razor.cs ++++ b/components/tabs/Tabs.razor.cs +@@ -320,6 +320,11 @@ internal void AddTabPane(TabPane tabPane) + + internal void Complete() + { ++ if (_afterFirstRender) ++ { ++ return; ++ } ++ + if (!string.IsNullOrWhiteSpace(ActiveKey)) + { + var activedPane = _tabs.Find(x => x.Key == ActiveKey); +@@ -372,15 +377,20 @@ internal void RemovePane(TabPane tab) + if (IsDisposed) + return; + ++ // reorder tabs ++ _tabs.OrderBy(x => x.TabIndex).ForEach((x, i) => x.SetIndex(i)); ++ + // if it is active, need to activiate the previous tab. + if (ActiveKey == tab.Key) + { + Previous(); + } + +- _tabs.Remove(tab); ++ _shouldRender = true; ++ _needUpdateScrollListPosition = tab.TabIndex != _tabs.Count - 1; // only update scroll list position when active tab is not the last one + +- _needUpdateScrollListPosition = true; ++ _tabs.Remove(tab); ++ StateHasChanged(); + } + + internal async Task HandleTabClick(TabPane tabPane) +@@ -398,21 +408,27 @@ internal async Task HandleTabClick(TabPane tabPane) + + internal void HandleKeydown(KeyboardEventArgs e, TabPane tabPane) + { +- var tabIndex = _tabs.FindIndex(p => p.Key == tabPane.Key); + switch (e.Code) + { +- case ""Enter"" or ""NumpadEnter"": NavigateToTab(tabPane); break; +- case ""ArrowLeft"": NavigateToTab(_tabs[Math.Max(0, tabIndex - 1)]); break; +- case ""ArrowRight"": NavigateToTab(_tabs[Math.Min(_tabs.Count - 1, tabIndex + 1)]); break; +- case ""ArrowUp"": NavigateToTab(_tabs[0]); break; +- case ""ArrowDown"": NavigateToTab(_tabs[^1]); break; ++ case ""Enter"" or ""NumpadEnter"": GoTo(tabPane.TabIndex); break; ++ case ""ArrowLeft"": Previous(); break; ++ case ""ArrowRight"": Next(); break; ++ case ""ArrowUp"": GoTo(0); break; ++ case ""ArrowDown"": GoTo(_tabs.Count - 1); break; + default: return; + } + } + +- private void NavigateToTab(TabPane tabPane) ++ /// ++ /// Activate the tab with the specified index ++ /// ++ /// ++ [PublicApi(""1.0.0"")] ++ public void GoTo(int tabIndex) + { +- ActivatePane(tabPane.Key); ++ var activeIndex = Math.Min(_tabs.Count - 1, Math.Max(0, tabIndex)); ++ var tab = _tabs.Find(x => x.TabIndex == activeIndex); ++ ActivatePane(tab.Key); + } + + /// +@@ -421,8 +437,7 @@ private void NavigateToTab(TabPane tabPane) + [PublicApi(""1.0.0"")] + public void Next() + { +- var currentIndex = _tabs.FindIndex(p => p.Key == ActiveKey); +- NavigateToTab(_tabs[Math.Min(_tabs.Count - 1, currentIndex + 1)]); ++ GoTo(_activeTab.TabIndex + 1); + } + + /// +@@ -431,8 +446,7 @@ public void Next() + [PublicApi(""1.0.0"")] + public void Previous() + { +- var currentIndex = _tabs.FindIndex(p => p.Key == ActiveKey); +- NavigateToTab(_tabs[Math.Max(0, currentIndex - 1)]); ++ GoTo(_activeTab.TabIndex - 1); + } + + /// +@@ -445,7 +459,6 @@ public void ActivatePane(string key) + if (_tabs.Count == 0) + return; + +- var tabIndex = _tabs.FindIndex(p => p.Key == key); + var tab = _tabs.Find(p => p.Key == key); + + if (tab == null) +@@ -766,8 +779,8 @@ internal void HandleDrop(TabPane tab) + { + if (Draggable && _draggingTab != null) + { +- var oldIndex = _tabs.IndexOf(_draggingTab); +- var newIndex = _tabs.IndexOf(tab); ++ var oldIndex = _draggingTab.TabIndex; ++ var newIndex = tab.TabIndex; + + if (oldIndex == newIndex) + { +@@ -776,7 +789,12 @@ internal void HandleDrop(TabPane tab) + + tab.ExchangeWith(_draggingTab); + +- var diffTabs = newIndex < oldIndex ? _tabs.GetRange(newIndex, oldIndex - newIndex) : _tabs.GetRange(oldIndex, newIndex - oldIndex); ++ /* Exchange example: ++ * 1,2,3,4,5,6 -> 1,5,3,4,2,6 ++ * ^ ^ ++ */ ++ var diffTabs = newIndex < oldIndex ? _tabs.Where(x => x.TabIndex == newIndex && x.TabIndex < oldIndex).ToList() ++ : _tabs.Where(x => x.TabIndex > oldIndex && x.TabIndex == newIndex).ToList(); + + for (var i = diffTabs.Count - 2; i >= 0; i--) + { +@@ -787,8 +805,7 @@ internal void HandleDrop(TabPane tab) + _shouldRender = true; + _renderedActivePane = null; + _needUpdateScrollListPosition = true; +- +- ActivatePane(_activeKey); ++ StateHasChanged(); + } + } + +diff --git a/site/AntDesign.Docs/Demos/Components/Tabs/demo/ContextMenu.razor b/site/AntDesign.Docs/Demos/Components/Tabs/demo/ContextMenu.razor +index 6180c4e312..94ee8af2df 100644 +--- a/site/AntDesign.Docs/Demos/Components/Tabs/demo/ContextMenu.razor ++++ b/site/AntDesign.Docs/Demos/Components/Tabs/demo/ContextMenu.razor +@@ -1,4 +1,4 @@ +- ++ + @foreach (var pane in panes) + { + +diff --git a/site/AntDesign.Docs/Demos/Components/Tabs/doc/index.en-US.md b/site/AntDesign.Docs/Demos/Components/Tabs/doc/index.en-US.md +index 508317a917..6096e1242a 100644 +--- a/site/AntDesign.Docs/Demos/Components/Tabs/doc/index.en-US.md ++++ b/site/AntDesign.Docs/Demos/Components/Tabs/doc/index.en-US.md +@@ -16,6 +16,17 @@ Ant Design has 3 types of Tabs for different situations. + - Normal Tabs: for EventCallbackal aspects of a page. + - [RadioButton](/components/radio/#components-radio-demo-radiobutton): for secondary tabs. + ++ ++## Supports keyboard navigation ++ ++Keyboard navigation is available when the focus is on the tab. ++ ++- ArrowLeft: navigate to previous tab ++- ArrowRight: navigate to next tab ++- ArrowUp: navigate to first tab ++- ArrowDown: navigate to last tab ++- Enter: navigate to currently focused tab ++ + ## API + + ### Tabs +diff --git a/site/AntDesign.Docs/Demos/Components/Tabs/doc/index.zh-CN.md b/site/AntDesign.Docs/Demos/Components/Tabs/doc/index.zh-CN.md +index 13d540d2a1..433006e342 100644 +--- a/site/AntDesign.Docs/Demos/Components/Tabs/doc/index.zh-CN.md ++++ b/site/AntDesign.Docs/Demos/Components/Tabs/doc/index.zh-CN.md +@@ -19,6 +19,16 @@ Ant Design 依次提供了三级选项卡,分别用于不同的场景。 + - 既可用于容器顶部,也可用于容器内部,是最通用的 Tabs。 + - [RadioButton](/components/radio/#components-radio-demo-radiobutton) 可作为更次级的页签来使用。 + ++## 支持键盘导航 ++ ++当焦点在标签上时,可用键盘导航 ++ ++- 左键:导航到前一个选项卡 ++- 右键:导航到后一个选项卡 ++- 上键:导航到第一个选项卡 ++- 下键:导航到最后一个选项卡 ++- 回车键:导航到当前焦点选项卡 ++ + ## API + + ### Tabs +diff --git a/tests/AntDesign.Tests/Card/Card.Render.Tests.razor b/tests/AntDesign.Tests/Card/Card.Render.Tests.razor +index d5a4e8880c..6cb9e8a314 100644 +--- a/tests/AntDesign.Tests/Card/Card.Render.Tests.razor ++++ b/tests/AntDesign.Tests/Card/Card.Render.Tests.razor +@@ -60,12 +60,12 @@ +
    +
    +
    +-
    ++
    +
    + Tab 1 +
    +
    +-
    ++
    +
    + Tab 2 +
    " +portainer,https://github.com/portainer/portainer,b349f16090886cf4d7905c160df0e4c1b775ee14,cedric-crouzet-penbase,2018-06-13 19:34:24,fix(containers): remove hardcoded container stop/restart timeout,"REST call to stop/restart a container overrides the default stop timeout (before kill) with hardcoded 5 seconds. +Containers already have a default stop timeout handled by the engine API (https://github.com/moby/moby/blob/master/client/container_stop.go). +With this hardcoded 5 seconds, the containers get killed after 5 seconds even if they define a custom greater stop timeout. +Another solution would be to not hardcode the 5 seconds but rather use a global editable setting.","fix(containers): remove hardcoded container stop/restart timeout + +REST call to stop/restart a container overrides the default stop timeout (before kill) with hardcoded 5 seconds. +Containers already have a default stop timeout handled by the engine API (https://github.com/moby/moby/blob/master/client/container_stop.go). +With this hardcoded 5 seconds, the containers get killed after 5 seconds even if they define a custom greater stop timeout. +Another solution would be to not hardcode the 5 seconds but rather use a global editable setting.","diff --git a/app/docker/rest/container.js b/app/docker/rest/container.js +index 9f35d18d8c39e..d100d5a1cb590 100644 +--- a/app/docker/rest/container.js ++++ b/app/docker/rest/container.js +@@ -15,10 +15,10 @@ function ContainerFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider) { + method: 'GET', params: { action: 'json' } + }, + stop: { +- method: 'POST', params: { id: '@id', t: 5, action: 'stop' } ++ method: 'POST', params: { id: '@id', action: 'stop' } + }, + restart: { +- method: 'POST', params: { id: '@id', t: 5, action: 'restart' } ++ method: 'POST', params: { id: '@id', action: 'restart' } + }, + kill: { + method: 'POST', params: { id: '@id', action: 'kill' }" +leetcode,https://github.com/doocs/leetcode,b9e714ede1505be7f8ee94eb0ff71002125036ee,yanglbme,2023-01-09 19:53:08,feat: add solutions to lc problem: No.1577,"No.1577.Number of Ways Where Square of Number Is Equal to Product of Two +Numbers","feat: add solutions to lc problem: No.1577 + +No.1577.Number of Ways Where Square of Number Is Equal to Product of Two +Numbers","diff --git a/solution/1500-1599/1577.Number of Ways Where Square of Number Is Equal to Product of Two Numbers/README.md b/solution/1500-1599/1577.Number of Ways Where Square of Number Is Equal to Product of Two Numbers/README.md +index f0c2067bfaf30..3c28196329d18 100644 +--- a/solution/1500-1599/1577.Number of Ways Where Square of Number Is Equal to Product of Two Numbers/README.md ++++ b/solution/1500-1599/1577.Number of Ways Where Square of Number Is Equal to Product of Two Numbers/README.md +@@ -59,6 +59,19 @@ + + + ++**方法一:哈希表** ++ ++我们用哈希表 `cnt1` 统计 `nums1` 中每个数出现的次数,用哈希表 `cnt2` 统计 `nums2` 中每个数出现的次数。 ++ ++然后我们双重循环遍历两个哈希表,记当前 `cnt1` 遍历到的键值对为 $(a, x)$,当前 `cnt2` 遍历到的键值对为 $(b, y)$。接下来分情况讨论: ++ ++- 如果 $a^2$ 能被 $b$ 整除,设 $c=\frac{a^2}{b}$,若 $b=c$,那么答案加上 $x \times y \times (y - 1)$,否则答案加上 $x \times y \times cnt2[c]$。 ++- 如果 $b^2$ 能被 $a$ 整除,设 $c=\frac{b^2}{a}$,若 $a=c$,那么答案加上 $x \times (x - 1) \times y$,否���答案加上 $x \times cnt1[c] \times y$。 ++ ++最后将答案除以 $2$ 返回即可。 ++ ++时间复杂度 $O(n \times m)$,空间复杂度 $O(n + m)$。其中 $n$ 和 $m$ 分别为数组 `nums1` 和 `nums2` 的长度。 ++ + + + ### **Python3** +@@ -66,7 +79,26 @@ + + + ```python +- ++class Solution: ++ def numTriplets(self, nums1: List[int], nums2: List[int]) -> int: ++ cnt1 = Counter(nums1) ++ cnt2 = Counter(nums2) ++ ans = 0 ++ for a, x in cnt1.items(): ++ for b, y in cnt2.items(): ++ if a * a % b == 0: ++ c = a * a // b ++ if b == c: ++ ans += x * y * (y - 1) ++ else: ++ ans += x * y * cnt2[c] ++ if b * b % a == 0: ++ c = b * b // a ++ if a == c: ++ ans += x * (x - 1) * y ++ else: ++ ans += x * y * cnt1[c] ++ return ans >> 1 + ``` + + ### **Java** +@@ -74,7 +106,79 @@ + + + ```java ++class Solution { ++ public int numTriplets(int[] nums1, int[] nums2) { ++ Map cnt1 = new HashMap<>(); ++ Map cnt2 = new HashMap<>(); ++ for (int v : nums1) { ++ cnt1.put(v, cnt1.getOrDefault(v, 0) + 1); ++ } ++ for (int v : nums2) { ++ cnt2.put(v, cnt2.getOrDefault(v, 0) + 1); ++ } ++ long ans = 0; ++ for (var e1 : cnt1.entrySet()) { ++ long a = e1.getKey(), x = e1.getValue(); ++ for (var e2 : cnt2.entrySet()) { ++ long b = e2.getKey(), y = e2.getValue(); ++ if ((a * a) % b == 0) { ++ long c = a * a / b; ++ if (b == c) { ++ ans += x * y * (y - 1); ++ } else { ++ ans += x * y * cnt2.getOrDefault((int) c, 0); ++ } ++ } ++ if ((b * b) % a == 0) { ++ long c = b * b / a; ++ if (a == c) { ++ ans += x * (x - 1) * y; ++ } else { ++ ans += x * y * cnt1.getOrDefault((int) c, 0); ++ } ++ } ++ } ++ } ++ return (int) (ans >> 1); ++ } ++} ++``` + ++### **Go** ++ ++```go ++func numTriplets(nums1 []int, nums2 []int) (ans int) { ++ cnt1 := map[int]int{} ++ cnt2 := map[int]int{} ++ for _, v := range nums1 { ++ cnt1[v]++ ++ } ++ for _, v := range nums2 { ++ cnt2[v]++ ++ } ++ for a, x := range cnt1 { ++ for b, y := range cnt2 { ++ if a*a%b == 0 { ++ c := a * a / b ++ if b == c { ++ ans += x * y * (y - 1) ++ } else { ++ ans += x * y * cnt2[c] ++ } ++ } ++ if b*b%a == 0 { ++ c := b * b / a ++ if a == c { ++ ans += x * (x - 1) * y ++ } else { ++ ans += x * y * cnt1[c] ++ } ++ } ++ } ++ } ++ ans /= 2 ++ return ++} + ``` + + ### **...** +diff --git a/solution/1500-1599/1577.Number of Ways Where Square of Number Is Equal to Product of Two Numbers/README_EN.md b/solution/1500-1599/1577.Number of Ways Where Square of Number Is Equal to Product of Two Numbers/README_EN.md +index 0af715f56d2f9..b58f044614948 100644 +--- a/solution/1500-1599/1577.Number of Ways Where Square of Number Is Equal to Product of Two Numbers/README_EN.md ++++ b/solution/1500-1599/1577.Number of Ways Where Square of Number Is Equal to Product of Two Numbers/README_EN.md +@@ -55,13 +55,104 @@ Type 2: (3,0,1). nums2[3]2 = nums1[0] * nums1[1]. + ### **Python3** + + ```python +- ++class Solution: ++ def numTriplets(self, nums1: List[int], nums2: List[int]) -> int: ++ cnt1 = Counter(nums1) ++ cnt2 = Counter(nums2) ++ ans = 0 ++ for a, x in cnt1.items(): ++ for b, y in cnt2.items(): ++ if a * a % b == 0: ++ c = a * a // b ++ if b == c: ++ ans += x * y * (y - 1) ++ else: ++ ans += x * y * cnt2[c] ++ if b * b % a == 0: ++ c = b * b // a ++ if a == c: ++ ans += x * (x - 1) * y ++ else: ++ ans += x * y * cnt1[c] ++ return ans >> 1 + ``` + + ### **Java** + + ```java ++class Solution { ++ public int numTriplets(int[] nums1, int[] nums2) { ++ Map cnt1 = new HashMap<>(); ++ Map cnt2 = new HashMap<>(); ++ for (int v : nums1) { ++ cnt1.put(v, cnt1.getOrDefault(v, 0) + 1); ++ } ++ for (int v : nums2) { ++ cnt2.put(v, cnt2.getOrDefault(v, 0) + 1); ++ } ++ long ans = 0; ++ for (var e1 : cnt1.entrySet()) { ++ long a = e1.getKey(), x = e1.getValue(); ++ for (var e2 : cnt2.entrySet()) { ++ long b = e2.getKey(), y = e2.getValue(); ++ if ((a * a) % b == 0) { ++ long c = a * a / b; ++ if (b == c) { ++ ans += x * y * (y - 1); ++ } else { ++ ans += x * y * cnt2.getOrDefault((int) c, 0); ++ } ++ } ++ if ((b * b) % a == 0) { ++ long c = b * b / a; ++ if (a == c) { ++ ans += x * (x - 1) * y; ++ } else { ++ ans += x * y * cnt1.getOrDefault((int) c, 0); ++ } ++ } ++ } ++ } ++ return (int) (ans >> 1); ++ } ++} ++``` + ++### **Go** ++ ++```go ++func numTriplets(nums1 []int, nums2 []int) (ans int) { ++ cnt1 := map[int]int{} ++ cnt2 := map[int]int{} ++ for _, v := range nums1 { ++ cnt1[v]++ ++ } ++ for _, v := range nums2 { ++ cnt2[v]++ ++ } ++ for a, x := range cnt1 { ++ for b, y := range cnt2 { ++ if a*a%b == 0 { ++ c := a * a / b ++ if b == c { ++ ans += x * y * (y - 1) ++ } else { ++ ans += x * y * cnt2[c] ++ } ++ } ++ if b*b%a == 0 { ++ c := b * b / a ++ if a == c { ++ ans += x * (x - 1) * y ++ } else { ++ ans += x * y * cnt1[c] ++ } ++ } ++ } ++ } ++ ans /= 2 ++ return ++} + ``` + + ### **...** +diff --git a/solution/1500-1599/1577.Number of Ways Where Square of Number Is Equal to Product of Two Numbers/Solution.go b/solution/1500-1599/1577.Number of Ways Where Square of Number Is Equal to Product of Two Numbers/Solution.go +new file mode 100644 +index 0000000000000..315f63acb7e6e +--- /dev/null ++++ b/solution/1500-1599/1577.Number of Ways Where Square of Number Is Equal to Product of Two Numbers/Solution.go +@@ -0,0 +1,32 @@ ++func numTriplets(nums1 []int, nums2 []int) (ans int) { ++ cnt1 := map[int]int{} ++ cnt2 := map[int]int{} ++ for _, v := range nums1 { ++ cnt1[v]++ ++ } ++ for _, v := range nums2 { ++ cnt2[v]++ ++ } ++ for a, x := range cnt1 { ++ for b, y := range cnt2 { ++ if a*a%b == 0 { ++ c := a * a / b ++ if b == c { ++ ans += x * y * (y - 1) ++ } else { ++ ans += x * y * cnt2[c] ++ } ++ } ++ if b*b%a == 0 { ++ c := b * b / a ++ if a == c { ++ ans += x * (x - 1) * y ++ } else { ++ ans += x * y * cnt1[c] ++ } ++ } ++ } ++ } ++ ans /= 2 ++ return ++} +\ No newline at end of file +diff --git a/solution/1500-1599/1577.Number of Ways Where Square of Number Is Equal to Product of Two Numbers/Solution.java b/solution/1500-1599/1577.Number of Ways Where Square of Number Is Equal to Product of Two Numbers/Solution.java +new file mode 100644 +index 0000000000000..4207859d3bf75 +--- /dev/null ++++ b/solution/1500-1599/1577.Number of Ways Where Square of Number Is Equal to Product of Two Numbers/Solution.java +@@ -0,0 +1,36 @@ ++class Solution { ++ public int numTriplets(int[] nums1, int[] nums2) { ++ Map cnt1 = new HashMap<>(); ++ Map cnt2 = new HashMap<>(); ++ for (int v : nums1) { ++ cnt1.put(v, cnt1.getOrDefault(v, 0) + 1); ++ } ++ for (int v : nums2) { ++ cnt2.put(v, cnt2.getOrDefault(v, 0) + 1); ++ } ++ long ans = 0; ++ for (var e1 : cnt1.entrySet()) { ++ long a = e1.getKey(), x = e1.getValue(); ++ for (var e2 : cnt2.entrySet()) { ++ long b = e2.getKey(), y = e2.getValue(); ++ if ((a * a) % b == 0) { ++ long c = a * a / b; ++ if (b == c) { ++ ans += x * y * (y - 1); ++ } else { ++ ans += x * y * cnt2.getOrDefault((int) c, 0); ++ } ++ } ++ if ((b * b) % a == 0) { ++ long c = b * b / a; ++ if (a == c) { ++ ans += x * (x - 1) * y; ++ } else { ++ ans += x * y * cnt1.getOrDefault((int) c, 0); ++ } ++ } ++ } ++ } ++ return (int) (ans >> 1); ++ } ++} +\ No newline at end of file +diff --git a/solution/1500-1599/1577.Number of Ways Where Square of Number Is Equal to Product of Two Numbers/Solution.py b/solution/1500-1599/1577.Number of Ways Where Square of Number Is Equal to Product of Two Numbers/Solution.py +new file mode 100644 +index 0000000000000..9fc9254dd63a9 +--- /dev/null ++++ b/solution/1500-1599/1577.Number of Ways Where Square of Number Is Equal to Product of Two Numbers/Solution.py +@@ -0,0 +1,20 @@ ++class Solution: ++ def numTriplets(self, nums1: List[int], nums2: List[int]) -> int: ++ cnt1 = Counter(nums1) ++ cnt2 = Counter(nums2) ++ ans = 0 ++ for a, x in cnt1.items(): ++ for b, y in cnt2.items(): ++ if a * a % b == 0: ++ c = a * a // b ++ if b == c: ++ ans += x * y * (y - 1) ++ else: ++ ans += x * y * cnt2[c] ++ if b * b % a == 0: ++ c = b * b // a ++ if a == c: ++ ans += x * (x - 1) * y ++ else: ++ ans += x * y * cnt1[c] ++ return ans >> 1" +amis,https://github.com/baidu/amis,48889dc8db0ef5f5d02e3b4a870934f50537bae8,qkiroc,2023-12-04 14:48:57,style: 优化checkbox组件样式 (#8986),"* style: 优化checkbox组件样式 + +* style: 优化checkbox换行样式 + +* 删除无用样式 + +---------","style: 优化checkbox组件样式 (#8986) + +* style: 优化checkbox组件样式 + +* style: 优化checkbox换行样式 + +* 删除无用样式 + +--------- + +Co-authored-by: qinhaoyan <30946345+qinhaoyan@users.noreply.github.com>","diff --git a/packages/amis-ui/scss/_components.scss b/packages/amis-ui/scss/_components.scss +index 8b8f61247ad..a2445e7234b 100644 +--- a/packages/amis-ui/scss/_components.scss ++++ b/packages/amis-ui/scss/_components.scss +@@ -1287,7 +1287,6 @@ + --checkbox-checkbox-default-height: var(--sizes-size-9); + --checkbox-checkbox-default-bg-color: var(--colors-neutral-fill-11); + --checkbox-checkbox-default-text-color: var(--colors-neutral-text-2); +- --checkbox-checkbox-default-lineHeight: var(--fonts-lineHeight-2); + --checkbox-checkbox-default-fontWeight: var(--fonts-weight-6); + --checkbox-checkbox-default-fontSize: var(--fonts-size-7); + --checkbox-checkbox-default-top-border-color: var(--colors-neutral-line-8); +diff --git a/packages/amis-ui/scss/components/form/_checks.scss b/packages/amis-ui/scss/components/form/_checks.scss +index e116a38afcd..ad038f077d0 100644 +--- a/packages/amis-ui/scss/components/form/_checks.scss ++++ b/packages/amis-ui/scss/components/form/_checks.scss +@@ -37,7 +37,6 @@ + cursor: pointer; + display: inline-block; + vertical-align: top; +- line-height: var(--checkbox-checkbox-default-lineHeight); + + > a { + // float: right;" +kanidm,https://github.com/kanidm/kanidm,2a9cacc221ad7975e21c3422eda3b5dbcba87637,dependabot[bot],2023-09-04 06:30:38,chore(deps-dev): bump ruff from 0.0.286 to 0.0.287 in /pykanidm (#2061),"Bumps [ruff](https://github.com/astral-sh/ruff) from 0.0.286 to 0.0.287. +- [Release notes](https://github.com/astral-sh/ruff/releases) +- [Changelog](https://github.com/astral-sh/ruff/blob/main/BREAKING_CHANGES.md) +- [Commits](https://github.com/astral-sh/ruff/compare/v0.0.286...v0.0.287) + +---","chore(deps-dev): bump ruff from 0.0.286 to 0.0.287 in /pykanidm (#2061) + +Bumps [ruff](https://github.com/astral-sh/ruff) from 0.0.286 to 0.0.287. +- [Release notes](https://github.com/astral-sh/ruff/releases) +- [Changelog](https://github.com/astral-sh/ruff/blob/main/BREAKING_CHANGES.md) +- [Commits](https://github.com/astral-sh/ruff/compare/v0.0.286...v0.0.287) + +--- +updated-dependencies: +- dependency-name: ruff + dependency-type: direct:development + update-type: version-update:semver-patch +... + +Signed-off-by: dependabot[bot] +Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>","diff --git a/pykanidm/poetry.lock b/pykanidm/poetry.lock +index aff34debe5..ab5363c9fc 100644 +--- a/pykanidm/poetry.lock ++++ b/pykanidm/poetry.lock +@@ -1965,28 +1965,28 @@ files = [ + + [[package]] + name = ""ruff"" +-version = ""0.0.286"" ++version = ""0.0.287"" + description = ""An extremely fast Python linter, written in Rust."" + optional = false + python-versions = "">=3.7"" + files = [ +- {file = ""ruff-0.0.286-py3-none-macosx_10_7_x86_64.whl"", hash = ""sha256:8e22cb557e7395893490e7f9cfea1073d19a5b1dd337f44fd81359b2767da4e9""}, +- {file = ""ruff-0.0.286-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl"", hash = ""sha256:68ed8c99c883ae79a9133cb1a86d7130feee0397fdf5ba385abf2d53e178d3fa""}, +- {file = ""ruff-0.0.286-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl"", hash = ""sha256:8301f0bb4ec1a5b29cfaf15b83565136c47abefb771603241af9d6038f8981e8""}, +- {file = ""ruff-0.0.286-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl"", hash = ""sha256:acc4598f810bbc465ce0ed84417ac687e392c993a84c7eaf3abf97638701c1ec""}, +- {file = ""ruff-0.0.286-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl"", hash = ""sha256:88c8e358b445eb66d47164fa38541cfcc267847d1e7a92dd186dddb1a0a9a17f""}, +- {file = ""ruff-0.0.286-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl"", hash = ""sha256:0433683d0c5dbcf6162a4beb2356e820a593243f1fa714072fec15e2e4f4c939""}, +- {file = ""ruff-0.0.286-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl"", hash = ""sha256:ddb61a0c4454cbe4623f4a07fef03c5ae921fe04fede8d15c6e36703c0a73b07""}, +- {file = ""ruff-0.0.286-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl"", hash = ""sha256:47549c7c0be24c8ae9f2bce6f1c49fbafea83bca80142d118306f08ec7414041""}, +- {file = ""ruff-0.0.286-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"", hash = ""sha256:559aa793149ac23dc4310f94f2c83209eedb16908a0343663be19bec42233d25""}, +- {file = ""ruff-0.0.286-py3-none-musllinux_1_2_aarch64.whl"", hash = ""sha256:d73cfb1c3352e7aa0ce6fb2321f36fa1d4a2c48d2ceac694cb03611ddf0e4db6""}, +- {file = ""ruff-0.0.286-py3-none-musllinux_1_2_armv7l.whl"", hash = ""sha256:3dad93b1f973c6d1db4b6a5da8690c5625a3fa32bdf38e543a6936e634b83dc3""}, +- {file = ""ruff-0.0.286-py3-none-musllinux_1_2_i686.whl"", hash = ""sha256:26afc0851f4fc3738afcf30f5f8b8612a31ac3455cb76e611deea80f5c0bf3ce""}, +- {file = ""ruff-0.0.286-py3-none-musllinux_1_2_x86_64.whl"", hash = ""sha256:9b6b116d1c4000de1b9bf027131dbc3b8a70507788f794c6b09509d28952c512""}, +- {file = ""ruff-0.0.286-py3-none-win32.whl"", hash = ""sha256:556e965ac07c1e8c1c2d759ac512e526ecff62c00fde1a046acb088d3cbc1a6c""}, +- {file = ""ruff-0.0.286-py3-none-win_amd64.whl"", hash = ""sha256:5d295c758961376c84aaa92d16e643d110be32add7465e197bfdaec5a431a107""}, +- {file = ""ruff-0.0.286-py3-none-win_arm64.whl"", hash = ""sha256:1d6142d53ab7f164204b3133d053c4958d4d11ec3a39abf23a40b13b0784e3f0""}, +- {file = ""ruff-0.0.286.tar.gz"", hash = ""sha256:f1e9d169cce81a384a26ee5bb8c919fe9ae88255f39a1a69fd1ebab233a85ed2""}, ++ {file = ""ruff-0.0.287-py3-none-macosx_10_7_x86_64.whl"", hash = ""sha256:1e0f9ee4c3191444eefeda97d7084721d9b8e29017f67997a20c153457f2eafd""}, ++ {file = ""ruff-0.0.287-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl"", hash = ""sha256:e9843e5704d4fb44e1a8161b0d31c1a38819723f0942639dfeb53d553be9bfb5""}, ++ {file = ""ruff-0.0.287-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl"", hash = ""sha256:8ca1ed11d759a29695aed2bfc7f914b39bcadfe2ef08d98ff69c873f639ad3a8""}, ++ {file = ""ruff-0.0.287-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl"", hash = ""sha256:1cf4d5ad3073af10f186ea22ce24bc5a8afa46151f6896f35c586e40148ba20b""}, ++ {file = ""ruff-0.0.287-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl"", hash = ""sha256:66d9d58bcb29afd72d2afe67120afcc7d240efc69a235853813ad556443dc922""}, ++ {file = ""ruff-0.0.287-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl"", hash = ""sha256:06ac5df7dd3ba8bf83bba1490a72f97f1b9b21c7cbcba8406a09de1a83f36083""}, ++ {file = ""ruff-0.0.287-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl"", hash = ""sha256:2bfb478e1146a60aa740ab9ebe448b1f9e3c0dfb54be3cc58713310eef059c30""}, ++ {file = ""ruff-0.0.287-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl"", hash = ""sha256:00d579a011949108c4b4fa04c4f1ee066dab536a9ba94114e8e580c96be2aeb4""}, ++ {file = ""ruff-0.0.287-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"", hash = ""sha256:d3a810a79b8029cc92d06c36ea1f10be5298d2323d9024e1d21aedbf0a1a13e5""}, ++ {file = ""ruff-0.0.287-py3-none-musllinux_1_2_aarch64.whl"", hash = ""sha256:150007028ad4976ce9a7704f635ead6d0e767f73354ce0137e3e44f3a6c0963b""}, ++ {file = ""ruff-0.0.287-py3-none-musllinux_1_2_armv7l.whl"", hash = ""sha256:a24a280db71b0fa2e0de0312b4aecb8e6d08081d1b0b3c641846a9af8e35b4a7""}, ++ {file = ""ruff-0.0.287-py3-none-musllinux_1_2_i686.whl"", hash = ""sha256:2918cb7885fa1611d542de1530bea3fbd63762da793751cc8c8d6e4ba234c3d8""}, ++ {file = ""ruff-0.0.287-py3-none-musllinux_1_2_x86_64.whl"", hash = ""sha256:33d7b251afb60bec02a64572b0fd56594b1923ee77585bee1e7e1daf675e7ae7""}, ++ {file = ""ruff-0.0.287-py3-none-win32.whl"", hash = ""sha256:022f8bed2dcb5e5429339b7c326155e968a06c42825912481e10be15dafb424b""}, ++ {file = ""ruff-0.0.287-py3-none-win_amd64.whl"", hash = ""sha256:26bd0041d135a883bd6ab3e0b29c42470781fb504cf514e4c17e970e33411d90""}, ++ {file = ""ruff-0.0.287-py3-none-win_arm64.whl"", hash = ""sha256:44bceb3310ac04f0e59d4851e6227f7b1404f753997c7859192e41dbee9f5c8d""}, ++ {file = ""ruff-0.0.287.tar.gz"", hash = ""sha256:02dc4f5bf53ef136e459d467f3ce3e04844d509bc46c025a05b018feb37bbc39""}, + ] + + [[package]] +@@ -2311,4 +2311,4 @@ testing = [""big-O"", ""jaraco.functools"", ""jaraco.itertools"", ""more-itertools"", ""p + [metadata] + lock-version = ""2.0"" + python-versions = ""^3.9"" +-content-hash = ""f3dc030564d0b27c359f56f2d4f962a4e151065fd2c6340896f47eccb81599f4"" ++content-hash = ""495a17e97f4732356c5d83306a92cd5a455ab060ffd8937822561f0cde928f0b"" +diff --git a/pykanidm/pyproject.toml b/pykanidm/pyproject.toml +index 686b4fb2a3..2177334539 100644 +--- a/pykanidm/pyproject.toml ++++ b/pykanidm/pyproject.toml +@@ -45,7 +45,7 @@ mkdocstrings-python = ""^1.6.0"" + pook = ""^1.1.1"" + + [tool.poetry.group.dev.dependencies] +-ruff = "">=0.0.230,<0.0.287"" ++ruff = "">=0.0.230,<0.0.288"" + + [build-system] + requires = [""poetry-core>=1.0.0""]" +nocobase,https://github.com/nocobase/nocobase,12ba257cf63287199510bc2867aeff37508a17c0,ChengLei Shao,2024-04-26 07:44:37,chore: define collection debug message (#4176),"* chore: define collection debug message + +* chore: safe debug log + +* chore: safe debug log","chore: define collection debug message (#4176) + +* chore: define collection debug message + +* chore: safe debug log + +* chore: safe debug log","diff --git a/packages/core/database/package.json b/packages/core/database/package.json +index cfac0973ce73d..cf81c5450ad28 100644 +--- a/packages/core/database/package.json ++++ b/packages/core/database/package.json +@@ -26,7 +26,8 @@ + ""semver"": ""^7.3.7"", + ""sequelize"": ""^6.26.0"", + ""umzug"": ""^3.1.1"", +- ""uuid"": ""^9.0.1"" ++ ""uuid"": ""^9.0.1"", ++ ""safe-json-stringify"": ""^1.2.0"" + }, + ""devDependencies"": { + ""@types/glob"": ""^7.2.0"" +diff --git a/packages/core/database/src/collection.ts b/packages/core/database/src/collection.ts +index dc997bc651290..e83d91a7ad745 100644 +--- a/packages/core/database/src/collection.ts ++++ b/packages/core/database/src/collection.ts +@@ -17,6 +17,7 @@ import { Model } from './model'; + import { AdjacencyListRepository } from './repositories/tree-repository/adjacency-list-repository'; + import { Repository } from './repository'; + import { checkIdentifier, md5, snakeCase } from './utils'; ++import safeJsonStringify from 'safe-json-stringify'; + + export type RepositoryType = typeof Repository; + +@@ -275,6 +276,7 @@ export class Collection< + getFields() { + return [...this.fields.values()]; + } ++ + addField(name: string, options: FieldOptions): Field { + return this.setField(name, options); + } +@@ -318,6 +320,8 @@ export class Collection< + + const { database } = this.context; + ++ database.logger.debug(`beforeSetField: ${this.name}, ${name}, ${safeJsonStringify(options)}`); ++ + if (options.source) { + const [sourceCollectionName, sourceFieldName] = options.source.split('.'); + const sourceCollection = this.db.collections.get(sourceCollectionName); +diff --git a/packages/core/database/src/database.ts b/packages/core/database/src/database.ts +index e50f5044bab40..33ce9088ec3ac 100644 +--- a/packages/core/database/src/database.ts ++++ b/packages/core/database/src/database.ts +@@ -6,6 +6,7 @@ import { EventEmitter } from 'events'; + import { backOff } from 'exponential-backoff'; + import glob from 'glob'; + import lodash from 'lodash'; ++import safeJsonStringify from 'safe-json-stringify'; + import { nanoid } from 'nanoid'; + import { basename, isAbsolute, resolve } from 'path'; + import semver from 'semver'; +@@ -537,6 +538,8 @@ export class Database extends EventEmitter implements AsyncEmitter { + options.underscored = true; + } + ++ this.logger.debug(`beforeDefineCollection: ${safeJsonStringify(options)}`); ++ + this.emit('beforeDefineCollection', options); + + const collection = this.collectionFactory.createCollection(options); +diff --git a/yarn.lock b/yarn.lock +index a5e4b4c92345f..d691fb027e2d2 100644 +--- a/yarn.lock ++++ b/yarn.lock +@@ -23240,6 +23240,11 @@ safe-buffer@5.2.1, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, s + resolved ""https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + ++safe-json-stringify@^1.2.0: ++ version ""1.2.0"" ++ resolved ""https://registry.npmmirror.com/safe-json-stringify/-/safe-json-stringify-1.2.0.tgz#356e44bc98f1f93ce45df14bcd7c01cda86e0afd"" ++ integrity sha512-gH8eh2nZudPQO6TytOvbxnuhYBOvDBBLW52tz5q6X58lJcd/tkmqFR+5Z9adS8aJtURSXWThWy/xJtJwixErvg== ++ + safe-regex-test@^1.0.0: + version ""1.0.0"" + resolved ""https://registry.npmmirror.com/safe-regex-test/-/safe-regex-test-1.0.0.tgz#793b874d524eb3640d1873aad03596db2d4f2295""" +leetcode,https://github.com/doocs/leetcode,36d3a402b67cf73fe37c9824d439525f733dd79d,Libin YANG,2024-06-28 06:04:16,feat: add solutions to lcci/lcof problems (#3170),lcci 17.20 & lcof 41. Continuous Median,"feat: add solutions to lcci/lcof problems (#3170) + +lcci 17.20 & lcof 41. Continuous Median","diff --git a/lcci/17.20.Continuous Median/README.md b/lcci/17.20.Continuous Median/README.md +index b3074347e30ca..dd85a2ce6a2a9 100644 +--- a/lcci/17.20.Continuous Median/README.md ++++ b/lcci/17.20.Continuous Median/README.md +@@ -46,17 +46,15 @@ findMedian() -> 2 + + + +-### 方法一:优先队列(双堆) ++### 方法一:大小根堆(优先队列) + +-创建大根堆、小根堆,其中:大根堆存放较小的一半元素,小根堆存放较大的一半元素。 ++我们可以使用两个堆来维护所有的元素,一个小根堆 $\text{minQ}$ 和一个大根堆 $\text{maxQ}$,其中小根堆 $\text{minQ}$ 存储较大的一半,大根堆 $\text{maxQ}$ 存储较小的一半。 + +-添加元素时,先放入小根堆,然后将小根堆对顶元素弹出并放入大根堆(使得大根堆个数多 $1$);若大小根堆元素个数差超过 $1$,则将大根堆元素弹出放入小根堆。 ++调用 `addNum` 方法时,我们首先将元素加入到大根堆 $\text{maxQ}$,然后将 $\text{maxQ}$ 的堆顶元素弹出并加入到小根堆 $\text{minQ}$。如果此时 $\text{minQ}$ 的大小与 $\text{maxQ}$ 的大小差值大于 $1$,我们就将 $\text{minQ}$ 的堆顶元素弹出并加入到 $\text{maxQ}$。时间复杂度为 $O(\log n)$。 + +-取中位数时,若大根堆元素较多,取大根堆堆顶,否则取两堆顶元素和的平均值。 ++调用 `findMedian` 方法时,如果 $\text{minQ}$ 的大小等于 $\text{maxQ}$ 的大小,说明元素的总数为偶数,我们就可以返回 $\text{minQ}$ 的堆顶元素与 $\text{maxQ}$ 的堆顶元素的平均值;否则,我们返回 $\text{minQ}$ 的堆顶元素。时间复杂度为 $O(1)$。 + +-**时间复杂度分析:** +- +-每次添加元素的时间复杂度为 $O(\log n)$,取中位数的时间复杂度为 $O(1)$。 ++空间复杂度为 $O(n)$。其中 $n$ 为元素的个数。 + + + +@@ -64,23 +62,20 @@ findMedian() -> 2 + + ```python + class MedianFinder: ++ + def __init__(self): +- """""" +- initialize your data structure here. +- """""" +- self.h1 = [] +- self.h2 = [] ++ self.minq = [] ++ self.maxq = [] + + def addNum(self, num: int) -> None: +- heappush(self.h1, num) +- heappush(self.h2, -heappop(self.h1)) +- if len(self.h2) - len(self.h1) > 1: +- heappush(self.h1, -heappop(self.h2)) ++ heappush(self.minq, -heappushpop(self.maxq, -num)) ++ if len(self.minq) - len(self.maxq) > 1: ++ heappush(self.maxq, -heappop(self.minq)) + + def findMedian(self) -> float: +- if len(self.h2) > len(self.h1): +- return -self.h2[0] +- return (self.h1[0] - self.h2[0]) / 2 ++ if len(self.minq) == len(self.maxq): ++ return (self.minq[0] - self.maxq[0]) / 2 ++ return self.minq[0] + + + # Your MedianFinder object will be instantiated and called as such: +@@ -93,26 +88,22 @@ class MedianFinder: + + ```java + class MedianFinder { +- private PriorityQueue q1 = new PriorityQueue<>(); +- private PriorityQueue q2 = new PriorityQueue<>(Collections.reverseOrder()); ++ private PriorityQueue minQ = new PriorityQueue<>(); ++ private PriorityQueue maxQ = new PriorityQueue<>(Collections.reverseOrder()); + +- /** initialize your data structure here. */ + public MedianFinder() { + } + + public void addNum(int num) { +- q1.offer(num); +- q2.offer(q1.poll()); +- if (q2.size() - q1.size() > 1) { +- q1.offer(q2.poll()); ++ maxQ.offer(num); ++ minQ.offer(maxQ.poll()); ++ if (minQ.size() - maxQ.size() > 1) { ++ maxQ.offer(minQ.poll()); + } + } + + public double findMedian() { +- if (q2.size() > q1.size()) { +- return q2.peek(); +- } +- return (q1.peek() + q2.peek()) * 1.0 / 2; ++ return minQ.size() == maxQ.size() ? (minQ.peek() + maxQ.peek()) / 2.0 : minQ.peek(); + } + } + +@@ -129,30 +120,27 @@ class MedianFinder { + ```cpp + class MedianFinder { + public: +- /** initialize your data structure here. */ + MedianFinder() { + } + + void addNum(int num) { +- q1.push(num); +- q2.push(q1.top()); +- q1.pop(); +- if (q2.size() - q1.size() > 1) { +- q1.push(q2.top()); +- q2.pop(); ++ maxQ.push(num); ++ minQ.push(maxQ.top()); ++ maxQ.pop(); ++ ++ if (minQ.size() > maxQ.size() + 1) { ++ maxQ.push(minQ.top()); ++ minQ.pop(); + } + } + + double findMedian() { +- if (q2.size() > q1.size()) { +- return q2.top(); +- } +- return (double) (q1.top() + q2.top()) / 2; ++ return minQ.size() == maxQ.size() ? (minQ.top() + maxQ.top()) / 2.0 : minQ.top(); + } + + private: +- priority_queue, greater> q1; +- priority_queue q2; ++ priority_queue maxQ; ++ priority_queue, greater> minQ; + }; + + /** +@@ -167,37 +155,31 @@ private: + + ```go + type MedianFinder struct { +- q1 hp +- q2 hp ++ minq hp ++ maxq hp + } + +-/** initialize your data structure here. */ + func Constructor() MedianFinder { + return MedianFinder{hp{}, hp{}} + } + + func (this *MedianFinder) AddNum(num int) { +- heap.Push(&this.q1, num) +- heap.Push(&this.q2, -heap.Pop(&this.q1).(int)) +- if this.q2.Len()-this.q1.Len() > 1 { +- heap.Push(&this.q1, -heap.Pop(&this.q2).(int)) ++ minq, maxq := &this.minq, &this.maxq ++ heap.Push(maxq, -num) ++ heap.Push(minq, -heap.Pop(maxq).(int)) ++ if minq.Len()-maxq.Len() > 1 { ++ heap.Push(maxq, -heap.Pop(minq).(int)) + } + } + + func (this *MedianFinder) FindMedian() float64 { +- if this.q2.Len() > this.q1.Len() { +- return -float64(this.q2.IntSlice[0]) ++ minq, maxq := this.minq, this.maxq ++ if minq.Len() == maxq.Len() { ++ return float64(minq.IntSlice[0]-maxq.IntSlice[0]) / 2 + } +- return float64(this.q1.IntSlice[0]-this.q2.IntSlice[0]) / 2.0 ++ return float64(minq.IntSlice[0]) + } + +-/** +- * Your MedianFinder object will be instantiated and called as such: +- * obj := Constructor(); +- * obj.AddNum(num); +- * param_2 := obj.FindMedian(); +- */ +- + type hp struct{ sort.IntSlice } + + func (h hp) Less(i, j int) bool { return h.IntSlice[i] < h.IntSlice[j] } +@@ -208,32 +190,181 @@ func (h *hp) Pop() any { + h.IntSlice = a[:len(a)-1] + return v + } ++ ++/** ++ * Your MedianFinder object will be instantiated and called as such: ++ * obj := Constructor(); ++ * obj.AddNum(num); ++ * param_2 := obj.FindMedian(); ++ */ ++``` ++ ++#### TypeScript ++ ++```ts ++class MedianFinder { ++ #minQ = new MinPriorityQueue(); ++ #maxQ = new MaxPriorityQueue(); ++ ++ addNum(num: number): void { ++ const [minQ, maxQ] = [this.#minQ, this.#maxQ]; ++ maxQ.enqueue(num); ++ minQ.enqueue(maxQ.dequeue().element); ++ if (minQ.size() - maxQ.size() > 1) { ++ maxQ.enqueue(minQ.dequeue().element); ++ } ++ } ++ ++ findMedian(): number { ++ const [minQ, maxQ] = [this.#minQ, this.#maxQ]; ++ if (minQ.size() === maxQ.size()) { ++ return (minQ.front().element + maxQ.front().element) / 2; ++ } ++ return minQ.front().element; ++ } ++} ++ ++/** ++ * Your MedianFinder object will be instantiated and called as such: ++ * var obj = new MedianFinder() ++ * obj.addNum(num) ++ * var param_2 = obj.findMedian() ++ */ ++``` ++ ++#### Rust ++ ++```rust ++use std::cmp::Reverse; ++use std::collections::BinaryHeap; ++ ++struct MedianFinder { ++ minQ: BinaryHeap>, ++ maxQ: BinaryHeap, ++} ++ ++impl MedianFinder { ++ fn new() -> Self { ++ MedianFinder { ++ minQ: BinaryHeap::new(), ++ maxQ: BinaryHeap::new(), ++ } ++ } ++ ++ fn add_num(&mut self, num: i32) { ++ self.maxQ.push(num); ++ self.minQ.push(Reverse(self.maxQ.pop().unwrap())); ++ ++ if self.minQ.len() > self.maxQ.len() + 1 { ++ self.maxQ.push(self.minQ.pop().unwrap().0); ++ } ++ } ++ ++ fn find_median(&self) -> f64 { ++ if self.minQ.len() == self.maxQ.len() { ++ let min_top = self.minQ.peek().unwrap().0; ++ let max_top = *self.maxQ.peek().unwrap(); ++ (min_top + max_top) as f64 / 2.0 ++ } else { ++ self.minQ.peek().unwrap().0 as f64 ++ } ++ } ++} ++``` ++ ++#### JavaScript ++ ++```js ++var MedianFinder = function () { ++ this.minQ = new MinPriorityQueue(); ++ this.maxQ = new MaxPriorityQueue(); ++}; ++ ++/** ++ * @param {number} num ++ * @return {void} ++ */ ++MedianFinder.prototype.addNum = function (num) { ++ this.maxQ.enqueue(num); ++ this.minQ.enqueue(this.maxQ.dequeue().element); ++ if (this.minQ.size() - this.maxQ.size() > 1) { ++ this.maxQ.enqueue(this.minQ.dequeue().element); ++ } ++}; ++ ++/** ++ * @return {number} ++ */ ++MedianFinder.prototype.findMedian = function () { ++ if (this.minQ.size() === this.maxQ.size()) { ++ return (this.minQ.front().element + this.maxQ.front().element) / 2; ++ } ++ return this.minQ.front().element; ++}; ++ ++/** ++ * Your MedianFinder object will be instantiated and called as such: ++ * var obj = new MedianFinder() ++ * obj.addNum(num) ++ * var param_2 = obj.findMedian() ++ */ ++``` ++ ++#### C# ++ ++```cs ++public class MedianFinder { ++ private PriorityQueue minQ = new PriorityQueue(); ++ private PriorityQueue maxQ = new PriorityQueue(Comparer.Create((a, b) => b.CompareTo(a))); ++ ++ public MedianFinder() { ++ ++ } ++ ++ public void AddNum(int num) { ++ maxQ.Enqueue(num, num); ++ minQ.Enqueue(maxQ.Peek(), maxQ.Dequeue()); ++ if (minQ.Count > maxQ.Count + 1) { ++ maxQ.Enqueue(minQ.Peek(), minQ.Dequeue()); ++ } ++ } ++ ++ public double FindMedian() { ++ return minQ.Count == maxQ.Count ? (minQ.Peek() + maxQ.Peek()) / 2.0 : minQ.Peek(); ++ } ++} ++ ++/** ++ * Your MedianFinder object will be instantiated and called as such: ++ * MedianFinder obj = new MedianFinder(); ++ * obj.AddNum(num); ++ * double param_2 = obj.FindMedian(); ++ */ + ``` + + #### Swift + + ```swift + class MedianFinder { +- private var minHeap = Heap(sort: <) +- private var maxHeap = Heap(sort: >) ++ private var minQ = Heap(sort: <) ++ private var maxQ = Heap(sort: >) + + init() { + } + + func addNum(_ num: Int) { +- maxHeap.insert(num) +- minHeap.insert(maxHeap.remove()!) +- +- if maxHeap.count < minHeap.count { +- maxHeap.insert(minHeap.remove()!) ++ maxQ.insert(num) ++ minQ.insert(maxQ.remove()!) ++ if maxQ.count < minQ.count { ++ maxQ.insert(minQ.remove()!) + } + } + + func findMedian() -> Double { +- if maxHeap.count > minHeap.count { +- return Double(maxHeap.peek()!) ++ if maxQ.count > minQ.count { ++ return Double(maxQ.peek()!) + } +- return (Double(maxHeap.peek()!) + Double(minHeap.peek()!)) / 2.0 ++ return (Double(maxQ.peek()!) + Double(minQ.peek()!)) / 2.0 + } + } + +@@ -318,6 +449,13 @@ struct Heap { + return 2 * index + 2 + } + } ++ ++/** ++ * Your MedianFinder object will be instantiated and called as such: ++ * let obj = MedianFinder() ++ * obj.addNum(num) ++ * let ret_2: Double = obj.findMedian() ++ */ + ``` + + +diff --git a/lcci/17.20.Continuous Median/README_EN.md b/lcci/17.20.Continuous Median/README_EN.md +index 9fa0d7acfba2a..132be30ebad8f 100644 +--- a/lcci/17.20.Continuous Median/README_EN.md ++++ b/lcci/17.20.Continuous Median/README_EN.md +@@ -53,7 +53,15 @@ findMedian() -> 2 + + + +-### Solution 1 ++### Solution 1: Min Heap and Max Heap (Priority Queue) ++ ++We can use two heaps to maintain all the elements, a min heap $\text{minQ}$ and a max heap $\text{maxQ}$, where the min heap $\text{minQ}$ stores the larger half, and the max heap $\text{maxQ}$ stores the smaller half. ++ ++When calling the `addNum` method, we first add the element to the max heap $\text{maxQ}$, then pop the top element of $\text{maxQ}$ and add it to the min heap $\text{minQ}$. If at this time the size difference between $\text{minQ}$ and $\text{maxQ}$ is greater than $1$, we pop the top element of $\text{minQ}$ and add it to $\text{maxQ}$. The time complexity is $O(\log n)$. ++ ++When calling the `findMedian` method, if the size of $\text{minQ}$ is equal to the size of $\text{maxQ}$, it means the total number of elements is even, and we can return the average value of the top elements of $\text{minQ}$ and $\text{maxQ}$; otherwise, we return the top element of $\text{minQ}$. The time complexity is $O(1)$. ++ ++The space complexity is $O(n)$, where $n$ is the number of elements. + + + +@@ -61,23 +69,20 @@ findMedian() -> 2 + + ```python + class MedianFinder: ++ + def __init__(self): +- """""" +- initialize your data structure here. +- """""" +- self.h1 = [] +- self.h2 = [] ++ self.minq = [] ++ self.maxq = [] + + def addNum(self, num: int) -> None: +- heappush(self.h1, num) +- heappush(self.h2, -heappop(self.h1)) +- if len(self.h2) - len(self.h1) > 1: +- heappush(self.h1, -heappop(self.h2)) ++ heappush(self.minq, -heappushpop(self.maxq, -num)) ++ if len(self.minq) - len(self.maxq) > 1: ++ heappush(self.maxq, -heappop(self.minq)) + + def findMedian(self) -> float: +- if len(self.h2) > len(self.h1): +- return -self.h2[0] +- return (self.h1[0] - self.h2[0]) / 2 ++ if len(self.minq) == len(self.maxq): ++ return (self.minq[0] - self.maxq[0]) / 2 ++ return self.minq[0] + + + # Your MedianFinder object will be instantiated and called as such: +@@ -90,26 +95,22 @@ class MedianFinder: + + ```java + class MedianFinder { +- private PriorityQueue q1 = new PriorityQueue<>(); +- private PriorityQueue q2 = new PriorityQueue<>(Collections.reverseOrder()); ++ private PriorityQueue minQ = new PriorityQueue<>(); ++ private PriorityQueue maxQ = new PriorityQueue<>(Collections.reverseOrder()); + +- /** initialize your data structure here. */ + public MedianFinder() { + } + + public void addNum(int num) { +- q1.offer(num); +- q2.offer(q1.poll()); +- if (q2.size() - q1.size() > 1) { +- q1.offer(q2.poll()); ++ maxQ.offer(num); ++ minQ.offer(maxQ.poll()); ++ if (minQ.size() - maxQ.size() > 1) { ++ maxQ.offer(minQ.poll()); + } + } + + public double findMedian() { +- if (q2.size() > q1.size()) { +- return q2.peek(); +- } +- return (q1.peek() + q2.peek()) * 1.0 / 2; ++ return minQ.size() == maxQ.size() ? (minQ.peek() + maxQ.peek()) / 2.0 : minQ.peek(); + } + } + +@@ -126,30 +127,27 @@ class MedianFinder { + ```cpp + class MedianFinder { + public: +- /** initialize your data structure here. */ + MedianFinder() { + } + + void addNum(int num) { +- q1.push(num); +- q2.push(q1.top()); +- q1.pop(); +- if (q2.size() - q1.size() > 1) { +- q1.push(q2.top()); +- q2.pop(); ++ maxQ.push(num); ++ minQ.push(maxQ.top()); ++ maxQ.pop(); ++ ++ if (minQ.size() > maxQ.size() + 1) { ++ maxQ.push(minQ.top()); ++ minQ.pop(); + } + } + + double findMedian() { +- if (q2.size() > q1.size()) { +- return q2.top(); +- } +- return (double) (q1.top() + q2.top()) / 2; ++ return minQ.size() == maxQ.size() ? (minQ.top() + maxQ.top()) / 2.0 : minQ.top(); + } + + private: +- priority_queue, greater> q1; +- priority_queue q2; ++ priority_queue maxQ; ++ priority_queue, greater> minQ; + }; + + /** +@@ -164,37 +162,31 @@ private: + + ```go + type MedianFinder struct { +- q1 hp +- q2 hp ++ minq hp ++ maxq hp + } + +-/** initialize your data structure here. */ + func Constructor() MedianFinder { + return MedianFinder{hp{}, hp{}} + } + + func (this *MedianFinder) AddNum(num int) { +- heap.Push(&this.q1, num) +- heap.Push(&this.q2, -heap.Pop(&this.q1).(int)) +- if this.q2.Len()-this.q1.Len() > 1 { +- heap.Push(&this.q1, -heap.Pop(&this.q2).(int)) ++ minq, maxq := &this.minq, &this.maxq ++ heap.Push(maxq, -num) ++ heap.Push(minq, -heap.Pop(maxq).(int)) ++ if minq.Len()-maxq.Len() > 1 { ++ heap.Push(maxq, -heap.Pop(minq).(int)) + } + } + + func (this *MedianFinder) FindMedian() float64 { +- if this.q2.Len() > this.q1.Len() { +- return -float64(this.q2.IntSlice[0]) ++ minq, maxq := this.minq, this.maxq ++ if minq.Len() == maxq.Len() { ++ return float64(minq.IntSlice[0]-maxq.IntSlice[0]) / 2 + } +- return float64(this.q1.IntSlice[0]-this.q2.IntSlice[0]) / 2.0 ++ return float64(minq.IntSlice[0]) + } + +-/** +- * Your MedianFinder object will be instantiated and called as such: +- * obj := Constructor(); +- * obj.AddNum(num); +- * param_2 := obj.FindMedian(); +- */ +- + type hp struct{ sort.IntSlice } + + func (h hp) Less(i, j int) bool { return h.IntSlice[i] < h.IntSlice[j] } +@@ -205,32 +197,181 @@ func (h *hp) Pop() any { + h.IntSlice = a[:len(a)-1] + return v + } ++ ++/** ++ * Your MedianFinder object will be instantiated and called as such: ++ * obj := Constructor(); ++ * obj.AddNum(num); ++ * param_2 := obj.FindMedian(); ++ */ ++``` ++ ++#### TypeScript ++ ++```ts ++class MedianFinder { ++ #minQ = new MinPriorityQueue(); ++ #maxQ = new MaxPriorityQueue(); ++ ++ addNum(num: number): void { ++ const [minQ, maxQ] = [this.#minQ, this.#maxQ]; ++ maxQ.enqueue(num); ++ minQ.enqueue(maxQ.dequeue().element); ++ if (minQ.size() - maxQ.size() > 1) { ++ maxQ.enqueue(minQ.dequeue().element); ++ } ++ } ++ ++ findMedian(): number { ++ const [minQ, maxQ] = [this.#minQ, this.#maxQ]; ++ if (minQ.size() === maxQ.size()) { ++ return (minQ.front().element + maxQ.front().element) / 2; ++ } ++ return minQ.front().element; ++ } ++} ++ ++/** ++ * Your MedianFinder object will be instantiated and called as such: ++ * var obj = new MedianFinder() ++ * obj.addNum(num) ++ * var param_2 = obj.findMedian() ++ */ ++``` ++ ++#### Rust ++ ++```rust ++use std::cmp::Reverse; ++use std::collections::BinaryHeap; ++ ++struct MedianFinder { ++ minQ: BinaryHeap>, ++ maxQ: BinaryHeap, ++} ++ ++impl MedianFinder { ++ fn new() -> Self { ++ MedianFinder { ++ minQ: BinaryHeap::new(), ++ maxQ: BinaryHeap::new(), ++ } ++ } ++ ++ fn add_num(&mut self, num: i32) { ++ self.maxQ.push(num); ++ self.minQ.push(Reverse(self.maxQ.pop().unwrap())); ++ ++ if self.minQ.len() > self.maxQ.len() + 1 { ++ self.maxQ.push(self.minQ.pop().unwrap().0); ++ } ++ } ++ ++ fn find_median(&self) -> f64 { ++ if self.minQ.len() == self.maxQ.len() { ++ let min_top = self.minQ.peek().unwrap().0; ++ let max_top = *self.maxQ.peek().unwrap(); ++ (min_top + max_top) as f64 / 2.0 ++ } else { ++ self.minQ.peek().unwrap().0 as f64 ++ } ++ } ++} ++``` ++ ++#### JavaScript ++ ++```js ++var MedianFinder = function () { ++ this.minQ = new MinPriorityQueue(); ++ this.maxQ = new MaxPriorityQueue(); ++}; ++ ++/** ++ * @param {number} num ++ * @return {void} ++ */ ++MedianFinder.prototype.addNum = function (num) { ++ this.maxQ.enqueue(num); ++ this.minQ.enqueue(this.maxQ.dequeue().element); ++ if (this.minQ.size() - this.maxQ.size() > 1) { ++ this.maxQ.enqueue(this.minQ.dequeue().element); ++ } ++}; ++ ++/** ++ * @return {number} ++ */ ++MedianFinder.prototype.findMedian = function () { ++ if (this.minQ.size() === this.maxQ.size()) { ++ return (this.minQ.front().element + this.maxQ.front().element) / 2; ++ } ++ return this.minQ.front().element; ++}; ++ ++/** ++ * Your MedianFinder object will be instantiated and called as such: ++ * var obj = new MedianFinder() ++ * obj.addNum(num) ++ * var param_2 = obj.findMedian() ++ */ ++``` ++ ++#### C# ++ ++```cs ++public class MedianFinder { ++ private PriorityQueue minQ = new PriorityQueue(); ++ private PriorityQueue maxQ = new PriorityQueue(Comparer.Create((a, b) => b.CompareTo(a))); ++ ++ public MedianFinder() { ++ ++ } ++ ++ public void AddNum(int num) { ++ maxQ.Enqueue(num, num); ++ minQ.Enqueue(maxQ.Peek(), maxQ.Dequeue()); ++ if (minQ.Count > maxQ.Count + 1) { ++ maxQ.Enqueue(minQ.Peek(), minQ.Dequeue()); ++ } ++ } ++ ++ public double FindMedian() { ++ return minQ.Count == maxQ.Count ? (minQ.Peek() + maxQ.Peek()) / 2.0 : minQ.Peek(); ++ } ++} ++ ++/** ++ * Your MedianFinder object will be instantiated and called as such: ++ * MedianFinder obj = new MedianFinder(); ++ * obj.AddNum(num); ++ * double param_2 = obj.FindMedian(); ++ */ + ``` + + #### Swift + + ```swift + class MedianFinder { +- private var minHeap = Heap(sort: <) +- private var maxHeap = Heap(sort: >) ++ private var minQ = Heap(sort: <) ++ private var maxQ = Heap(sort: >) + + init() { + } + + func addNum(_ num: Int) { +- maxHeap.insert(num) +- minHeap.insert(maxHeap.remove()!) +- +- if maxHeap.count < minHeap.count { +- maxHeap.insert(minHeap.remove()!) ++ maxQ.insert(num) ++ minQ.insert(maxQ.remove()!) ++ if maxQ.count < minQ.count { ++ maxQ.insert(minQ.remove()!) + } + } + + func findMedian() -> Double { +- if maxHeap.count > minHeap.count { +- return Double(maxHeap.peek()!) ++ if maxQ.count > minQ.count { ++ return Double(maxQ.peek()!) + } +- return (Double(maxHeap.peek()!) + Double(minHeap.peek()!)) / 2.0 ++ return (Double(maxQ.peek()!) + Double(minQ.peek()!)) / 2.0 + } + } + +@@ -315,6 +456,13 @@ struct Heap { + return 2 * index + 2 + } + } ++ ++/** ++ * Your MedianFinder object will be instantiated and called as such: ++ * let obj = MedianFinder() ++ * obj.addNum(num) ++ * let ret_2: Double = obj.findMedian() ++ */ + ``` + + +diff --git a/lcci/17.20.Continuous Median/Solution.cpp b/lcci/17.20.Continuous Median/Solution.cpp +index 4e65d4c2bd94f..4db5d9a118f29 100644 +--- a/lcci/17.20.Continuous Median/Solution.cpp ++++ b/lcci/17.20.Continuous Median/Solution.cpp +@@ -1,29 +1,26 @@ + class MedianFinder { + public: +- /** initialize your data structure here. */ + MedianFinder() { + } + + void addNum(int num) { +- q1.push(num); +- q2.push(q1.top()); +- q1.pop(); +- if (q2.size() - q1.size() > 1) { +- q1.push(q2.top()); +- q2.pop(); ++ maxQ.push(num); ++ minQ.push(maxQ.top()); ++ maxQ.pop(); ++ ++ if (minQ.size() > maxQ.size() + 1) { ++ maxQ.push(minQ.top()); ++ minQ.pop(); + } + } + + double findMedian() { +- if (q2.size() > q1.size()) { +- return q2.top(); +- } +- return (double) (q1.top() + q2.top()) / 2; ++ return minQ.size() == maxQ.size() ? (minQ.top() + maxQ.top()) / 2.0 : minQ.top(); + } + + private: +- priority_queue, greater> q1; +- priority_queue q2; ++ priority_queue maxQ; ++ priority_queue, greater> minQ; + }; + + /** +@@ -31,4 +28,4 @@ class MedianFinder { + * MedianFinder* obj = new MedianFinder(); + * obj->addNum(num); + * double param_2 = obj->findMedian(); +- */ +\ No newline at end of file ++ */ +diff --git a/lcci/17.20.Continuous Median/Solution.cs b/lcci/17.20.Continuous Median/Solution.cs +new file mode 100644 +index 0000000000000..6f5d6400527d3 +--- /dev/null ++++ b/lcci/17.20.Continuous Median/Solution.cs +@@ -0,0 +1,27 @@ ++public class MedianFinder { ++ private PriorityQueue minQ = new PriorityQueue(); ++ private PriorityQueue maxQ = new PriorityQueue(Comparer.Create((a, b) => b.CompareTo(a))); ++ ++ public MedianFinder() { ++ ++ } ++ ++ public void AddNum(int num) { ++ maxQ.Enqueue(num, num); ++ minQ.Enqueue(maxQ.Peek(), maxQ.Dequeue()); ++ if (minQ.Count > maxQ.Count + 1) { ++ maxQ.Enqueue(minQ.Peek(), minQ.Dequeue()); ++ } ++ } ++ ++ public double FindMedian() { ++ return minQ.Count == maxQ.Count ? (minQ.Peek() + maxQ.Peek()) / 2.0 : minQ.Peek(); ++ } ++} ++ ++/** ++ * Your MedianFinder object will be instantiated and called as such: ++ * MedianFinder obj = new MedianFinder(); ++ * obj.AddNum(num); ++ * double param_2 = obj.FindMedian(); ++ */ +diff --git a/lcci/17.20.Continuous Median/Solution.go b/lcci/17.20.Continuous Median/Solution.go +index 08bef8dd85dc0..5da36e5deebd5 100644 +--- a/lcci/17.20.Continuous Median/Solution.go ++++ b/lcci/17.20.Continuous Median/Solution.go +@@ -1,35 +1,29 @@ + type MedianFinder struct { +- q1 hp +- q2 hp ++ minq hp ++ maxq hp + } + +-/** initialize your data structure here. */ + func Constructor() MedianFinder { + return MedianFinder{hp{}, hp{}} + } + + func (this *MedianFinder) AddNum(num int) { +- heap.Push(&this.q1, num) +- heap.Push(&this.q2, -heap.Pop(&this.q1).(int)) +- if this.q2.Len()-this.q1.Len() > 1 { +- heap.Push(&this.q1, -heap.Pop(&this.q2).(int)) ++ minq, maxq := &this.minq, &this.maxq ++ heap.Push(maxq, -num) ++ heap.Push(minq, -heap.Pop(maxq).(int)) ++ if minq.Len()-maxq.Len() > 1 { ++ heap.Push(maxq, -heap.Pop(minq).(int)) + } + } + + func (this *MedianFinder) FindMedian() float64 { +- if this.q2.Len() > this.q1.Len() { +- return -float64(this.q2.IntSlice[0]) ++ minq, maxq := this.minq, this.maxq ++ if minq.Len() == maxq.Len() { ++ return float64(minq.IntSlice[0]-maxq.IntSlice[0]) / 2 + } +- return float64(this.q1.IntSlice[0]-this.q2.IntSlice[0]) / 2.0 ++ return float64(minq.IntSlice[0]) + } + +-/** +- * Your MedianFinder object will be instantiated and called as such: +- * obj := Constructor(); +- * obj.AddNum(num); +- * param_2 := obj.FindMedian(); +- */ +- + type hp struct{ sort.IntSlice } + + func (h hp) Less(i, j int) bool { return h.IntSlice[i] < h.IntSlice[j] } +@@ -39,4 +33,11 @@ func (h *hp) Pop() any { + v := a[len(a)-1] + h.IntSlice = a[:len(a)-1] + return v +-} +\ No newline at end of file ++} ++ ++/** ++ * Your MedianFinder object will be instantiated and called as such: ++ * obj := Constructor(); ++ * obj.AddNum(num); ++ * param_2 := obj.FindMedian(); ++ */ +diff --git a/lcci/17.20.Continuous Median/Solution.java b/lcci/17.20.Continuous Median/Solution.java +index 67cba760f5d1f..4fedda85b0558 100644 +--- a/lcci/17.20.Continuous Median/Solution.java ++++ b/lcci/17.20.Continuous Median/Solution.java +@@ -1,24 +1,20 @@ + class MedianFinder { +- private PriorityQueue q1 = new PriorityQueue<>(); +- private PriorityQueue q2 = new PriorityQueue<>(Collections.reverseOrder()); ++ private PriorityQueue minQ = new PriorityQueue<>(); ++ private PriorityQueue maxQ = new PriorityQueue<>(Collections.reverseOrder()); + +- /** initialize your data structure here. */ + public MedianFinder() { + } + + public void addNum(int num) { +- q1.offer(num); +- q2.offer(q1.poll()); +- if (q2.size() - q1.size() > 1) { +- q1.offer(q2.poll()); ++ maxQ.offer(num); ++ minQ.offer(maxQ.poll()); ++ if (minQ.size() - maxQ.size() > 1) { ++ maxQ.offer(minQ.poll()); + } + } + + public double findMedian() { +- if (q2.size() > q1.size()) { +- return q2.peek(); +- } +- return (q1.peek() + q2.peek()) * 1.0 / 2; ++ return minQ.size() == maxQ.size() ? (minQ.peek() + maxQ.peek()) / 2.0 : minQ.peek(); + } + } + +@@ -27,4 +23,4 @@ public double findMedian() { + * MedianFinder obj = new MedianFinder(); + * obj.addNum(num); + * double param_2 = obj.findMedian(); +- */ +\ No newline at end of file ++ */ +diff --git a/lcci/17.20.Continuous Median/Solution.js b/lcci/17.20.Continuous Median/Solution.js +new file mode 100644 +index 0000000000000..5e38a201dc1d8 +--- /dev/null ++++ b/lcci/17.20.Continuous Median/Solution.js +@@ -0,0 +1,33 @@ ++var MedianFinder = function () { ++ this.minQ = new MinPriorityQueue(); ++ this.maxQ = new MaxPriorityQueue(); ++}; ++ ++/** ++ * @param {number} num ++ * @return {void} ++ */ ++MedianFinder.prototype.addNum = function (num) { ++ this.maxQ.enqueue(num); ++ this.minQ.enqueue(this.maxQ.dequeue().element); ++ if (this.minQ.size() - this.maxQ.size() > 1) { ++ this.maxQ.enqueue(this.minQ.dequeue().element); ++ } ++}; ++ ++/** ++ * @return {number} ++ */ ++MedianFinder.prototype.findMedian = function () { ++ if (this.minQ.size() === this.maxQ.size()) { ++ return (this.minQ.front().element + this.maxQ.front().element) / 2; ++ } ++ return this.minQ.front().element; ++}; ++ ++/** ++ * Your MedianFinder object will be instantiated and called as such: ++ * var obj = new MedianFinder() ++ * obj.addNum(num) ++ * var param_2 = obj.findMedian() ++ */ +diff --git a/lcci/17.20.Continuous Median/Solution.py b/lcci/17.20.Continuous Median/Solution.py +index 3eb1703cc52f1..0b61b5b78e1c6 100644 +--- a/lcci/17.20.Continuous Median/Solution.py ++++ b/lcci/17.20.Continuous Median/Solution.py +@@ -1,21 +1,18 @@ + class MedianFinder: ++ + def __init__(self): +- """""" +- initialize your data structure here. +- """""" +- self.h1 = [] +- self.h2 = [] ++ self.minq = [] ++ self.maxq = [] + + def addNum(self, num: int) -> None: +- heappush(self.h1, num) +- heappush(self.h2, -heappop(self.h1)) +- if len(self.h2) - len(self.h1) > 1: +- heappush(self.h1, -heappop(self.h2)) ++ heappush(self.minq, -heappushpop(self.maxq, -num)) ++ if len(self.minq) - len(self.maxq) > 1: ++ heappush(self.maxq, -heappop(self.minq)) + + def findMedian(self) -> float: +- if len(self.h2) > len(self.h1): +- return -self.h2[0] +- return (self.h1[0] - self.h2[0]) / 2 ++ if len(self.minq) == len(self.maxq): ++ return (self.minq[0] - self.maxq[0]) / 2 ++ return self.minq[0] + + + # Your MedianFinder object will be instantiated and called as such: +diff --git a/lcci/17.20.Continuous Median/Solution.rs b/lcci/17.20.Continuous Median/Solution.rs +new file mode 100644 +index 0000000000000..e3a7d37dfb505 +--- /dev/null ++++ b/lcci/17.20.Continuous Median/Solution.rs +@@ -0,0 +1,35 @@ ++use std::cmp::Reverse; ++use std::collections::BinaryHeap; ++ ++struct MedianFinder { ++ minQ: BinaryHeap>, ++ maxQ: BinaryHeap, ++} ++ ++impl MedianFinder { ++ fn new() -> Self { ++ MedianFinder { ++ minQ: BinaryHeap::new(), ++ maxQ: BinaryHeap::new(), ++ } ++ } ++ ++ fn add_num(&mut self, num: i32) { ++ self.maxQ.push(num); ++ self.minQ.push(Reverse(self.maxQ.pop().unwrap())); ++ ++ if self.minQ.len() > self.maxQ.len() + 1 { ++ self.maxQ.push(self.minQ.pop().unwrap().0); ++ } ++ } ++ ++ fn find_median(&self) -> f64 { ++ if self.minQ.len() == self.maxQ.len() { ++ let min_top = self.minQ.peek().unwrap().0; ++ let max_top = *self.maxQ.peek().unwrap(); ++ (min_top + max_top) as f64 / 2.0 ++ } else { ++ self.minQ.peek().unwrap().0 as f64 ++ } ++ } ++} +diff --git a/lcci/17.20.Continuous Median/Solution.swift b/lcci/17.20.Continuous Median/Solution.swift +index edd2293a4803c..bf1b16b0ac17b 100644 +--- a/lcci/17.20.Continuous Median/Solution.swift ++++ b/lcci/17.20.Continuous Median/Solution.swift +@@ -1,24 +1,23 @@ + class MedianFinder { +- private var minHeap = Heap(sort: <) +- private var maxHeap = Heap(sort: >) ++ private var minQ = Heap(sort: <) ++ private var maxQ = Heap(sort: >) + + init() { + } + + func addNum(_ num: Int) { +- maxHeap.insert(num) +- minHeap.insert(maxHeap.remove()!) +- +- if maxHeap.count < minHeap.count { +- maxHeap.insert(minHeap.remove()!) ++ maxQ.insert(num) ++ minQ.insert(maxQ.remove()!) ++ if maxQ.count < minQ.count { ++ maxQ.insert(minQ.remove()!) + } + } + + func findMedian() -> Double { +- if maxHeap.count > minHeap.count { +- return Double(maxHeap.peek()!) ++ if maxQ.count > minQ.count { ++ return Double(maxQ.peek()!) + } +- return (Double(maxHeap.peek()!) + Double(minHeap.peek()!)) / 2.0 ++ return (Double(maxQ.peek()!) + Double(minQ.peek()!)) / 2.0 + } + } + +@@ -102,4 +101,11 @@ struct Heap { + private func rightChildIndex(ofParentAt index: Int) -> Int { + return 2 * index + 2 + } +-} +\ No newline at end of file ++} ++ ++/** ++ * Your MedianFinder object will be instantiated and called as such: ++ * let obj = MedianFinder() ++ * obj.addNum(num) ++ * let ret_2: Double = obj.findMedian() ++ */ +diff --git a/lcci/17.20.Continuous Median/Solution.ts b/lcci/17.20.Continuous Median/Solution.ts +new file mode 100644 +index 0000000000000..0df774deac49f +--- /dev/null ++++ b/lcci/17.20.Continuous Median/Solution.ts +@@ -0,0 +1,28 @@ ++class MedianFinder { ++ #minQ = new MinPriorityQueue(); ++ #maxQ = new MaxPriorityQueue(); ++ ++ addNum(num: number): void { ++ const [minQ, maxQ] = [this.#minQ, this.#maxQ]; ++ maxQ.enqueue(num); ++ minQ.enqueue(maxQ.dequeue().element); ++ if (minQ.size() - maxQ.size() > 1) { ++ maxQ.enqueue(minQ.dequeue().element); ++ } ++ } ++ ++ findMedian(): number { ++ const [minQ, maxQ] = [this.#minQ, this.#maxQ]; ++ if (minQ.size() === maxQ.size()) { ++ return (minQ.front().element + maxQ.front().element) / 2; ++ } ++ return minQ.front().element; ++ } ++} ++ ++/** ++ * Your MedianFinder object will be instantiated and called as such: ++ * var obj = new MedianFinder() ++ * obj.addNum(num) ++ * var param_2 = obj.findMedian() ++ */ +diff --git ""a/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/README.md"" ""b/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/README.md"" +index 3bedc52233d3a..6b34dbdd86dc6 100644 +--- ""a/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/README.md"" ++++ ""b/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/README.md"" +@@ -58,15 +58,15 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9 + + + +-### 方法一:优先队列(大小根堆) ++### 方法一:大小根堆(优先队列) + +-我们可以维护两个优先队列,一个大根堆,一个小根堆,大根堆存储较小的一半数,小根堆存储较大的一半数。 ++我们可以使用两个堆来维护所有的元素,一个小根堆 $\text{minQ}$ 和一个大根堆 $\text{maxQ}$,其中小根堆 $\text{minQ}$ 存储较大的一半,大根堆 $\text{maxQ}$ 存储较小的一半。 + +-当两个堆的元素个数相同时,我们优先往小根堆中添加元素,这样会使得小根堆元素个数比大根堆多 $1$,这样中位数就可以从小根堆中取出。 ++调用 `addNum` 方法时,我们首先将元素加入到大根堆 $\text{maxQ}$,然后将 $\text{maxQ}$ 的堆顶元素弹出并加入到小根堆 $\text{minQ}$。如果此时 $\text{minQ}$ 的大小与 $\text{maxQ}$ 的大小差值大于 $1$,我们就将 $\text{minQ}$ 的堆顶元素弹出并加入到 $\text{maxQ}$。时间复杂度为 $O(\log n)$。 + +-当两个堆的元素个数不同时,说明此时小根堆元素个数比大根堆多 $1$,我们往大根堆中添加元素,这样会使得两个堆元素个数相同,这样中位数就可以从两个堆中取出。 ++调用 `findMedian` 方法时,如果 $\text{minQ}$ 的大小等于 $\text{maxQ}$ 的大小,说明元素的总数为偶数,我们就可以返回 $\text{minQ}$ 的堆顶元素与 $\text{maxQ}$ 的堆顶元素的平均值;否则,我们返回 $\text{minQ}$ 的堆顶元素。时间复杂度为 $O(1)$。 + +-时间复杂度方面,添加元素的时间复杂度为 $O(\log n)$,查找中位数的时间复杂度为 $O(1)$。空间复杂度为 $O(n)$。其中 $n$ 为数据流中元素的个数。 ++空间复杂度为 $O(n)$。其中 $n$ 为元素的个数。 + + + +@@ -74,23 +74,20 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9 + + ```python + class MedianFinder: ++ + def __init__(self): +- """""" +- initialize your data structure here. +- """""" +- self.q1 = [] +- self.q2 = [] ++ self.minq = [] ++ self.maxq = [] + + def addNum(self, num: int) -> None: +- if len(self.q1) > len(self.q2): +- heappush(self.q2, -heappushpop(self.q1, num)) +- else: +- heappush(self.q1, -heappushpop(self.q2, -num)) ++ heappush(self.minq, -heappushpop(self.maxq, -num)) ++ if len(self.minq) - len(self.maxq) > 1: ++ heappush(self.maxq, -heappop(self.minq)) + + def findMedian(self) -> float: +- if len(self.q1) > len(self.q2): +- return self.q1[0] +- return (self.q1[0] - self.q2[0]) / 2 ++ if len(self.minq) == len(self.maxq): ++ return (self.minq[0] - self.maxq[0]) / 2 ++ return self.minq[0] + + + # Your MedianFinder object will be instantiated and called as such: +@@ -103,28 +100,22 @@ class MedianFinder: + + ```java + class MedianFinder { +- private PriorityQueue q1 = new PriorityQueue<>(); +- private PriorityQueue q2 = new PriorityQueue<>((a, b) -> b - a); ++ private PriorityQueue minQ = new PriorityQueue<>(); ++ private PriorityQueue maxQ = new PriorityQueue<>(Collections.reverseOrder()); + +- /** initialize your data structure here. */ + public MedianFinder() { + } + + public void addNum(int num) { +- if (q1.size() > q2.size()) { +- q1.offer(num); +- q2.offer(q1.poll()); +- } else { +- q2.offer(num); +- q1.offer(q2.poll()); ++ maxQ.offer(num); ++ minQ.offer(maxQ.poll()); ++ if (minQ.size() - maxQ.size() > 1) { ++ maxQ.offer(minQ.poll()); + } + } + + public double findMedian() { +- if (q1.size() > q2.size()) { +- return q1.peek(); +- } +- return (q1.peek() + q2.peek()) / 2.0; ++ return minQ.size() == maxQ.size() ? (minQ.peek() + maxQ.peek()) / 2.0 : minQ.peek(); + } + } + +@@ -141,32 +132,27 @@ class MedianFinder { + ```cpp + class MedianFinder { + public: +- /** initialize your data structure here. */ + MedianFinder() { + } + + void addNum(int num) { +- if (q1.size() > q2.size()) { +- q1.push(num); +- q2.push(q1.top()); +- q1.pop(); +- } else { +- q2.push(num); +- q1.push(q2.top()); +- q2.pop(); ++ maxQ.push(num); ++ minQ.push(maxQ.top()); ++ maxQ.pop(); ++ ++ if (minQ.size() > maxQ.size() + 1) { ++ maxQ.push(minQ.top()); ++ minQ.pop(); + } + } + + double findMedian() { +- if (q1.size() > q2.size()) { +- return q1.top(); +- } +- return (q1.top() + q2.top()) / 2.0; ++ return minQ.size() == maxQ.size() ? (minQ.top() + maxQ.top()) / 2.0 : minQ.top(); + } + + private: +- priority_queue, greater> q1; +- priority_queue q2; ++ priority_queue maxQ; ++ priority_queue, greater> minQ; + }; + + /** +@@ -181,29 +167,29 @@ private: + + ```go + type MedianFinder struct { +- q1, q2 hp ++ minq hp ++ maxq hp + } + +-/** initialize your data structure here. */ + func Constructor() MedianFinder { + return MedianFinder{hp{}, hp{}} + } + + func (this *MedianFinder) AddNum(num int) { +- if this.q1.Len() > this.q2.Len() { +- heap.Push(&this.q1, num) +- heap.Push(&this.q2, -heap.Pop(&this.q1).(int)) +- } else { +- heap.Push(&this.q2, -num) +- heap.Push(&this.q1, -heap.Pop(&this.q2).(int)) ++ minq, maxq := &this.minq, &this.maxq ++ heap.Push(maxq, -num) ++ heap.Push(minq, -heap.Pop(maxq).(int)) ++ if minq.Len()-maxq.Len() > 1 { ++ heap.Push(maxq, -heap.Pop(minq).(int)) + } + } + + func (this *MedianFinder) FindMedian() float64 { +- if this.q1.Len() > this.q2.Len() { +- return float64(this.q1.IntSlice[0]) ++ minq, maxq := this.minq, this.maxq ++ if minq.Len() == maxq.Len() { ++ return float64(minq.IntSlice[0]-maxq.IntSlice[0]) / 2 + } +- return float64(this.q1.IntSlice[0]-this.q2.IntSlice[0]) / 2.0 ++ return float64(minq.IntSlice[0]) + } + + type hp struct{ sort.IntSlice } +@@ -229,34 +215,24 @@ func (h *hp) Pop() any { + + ```ts + class MedianFinder { +- private nums: number[]; +- +- constructor() { +- this.nums = []; +- } ++ #minQ = new MinPriorityQueue(); ++ #maxQ = new MaxPriorityQueue(); + + addNum(num: number): void { +- const { nums } = this; +- let l = 0; +- let r = nums.length; +- while (l < r) { +- const mid = (l + r) >>> 1; +- if (nums[mid] < num) { +- l = mid + 1; +- } else { +- r = mid; +- } ++ const [minQ, maxQ] = [this.#minQ, this.#maxQ]; ++ maxQ.enqueue(num); ++ minQ.enqueue(maxQ.dequeue().element); ++ if (minQ.size() - maxQ.size() > 1) { ++ maxQ.enqueue(minQ.dequeue().element); + } +- nums.splice(l, 0, num); + } + + findMedian(): number { +- const { nums } = this; +- const n = nums.length; +- if ((n & 1) === 1) { +- return nums[n >> 1]; ++ const [minQ, maxQ] = [this.#minQ, this.#maxQ]; ++ if (minQ.size() === maxQ.size()) { ++ return (minQ.front().element + maxQ.front().element) / 2; + } +- return (nums[n >> 1] + nums[(n >> 1) - 1]) / 2; ++ return minQ.front().element; + } + } + +@@ -271,40 +247,39 @@ class MedianFinder { + #### Rust + + ```rust ++use std::cmp::Reverse; ++use std::collections::BinaryHeap; ++ + struct MedianFinder { +- nums: Vec, ++ minQ: BinaryHeap>, ++ maxQ: BinaryHeap, + } + +-/** +- * `&self` means the method takes an immutable reference. +- * If you need a mutable reference, change it to `&mut self` instead. +- */ + impl MedianFinder { +- /** initialize your data structure here. */ + fn new() -> Self { +- Self { nums: Vec::new() } ++ MedianFinder { ++ minQ: BinaryHeap::new(), ++ maxQ: BinaryHeap::new(), ++ } + } + + fn add_num(&mut self, num: i32) { +- let mut l = 0; +- let mut r = self.nums.len(); +- while l < r { +- let mid = (l + r) >> 1; +- if self.nums[mid] < num { +- l = mid + 1; +- } else { +- r = mid; +- } ++ self.maxQ.push(num); ++ self.minQ.push(Reverse(self.maxQ.pop().unwrap())); ++ ++ if self.minQ.len() > self.maxQ.len() + 1 { ++ self.maxQ.push(self.minQ.pop().unwrap().0); + } +- self.nums.insert(l, num); + } + + fn find_median(&self) -> f64 { +- let n = self.nums.len(); +- if (n & 1) == 1 { +- return f64::from(self.nums[n >> 1]); ++ if self.minQ.len() == self.maxQ.len() { ++ let min_top = self.minQ.peek().unwrap().0; ++ let max_top = *self.maxQ.peek().unwrap(); ++ (min_top + max_top) as f64 / 2.0 ++ } else { ++ self.minQ.peek().unwrap().0 as f64 + } +- f64::from(self.nums[n >> 1] + self.nums[(n >> 1) - 1]) / 2.0 + } + } + ``` +@@ -312,11 +287,9 @@ impl MedianFinder { + #### JavaScript + + ```js +-/** +- * initialize your data structure here. +- */ + var MedianFinder = function () { +- this.val = []; ++ this.minQ = new MinPriorityQueue(); ++ this.maxQ = new MaxPriorityQueue(); + }; + + /** +@@ -324,78 +297,52 @@ var MedianFinder = function () { + * @return {void} + */ + MedianFinder.prototype.addNum = function (num) { +- let left = 0; +- let right = this.val.length; +- while (left < right) { +- let mid = left + ~~((right - left) / 2); +- if (num > this.val[mid]) { +- left = mid + 1; +- } else { +- right = mid; +- } ++ this.maxQ.enqueue(num); ++ this.minQ.enqueue(this.maxQ.dequeue().element); ++ if (this.minQ.size() - this.maxQ.size() > 1) { ++ this.maxQ.enqueue(this.minQ.dequeue().element); + } +- this.val.splice(left, 0, num); + }; + + /** + * @return {number} + */ + MedianFinder.prototype.findMedian = function () { +- let mid = ~~(this.val.length / 2); +- return this.val.length % 2 ? this.val[mid] : (this.val[mid - 1] + this.val[mid]) / 2; ++ if (this.minQ.size() === this.maxQ.size()) { ++ return (this.minQ.front().element + this.maxQ.front().element) / 2; ++ } ++ return this.minQ.front().element; + }; ++ ++/** ++ * Your MedianFinder object will be instantiated and called as such: ++ * var obj = new MedianFinder() ++ * obj.addNum(num) ++ * var param_2 = obj.findMedian() ++ */ + ``` + + #### C# + + ```cs + public class MedianFinder { +- private List nums; +- private int curIndex; ++ private PriorityQueue minQ = new PriorityQueue(); ++ private PriorityQueue maxQ = new PriorityQueue(Comparer.Create((a, b) => b.CompareTo(a))); + +- /** initialize your data structure here. */ + public MedianFinder() { +- nums = new List(); +- } + +- private int FindIndex(int val) { +- int left = 0; +- int right = nums.Count - 1; +- while (left <= right) { +- int mid = left + (right - left) / 2; +- if (val > nums[mid]) { +- left = mid + 1; +- } else { +- right = mid - 1; +- } +- } +- return left; + } + + public void AddNum(int num) { +- if (nums.Count == 0) { +- nums.Add(num); +- curIndex = 0; +- } else { +- curIndex = FindIndex(num); +- if (curIndex == nums.Count) { +- nums.Add(num); +- } else { +- nums.Insert(curIndex, num); +- } ++ maxQ.Enqueue(num, num); ++ minQ.Enqueue(maxQ.Peek(), maxQ.Dequeue()); ++ if (minQ.Count > maxQ.Count + 1) { ++ maxQ.Enqueue(minQ.Peek(), minQ.Dequeue()); + } + } + + public double FindMedian() { +- if (nums.Count % 2 == 1) { +- return (double)nums[nums.Count / 2]; +- } else { +- if (nums.Count == 0) { +- return 0; +- } else { +- return (double) (nums[nums.Count / 2 - 1] + nums[nums.Count / 2]) / 2; +- } +- } ++ return minQ.Count == maxQ.Count ? (minQ.Peek() + maxQ.Peek()) / 2.0 : minQ.Peek(); + } + } + +@@ -411,31 +358,25 @@ public class MedianFinder { + + ```swift + class MedianFinder { +- private var lowerHalf = Heap(sort: >) +- private var upperHalf = Heap(sort: <) ++ private var minQ = Heap(sort: <) ++ private var maxQ = Heap(sort: >) + +- init() {} ++ init() { ++ } + + func addNum(_ num: Int) { +- if lowerHalf.count == 0 || num <= lowerHalf.peek()! { +- lowerHalf.insert(num) +- } else { +- upperHalf.insert(num) +- } +- +- if lowerHalf.count > upperHalf.count + 1 { +- upperHalf.insert(lowerHalf.remove()!) +- } else if upperHalf.count > lowerHalf.count { +- lowerHalf.insert(upperHalf.remove()!) ++ maxQ.insert(num) ++ minQ.insert(maxQ.remove()!) ++ if maxQ.count < minQ.count { ++ maxQ.insert(minQ.remove()!) + } + } + + func findMedian() -> Double { +- if lowerHalf.count > upperHalf.count { +- return Double(lowerHalf.peek()!) +- } else { +- return (Double(lowerHalf.peek()!) + Double(upperHalf.peek()!)) / 2.0 ++ if maxQ.count > minQ.count { ++ return Double(maxQ.peek()!) + } ++ return (Double(maxQ.peek()!) + Double(minQ.peek()!)) / 2.0 + } + } + +@@ -443,9 +384,18 @@ struct Heap { + var elements: [T] + let sort: (T, T) -> Bool + +- init(sort: @escaping (T, T) -> Bool) { ++ init(sort: @escaping (T, T) -> Bool, elements: [T] = []) { + self.sort = sort +- self.elements = [] ++ self.elements = elements ++ if !elements.isEmpty { ++ for i in stride(from: elements.count / 2 - 1, through: 0, by: -1) { ++ siftDown(from: i) ++ } ++ } ++ } ++ ++ var isEmpty: Bool { ++ return elements.isEmpty + } + + var count: Int { +@@ -463,36 +413,32 @@ struct Heap { + + mutating func remove() -> T? { + guard !elements.isEmpty else { return nil } +- if elements.count == 1 { +- return elements.removeLast() +- } else { +- let value = elements[0] +- elements[0] = elements.removeLast() +- siftDown(from: 0) +- return value +- } ++ elements.swapAt(0, elements.count - 1) ++ let removedValue = elements.removeLast() ++ siftDown(from: 0) ++ return removedValue + } + + private mutating func siftUp(from index: Int) { + var child = index +- var parent = parentIndex(of: child) ++ var parent = parentIndex(ofChildAt: child) + while child > 0 && sort(elements[child], elements[parent]) { + elements.swapAt(child, parent) + child = parent +- parent = self.parentIndex(of: child) ++ parent = parentIndex(ofChildAt: child) + } + } + + private mutating func siftDown(from index: Int) { + var parent = index + while true { +- let left = leftChildIndex(of: parent) +- let right = rightChildIndex(of: parent) ++ let left = leftChildIndex(ofParentAt: parent) ++ let right = rightChildIndex(ofParentAt: parent) + var candidate = parent +- if left < elements.count && sort(elements[left], elements[candidate]) { ++ if left < count && sort(elements[left], elements[candidate]) { + candidate = left + } +- if right < elements.count && sort(elements[right], elements[candidate]) { ++ if right < count && sort(elements[right], elements[candidate]) { + candidate = right + } + if candidate == parent { +@@ -503,24 +449,24 @@ struct Heap { + } + } + +- private func parentIndex(of index: Int) -> Int { ++ private func parentIndex(ofChildAt index: Int) -> Int { + return (index - 1) / 2 + } + +- private func leftChildIndex(of index: Int) -> Int { ++ private func leftChildIndex(ofParentAt index: Int) -> Int { + return 2 * index + 1 + } + +- private func rightChildIndex(of index: Int) -> Int { ++ private func rightChildIndex(ofParentAt index: Int) -> Int { + return 2 * index + 2 + } + } + + /** + * Your MedianFinder object will be instantiated and called as such: +- * let obj = MedianFinder(); +- * obj.addNum(num); +- * let param_2 = obj.findMedian(); ++ * let obj = MedianFinder() ++ * obj.addNum(num) ++ * let ret_2: Double = obj.findMedian() + */ + ``` + +@@ -528,47 +474,4 @@ struct Heap { + + + +- +- +-### 方法二:有序列表 +- +-我们也可以使用一个有序列表来维护数据流中的元素,这样我们就可以直接通过索引来获取中位数。 +- +-时间复杂度方面,添加元素的时间复杂度为 $O(\log n)$,查找中位数的时间复杂度为 $O(1)$。空间复杂度为 $O(n)$。其中 $n$ 为数据流中元素的个数。 +- +- +- +-#### Python3 +- +-```python +-from sortedcontainers import SortedList +- +- +-class MedianFinder: +- def __init__(self): +- """""" +- initialize your data structure here. +- """""" +- self.sl = SortedList() +- +- def addNum(self, num: int) -> None: +- self.sl.add(num) +- +- def findMedian(self) -> float: +- n = len(self.sl) +- if n & 1: +- return self.sl[n // 2] +- return (self.sl[(n - 1) // 2] + self.sl[n // 2]) / 2 +- +- +-# Your MedianFinder object will be instantiated and called as such: +-# obj = MedianFinder() +-# obj.addNum(num) +-# param_2 = obj.findMedian() +-``` +- +- +- +- +- + +diff --git ""a/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.cpp"" ""b/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.cpp"" +index 55f74f02ead0c..4db5d9a118f29 100644 +--- ""a/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.cpp"" ++++ ""b/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.cpp"" +@@ -1,31 +1,26 @@ + class MedianFinder { + public: +- /** initialize your data structure here. */ + MedianFinder() { + } + + void addNum(int num) { +- if (q1.size() > q2.size()) { +- q1.push(num); +- q2.push(q1.top()); +- q1.pop(); +- } else { +- q2.push(num); +- q1.push(q2.top()); +- q2.pop(); ++ maxQ.push(num); ++ minQ.push(maxQ.top()); ++ maxQ.pop(); ++ ++ if (minQ.size() > maxQ.size() + 1) { ++ maxQ.push(minQ.top()); ++ minQ.pop(); + } + } + + double findMedian() { +- if (q1.size() > q2.size()) { +- return q1.top(); +- } +- return (q1.top() + q2.top()) / 2.0; ++ return minQ.size() == maxQ.size() ? (minQ.top() + maxQ.top()) / 2.0 : minQ.top(); + } + + private: +- priority_queue, greater> q1; +- priority_queue q2; ++ priority_queue maxQ; ++ priority_queue, greater> minQ; + }; + + /** +@@ -33,4 +28,4 @@ class MedianFinder { + * MedianFinder* obj = new MedianFinder(); + * obj->addNum(num); + * double param_2 = obj->findMedian(); +- */ +\ No newline at end of file ++ */ +diff --git ""a/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.cs"" ""b/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.cs"" +index 9ec974fe07e5f..6f5d6400527d3 100644 +--- ""a/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.cs"" ++++ ""b/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.cs"" +@@ -1,50 +1,21 @@ + public class MedianFinder { +- private List nums; +- private int curIndex; ++ private PriorityQueue minQ = new PriorityQueue(); ++ private PriorityQueue maxQ = new PriorityQueue(Comparer.Create((a, b) => b.CompareTo(a))); + +- /** initialize your data structure here. */ + public MedianFinder() { +- nums = new List(); +- } + +- private int FindIndex(int val) { +- int left = 0; +- int right = nums.Count - 1; +- while (left <= right) { +- int mid = left + (right - left) / 2; +- if (val > nums[mid]) { +- left = mid + 1; +- } else { +- right = mid - 1; +- } +- } +- return left; + } + + public void AddNum(int num) { +- if (nums.Count == 0) { +- nums.Add(num); +- curIndex = 0; +- } else { +- curIndex = FindIndex(num); +- if (curIndex == nums.Count) { +- nums.Add(num); +- } else { +- nums.Insert(curIndex, num); +- } ++ maxQ.Enqueue(num, num); ++ minQ.Enqueue(maxQ.Peek(), maxQ.Dequeue()); ++ if (minQ.Count > maxQ.Count + 1) { ++ maxQ.Enqueue(minQ.Peek(), minQ.Dequeue()); + } + } + + public double FindMedian() { +- if (nums.Count % 2 == 1) { +- return (double)nums[nums.Count / 2]; +- } else { +- if (nums.Count == 0) { +- return 0; +- } else { +- return (double) (nums[nums.Count / 2 - 1] + nums[nums.Count / 2]) / 2; +- } +- } ++ return minQ.Count == maxQ.Count ? (minQ.Peek() + maxQ.Peek()) / 2.0 : minQ.Peek(); + } + } + +diff --git ""a/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.go"" ""b/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.go"" +index b16e648a7e8f3..5da36e5deebd5 100644 +--- ""a/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.go"" ++++ ""b/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.go"" +@@ -1,27 +1,27 @@ + type MedianFinder struct { +- q1, q2 hp ++ minq hp ++ maxq hp + } + +-/** initialize your data structure here. */ + func Constructor() MedianFinder { + return MedianFinder{hp{}, hp{}} + } + + func (this *MedianFinder) AddNum(num int) { +- if this.q1.Len() > this.q2.Len() { +- heap.Push(&this.q1, num) +- heap.Push(&this.q2, -heap.Pop(&this.q1).(int)) +- } else { +- heap.Push(&this.q2, -num) +- heap.Push(&this.q1, -heap.Pop(&this.q2).(int)) ++ minq, maxq := &this.minq, &this.maxq ++ heap.Push(maxq, -num) ++ heap.Push(minq, -heap.Pop(maxq).(int)) ++ if minq.Len()-maxq.Len() > 1 { ++ heap.Push(maxq, -heap.Pop(minq).(int)) + } + } + + func (this *MedianFinder) FindMedian() float64 { +- if this.q1.Len() > this.q2.Len() { +- return float64(this.q1.IntSlice[0]) ++ minq, maxq := this.minq, this.maxq ++ if minq.Len() == maxq.Len() { ++ return float64(minq.IntSlice[0]-maxq.IntSlice[0]) / 2 + } +- return float64(this.q1.IntSlice[0]-this.q2.IntSlice[0]) / 2.0 ++ return float64(minq.IntSlice[0]) + } + + type hp struct{ sort.IntSlice } +@@ -40,4 +40,4 @@ func (h *hp) Pop() any { + * obj := Constructor(); + * obj.AddNum(num); + * param_2 := obj.FindMedian(); +- */ +\ No newline at end of file ++ */ +diff --git ""a/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.java"" ""b/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.java"" +index a66e8a1d34881..4fedda85b0558 100644 +--- ""a/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.java"" ++++ ""b/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.java"" +@@ -1,26 +1,20 @@ + class MedianFinder { +- private PriorityQueue q1 = new PriorityQueue<>(); +- private PriorityQueue q2 = new PriorityQueue<>((a, b) -> b - a); ++ private PriorityQueue minQ = new PriorityQueue<>(); ++ private PriorityQueue maxQ = new PriorityQueue<>(Collections.reverseOrder()); + +- /** initialize your data structure here. */ + public MedianFinder() { + } + + public void addNum(int num) { +- if (q1.size() > q2.size()) { +- q1.offer(num); +- q2.offer(q1.poll()); +- } else { +- q2.offer(num); +- q1.offer(q2.poll()); ++ maxQ.offer(num); ++ minQ.offer(maxQ.poll()); ++ if (minQ.size() - maxQ.size() > 1) { ++ maxQ.offer(minQ.poll()); + } + } + + public double findMedian() { +- if (q1.size() > q2.size()) { +- return q1.peek(); +- } +- return (q1.peek() + q2.peek()) / 2.0; ++ return minQ.size() == maxQ.size() ? (minQ.peek() + maxQ.peek()) / 2.0 : minQ.peek(); + } + } + +@@ -29,4 +23,4 @@ public double findMedian() { + * MedianFinder obj = new MedianFinder(); + * obj.addNum(num); + * double param_2 = obj.findMedian(); +- */ +\ No newline at end of file ++ */ +diff --git ""a/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.js"" ""b/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.js"" +index 8e67a7a2aa5e1..5e38a201dc1d8 100644 +--- ""a/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.js"" ++++ ""b/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.js"" +@@ -1,8 +1,6 @@ +-/** +- * initialize your data structure here. +- */ + var MedianFinder = function () { +- this.val = []; ++ this.minQ = new MinPriorityQueue(); ++ this.maxQ = new MaxPriorityQueue(); + }; + + /** +@@ -10,23 +8,26 @@ var MedianFinder = function () { + * @return {void} + */ + MedianFinder.prototype.addNum = function (num) { +- let left = 0; +- let right = this.val.length; +- while (left < right) { +- let mid = left + ~~((right - left) / 2); +- if (num > this.val[mid]) { +- left = mid + 1; +- } else { +- right = mid; +- } ++ this.maxQ.enqueue(num); ++ this.minQ.enqueue(this.maxQ.dequeue().element); ++ if (this.minQ.size() - this.maxQ.size() > 1) { ++ this.maxQ.enqueue(this.minQ.dequeue().element); + } +- this.val.splice(left, 0, num); + }; + + /** + * @return {number} + */ + MedianFinder.prototype.findMedian = function () { +- let mid = ~~(this.val.length / 2); +- return this.val.length % 2 ? this.val[mid] : (this.val[mid - 1] + this.val[mid]) / 2; ++ if (this.minQ.size() === this.maxQ.size()) { ++ return (this.minQ.front().element + this.maxQ.front().element) / 2; ++ } ++ return this.minQ.front().element; + }; ++ ++/** ++ * Your MedianFinder object will be instantiated and called as such: ++ * var obj = new MedianFinder() ++ * obj.addNum(num) ++ * var param_2 = obj.findMedian() ++ */ +diff --git ""a/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.py"" ""b/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.py"" +index 072c240a5ae3c..0b61b5b78e1c6 100644 +--- ""a/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.py"" ++++ ""b/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.py"" +@@ -1,21 +1,18 @@ + class MedianFinder: ++ + def __init__(self): +- """""" +- initialize your data structure here. +- """""" +- self.q1 = [] +- self.q2 = [] ++ self.minq = [] ++ self.maxq = [] + + def addNum(self, num: int) -> None: +- if len(self.q1) > len(self.q2): +- heappush(self.q2, -heappushpop(self.q1, num)) +- else: +- heappush(self.q1, -heappushpop(self.q2, -num)) ++ heappush(self.minq, -heappushpop(self.maxq, -num)) ++ if len(self.minq) - len(self.maxq) > 1: ++ heappush(self.maxq, -heappop(self.minq)) + + def findMedian(self) -> float: +- if len(self.q1) > len(self.q2): +- return self.q1[0] +- return (self.q1[0] - self.q2[0]) / 2 ++ if len(self.minq) == len(self.maxq): ++ return (self.minq[0] - self.maxq[0]) / 2 ++ return self.minq[0] + + + # Your MedianFinder object will be instantiated and called as such: +diff --git ""a/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.rs"" ""b/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.rs"" +index 52b8117baf98c..e3a7d37dfb505 100644 +--- ""a/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.rs"" ++++ ""b/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.rs"" +@@ -1,36 +1,35 @@ ++use std::cmp::Reverse; ++use std::collections::BinaryHeap; ++ + struct MedianFinder { +- nums: Vec, ++ minQ: BinaryHeap>, ++ maxQ: BinaryHeap, + } + +-/** +- * `&self` means the method takes an immutable reference. +- * If you need a mutable reference, change it to `&mut self` instead. +- */ + impl MedianFinder { +- /** initialize your data structure here. */ + fn new() -> Self { +- Self { nums: Vec::new() } ++ MedianFinder { ++ minQ: BinaryHeap::new(), ++ maxQ: BinaryHeap::new(), ++ } + } + + fn add_num(&mut self, num: i32) { +- let mut l = 0; +- let mut r = self.nums.len(); +- while l < r { +- let mid = (l + r) >> 1; +- if self.nums[mid] < num { +- l = mid + 1; +- } else { +- r = mid; +- } ++ self.maxQ.push(num); ++ self.minQ.push(Reverse(self.maxQ.pop().unwrap())); ++ ++ if self.minQ.len() > self.maxQ.len() + 1 { ++ self.maxQ.push(self.minQ.pop().unwrap().0); + } +- self.nums.insert(l, num); + } + + fn find_median(&self) -> f64 { +- let n = self.nums.len(); +- if (n & 1) == 1 { +- return f64::from(self.nums[n >> 1]); ++ if self.minQ.len() == self.maxQ.len() { ++ let min_top = self.minQ.peek().unwrap().0; ++ let max_top = *self.maxQ.peek().unwrap(); ++ (min_top + max_top) as f64 / 2.0 ++ } else { ++ self.minQ.peek().unwrap().0 as f64 + } +- f64::from(self.nums[n >> 1] + self.nums[(n >> 1) - 1]) / 2.0 + } + } +diff --git ""a/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.swift"" ""b/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.swift"" +index 20d2c1114cce4..bf1b16b0ac17b 100644 +--- ""a/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.swift"" ++++ ""b/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.swift"" +@@ -1,29 +1,23 @@ + class MedianFinder { +- private var lowerHalf = Heap(sort: >) +- private var upperHalf = Heap(sort: <) ++ private var minQ = Heap(sort: <) ++ private var maxQ = Heap(sort: >) + +- init() {} ++ init() { ++ } + + func addNum(_ num: Int) { +- if lowerHalf.count == 0 || num <= lowerHalf.peek()! { +- lowerHalf.insert(num) +- } else { +- upperHalf.insert(num) +- } +- +- if lowerHalf.count > upperHalf.count + 1 { +- upperHalf.insert(lowerHalf.remove()!) +- } else if upperHalf.count > lowerHalf.count { +- lowerHalf.insert(upperHalf.remove()!) ++ maxQ.insert(num) ++ minQ.insert(maxQ.remove()!) ++ if maxQ.count < minQ.count { ++ maxQ.insert(minQ.remove()!) + } + } + + func findMedian() -> Double { +- if lowerHalf.count > upperHalf.count { +- return Double(lowerHalf.peek()!) +- } else { +- return (Double(lowerHalf.peek()!) + Double(upperHalf.peek()!)) / 2.0 ++ if maxQ.count > minQ.count { ++ return Double(maxQ.peek()!) + } ++ return (Double(maxQ.peek()!) + Double(minQ.peek()!)) / 2.0 + } + } + +@@ -31,9 +25,18 @@ struct Heap { + var elements: [T] + let sort: (T, T) -> Bool + +- init(sort: @escaping (T, T) -> Bool) { ++ init(sort: @escaping (T, T) -> Bool, elements: [T] = []) { + self.sort = sort +- self.elements = [] ++ self.elements = elements ++ if !elements.isEmpty { ++ for i in stride(from: elements.count / 2 - 1, through: 0, by: -1) { ++ siftDown(from: i) ++ } ++ } ++ } ++ ++ var isEmpty: Bool { ++ return elements.isEmpty + } + + var count: Int { +@@ -51,36 +54,32 @@ struct Heap { + + mutating func remove() -> T? { + guard !elements.isEmpty else { return nil } +- if elements.count == 1 { +- return elements.removeLast() +- } else { +- let value = elements[0] +- elements[0] = elements.removeLast() +- siftDown(from: 0) +- return value +- } ++ elements.swapAt(0, elements.count - 1) ++ let removedValue = elements.removeLast() ++ siftDown(from: 0) ++ return removedValue + } + + private mutating func siftUp(from index: Int) { + var child = index +- var parent = parentIndex(of: child) ++ var parent = parentIndex(ofChildAt: child) + while child > 0 && sort(elements[child], elements[parent]) { + elements.swapAt(child, parent) + child = parent +- parent = self.parentIndex(of: child) ++ parent = parentIndex(ofChildAt: child) + } + } + + private mutating func siftDown(from index: Int) { + var parent = index + while true { +- let left = leftChildIndex(of: parent) +- let right = rightChildIndex(of: parent) ++ let left = leftChildIndex(ofParentAt: parent) ++ let right = rightChildIndex(ofParentAt: parent) + var candidate = parent +- if left < elements.count && sort(elements[left], elements[candidate]) { ++ if left < count && sort(elements[left], elements[candidate]) { + candidate = left + } +- if right < elements.count && sort(elements[right], elements[candidate]) { ++ if right < count && sort(elements[right], elements[candidate]) { + candidate = right + } + if candidate == parent { +@@ -91,22 +90,22 @@ struct Heap { + } + } + +- private func parentIndex(of index: Int) -> Int { ++ private func parentIndex(ofChildAt index: Int) -> Int { + return (index - 1) / 2 + } + +- private func leftChildIndex(of index: Int) -> Int { ++ private func leftChildIndex(ofParentAt index: Int) -> Int { + return 2 * index + 1 + } + +- private func rightChildIndex(of index: Int) -> Int { ++ private func rightChildIndex(ofParentAt index: Int) -> Int { + return 2 * index + 2 + } + } + + /** + * Your MedianFinder object will be instantiated and called as such: +- * let obj = MedianFinder(); +- * obj.addNum(num); +- * let param_2 = obj.findMedian(); +- */ +\ No newline at end of file ++ * let obj = MedianFinder() ++ * obj.addNum(num) ++ * let ret_2: Double = obj.findMedian() ++ */ +diff --git ""a/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.ts"" ""b/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.ts"" +index 8d02f1c2588a9..0df774deac49f 100644 +--- ""a/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.ts"" ++++ ""b/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution.ts"" +@@ -1,32 +1,22 @@ + class MedianFinder { +- private nums: number[]; +- +- constructor() { +- this.nums = []; +- } ++ #minQ = new MinPriorityQueue(); ++ #maxQ = new MaxPriorityQueue(); + + addNum(num: number): void { +- const { nums } = this; +- let l = 0; +- let r = nums.length; +- while (l < r) { +- const mid = (l + r) >>> 1; +- if (nums[mid] < num) { +- l = mid + 1; +- } else { +- r = mid; +- } ++ const [minQ, maxQ] = [this.#minQ, this.#maxQ]; ++ maxQ.enqueue(num); ++ minQ.enqueue(maxQ.dequeue().element); ++ if (minQ.size() - maxQ.size() > 1) { ++ maxQ.enqueue(minQ.dequeue().element); + } +- nums.splice(l, 0, num); + } + + findMedian(): number { +- const { nums } = this; +- const n = nums.length; +- if ((n & 1) === 1) { +- return nums[n >> 1]; ++ const [minQ, maxQ] = [this.#minQ, this.#maxQ]; ++ if (minQ.size() === maxQ.size()) { ++ return (minQ.front().element + maxQ.front().element) / 2; + } +- return (nums[n >> 1] + nums[(n >> 1) - 1]) / 2; ++ return minQ.front().element; + } + } + +diff --git ""a/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution2.py"" ""b/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution2.py"" +deleted file mode 100644 +index ba0aa0cd2532e..0000000000000 +--- ""a/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/Solution2.py"" ++++ /dev/null +@@ -1,24 +0,0 @@ +-from sortedcontainers import SortedList +- +- +-class MedianFinder: +- def __init__(self): +- """""" +- initialize your data structure here. +- """""" +- self.sl = SortedList() +- +- def addNum(self, num: int) -> None: +- self.sl.add(num) +- +- def findMedian(self) -> float: +- n = len(self.sl) +- if n & 1: +- return self.sl[n // 2] +- return (self.sl[(n - 1) // 2] + self.sl[n // 2]) / 2 +- +- +-# Your MedianFinder object will be instantiated and called as such: +-# obj = MedianFinder() +-# obj.addNum(num) +-# param_2 = obj.findMedian()" +greptimedb,https://github.com/GreptimeTeam/greptimedb,1b4236d69822af2904a7d3ae335d1cb4115b2bcd,shuiyisong,2023-03-07 08:21:47,refactor: use split instead of `serde_urlencoded` in http auth (#1110),"* refactor: change from urlencoded to regex + +* refactor: change from urlencoded to regex + +* chore: add unit test + +* chore: update comment + +* chore: remove local benchmark test + +* chore: minor fix + +* chore: remove unused dep","refactor: use split instead of `serde_urlencoded` in http auth (#1110) + +* refactor: change from urlencoded to regex + +* refactor: change from urlencoded to regex + +* chore: add unit test + +* chore: update comment + +* chore: remove local benchmark test + +* chore: minor fix + +* chore: remove unused dep","diff --git a/Cargo.lock b/Cargo.lock +index bb751e53b13d..6439d25f14ca 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -6940,7 +6940,6 @@ dependencies = [ + ""script"", + ""serde"", + ""serde_json"", +- ""serde_urlencoded"", + ""session"", + ""sha1"", + ""snafu"", +diff --git a/src/servers/Cargo.toml b/src/servers/Cargo.toml +index d3e2634fbd59..48bd54d46607 100644 +--- a/src/servers/Cargo.toml ++++ b/src/servers/Cargo.toml +@@ -52,7 +52,6 @@ rustls-pemfile = ""1.0"" + schemars = ""0.8"" + serde.workspace = true + serde_json = ""1.0"" +-serde_urlencoded = ""0.7"" + session = { path = ""../session"" } + sha1 = ""0.10"" + snafu = { version = ""0.7"", features = [""backtraces""] } +diff --git a/src/servers/src/auth.rs b/src/servers/src/auth.rs +index 35b5ac533bc2..adff1a74d8a1 100644 +--- a/src/servers/src/auth.rs ++++ b/src/servers/src/auth.rs +@@ -82,7 +82,7 @@ pub enum Error { + #[snafu(display(""Invalid config value: {}, {}"", value, msg))] + InvalidConfig { value: String, msg: String }, + +- #[snafu(display(""Illegal runtime param: {}"", msg))] ++ #[snafu(display(""Illegal param: {}"", msg))] + IllegalParam { msg: String }, + + #[snafu(display(""Internal state error: {}"", msg))] +diff --git a/src/servers/src/http/authorize.rs b/src/servers/src/http/authorize.rs +index d438fe4e1abb..4259912d6f94 100644 +--- a/src/servers/src/http/authorize.rs ++++ b/src/servers/src/http/authorize.rs +@@ -12,7 +12,6 @@ + // See the License for the specific language governing permissions and + // limitations under the License. + +-use std::collections::HashMap; + use std::marker::PhantomData; + + use axum::http::{self, Request, StatusCode}; +@@ -106,21 +105,12 @@ async fn authorize( + ) -> crate::auth::Result<()> { + // try get database name + let query = request.uri().query().unwrap_or_default(); +- let input_database = match serde_urlencoded::from_str::>(query) { +- Ok(query_map) => query_map +- .get(""db"") +- .context(IllegalParamSnafu { +- msg: ""fail to get valid database from http query"", +- })? +- .to_owned(), +- Err(e) => IllegalParamSnafu { +- msg: format!(""fail to parse http query: {e}""), +- } +- .fail()?, +- }; ++ let input_database = extract_db_from_query(query).context(IllegalParamSnafu { ++ msg: ""db not provided or corrupted"", ++ })?; + + let (catalog, database) = +- crate::parse_catalog_and_schema_from_client_database_name(&input_database); ++ crate::parse_catalog_and_schema_from_client_database_name(input_database); + + let user_info = request + .extensions() +@@ -157,20 +147,7 @@ fn get_influxdb_credentials( + // try v1 + let Some(query_str) = request.uri().query() else { return Ok(None) }; + +- // TODO(shuiyisong): remove this for performance optimization +- // `authorize` would deserialize query from urlencoded again +- let query = match serde_urlencoded::from_str::>(query_str) { +- Ok(query_map) => query_map, +- Err(e) => IllegalParamSnafu { +- msg: format!(""fail to parse http query: {e}""), +- } +- .fail()?, +- }; +- +- let username = query.get(""u""); +- let password = query.get(""p""); +- +- match (username, password) { ++ match extract_influxdb_user_from_query(query_str) { + (None, None) => Ok(None), + (Some(username), Some(password)) => { + Ok(Some((username.to_string(), password.to_string()))) +@@ -281,8 +258,33 @@ fn need_auth(req: &Request) -> bool { + path.starts_with(HTTP_API_PREFIX) + } + ++fn extract_db_from_query(query: &str) -> Option<&str> { ++ for pair in query.split('&') { ++ if let Some(db) = pair.strip_prefix(""db="") { ++ return if db.is_empty() { None } else { Some(db) }; ++ } ++ } ++ None ++} ++ ++fn extract_influxdb_user_from_query(query: &str) -> (Option<&str>, Option<&str>) { ++ let mut username = None; ++ let mut password = None; ++ ++ for pair in query.split('&') { ++ if pair.starts_with(""u="") && pair.len() > 2 { ++ username = Some(&pair[2..]); ++ } else if pair.starts_with(""p="") && pair.len() > 2 { ++ password = Some(&pair[2..]); ++ } ++ } ++ (username, password) ++} ++ + #[cfg(test)] + mod tests { ++ use std::assert_matches::assert_matches; ++ + use super::*; + + #[test] +@@ -319,7 +321,7 @@ mod tests { + + let wrong_credential = ""dXNlcm5hbWU6cG Fzc3dvcmQ=""; + let result = decode_basic(wrong_credential); +- matches!(result.err(), Some(error::Error::InvalidBase64Value { .. })); ++ assert_matches!(result.err(), Some(error::Error::InvalidBase64Value { .. })); + } + + #[test] +@@ -330,7 +332,7 @@ mod tests { + + let auth_scheme_str = ""basic dGVzdDp0ZXN0""; + let scheme: AuthScheme = auth_scheme_str.try_into().unwrap(); +- matches!(scheme, AuthScheme::Basic(username, pwd) if username == ""test"" && pwd == ""test""); ++ assert_matches!(scheme, AuthScheme::Basic(username, pwd) if username == ""test"" && pwd == ""test""); + + let unsupported = ""digest""; + let auth_scheme: Result = unsupported.try_into(); +@@ -343,18 +345,18 @@ mod tests { + let req = mock_http_request(Some(""Basic dXNlcm5hbWU6cGFzc3dvcmQ=""), None).unwrap(); + + let auth_scheme = auth_header(&req).unwrap(); +- matches!(auth_scheme, AuthScheme::Basic(username, pwd) if username == ""username"" && pwd == ""password""); ++ assert_matches!(auth_scheme, AuthScheme::Basic(username, pwd) if username == ""username"" && pwd == ""password""); + + let wrong_req = mock_http_request(Some(""Basic dXNlcm5hbWU6 cGFzc3dvcmQ=""), None).unwrap(); + let res = auth_header(&wrong_req); +- matches!( ++ assert_matches!( + res.err(), + Some(error::Error::InvalidAuthorizationHeader { .. }) + ); + + let wrong_req = mock_http_request(Some(""Digest dXNlcm5hbWU6cGFzc3dvcmQ=""), None).unwrap(); + let res = auth_header(&wrong_req); +- matches!(res.err(), Some(error::Error::UnsupportedAuthScheme { .. })); ++ assert_matches!(res.err(), Some(error::Error::UnsupportedAuthScheme { .. })); + } + + fn mock_http_request(auth_header: Option<&str>, uri: Option<&str>) -> Result> { +@@ -367,4 +369,50 @@ mod tests { + + Ok(req.body(()).unwrap()) + } ++ ++ #[test] ++ fn test_extract_db() { ++ assert_matches!(extract_db_from_query(""""), None); ++ assert_matches!(extract_db_from_query(""&""), None); ++ assert_matches!(extract_db_from_query(""db=""), None); ++ assert_matches!(extract_db_from_query(""db=foo""), Some(""foo"")); ++ assert_matches!(extract_db_from_query(""name=bar""), None); ++ assert_matches!(extract_db_from_query(""db=&name=bar""), None); ++ assert_matches!(extract_db_from_query(""db=foo&name=bar""), Some(""foo"")); ++ assert_matches!(extract_db_from_query(""name=bar&db=""), None); ++ assert_matches!(extract_db_from_query(""name=bar&db=foo""), Some(""foo"")); ++ assert_matches!(extract_db_from_query(""name=bar&db=&name=bar""), None); ++ assert_matches!( ++ extract_db_from_query(""name=bar&db=foo&name=bar""), ++ Some(""foo"") ++ ); ++ } ++ ++ #[test] ++ fn test_extract_user() { ++ assert_matches!(extract_influxdb_user_from_query(""""), (None, None)); ++ assert_matches!(extract_influxdb_user_from_query(""u=""), (None, None)); ++ assert_matches!( ++ extract_influxdb_user_from_query(""u=123""), ++ (Some(""123""), None) ++ ); ++ assert_matches!( ++ extract_influxdb_user_from_query(""u=123&p=""), ++ (Some(""123""), None) ++ ); ++ assert_matches!( ++ extract_influxdb_user_from_query(""u=123&p=4""), ++ (Some(""123""), Some(""4"")) ++ ); ++ assert_matches!(extract_influxdb_user_from_query(""p=""), (None, None)); ++ assert_matches!(extract_influxdb_user_from_query(""p=4""), (None, Some(""4""))); ++ assert_matches!( ++ extract_influxdb_user_from_query(""p=4&u=""), ++ (None, Some(""4"")) ++ ); ++ assert_matches!( ++ extract_influxdb_user_from_query(""p=4&u=123""), ++ (Some(""123""), Some(""4"")) ++ ); ++ } + } +diff --git a/src/servers/tests/auth.rs b/src/servers/tests/auth.rs +index 8e9c9b854637..0c38124189e1 100644 +--- a/src/servers/tests/auth.rs ++++ b/src/servers/tests/auth.rs +@@ -134,10 +134,10 @@ async fn test_auth_by_plain_text() { + ) + .await; + assert!(auth_result.is_err()); +- matches!( ++ assert!(matches!( + auth_result.err().unwrap(), + servers::auth::Error::UnsupportedPasswordType { .. } +- ); ++ )); + + // auth failed, err: user not exist. + let auth_result = user_provider +@@ -147,10 +147,10 @@ async fn test_auth_by_plain_text() { + ) + .await; + assert!(auth_result.is_err()); +- matches!( ++ assert!(matches!( + auth_result.err().unwrap(), + servers::auth::Error::UserNotFound { .. } +- ); ++ )); + + // auth failed, err: wrong password + let auth_result = user_provider +@@ -160,10 +160,10 @@ async fn test_auth_by_plain_text() { + ) + .await; + assert!(auth_result.is_err()); +- matches!( ++ assert!(matches!( + auth_result.err().unwrap(), + servers::auth::Error::UserPasswordMismatch { .. } +- ); ++ )) + } + + #[tokio::test]" +vector,https://github.com/vectordotdev/vector,8ab99d1804e3f12161ddaec22afe9d79ecc1b31d,Brian L. Troutwine,2021-12-23 23:04:43,chore: Convert delimiter to byte (#10570),"* Convert delimiter to byte + +This commit converts the delimiter to byte from char. In some instances a char +can be multi-bytes wide, meaning that it's possible for the current algorithm to +split a delimiter as it forwards in the underlying buffer. The implementation +assumes that we want single-byte delimiters, which is now the case.","chore: Convert delimiter to byte (#10570) + +* Convert delimiter to byte + +This commit converts the delimiter to byte from char. In some instances a char +can be multi-bytes wide, meaning that it's possible for the current algorithm to +split a delimiter as it forwards in the underlying buffer. The implementation +assumes that we want single-byte delimiters, which is now the case. + +Resolves #10569 + +Signed-off-by: Brian L. Troutwine + +* correct benchmark ding + +Signed-off-by: Brian L. Troutwine ","diff --git a/benches/codecs/character_delimited_bytes.rs b/benches/codecs/character_delimited_bytes.rs +index 1c6d7cf57423c..9c070e072a9c1 100644 +--- a/benches/codecs/character_delimited_bytes.rs ++++ b/benches/codecs/character_delimited_bytes.rs +@@ -47,8 +47,8 @@ fn decoding(c: &mut Criterion) { + let framer = Box::new( + param + .max_length +- .map(|ml| CharacterDelimitedDecoder::new_with_max_length('a', ml)) +- .unwrap_or(CharacterDelimitedDecoder::new('a')), ++ .map(|ml| CharacterDelimitedDecoder::new_with_max_length(b'a', ml)) ++ .unwrap_or(CharacterDelimitedDecoder::new(b'a')), + ); + let deserializer = Box::new(BytesDeserializer::new()); + let decoder = codecs::Decoder::new(framer, deserializer); +diff --git a/benches/languages.rs b/benches/languages.rs +index 355878435bd9f..a751b22ff1b7c 100644 +--- a/benches/languages.rs ++++ b/benches/languages.rs +@@ -331,7 +331,7 @@ fn benchmark_configs( + config.push_str(&transform_config); + config.push_str(&sink_config); + +- let config = config::load_from_str(&config, Some(config::Format::Toml)) ++ let config = config::load_from_str(&config, config::Format::Toml) + .expect(&format!(""invalid TOML configuration: {}"", &config)); + let rt = runtime(); + let (output_lines, topology) = rt.block_on(async move { +diff --git a/src/codecs/framing/character_delimited.rs b/src/codecs/framing/character_delimited.rs +index 1b469f8c0fcab..df73a38038872 100644 +--- a/src/codecs/framing/character_delimited.rs ++++ b/src/codecs/framing/character_delimited.rs +@@ -16,7 +16,7 @@ pub struct CharacterDelimitedDecoderConfig { + #[derive(Debug, Clone, Deserialize, Serialize, PartialEq)] + pub struct CharacterDelimitedDecoderOptions { + /// The character that delimits byte sequences. +- delimiter: char, ++ delimiter: u8, + /// The maximum length of the byte buffer. + /// + /// This length does *not* include the trailing delimiter. +@@ -44,7 +44,7 @@ impl FramingConfig for CharacterDelimitedDecoderConfig { + #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] + pub struct CharacterDelimitedDecoder { + /// The delimiter used to separate byte sequences. +- delimiter: char, ++ delimiter: u8, + /// The maximum length of the byte buffer. + max_length: usize, + /// Whether the `max_length` has been exceeded, resulting in discarding all +@@ -56,7 +56,7 @@ pub struct CharacterDelimitedDecoder { + + impl CharacterDelimitedDecoder { + /// Creates a `CharacterDelimitedDecoder` with the specified delimiter. +- pub const fn new(delimiter: char) -> Self { ++ pub const fn new(delimiter: u8) -> Self { + CharacterDelimitedDecoder { + delimiter, + max_length: usize::MAX, +@@ -68,7 +68,7 @@ impl CharacterDelimitedDecoder { + /// Creates a `CharacterDelimitedDecoder` with a maximum frame length limit. + /// + /// Any frames longer than `max_length` bytes will be discarded entirely. +- pub const fn new_with_max_length(delimiter: char, max_length: usize) -> Self { ++ pub const fn new_with_max_length(delimiter: u8, max_length: usize) -> Self { + CharacterDelimitedDecoder { + max_length, + ..CharacterDelimitedDecoder::new(delimiter) +@@ -93,7 +93,7 @@ impl Decoder for CharacterDelimitedDecoder { + + let newline_pos = buf[self.next_index..read_to] + .iter() +- .position(|b| *b as char == self.delimiter); ++ .position(|b| *b == self.delimiter); + + match (self.is_discarding, newline_pos) { + (true, Some(offset)) => { +@@ -189,7 +189,7 @@ mod tests { + + #[test] + fn character_delimited_decode() { +- let mut codec = CharacterDelimitedDecoder::new('\n'); ++ let mut codec = CharacterDelimitedDecoder::new(b'\n'); + let buf = &mut BytesMut::new(); + buf.put_slice(b""abc\n""); + assert_eq!(Some(""abc"".into()), codec.decode(buf).unwrap()); +@@ -197,7 +197,7 @@ mod tests { + + #[test] + fn character_delimited_encode() { +- let mut codec = CharacterDelimitedDecoder::new('\n'); ++ let mut codec = CharacterDelimitedDecoder::new(b'\n'); + + let mut buf = BytesMut::new(); + codec.encode(b""abc"", &mut buf).unwrap(); +@@ -209,7 +209,7 @@ mod tests { + fn decode_max_length() { + const MAX_LENGTH: usize = 6; + +- let mut codec = CharacterDelimitedDecoder::new_with_max_length('\n', MAX_LENGTH); ++ let mut codec = CharacterDelimitedDecoder::new_with_max_length(b'\n', MAX_LENGTH); + let buf = &mut BytesMut::new(); + + // limit is 6 so it will skip longer lines +@@ -234,7 +234,7 @@ mod tests { + fn decoder_discard_repeat() { + const MAX_LENGTH: usize = 1; + +- let mut codec = CharacterDelimitedDecoder::new_with_max_length('\n', MAX_LENGTH); ++ let mut codec = CharacterDelimitedDecoder::new_with_max_length(b'\n', MAX_LENGTH); + let buf = &mut BytesMut::new(); + + buf.reserve(200); +@@ -253,7 +253,7 @@ mod tests { + let mut bytes = serde_json::to_vec(&input).unwrap(); + bytes.push(b'\n'); + +- let mut codec = CharacterDelimitedDecoder::new('\n'); ++ let mut codec = CharacterDelimitedDecoder::new(b'\n'); + let buf = &mut BytesMut::new(); + + buf.reserve(bytes.len()); +@@ -321,7 +321,7 @@ mod tests { + {""log"":""2019-01-18 07:53:06.419 [ ] INFO 1 --- [vent-bus.prod-1] c.t.listener.CommonListener : warehousing Dailywarehousing.daily\n"",""stream"":""stdout"",""time"":""2019-01-18T07:53:06.420527437Z""} + ""#}; + +- let mut codec = CharacterDelimitedDecoder::new('\n'); ++ let mut codec = CharacterDelimitedDecoder::new(b'\n'); + let buf = &mut BytesMut::new(); + + buf.extend(events.to_string().as_bytes()); +diff --git a/src/codecs/framing/newline_delimited.rs b/src/codecs/framing/newline_delimited.rs +index e68cd22488734..30ac189412528 100644 +--- a/src/codecs/framing/newline_delimited.rs ++++ b/src/codecs/framing/newline_delimited.rs +@@ -71,7 +71,7 @@ pub struct NewlineDelimitedDecoder(CharacterDelimitedDecoder); + impl NewlineDelimitedDecoder { + /// Creates a new `NewlineDelimitedDecoder`. + pub const fn new() -> Self { +- Self(CharacterDelimitedDecoder::new('\n')) ++ Self(CharacterDelimitedDecoder::new(b'\n')) + } + + /// Creates a `NewlineDelimitedDecoder` with a maximum frame length limit. +@@ -79,7 +79,7 @@ impl NewlineDelimitedDecoder { + /// Any frames longer than `max_length` bytes will be discarded entirely. + pub const fn new_with_max_length(max_length: usize) -> Self { + Self(CharacterDelimitedDecoder::new_with_max_length( +- '\n', max_length, ++ b'\n', max_length, + )) + } + } +diff --git a/src/sources/aws_s3/sqs.rs b/src/sources/aws_s3/sqs.rs +index aabddaf6e9b8e..ebf8d3e63f2c1 100644 +--- a/src/sources/aws_s3/sqs.rs ++++ b/src/sources/aws_s3/sqs.rs +@@ -429,7 +429,7 @@ impl IngestorProcess { + // the case that the same vector instance processes the same message. + let mut read_error = None; + let lines: Box + Send + Unpin> = Box::new( +- FramedRead::new(object_reader, CharacterDelimitedDecoder::new('\n')) ++ FramedRead::new(object_reader, CharacterDelimitedDecoder::new(b'\n')) + .map(|res| { + res.map_err(|err| { + read_error = Some(err); +diff --git a/src/sources/journald.rs b/src/sources/journald.rs +index 64f4e392fabff..a52d617ebf939 100644 +--- a/src/sources/journald.rs ++++ b/src/sources/journald.rs +@@ -426,7 +426,7 @@ fn start_journalctl( + + let stream = FramedRead::new( + child.stdout.take().unwrap(), +- CharacterDelimitedDecoder::new('\n'), ++ CharacterDelimitedDecoder::new(b'\n'), + ) + .boxed();" +habitica,https://github.com/HabitRPG/habitica,868a8a4e7710ac284caf0927068adca747bbe9df,dependabot-preview[bot],2020-11-09 15:20:05,build(deps): bump sass from 1.28.0 to 1.29.0 in /website/client (#12769),"Bumps [sass](https://github.com/sass/dart-sass) from 1.28.0 to 1.29.0. +- [Release notes](https://github.com/sass/dart-sass/releases) +- [Changelog](https://github.com/sass/dart-sass/blob/master/CHANGELOG.md) +- [Commits](https://github.com/sass/dart-sass/compare/1.28.0...1.29.0)","build(deps): bump sass from 1.28.0 to 1.29.0 in /website/client (#12769) + +Bumps [sass](https://github.com/sass/dart-sass) from 1.28.0 to 1.29.0. +- [Release notes](https://github.com/sass/dart-sass/releases) +- [Changelog](https://github.com/sass/dart-sass/blob/master/CHANGELOG.md) +- [Commits](https://github.com/sass/dart-sass/compare/1.28.0...1.29.0) + +Signed-off-by: dependabot-preview[bot] + +Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>","diff --git a/website/client/package-lock.json b/website/client/package-lock.json +index 41c37d7abc9..bc5b8a447b9 100644 +--- a/website/client/package-lock.json ++++ b/website/client/package-lock.json +@@ -18371,9 +18371,9 @@ + ""integrity"": ""sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="" + }, + ""sass"": { +- ""version"": ""1.28.0"", +- ""resolved"": ""https://registry.npmjs.org/sass/-/sass-1.28.0.tgz"", +- ""integrity"": ""sha512-9FWX/0wuE1KxwfiP02chZhHaPzu6adpx9+wGch7WMOuHy5npOo0UapRI3FNSHva2CczaYJu2yNUBN8cCSqHz/A=="", ++ ""version"": ""1.29.0"", ++ ""resolved"": ""https://registry.npmjs.org/sass/-/sass-1.29.0.tgz"", ++ ""integrity"": ""sha512-ZpwAUFgnvAUCdkjwPREny+17BpUj8nh5Yr6zKPGtLNTLrmtoRYIjm7njP24COhjJldjwW1dcv52Lpf4tNZVVRA=="", + ""requires"": { + ""chokidar"": "">=2.0.0 <4.0.0"" + } +diff --git a/website/client/package.json b/website/client/package.json +index e8ed76fe737..70b18a17024 100644 +--- a/website/client/package.json ++++ b/website/client/package.json +@@ -44,7 +44,7 @@ + ""lodash"": ""^4.17.20"", + ""moment"": ""^2.29.1"", + ""nconf"": ""^0.10.0"", +- ""sass"": ""^1.28.0"", ++ ""sass"": ""^1.29.0"", + ""sass-loader"": ""^8.0.2"", + ""smartbanner.js"": ""^1.16.0"", + ""svg-inline-loader"": ""^0.8.2""," +sentry,https://github.com/getsentry/sentry,ff6f260e9edb726374d2e4f455ff8b3d0ecd551e,Lauryn Brown,2018-03-03 04:52:41,"feat(environments): Added ReleaseProjectEnvironment to team and project transfer_to, project delete, and release merge. (#7405)","* Added obvious changes to transfer to. + +* Searched for and added the releaseprojectenviornment to similar areas as releaseproject. + +* Added a test that asserts that ReleaseProjectEnvironment is deleted during team transfer. + +* Added test to ensure ReleaseProject and ReleaseProjectEnvironment are deleted on project transfer. + +* Added ReleaseProjectEnvironment to release merge test + +* Added environment objects to test +-release to avoid mysql problems.","feat(environments): Added ReleaseProjectEnvironment to team and project transfer_to, project delete, and release merge. (#7405) + +* Added obvious changes to transfer to. + +* Searched for and added the releaseprojectenviornment to similar areas as releaseproject. + +* Added a test that asserts that ReleaseProjectEnvironment is deleted during team transfer. + +* Added test to ensure ReleaseProject and ReleaseProjectEnvironment are deleted on project transfer. + +* Added ReleaseProjectEnvironment to release merge test + +* Added environment objects to test +-release to avoid mysql problems.","diff --git a/src/sentry/deletions/defaults/project.py b/src/sentry/deletions/defaults/project.py +index 253b2b0647b8e2..e3d14c3578174a 100644 +--- a/src/sentry/deletions/defaults/project.py ++++ b/src/sentry/deletions/defaults/project.py +@@ -43,7 +43,7 @@ def get_child_relations(self, instance): + # in bulk + # Release needs to handle deletes after Group is cleaned up as the foreign + # key is protected +- model_list = (models.Group, models.ReleaseProject, models.ProjectDSymFile, ++ model_list = (models.Group, models.ReleaseProject, models.ReleaseProjectEnvironment, models.ProjectDSymFile, + models.ProjectSymCacheFile) + relations.extend( + [ModelRelation(m, {'project_id': instance.id}, ModelDeletionTask) for m in model_list] +diff --git a/src/sentry/models/project.py b/src/sentry/models/project.py +index d93de348867b57..baea183b5bfa02 100644 +--- a/src/sentry/models/project.py ++++ b/src/sentry/models/project.py +@@ -293,6 +293,7 @@ def transfer_to(self, team): + EnvironmentProject, + ProjectTeam, + ReleaseProject, ++ ReleaseProjectEnvironment, + Rule, + ) + +@@ -327,7 +328,7 @@ def transfer_to(self, team): + # to this however, such as rules, which should maintain their + # configuration when moved across organizations. + if org_changed: +- for model in ReleaseProject, EnvironmentProject: ++ for model in ReleaseProject, ReleaseProjectEnvironment, EnvironmentProject: + model.objects.filter( + project_id=self.id, + ).delete() +diff --git a/src/sentry/models/release.py b/src/sentry/models/release.py +index 3d1669137b3732..666c387f33bdc3 100644 +--- a/src/sentry/models/release.py ++++ b/src/sentry/models/release.py +@@ -186,12 +186,12 @@ def merge(cls, to_release, from_releases): + # ReleaseFile.release + + from sentry.models import ( +- ReleaseCommit, ReleaseEnvironment, ReleaseFile, ReleaseProject, Group, GroupRelease, ++ ReleaseCommit, ReleaseEnvironment, ReleaseFile, ReleaseProject, ReleaseProjectEnvironment, Group, GroupRelease, + GroupResolution + ) + + model_list = ( +- ReleaseCommit, ReleaseEnvironment, ReleaseFile, ReleaseProject, GroupRelease, ++ ReleaseCommit, ReleaseEnvironment, ReleaseFile, ReleaseProject, ReleaseProjectEnvironment, GroupRelease, + GroupResolution + ) + for release in from_releases: +diff --git a/src/sentry/models/team.py b/src/sentry/models/team.py +index 3a4ae9631f0c01..a15233cb5ea4b1 100644 +--- a/src/sentry/models/team.py ++++ b/src/sentry/models/team.py +@@ -185,7 +185,7 @@ def transfer_to(self, organization): + """""" + from sentry.models import ( + OrganizationAccessRequest, OrganizationMember, OrganizationMemberTeam, Project, +- ProjectTeam, ReleaseProject ++ ProjectTeam, ReleaseProject, ReleaseProjectEnvironment + ) + + try: +@@ -213,6 +213,9 @@ def transfer_to(self, organization): + ReleaseProject.objects.filter( + project_id__in=project_ids, + ).delete() ++ ReleaseProjectEnvironment.objects.filter( ++ project_id__in=project_ids, ++ ).delete() + + Project.objects.filter( + id__in=project_ids, +diff --git a/tests/sentry/models/test_project.py b/tests/sentry/models/test_project.py +index 6bb18b2b1c2c8a..f43d3633fc710e 100644 +--- a/tests/sentry/models/test_project.py ++++ b/tests/sentry/models/test_project.py +@@ -2,7 +2,7 @@ + + from __future__ import absolute_import + +-from sentry.models import Environment, OrganizationMember, OrganizationMemberTeam, Project, Rule ++from sentry.models import Environment, OrganizationMember, OrganizationMemberTeam, Project, Release, ReleaseProject, ReleaseProjectEnvironment, Rule + from sentry.testutils import TestCase + + +@@ -84,3 +84,48 @@ def test_transfer_to_slug_collision(self): + assert project.slug != 'matt' + assert Project.objects.filter(organization=to_org).count() == 2 + assert Project.objects.filter(organization=from_org).count() == 0 ++ ++ def test_transfer_to_releases(self): ++ from_org = self.create_organization() ++ from_team = self.create_team(organization=from_org) ++ to_org = self.create_organization() ++ to_team = self.create_team(organization=to_org) ++ ++ project = self.create_project(teams=[from_team]) ++ ++ environment = Environment.get_or_create(project, 'production') ++ release = Release.get_or_create(project=project, version='1.0') ++ ++ ReleaseProjectEnvironment.objects.create( ++ project=project, ++ release=release, ++ environment=environment, ++ ) ++ ++ assert ReleaseProjectEnvironment.objects.filter( ++ project=project, ++ release=release, ++ environment=environment, ++ ).exists() ++ assert ReleaseProject.objects.filter( ++ project=project, ++ release=release, ++ ).exists() ++ ++ project.transfer_to(to_team) ++ ++ project = Project.objects.get(id=project.id) ++ ++ assert project.teams.count() == 1 ++ assert project.teams.first() == to_team ++ assert project.organization_id == to_org.id ++ ++ assert not ReleaseProjectEnvironment.objects.filter( ++ project=project, ++ release=release, ++ environment=environment, ++ ).exists() ++ assert not ReleaseProject.objects.filter( ++ project=project, ++ release=release, ++ ).exists() +diff --git a/tests/sentry/models/test_release.py b/tests/sentry/models/test_release.py +index d1f90009a939bc..5d7b711c803364 100644 +--- a/tests/sentry/models/test_release.py ++++ b/tests/sentry/models/test_release.py +@@ -4,8 +4,8 @@ + import six + + from sentry.models import ( +- Commit, CommitAuthor, Group, GroupRelease, GroupResolution, GroupLink, GroupStatus, +- Release, ReleaseCommit, ReleaseEnvironment, ReleaseProject, Repository ++ Commit, CommitAuthor, Environment, Group, GroupRelease, GroupResolution, GroupLink, GroupStatus, ++ Release, ReleaseCommit, ReleaseEnvironment, ReleaseProject, ReleaseProjectEnvironment, Repository + ) + + from sentry.testutils import TestCase +@@ -19,13 +19,17 @@ def test_simple(self): + + # merge to + project = self.create_project(organization=org, name='foo') ++ environment = Environment.get_or_create(project=project, name='env1') + release = Release.objects.create(version='abcdabc', organization=org) + release.add_project(project) + release_commit = ReleaseCommit.objects.create( + organization_id=org.id, release=release, commit=commit, order=1 + ) + release_environment = ReleaseEnvironment.objects.create( +- organization_id=org.id, project_id=project.id, release_id=release.id, environment_id=2 ++ organization_id=org.id, project_id=project.id, release_id=release.id, environment_id=environment.id ++ ) ++ release_project_environment = ReleaseProjectEnvironment.objects.create( ++ release_id=release.id, project_id=project.id, environment_id=environment.id + ) + group_release = GroupRelease.objects.create( + project_id=project.id, release_id=release.id, group_id=1 +@@ -35,6 +39,7 @@ def test_simple(self): + + # merge from #1 + project2 = self.create_project(organization=org, name='bar') ++ environment2 = Environment.get_or_create(project=project2, name='env2') + release2 = Release.objects.create(version='bbbbbbb', organization=org) + release2.add_project(project2) + release_commit2 = ReleaseCommit.objects.create( +@@ -44,7 +49,10 @@ def test_simple(self): + organization_id=org.id, + project_id=project2.id, + release_id=release2.id, +- environment_id=3, ++ environment_id=environment2.id, ++ ) ++ release_project_environment2 = ReleaseProjectEnvironment.objects.create( ++ release_id=release2.id, project_id=project2.id, environment_id=environment2.id + ) + group_release2 = GroupRelease.objects.create( + project_id=project2.id, release_id=release2.id, group_id=2 +@@ -54,6 +62,7 @@ def test_simple(self): + + # merge from #2 + project3 = self.create_project(organization=org, name='baz') ++ environment3 = Environment.get_or_create(project=project3, name='env3') + release3 = Release.objects.create(version='cccccc', organization=org) + release3.add_project(project3) + release_commit3 = ReleaseCommit.objects.create( +@@ -63,7 +72,10 @@ def test_simple(self): + organization_id=org.id, + project_id=project3.id, + release_id=release3.id, +- environment_id=4, ++ environment_id=environment3.id, ++ ) ++ release_project_environment3 = ReleaseProjectEnvironment.objects.create( ++ release_id=release3.id, project_id=project3.id, environment_id=environment3.id + ) + group_release3 = GroupRelease.objects.create( + project_id=project3.id, release_id=release3.id, group_id=3 +@@ -90,6 +102,14 @@ def test_simple(self): + assert ReleaseProject.objects.filter(release=release, project=project2).exists() + assert ReleaseProject.objects.filter(release=release, project=project3).exists() + ++ # ReleaseProjectEnvironment.release ++ assert ReleaseProjectEnvironment.objects.get( ++ id=release_project_environment.id).release_id == release.id ++ assert ReleaseProjectEnvironment.objects.get( ++ id=release_project_environment2.id).release_id == release.id ++ assert ReleaseProjectEnvironment.objects.get( ++ id=release_project_environment3.id).release_id == release.id ++ + # GroupRelease.release_id + assert GroupRelease.objects.get(id=group_release.id).release_id == release.id + assert GroupRelease.objects.get(id=group_release2.id).release_id == release.id +diff --git a/tests/sentry/models/test_team.py b/tests/sentry/models/test_team.py +index 66b80fab6502ac..0b54d16080ee62 100644 +--- a/tests/sentry/models/test_team.py ++++ b/tests/sentry/models/test_team.py +@@ -4,7 +4,7 @@ + + from sentry.models import ( + OrganizationMember, OrganizationMemberTeam, Project, ProjectTeam, +- Release, ReleaseProject, Team ++ Release, ReleaseProject, ReleaseProjectEnvironment, Team + ) + from sentry.testutils import TestCase + +@@ -160,3 +160,42 @@ def test_release_projects(self): + release=release, + project=project, + ).exists() ++ ++ def test_release_project_envs(self): ++ user = self.create_user() ++ org = self.create_organization(name='foo', owner=user) ++ org2 = self.create_organization(name='bar', owner=None) ++ team = self.create_team(organization=org) ++ project = self.create_project(teams=[team]) ++ ++ release = Release.objects.create( ++ version='a' * 7, ++ organization=org, ++ ) ++ ++ release.add_project(project) ++ env = self.create_environment( ++ name='prod', ++ project=project, ++ ) ++ ReleaseProjectEnvironment.objects.create( ++ release=release, ++ project=project, ++ environment=env, ++ ) ++ ++ assert ReleaseProjectEnvironment.objects.filter( ++ release=release, ++ project=project, ++ environment=env, ++ ).exists() ++ ++ team.transfer_to(org2) ++ ++ assert Release.objects.filter(id=release.id).exists() ++ ++ assert not ReleaseProjectEnvironment.objects.filter( ++ release=release, ++ project=project, ++ environment=env, ++ ).exists()" +vector,https://github.com/vectordotdev/vector,4af6d78b88661d874547f336a740b845aacd9334,David Huie,2023-01-12 07:17:05,docs(eventstoredb_metrics source): Auto-gen docs (#15890),"* Auto-gen eventstoredb_metrics docs + +* Use an implicit default + +* Drop plural + +* Update cue docs","docs(eventstoredb_metrics source): Auto-gen docs (#15890) + +* Auto-gen eventstoredb_metrics docs + +* Use an implicit default + +* Drop plural + +* Update cue docs","diff --git a/Cargo.toml b/Cargo.toml +index 8c260cfb3c0c4..bcc592d2d4f30 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -515,7 +515,7 @@ sources-datadog_agent = [""sources-utils-http-error"", ""protobuf-build""] + sources-demo_logs = [""dep:fakedata"", ""dep:serde_with""] + sources-dnstap = [""dep:base64"", ""dep:trust-dns-proto"", ""dep:dnsmsg-parser"", ""protobuf-build""] + sources-docker_logs = [""docker""] +-sources-eventstoredb_metrics = [] ++sources-eventstoredb_metrics = [""dep:serde_with""] + sources-exec = [] + sources-file = [""dep:file-source""] + sources-file-descriptor = [""tokio-util/io""] +diff --git a/src/sources/eventstoredb_metrics/mod.rs b/src/sources/eventstoredb_metrics/mod.rs +index 3c18de0b38cce..61cad25dbad36 100644 +--- a/src/sources/eventstoredb_metrics/mod.rs ++++ b/src/sources/eventstoredb_metrics/mod.rs +@@ -3,6 +3,7 @@ use std::time::Duration; + use futures::{FutureExt, StreamExt}; + use http::Uri; + use hyper::{Body, Request}; ++use serde_with::serde_as; + use tokio_stream::wrappers::IntervalStream; + use vector_common::internal_event::{ + ByteSize, BytesReceived, CountByteSize, InternalEventHandle as _, Protocol, +@@ -25,25 +26,29 @@ use crate::{ + pub mod types; + + /// Configuration for the `eventstoredb_metrics` source. ++#[serde_as] + #[configurable_component(source(""eventstoredb_metrics""))] + #[derive(Clone, Debug, Default)] + pub struct EventStoreDbConfig { +- /// Endpoints to scrape stats from. ++ /// Endpoint to scrape stats from. + #[serde(default = ""default_endpoint"")] ++ #[configurable(metadata(docs::examples = ""https://localhost:2113/stats""))] + endpoint: String, + + /// The interval between scrapes, in seconds. + #[serde(default = ""default_scrape_interval_secs"")] +- scrape_interval_secs: u64, ++ #[serde_as(as = ""serde_with::DurationSeconds"")] ++ scrape_interval_secs: Duration, + + /// Overrides the default namespace for the metrics emitted by the source. + /// + /// By default, `eventstoredb` is used. ++ #[configurable(metadata(docs::examples = ""eventstoredb""))] + default_namespace: Option, + } + +-const fn default_scrape_interval_secs() -> u64 { +- 15 ++const fn default_scrape_interval_secs() -> Duration { ++ Duration::from_secs(15) + } + + pub fn default_endpoint() -> String { +@@ -74,12 +79,11 @@ impl SourceConfig for EventStoreDbConfig { + + fn eventstoredb( + endpoint: String, +- interval: u64, ++ interval: Duration, + namespace: Option, + mut cx: SourceContext, + ) -> crate::Result { +- let mut ticks = IntervalStream::new(tokio::time::interval(Duration::from_secs(interval))) +- .take_until(cx.shutdown); ++ let mut ticks = IntervalStream::new(tokio::time::interval(interval)).take_until(cx.shutdown); + let tls_settings = TlsSettings::from_options(&None)?; + let client = HttpClient::new(tls_settings, &cx.proxy)?; + let url: Uri = endpoint.as_str().parse()?; +@@ -156,7 +160,7 @@ mod integration_tests { + async fn scrape_something() { + let config = EventStoreDbConfig { + endpoint: EVENTSTOREDB_SCRAPE_ADDRESS.to_owned(), +- scrape_interval_secs: 1, ++ scrape_interval_secs: Duration::from_secs(1), + default_namespace: None, + }; + +diff --git a/website/cue/reference/components/sources/base/eventstoredb_metrics.cue b/website/cue/reference/components/sources/base/eventstoredb_metrics.cue +index 3aa639eb309a9..336b624f03123 100644 +--- a/website/cue/reference/components/sources/base/eventstoredb_metrics.cue ++++ b/website/cue/reference/components/sources/base/eventstoredb_metrics.cue +@@ -8,16 +8,22 @@ base: components: sources: eventstoredb_metrics: configuration: { + By default, `eventstoredb` is used. + """""" + required: false +- type: string: {} ++ type: string: examples: [""eventstoredb""] + } + endpoint: { +- description: ""Endpoints to scrape stats from."" ++ description: ""Endpoint to scrape stats from."" + required: false +- type: string: default: ""https://localhost:2113/stats"" ++ type: string: { ++ default: ""https://localhost:2113/stats"" ++ examples: [""https://localhost:2113/stats""] ++ } + } + scrape_interval_secs: { + description: ""The interval between scrapes, in seconds."" + required: false +- type: uint: default: 15 ++ type: uint: { ++ default: 15 ++ unit: ""seconds"" ++ } + } + } +diff --git a/website/cue/reference/components/sources/eventstoredb_metrics.cue b/website/cue/reference/components/sources/eventstoredb_metrics.cue +index f749e27c4435f..09b38eff7ba67 100644 +--- a/website/cue/reference/components/sources/eventstoredb_metrics.cue ++++ b/website/cue/reference/components/sources/eventstoredb_metrics.cue +@@ -44,35 +44,7 @@ components: sources: eventstoredb_metrics: { + platform_name: null + } + +- configuration: { +- endpoints: { +- common: true +- description: ""Endpoints to scrape stats from."" +- required: false +- type: string: { +- examples: [""https://localhost:2113/stats""] +- default: ""https://localhost:2113/stats"" +- } +- } +- scrape_interval_secs: { +- common: true +- description: ""The interval between scrapes, in seconds."" +- required: false +- type: uint: { +- default: 15 +- unit: ""seconds"" +- } +- } +- default_namespace: { +- common: false +- description: ""The namespace used otherwise will be defaulted to eventstoredb."" +- required: false +- type: string: { +- examples: [""app-123-eventstoredb""] +- default: ""eventstoredb"" +- } +- } +- } ++ configuration: base.components.sources.eventstoredb_metrics.configuration + + output: metrics: { + _eventstoredb_metrics_tags: {" +NodeBB,https://github.com/NodeBB/NodeBB,548765838f693085eecc9d236da9bbdec56bc6df,dependabot[bot],2022-05-14 19:59:12,chore(deps-dev): bump husky from 8.0.0 to 8.0.1 in /install (#10595),"Bumps [husky](https://github.com/typicode/husky) from 8.0.0 to 8.0.1. +- [Release notes](https://github.com/typicode/husky/releases) +- [Commits](https://github.com/typicode/husky/compare/v8.0.0...v8.0.1) + +---","chore(deps-dev): bump husky from 8.0.0 to 8.0.1 in /install (#10595) + +Bumps [husky](https://github.com/typicode/husky) from 8.0.0 to 8.0.1. +- [Release notes](https://github.com/typicode/husky/releases) +- [Commits](https://github.com/typicode/husky/compare/v8.0.0...v8.0.1) + +--- +updated-dependencies: +- dependency-name: husky + dependency-type: direct:development + update-type: version-update:semver-patch +... + +Signed-off-by: dependabot[bot] + +Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>","diff --git a/install/package.json b/install/package.json +index 7515987caa7f..61dd9a4e3e85 100644 +--- a/install/package.json ++++ b/install/package.json +@@ -155,7 +155,7 @@ + ""eslint-plugin-import"": ""2.26.0"", + ""grunt"": ""1.5.3"", + ""grunt-contrib-watch"": ""1.1.0"", +- ""husky"": ""8.0.0"", ++ ""husky"": ""8.0.1"", + ""jsdom"": ""19.0.0"", + ""lint-staged"": ""12.4.1"", + ""mocha"": ""10.0.0""," +uno,https://github.com/unoplatform/uno,dbc9ac50e16cbacdbc14497a26523e4941b94b0e,dependabot[bot],2023-02-13 08:16:14,chore(deps): bump Microsoft.IO.RecyclableMemoryStream,"Bumps [Microsoft.IO.RecyclableMemoryStream](https://github.com/Microsoft/Microsoft.IO.RecyclableMemoryStream) from 2.2.0 to 2.3.1. +- [Release notes](https://github.com/Microsoft/Microsoft.IO.RecyclableMemoryStream/releases) +- [Changelog](https://github.com/microsoft/Microsoft.IO.RecyclableMemoryStream/blob/master/CHANGES.md) +- [Commits](https://github.com/Microsoft/Microsoft.IO.RecyclableMemoryStream/compare/2.2.0...2.3.1) + +---","chore(deps): bump Microsoft.IO.RecyclableMemoryStream + +Bumps [Microsoft.IO.RecyclableMemoryStream](https://github.com/Microsoft/Microsoft.IO.RecyclableMemoryStream) from 2.2.0 to 2.3.1. +- [Release notes](https://github.com/Microsoft/Microsoft.IO.RecyclableMemoryStream/releases) +- [Changelog](https://github.com/microsoft/Microsoft.IO.RecyclableMemoryStream/blob/master/CHANGES.md) +- [Commits](https://github.com/Microsoft/Microsoft.IO.RecyclableMemoryStream/compare/2.2.0...2.3.1) + +--- +updated-dependencies: +- dependency-name: Microsoft.IO.RecyclableMemoryStream + dependency-type: direct:production + update-type: version-update:semver-minor +... + +Signed-off-by: dependabot[bot] ","diff --git a/src/Uno.UI.RemoteControl.Host/Uno.UI.RemoteControl.Host.csproj b/src/Uno.UI.RemoteControl.Host/Uno.UI.RemoteControl.Host.csproj +index f51f347b3c70..1aa023f08094 100644 +--- a/src/Uno.UI.RemoteControl.Host/Uno.UI.RemoteControl.Host.csproj ++++ b/src/Uno.UI.RemoteControl.Host/Uno.UI.RemoteControl.Host.csproj +@@ -20,7 +20,7 @@ + + + +- ++ + + + +diff --git a/src/Uno.UI.RemoteControl/Uno.UI.RemoteControl.Reference.csproj b/src/Uno.UI.RemoteControl/Uno.UI.RemoteControl.Reference.csproj +index a4a1e57328e6..ee91398a58a2 100644 +--- a/src/Uno.UI.RemoteControl/Uno.UI.RemoteControl.Reference.csproj ++++ b/src/Uno.UI.RemoteControl/Uno.UI.RemoteControl.Reference.csproj +@@ -42,7 +42,7 @@ + + + +- ++ + + + +diff --git a/src/Uno.UI.RemoteControl/Uno.UI.RemoteControl.Skia.csproj b/src/Uno.UI.RemoteControl/Uno.UI.RemoteControl.Skia.csproj +index 0c0ac5ad02c6..fd3d6d5246da 100644 +--- a/src/Uno.UI.RemoteControl/Uno.UI.RemoteControl.Skia.csproj ++++ b/src/Uno.UI.RemoteControl/Uno.UI.RemoteControl.Skia.csproj +@@ -44,7 +44,7 @@ + + + +- ++ + + + +diff --git a/src/Uno.UI.RemoteControl/Uno.UI.RemoteControl.Wasm.csproj b/src/Uno.UI.RemoteControl/Uno.UI.RemoteControl.Wasm.csproj +index 59c5c653149e..932d70918966 100644 +--- a/src/Uno.UI.RemoteControl/Uno.UI.RemoteControl.Wasm.csproj ++++ b/src/Uno.UI.RemoteControl/Uno.UI.RemoteControl.Wasm.csproj +@@ -48,7 +48,7 @@ + + + +- ++ + + + +diff --git a/src/Uno.UI.RemoteControl/Uno.UI.RemoteControl.csproj b/src/Uno.UI.RemoteControl/Uno.UI.RemoteControl.csproj +index d0c82d18d942..c44072d85ff4 100644 +--- a/src/Uno.UI.RemoteControl/Uno.UI.RemoteControl.csproj ++++ b/src/Uno.UI.RemoteControl/Uno.UI.RemoteControl.csproj +@@ -62,7 +62,7 @@ + + + +- ++ + + + +diff --git a/src/Uno.UI.RemoteControl/Uno.UI.RemoteControl.netcoremobile.csproj b/src/Uno.UI.RemoteControl/Uno.UI.RemoteControl.netcoremobile.csproj +index 27b3f1f50cb4..01e3203cc84e 100644 +--- a/src/Uno.UI.RemoteControl/Uno.UI.RemoteControl.netcoremobile.csproj ++++ b/src/Uno.UI.RemoteControl/Uno.UI.RemoteControl.netcoremobile.csproj +@@ -49,7 +49,7 @@ + + + +- ++ + + + " +atlantis,https://github.com/runatlantis/atlantis,ad79d0708b658d78aee7810e9b35cbc31c93df0b,nitrocode,2022-11-24 07:29:50,docs: Small updates 🦃 (#2711),"* Add missing pages + +* Update server-configuration.md + +* Update test.yml + +* Update lint.yml + +* Update test.yml + +* Update lint.yml + +* Update server-configuration.md + +* Update server-configuration.md + +* Update server-configuration.md + +* Update server-configuration.md + +* Update server-configuration.md + +* Update server-configuration.md + +* Update server-configuration.md + +* Update server-configuration.md","docs: Small updates 🦃 (#2711) + +* Add missing pages + +* Update server-configuration.md + +* Update test.yml + +* Update lint.yml + +* Update test.yml + +* Update lint.yml + +* Update server-configuration.md + +* Update server-configuration.md + +* Update server-configuration.md + +* Update server-configuration.md + +* Update server-configuration.md + +* Update server-configuration.md + +* Update server-configuration.md + +* Update server-configuration.md","diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml +index 0e4a44f4cf..a667da7b0e 100644 +--- a/.github/workflows/lint.yml ++++ b/.github/workflows/lint.yml +@@ -1,6 +1,11 @@ + name: linter + +-on: [pull_request] ++on: ++ pull_request: ++ branches: ++ - ""main"" ++ paths-ignore: ++ - 'runatlantis.io/**' + + concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} +@@ -8,6 +13,7 @@ concurrency: + + jobs: + golangci-lint: ++ if: github.event.pull_request.draft == false + name: runner / golangci-lint + runs-on: ubuntu-22.04 + steps: +@@ -20,6 +26,7 @@ jobs: + + # Use revive via golangci-lint binary with ""warning"" level. + revive: ++ if: github.event.pull_request.draft == false + name: runner / revive + runs-on: ubuntu-22.04 + steps: +@@ -34,6 +41,7 @@ jobs: + + # You can add more and more supported linters with different config. + errcheck: ++ if: github.event.pull_request.draft == false + name: runner / errcheck + runs-on: ubuntu-22.04 + steps: +diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml +index 07fa50bcbc..cb17aa9f07 100644 +--- a/.github/workflows/test.yml ++++ b/.github/workflows/test.yml +@@ -4,15 +4,21 @@ on: + push: + branches: + - ""main"" ++ paths-ignore: ++ - 'runatlantis.io/**' + pull_request: + branches: + - ""main"" ++ paths-ignore: ++ - 'runatlantis.io/**' ++ + concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + + jobs: + test: ++ if: github.event.pull_request.draft == false + name: runner / gotest + runs-on: ubuntu-22.04 + container: ghcr.io/runatlantis/testing-env:2022.11.17 +diff --git a/runatlantis.io/.vuepress/config.js b/runatlantis.io/.vuepress/config.js +index 57518fe1c3..6874025bc0 100644 +--- a/runatlantis.io/.vuepress/config.js ++++ b/runatlantis.io/.vuepress/config.js +@@ -76,7 +76,9 @@ module.exports = { + 'checkout-strategy', + 'terraform-versions', + 'terraform-cloud', +- 'using-slack-hooks' ++ 'using-slack-hooks', ++ 'stats', ++ 'faq' + ] + }, + { +diff --git a/runatlantis.io/docs/server-configuration.md b/runatlantis.io/docs/server-configuration.md +index 92dee66822..185ce2f6bc 100644 +--- a/runatlantis.io/docs/server-configuration.md ++++ b/runatlantis.io/docs/server-configuration.md +@@ -50,12 +50,16 @@ Values are chosen in this order: + ### `--allow-draft-prs` + ```bash + atlantis server --allow-draft-prs ++ # or ++ ATLANTIS_ALLOW_DRAFT_PRS=true + ``` + Respond to pull requests from draft prs. Defaults to `false`. + + ### `--allow-fork-prs` + ```bash + atlantis server --allow-fork-prs ++ # or ++ ATLANTIS_ALLOW_FORK_PRS=true + ``` + Respond to pull requests from forks. Defaults to `false`. + +@@ -71,6 +75,8 @@ Values are chosen in this order: + + ```bash + atlantis server --allow-repo-config ++ # or ++ ATLANTIS_ALLOW_REPO_CONFIG=true + ``` + This flag is deprecated. It allows all repos to use all restricted + `atlantis.yaml` keys. See [Repo Level Atlantis.yaml](repo-level-atlantis-yaml.html) for more details. +@@ -106,6 +112,8 @@ Values are chosen in this order: + ### `--automerge` + ```bash + atlantis server --automerge ++ # or ++ ATLANTIS_AUTOMERGE=true + ``` + Automatically merge pull requests after all plans have been successfully applied. + Defaults to `false`. See [Automerging](automerging.html) for more details. +@@ -114,6 +122,8 @@ Values are chosen in this order: + ```bash + # NOTE: Use single quotes to avoid shell expansion of *. + atlantis server --autoplan-file-list='**/*.tf,project1/*.pkr.hcl' ++ # or ++ ATLANTIS_AUTOPLAN_FILE_LIST='**/*.tf,project1/*.pkr.hcl' + ``` + List of file patterns that Atlantis will use to check if a directory contains modified files that should trigger project planning. + +@@ -137,47 +147,57 @@ Values are chosen in this order: + ### `--azuredevops-hostname` + ```bash + atlantis server --azuredevops-hostname=""dev.azure.com"" ++ # or ++ ATLANTIS_AZUREDEVOPS_HOSTNAME=""dev.azure.com"" + ``` + Azure DevOps hostname to support cloud and self hosted instances. Defaults to `dev.azure.com`. + + ### `--azuredevops-webhook-password` + ```bash + atlantis server --azuredevops-webhook-password=""password123"" ++ # or (recommended) ++ ATLANTIS_AZUREDEVOPS_WEBHOOK_PASSWORD=""password123"" + ``` + Azure DevOps basic authentication password for inbound webhooks (see +- https://docs.microsoft.com/en-us/azure/devops/service-hooks/authorize?view=azure-devops). ++ [docs](https://docs.microsoft.com/en-us/azure/devops/service-hooks/authorize?view=azure-devops)). + + ::: warning SECURITY WARNING + If not specified, Atlantis won't be able to validate that the + incoming webhook call came from your Azure DevOps org. This means that an + attacker could spoof calls to Atlantis and cause it to perform malicious +- actions. Should be specified via the ATLANTIS_AZUREDEVOPS_BASIC_AUTH environment ++ actions. Should be specified via the `ATLANTIS_AZUREDEVOPS_BASIC_AUTH` environment + variable. + ::: + + ### `--azuredevops-webhook-user` + ```bash + atlantis server --azuredevops-webhook-user=""username@example.com"" ++ # or ++ ATLANTIS_AZUREDEVOPS_WEBHOOK_USER=""username@example.com"" + ``` +- Azure DevOps basic authentication username for inbound webhooks. Can also be specified via the ATLANTIS_AZUREDEVOPS_WEBHOOK_USER +- environment variable. ++ Azure DevOps basic authentication username for inbound webhooks. + + ### `--azuredevops-token` + ```bash + atlantis server --azuredevops-token=""RandomStringProducedByAzureDevOps"" ++ # or (recommended) ++ ATLANTIS_AZUREDEVOPS_TOKEN=""RandomStringProducedByAzureDevOps"" + ``` +- Azure DevOps token of API user. Can also be specified via the ATLANTIS_AZUREDEVOPS_TOKEN +- environment variable. ++ Azure DevOps token of API user. + + ### `--azuredevops-user` + ```bash + atlantis server --azuredevops-user=""username@example.com"" ++ # or ++ ATLANTIS_AZUREDEVOPS_USER=""username@example.com"" + ``` + Azure DevOps username of API user. + + ### `--bitbucket-base-url` + ```bash + atlantis server --bitbucket-base-url=""http://bitbucket.corp:7990/basepath"" ++ # or ++ ATLANTIS_BITBUCKET_BASE_URL=""http://bitbucket.corp:7990/basepath"" + ``` + Base URL of Bitbucket Server (aka Stash) installation. Must include + `http://` or `https://`. If using Bitbucket Cloud (bitbucket.org), do not set. Defaults to +@@ -187,13 +207,15 @@ Values are chosen in this order: + ```bash + atlantis server --bitbucket-token=""token"" + # or (recommended) +- ATLANTIS_BITBUCKET_TOKEN='token' atlantis server ++ ATLANTIS_BITBUCKET_TOKEN=""token"" + ``` + Bitbucket app password of API user. + + ### `--bitbucket-user` + ```bash + atlantis server --bitbucket-user=""myuser"" ++ # or ++ ATLANTIS_BITBUCKET_USER=""myuser"" + ``` + Bitbucket username of API user. + +@@ -201,7 +223,7 @@ Values are chosen in this order: + ```bash + atlantis server --bitbucket-webhook-secret=""secret"" + # or (recommended) +- ATLANTIS_BITBUCKET_WEBHOOK_SECRET='secret' atlantis server ++ ATLANTIS_BITBUCKET_WEBHOOK_SECRET=""secret"" + ``` + Secret used to validate Bitbucket webhooks. Only Bitbucket Server supports webhook secrets. + For Bitbucket.org, see [Security](security.html#bitbucket-cloud-bitbucket-org) for mitigations. +@@ -214,19 +236,25 @@ Values are chosen in this order: + ### `--checkout-strategy` + ```bash + atlantis server --checkout-strategy="""" ++ # or ++ ATLANTIS_CHECKOUT_STRATEGY="""" + ``` +- How to check out pull requests. ++ How to check out pull requests. Use either `branch` or `merge`. + Defaults to `branch`. See [Checkout Strategy](checkout-strategy.html) for more details. + + ### `--config` + ```bash + atlantis server --config=""my/config/file.yaml"" ++ # or ++ ATLANTIS_CONFIG=""my/config/file.yaml"" + ``` + YAML config file where flags can also be set. See [Config File](#config-file) for more details. + + ### `--data-dir` + ```bash + atlantis server --data-dir=""path/to/data/dir"" ++ # or ++ ATLANTIS_DATA_DIR=""path/to/data/dir"" + ``` + Directory where Atlantis will store its data. Will be created if it doesn't exist. + Defaults to `~/.atlantis`. Atlantis will store its database, checked out repos, Terraform plans and downloaded +@@ -235,7 +263,9 @@ Values are chosen in this order: + + ### `--default-tf-version` + ```bash +- atlantis server --default-tf-version=""v0.12.0"" ++ atlantis server --default-tf-version=""v0.12.31"" ++ # or ++ ATLANTIS_DEFAULT_TF_VERSION=""v0.12.31"" + ``` + Terraform version to default to. Will download to `/bin/terraform` + if not in `PATH`. See [Terraform Versions](terraform-versions.html) for more details. +@@ -243,55 +273,74 @@ Values are chosen in this order: + ### `--disable-apply` + ```bash + atlantis server --disable-apply ++ # or ++ ATLANTIS_DISABLE_APPLY=true + ``` +- Disable all \""atlantis apply\"" commands, regardless of which flags are passed with it. ++ Disable all `atlantis apply` commands, regardless of which flags are passed with it. + + ### `--disable-apply-all` + ```bash + atlantis server --disable-apply-all ++ # or ++ ATLANTIS_DISABLE_APPLY_ALL=true + ``` +- Disable \""atlantis apply\"" command so a specific project/workspace/directory has to ++ Disable `atlantis apply` command so a specific project/workspace/directory has to + be specified for applies. + + ### `--disable-autoplan` + ```bash + atlantis server --disable-autoplan ++ # or ++ ATLANTIS_DISABLE_AUTOPLAN=true + ``` +- Disable atlantis auto planning ++ Disable atlantis auto planning. + + ### `--disable-markdown-folding` + ```bash + atlantis server --disable-markdown-folding ++ # or ++ ATLANTIS_DISABLE_MARKDOWN_FOLDER=true + ``` +- Disable folding in markdown output. ++ Disable folding in markdown output using the `
    ` html tag. + + ### `--disable-repo-locking` + ```bash + atlantis server --disable-repo-locking ++ # or ++ ATLANTIS_DISABLE_REPO_LOCKING=true + ``` +- Stops atlantis locking projects and or workspaces when running terraform ++ Stops atlantis from locking projects and or workspaces when running terraform. + + ### `--enable-policy-checks` +- + ```bash + atlantis server --enable-policy-checks ++ # or ++ ATLANTIS_ENABLE_POLICY_CHECKS=true + ``` + Enables atlantis to run server side policies on the result of a terraform plan. Policies are defined in [server side repo config](https://www.runatlantis.io/docs/server-side-repo-config.html#reference). + + ### `--enable-regexp-cmd` + ```bash + atlantis server --enable-regexp-cmd ++ # or ++ ATLANTIS_ENABLE_REGEXP_CMD=true + ``` +- Enable Atlantis to use regular expressions on plan/apply commands when \""-p\"" flag is passed with it. ++ Enable Atlantis to use regular expressions on plan/apply commands when `-p` flag is passed with it. ++ ++ This can be used to run all defined projects in `atlantis.yaml` using `atlantis plan -p .*`. ++ ++ This will not work with `-d` yet and to use `-p` the repo projects must be defined in the repo `atlantis.yaml` file. + + ::: warning SECURITY WARNING + It's not supposed to be used with `--disable-apply-all`. +- The command `atlantis apply -p .*` will bypass the restriction and run apply on every projects ++ The command `atlantis apply -p .*` will bypass the restriction and run apply on every projects. + ::: + + ### `--enable-diff-markdown-format` + ```bash + atlantis server --enable-diff-markdown-format ++ # or ++ ATLANTIS_ENABLE_DIFF_MARKDOWN_FORMAT=true + ``` + Enable Atlantis to format Terraform plan output into a markdown-diff friendly format for color-coding purposes. + +@@ -300,6 +349,8 @@ Values are chosen in this order: + ### `--gh-hostname` + ```bash + atlantis server --gh-hostname=""my.github.enterprise.com"" ++ # or ++ ATLANTIS_GH_HOSTNAME=""my.github.enterprise.com"" + ``` + Hostname of your GitHub Enterprise installation. If using [GitHub.com](https://github.com), + don't set. Defaults to `github.com`. +@@ -308,13 +359,15 @@ Values are chosen in this order: + ```bash + atlantis server --gh-token=""token"" + # or (recommended) +- ATLANTIS_GH_TOKEN='token' atlantis server ++ ATLANTIS_GH_TOKEN=""token"" + ``` + GitHub token of API user. + + ### `--gh-user` + ```bash + atlantis server --gh-user=""myuser"" ++ # or ++ ATLANTIS_GH_USER=""myuser"" + ``` + GitHub username of API user. + +@@ -322,7 +375,7 @@ Values are chosen in this order: + ```bash + atlantis server --gh-webhook-secret=""secret"" + # or (recommended) +- ATLANTIS_GH_WEBHOOK_SECRET='secret' atlantis server ++ ATLANTIS_GH_WEBHOOK_SECRET=""secret"" + ``` + Secret used to validate GitHub webhooks (see [https://developer.github.com/webhooks/securing/](https://docs.github.com/en/developers/webhooks-and-events/webhooks/securing-your-webhooks)). + +@@ -334,12 +387,16 @@ Values are chosen in this order: + ### `--gh-org` + ```bash + atlantis server --gh-org=""myorgname"" ++ # or ++ ATLANTIS_GH_ORG=""myorgname"" + ``` + GitHub organization name. Set to enable creating a private GitHub app for this organization. + + ### `--gh-app-id` + ```bash + atlantis server --gh-app-id=""00000"" ++ # or ++ ATLANTIS_GH_APP_ID=""00000"" + ``` + GitHub app ID. If set, GitHub authentication will be performed as [an installation](https://docs.github.com/en/rest/apps/installations). + +@@ -362,18 +419,24 @@ Values are chosen in this order: + ### `--gh-app-slug` + ```bash + atlantis server --gh-app-slug=""myappslug"" ++ # or ++ ATLANTIS_GH_APP_SLUG=""myappslug"" + ``` + A slugged version of GitHub app name shown in pull requests comments, etc (not `Atlantis App` but something like `atlantis-app`). Atlantis uses the value of this parameter to identify the comments it has left on GitHub pull requests. This is used for functions such as `--hide-prev-plan-comments`. + + ### `--gh-app-key-file` + ```bash + atlantis server --gh-app-key-file=""path/to/app-key.pem"" ++ # or ++ ATLANTIS_GH_APP_KEY_FILE=""path/to/app-key.pem"" + ``` + Path to a GitHub App PEM encoded private key file. If set, GitHub authentication will be performed as [an installation](https://docs.github.com/en/rest/apps/installations). + + ### `--gh-app-key` + ```bash + atlantis server --gh-app-key=""-----BEGIN RSA PRIVATE KEY-----(...)"" ++ # or ++ ATLANTIS_GH_APP_KEY=""-----BEGIN RSA PRIVATE KEY-----(...)"" + ``` + The PEM encoded private key for the GitHub App. + +@@ -384,6 +447,8 @@ Values are chosen in this order: + ### `--gh-team-allowlist` + ```bash + atlantis server --gh-team-allowlist=""myteam:plan, secteam:apply, DevOps Team:apply"" ++ # or ++ ATLANTIS_GH_TEAM_ALLOWLIST=""myteam:plan, secteam:apply, DevOps Team:apply"" + ``` + Comma-separated list of GitHub team name (not a slug) and permission pairs. By default, any team can plan and apply. + +@@ -395,12 +460,21 @@ Values are chosen in this order: + ### `--gh-allow-mergeable-bypass-apply` + ```bash + atlantis server --gh-allow-mergeable-bypass-apply ++ # or ++ ATLANTIS_GH_ALLOW_MERGEABLE_BYPASS_APPLY=true + ``` + Feature flag to enable ability to use `mergeable` mode with required apply status check. + ++ ::: warning NOTE ++ If there aren't any required checks set in the Github branch protection settings then this will cause atlantis to fail. ++ See issue https://github.com/runatlantis/atlantis/issues/2663. ++ ::: ++ + ### `--gitlab-hostname` + ```bash + atlantis server --gitlab-hostname=""my.gitlab.enterprise.com"" ++ # or ++ ATLANTIS_GITLAB_HOSTNAME=""my.gitlab.enterprise.com"" + ``` + Hostname of your GitLab Enterprise installation. If using [Gitlab.com](https://gitlab.com), + don't set. Defaults to `gitlab.com`. +@@ -409,21 +483,23 @@ Values are chosen in this order: + ```bash + atlantis server --gitlab-token=""token"" + # or (recommended) +- ATLANTIS_GITLAB_TOKEN='token' atlantis server ++ ATLANTIS_GITLAB_TOKEN=""token"" + ``` + GitLab token of API user. + + ### `--gitlab-user` + ```bash + atlantis server --gitlab-user=""myuser"" ++ # or ++ ATLANTIS_GITLAB_USER=""myuser"" + ``` +- GitLab username of API user. ++ GitLab username of API user. + + ### `--gitlab-webhook-secret` + ```bash + atlantis server --gitlab-webhook-secret=""secret"" + # or (recommended) +- ATLANTIS_GITLAB_WEBHOOK_SECRET='secret' atlantis server ++ ATLANTIS_GITLAB_WEBHOOK_SECRET=""secret"" + ``` + Secret used to validate GitLab webhooks. + +@@ -441,13 +517,17 @@ Values are chosen in this order: + ### `--hide-prev-plan-comments` + ```bash + atlantis server --hide-prev-plan-comments ++ # or ++ ATLANTIS_HIDE_PREV_PLAN_COMMENTS=true + ``` + Hide previous plan comments to declutter PRs. This is only supported in +- GitHub currently. ++ GitHub currently. This is not enabled by default. + + ### `--locking-db-type` + ```bash + atlantis server --locking-db-type="""" ++ # or ++ ATLANTIS_LOCKING_DB_TYPE="""" + ``` + The locking database type to use for storing plan and apply locks. Defaults to `boltdb`. + +@@ -458,13 +538,19 @@ Values are chosen in this order: + ### `--log-level` + ```bash + atlantis server --log-level="""" ++ # or ++ ATLANTIS_LOG_LEVEL="""" + ``` + Log level. Defaults to `info`. + + ### `--markdown-template-overrides-dir` + ```bash + atlantis server --markdown-template-overrides-dir=""path/to/templates/"" ++ # or ++ ATLANTIS_MARKDOWN_TEMPLATE_OVERRIDES_DIR=""path/to/templates/"" + ``` ++ This will be available in v0.21.0. ++ + Directory where Atlantis will read in overrides for markdown templates used to render comments on pull requests. + Markdown template overrides may be specified either in individual files, or all together in a single file. All template + override files _must_ have the `.tmpl` extension, otherwise they will not be parsed. +@@ -479,54 +565,72 @@ Values are chosen in this order: + ### `--parallel-pool-size` + ```bash + atlantis server --parallel-pool-size=100 ++ # or ++ ATLANTIS_PARALLEL_POOL_SIZE=100 + ``` + Max size of the wait group that runs parallel plans and applies (if enabled). Defaults to `15` + + ### `--port` + ```bash +- atlantis server --port=8080 ++ atlantis server --port=4141 ++ # or ++ ATLANTIS_PORT=4141 + ``` + Port to bind to. Defaults to `4141`. + + ### `--quiet-policy-checks` + ```bash + atlantis server --quiet-policy-checks ++ # or ++ ATLANTIS_QUIET_POLICY_CHECKS=true + ``` + Exclude policy check comments from pull requests unless there's an actual error from conftest. This also excludes warnings. Defaults to `false`. + + ### `--redis-host` + ```bash + atlantis server --redis-host=""localhost"" ++ # or ++ ATLANTIS_REDIS_HOST=""localhost"" + ``` + The Redis Hostname for when using a Locking DB type of `redis`. + + ### `--redis-password` + ```bash + atlantis server --redis-password=""password123"" ++ # or (recommended) ++ ATLANTIS_REDIS_PASSWORD=""password123"" + ``` + The Redis Password for when using a Locking DB type of `redis`. + + ### `--redis-port` + ```bash + atlantis server --redis-port=6379 ++ # or ++ ATLANTIS_REDIS_PORT=6379 + ``` + The Redis Port for when using a Locking DB type of `redis`. Defaults to `6379`. + + ### `--redis-db` + ```bash + atlantis server --redis-db=0 ++ # or ++ ATLANTIS_REDIS_DB=0 + ``` + The Redis Database to use when using a Locking DB type of `redis`. Defaults to `0`. + + ### `--redis-tls-enabled` + ```bash + atlantis server --redis-tls-enabled=false ++ # or ++ ATLANTIS_REDIS_TLS_ENABLED=false + ``` + Enables a TLS connection, with min version of 1.2, to Redis when using a Locking DB type of `redis`. Defaults to `false`. + + ### `--redis-insecure-skip-verify` + ```bash + atlantis server --redis-insecure-skip-verify=false ++ # or ++ ATLANTIS_REDIS_INSECURE_SKIP_VERIFY=false + ``` + Controls whether the Redis client verifies the Redis server's certificate chain and host name. If true, accepts any certificate presented by the server and any host name in that certificate. Defaults to `false`. + +@@ -537,12 +641,16 @@ Values are chosen in this order: + ### `--repo-config` + ```bash + atlantis server --repo-config=""path/to/repos.yaml"" ++ # or ++ ATLANTIS_REPO_CONFIG=""path/to/repos.yaml"" + ``` + Path to a YAML server-side repo config file. See [Server Side Repo Config](server-side-repo-config.html). + + ### `--repo-config-json` + ```bash + atlantis server --repo-config-json='{""repos"":[{""id"":""/.*/"", ""apply_requirements"":[""mergeable""]}]}' ++ # or ++ ATLANTIS_REPO_CONFIG_JSON='{""repos"":[{""id"":""/.*/"", ""apply_requirements"":[""mergeable""]}]}' + ``` + Specify server-side repo config as a JSON string. Useful if you don't want to write a config file to disk. + See [Server Side Repo Config](server-side-repo-config.html) for more details. +@@ -577,10 +685,13 @@ Values are chosen in this order: + ### `--repo-whitelist` + + Deprecated for `--repo-allowlist`. ++ + ### `--repo-allowlist` + ```bash + # NOTE: Use single quotes to avoid shell expansion of *. + atlantis server --repo-allowlist='github.com/myorg/*' ++ # or ++ ATLANTIS_REPO_ALLOWLIST='github.com/myorg/*' + ``` + Atlantis requires you to specify an allowlist of repositories it will accept webhooks from. + +@@ -609,6 +720,8 @@ Values are chosen in this order: + + ```bash + atlantis server --require-approval ++ # or ++ ATLANTIS_REQUIRE_APPROVAL=true + ``` + This flag is deprecated. It requires all pull requests to be approved + before `atlantis apply` is allowed. See [Apply Requirements](apply-requirements.html) for more details. +@@ -626,6 +739,8 @@ Values are chosen in this order: + + ```bash + atlantis server --require-mergeable ++ # or ++ ATLANTIS_REQUIRE_MERGEABLE=true + ``` + This flag is deprecated. It causes all pull requests to be mergeable + before `atlantis apply` is allowed. See [Apply Requirements](apply-requirements.html) for more details. +@@ -642,6 +757,8 @@ Values are chosen in this order: + ### `--silence-fork-pr-errors` + ```bash + atlantis server --silence-fork-pr-errors ++ # or ++ ATLANTIS_SILENCE_FORK_PR_ERRORS=true + ``` + Normally, if Atlantis receives a pull request webhook from a fork and --allow-fork-prs is not set, + it will comment back with an error. This flag disables that commenting. +@@ -653,6 +770,8 @@ Values are chosen in this order: + ### `--silence-allowlist-errors` + ```bash + atlantis server --silence-allowlist-errors ++ # or ++ ATLANTIS_SILENCE_ALLOWLIST_ERRORS=true + ``` + Some users use the `--repo-allowlist` flag to control which repos Atlantis + responds to. Normally, if Atlantis receives a pull request webhook from a repo not listed +@@ -664,6 +783,8 @@ Values are chosen in this order: + ### `--silence-no-projects` + ```bash + atlantis server --silence-no-projects ++ # or ++ ATLANTIS_SILENCE_NO_PROJECTS=true + ``` + `--silence-no-projects` will tell Atlantis to ignore PRs if none of the modified files are part of a project defined in the `atlantis.yaml` file. + +@@ -673,12 +794,16 @@ Values are chosen in this order: + ### `--silence-vcs-status-no-plans` + ```bash + atlantis server --silence-vcs-status-no-plans ++ # or ++ ATLANTIS_SILENCE_VCS_STATUS_NO_PLANS=true + ``` + `--silence-vcs-status-no-plans` will tell Atlantis to ignore setting VCS status if none of the modified files are part of a project defined in the `atlantis.yaml` file. + + ### `--skip-clone-no-changes` + ```bash + atlantis server --skip-clone-no-changes ++ # or ++ ATLANTIS_SKIP_CLONE_NO_CHANGES=true + ``` + `--skip-clone-no-changes` will skip cloning the repo during autoplan if there are no changes to Terraform projects. This will only apply for GitHub and GitLab and only for repos that have `atlantis.yaml` file. Defaults to `false`. + +@@ -686,13 +811,15 @@ Values are chosen in this order: + ```bash + atlantis server --slack-token=token + # or (recommended) +- ATLANTIS_SLACK_TOKEN='token' atlantis server ++ ATLANTIS_SLACK_TOKEN='token' + ``` + API token for Slack notifications. Slack is not fully supported. TODO: Slack docs. + + ### `--ssl-cert-file` + ```bash + atlantis server --ssl-cert-file=""/etc/ssl/certs/my-cert.crt"" ++ # or ++ ATLANTIS_SSL_CERT_FILE=""/etc/ssl/certs/my-cert.crt"" + ``` + File containing x509 Certificate used for serving HTTPS. + If the cert is signed by a CA, the file should be the concatenation +@@ -700,19 +827,25 @@ Values are chosen in this order: + + ### `--ssl-key-file` + ```bash +- atlantis server --ssl-cert-file=""/etc/ssl/private/my-cert.key"" ++ atlantis server --ssl-key-file=""/etc/ssl/private/my-cert.key"" ++ # or ++ ATLANTIS_SSL_KEY_FILE=""/etc/ssl/private/my-cert.key"" + ``` + File containing x509 private key matching `--ssl-cert-file`. + + ### `--stats-namespace` + ```bash + atlantis server --stats-namespace=""myatlantis"" ++ # or ++ ATLANTIS_STATS_NAMESPACE=""myatlantis"" + ``` +- Namespace for emitting stats/metrics. See (stats.html#Metrics/Stats) ++ Namespace for emitting stats/metrics. See [stats](stats.html) section. + + ### `--tf-download-url` + ```bash + atlantis server --tf-download-url=""https://releases.company.com"" ++ # or ++ ATLANTIS_TF_DOWNLOAD_URL=""https://releases.company.com"" + ``` + An alternative URL to download Terraform versions if they are missing. Useful in an airgapped + environment where releases.hashicorp.com is not available. Directory structure of the custom +@@ -721,6 +854,8 @@ Values are chosen in this order: + ### `--tfe-hostname` + ```bash + atlantis server --tfe-hostname=""my-terraform-enterprise.company.com"" ++ # or ++ ATLANTIS_TFE_HOSTNAME=""my-terraform-enterprise.company.com"" + ``` + Hostname of your Terraform Enterprise installation to be used in conjunction with + `--tfe-token`. See [Terraform Cloud](terraform-cloud.html) for more details. +@@ -730,6 +865,8 @@ Values are chosen in this order: + ### `--tfe-local-execution-mode` + ```bash + atlantis server --tfe-local-execution-mode ++ # or ++ ATLANTIS_TFE_LOCAL_EXECUTION_MODE=true + ``` + Enable if you're using local execution mode (instead of TFE/C's remote execution mode). See [Terraform Cloud](terraform-cloud.html) for more details. + +@@ -744,6 +881,8 @@ Values are chosen in this order: + ### `--var-file-allowlist` + ```bash + atlantis server --var-file-allowlist='/path/to/tfvars/dir' ++ # or ++ ATLANTIS_VAR_FILE_ALLOWLIST='/path/to/tfvars/dir' + ``` + Comma-separated list of additional directory paths where [variable definition files](https://www.terraform.io/language/values/variables#variable-definitions-tfvars-files) can be read from. + The paths in this argument should be absolute paths. Relative paths and globbing are currently not supported. +@@ -752,6 +891,8 @@ Values are chosen in this order: + ### `--vcs-status-name` + ```bash + atlantis server --vcs-status-name=""atlantis-dev"" ++ # or ++ ATLANTIS_VCS_STATUS_NAME=""atlantis-dev"" + ``` + Name used to identify Atlantis when updating a pull request status. Defaults to `atlantis`. + +@@ -766,6 +907,17 @@ Values are chosen in this order: + ``` + Write out a .git-credentials file with the provider user and token to allow + cloning private modules over HTTPS or SSH. See [here](https://git-scm.com/docs/git-credential-store) for more information. ++ ++ Follow the `git::ssh` syntax to avoid using a custom `.gitconfig` with an `insteadOf`. ++ ++ ```hcl ++ module ""private_submodule"" { ++ source = ""git::ssh://git@github.com////modules/?ref=v1.2.3"" ++ ++ # ... ++ } ++ ``` ++ + ::: warning SECURITY WARNING + This does write secrets to disk and should only be enabled in a secure environment. + ::: +@@ -773,23 +925,31 @@ Values are chosen in this order: + ### `--web-basic-auth` + ```bash + atlantis server --web-basic-auth ++ # or ++ ATLANTIS_WEB_BASIC_AUTH=true + ``` + Enable Basic Authentication on the Atlantis web service. + + ### `--web-username` + ```bash + atlantis server --web-username=""atlantis"" ++ # or ++ ATLANTIS_WEB_USERNAME=""atlantis"" + ``` + Username used for Basic Authentication on the Atlantis web service. Defaults to `atlantis`. + + ### `--web-password` + ```bash + atlantis server --web-password=""atlantis"" ++ # or ++ ATLANTIS_WEB_PASSWORD=""atlantis"" + ``` + Password used for Basic Authentication on the Atlantis web service. Defaults to `atlantis`. + + ### `--websocket-check-origin` + ```bash + atlantis server --websocket-check-origin ++ # or ++ ATLANTIS_WEBSOCKET_CHECK_ORIGIN=true + ``` + Only allow websockets connection when they originate from the running Atlantis web server" +seastar,https://github.com/scylladb/seastar,a210b4894bcff10b79b07d0229d594c47acd89b4,Kefu Chai,2023-02-26 13:15:16,build: set the correct version when finding lz4,"before this change, `lz4_VERSION` was used for the +detected version. this variable is not set at all. + +after this change, `PC_lz4_VERSION` is used instead, so we can +detect the version of lz4, and fail the `find_package()` call, if +the version of installed lz4 does not fulfill the needs.","build: set the correct version when finding lz4 + +before this change, `lz4_VERSION` was used for the +detected version. this variable is not set at all. + +after this change, `PC_lz4_VERSION` is used instead, so we can +detect the version of lz4, and fail the `find_package()` call, if +the version of installed lz4 does not fulfill the needs. + +Signed-off-by: Kefu Chai ","diff --git a/cmake/Findlz4.cmake b/cmake/Findlz4.cmake +index a2cd09fdcb5..8d0b2ee3db3 100644 +--- a/cmake/Findlz4.cmake ++++ b/cmake/Findlz4.cmake +@@ -46,7 +46,7 @@ find_package_handle_standard_args (lz4 + REQUIRED_VARS + lz4_LIBRARY + lz4_INCLUDE_DIR +- VERSION_VAR lz4_VERSION) ++ VERSION_VAR PC_lz4_VERSION) + + if (lz4_FOUND) + set (CMAKE_REQUIRED_LIBRARIES ${lz4_LIBRARY})" +docusaurus,https://github.com/facebook/docusaurus,f77e96d28dd8b23314de4dda0b59679daf2706dd,Endi,2019-07-14 20:54:54,fix(v2): missing deps from preset-classic (#1662),"* fix(v2): missing deps from preset-classic + +* nits + +* changelog + +* Update CHANGELOG.md","fix(v2): missing deps from preset-classic (#1662) + +* fix(v2): missing deps from preset-classic + +* nits + +* changelog + +* Update CHANGELOG.md","diff --git a/packages/docusaurus-preset-classic/package.json b/packages/docusaurus-preset-classic/package.json +index 9736e5574fa3..6580c7dae519 100644 +--- a/packages/docusaurus-preset-classic/package.json ++++ b/packages/docusaurus-preset-classic/package.json +@@ -13,7 +13,9 @@ + ""@docusaurus/plugin-content-pages"": ""^2.0.0-alpha.21"", + ""@docusaurus/plugin-sitemap"": ""^2.0.0-alpha.21"", + ""@docusaurus/theme-classic"": ""^2.0.0-alpha.21"", +- ""@docusaurus/theme-search-algolia"": ""^2.0.0-alpha.21"" ++ ""@docusaurus/theme-search-algolia"": ""^2.0.0-alpha.21"", ++ ""@docusaurus/plugin-google-analytics"": ""^2.0.0-alpha.21"", ++ ""@docusaurus/plugin-google-gtag"": ""^2.0.0-alpha.21"" + }, + ""peerDependencies"": { + ""@docusaurus/core"": ""^2.0.0"" +diff --git a/packages/docusaurus/CHANGELOG.md b/packages/docusaurus/CHANGELOG.md +index 14dd208415ac..357d1f4e326a 100644 +--- a/packages/docusaurus/CHANGELOG.md ++++ b/packages/docusaurus/CHANGELOG.md +@@ -1,10 +1,16 @@ + # Docusaurus 2 Changelog + ++## Unreleased ++ ++- Add missing dependencies on @docusaurus/preset-classic ++ + ## 2.0.0-alpha.21 ++ + - Fix babel-loader not transpiling docusaurus package + + ## 2.0.0-alpha.20 + ++- Add copy codeblock button + - Added Google analytics and Google gtag plugins. + - Moved source components to `/src`. Please create a `website/src` directory and move your `/pages` and `/theme` code into it. This is to make it easier to integrate your website with external build/static analysis tooling (you can now just pass in `src/**/*.js` as the path to process). + - Added more documentation thanks to @wgao19. +@@ -13,7 +19,7 @@ + - Render 404.html page + - Improve SEO + - Clicking on the logo in the mobile sliding navigation will now bring you to the homepage. +-- Performance ++- Performance + - Disable webpack output pathinfo. Webpack has the ability to generate path info in the output bundle. However, this puts garbage collection pressure on projects that bundle thousands of modules. Not very useful for our case + - Drop cache-loader in CI and test environment because it has an initial overhead. We always start from scratch in vm instance like CI so cache-loader is useless + - Better splitchunks and babel default webpack config" +podman,https://github.com/containers/podman,94878af15147e82f5a3ca7d8234518b653ae9225,Giuseppe Scrivano,2024-10-22 15:35:07,test: set soft ulimit,"when the current soft limit is higher than the new value, ulimit fails +to set the hard limit as (tested on Rawhide): + +[root@rawhide ~]# ulimit -n -H 1048575","test: set soft ulimit + +when the current soft limit is higher than the new value, ulimit fails +to set the hard limit as (tested on Rawhide): + +[root@rawhide ~]# ulimit -n -H 1048575 +-bash: ulimit: open files: cannot modify limit: Invalid argument + +to avoid the problem, set also the soft limit: + +[root@rawhide ~]# ulimit -n -H +12345678 +[root@rawhide ~]# ulimit -n -H 1048575 +-bash: ulimit: open files: cannot modify limit: Invalid argument +[root@rawhide ~]# ulimit -n -SH 1048575 +[root@rawhide ~]# ulimit -n -H +1048575 + +commit 71d5ee0e04eb61802b7c59166d88eac19c563ff7 introduced the issue. + +Signed-off-by: Giuseppe Scrivano ","diff --git a/test/system/030-run.bats b/test/system/030-run.bats +index 3d75b1aa2b..597f407be9 100644 +--- a/test/system/030-run.bats ++++ b/test/system/030-run.bats +@@ -1315,7 +1315,7 @@ EOF + default_value=$output + + # Set the current ulimit smaller than the default value +- ulimit -n -H $((default_value - 1)) ++ ulimit -n -SH $((default_value - 1)) + + run_podman run --rm $IMAGE sh -c 'ulimit -n -H'" +insomnia,https://github.com/Kong/insomnia,ee5d346fcf76b8068cc9071ba08232fb96fb9c4c,Filipe Freire,2023-11-08 20:33:01,fix: multi-line curl not properly imported due to padding #6755 (#6774),"* fix: multi-line curl not properly imported due to padding #6755 + +* Update curl.test.ts + +* Update curl.test.ts","fix: multi-line curl not properly imported due to padding #6755 (#6774) + +* fix: multi-line curl not properly imported due to padding #6755 + +* Update curl.test.ts + +* Update curl.test.ts","diff --git a/packages/insomnia/src/utils/importers/importers/curl.test.ts b/packages/insomnia/src/utils/importers/importers/curl.test.ts +index 0e1922dec7d..bacd314b89c 100644 +--- a/packages/insomnia/src/utils/importers/importers/curl.test.ts ++++ b/packages/insomnia/src/utils/importers/importers/curl.test.ts +@@ -153,4 +153,23 @@ describe('curl', () => { + }]); + }); + }); ++ describe('cURL -H flags', () => { ++ it.each([ ++ { flag: '-H', inputs: ['X-Host: example.com'], expected: [{ name: 'X-Host', value: 'example.com' }] }, ++ { flag: '-H', inputs: ['X-Host:example.com'], expected: [{ name: 'X-Host', value: 'example.com' }] }, ++ { flag: '-H', inputs: ['Content-Type:application/x-www-form-urlencoded'], expected: [{ name: 'Content-Type', value: 'application/x-www-form-urlencoded' }] }, ++ { flag: ' -H', inputs: ['Content-Type:application/x-www-form-urlencoded'], expected: [{ name: 'Content-Type', value: 'application/x-www-form-urlencoded' }] }, ++ { flag: ' -H', inputs: ['Content-Type:application/x-www-form-urlencoded'], expected: [{ name: 'Content-Type', value: 'application/x-www-form-urlencoded' }] }, ++ ])('handles %p correctly', async ({ ++ flag, ++ inputs, ++ expected, ++ }: { flag: string; inputs: string[]; expected: Parameter[] }) => { ++ const flaggedInputs = inputs.map(input => `${flag} ${quote([input])}`).join(' '); ++ const rawData = `curl https://example.com ${flaggedInputs}`; ++ expect(convert(rawData)).toMatchObject([{ ++ headers: expected, ++ }]); ++ }); ++ }); + }); +diff --git a/packages/insomnia/src/utils/importers/importers/curl.ts b/packages/insomnia/src/utils/importers/importers/curl.ts +index 03698f9a5ad..0e62cb6dc9d 100644 +--- a/packages/insomnia/src/utils/importers/importers/curl.ts ++++ b/packages/insomnia/src/utils/importers/importers/curl.ts +@@ -46,7 +46,12 @@ const importCommand = (parseEntries: ParseEntry[]): ImportRequest => { + + // Start at 1 so we can skip the ^curl part + for (let i = 1; i < parseEntries.length; i++) { +- const parseEntry = parseEntries[i]; ++ let parseEntry = parseEntries[i]; ++ // trim leading spaces between parsed entries ++ // regex won't match otherwise (e.g. -H 'Content-Type: application/json') ++ if (typeof parseEntry === 'string') { ++ parseEntry = parseEntry.trim(); ++ } + + if (typeof parseEntry === 'string' && parseEntry.match(/^-{1,2}[\w-]+/)) { + const isSingleDash = parseEntry[0] === '-' && parseEntry[1] !== '-';" +angular,https://github.com/angular/angular,64967da78acb952a5e293729f6a3dd983fc3df91,Paul Gschwendtner,2023-01-13 01:14:51,ci: include branch name in update CLI help PRs (#48716),"This should make it easier to distinguish between PRs +as currently they same equivalent but actually target +different branches. + +PR Close #48716","ci: include branch name in update CLI help PRs (#48716) + +This should make it easier to distinguish between PRs +as currently they same equivalent but actually target +different branches. + +PR Close #48716","diff --git a/.github/workflows/update-cli-help.yml b/.github/workflows/update-cli-help.yml +index a823525c9875c5..df0f95b35e8ab1 100644 +--- a/.github/workflows/update-cli-help.yml ++++ b/.github/workflows/update-cli-help.yml +@@ -35,7 +35,7 @@ jobs: + uses: angular/dev-infra/github-actions/create-pr-for-changes@ad1374e8222825244b36a91d0f085f8fc3c7126d + with: + branch-prefix: update-cli-help +- pr-title: 'docs: update Angular CLI help' ++ pr-title: 'docs: update Angular CLI help [${{github.ref_name}}]' + pr-description: | + Updated Angular CLI help contents. + pr-labels: |" +quivr,https://github.com/QuivrHQ/quivr,1456015c68fcbb5eb419c7ceb511df1930b588dc,Jacopo Chevallard,2024-09-23 22:45:07,fix: wrong default path for CHAT_LLM_CONFIG_PATH env variable (#3247),"# Description + +Please include a summary of the changes and the related issue. Please +also include relevant motivation and context. + +## Checklist before requesting a review + +Please delete options that are not relevant. + +- [x] My code follows the style guidelines of this project +- [x] I have performed a self-review of my code +- [ ] I have commented hard-to-understand areas +- [ ] I have ideally added tests that prove my fix is effective or that +my feature works +- [ ] New and existing unit tests pass locally with my changes +- [ ] Any dependent changes have been merged + +## Screenshots (if appropriate):","fix: wrong default path for CHAT_LLM_CONFIG_PATH env variable (#3247) + +# Description + +Please include a summary of the changes and the related issue. Please +also include relevant motivation and context. + +## Checklist before requesting a review + +Please delete options that are not relevant. + +- [x] My code follows the style guidelines of this project +- [x] I have performed a self-review of my code +- [ ] I have commented hard-to-understand areas +- [ ] I have ideally added tests that prove my fix is effective or that +my feature works +- [ ] New and existing unit tests pass locally with my changes +- [ ] Any dependent changes have been merged + +## Screenshots (if appropriate):","diff --git a/backend/api/quivr_api/modules/chat/controller/chat/utils.py b/backend/api/quivr_api/modules/chat/controller/chat/utils.py +index d6cb61d6692c..5306f4ecbeb7 100644 +--- a/backend/api/quivr_api/modules/chat/controller/chat/utils.py ++++ b/backend/api/quivr_api/modules/chat/controller/chat/utils.py +@@ -14,7 +14,7 @@ + + + class RetrievalConfigPathEnv(Enum): +- CHAT_WITH_LLM = (""CHAT_LLM_CONFIG_PATH"", ""chat_llm_config.yaml"") ++ CHAT_WITH_LLM = (""CHAT_LLM_CONFIG_PATH"", ""config/chat_llm_config.yaml"") + RAG = (""BRAIN_CONFIG_PATH"", ""config/retrieval_config_workflow.yaml"") + + @property" +PrismLauncher,https://github.com/PrismLauncher/PrismLauncher,eed73c90785ec977ee975d403270f9138aa6960c,flow,2022-09-21 03:06:08,refactor: clean up InstanceImportTask a bit,"Also removes a divide by two in the download progress +(why was it there???)","refactor: clean up InstanceImportTask a bit + +Also removes a divide by two in the download progress +(why was it there???) + +Signed-off-by: flow ","diff --git a/launcher/InstanceImportTask.cpp b/launcher/InstanceImportTask.cpp +index 72c2496f6c..da57ddeb31 100644 +--- a/launcher/InstanceImportTask.cpp ++++ b/launcher/InstanceImportTask.cpp +@@ -35,34 +35,26 @@ + */ + + #include ""InstanceImportTask.h"" +-#include ++ + #include ""Application.h"" +-#include ""BaseInstance.h"" + #include ""FileSystem.h"" + #include ""MMCZip.h"" + #include ""NullInstance.h"" ++ + #include ""icons/IconList.h"" + #include ""icons/IconUtils.h"" +-#include ""settings/INISettingsObject.h"" + +-// FIXME: this does not belong here, it's Minecraft/Flame specific +-#include +-#include ""Json.h"" +-#include ""minecraft/MinecraftInstance.h"" +-#include ""minecraft/PackProfile.h"" + #include ""modplatform/technic/TechnicPackProcessor.h"" + #include ""modplatform/modrinth/ModrinthInstanceCreationTask.h"" + #include ""modplatform/flame/FlameInstanceCreationTask.h"" + +-#include ""Application.h"" +-#include ""icons/IconList.h"" +-#include ""net/ChecksumValidator.h"" +- +-#include ""ui/dialogs/CustomMessageBox.h"" +-#include ""ui/dialogs/BlockedModsDialog.h"" ++#include ""settings/INISettingsObject.h"" + ++#include + #include + ++#include ++ + InstanceImportTask::InstanceImportTask(const QUrl sourceUrl, QWidget* parent) + { + m_sourceUrl = sourceUrl; +@@ -80,26 +72,26 @@ bool InstanceImportTask::abort() + + void InstanceImportTask::executeTask() + { +- if (m_sourceUrl.isLocalFile()) +- { ++ if (m_sourceUrl.isLocalFile()) { + m_archivePath = m_sourceUrl.toLocalFile(); + processZipPack(); +- } +- else +- { ++ } else { + setStatus(tr(""Downloading modpack:\n%1"").arg(m_sourceUrl.toString())); + m_downloadRequired = true; + +- const QString path = m_sourceUrl.host() + '/' + m_sourceUrl.path(); ++ const QString path(m_sourceUrl.host() + '/' + m_sourceUrl.path()); ++ + auto entry = APPLICATION->metacache()->resolveEntry(""general"", path); + entry->setStale(true); ++ m_archivePath = entry->getFullPath(); ++ + m_filesNetJob = new NetJob(tr(""Modpack download""), APPLICATION->network()); + m_filesNetJob->addNetAction(Net::Download::makeCached(m_sourceUrl, entry)); +- m_archivePath = entry->getFullPath(); +- auto job = m_filesNetJob.get(); +- connect(job, &NetJob::succeeded, this, &InstanceImportTask::downloadSucceeded); +- connect(job, &NetJob::progress, this, &InstanceImportTask::downloadProgressChanged); +- connect(job, &NetJob::failed, this, &InstanceImportTask::downloadFailed); ++ ++ connect(m_filesNetJob.get(), &NetJob::succeeded, this, &InstanceImportTask::downloadSucceeded); ++ connect(m_filesNetJob.get(), &NetJob::progress, this, &InstanceImportTask::downloadProgressChanged); ++ connect(m_filesNetJob.get(), &NetJob::failed, this, &InstanceImportTask::downloadFailed); ++ + m_filesNetJob->start(); + } + } +@@ -118,7 +110,7 @@ void InstanceImportTask::downloadFailed(QString reason) + + void InstanceImportTask::downloadProgressChanged(qint64 current, qint64 total) + { +- setProgress(current / 2, total); ++ setProgress(current, total); + } + + void InstanceImportTask::processZipPack()" +aws-cdk,https://github.com/aws/aws-cdk,a67633e102c15741de26237642aed2240bcbc491,Rico Hermans,2023-10-24 16:49:20,chore: fix the use of mixed dep/devdeps (#27652),"`fs-extra` is sometimes not included in the `npm pack` tarball, depending on the version of NPM. + +The reason is that it occurs in both `dependencies` and `devDependencies`, which is not a useful dependency specification. + +This is breaking jsii builds, depending on the NPM version used. + +---- + +*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*","chore: fix the use of mixed dep/devdeps (#27652) + +`fs-extra` is sometimes not included in the `npm pack` tarball, depending on the version of NPM. + +The reason is that it occurs in both `dependencies` and `devDependencies`, which is not a useful dependency specification. + +This is breaking jsii builds, depending on the NPM version used. + +---- + +*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*","diff --git a/packages/@aws-cdk/app-staging-synthesizer-alpha/package.json b/packages/@aws-cdk/app-staging-synthesizer-alpha/package.json +index 8ea79ac838439..e4cd98f976f19 100644 +--- a/packages/@aws-cdk/app-staging-synthesizer-alpha/package.json ++++ b/packages/@aws-cdk/app-staging-synthesizer-alpha/package.json +@@ -83,10 +83,6 @@ + ""AWSLINT_BASE_CONSTRUCT"": true + } + }, +- ""dependencies"": { +- ""aws-cdk-lib"": ""0.0.0"", +- ""constructs"": ""^10.0.0"" +- }, + ""devDependencies"": { + ""aws-cdk-lib"": ""0.0.0"", + ""@aws-cdk/integ-runner"": ""0.0.0"", +diff --git a/packages/@aws-cdk/aws-appconfig-alpha/package.json b/packages/@aws-cdk/aws-appconfig-alpha/package.json +index 86f5da9eacfe3..bc3a6a8f3d4ee 100644 +--- a/packages/@aws-cdk/aws-appconfig-alpha/package.json ++++ b/packages/@aws-cdk/aws-appconfig-alpha/package.json +@@ -87,8 +87,6 @@ + ""jest"": ""^29.7.0"" + }, + ""dependencies"": { +- ""aws-cdk-lib"": ""0.0.0"", +- ""constructs"": ""^10.0.0"", + ""mime-types"": ""^2.1.35"" + }, + ""homepage"": ""https://github.com/aws/aws-cdk"", +diff --git a/packages/@aws-cdk/cx-api/package.json b/packages/@aws-cdk/cx-api/package.json +index 93c5ef34c77ed..6b35899c35853 100644 +--- a/packages/@aws-cdk/cx-api/package.json ++++ b/packages/@aws-cdk/cx-api/package.json +@@ -79,7 +79,6 @@ + ""organization"": true + }, + ""dependencies"": { +- ""@aws-cdk/cloud-assembly-schema"": ""0.0.0"", + ""semver"": ""^7.5.4"" + }, + ""peerDependencies"": { +diff --git a/packages/@aws-cdk/example-construct-library/package.json b/packages/@aws-cdk/example-construct-library/package.json +index 93511022414de..b14a20d17e189 100644 +--- a/packages/@aws-cdk/example-construct-library/package.json ++++ b/packages/@aws-cdk/example-construct-library/package.json +@@ -80,10 +80,6 @@ + ""@types/jest"": ""^29.5.5"", + ""jest"": ""^29.7.0"" + }, +- ""dependencies"": { +- ""aws-cdk-lib"": ""0.0.0"", +- ""constructs"": ""^10.0.0"" +- }, + ""homepage"": ""https://github.com/aws/aws-cdk"", + ""peerDependencies"": { + ""aws-cdk-lib"": ""^0.0.0"", +diff --git a/packages/aws-cdk-lib/package.json b/packages/aws-cdk-lib/package.json +index acd47c7a9a082..f3859449aa085 100644 +--- a/packages/aws-cdk-lib/package.json ++++ b/packages/aws-cdk-lib/package.json +@@ -108,7 +108,7 @@ + ""organization"": true + }, + ""license"": ""Apache-2.0"", +- ""bundledDependencies"": [ ++ ""bundleDependencies"": [ + ""@balena/dockerignore"", + ""case"", + ""fs-extra"", +@@ -176,7 +176,6 @@ + ""delay"": ""5.0.0"", + ""esbuild"": ""^0.19.4"", + ""fast-check"": ""^3.13.1"", +- ""fs-extra"": ""^11.1.1"", + ""jest"": ""^29.7.0"", + ""jest-each"": ""^29.7.0"", + ""lambda-tester"": ""^4.0.1"", +diff --git a/packages/aws-cdk/package.json b/packages/aws-cdk/package.json +index 320aacb543cc0..f550f02f0aae4 100644 +--- a/packages/aws-cdk/package.json ++++ b/packages/aws-cdk/package.json +@@ -82,7 +82,6 @@ + ""aws-cdk-lib"": ""0.0.0"", + ""aws-sdk-mock"": ""5.6.0"", + ""axios"": ""^0.27.2"", +- ""cdk-from-cfn"": ""^0.47.0"", + ""constructs"": ""^10.0.0"", + ""fast-check"": ""^3.13.1"", + ""jest"": ""^29.7.0"", +diff --git a/tools/@aws-cdk/cdk-build-tools/config/eslintrc.js b/tools/@aws-cdk/cdk-build-tools/config/eslintrc.js +index d37fadbc92722..96606baae2b0f 100644 +--- a/tools/@aws-cdk/cdk-build-tools/config/eslintrc.js ++++ b/tools/@aws-cdk/cdk-build-tools/config/eslintrc.js +@@ -73,7 +73,6 @@ module.exports = { + '**/test/**', // --> Unit tests + ], + optionalDependencies: false, // Disallow importing optional dependencies (those shouldn't be in use in the project) +- peerDependencies: false, // Disallow importing peer dependencies (that aren't also direct dependencies) + }, + ], + +diff --git a/tools/@aws-cdk/cfn2ts/package.json b/tools/@aws-cdk/cfn2ts/package.json +index a4ca4a7dcef5a..e106b6ebfa873 100644 +--- a/tools/@aws-cdk/cfn2ts/package.json ++++ b/tools/@aws-cdk/cfn2ts/package.json +@@ -40,7 +40,6 @@ + }, + ""devDependencies"": { + ""@aws-cdk/cdk-build-tools"": ""0.0.0"", +- ""@aws-cdk/pkglint"": ""0.0.0"", + ""@types/fs-extra"": ""^9.0.13"", + ""@types/jest"": ""^29.5.5"", + ""@types/yargs"": ""^15.0.16"", +diff --git a/tools/@aws-cdk/pkglint/lib/rules.ts b/tools/@aws-cdk/pkglint/lib/rules.ts +index 2ee767709a248..e80ea54a2deee 100644 +--- a/tools/@aws-cdk/pkglint/lib/rules.ts ++++ b/tools/@aws-cdk/pkglint/lib/rules.ts +@@ -1258,6 +1258,11 @@ export class PkgLintAsScript extends ValidationRule { + public readonly name = 'package-info/scripts/pkglint'; + + public validate(pkg: PackageJson): void { ++ if (pkg.packageName === '@aws-cdk/cfn2ts') { ++ // cfn2ts uses pkglint as a real dependency, and it can't be both. ++ return; ++ } ++ + const script = 'pkglint -f'; + + expectDevDependency(this.name, pkg, '@aws-cdk/pkglint', `${PKGLINT_VERSION}`); // eslint-disable-line @typescript-eslint/no-require-imports +@@ -1301,6 +1306,24 @@ export class NoStarDeps extends ValidationRule { + } + } + ++export class NoMixedDeps extends ValidationRule { ++ public readonly name = 'dependencies/no-mixed-deps'; ++ ++ public validate(pkg: PackageJson) { ++ const deps = Object.keys(pkg.json.dependencies ?? {}); ++ const devDeps = Object.keys(pkg.json.devDependencies ?? {}); ++ ++ const shared = deps.filter((dep) => devDeps.includes(dep)); ++ for (const dep of shared) { ++ pkg.report({ ++ ruleName: this.name, ++ message: `dependency may not be both in dependencies and devDependencies: ${dep}`, ++ fix: () => pkg.removeDevDependency(dep), ++ }); ++ } ++ } ++} ++ + interface VersionCount { + version: string; + count: number; +@@ -1836,6 +1859,7 @@ function shouldUseCDKBuildTools(pkg: PackageJson) { + const exclude = [ + '@aws-cdk/cdk-build-tools', + '@aws-cdk/script-tests', ++ '@aws-cdk/cfn2ts', + 'awslint', + ];" +plane,https://github.com/makeplane/plane,05920a72a59ad58f7e67883ea5b5abf106ca2c84,guru_sainath,2023-10-04 18:17:34,chore: layout access validation and switch in plane deploy issues route (#2351),"* chore: handled route validation and layout access validation in plane deploy issues + +* chore: impoved validation condition","chore: layout access validation and switch in plane deploy issues route (#2351) + +* chore: handled route validation and layout access validation in plane deploy issues + +* chore: impoved validation condition","diff --git a/space/components/issues/navbar/index.tsx b/space/components/issues/navbar/index.tsx +index 509d676b7bb..35ffbe289c2 100644 +--- a/space/components/issues/navbar/index.tsx ++++ b/space/components/issues/navbar/index.tsx +@@ -44,19 +44,43 @@ const IssueNavbar = observer(() => { + }, [projectStore, workspace_slug, project_slug]); + + useEffect(() => { +- if (workspace_slug && project_slug) { +- if (!board) { +- router.push({ +- pathname: `/${workspace_slug}/${project_slug}`, +- query: { +- board: ""list"", +- }, +- }); +- return projectStore.setActiveBoard(""list""); ++ if (workspace_slug && project_slug && projectStore?.deploySettings) { ++ const viewsAcceptable: string[] = []; ++ let currentBoard: string | null = null; ++ ++ if (projectStore?.deploySettings?.views?.list) viewsAcceptable.push(""list""); ++ if (projectStore?.deploySettings?.views?.kanban) viewsAcceptable.push(""kanban""); ++ if (projectStore?.deploySettings?.views?.calendar) viewsAcceptable.push(""calendar""); ++ if (projectStore?.deploySettings?.views?.gantt) viewsAcceptable.push(""gantt""); ++ if (projectStore?.deploySettings?.views?.spreadsheet) viewsAcceptable.push(""spreadsheet""); ++ ++ if (board) { ++ if (viewsAcceptable.includes(board.toString())) { ++ currentBoard = board.toString(); ++ } else { ++ if (viewsAcceptable && viewsAcceptable.length > 0) { ++ currentBoard = viewsAcceptable[0]; ++ } ++ } ++ } else { ++ if (viewsAcceptable && viewsAcceptable.length > 0) { ++ currentBoard = viewsAcceptable[0]; ++ } ++ } ++ ++ if (currentBoard) { ++ if (projectStore?.activeBoard === null || projectStore?.activeBoard !== currentBoard) { ++ projectStore.setActiveBoard(currentBoard); ++ router.push({ ++ pathname: `/${workspace_slug}/${project_slug}`, ++ query: { ++ board: currentBoard, ++ }, ++ }); ++ } + } +- projectStore.setActiveBoard(board.toString()); + } +- }, [board, workspace_slug, project_slug]); ++ }, [board, workspace_slug, project_slug, router, projectStore, projectStore?.deploySettings]); + + return ( +
    " +shuttle,https://github.com/shuttle-hq/shuttle,8f7180476777c6134560bcae52f585b5103e4933,Joshua Mo,2023-01-10 13:27:17,feat: add flag for router IP local run (#565),"* feat: add flag for router IP local run + +* refactor: amend ipaddr setting, local run init fn + +* refactor: delete unnecessary dependency + +Forgot to delete a dependency and it looks like I can't squash commits, whoops 🤦 + +* Revert ""refactor: delete unnecessary dependency"" + +This reverts commit 1794cc62fd6e0bf13d3fac3a3cbb832f67489474. + +* refactor: remove unnecessary dep (amendment) +Re-pushing this amendment but without the git diff. Probably should have changed that before submitting initially. + +* clippy + +* amendment from clippy warning (needless borrow) + +* refactor: apply cargo fmt diffs + +* refactor: return URL from run test setup fn ++ cargo_shuttle_run() now returns a string containing the full base URL instead of port ++ Relevant changes have been made to tests to account for this + +* refactor: change flag name to be 'external' + +Changed as per discussion on the PR. + +* refactor: use passed args directly for struct + +* test: make sure tests align to proper folders","feat: add flag for router IP local run (#565) + +* feat: add flag for router IP local run + +* refactor: amend ipaddr setting, local run init fn + +* refactor: delete unnecessary dependency + +Forgot to delete a dependency and it looks like I can't squash commits, whoops 🤦 + +* Revert ""refactor: delete unnecessary dependency"" + +This reverts commit 1794cc62fd6e0bf13d3fac3a3cbb832f67489474. + +* refactor: remove unnecessary dep (amendment) +Re-pushing this amendment but without the git diff. Probably should have changed that before submitting initially. + +* clippy + +* amendment from clippy warning (needless borrow) + +* refactor: apply cargo fmt diffs + +* refactor: return URL from run test setup fn ++ cargo_shuttle_run() now returns a string containing the full base URL instead of port ++ Relevant changes have been made to tests to account for this + +* refactor: change flag name to be 'external' + +Changed as per discussion on the PR. + +* refactor: use passed args directly for struct + +* test: make sure tests align to proper folders + +Co-authored-by: Oddbjørn Grødem <29732646+oddgrd@users.noreply.github.com>","diff --git a/cargo-shuttle/src/args.rs b/cargo-shuttle/src/args.rs +index 6bf4d522c..e7f0d8d59 100644 +--- a/cargo-shuttle/src/args.rs ++++ b/cargo-shuttle/src/args.rs +@@ -143,6 +143,9 @@ pub struct RunArgs { + /// port to start service on + #[clap(long, default_value = ""8000"")] + pub port: u16, ++ /// use 0.0.0.0 instead of localhost (for usage with local external devices) ++ #[clap(long)] ++ pub external: bool, + } + + #[derive(Parser, Debug)] +diff --git a/cargo-shuttle/src/lib.rs b/cargo-shuttle/src/lib.rs +index 4dc9ba980..38d56268a 100644 +--- a/cargo-shuttle/src/lib.rs ++++ b/cargo-shuttle/src/lib.rs +@@ -405,7 +405,13 @@ impl Shuttle { + secrets, + working_directory.to_path_buf(), + )?; +- let addr = SocketAddr::new(Ipv4Addr::LOCALHOST.into(), run_args.port); ++ let addr = if run_args.external { ++ std::net::IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)) ++ } else { ++ Ipv4Addr::LOCALHOST.into() ++ }; ++ ++ let addr = SocketAddr::new(addr, run_args.port); + + trace!(""loading project""); + println!( +diff --git a/cargo-shuttle/tests/integration/run.rs b/cargo-shuttle/tests/integration/run.rs +index 318145ffb..3207d019c 100644 +--- a/cargo-shuttle/tests/integration/run.rs ++++ b/cargo-shuttle/tests/integration/run.rs +@@ -5,10 +5,18 @@ use std::{fs::canonicalize, process::exit, time::Duration}; + use tokio::time::sleep; + + /// creates a `cargo-shuttle` run instance with some reasonable defaults set. +-async fn cargo_shuttle_run(working_directory: &str) -> u16 { ++async fn cargo_shuttle_run(working_directory: &str, external: bool) -> String { + let working_directory = canonicalize(working_directory).unwrap(); ++ + let port = pick_unused_port().unwrap(); +- let run_args = RunArgs { port }; ++ ++ let url = if !external { ++ format!(""http://localhost:{port}"") ++ } else { ++ format!(""http://0.0.0.0:{port}"") ++ }; ++ ++ let run_args = RunArgs { port, external }; + + let runner = Shuttle::new().unwrap().run(Args { + api_url: Some(""http://shuttle.invalid:80"".to_string()), +@@ -34,12 +42,7 @@ async fn cargo_shuttle_run(working_directory: &str) -> u16 { + tokio::spawn(runner); + + // Wait for service to be responsive +- while (reqwest::Client::new() +- .get(format!(""http://localhost:{port}"")) +- .send() +- .await) +- .is_err() +- { ++ while (reqwest::Client::new().get(url.clone()).send().await).is_err() { + println!( + ""waiting for '{}' to start up..."", + working_directory.display() +@@ -47,15 +50,15 @@ async fn cargo_shuttle_run(working_directory: &str) -> u16 { + sleep(Duration::from_millis(350)).await; + } + +- port ++ url + } + + #[tokio::test(flavor = ""multi_thread"")] + async fn rocket_hello_world() { +- let port = cargo_shuttle_run(""../examples/rocket/hello-world"").await; ++ let url = cargo_shuttle_run(""../examples/rocket/hello-world"", false).await; + + let request_text = reqwest::Client::new() +- .get(format!(""http://localhost:{port}/hello"")) ++ .get(format!(""{url}/hello"")) + .send() + .await + .unwrap() +@@ -68,10 +71,10 @@ async fn rocket_hello_world() { + + #[tokio::test(flavor = ""multi_thread"")] + async fn rocket_secrets() { +- let port = cargo_shuttle_run(""../examples/rocket/secrets"").await; ++ let url = cargo_shuttle_run(""../examples/rocket/secrets"", false).await; + + let request_text = reqwest::Client::new() +- .get(format!(""http://localhost:{port}/secret"")) ++ .get(format!(""{url}/secret"")) + .send() + .await + .unwrap() +@@ -85,11 +88,11 @@ async fn rocket_secrets() { + // This example uses a shared Postgres. Thus local runs should create a docker container for it. + #[tokio::test(flavor = ""multi_thread"")] + async fn rocket_postgres() { +- let port = cargo_shuttle_run(""../examples/rocket/postgres"").await; ++ let url = cargo_shuttle_run(""../examples/rocket/postgres"", false).await; + let client = reqwest::Client::new(); + + let post_text = client +- .post(format!(""http://localhost:{port}/todo"")) ++ .post(format!(""{url}/todo"")) + .body(""{\""note\"": \""Deploy to shuttle\""}"") + .send() + .await +@@ -101,7 +104,7 @@ async fn rocket_postgres() { + assert_eq!(post_text, ""{\""id\"":1,\""note\"":\""Deploy to shuttle\""}""); + + let request_text = client +- .get(format!(""http://localhost:{port}/todo/1"")) ++ .get(format!(""{url}/todo/1"")) + .send() + .await + .unwrap() +@@ -114,11 +117,11 @@ async fn rocket_postgres() { + + #[tokio::test(flavor = ""multi_thread"")] + async fn rocket_authentication() { +- let port = cargo_shuttle_run(""../examples/rocket/authentication"").await; ++ let url = cargo_shuttle_run(""../examples/rocket/authentication"", false).await; + let client = reqwest::Client::new(); + + let public_text = client +- .get(format!(""http://localhost:{port}/public"")) ++ .get(format!(""{url}/public"")) + .send() + .await + .unwrap() +@@ -132,7 +135,7 @@ async fn rocket_authentication() { + ); + + let private_status = client +- .get(format!(""http://localhost:{port}/private"")) ++ .get(format!(""{url}/private"")) + .send() + .await + .unwrap() +@@ -141,7 +144,7 @@ async fn rocket_authentication() { + assert_eq!(private_status, StatusCode::FORBIDDEN); + + let body = client +- .post(format!(""http://localhost:{port}/login"")) ++ .post(format!(""{url}/login"")) + .body(""{\""username\"": \""username\"", \""password\"": \""password\""}"") + .send() + .await +@@ -153,7 +156,7 @@ async fn rocket_authentication() { + let token = format!(""Bearer {}"", json[""token""].as_str().unwrap()); + + let private_text = client +- .get(format!(""http://localhost:{port}/private"")) ++ .get(format!(""{url}/private"")) + .header(""Authorization"", token) + .send() + .await +@@ -170,10 +173,10 @@ async fn rocket_authentication() { + + #[tokio::test(flavor = ""multi_thread"")] + async fn actix_web_hello_world() { +- let port = cargo_shuttle_run(""../examples/actix-web/hello-world"").await; ++ let url = cargo_shuttle_run(""../examples/actix-web/hello-world"", false).await; + + let request_text = reqwest::Client::new() +- .get(format!(""http://localhost:{port}/hello"")) ++ .get(format!(""{url}/hello"")) + .send() + .await + .unwrap() +@@ -186,10 +189,10 @@ async fn actix_web_hello_world() { + + #[tokio::test(flavor = ""multi_thread"")] + async fn axum_hello_world() { +- let port = cargo_shuttle_run(""../examples/axum/hello-world"").await; ++ let url = cargo_shuttle_run(""../examples/axum/hello-world"", false).await; + + let request_text = reqwest::Client::new() +- .get(format!(""http://localhost:{port}/hello"")) ++ .get(format!(""{url}/hello"")) + .send() + .await + .unwrap() +@@ -202,10 +205,10 @@ async fn axum_hello_world() { + + #[tokio::test(flavor = ""multi_thread"")] + async fn tide_hello_world() { +- let port = cargo_shuttle_run(""../examples/tide/hello-world"").await; ++ let url = cargo_shuttle_run(""../examples/tide/hello-world"", false).await; + + let request_text = reqwest::Client::new() +- .get(format!(""http://localhost:{port}/hello"")) ++ .get(format!(""{url}/hello"")) + .send() + .await + .unwrap() +@@ -218,10 +221,10 @@ async fn tide_hello_world() { + + #[tokio::test(flavor = ""multi_thread"")] + async fn tower_hello_world() { +- let port = cargo_shuttle_run(""../examples/tower/hello-world"").await; ++ let url = cargo_shuttle_run(""../examples/tower/hello-world"", false).await; + + let request_text = reqwest::Client::new() +- .get(format!(""http://localhost:{port}/hello"")) ++ .get(format!(""{url}/hello"")) + .send() + .await + .unwrap() +@@ -234,10 +237,10 @@ async fn tower_hello_world() { + + #[tokio::test(flavor = ""multi_thread"")] + async fn warp_hello_world() { +- let port = cargo_shuttle_run(""../examples/warp/hello-world"").await; ++ let url = cargo_shuttle_run(""../examples/warp/hello-world"", false).await; + + let request_text = reqwest::Client::new() +- .get(format!(""http://localhost:{port}/hello"")) ++ .get(format!(""{url}/hello"")) + .send() + .await + .unwrap() +@@ -250,10 +253,10 @@ async fn warp_hello_world() { + + #[tokio::test(flavor = ""multi_thread"")] + async fn poem_hello_world() { +- let port = cargo_shuttle_run(""../examples/poem/hello-world"").await; ++ let url = cargo_shuttle_run(""../examples/poem/hello-world"", false).await; + + let request_text = reqwest::Client::new() +- .get(format!(""http://localhost:{port}/hello"")) ++ .get(format!(""{url}/hello"")) + .send() + .await + .unwrap() +@@ -267,11 +270,11 @@ async fn poem_hello_world() { + // This example uses a shared Postgres. Thus local runs should create a docker container for it. + #[tokio::test(flavor = ""multi_thread"")] + async fn poem_postgres() { +- let port = cargo_shuttle_run(""../examples/poem/postgres"").await; ++ let url = cargo_shuttle_run(""../examples/poem/postgres"", false).await; + let client = reqwest::Client::new(); + + let post_text = client +- .post(format!(""http://localhost:{port}/todo"")) ++ .post(format!(""{url}/todo"")) + .body(""{\""note\"": \""Deploy to shuttle\""}"") + .header(""content-type"", ""application/json"") + .send() +@@ -284,7 +287,7 @@ async fn poem_postgres() { + assert_eq!(post_text, ""{\""id\"":1,\""note\"":\""Deploy to shuttle\""}""); + + let request_text = client +- .get(format!(""http://localhost:{port}/todo/1"")) ++ .get(format!(""{url}/todo/1"")) + .send() + .await + .unwrap() +@@ -298,12 +301,12 @@ async fn poem_postgres() { + // This example uses a shared MongoDb. Thus local runs should create a docker container for it. + #[tokio::test(flavor = ""multi_thread"")] + async fn poem_mongodb() { +- let port = cargo_shuttle_run(""../examples/poem/mongodb"").await; ++ let url = cargo_shuttle_run(""../examples/poem/mongodb"", false).await; + let client = reqwest::Client::new(); + + // Post a todo note and get the persisted todo objectId + let post_text = client +- .post(format!(""http://localhost:{port}/todo"")) ++ .post(format!(""{url}/todo"")) + .body(""{\""note\"": \""Deploy to shuttle\""}"") + .header(""content-type"", ""application/json"") + .send() +@@ -317,7 +320,7 @@ async fn poem_mongodb() { + assert_eq!(post_text.len(), 24); + + let request_text = client +- .get(format!(""http://localhost:{port}/todo/{post_text}"")) ++ .get(format!(""{url}/todo/{post_text}"")) + .send() + .await + .unwrap() +@@ -330,10 +333,10 @@ async fn poem_mongodb() { + + #[tokio::test(flavor = ""multi_thread"")] + async fn salvo_hello_world() { +- let port = cargo_shuttle_run(""../examples/salvo/hello-world"").await; ++ let url = cargo_shuttle_run(""../examples/salvo/hello-world"", false).await; + + let request_text = reqwest::Client::new() +- .get(format!(""http://localhost:{port}/hello"")) ++ .get(format!(""{url}/hello"")) + .send() + .await + .unwrap() +@@ -346,10 +349,10 @@ async fn salvo_hello_world() { + + #[tokio::test(flavor = ""multi_thread"")] + async fn thruster_hello_world() { +- let port = cargo_shuttle_run(""../examples/thruster/hello-world"").await; ++ let url = cargo_shuttle_run(""../examples/thruster/hello-world"", false).await; + + let request_text = reqwest::Client::new() +- .get(format!(""http://localhost:{port}/hello"")) ++ .get(format!(""{url}/hello"")) + .send() + .await + .unwrap() +@@ -359,3 +362,19 @@ async fn thruster_hello_world() { + + assert_eq!(request_text, ""Hello, World!""); + } ++ ++#[tokio::test(flavor = ""multi_thread"")] ++async fn rocket_hello_world_with_router_ip() { ++ let url = cargo_shuttle_run(""../examples/rocket/hello-world"", true).await; ++ ++ let request_text = reqwest::Client::new() ++ .get(format!(""{url}/hello"")) ++ .send() ++ .await ++ .unwrap() ++ .text() ++ .await ++ .unwrap(); ++ ++ assert_eq!(request_text, ""Hello, world!""); ++} +diff --git a/service/tests/integration/helpers/loader.rs b/service/tests/integration/helpers/loader.rs +index 9f3b7294a..2d09238c2 100644 +--- a/service/tests/integration/helpers/loader.rs ++++ b/service/tests/integration/helpers/loader.rs +@@ -24,5 +24,5 @@ pub fn build_so_create_loader(resources: &str, crate_name: &str) -> Result { + const newModel = result.data; + + const { base_model } = newModel; ++ const didBaseModelChange = ++ state.generation.model?.base_model !== base_model; + +- if (state.generation.model?.base_model !== base_model) { ++ if (didBaseModelChange) { + // we may need to reset some incompatible submodels + let modelsCleared = 0; + +@@ -81,7 +83,7 @@ export const addModelSelectedListener = () => { + } + } + +- dispatch(modelChanged(newModel)); ++ dispatch(modelChanged(newModel, state.generation.model)); + }, + }); + }; +diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelsLoaded.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelsLoaded.ts +index 5abb369fb68..1e50d3578bf 100644 +--- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelsLoaded.ts ++++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelsLoaded.ts +@@ -74,7 +74,7 @@ export const addModelsLoadedListener = () => { + return; + } + +- dispatch(modelChanged(result.data)); ++ dispatch(modelChanged(result.data, currentModel)); + }, + }); + startAppListening({ +@@ -149,7 +149,7 @@ export const addModelsLoadedListener = () => { + + if (!firstModel) { + // No custom VAEs loaded at all; use the default +- dispatch(modelChanged(null)); ++ dispatch(vaeSelected(null)); + return; + } + +@@ -227,7 +227,7 @@ export const addModelsLoadedListener = () => { + const log = logger('models'); + log.info( + { models: action.payload.entities }, +- `ControlNet models loaded (${action.payload.ids.length})` ++ `T2I Adapter models loaded (${action.payload.ids.length})` + ); + + selectAllT2IAdapters(getState().controlAdapters).forEach((ca) => { +diff --git a/invokeai/frontend/web/src/features/canvas/store/canvasSlice.ts b/invokeai/frontend/web/src/features/canvas/store/canvasSlice.ts +index 82054675e65..aa0fc84c52c 100644 +--- a/invokeai/frontend/web/src/features/canvas/store/canvasSlice.ts ++++ b/invokeai/frontend/web/src/features/canvas/store/canvasSlice.ts +@@ -682,6 +682,12 @@ export const canvasSlice = createSlice({ + }, + extraReducers: (builder) => { + builder.addCase(modelChanged, (state, action) => { ++ if ( ++ action.meta.previousModel?.base_model === action.payload?.base_model ++ ) { ++ // The base model hasn't changed, we don't need to optimize the size ++ return; ++ } + const optimalDimension = getOptimalDimension(action.payload); + const { width, height } = state.boundingBoxDimensions; + if (getIsSizeOptimal(width, height, optimalDimension)) { +diff --git a/invokeai/frontend/web/src/features/parameters/store/generationSlice.ts b/invokeai/frontend/web/src/features/parameters/store/generationSlice.ts +index dd35e4b1928..8bda46b4a5e 100644 +--- a/invokeai/frontend/web/src/features/parameters/store/generationSlice.ts ++++ b/invokeai/frontend/web/src/features/parameters/store/generationSlice.ts +@@ -158,27 +158,51 @@ export const generationSlice = createSlice({ + const { image_name, width, height } = action.payload; + state.initialImage = { imageName: image_name, width, height }; + }, +- modelChanged: (state, action: PayloadAction) => { +- const newModel = action.payload; +- state.model = newModel; ++ modelChanged: { ++ reducer: ( ++ state, ++ action: PayloadAction< ++ ParameterModel | null, ++ string, ++ { previousModel?: ParameterModel | null } ++ > ++ ) => { ++ const newModel = action.payload; ++ state.model = newModel; + +- if (newModel === null) { +- return; +- } ++ if (newModel === null) { ++ return; ++ } + +- // Clamp ClipSkip Based On Selected Model +- const { maxClip } = CLIP_SKIP_MAP[newModel.base_model]; +- state.clipSkip = clamp(state.clipSkip, 0, maxClip); +- const optimalDimension = getOptimalDimension(newModel); +- if (getIsSizeOptimal(state.width, state.height, optimalDimension)) { +- return; +- } +- const { width, height } = calculateNewSize( +- state.aspectRatio.value, +- optimalDimension * optimalDimension +- ); +- state.width = width; +- state.height = height; ++ // Clamp ClipSkip Based On Selected Model ++ const { maxClip } = CLIP_SKIP_MAP[newModel.base_model]; ++ state.clipSkip = clamp(state.clipSkip, 0, maxClip); ++ ++ if (action.meta.previousModel?.base_model === newModel.base_model) { ++ // The base model hasn't changed, we don't need to optimize the size ++ return; ++ } ++ ++ const optimalDimension = getOptimalDimension(newModel); ++ if (getIsSizeOptimal(state.width, state.height, optimalDimension)) { ++ return; ++ } ++ const { width, height } = calculateNewSize( ++ state.aspectRatio.value, ++ optimalDimension * optimalDimension ++ ); ++ state.width = width; ++ state.height = height; ++ }, ++ prepare: ( ++ payload: ParameterModel | null, ++ previousModel?: ParameterModel | null ++ ) => ({ ++ payload, ++ meta: { ++ previousModel, ++ }, ++ }), + }, + vaeSelected: (state, action: PayloadAction) => { + // null is a valid VAE!" +mongoose,https://github.com/Automattic/mongoose,3e943e238bef81d0e2950c17d932c5fc7fca8b30,dependabot[bot],2025-02-04 20:47:41,chore(deps-dev): bump @babel/preset-env from 7.26.0 to 7.26.7,"Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.26.0 to 7.26.7. +- [Release notes](https://github.com/babel/babel/releases) +- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) +- [Commits](https://github.com/babel/babel/commits/v7.26.7/packages/babel-preset-env) + +---","chore(deps-dev): bump @babel/preset-env from 7.26.0 to 7.26.7 + +Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.26.0 to 7.26.7. +- [Release notes](https://github.com/babel/babel/releases) +- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) +- [Commits](https://github.com/babel/babel/commits/v7.26.7/packages/babel-preset-env) + +--- +updated-dependencies: +- dependency-name: ""@babel/preset-env"" + dependency-type: direct:development + update-type: version-update:semver-patch +... + +Signed-off-by: dependabot[bot] ","diff --git a/package.json b/package.json +index 4d5fb039842..44aa124df07 100644 +--- a/package.json ++++ b/package.json +@@ -29,7 +29,7 @@ + }, + ""devDependencies"": { + ""@babel/core"": ""7.26.7"", +- ""@babel/preset-env"": ""7.26.0"", ++ ""@babel/preset-env"": ""7.26.7"", + ""@typescript-eslint/eslint-plugin"": ""^8.19.1"", + ""@typescript-eslint/parser"": ""^8.19.1"", + ""acquit"": ""1.3.0""," +playwright,https://github.com/microsoft/playwright,6698f3277a947e86e023a37e215b4197db221678,Dmitry Gozman,2021-12-08 01:28:20,fix(traceViewer): calculate the number of filmstrip frames correctly (#10757),"We now fit evenly-spaced frames into available width (as intended before), +and then add one more last frame that could be cropped at the right.","fix(traceViewer): calculate the number of filmstrip frames correctly (#10757) + +We now fit evenly-spaced frames into available width (as intended before), +and then add one more last frame that could be cropped at the right.","diff --git a/packages/playwright-core/src/web/traceViewer/ui/filmStrip.tsx b/packages/playwright-core/src/web/traceViewer/ui/filmStrip.tsx +index 9fcf5ce68e5e3..4e4060b38066e 100644 +--- a/packages/playwright-core/src/web/traceViewer/ui/filmStrip.tsx ++++ b/packages/playwright-core/src/web/traceViewer/ui/filmStrip.tsx +@@ -87,12 +87,12 @@ const FilmStripLane: React.FunctionComponent<{ + const gapLeft = (startTime - boundaries.minimum) / boundariesDuration * width; + const gapRight = (boundaries.maximum - endTime) / boundariesDuration * width; + const effectiveWidth = (endTime - startTime) / boundariesDuration * width; +- const frameCount = effectiveWidth / (frameSize.width + 2 * frameMargin) | 0 + 1; ++ const frameCount = (effectiveWidth / (frameSize.width + 2 * frameMargin)) | 0; + const frameDuration = (endTime - startTime) / frameCount; + + const frames: JSX.Element[] = []; +- let i = 0; +- for (let time = startTime; startTime && frameDuration && time <= endTime; time += frameDuration, ++i) { ++ for (let i = 0; startTime && frameDuration && i < frameCount; ++i) { ++ const time = startTime + frameDuration * i; + const index = upperBound(screencastFrames, time, timeComparator) - 1; + frames.push(
    ); + } + // Always append last frame to show endgame. +- frames.push(
    internal_used_unfinished_full_sync_; ++ ++ // for wash data from 4.0.0 to 4.0.1 ++ bool wash_data_; + }; + + #endif +diff --git a/include/pika_db.h b/include/pika_db.h +index c3d4fce211..5b77f78771 100644 +--- a/include/pika_db.h ++++ b/include/pika_db.h +@@ -90,6 +90,13 @@ class DB : public std::enable_shared_from_this, public pstd::noncopyable { + friend class PkClusterInfoCmd; + friend class PikaServer; + ++ /** ++ * When it is the first time for upgrading version from 4.0.0 to 4.0.1, you should call ++ * this function to wash data. true if successful, false otherwise. ++ * @see https://github.com/OpenAtomFoundation/pika/issues/2886 ++ */ ++ bool WashData(); ++ + std::string GetDBName(); + std::shared_ptr storage() const; + void GetBgSaveMetaData(std::vector* fileNames, std::string* snapshot_uuid); +diff --git a/src/pika.cc b/src/pika.cc +index ca44ece971..a530e3fbda 100644 +--- a/src/pika.cc ++++ b/src/pika.cc +@@ -232,6 +232,17 @@ int main(int argc, char* argv[]) { + g_pika_conf.reset(); + }; + ++ // wash data if necessary ++ if (g_pika_conf->wash_data()) { ++ auto dbs = g_pika_server->GetDB(); ++ for (auto& kv : dbs) { ++ if (!kv.second->WashData()) { ++ LOG(FATAL) << ""write batch error in WashData""; ++ return 1; ++ } ++ } ++ } ++ + g_pika_rm->Start(); + g_pika_server->Start(); + +diff --git a/src/pika_conf.cc b/src/pika_conf.cc +index 98468835e8..327fcd3554 100644 +--- a/src/pika_conf.cc ++++ b/src/pika_conf.cc +@@ -730,6 +730,8 @@ int PikaConf::Load() { + rsync_timeout_ms_.store(tmp_rsync_timeout_ms); + } + ++ GetConfBool(""wash-data"", &wash_data_); ++ + return ret; + } + +diff --git a/src/pika_db.cc b/src/pika_db.cc +index 884948d4c5..04ff0dc710 100644 +--- a/src/pika_db.cc ++++ b/src/pika_db.cc +@@ -54,6 +54,33 @@ DB::~DB() { + StopKeyScan(); + } + ++bool DB::WashData() { ++ rocksdb::ReadOptions read_options; ++ rocksdb::Status s; ++ auto suffix_len = storage::ParsedBaseDataValue::GetkBaseDataValueSuffixLength(); ++ for (int i = 0; i < g_pika_conf->db_instance_num(); i++) { ++ rocksdb::WriteBatch batch; ++ auto handle = storage_->GetHashCFHandles(i)[1]; ++ auto db = storage_->GetDBByIndex(i); ++ auto it(db->NewIterator(read_options, handle)); ++ for (it->SeekToFirst(); it->Valid(); it->Next()) { ++ std::string key = it->key().ToString(); ++ std::string value = it->value().ToString(); ++ if (value.size() < suffix_len) { ++ // need to wash ++ storage::BaseDataValue internal_value(value); ++ batch.Put(handle, key, internal_value.Encode()); ++ } ++ } ++ delete it; ++ s = db->Write(storage_->GetDefaultWriteOptions(i), &batch); ++ if (!s.ok()) { ++ return false; ++ } ++ } ++ return true; ++} ++ + std::string DB::GetDBName() { return db_name_; } + + void DB::BgSaveDB() { +diff --git a/src/storage/include/storage/storage.h b/src/storage/include/storage/storage.h +index c673b07030..f929fb2091 100644 +--- a/src/storage/include/storage/storage.h ++++ b/src/storage/include/storage/storage.h +@@ -1096,6 +1096,11 @@ class Storage { + const std::string& db_type, const std::unordered_map& options); + void GetRocksDBInfo(std::string& info); + ++ // get hash cf handle in insts_[idx] ++ std::vector GetHashCFHandles(const int idx); ++ // get DefaultWriteOptions in insts_[idx] ++ rocksdb::WriteOptions GetDefaultWriteOptions(const int idx) const; ++ + private: + std::vector> insts_; + std::unique_ptr slot_indexer_; +diff --git a/src/storage/src/base_data_value_format.h b/src/storage/src/base_data_value_format.h +index ce118613a6..41648b11ef 100644 +--- a/src/storage/src/base_data_value_format.h ++++ b/src/storage/src/base_data_value_format.h +@@ -98,11 +98,13 @@ class ParsedBaseDataValue : public ParsedInternalValue { + } + } + ++ static size_t GetkBaseDataValueSuffixLength() { return kBaseDataValueSuffixLength; } ++ + protected: + virtual void SetVersionToValue() override {}; + + private: +- const size_t kBaseDataValueSuffixLength = kSuffixReserveLength + kTimestampLength; ++ static const size_t kBaseDataValueSuffixLength = kSuffixReserveLength + kTimestampLength; + }; + + } // namespace storage +diff --git a/src/storage/src/redis.h b/src/storage/src/redis.h +index 93a52e0406..8d23a43118 100644 +--- a/src/storage/src/redis.h ++++ b/src/storage/src/redis.h +@@ -464,6 +464,8 @@ class Redis { + inline Status SetFirstOrLastID(const rocksdb::Slice& key, StreamMetaValue& stream_meta, bool is_set_first, + rocksdb::ReadOptions& read_options); + ++public: ++ inline rocksdb::WriteOptions GetDefaultWriteOptions() const { return default_write_options_; } + + private: + int32_t index_ = 0; +diff --git a/src/storage/src/storage.cc b/src/storage/src/storage.cc +index 173ecfb976..006a6d00fb 100644 +--- a/src/storage/src/storage.cc ++++ b/src/storage/src/storage.cc +@@ -89,6 +89,14 @@ static std::string AppendSubDirectory(const std::string& db_path, int index) { + } + } + ++std::vector Storage::GetHashCFHandles(const int idx) { ++ return insts_[idx]->GetHashCFHandles(); ++} ++ ++rocksdb::WriteOptions Storage::GetDefaultWriteOptions(const int idx) const { ++ return insts_[idx]->GetDefaultWriteOptions(); ++} ++ + Status Storage::Open(const StorageOptions& storage_options, const std::string& db_path) { + mkpath(db_path.c_str(), 0755);" +kubo,https://github.com/ipfs/kubo,c744981585519d632d4deb02a7cc0bc56370d2fa,Steven Allen,2021-04-14 01:15:15,fix(mkreleaselog): partially handle v2 modules,"We can now handle v2 modules that use tags, but not v2 modules that use +v2 sub-directories.","fix(mkreleaselog): partially handle v2 modules + +We can now handle v2 modules that use tags, but not v2 modules that use +v2 sub-directories.","diff --git a/bin/mkreleaselog b/bin/mkreleaselog +index 0588adaee24..bcc4f325513 100755 +--- a/bin/mkreleaselog ++++ b/bin/mkreleaselog +@@ -40,7 +40,8 @@ msg() { + } + + statlog() { +- local rpath=""$GOPATH/src/$1"" ++ local module=""$1"" ++ local rpath=""$GOPATH/src/$(strip_version ""$module"")"" + local start=""${2:-}"" + local end=""${3:-HEAD}"" + local mailmap_file=""$rpath/.mailmap"" +@@ -106,9 +107,10 @@ pr_link() { + release_log() { + setopt local_options BASH_REMATCH + +- local repo=""$1"" ++ local module=""$1"" + local start=""$2"" + local end=""${3:-HEAD}"" ++ local repo=""$(strip_version ""$1"")"" + local dir=""$GOPATH/src/$repo"" + + local commit pr +@@ -139,11 +141,11 @@ indent() { + } + + mod_deps() { +- go list -json -m all | jq 'select(.Version != null)' ++ go list -mod=mod -json -m all | jq 'select(.Version != null)' + } + + ensure() { +- local repo=""$1"" ++ local repo=""$(strip_version ""$1"")"" + local commit=""$2"" + local rpath=""$GOPATH/src/$repo"" + if [[ ! -d ""$rpath"" ]]; then +@@ -164,14 +166,23 @@ statsummary() { + jq '. + {Lines: (.Deletions + .Insertions)}' + } + ++strip_version() { ++ local repo=""$1"" ++ if [[ ""$repo"" =~ '.*/v[0-9]+$' ]]; then ++ repo=""$(dirname ""$repo"")"" ++ fi ++ echo ""$repo"" ++} ++ + recursive_release_log() { + local start=""${1:-$(git tag -l | sort -V | grep -v -- '-rc' | grep 'v'| tail -n1)}"" + local end=""${2:-$(git rev-parse HEAD)}"" + local repo_root=""$(git rev-parse --show-toplevel)"" +- local package=""$(cd ""$repo_root"" && go list)"" ++ local module=""$(go list -m)"" ++ local dir=""$(go list -m -f '{{.Dir}}')"" + +- if ! [[ ""${GOPATH}/${package}"" != ""${repo_root}"" ]]; then +- echo ""This script requires the target package and all dependencies to live in a GOPATH."" ++ if [[ ""${GOPATH}/${module}"" -ef ""${dir}"" ]]; then ++ echo ""This script requires the target module and all dependencies to live in a GOPATH."" + return 1 + fi + +@@ -191,28 +202,28 @@ recursive_release_log() { + + rm -f go.mod go.sum + +- printf -- ""Generating Changelog for %s %s..%s\n"" ""$package"" ""$start"" ""$end"" >&2 ++ printf -- ""Generating Changelog for %s %s..%s\n"" ""$module"" ""$start"" ""$end"" >&2 + +- printf -- ""- %s:\n"" ""$package"" +- release_log ""$package"" ""$start"" ""$end"" | indent ++ printf -- ""- %s:\n"" ""$module"" ++ release_log ""$module"" ""$start"" ""$end"" | indent + + +- statlog ""$package"" ""$start"" ""$end"" > statlog.json ++ statlog ""$module"" ""$start"" ""$end"" > statlog.json + + dep_changes old_deps.json new_deps.json | + jq --arg filter ""$REPO_FILTER"" 'select(.Path | match($filter))' | + # Compute changelogs + jq -r '""\(.Path) \(.New.Version) \(.New.Ref) \(.Old.Version) \(.Old.Ref // """")""' | +- while read repo new new_ref old old_ref; do +- if ! ensure ""$repo"" ""$new_ref""; then ++ while read module new new_ref old old_ref; do ++ if ! ensure ""$module"" ""$new_ref""; then + result=1 + local changelog=""failed to fetch repo"" + else +- statlog ""$repo"" ""$old_ref"" ""$new_ref"" >> statlog.json +- local changelog=""$(release_log ""$repo"" ""$old_ref"" ""$new_ref"")"" ++ statlog ""$module"" ""$old_ref"" ""$new_ref"" >> statlog.json ++ local changelog=""$(release_log ""$module"" ""$old_ref"" ""$new_ref"")"" + fi + if [[ -n ""$changelog"" ]]; then +- printf -- ""- %s (%s -> %s):\n"" ""$repo"" ""$old"" ""$new"" ++ printf -- ""- %s (%s -> %s):\n"" ""$module"" ""$old"" ""$new"" + echo ""$changelog"" | indent + fi + done" +prisma,https://github.com/prisma/prisma,aeb7255e179146c1596036c56d1578b84b0f2566,Florian Gößler,2025-03-18 20:01:09,"refactor: uplift migrations, views and typed-sql directory paths (#26631)","This PR is a follow up to https://github.com/prisma/prisma/pull/26596. +Here I refactor the path resolving logic for migrations, views and +typed-sql files to happen centrally. This removes the dependency on the +schema path in lower levels but also enables us to expose these paths in +config options later on.","refactor: uplift migrations, views and typed-sql directory paths (#26631) + +This PR is a follow up to https://github.com/prisma/prisma/pull/26596. +Here I refactor the path resolving logic for migrations, views and +typed-sql files to happen centrally. This removes the dependency on the +schema path in lower levels but also enables us to expose these paths in +config options later on.","diff --git a/packages/cli/src/Generate.ts b/packages/cli/src/Generate.ts +index 8fbf643b6d0a..435979b53461 100644 +--- a/packages/cli/src/Generate.ts ++++ b/packages/cli/src/Generate.ts +@@ -13,6 +13,7 @@ import { + getSchemaWithPath, + getSchemaWithPathOptional, + HelpError, ++ inferDirectoryConfig, + isError, + link, + loadEnvFile, +@@ -152,6 +153,7 @@ ${bold('Examples')} + + // Using typed sql requires env vars to be set during generate to connect to the database. Regular generate doesn't need that. + const schemaContext = await processSchemaResult({ schemaResult, ignoreEnvVarErrors: !args['--sql'] }) ++ const directoryConfig = inferDirectoryConfig(schemaContext) + + // TODO Extract logic from here + let hasJsClient +@@ -159,7 +161,7 @@ ${bold('Examples')} + let clientGeneratorVersion: string | null = null + let typedSql: SqlQueryOutput[] | undefined + if (args['--sql']) { +- typedSql = await introspectSql(schemaContext) ++ typedSql = await introspectSql(directoryConfig, schemaContext) + } + try { + generators = await getGenerators({ +@@ -313,7 +315,7 @@ Please run \`${getCommandWithExecutor('prisma generate')}\` to see the errors.`) + let generatorsWatch: Generator[] | undefined + try { + if (args['--sql']) { +- typedSql = await introspectSql(schemaContext) ++ typedSql = await introspectSql(directoryConfig, schemaContext) + } + + generatorsWatch = await getGenerators({ +diff --git a/packages/cli/src/generate/introspectSql.ts b/packages/cli/src/generate/introspectSql.ts +index 4cff8315c0fe..1c6558c0c170 100644 +--- a/packages/cli/src/generate/introspectSql.ts ++++ b/packages/cli/src/generate/introspectSql.ts +@@ -1,4 +1,4 @@ +-import { isValidJsIdentifier, SchemaContext } from '@prisma/internals' ++import { DirectoryConfig, isValidJsIdentifier, SchemaContext } from '@prisma/internals' + import { introspectSql as migrateIntrospectSql, IntrospectSqlError, IntrospectSqlInput } from '@prisma/migrate' + import fs from 'fs/promises' + import { bold } from 'kleur/colors' +@@ -6,8 +6,8 @@ import path from 'path' + + const SQL_DIR = 'sql' + +-export async function introspectSql(schemaContext: SchemaContext) { +- const sqlFiles = await readTypedSqlFiles(schemaContext.schemaRootDir) ++export async function introspectSql(directoryConfig: DirectoryConfig, schemaContext: SchemaContext) { ++ const sqlFiles = await readTypedSqlFiles(directoryConfig.typedSqlDirPath) + const introspectionResult = await migrateIntrospectSql(schemaContext, sqlFiles) + if (introspectionResult.ok) { + return introspectionResult.queries +@@ -19,23 +19,22 @@ export function sqlDirPath(schemaRootDir: string) { + return path.join(schemaRootDir, SQL_DIR) + } + +-async function readTypedSqlFiles(schemaRootDir: string): Promise { +- const sqlPath = sqlDirPath(schemaRootDir) // TODO:(schemaPath) uplift to schemaContext +- const files = await fs.readdir(sqlPath) ++async function readTypedSqlFiles(typedSqlDirPath: string): Promise { ++ const files = await fs.readdir(typedSqlDirPath) + const results: IntrospectSqlInput[] = [] + for (const fileName of files) { + const { name, ext } = path.parse(fileName) + if (ext !== '.sql') { + continue + } +- const absPath = path.join(sqlPath, fileName) ++ const absPath = path.join(typedSqlDirPath, fileName) + if (!isValidJsIdentifier(name)) { + throw new Error(`${absPath} can not be used as a typed sql query: name must be a valid JS identifier`) + } + if (name.startsWith('$')) { + throw new Error(`${absPath} can not be used as a typed sql query: name must not start with $`) + } +- const source = await fs.readFile(path.join(sqlPath, fileName), 'utf8') ++ const source = await fs.readFile(path.join(typedSqlDirPath, fileName), 'utf8') + results.push({ + name, + source, +diff --git a/packages/cli/src/utils/test-handlePanic.ts b/packages/cli/src/utils/test-handlePanic.ts +index be3f255cf520..c83871239ceb 100644 +--- a/packages/cli/src/utils/test-handlePanic.ts ++++ b/packages/cli/src/utils/test-handlePanic.ts +@@ -1,4 +1,4 @@ +-import { handlePanic, loadSchemaContext, toSchemasContainer } from '@prisma/internals' ++import { handlePanic, inferDirectoryConfig, loadSchemaContext, toSchemasContainer } from '@prisma/internals' + import { SchemaEngine } from '@prisma/migrate' + import path from 'path' + +@@ -13,11 +13,13 @@ async function main() { + process.chdir(dirPath) + + const schemaContext = await loadSchemaContext({ schemaPathFromArg: path.join(dirPath, 'schema.prisma') }) ++ const { viewsDirPath } = inferDirectoryConfig(schemaContext) + + const engine = new SchemaEngine({ schemaContext }) + + await engine.introspect({ + schema: toSchemasContainer(schemaContext.schemaFiles), ++ viewsDirectoryPath: viewsDirPath, + baseDirectoryPath: dirPath, + force: false, + }) +diff --git a/packages/client/tests/functional/_utils/setupTestSuiteClient.ts b/packages/client/tests/functional/_utils/setupTestSuiteClient.ts +index 855b12e58e3c..83a1f5aa48b4 100644 +--- a/packages/client/tests/functional/_utils/setupTestSuiteClient.ts ++++ b/packages/client/tests/functional/_utils/setupTestSuiteClient.ts +@@ -1,6 +1,6 @@ + import type { D1Database } from '@cloudflare/workers-types' + import { SqlQueryOutput } from '@prisma/generator-helper' +-import { getDMMF, parseEnvValue, processSchemaResult } from '@prisma/internals' ++import { getDMMF, inferDirectoryConfig, parseEnvValue, processSchemaResult } from '@prisma/internals' + import { readFile } from 'fs/promises' + import path from 'path' + import { fetch, WebSocket } from 'undici' +@@ -61,6 +61,7 @@ export async function setupTestSuiteClient({ + ignoreEnvVarErrors: true, + }) + const generator = schemaContext.generators.find((g) => parseEnvValue(g.provider) === 'prisma-client-js')! ++ const directoryConfig = inferDirectoryConfig(schemaContext) + const hasTypedSql = await testSuiteHasTypedSql(suiteMeta) + + await setupTestSuiteFiles({ suiteMeta, suiteConfig }) +@@ -80,7 +81,7 @@ export async function setupTestSuiteClient({ + // TypedSQL requires a connection to the database => ENV vars in the schema must be resolved for the test to work. + ignoreEnvVarErrors: false, + }) +- typedSql = await introspectSql(schemaContextIntrospect) ++ typedSql = await introspectSql(directoryConfig, schemaContextIntrospect) + } + + if (clientMeta.dataProxy === true) { +diff --git a/packages/internals/src/cli/directoryConfig.ts b/packages/internals/src/cli/directoryConfig.ts +new file mode 100644 +index 000000000000..128fcb32dd8c +--- /dev/null ++++ b/packages/internals/src/cli/directoryConfig.ts +@@ -0,0 +1,29 @@ ++import path from 'path' ++ ++import { SchemaContext } from './schemaContext' ++ ++export type DirectoryConfig = { ++ viewsDirPath: string ++ typedSqlDirPath: string ++ migrationsDirPath: string ++} ++ ++// TODO: Pass PrismaConfig as second argument to enable setting custom directory paths. See ORM-663 & ORM-664. ++export function inferDirectoryConfig(schemaContext?: SchemaContext | null): DirectoryConfig { ++ const rootDir = schemaContext?.schemaRootDir ?? path.join(process.cwd(), 'prisma') ++ ++ // If the schemaPath points to a file => place the migrations folder next to it. ++ // If the schemaPath points to a directory => also place the migrations folder next to it. NOT inside of it! ++ const migrationsDirPath = path.join(path.dirname(schemaContext?.schemaPath ?? process.cwd()), 'migrations') ++ ++ // TODO: for now simply ported the existing view folder logic here but did not refine it ++ const schemaPath = schemaContext?.schemaPath ?? path.join(process.cwd(), 'prisma') ++ const prismaDir = path.dirname(schemaPath) ++ const viewsDirPath = path.join(prismaDir, 'views') ++ ++ return { ++ viewsDirPath, ++ typedSqlDirPath: path.join(rootDir, 'sql'), ++ migrationsDirPath, ++ } ++} +diff --git a/packages/internals/src/cli/schemaContext.ts b/packages/internals/src/cli/schemaContext.ts +index 666a257baa12..e0a1eee93e8e 100644 +--- a/packages/internals/src/cli/schemaContext.ts ++++ b/packages/internals/src/cli/schemaContext.ts +@@ -102,15 +102,16 @@ export async function processSchemaResult({ + const configFromPsl = await getConfig({ datamodel: schemaResult.schemas, ignoreEnvVarErrors }) + + const primaryDatasource = configFromPsl.datasources.at(0) ++ const schemaRootDir = schemaResult.schemaRootDir || cwd + + return { + schemaFiles: schemaResult.schemas, + schemaPath: schemaResult.schemaPath, +- schemaRootDir: schemaResult.schemaRootDir || cwd, ++ schemaRootDir, + datasources: configFromPsl.datasources, + generators: configFromPsl.generators, + primaryDatasource, +- primaryDatasourceDirectory: primaryDatasourceDirectory(primaryDatasource) || schemaResult.schemaRootDir || cwd, ++ primaryDatasourceDirectory: primaryDatasourceDirectory(primaryDatasource) || schemaRootDir, + warnings: configFromPsl.warnings, + loadedFromPathForLogMessages, + } +diff --git a/packages/internals/src/index.ts b/packages/internals/src/index.ts +index 7264d81cdfe2..eb7e6640d8f1 100644 +--- a/packages/internals/src/index.ts ++++ b/packages/internals/src/index.ts +@@ -1,4 +1,5 @@ + export { checkUnsupportedDataProxy } from './cli/checkUnsupportedDataProxy' ++export { type DirectoryConfig, inferDirectoryConfig } from './cli/directoryConfig' + export { getGeneratorSuccessMessage } from './cli/getGeneratorSuccessMessage' + export { + getPrismaConfigFromPackageJson, +diff --git a/packages/migrate/src/Migrate.ts b/packages/migrate/src/Migrate.ts +index 310938a3fe91..0c707d112914 100644 +--- a/packages/migrate/src/Migrate.ts ++++ b/packages/migrate/src/Migrate.ts +@@ -9,7 +9,6 @@ import { + } from '@prisma/internals' + import { dim } from 'kleur/colors' + import logUpdate from 'log-update' +-import path from 'path' + + import { SchemaEngine } from './SchemaEngine' + import type { EngineArgs, EngineResults } from './types' +@@ -26,17 +25,15 @@ export class Migrate { + private schemaContext?: SchemaContext + public migrationsDirectoryPath?: string + +- constructor(schemaContext?: SchemaContext, enabledPreviewFeatures?: string[]) { ++ constructor(schemaContext?: SchemaContext, migrationsDirPath?: string, enabledPreviewFeatures?: string[]) { + // schemaPath and migrationsDirectoryPath is optional for primitives + // like migrate diff and db execute + if (schemaContext) { + this.schemaContext = schemaContext +- this.migrationsDirectoryPath = path.join(path.dirname(schemaContext.schemaPath), 'migrations') // TODO:(schemaPath) refactor in scope of ORM-663 ++ this.migrationsDirectoryPath = migrationsDirPath + this.engine = new SchemaEngine({ schemaContext, enabledPreviewFeatures }) + } else { +- this.engine = new SchemaEngine({ +- enabledPreviewFeatures, +- }) ++ this.engine = new SchemaEngine({ enabledPreviewFeatures }) + } + } + +diff --git a/packages/migrate/src/SchemaEngine.ts b/packages/migrate/src/SchemaEngine.ts +index 3b566f7faadb..6394bcd4b0b8 100644 +--- a/packages/migrate/src/SchemaEngine.ts ++++ b/packages/migrate/src/SchemaEngine.ts +@@ -1,5 +1,3 @@ +-import path from 'node:path' +- + import Debug from '@prisma/debug' + import { + BinaryType, +@@ -174,6 +172,7 @@ export class SchemaEngine { + schema, + force = false, + baseDirectoryPath, ++ viewsDirectoryPath, + compositeTypeDepth = -1, // cannot be undefined + namespaces, + }: EngineArgs.IntrospectParams): Promise { +@@ -187,8 +186,7 @@ export class SchemaEngine { + const { views } = introspectResult + + if (views) { +- const schemaPath = this.schemaContext?.schemaPath ?? path.join(process.cwd(), 'prisma') // TODO:(schemaPath) pass views directory from the top based on config - see ORM-664 +- await handleViewsIO({ views, schemaPath }) ++ await handleViewsIO({ views, viewsDirectoryPath }) + } + + return introspectResult +diff --git a/packages/migrate/src/__tests__/DbPull/postgresql-views.test.ts b/packages/migrate/src/__tests__/DbPull/postgresql-views.test.ts +index 937ddbf499bc..09c100cebc91 100644 +--- a/packages/migrate/src/__tests__/DbPull/postgresql-views.test.ts ++++ b/packages/migrate/src/__tests__/DbPull/postgresql-views.test.ts +@@ -100,6 +100,7 @@ describe('postgresql-views', () => { + + const introspectionResult = await engine.introspect({ + schema: toSchemasContainer(schemas), ++ viewsDirectoryPath: path.join(process.cwd(), 'prisma', 'views'), + baseDirectoryPath: ctx.tmpDir, + force: false, + }) +@@ -121,6 +122,7 @@ describe('postgresql-views', () => { + + const introspectionResult = await engine.introspect({ + schema: toSchemasContainer(schemas), ++ viewsDirectoryPath: path.join(process.cwd(), 'prisma', 'views'), + baseDirectoryPath: ctx.tmpDir, + force: false, + }) +@@ -147,6 +149,7 @@ describe('postgresql-views', () => { + + const introspectionResult = await engine.introspect({ + schema: toSchemasContainer(schemas), ++ viewsDirectoryPath: path.join(process.cwd(), 'views'), + baseDirectoryPath: ctx.tmpDir, + force: false, + }) +@@ -173,6 +176,7 @@ describe('postgresql-views', () => { + + const introspectionResult = await engine.introspect({ + schema: toSchemasContainer(schemas), ++ viewsDirectoryPath: path.join(process.cwd(), 'prisma', 'views'), + baseDirectoryPath: ctx.tmpDir, + force: false, + }) +diff --git a/packages/migrate/src/__tests__/handlePanic.migrate.test.ts b/packages/migrate/src/__tests__/handlePanic.migrate.test.ts +index c5825ee413a7..7ece5ab54835 100644 +--- a/packages/migrate/src/__tests__/handlePanic.migrate.test.ts ++++ b/packages/migrate/src/__tests__/handlePanic.migrate.test.ts +@@ -1,4 +1,4 @@ +-import { handlePanic, isCi, loadSchemaContext, RustPanic } from '@prisma/internals' ++import { handlePanic, inferDirectoryConfig, isCi, loadSchemaContext, RustPanic } from '@prisma/internals' + import fs from 'fs' + import { ensureDir } from 'fs-extra' + import { stdin } from 'mock-stdin' +@@ -91,12 +91,13 @@ describe('handlePanic migrate', () => { + await writeFiles(testRootDir, files) + + const schemaContext = await loadSchemaContext({ schemaPathFromArg: schemaPath }) ++ const { migrationsDirPath } = inferDirectoryConfig(schemaContext) + + captureStdout.startCapture() + + let error + try { +- const migrate = new Migrate(schemaContext) ++ const migrate = new Migrate(schemaContext, migrationsDirPath) + await migrate.createMigration({ + migrationsDirectoryPath: migrate.migrationsDirectoryPath!, + migrationName: 'setup', +@@ -155,9 +156,10 @@ describe('handlePanic migrate', () => { + const schemaPath = join(testRootDir, Object.keys(files)[0]) + await writeFiles(testRootDir, files) + const schemaContext = await loadSchemaContext({ schemaPathFromArg: schemaPath }) ++ const { migrationsDirPath } = inferDirectoryConfig(schemaContext) + + try { +- const migrate = new Migrate(schemaContext) ++ const migrate = new Migrate(schemaContext, migrationsDirPath) + await migrate.createMigration({ + migrationsDirectoryPath: migrate.migrationsDirectoryPath!, + migrationName: 'setup', +diff --git a/packages/migrate/src/__tests__/introspection/introspection.test.ts b/packages/migrate/src/__tests__/introspection/introspection.test.ts +index a9228054a4a7..4a1262ff43f0 100644 +--- a/packages/migrate/src/__tests__/introspection/introspection.test.ts ++++ b/packages/migrate/src/__tests__/introspection/introspection.test.ts +@@ -1,4 +1,4 @@ +-import { loadSchemaContext, toSchemasContainer } from '@prisma/internals' ++import { inferDirectoryConfig, loadSchemaContext, toSchemasContainer } from '@prisma/internals' + import fs from 'fs' + import path from 'path' + +@@ -7,6 +7,7 @@ import { SchemaEngine } from '../../SchemaEngine' + test('introspection basic', async () => { + const schemaPath = path.join(__dirname, 'schema.prisma') + const schemaContext = await loadSchemaContext({ schemaPathFromArg: schemaPath }) ++ const { viewsDirPath } = inferDirectoryConfig(schemaContext) + const engine = new SchemaEngine({ schemaContext }) + + const schemaContent = await fs.promises.readFile(schemaPath, { encoding: 'utf-8' }) +@@ -21,7 +22,11 @@ test('introspection basic', async () => { + }) + expect(dbVersion.length > 0).toBe(true) + +- const result = await engine.introspect({ schema, baseDirectoryPath: __dirname }) ++ const result = await engine.introspect({ ++ schema, ++ viewsDirectoryPath: viewsDirPath, ++ baseDirectoryPath: __dirname, ++ }) + expect(result).toMatchInlineSnapshot(` + { + ""schema"": { +diff --git a/packages/migrate/src/__tests__/rpc.test.ts b/packages/migrate/src/__tests__/rpc.test.ts +index 8efcbd2e390a..ec69078234c8 100644 +--- a/packages/migrate/src/__tests__/rpc.test.ts ++++ b/packages/migrate/src/__tests__/rpc.test.ts +@@ -1,5 +1,12 @@ + import { jestConsoleContext, jestContext } from '@prisma/get-platform' +-import { getSchema, getSchemaWithPath, loadSchemaContext, MultipleSchemas, toSchemasContainer } from '@prisma/internals' ++import { ++ getSchema, ++ getSchemaWithPath, ++ inferDirectoryConfig, ++ loadSchemaContext, ++ MultipleSchemas, ++ toSchemasContainer, ++} from '@prisma/internals' + import fs from 'fs-jetpack' + import path from 'path' + +@@ -12,7 +19,8 @@ describe('applyMigrations', () => { + it('should succeed', async () => { + ctx.fixture('existing-db-1-migration') + const schemaContext = await loadSchemaContext() +- const migrate = new Migrate(schemaContext) ++ const { migrationsDirPath } = inferDirectoryConfig(schemaContext) ++ const migrate = new Migrate(schemaContext, migrationsDirPath) + const migrationsList = await listMigrations(migrate.migrationsDirectoryPath!) + const result = migrate.engine.applyMigrations({ + migrationsList, +@@ -29,7 +37,8 @@ describe('applyMigrations', () => { + it('should fail on existing brownfield db', async () => { + ctx.fixture('existing-db-brownfield') + const schemaContext = await loadSchemaContext() +- const migrate = new Migrate(schemaContext) ++ const { migrationsDirPath } = inferDirectoryConfig(schemaContext) ++ const migrate = new Migrate(schemaContext, migrationsDirPath) + const migrationsList = await listMigrations(migrate.migrationsDirectoryPath!) + const result = migrate.engine.applyMigrations({ + migrationsList, +@@ -89,7 +98,8 @@ describe('createMigration', () => { + it('should succeed - existing-db-1-migration', async () => { + ctx.fixture('schema-only-sqlite') + const schemaContext = await loadSchemaContext() +- const migrate = new Migrate(schemaContext) ++ const { migrationsDirPath } = inferDirectoryConfig(schemaContext) ++ const migrate = new Migrate(schemaContext, migrationsDirPath) + const result = migrate.createMigration({ + migrationName: 'my_migration', + draft: false, +@@ -107,7 +117,8 @@ describe('createMigration', () => { + it('draft should succeed - existing-db-1-migration', async () => { + ctx.fixture('existing-db-1-migration') + const schemaContext = await loadSchemaContext() +- const migrate = new Migrate(schemaContext) ++ const { migrationsDirPath } = inferDirectoryConfig(schemaContext) ++ const migrate = new Migrate(schemaContext, migrationsDirPath) + const result = migrate.createMigration({ + migrationName: 'draft_123', + draft: true, +@@ -146,7 +157,8 @@ describe('devDiagnostic', () => { + it('createMigration', async () => { + ctx.fixture('schema-only-sqlite') + const schemaContext = await loadSchemaContext() +- const migrate = new Migrate(schemaContext) ++ const { migrationsDirPath } = inferDirectoryConfig(schemaContext) ++ const migrate = new Migrate(schemaContext, migrationsDirPath) + const migrationsList = await listMigrations(migrate.migrationsDirectoryPath!) + const result = migrate.engine.devDiagnostic({ + migrationsList, +@@ -165,7 +177,8 @@ describe('devDiagnostic', () => { + it('reset because drift', async () => { + ctx.fixture('existing-db-1-migration-conflict') + const schemaContext = await loadSchemaContext() +- const migrate = new Migrate(schemaContext) ++ const { migrationsDirPath } = inferDirectoryConfig(schemaContext) ++ const migrate = new Migrate(schemaContext, migrationsDirPath) + const migrationsList = await listMigrations(migrate.migrationsDirectoryPath!) + const result = migrate.engine.devDiagnostic({ + migrationsList, +@@ -199,7 +212,8 @@ describe('diagnoseMigrationHistory', () => { + it('optInToShadowDatabase true should succeed - existing-db-1-migration', async () => { + ctx.fixture('existing-db-1-migration') + const schemaContext = await loadSchemaContext() +- const migrate = new Migrate(schemaContext) ++ const { migrationsDirPath } = inferDirectoryConfig(schemaContext) ++ const migrate = new Migrate(schemaContext, migrationsDirPath) + const migrationsList = await listMigrations(migrate.migrationsDirectoryPath!) + const result = migrate.engine.diagnoseMigrationHistory({ + migrationsList, +@@ -220,7 +234,8 @@ describe('diagnoseMigrationHistory', () => { + it(' optInToShadowDatabase false should succeed - existing-db-1-migration', async () => { + ctx.fixture('existing-db-1-migration') + const schemaContext = await loadSchemaContext() +- const migrate = new Migrate(schemaContext) ++ const { migrationsDirPath } = inferDirectoryConfig(schemaContext) ++ const migrate = new Migrate(schemaContext, migrationsDirPath) + const migrationsList = await listMigrations(migrate.migrationsDirectoryPath!) + const result = migrate.engine.diagnoseMigrationHistory({ + migrationsList, +@@ -258,7 +273,8 @@ describe('ensureConnectionValidity', () => { + it('should succeed when database exists - PostgreSQL', async () => { + ctx.fixture('schema-only') + const schemaContext = await loadSchemaContext() +- const migrate = new Migrate(schemaContext) ++ const { migrationsDirPath } = inferDirectoryConfig(schemaContext) ++ const migrate = new Migrate(schemaContext, migrationsDirPath) + const result = migrate.engine.ensureConnectionValidity({ + datasource: { + tag: 'Schema', +@@ -318,7 +334,8 @@ describe('evaluateDataLoss', () => { + it('should succeed - schema-only-sqlite', async () => { + ctx.fixture('schema-only-sqlite') + const schemaContext = await loadSchemaContext() +- const migrate = new Migrate(schemaContext) ++ const { migrationsDirPath } = inferDirectoryConfig(schemaContext) ++ const migrate = new Migrate(schemaContext, migrationsDirPath) + const migrationsList = await listMigrations(migrate.migrationsDirectoryPath!) + const result = migrate.engine.evaluateDataLoss({ + migrationsList, +@@ -339,7 +356,8 @@ describe('evaluateDataLoss', () => { + it('should succeed - existing-db-1-migration', async () => { + ctx.fixture('existing-db-1-migration') + const schemaContext = await loadSchemaContext() +- const migrate = new Migrate(schemaContext) ++ const { migrationsDirPath } = inferDirectoryConfig(schemaContext) ++ const migrate = new Migrate(schemaContext, migrationsDirPath) + const migrationsList = await listMigrations(migrate.migrationsDirectoryPath!) + const result = migrate.engine.evaluateDataLoss({ + migrationsList, +@@ -361,7 +379,8 @@ describe('getDatabaseVersion - PostgreSQL', () => { + it('[No params] should succeed', async () => { + ctx.fixture('schema-only') + const schemaContext = await loadSchemaContext() +- const migrate = new Migrate(schemaContext) ++ const { migrationsDirPath } = inferDirectoryConfig(schemaContext) ++ const migrate = new Migrate(schemaContext, migrationsDirPath) + const result = migrate.engine.getDatabaseVersion() + await expect(result).resolves.toContain('PostgreSQL') + migrate.stop() +@@ -400,7 +419,8 @@ describe('markMigrationRolledBack', () => { + ctx.fixture('existing-db-1-migration') + + const schemaContext = await loadSchemaContext() +- const migrate = new Migrate(schemaContext) ++ const { migrationsDirPath } = inferDirectoryConfig(schemaContext) ++ const migrate = new Migrate(schemaContext, migrationsDirPath) + + const resultMarkRolledBacked = migrate.engine.markMigrationRolledBack({ + migrationName: '20201014154943_init', +@@ -419,7 +439,8 @@ describe('markMigrationRolledBack', () => { + it('existing-db-1-migration', async () => { + ctx.fixture('existing-db-1-migration') + const schemaContext = await loadSchemaContext() +- const migrate = new Migrate(schemaContext) ++ const { migrationsDirPath } = inferDirectoryConfig(schemaContext) ++ const migrate = new Migrate(schemaContext, migrationsDirPath) + const result = await migrate.createMigration({ + migrationName: 'draft_123', + draft: true, +@@ -481,7 +502,8 @@ describe('markMigrationApplied', () => { + it('existing-db-1-migration', async () => { + ctx.fixture('existing-db-1-migration') + const schemaContext = await loadSchemaContext() +- const migrate = new Migrate(schemaContext) ++ const { migrationsDirPath } = inferDirectoryConfig(schemaContext) ++ const migrate = new Migrate(schemaContext, migrationsDirPath) + const result = await migrate.createMigration({ + migrationName: 'draft_123', + draft: true, +@@ -512,7 +534,8 @@ describe('schemaPush', () => { + it('should succeed if SQLite database file is missing', async () => { + ctx.fixture('schema-only-sqlite') + const schemaContext = await loadSchemaContext() +- const migrate = new Migrate(schemaContext) ++ const { migrationsDirPath } = inferDirectoryConfig(schemaContext) ++ const migrate = new Migrate(schemaContext, migrationsDirPath) + const result = migrate.engine.schemaPush({ + force: false, + schema: toSchemasContainer(schemaContext.schemaFiles), +@@ -531,7 +554,8 @@ describe('schemaPush', () => { + it('should succeed without warning', async () => { + ctx.fixture('existing-db-1-draft') + const schemaContext = await loadSchemaContext() +- const migrate = new Migrate(schemaContext) ++ const { migrationsDirPath } = inferDirectoryConfig(schemaContext) ++ const migrate = new Migrate(schemaContext, migrationsDirPath) + const result = migrate.engine.schemaPush({ + force: false, + schema: toSchemasContainer(schemaContext.schemaFiles), +@@ -550,7 +574,8 @@ describe('schemaPush', () => { + it('should return executedSteps 0 with warning if dataloss detected', async () => { + ctx.fixture('existing-db-brownfield') + const schemaContext = await loadSchemaContext() +- const migrate = new Migrate(schemaContext) ++ const { migrationsDirPath } = inferDirectoryConfig(schemaContext) ++ const migrate = new Migrate(schemaContext, migrationsDirPath) + const result = migrate.engine.schemaPush({ + force: false, + schema: toSchemasContainer(replaceInSchemas(schemaContext.schemaFiles, 'Blog', 'Something')), +@@ -571,7 +596,8 @@ describe('schemaPush', () => { + it('force should accept dataloss', async () => { + ctx.fixture('existing-db-brownfield') + const schemaContext = await loadSchemaContext() +- const migrate = new Migrate(schemaContext) ++ const { migrationsDirPath } = inferDirectoryConfig(schemaContext) ++ const migrate = new Migrate(schemaContext, migrationsDirPath) + const result = migrate.engine.schemaPush({ + force: true, + schema: toSchemasContainer(replaceInSchemas(schemaContext.schemaFiles, 'Blog', 'Something')), +diff --git a/packages/migrate/src/commands/DbPull.ts b/packages/migrate/src/commands/DbPull.ts +index 8465ffa41860..6ce6f5fb3664 100644 +--- a/packages/migrate/src/commands/DbPull.ts ++++ b/packages/migrate/src/commands/DbPull.ts +@@ -9,6 +9,7 @@ import { + getCommandWithExecutor, + getConfig, + HelpError, ++ inferDirectoryConfig, + link, + loadEnvFile, + loadSchemaContext, +@@ -313,9 +314,11 @@ Some information will be lost (relations, comments, mapped fields, @ignore...), + let introspectionSchema: MigrateTypes.SchemasContainer | undefined = undefined + let introspectionWarnings: EngineArgs.IntrospectResult['warnings'] + try { ++ const directoryConfig = inferDirectoryConfig(schemaContext) + const introspectionResult = await engine.introspect({ + schema: toSchemasContainer(schema), + baseDirectoryPath: schemaContext?.schemaRootDir ?? process.cwd(), ++ viewsDirectoryPath: directoryConfig.viewsDirPath, + force: args['--force'], + compositeTypeDepth: args['--composite-type-depth'], + namespaces: args['--schemas']?.split(','), +diff --git a/packages/migrate/src/commands/DbPush.ts b/packages/migrate/src/commands/DbPush.ts +index 3c1bb1fdc14c..b4faec756fcc 100644 +--- a/packages/migrate/src/commands/DbPush.ts ++++ b/packages/migrate/src/commands/DbPush.ts +@@ -8,6 +8,7 @@ import { + formatms, + getCommandWithExecutor, + HelpError, ++ inferDirectoryConfig, + isError, + loadEnvFile, + loadSchemaContext, +@@ -85,13 +86,14 @@ ${bold('Examples')} + schemaPathFromArg: args['--schema'], + schemaPathFromConfig: config.schema, + }) ++ const { migrationsDirPath } = inferDirectoryConfig(schemaContext) + + checkUnsupportedDataProxy({ cmd: 'db push', schemaContext }) + + const datasourceInfo = parseDatasourceInfo(schemaContext.primaryDatasource) + printDatasource({ datasourceInfo }) + +- const migrate = new Migrate(schemaContext) ++ const migrate = new Migrate(schemaContext, migrationsDirPath) + + try { + // Automatically create the database if it doesn't exist +diff --git a/packages/migrate/src/commands/MigrateDeploy.ts b/packages/migrate/src/commands/MigrateDeploy.ts +index f63f747eda50..a1ad0fdc7741 100644 +--- a/packages/migrate/src/commands/MigrateDeploy.ts ++++ b/packages/migrate/src/commands/MigrateDeploy.ts +@@ -6,6 +6,7 @@ import { + Command, + format, + HelpError, ++ inferDirectoryConfig, + isError, + loadEnvFile, + loadSchemaContext, +@@ -74,12 +75,13 @@ ${bold('Examples')} + schemaPathFromArg: args['--schema'], + schemaPathFromConfig: config.schema, + }) ++ const { migrationsDirPath } = inferDirectoryConfig(schemaContext) + + checkUnsupportedDataProxy({ cmd: 'migrate deploy', schemaContext }) + + printDatasource({ datasourceInfo: parseDatasourceInfo(schemaContext.primaryDatasource) }) + +- const migrate = new Migrate(schemaContext) ++ const migrate = new Migrate(schemaContext, migrationsDirPath) + + try { + // Automatically create the database if it doesn't exist +diff --git a/packages/migrate/src/commands/MigrateDev.ts b/packages/migrate/src/commands/MigrateDev.ts +index 92dd8131f52d..0610fa486e9f 100644 +--- a/packages/migrate/src/commands/MigrateDev.ts ++++ b/packages/migrate/src/commands/MigrateDev.ts +@@ -8,6 +8,7 @@ import { + format, + getCommandWithExecutor, + HelpError, ++ inferDirectoryConfig, + isError, + loadEnvFile, + loadSchemaContext, +@@ -97,6 +98,7 @@ ${bold('Examples')} + schemaPathFromArg: args['--schema'], + schemaPathFromConfig: config.schema, + }) ++ const { migrationsDirPath } = inferDirectoryConfig(schemaContext) + + checkUnsupportedDataProxy({ cmd: 'migrate dev', schemaContext }) + +@@ -114,7 +116,7 @@ ${bold('Examples')} + process.stdout.write(wasDbCreated + '\n\n') + } + +- const migrate = new Migrate(schemaContext) ++ const migrate = new Migrate(schemaContext, migrationsDirPath) + + let devDiagnostic: EngineResults.DevDiagnosticOutput + try { +diff --git a/packages/migrate/src/commands/MigrateReset.ts b/packages/migrate/src/commands/MigrateReset.ts +index d14eccbe3eee..cc9b1e755ccc 100644 +--- a/packages/migrate/src/commands/MigrateReset.ts ++++ b/packages/migrate/src/commands/MigrateReset.ts +@@ -6,6 +6,7 @@ import { + Command, + format, + HelpError, ++ inferDirectoryConfig, + isError, + loadEnvFile, + loadSchemaContext, +@@ -80,6 +81,7 @@ ${bold('Examples')} + schemaPathFromArg: args['--schema'], + schemaPathFromConfig: config.schema, + }) ++ const { migrationsDirPath } = inferDirectoryConfig(schemaContext) + const datasourceInfo = parseDatasourceInfo(schemaContext.primaryDatasource) + printDatasource({ datasourceInfo }) + +@@ -112,7 +114,7 @@ ${bold('Examples')} + } + } + +- const migrate = new Migrate(schemaContext) ++ const migrate = new Migrate(schemaContext, migrationsDirPath) + + let migrationIds: string[] + try { +diff --git a/packages/migrate/src/commands/MigrateResolve.ts b/packages/migrate/src/commands/MigrateResolve.ts +index 63864680eab2..e300109727be 100644 +--- a/packages/migrate/src/commands/MigrateResolve.ts ++++ b/packages/migrate/src/commands/MigrateResolve.ts +@@ -6,6 +6,7 @@ import { + format, + getCommandWithExecutor, + HelpError, ++ inferDirectoryConfig, + isError, + link, + loadEnvFile, +@@ -85,6 +86,7 @@ ${bold('Examples')} + schemaPathFromArg: args['--schema'], + schemaPathFromConfig: config.schema, + }) ++ const { migrationsDirPath } = inferDirectoryConfig(schemaContext) + + checkUnsupportedDataProxy({ cmd: 'migrate resolve', schemaContext }) + +@@ -114,7 +116,7 @@ ${bold(green(getCommandWithExecutor('prisma migrate resolve --rolled-back 202012 + + await ensureCanConnectToDatabase(schemaContext.primaryDatasource) + +- const migrate = new Migrate(schemaContext) ++ const migrate = new Migrate(schemaContext, migrationsDirPath) + try { + await migrate.markMigrationApplied({ + migrationId: args['--applied'], +@@ -136,7 +138,7 @@ ${bold(green(getCommandWithExecutor('prisma migrate resolve --rolled-back 202012 + + await ensureCanConnectToDatabase(schemaContext.primaryDatasource) + +- const migrate = new Migrate(schemaContext) ++ const migrate = new Migrate(schemaContext, migrationsDirPath) + try { + await migrate.markMigrationRolledBack({ + migrationId: args['--rolled-back'], +diff --git a/packages/migrate/src/commands/MigrateStatus.ts b/packages/migrate/src/commands/MigrateStatus.ts +index f2161aa746ec..8ed3ad276383 100644 +--- a/packages/migrate/src/commands/MigrateStatus.ts ++++ b/packages/migrate/src/commands/MigrateStatus.ts +@@ -7,6 +7,7 @@ import { + format, + getCommandWithExecutor, + HelpError, ++ inferDirectoryConfig, + isError, + link, + loadEnvFile, +@@ -75,12 +76,13 @@ Check the status of your database migrations + schemaPathFromArg: args['--schema'], + schemaPathFromConfig: config.schema, + }) ++ const { migrationsDirPath } = inferDirectoryConfig(schemaContext) + + checkUnsupportedDataProxy({ cmd: 'migrate status', schemaContext }) + + printDatasource({ datasourceInfo: parseDatasourceInfo(schemaContext.primaryDatasource) }) + +- const migrate = new Migrate(schemaContext) ++ const migrate = new Migrate(schemaContext, migrationsDirPath) + + await ensureCanConnectToDatabase(schemaContext.primaryDatasource) + +diff --git a/packages/migrate/src/types.ts b/packages/migrate/src/types.ts +index a447a2d4f8ba..a3bb860b4b5e 100644 +--- a/packages/migrate/src/types.ts ++++ b/packages/migrate/src/types.ts +@@ -123,6 +123,7 @@ export namespace EngineArgs { + export interface IntrospectParams { + schema: MigrateTypes.SchemasContainer + baseDirectoryPath: string ++ viewsDirectoryPath: string + force?: Boolean + + // Note: this must be a non-negative integer +diff --git a/packages/migrate/src/views/handleViewsIO.ts b/packages/migrate/src/views/handleViewsIO.ts +index e0f433ee4ef6..22742f89a51a 100644 +--- a/packages/migrate/src/views/handleViewsIO.ts ++++ b/packages/migrate/src/views/handleViewsIO.ts +@@ -19,7 +19,7 @@ export interface IntrospectionViewDefinition { + + type HandleViewsIOParams = { + views: IntrospectionViewDefinition[] +- schemaPath: string ++ viewsDirectoryPath: string + } + + /** +@@ -28,17 +28,15 @@ type HandleViewsIOParams = { + * If some other non "".sql"" files or folders exist within the `views` directory, the CLI must preserve them. + * In case of empty folders, these are deleted silently. + */ +-export async function handleViewsIO({ views, schemaPath }: HandleViewsIOParams): Promise { +- const prismaDir = path.dirname(pathToPosix(schemaPath)) +- const viewsDir = path.posix.join(prismaDir, 'views') +- ++export async function handleViewsIO({ views, viewsDirectoryPath }: HandleViewsIOParams): Promise { ++ const posixViewsDirectoryPath = pathToPosix(viewsDirectoryPath) + if (views.length === 0) { +- await cleanLeftoversIO(viewsDir) ++ await cleanLeftoversIO(posixViewsDirectoryPath) + return + } + +- const { viewFilesToKeep } = await createViewsIO(viewsDir, views) +- await cleanLeftoversIO(viewsDir, viewFilesToKeep) ++ const { viewFilesToKeep } = await createViewsIO(posixViewsDirectoryPath, views) ++ await cleanLeftoversIO(posixViewsDirectoryPath, viewFilesToKeep) + } + + async function createViewsIO(" +prettier,https://github.com/prettier/prettier,4d58724016186d0a3eff235db5459d1e966b1d3f,dependabot[bot],2021-01-25 20:48:47,Build(deps): Bump @glimmer/syntax from 0.73.1 to 0.73.2 (#10103),"Bumps [@glimmer/syntax](https://github.com/glimmerjs/glimmer-vm) from 0.73.1 to 0.73.2. +- [Release notes](https://github.com/glimmerjs/glimmer-vm/releases) +- [Changelog](https://github.com/glimmerjs/glimmer-vm/blob/master/CHANGELOG.md) +- [Commits](https://github.com/glimmerjs/glimmer-vm/compare/v0.73.1...v0.73.2)","Build(deps): Bump @glimmer/syntax from 0.73.1 to 0.73.2 (#10103) + +Bumps [@glimmer/syntax](https://github.com/glimmerjs/glimmer-vm) from 0.73.1 to 0.73.2. +- [Release notes](https://github.com/glimmerjs/glimmer-vm/releases) +- [Changelog](https://github.com/glimmerjs/glimmer-vm/blob/master/CHANGELOG.md) +- [Commits](https://github.com/glimmerjs/glimmer-vm/compare/v0.73.1...v0.73.2) + +Signed-off-by: dependabot[bot] + +Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>","diff --git a/package.json b/package.json +index 6c8b2032e4ff..4504138cd75a 100644 +--- a/package.json ++++ b/package.json +@@ -23,7 +23,7 @@ + ""@angular/compiler"": ""11.1.0"", + ""@babel/code-frame"": ""7.12.11"", + ""@babel/parser"": ""7.12.11"", +- ""@glimmer/syntax"": ""0.73.1"", ++ ""@glimmer/syntax"": ""0.73.2"", + ""@iarna/toml"": ""2.2.5"", + ""@typescript-eslint/typescript-estree"": ""4.14.0"", + ""angular-estree-parser"": ""2.3.0"", +diff --git a/yarn.lock b/yarn.lock +index 9d7bda27dc3b..8594eb855a1b 100644 +--- a/yarn.lock ++++ b/yarn.lock +@@ -1064,13 +1064,6 @@ + dependencies: + ""@glimmer/env"" ""^0.1.7"" + +-""@glimmer/interfaces@0.73.1"": +- version ""0.73.1"" +- resolved ""https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.73.1.tgz#ad1dffb635c19b66230c45894e15f3a34d90e5b0"" +- integrity sha512-MttMIyWGZ+IbiJJpr4q9dwMmn+7eOMdxjMiuaEYeLBN/DXe8T9VePqgapURkSL9CEmKByB/pLvcaVTSYfm0RYg== +- dependencies: +- ""@simple-dom/interface"" ""^1.4.0"" +- + ""@glimmer/interfaces@0.73.2"": + version ""0.73.2"" + resolved ""https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.73.2.tgz#03c769208bf705760800f3f64774b074bf04f738"" +@@ -1089,25 +1082,16 @@ + ""@glimmer/util"" ""0.73.2"" + ""@glimmer/validator"" ""0.73.2"" + +-""@glimmer/syntax@0.73.1"": +- version ""0.73.1"" +- resolved ""https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.73.1.tgz#9e3c898ba91ddb1d4e6f413452b0b84700910c83"" +- integrity sha512-TpTK9yAaoDOzdo+5itoJPRxrVWacYlGuHtJvATi96RJUTAxPz9b9M3AcVm0atcZW7WiA8X8J/weQ2KcIVgAYmw== ++""@glimmer/syntax@0.73.2"": ++ version ""0.73.2"" ++ resolved ""https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.73.2.tgz#76438633f26b3fccb86bd7d25390a901737aa530"" ++ integrity sha512-neZvKpfJETtUxnZMdpmD9qi4E9WaKhnQt63H+0iHkz1APriIZM5rsq12oiG9MSCvEiF5iP3auwJMU22XKPtyeQ== + dependencies: +- ""@glimmer/interfaces"" ""0.73.1"" +- ""@glimmer/util"" ""0.73.1"" ++ ""@glimmer/interfaces"" ""0.73.2"" ++ ""@glimmer/util"" ""0.73.2"" + ""@handlebars/parser"" ""^2.0.0"" + simple-html-tokenizer ""^0.5.10"" + +-""@glimmer/util@0.73.1"": +- version ""0.73.1"" +- resolved ""https://registry.yarnpkg.com/@glimmer/util/-/util-0.73.1.tgz#f89bb7adba18315e00fbdb5a7c5a4913bbdebc6e"" +- integrity sha512-zFXY9OgR6wx7Cy4yYJkmgoUsdx3MQYAmZytuEDTghLXJyUoSh5Jcvner+qhFkqLSzj2pvE4btn3yUNnx3QOBtg== +- dependencies: +- ""@glimmer/env"" ""0.1.7"" +- ""@glimmer/interfaces"" ""0.73.1"" +- ""@simple-dom/interface"" ""^1.4.0"" +- + ""@glimmer/util@0.73.2"": + version ""0.73.2"" + resolved ""https://registry.yarnpkg.com/@glimmer/util/-/util-0.73.2.tgz#32ca1cec339a91f12f0359711f1a86fc1dcc13ca""" +core,https://github.com/stenciljs/core,e72da1327ab7b94ec6f59f1ef44824bdfd2d1089,dependabot[bot],2023-04-13 17:30:11,chore(deps): bump actions/checkout from 3.5.0 to 3.5.1 (#4262),"Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.0 to 3.5.1. +- [Release notes](https://github.com/actions/checkout/releases) +- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) +- [Commits](https://github.com/actions/checkout/compare/8f4b7f84864484a7bf31766abe9204da3cbe65b3...83b7061638ee4956cf7545a6f7efe594e5ad0247) + +---","chore(deps): bump actions/checkout from 3.5.0 to 3.5.1 (#4262) + +Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.0 to 3.5.1. +- [Release notes](https://github.com/actions/checkout/releases) +- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) +- [Commits](https://github.com/actions/checkout/compare/8f4b7f84864484a7bf31766abe9204da3cbe65b3...83b7061638ee4956cf7545a6f7efe594e5ad0247) + +--- +updated-dependencies: +- dependency-name: actions/checkout + dependency-type: direct:production + update-type: version-update:semver-patch +... + +Signed-off-by: dependabot[bot] +Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>","diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml +index 308ddcd0606..0bb9d5ee868 100644 +--- a/.github/workflows/build.yml ++++ b/.github/workflows/build.yml +@@ -11,7 +11,7 @@ jobs: + runs-on: 'ubuntu-20.04' + steps: + - name: Checkout Code +- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 ++ uses: actions/checkout@83b7061638ee4956cf7545a6f7efe594e5ad0247 # v3.5.1 + with: + # the pull_request_target event will consider the HEAD of `main` to be the SHA to use. + # attempt to use the SHA associated with a pull request and fallback to HEAD of `main` +diff --git a/.github/workflows/lint-and-format.yml b/.github/workflows/lint-and-format.yml +index 4cb2a6e8962..86c8c85d174 100644 +--- a/.github/workflows/lint-and-format.yml ++++ b/.github/workflows/lint-and-format.yml +@@ -11,7 +11,7 @@ jobs: + runs-on: 'ubuntu-20.04' + steps: + - name: Checkout Code +- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 ++ uses: actions/checkout@83b7061638ee4956cf7545a6f7efe594e5ad0247 # v3.5.1 + + - name: Get Core Dependencies + uses: ./.github/workflows/actions/get-core-dependencies +diff --git a/.github/workflows/pr-assign.yml b/.github/workflows/pr-assign.yml +index 76b2b2d1dc7..70786995907 100644 +--- a/.github/workflows/pr-assign.yml ++++ b/.github/workflows/pr-assign.yml +@@ -9,7 +9,7 @@ jobs: + runs-on: ubuntu-latest + if: ${{ !github.event.pull_request.draft && github.event.pull_request.user.type != 'Bot' }} + steps: +- - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 ++ - uses: actions/checkout@83b7061638ee4956cf7545a6f7efe594e5ad0247 # v3.5.1 + - uses: ./.github/workflows/actions/auto-request-reviews + with: + orgReadToken: ${{ secrets.READORG_GITHUB_TOKEN }} +diff --git a/.github/workflows/release-dev.yml b/.github/workflows/release-dev.yml +index bfb2e154471..826847cd183 100644 +--- a/.github/workflows/release-dev.yml ++++ b/.github/workflows/release-dev.yml +@@ -18,7 +18,7 @@ jobs: + dev-version: ${{ steps.get-dev-version.outputs.DEV_VERSION }} + steps: + - name: Checkout Code +- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 ++ uses: actions/checkout@83b7061638ee4956cf7545a6f7efe594e5ad0247 # v3.5.1 + + - name: Get Core Dependencies + uses: ./.github/workflows/actions/get-core-dependencies +@@ -53,7 +53,7 @@ jobs: + runs-on: ubuntu-20.04 + steps: + - name: Checkout Code +- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 ++ uses: actions/checkout@83b7061638ee4956cf7545a6f7efe594e5ad0247 # v3.5.1 + - uses: ./.github/workflows/actions/publish-npm + with: + tag: dev +diff --git a/.github/workflows/release-nightly.yml b/.github/workflows/release-nightly.yml +index d7c59c5ad5a..607201264ac 100644 +--- a/.github/workflows/release-nightly.yml ++++ b/.github/workflows/release-nightly.yml +@@ -20,7 +20,7 @@ jobs: + nightly-version: ${{ steps.get-nightly-version.outputs.NIGHTLY_VERSION }} + steps: + - name: Checkout Code +- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 ++ uses: actions/checkout@83b7061638ee4956cf7545a6f7efe594e5ad0247 # v3.5.1 + + - name: Get Core Dependencies + uses: ./.github/workflows/actions/get-core-dependencies +@@ -58,7 +58,7 @@ jobs: + runs-on: ubuntu-20.04 + steps: + - name: Checkout Code +- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 ++ uses: actions/checkout@83b7061638ee4956cf7545a6f7efe594e5ad0247 # v3.5.1 + - uses: ./.github/workflows/actions/publish-npm + with: + tag: nightly +diff --git a/.github/workflows/tech-debt-burndown.yml b/.github/workflows/tech-debt-burndown.yml +index a99c36b0f4e..c533b853f1f 100644 +--- a/.github/workflows/tech-debt-burndown.yml ++++ b/.github/workflows/tech-debt-burndown.yml +@@ -20,13 +20,13 @@ jobs: + runs-on: 'ubuntu-20.04' + steps: + - name: Checkout main +- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 ++ uses: actions/checkout@83b7061638ee4956cf7545a6f7efe594e5ad0247 # v3.5.1 + with: + ref: main + if: ${{ matrix.branch == 'main' }} + + - name: Checkout PR branch +- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 ++ uses: actions/checkout@83b7061638ee4956cf7545a6f7efe594e5ad0247 # v3.5.1 + with: + # the pull_request_target event will consider the HEAD of `main` to be the SHA to use. + # attempt to use the SHA associated with a pull request and fallback to HEAD of `main` +@@ -58,13 +58,13 @@ jobs: + runs-on: 'ubuntu-20.04' + steps: + - name: Checkout main +- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 ++ uses: actions/checkout@83b7061638ee4956cf7545a6f7efe594e5ad0247 # v3.5.1 + with: + ref: main + if: ${{ matrix.branch == 'main' }} + + - name: Checkout PR branch +- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 ++ uses: actions/checkout@83b7061638ee4956cf7545a6f7efe594e5ad0247 # v3.5.1 + with: + # the pull_request_target event will consider the HEAD of `main` to be the SHA to use. + # attempt to use the SHA associated with a pull request and fallback to HEAD of `main` +@@ -90,7 +90,7 @@ jobs: + runs-on: 'ubuntu-20.04' + steps: + - name: Checkout current branch +- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 ++ uses: actions/checkout@83b7061638ee4956cf7545a6f7efe594e5ad0247 # v3.5.1 + with: + # the pull_request_target event will consider the HEAD of `main` to be the SHA to use. + # attempt to use the SHA associated with a pull request and fallback to HEAD of `main` +diff --git a/.github/workflows/test-analysis.yml b/.github/workflows/test-analysis.yml +index 76a2791a2e0..efe82302d96 100644 +--- a/.github/workflows/test-analysis.yml ++++ b/.github/workflows/test-analysis.yml +@@ -16,7 +16,7 @@ jobs: + runs-on: ${{ matrix.os }} + steps: + - name: Checkout Code +- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 ++ uses: actions/checkout@83b7061638ee4956cf7545a6f7efe594e5ad0247 # v3.5.1 + + - name: Get Core Dependencies + uses: ./.github/workflows/actions/get-core-dependencies +diff --git a/.github/workflows/test-browserstack.yml b/.github/workflows/test-browserstack.yml +index 8afbbbde6aa..0b701b3a055 100644 +--- a/.github/workflows/test-browserstack.yml ++++ b/.github/workflows/test-browserstack.yml +@@ -50,7 +50,7 @@ jobs: + # GitHub Actions 'concurrency' field as means to block the job until no other tests are running. + concurrency: run_browserstack_queue + steps: +- - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 ++ - uses: actions/checkout@83b7061638ee4956cf7545a6f7efe594e5ad0247 # v3.5.1 + with: + ref: ${{ github.event_name == 'pull_request_target' && format('refs/pull/{0}/merge', github.event.number) || '' }} + persist-credentials: false +diff --git a/.github/workflows/test-bundlers.yml b/.github/workflows/test-bundlers.yml +index ad44e9b2804..12251871957 100644 +--- a/.github/workflows/test-bundlers.yml ++++ b/.github/workflows/test-bundlers.yml +@@ -11,7 +11,7 @@ jobs: + runs-on: 'ubuntu-20.04' + steps: + - name: Checkout Code +- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 ++ uses: actions/checkout@83b7061638ee4956cf7545a6f7efe594e5ad0247 # v3.5.1 + + - name: Get Core Dependencies + uses: ./.github/workflows/actions/get-core-dependencies +diff --git a/.github/workflows/test-component-starter.yml b/.github/workflows/test-component-starter.yml +index a4b6418eb8f..62aab17406b 100644 +--- a/.github/workflows/test-component-starter.yml ++++ b/.github/workflows/test-component-starter.yml +@@ -16,7 +16,7 @@ jobs: + runs-on: ${{ matrix.os }} + steps: + - name: Checkout Code +- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 ++ uses: actions/checkout@83b7061638ee4956cf7545a6f7efe594e5ad0247 # v3.5.1 + + - name: Get Core Dependencies + uses: ./.github/workflows/actions/get-core-dependencies +diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml +index 887fe882fc3..2edbf687667 100644 +--- a/.github/workflows/test-e2e.yml ++++ b/.github/workflows/test-e2e.yml +@@ -16,7 +16,7 @@ jobs: + runs-on: ${{ matrix.os }} + steps: + - name: Checkout Code +- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 ++ uses: actions/checkout@83b7061638ee4956cf7545a6f7efe594e5ad0247 # v3.5.1 + + - name: Get Core Dependencies + uses: ./.github/workflows/actions/get-core-dependencies +diff --git a/.github/workflows/test-unit.yml b/.github/workflows/test-unit.yml +index 6b5db631c46..abe3cc1344d 100644 +--- a/.github/workflows/test-unit.yml ++++ b/.github/workflows/test-unit.yml +@@ -16,7 +16,7 @@ jobs: + runs-on: ${{ matrix.os }} + steps: + - name: Checkout Code +- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 ++ uses: actions/checkout@83b7061638ee4956cf7545a6f7efe594e5ad0247 # v3.5.1 + + - name: Get Core Dependencies + uses: ./.github/workflows/actions/get-core-dependencies" +components,https://github.com/angular/components,bd9ba9cbc80d857fd5fabe16679ebb7d38860413,Alan Agius,2018-05-15 06:49:16,docs(toolbar): set proper `role` value (#11317),"Based on https://www.w3.org/TR/wai-aria/#role_definitions there is no such role as `header`, but rather it should `heading`","docs(toolbar): set proper `role` value (#11317) + +Based on https://www.w3.org/TR/wai-aria/#role_definitions there is no such role as `header`, but rather it should `heading`","diff --git a/src/lib/toolbar/toolbar.md b/src/lib/toolbar/toolbar.md +index 06493a2720c6..ca1936e300ff 100644 +--- a/src/lib/toolbar/toolbar.md ++++ b/src/lib/toolbar/toolbar.md +@@ -68,7 +68,7 @@ By default, the toolbar assumes that it will be used in a purely decorative fash + no roles, ARIA attributes, or keyboard shortcuts. This is equivalent to having a sequence of `
    ` + elements on the page. + +-Generally, the toolbar is used as a header where `role=""header""` would be appropriate. ++Generally, the toolbar is used as a header where `role=""heading""` would be appropriate. + + Only if the use-case of the toolbar match that of role=""toolbar"", the user should add the role and + an appropriate label via `aria-label` or `aria-labelledby`." +zustand,https://github.com/pmndrs/zustand,5b3b963181a53a9e7ecd065c8f082dd5569e53ce,Daishi Kato,2021-12-24 12:39:46,fix(middleware): revert devtools extension connector with try-catch (#724),"* fix(middleware): revert devtools extension connector with try-catch + +* add a test case","fix(middleware): revert devtools extension connector with try-catch (#724) + +* fix(middleware): revert devtools extension connector with try-catch + +* add a test case + +Co-authored-by: Devansh Jethmalani ","diff --git a/src/middleware/devtools.ts b/src/middleware/devtools.ts +index e1fa95763c..c0521e2bc5 100644 +--- a/src/middleware/devtools.ts ++++ b/src/middleware/devtools.ts +@@ -87,16 +87,20 @@ export const devtools = + ? { name: options } + : options + +- if (typeof window === 'undefined') { +- return fn(set, get, api) ++ let extensionConnector ++ try { ++ extensionConnector = ++ (window as any).__REDUX_DEVTOOLS_EXTENSION__ || ++ (window as any).top.__REDUX_DEVTOOLS_EXTENSION__ ++ } catch { ++ // ignored + } + +- const extensionConnector = +- (window as any).__REDUX_DEVTOOLS_EXTENSION__ || +- (window as any).top.__REDUX_DEVTOOLS_EXTENSION__ +- + if (!extensionConnector) { +- if (process.env.NODE_ENV === 'development') { ++ if ( ++ process.env.NODE_ENV === 'development' && ++ typeof window !== 'undefined' ++ ) { + console.warn( + '[zustand devtools middleware] Please install/enable Redux devtools extension' + ) +diff --git a/tests/devtools.test.tsx b/tests/devtools.test.tsx +index 99424d1eb9..d6e5cb3ae8 100644 +--- a/tests/devtools.test.tsx ++++ b/tests/devtools.test.tsx +@@ -483,6 +483,17 @@ it('works in non-browser env', () => { + global.window = originalWindow + }) + ++it('works in react native env', () => { ++ const originalWindow = global.window ++ global.window = {} as any ++ ++ expect(() => { ++ create(devtools(() => ({ count: 0 }))) ++ }).not.toThrow() ++ ++ global.window = originalWindow ++}) ++ + it('preserves isRecording after setting from devtools', () => { + const api = create(devtools(() => ({ count: 0 }))) + ;(extensionSubscriber as (message: any) => void)({" +ant-design,https://github.com/ant-design/ant-design,82777bca93eb28373794455343ae6795cd8b4876,Qin Zan,2023-12-12 10:00:27,test: add Unit Testing (#46393),"* Unit Testing + +Added unit tests for the DatePicker show time field and month range relative start and end selection. + +* Remove duplicated test","test: add Unit Testing (#46393) + +* Unit Testing + +Added unit tests for the DatePicker show time field and month range relative start and end selection. + +* Remove duplicated test","diff --git a/components/date-picker/__tests__/DatePicker.test.tsx b/components/date-picker/__tests__/DatePicker.test.tsx +index d77073d42727..4c8ba323e0cb 100644 +--- a/components/date-picker/__tests__/DatePicker.test.tsx ++++ b/components/date-picker/__tests__/DatePicker.test.tsx +@@ -1,16 +1,19 @@ + import type { TriggerProps } from '@rc-component/trigger'; + import dayjs from 'dayjs'; ++ + import 'dayjs/locale/mk'; // to test local in 'prop locale should works' test case ++ ++import React from 'react'; ++import { CloseCircleFilled } from '@ant-design/icons'; ++import userEvent from '@testing-library/user-event'; + import customParseFormat from 'dayjs/plugin/customParseFormat'; + import MockDate from 'mockdate'; + import dayJsGenerateConfig from 'rc-picker/lib/generate/dayjs'; +-import React from 'react'; +-import userEvent from '@testing-library/user-event'; +-import { CloseCircleFilled } from '@ant-design/icons'; ++ + import DatePicker from '..'; ++import { resetWarned } from '../../_util/warning'; + import focusTest from '../../../tests/shared/focusTest'; + import { fireEvent, render, screen, waitFor } from '../../../tests/utils'; +-import { resetWarned } from '../../_util/warning'; + import type { PickerLocale } from '../generatePicker'; + import { closeCircleByRole, expectCloseCircle } from './utils'; + +@@ -124,6 +127,55 @@ describe('DatePicker', () => { + ).toBe(60); + }); + ++ it('showTime={{ showMinute: true, showSecond: true }}', () => { ++ const { container } = render( ++ , ++ ); ++ expect(container.querySelectorAll('.ant-picker-time-panel-column').length).toBe(2); ++ expect( ++ container ++ .querySelectorAll('.ant-picker-time-panel-column')?.[0] ++ .querySelectorAll('.ant-picker-time-panel-cell').length, ++ ).toBe(60); ++ expect( ++ container ++ .querySelectorAll('.ant-picker-time-panel-column')?.[1] ++ .querySelectorAll('.ant-picker-time-panel-cell').length, ++ ).toBe(60); ++ }); ++ ++ it('showTime={{ showHour: true, showMinute: true, showSecond: true }}', () => { ++ const { container } = render( ++ , ++ ); ++ expect(container.querySelectorAll('.ant-picker-time-panel-column').length).toBe(3); ++ expect( ++ container ++ .querySelectorAll('.ant-picker-time-panel-column')?.[0] ++ .querySelectorAll('.ant-picker-time-panel-cell').length, ++ ).toBe(24); ++ expect( ++ container ++ .querySelectorAll('.ant-picker-time-panel-column')?.[1] ++ .querySelectorAll('.ant-picker-time-panel-cell').length, ++ ).toBe(60); ++ expect( ++ container ++ .querySelectorAll('.ant-picker-time-panel-column')?.[2] ++ .querySelectorAll('.ant-picker-time-panel-cell').length, ++ ).toBe(60); ++ }); ++ + it('showTime={{ showHour: true, showSecond: true }}', () => { + const { container } = render( + { + ).toBe(60); + }); + +- it('showTime={{ showMinute: true, showSecond: true }}', () => { ++ it('showTime={{ showSecond: true }}', () => { + const { container } = render( + , + ); +- expect(container.querySelectorAll('.ant-picker-time-panel-column').length).toBe(2); ++ expect(container.querySelectorAll('.ant-picker-time-panel-column').length).toBe(1); + expect( + container + .querySelectorAll('.ant-picker-time-panel-column')?.[0] + .querySelectorAll('.ant-picker-time-panel-cell').length, + ).toBe(60); ++ }); ++ ++ it('showTime={{ showMinute: true }}', () => { ++ const { container } = render( ++ , ++ ); ++ expect(container.querySelectorAll('.ant-picker-time-panel-column').length).toBe(1); + expect( + container +- .querySelectorAll('.ant-picker-time-panel-column')?.[1] ++ .querySelectorAll('.ant-picker-time-panel-column')?.[0] + .querySelectorAll('.ant-picker-time-panel-cell').length, + ).toBe(60); + }); ++ ++ it('showTime={{ showHour: true }}', () => { ++ const { container } = render( ++ , ++ ); ++ expect(container.querySelectorAll('.ant-picker-time-panel-column').length).toBe(1); ++ expect( ++ container ++ .querySelectorAll('.ant-picker-time-panel-column')?.[0] ++ .querySelectorAll('.ant-picker-time-panel-cell').length, ++ ).toBe(24); ++ }); ++ ++ it('showTime={{ }} (no true args)', () => { ++ const { container } = render( ++ , ++ ); ++ expect(container.querySelectorAll('.ant-picker-time-panel-column').length).toBe(0); ++ }); ++ + it('showTime should work correctly when format is custom function', () => { + const { container } = render( + { + expect(container.firstChild).toMatchSnapshot(); + }); + ++ it('the left selection is before the right selection', () => { ++ let rangePickerValue: dayjs.Dayjs[] = []; ++ const Test: React.FC = () => { ++ const [value, setValue] = useState>(null); ++ return ( ++ { ++ setValue(v); ++ rangePickerValue = v as dayjs.Dayjs[]; ++ }} ++ /> ++ ); ++ }; ++ ++ const wrapper = render(); ++ ++ openPicker(wrapper); ++ selectCell(wrapper, 'Feb'); ++ openPicker(wrapper, 1); ++ selectCell(wrapper, 'May'); ++ closePicker(wrapper, 1); ++ ++ const [start, end] = rangePickerValue; ++ ++ expect(start.isBefore(end, 'date')).toBeTruthy(); ++ }); ++ ++ it('the left selection is after the right selection, no selection made', () => { ++ let rangePickerValue: dayjs.Dayjs[] = []; ++ const Test: React.FC = () => { ++ const [value, setValue] = useState>(null); ++ return ( ++ { ++ setValue(v); ++ rangePickerValue = v as dayjs.Dayjs[]; ++ }} ++ /> ++ ); ++ }; ++ ++ const wrapper = render(); ++ ++ openPicker(wrapper); ++ selectCell(wrapper, 'May'); ++ openPicker(wrapper, 1); ++ selectCell(wrapper, 'Feb'); ++ closePicker(wrapper, 1); ++ ++ const [start, end] = rangePickerValue; ++ ++ expect(start).not.toBeNull(); ++ expect(end).toBeNull(); ++ }); ++ + // https://github.com/ant-design/ant-design/issues/13302 + describe('in ""month"" mode, when the left and right panels select the same month', () => { + it('the cell status is correct', () => {" +cilium,https://github.com/cilium/cilium,2fb03bc769babdda8fac754a230d832e8c9ebbd2,Maciej Kwiek,2020-06-30 01:21:14,test: add missing artii cert-key pair,"These files are generated by + +cd k8sT/manifests +openssl genrsa -out internal-artii.key 2048 +openssl req -new -key internal-artii.key -out internal-artii.csr +openssl x509 -req -days 3600 -in internal-artii.csr -CA testCA.crt -CAkey testCA.key -CAcreateserial -out internal-artii.crt -sha256 + +common name needs to be `artii.herokuapp.com`. testCA.key password is +`cilium`","test: add missing artii cert-key pair + +These files are generated by + +cd k8sT/manifests +openssl genrsa -out internal-artii.key 2048 +openssl req -new -key internal-artii.key -out internal-artii.csr +openssl x509 -req -days 3600 -in internal-artii.csr -CA testCA.crt -CAkey testCA.key -CAcreateserial -out internal-artii.crt -sha256 + +common name needs to be `artii.herokuapp.com`. testCA.key password is +`cilium` + +Signed-off-by: Maciej Kwiek ","diff --git a/test/k8sT/manifests/internal-artii.crt b/test/k8sT/manifests/internal-artii.crt +new file mode 100644 +index 0000000000000..4d42731d86f1b +--- /dev/null ++++ b/test/k8sT/manifests/internal-artii.crt +@@ -0,0 +1,20 @@ ++-----BEGIN CERTIFICATE----- ++MIIDUDCCAjgCFE+nWBSj6DlZrAn/j+oT9z98ByvAMA0GCSqGSIb3DQEBCwUAMGYx ++CzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRIwEAYDVQQHDAlTdW5u ++eXZhbGUxEjAQBgNVBAoMCUlzb3ZhbGVudDEaMBgGA1UEAwwRd3d3Lmlzb3ZhbGVu ++dC5jb20wHhcNMjAwNjI5MTU1NTE0WhcNMzAwNTA4MTU1NTE0WjBjMQswCQYDVQQG ++EwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lk ++Z2l0cyBQdHkgTHRkMRwwGgYDVQQDDBNhcnRpaS5oZXJva3VhcHAuY29tMIIBIjAN ++BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA8MEP8zQbMQdGykyq0yf7W4kdGCTt ++N15ZhkbYAABm4oaCt7DvvYxFWzEPWD3S1qEsOWSUt4u5GsjQl3E+Xeg7hUYkJsPF ++USqQSzMPYXd38giwNkqr6jI3SSaglT8y1oHXUZp4GBSrEOp5SznPtugyLFW1Xzll ++mVmarVbB6ZE6viLkQQylOIDCV9Zgh7Rg9Vb4V/fhrs/FYAbDWDwyFs8wRjMm93Dg ++x9nLK8ATYdX/iFCR/CKpGIsv3cgeZ0EyqvpG+CdSjllNcmbazT98JhSpm1gRT7aj ++gwAMwxwC0tmbp+SVpg+xdWv+BGYI3j9bbrLLpEHc331eVFhSM5r3ktbQAQIDAQAB ++MA0GCSqGSIb3DQEBCwUAA4IBAQABpGG//0vYqw/7902qqefpCsAuRc0RIlbnl5Ux ++ENt0Go9UYBGyqkdicb68YNOmnBzHpo2ZbZfwBd8cSP4sLrVZ7OW1TAB06HbNZD2p ++uY426PCINKbHeZDdoOkq3AgnhuyO/2XxzRBJ3AGx1jNL7ciibjrItZByhCGGdfvF ++CJJl5dRi8Q+FkKZXo0OKSOwUf4TUKibKdfoNoQjRyiRl2gPSXCOXEVyDhNaKooXC ++BpCd+cUOtlz/JYxAPYyj1hRM4/VlXkKzq+ucASy/Ug/uA6BlfaNnrH4J+nFC58IF ++XpdGtiTngEp0PIX3K4nO2V6tOQuqzy+GBEW75xdmdd40ix+G ++-----END CERTIFICATE----- +diff --git a/test/k8sT/manifests/internal-artii.key b/test/k8sT/manifests/internal-artii.key +new file mode 100644 +index 0000000000000..d0e21f2282fb0 +--- /dev/null ++++ b/test/k8sT/manifests/internal-artii.key +@@ -0,0 +1,27 @@ ++-----BEGIN RSA PRIVATE KEY----- ++MIIEpQIBAAKCAQEA8MEP8zQbMQdGykyq0yf7W4kdGCTtN15ZhkbYAABm4oaCt7Dv ++vYxFWzEPWD3S1qEsOWSUt4u5GsjQl3E+Xeg7hUYkJsPFUSqQSzMPYXd38giwNkqr ++6jI3SSaglT8y1oHXUZp4GBSrEOp5SznPtugyLFW1XzllmVmarVbB6ZE6viLkQQyl ++OIDCV9Zgh7Rg9Vb4V/fhrs/FYAbDWDwyFs8wRjMm93Dgx9nLK8ATYdX/iFCR/CKp ++GIsv3cgeZ0EyqvpG+CdSjllNcmbazT98JhSpm1gRT7ajgwAMwxwC0tmbp+SVpg+x ++dWv+BGYI3j9bbrLLpEHc331eVFhSM5r3ktbQAQIDAQABAoIBAQDhhRe5y5+FB7nq ++GnMSJSuxjPjx+vUynnDh9U60gavemf2ssFOCjPkS+RvUnuT3JDbW9D7SyFF2o5Gx ++quSu9rF6oD+RCGW3KFXN+2B2/oAe+sCFuuDbGnrrTQGzjGXExg+6YyYH+KRdziYc ++r2TBgzQsj4S8VHm1clgP82rlraMHIrrr038oXYHNpY57t+U4NQdgBKgnN3E81i/5 ++ntINfMQaE8kip+TizoSOX5AcABlyMrqcSJ+fX91TpsG15ur1ZPxt+mB0m62nLQrE ++rhmo9hw8Q50i7uBCNRQbFQe/rQ1HMHTdwsWtmA9wVCcvyZ/A6KaWLKb9b1v1zuZE ++LPMTwA6ZAoGBAPmzDZXIuXpZ7lzXzm5C6In8JQ1cKwquHkz8qN4QmoYiFH4LAUUj ++dS0VXAvJX0SEJM6lKenpUHAXbSoAIe+SIBXScEwQNmkfsBNLE9hgJWEPg1xxBQOQ ++AJr16aH8Ht9+UyDVvkysi2ycKSbjTXBonVQGmPkCEUzmZnlbQPYjblAzAoGBAPbU ++Ogu+FuMQLqNUEEdQwDdPPPkvyrMwC+NFq8hmp+KVYQrLBWpGKRahwO/FCFOKB3al ++6gKdR45+vQMcrxV5rmx7twPlE+26KXTK1ZW/v05XTjDzsbhMP4ufNGKA/VoXAzT8 ++Y358xlNfKlyBVZWcQR8dir55zmiyFHVPRK7bUxr7AoGADXUE6mmi9WEbY42N5otc ++lPMt3AZ3m1++6k9DmpQyf8AecpyNOPisO/3GtCvqInsssKZeF+knGKNqkrTnH040 ++xHhO7QqCpC+9AY0uSJ8F5LE9VyIQLxz3q2JNcRlxYIIiYMakNuWlrfjMjvf5GHHK ++6NhiLilaXVaddzTfz2QhcdkCgYEA7R6ekM9Rj1rpYvCMHua9caUGr2CxOwkKMpCo ++4YF1ASB+NG8rSZgTOvGztuOzBwYP+3SSZWaQ6pxomgfBT0ExRnhnLi+wwG1aDCAb ++pZuqfekzbaV+8s0VMt2D5qmCOjznUMyyDD50DH3c5Tc+b9bHXMv1kNzVZRDGxJed ++JNoAcWcCgYEA+UdczyJbQ07iXmDXXDyhe9mNKhsdilQho6kmbOwmO/EVoGHEShnw ++zuv1ADCb6/9oEYZpuP+4dFDodUo6DQXf2+9XqsmokfwN2RARlgPbhvKJ214ZZ2Wr ++8fLKG5fXcCaeVP8rGn/1yca+Z8+lHkC0olfU2mpBzz9MfEvdnwE3Ji4= ++-----END RSA PRIVATE KEY-----" +fresh,https://github.com/denoland/fresh,1643d6d1d6c0be42dea1f824501fcfc357bdb9f1,Reed von Redwitz,2023-11-29 03:23:16,chore: remove dead code (#2083),As per,"chore: remove dead code (#2083) + +As per +https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referer, which +links to the interesting https://en.wikipedia.org/wiki/HTTP_referer, the +incorrect `referer` is actually correct when using headers. + +I noticed this when frantically trying to keep up with your flood of PRs +while trying to get the base path stuff working. The header coming in +does indeed use `referer`. + +@marvinhagemeister","diff --git a/src/server/context.ts b/src/server/context.ts +index 2874990248e..1a7a45740b1 100644 +--- a/src/server/context.ts ++++ b/src/server/context.ts +@@ -483,11 +483,6 @@ export class ServerContext { + baseRoute, + methods: { + default: async (req, ctx) => { +- if ( +- req.headers.get(""referrer"")?.includes(""/_frsh/error_overlay"") +- ) { +- throw new Error(""fail""); +- } + const resp = await internalRender({ + request: req, + context: ctx," +umami,https://github.com/umami-software/umami,98a60d0d3ecc08224d8e9284ee5f5defc54cf29a,Alexander Klein,2021-02-21 18:21:33,"fix(Dashboard): ""no data"" caption not rendered",Change styling of `DataTable` to make `NoData` visible again.,"fix(Dashboard): ""no data"" caption not rendered + +Change styling of `DataTable` to make `NoData` visible again. + +Refs #498","diff --git a/components/metrics/DataTable.module.css b/components/metrics/DataTable.module.css +index b8b203c4ce..b21b92b953 100644 +--- a/components/metrics/DataTable.module.css ++++ b/components/metrics/DataTable.module.css +@@ -1,14 +1,15 @@ + .table { + position: relative; ++ height: 100%; + font-size: var(--font-size-small); +- display: flex; +- flex-direction: column; +- flex: 1; ++ display: grid; ++ grid-template-rows: fit-content(100%) auto; + overflow: hidden; + } + + .body { + position: relative; ++ height: 100%; + overflow: auto; + }" +bruno,https://github.com/usebruno/bruno,5e4a96792e6228e01cdc2ae7c373663de3d6a02b,David Francis,2024-09-16 16:33:18,feat: Feature/cli support multiple reporters (#2911),"* Support multiple reporters at once in the CLI + +* Typos + +* Better logging string after writing file + +* Remove double blank line + +* More double blank lines + +* Switch reporter schema to one from discussion + +* Typo + +* Add comment","feat: Feature/cli support multiple reporters (#2911) + +* Support multiple reporters at once in the CLI + +* Typos + +* Better logging string after writing file + +* Remove double blank line + +* More double blank lines + +* Switch reporter schema to one from discussion + +* Typo + +* Add comment","diff --git a/packages/bruno-cli/src/commands/run.js b/packages/bruno-cli/src/commands/run.js +index 53871bc573..58b3cdf803 100644 +--- a/packages/bruno-cli/src/commands/run.js ++++ b/packages/bruno-cli/src/commands/run.js +@@ -235,6 +235,18 @@ const builder = async (yargs) => { + default: 'json', + type: 'string' + }) ++ .option('reporter-json', { ++ describe: 'Path to write json file results to', ++ type: 'string' ++ }) ++ .option('reporter-junit', { ++ describe: 'Path to write junit file results to', ++ type: 'string' ++ }) ++ .option('reporter-html', { ++ describe: 'Path to write html file results to', ++ type: 'string' ++ }) + .option('insecure', { + type: 'boolean', + description: 'Allow insecure server connections' +@@ -267,6 +279,10 @@ const builder = async (yargs) => { + '$0 run request.bru --output results.html --format html', + 'Run a request and write the results to results.html in html format in the current directory' + ) ++ .example( ++ '$0 run request.bru --reporter-junit results.xml --reporter-html results.html', ++ 'Run a request and write the results to results.html in html format and results.xml in junit format in the current directory' ++ ) + + .example('$0 run request.bru --tests-only', 'Run all requests that have a test') + .example( +@@ -291,6 +307,9 @@ const handler = async function (argv) { + r: recursive, + output: outputPath, + format, ++ reporterJson, ++ reporterJunit, ++ reporterHtml, + sandbox, + testsOnly, + bail +@@ -392,6 +411,25 @@ const handler = async function (argv) { + process.exit(constants.EXIT_STATUS.ERROR_INCORRECT_OUTPUT_FORMAT); + } + ++ let formats = {}; ++ ++ // Maintains back compat with --format and --output ++ if (outputPath && outputPath.length) { ++ formats[format] = outputPath; ++ } ++ ++ if (reporterHtml && reporterHtml.length) { ++ formats['html'] = reporterHtml; ++ } ++ ++ if (reporterJson && reporterJson.length) { ++ formats['json'] = reporterJson; ++ } ++ ++ if (reporterJunit && reporterJunit.length) { ++ formats['junit'] = reporterJunit; ++ } ++ + // load .env file at root of collection if it exists + const dotEnvPath = path.join(collectionPath, '.env'); + const dotEnvExists = await exists(dotEnvPath); +@@ -524,28 +562,45 @@ const handler = async function (argv) { + const totalTime = results.reduce((acc, res) => acc + res.response.responseTime, 0); + console.log(chalk.dim(chalk.grey(`Ran all requests - ${totalTime} ms`))); + +- if (outputPath && outputPath.length) { +- const outputDir = path.dirname(outputPath); +- const outputDirExists = await exists(outputDir); +- if (!outputDirExists) { +- console.error(chalk.red(`Output directory ${outputDir} does not exist`)); +- process.exit(constants.EXIT_STATUS.ERROR_MISSING_OUTPUT_DIR); +- } +- ++ const formatKeys = Object.keys(formats); ++ if (formatKeys && formatKeys.length > 0) { + const outputJson = { + summary, + results + }; + +- if (format === 'json') { +- fs.writeFileSync(outputPath, JSON.stringify(outputJson, null, 2)); +- } else if (format === 'junit') { +- makeJUnitOutput(results, outputPath); +- } else if (format === 'html') { +- makeHtmlOutput(outputJson, outputPath); ++ const reporters = { ++ 'json': (path) => fs.writeFileSync(path, JSON.stringify(outputJson, null, 2)), ++ 'junit': (path) => makeJUnitOutput(results, path), ++ 'html': (path) => makeHtmlOutput(outputJson, path), + } + +- console.log(chalk.dim(chalk.grey(`Wrote results to ${outputPath}`))); ++ for (const formatter of Object.keys(formats)) ++ { ++ const reportPath = formats[formatter]; ++ const reporter = reporters[formatter]; ++ ++ // Skip formatters lacking an output path. ++ if (!reportPath || reportPath.length === 0) { ++ continue; ++ } ++ ++ const outputDir = path.dirname(reportPath); ++ const outputDirExists = await exists(outputDir); ++ if (!outputDirExists) { ++ console.error(chalk.red(`Output directory ${outputDir} does not exist`)); ++ process.exit(constants.EXIT_STATUS.ERROR_MISSING_OUTPUT_DIR); ++ } ++ ++ if (!reporter) { ++ console.error(chalk.red(`Reporter ${formatter} does not exist`)); ++ process.exit(constants.EXIT_STATUS.ERROR_INCORRECT_OUTPUT_FORMAT); ++ } ++ ++ reporter(reportPath); ++ ++ console.log(chalk.dim(chalk.grey(`Wrote ${formatter} results to ${reportPath}`))); ++ } + } + + if (summary.failedAssertions + summary.failedTests + summary.failedRequests > 0) {" +pyroscope,https://github.com/grafana/pyroscope,5d05e095c22454c892acf9540ab447470bc5594b,Pyroscope Bot dmitry+bot@pyroscope.io,2022-09-22 19:13:03,chore(release): publish,- @pyroscope/webapp@1.43.1,"chore(release): publish + + - @pyroscope/webapp@1.43.1","diff --git a/webapp/CHANGELOG.md b/webapp/CHANGELOG.md +index 662013da71..53af75e6f3 100644 +--- a/webapp/CHANGELOG.md ++++ b/webapp/CHANGELOG.md +@@ -3,6 +3,17 @@ + All notable changes to this project will be documented in this file. + See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ++## [1.43.1](https://github.com/pyroscope-io/pyroscope/compare/@pyroscope/webapp@1.43.0...@pyroscope/webapp@1.43.1) (2022-09-22) ++ ++ ++### Bug Fixes ++ ++* **webapp:** don't render popover outside the visible window ([#1534](https://github.com/pyroscope-io/pyroscope/issues/1534)) ([0ce4e7d](https://github.com/pyroscope-io/pyroscope/commit/0ce4e7de968bb3e919fab0dcd7394350eb4716b5)) ++ ++ ++ ++ ++ + # [1.43.0](https://github.com/pyroscope-io/pyroscope/compare/@pyroscope/webapp@1.42.4...@pyroscope/webapp@1.43.0) (2022-09-22) + + +diff --git a/webapp/package.json b/webapp/package.json +index 6feeedbbcc..cd95d23b9e 100644 +--- a/webapp/package.json ++++ b/webapp/package.json +@@ -1,6 +1,6 @@ + { + ""name"": ""@pyroscope/webapp"", +- ""version"": ""1.43.0"", ++ ""version"": ""1.43.1"", + ""private"": true, + ""scripts"": { + ""test"": ""echo \""Error: run tests from root\"" && exit 1""," +angular,https://github.com/angular/angular,8f11b516f88e578ac854d40fdb8abf8e10510ef4,Alex Rickabaugh,2020-09-30 18:56:05,refactor(compiler-cli): API for getting components from a template file (#39002),"This commit adds an API to `NgCompiler`, a method called +`getComponentsWithTemplateFile`. Given a filesystem path to an external +template file, it retrieves a `Set` (actually a `ReadonlySet`) of component +declarations which are using this template. In most cases, this will only be +a single component. + +This information is easily determined by the compiler during analysis, but +is hard for a lot of Angular tooling (e.g. the language service) to infer +independently. Therefore, it makes sense to expose this as a compiler API. + +PR Close #39002","refactor(compiler-cli): API for getting components from a template file (#39002) + +This commit adds an API to `NgCompiler`, a method called +`getComponentsWithTemplateFile`. Given a filesystem path to an external +template file, it retrieves a `Set` (actually a `ReadonlySet`) of component +declarations which are using this template. In most cases, this will only be +a single component. + +This information is easily determined by the compiler during analysis, but +is hard for a lot of Angular tooling (e.g. the language service) to infer +independently. Therefore, it makes sense to expose this as a compiler API. + +PR Close #39002","diff --git a/packages/compiler-cli/ngcc/src/analysis/decoration_analyzer.ts b/packages/compiler-cli/ngcc/src/analysis/decoration_analyzer.ts +index 399c3abeb229e0..e557fa4fe5b730 100644 +--- a/packages/compiler-cli/ngcc/src/analysis/decoration_analyzer.ts ++++ b/packages/compiler-cli/ngcc/src/analysis/decoration_analyzer.ts +@@ -14,7 +14,7 @@ import {CycleAnalyzer, ImportGraph} from '../../../src/ngtsc/cycles'; + import {isFatalDiagnosticError} from '../../../src/ngtsc/diagnostics'; + import {absoluteFrom, absoluteFromSourceFile, dirname, FileSystem, LogicalFileSystem, resolve} from '../../../src/ngtsc/file_system'; + import {AbsoluteModuleStrategy, LocalIdentifierStrategy, LogicalProjectStrategy, ModuleResolver, NOOP_DEFAULT_IMPORT_RECORDER, PrivateExportAliasingHost, Reexport, ReferenceEmitter} from '../../../src/ngtsc/imports'; +-import {CompoundMetadataReader, CompoundMetadataRegistry, DtsMetadataReader, InjectableClassRegistry, LocalMetadataRegistry} from '../../../src/ngtsc/metadata'; ++import {CompoundMetadataReader, CompoundMetadataRegistry, DtsMetadataReader, InjectableClassRegistry, LocalMetadataRegistry, TemplateMapping} from '../../../src/ngtsc/metadata'; + import {PartialEvaluator} from '../../../src/ngtsc/partial_evaluator'; + import {LocalModuleScopeRegistry, MetadataDtsModuleScopeResolver} from '../../../src/ngtsc/scope'; + import {DecoratorHandler} from '../../../src/ngtsc/transform'; +@@ -94,8 +94,8 @@ export class DecorationAnalyzer { + handlers: DecoratorHandler[] = [ + new ComponentDecoratorHandler( + this.reflectionHost, this.evaluator, this.fullRegistry, this.fullMetaReader, +- this.scopeRegistry, this.scopeRegistry, this.isCore, this.resourceManager, this.rootDirs, +- !!this.compilerOptions.preserveWhitespaces, ++ this.scopeRegistry, this.scopeRegistry, new TemplateMapping(), this.isCore, ++ this.resourceManager, this.rootDirs, !!this.compilerOptions.preserveWhitespaces, + /* i18nUseExternalIds */ true, this.bundle.enableI18nLegacyMessageIdFormat, + /* i18nNormalizeLineEndingsInICUs */ false, this.moduleResolver, this.cycleAnalyzer, + this.refEmitter, NOOP_DEFAULT_IMPORT_RECORDER, NOOP_DEPENDENCY_TRACKER, +diff --git a/packages/compiler-cli/src/ngtsc/annotations/src/component.ts b/packages/compiler-cli/src/ngtsc/annotations/src/component.ts +index 7c2d673034f7b0..1ae175cbcec416 100644 +--- a/packages/compiler-cli/src/ngtsc/annotations/src/component.ts ++++ b/packages/compiler-cli/src/ngtsc/annotations/src/component.ts +@@ -11,11 +11,11 @@ import * as ts from 'typescript'; + + import {CycleAnalyzer} from '../../cycles'; + import {ErrorCode, FatalDiagnosticError, ngErrorCode} from '../../diagnostics'; +-import {absoluteFrom, relative} from '../../file_system'; ++import {absoluteFrom, relative, resolve} from '../../file_system'; + import {DefaultImportRecorder, ModuleResolver, Reference, ReferenceEmitter} from '../../imports'; + import {DependencyTracker} from '../../incremental/api'; + import {IndexingContext} from '../../indexer'; +-import {ClassPropertyMapping, DirectiveMeta, DirectiveTypeCheckMeta, extractDirectiveTypeCheckMeta, InjectableClassRegistry, MetadataReader, MetadataRegistry} from '../../metadata'; ++import {ClassPropertyMapping, DirectiveMeta, DirectiveTypeCheckMeta, extractDirectiveTypeCheckMeta, InjectableClassRegistry, MetadataReader, MetadataRegistry, TemplateMapping} from '../../metadata'; + import {EnumValue, PartialEvaluator} from '../../partial_evaluator'; + import {ClassDeclaration, Decorator, ReflectionHost, reflectObjectLiteral} from '../../reflection'; + import {ComponentScopeReader, LocalModuleScopeRegistry} from '../../scope'; +@@ -83,9 +83,10 @@ export class ComponentDecoratorHandler implements + private reflector: ReflectionHost, private evaluator: PartialEvaluator, + private metaRegistry: MetadataRegistry, private metaReader: MetadataReader, + private scopeReader: ComponentScopeReader, private scopeRegistry: LocalModuleScopeRegistry, +- private isCore: boolean, private resourceLoader: ResourceLoader, +- private rootDirs: ReadonlyArray, private defaultPreserveWhitespaces: boolean, +- private i18nUseExternalIds: boolean, private enableI18nLegacyMessageIdFormat: boolean, ++ private templateMapping: TemplateMapping, private isCore: boolean, ++ private resourceLoader: ResourceLoader, private rootDirs: ReadonlyArray, ++ private defaultPreserveWhitespaces: boolean, private i18nUseExternalIds: boolean, ++ private enableI18nLegacyMessageIdFormat: boolean, + private i18nNormalizeLineEndingsInICUs: boolean|undefined, + private moduleResolver: ModuleResolver, private cycleAnalyzer: CycleAnalyzer, + private refEmitter: ReferenceEmitter, private defaultImportRecorder: DefaultImportRecorder, +@@ -384,6 +385,10 @@ export class ComponentDecoratorHandler implements + ...analysis.typeCheckMeta, + }); + ++ if (!analysis.template.isInline) { ++ this.templateMapping.register(resolve(analysis.template.templateUrl), node); ++ } ++ + this.injectableRegistry.registerInjectable(node); + } + +diff --git a/packages/compiler-cli/src/ngtsc/annotations/test/component_spec.ts b/packages/compiler-cli/src/ngtsc/annotations/test/component_spec.ts +index 5fc7139e281b3f..14ceb191c7de21 100644 +--- a/packages/compiler-cli/src/ngtsc/annotations/test/component_spec.ts ++++ b/packages/compiler-cli/src/ngtsc/annotations/test/component_spec.ts +@@ -10,7 +10,7 @@ import {ErrorCode, FatalDiagnosticError} from '../../diagnostics'; + import {absoluteFrom} from '../../file_system'; + import {runInEachFileSystem} from '../../file_system/testing'; + import {ModuleResolver, NOOP_DEFAULT_IMPORT_RECORDER, ReferenceEmitter} from '../../imports'; +-import {CompoundMetadataReader, DtsMetadataReader, InjectableClassRegistry, LocalMetadataRegistry} from '../../metadata'; ++import {CompoundMetadataReader, DtsMetadataReader, InjectableClassRegistry, LocalMetadataRegistry, TemplateMapping} from '../../metadata'; + import {PartialEvaluator} from '../../partial_evaluator'; + import {isNamedClassDeclaration, TypeScriptReflectionHost} from '../../reflection'; + import {LocalModuleScopeRegistry, MetadataDtsModuleScopeResolver} from '../../scope'; +@@ -69,6 +69,7 @@ runInEachFileSystem(() => { + + const handler = new ComponentDecoratorHandler( + reflectionHost, evaluator, metaRegistry, metaReader, scopeRegistry, scopeRegistry, ++ new TemplateMapping(), + /* isCore */ false, new NoopResourceLoader(), /* rootDirs */[''], + /* defaultPreserveWhitespaces */ false, /* i18nUseExternalIds */ true, + /* enableI18nLegacyMessageIdFormat */ false, +diff --git a/packages/compiler-cli/src/ngtsc/core/src/compiler.ts b/packages/compiler-cli/src/ngtsc/core/src/compiler.ts +index 48857f59b7d489..fc91e6a281b100 100644 +--- a/packages/compiler-cli/src/ngtsc/core/src/compiler.ts ++++ b/packages/compiler-cli/src/ngtsc/core/src/compiler.ts +@@ -13,11 +13,11 @@ import {ComponentDecoratorHandler, DirectiveDecoratorHandler, InjectableDecorato + import {CycleAnalyzer, ImportGraph} from '../../cycles'; + import {ErrorCode, ngErrorCode} from '../../diagnostics'; + import {checkForPrivateExports, ReferenceGraph} from '../../entry_point'; +-import {LogicalFileSystem} from '../../file_system'; ++import {LogicalFileSystem, resolve} from '../../file_system'; + import {AbsoluteModuleStrategy, AliasingHost, AliasStrategy, DefaultImportTracker, ImportRewriter, LocalIdentifierStrategy, LogicalProjectStrategy, ModuleResolver, NoopImportRewriter, PrivateExportAliasingHost, R3SymbolsImportRewriter, Reference, ReferenceEmitStrategy, ReferenceEmitter, RelativePathStrategy, UnifiedModulesAliasingHost, UnifiedModulesStrategy} from '../../imports'; + import {IncrementalBuildStrategy, IncrementalDriver} from '../../incremental'; + import {generateAnalysis, IndexedComponent, IndexingContext} from '../../indexer'; +-import {CompoundMetadataReader, CompoundMetadataRegistry, DtsMetadataReader, InjectableClassRegistry, LocalMetadataRegistry, MetadataReader} from '../../metadata'; ++import {CompoundMetadataReader, CompoundMetadataRegistry, DtsMetadataReader, InjectableClassRegistry, LocalMetadataRegistry, MetadataReader, TemplateMapping} from '../../metadata'; + import {ModuleWithProvidersScanner} from '../../modulewithproviders'; + import {PartialEvaluator} from '../../partial_evaluator'; + import {NOOP_PERF_RECORDER, PerfRecorder} from '../../perf'; +@@ -52,6 +52,7 @@ interface LazyCompilationState { + aliasingHost: AliasingHost|null; + refEmitter: ReferenceEmitter; + templateTypeChecker: TemplateTypeChecker; ++ templateMapping: TemplateMapping; + } + + /** +@@ -223,6 +224,14 @@ export class NgCompiler { + return this.ensureAnalyzed().templateTypeChecker; + } + ++ /** ++ * Retrieves the `ts.Declaration`s for any component(s) which use the given template file. ++ */ ++ getComponentsWithTemplateFile(templateFilePath: string): ReadonlySet { ++ const {templateMapping} = this.ensureAnalyzed(); ++ return templateMapping.getComponentsWithTemplate(resolve(templateFilePath)); ++ } ++ + /** + * Perform Angular's analysis step (as a precursor to `getDiagnostics` or `prepareEmit`) + * asynchronously. +@@ -714,13 +723,14 @@ export class NgCompiler { + const isCore = isAngularCorePackage(this.tsProgram); + + const defaultImportTracker = new DefaultImportTracker(); ++ const templateMapping = new TemplateMapping(); + + // Set up the IvyCompilation, which manages state for the Ivy transformer. + const handlers: DecoratorHandler[] = [ + new ComponentDecoratorHandler( +- reflector, evaluator, metaRegistry, metaReader, scopeReader, scopeRegistry, isCore, +- this.resourceManager, this.adapter.rootDirs, this.options.preserveWhitespaces || false, +- this.options.i18nUseExternalIds !== false, ++ reflector, evaluator, metaRegistry, metaReader, scopeReader, scopeRegistry, ++ templateMapping, isCore, this.resourceManager, this.adapter.rootDirs, ++ this.options.preserveWhitespaces || false, this.options.i18nUseExternalIds !== false, + this.options.enableI18nLegacyMessageIdFormat !== false, + this.options.i18nNormalizeLineEndingsInICUs, this.moduleResolver, this.cycleAnalyzer, + refEmitter, defaultImportTracker, this.incrementalDriver.depGraph, injectableRegistry, +@@ -773,6 +783,7 @@ export class NgCompiler { + aliasingHost, + refEmitter, + templateTypeChecker, ++ templateMapping, + }; + } + } +diff --git a/packages/compiler-cli/src/ngtsc/core/test/BUILD.bazel b/packages/compiler-cli/src/ngtsc/core/test/BUILD.bazel +index ec34344c911a47..54dcaad509c814 100644 +--- a/packages/compiler-cli/src/ngtsc/core/test/BUILD.bazel ++++ b/packages/compiler-cli/src/ngtsc/core/test/BUILD.bazel +@@ -15,6 +15,7 @@ ts_library( + ""//packages/compiler-cli/src/ngtsc/file_system"", + ""//packages/compiler-cli/src/ngtsc/file_system/testing"", + ""//packages/compiler-cli/src/ngtsc/incremental"", ++ ""//packages/compiler-cli/src/ngtsc/reflection"", + ""//packages/compiler-cli/src/ngtsc/typecheck"", + ""@npm//typescript"", + ], +diff --git a/packages/compiler-cli/src/ngtsc/core/test/compiler_test.ts b/packages/compiler-cli/src/ngtsc/core/test/compiler_test.ts +index 16e9fea106b680..0a6b3ac1186e9c 100644 +--- a/packages/compiler-cli/src/ngtsc/core/test/compiler_test.ts ++++ b/packages/compiler-cli/src/ngtsc/core/test/compiler_test.ts +@@ -11,12 +11,14 @@ import * as ts from 'typescript'; + import {absoluteFrom as _, FileSystem, getFileSystem, getSourceFileOrError, NgtscCompilerHost, setFileSystem} from '../../file_system'; + import {runInEachFileSystem} from '../../file_system/testing'; + import {NoopIncrementalBuildStrategy} from '../../incremental'; ++import {ClassDeclaration, isNamedClassDeclaration} from '../../reflection'; + import {ReusedProgramStrategy} from '../../typecheck'; ++ + import {NgCompilerOptions} from '../api'; ++ + import {NgCompiler} from '../src/compiler'; + import {NgCompilerHost} from '../src/host'; + +- + runInEachFileSystem(() => { + describe('NgCompiler', () => { + let fs: FileSystem; +@@ -55,5 +57,63 @@ runInEachFileSystem(() => { + expect(diags.length).toBe(1); + expect(diags[0].messageText).toContain('does_not_exist'); + }); ++ ++ describe('getComponentsWithTemplateFile', () => { ++ it('should return the component(s) using a template file', () => { ++ const templateFile = _('/template.html'); ++ fs.writeFile(templateFile, `This is the template, used by components CmpA and CmpC`); ++ const cmpAFile = _('/cmp-a.ts'); ++ fs.writeFile(cmpAFile, ` ++ import {Component} from '@angular/core'; ++ @Component({ ++ selector: 'cmp-a', ++ templateUrl: './template.html', ++ }) ++ export class CmpA {} ++ `); ++ const cmpBFile = _('/cmp-b.ts'); ++ fs.writeFile(cmpBFile, ` ++ import {Component} from '@angular/core'; ++ @Component({ ++ selector: 'cmp-b', ++ template: 'CmpB does not use an external template', ++ }) ++ export class CmpB {} ++ `); ++ const cmpCFile = _('/cmp-c.ts'); ++ fs.writeFile(cmpCFile, ` ++ import {Component} from '@angular/core'; ++ @Component({ ++ selector: 'cmp-c', ++ templateUrl: './template.html', ++ }) ++ export class CmpC {} ++ `); ++ ++ const options: NgCompilerOptions = {}; ++ ++ const baseHost = new NgtscCompilerHost(getFileSystem(), options); ++ const host = NgCompilerHost.wrap( ++ baseHost, [cmpAFile, cmpBFile, cmpCFile], options, /* oldProgram */ null); ++ const program = ts.createProgram({host, options, rootNames: host.inputFiles}); ++ const CmpA = getClass(getSourceFileOrError(program, cmpAFile), 'CmpA'); ++ const CmpC = getClass(getSourceFileOrError(program, cmpCFile), 'CmpC'); ++ const compiler = new NgCompiler( ++ host, options, program, new ReusedProgramStrategy(program, host, options, []), ++ new NoopIncrementalBuildStrategy(), /** enableTemplateTypeChecker */ false); ++ const components = compiler.getComponentsWithTemplateFile(templateFile); ++ expect(components).toEqual(new Set([CmpA, CmpC])); ++ }); ++ }); + }); + }); ++ ++ ++function getClass(sf: ts.SourceFile, name: string): ClassDeclaration { ++ for (const stmt of sf.statements) { ++ if (isNamedClassDeclaration(stmt) && stmt.name.text === name) { ++ return stmt; ++ } ++ } ++ throw new Error(`Class ${name} not found in file: ${sf.fileName}: ${sf.text}`); ++} +diff --git a/packages/compiler-cli/src/ngtsc/metadata/BUILD.bazel b/packages/compiler-cli/src/ngtsc/metadata/BUILD.bazel +index 6c36eb70d386d5..2cf7890186262e 100644 +--- a/packages/compiler-cli/src/ngtsc/metadata/BUILD.bazel ++++ b/packages/compiler-cli/src/ngtsc/metadata/BUILD.bazel +@@ -9,6 +9,7 @@ ts_library( + ]), + deps = [ + ""//packages/compiler"", ++ ""//packages/compiler-cli/src/ngtsc/file_system"", + ""//packages/compiler-cli/src/ngtsc/imports"", + ""//packages/compiler-cli/src/ngtsc/reflection"", + ""//packages/compiler-cli/src/ngtsc/util"", +diff --git a/packages/compiler-cli/src/ngtsc/metadata/index.ts b/packages/compiler-cli/src/ngtsc/metadata/index.ts +index 9ee4e1a977ac44..b45207187527d3 100644 +--- a/packages/compiler-cli/src/ngtsc/metadata/index.ts ++++ b/packages/compiler-cli/src/ngtsc/metadata/index.ts +@@ -10,5 +10,6 @@ export * from './src/api'; + export {DtsMetadataReader} from './src/dts'; + export {flattenInheritedDirectiveMetadata} from './src/inheritance'; + export {CompoundMetadataRegistry, LocalMetadataRegistry, InjectableClassRegistry} from './src/registry'; ++export {TemplateRegistry as TemplateMapping} from './src/template_mapping'; + export {extractDirectiveTypeCheckMeta, CompoundMetadataReader} from './src/util'; +-export {BindingPropertyName, ClassPropertyMapping, ClassPropertyName, InputOrOutput} from './src/property_mapping'; ++export {BindingPropertyName, ClassPropertyMapping, ClassPropertyName, InputOrOutput} from './src/property_mapping'; +\ No newline at end of file +diff --git a/packages/compiler-cli/src/ngtsc/metadata/src/template_mapping.ts b/packages/compiler-cli/src/ngtsc/metadata/src/template_mapping.ts +new file mode 100644 +index 00000000000000..2a5d49613ef6cd +--- /dev/null ++++ b/packages/compiler-cli/src/ngtsc/metadata/src/template_mapping.ts +@@ -0,0 +1,36 @@ ++/** ++ * @license ++ * Copyright Google LLC All Rights Reserved. ++ * ++ * Use of this source code is governed by an MIT-style license that can be ++ * found in the LICENSE file at https://angular.io/license ++ */ ++ ++import {AbsoluteFsPath} from '../../file_system'; ++import {ClassDeclaration} from '../../reflection'; ++ ++/** ++ * Tracks the mapping between external template files and the component(s) which use them. ++ * ++ * This information is produced during analysis of the program and is used mainly to support ++ * external tooling, for which such a mapping is challenging to determine without compiler ++ * assistance. ++ */ ++export class TemplateRegistry { ++ private map = new Map>(); ++ ++ getComponentsWithTemplate(template: AbsoluteFsPath): ReadonlySet { ++ if (!this.map.has(template)) { ++ return new Set(); ++ } ++ ++ return this.map.get(template)!; ++ } ++ ++ register(template: AbsoluteFsPath, component: ClassDeclaration): void { ++ if (!this.map.has(template)) { ++ this.map.set(template, new Set()); ++ } ++ this.map.get(template)!.add(component); ++ } ++}" +metersphere,https://github.com/metersphere/metersphere,4995736e302d2680a4d5fc7a22e27e02eec8fb8f,baiqi,2024-09-19 12:24:12,fix(报告): 测试计划报告总结富文本渲染调整,--bug=1046672 --user=白奇 报告总结中包含表格、任务列表等格式,导出pdf后格式未导出 https://www.tapd.cn/55049933/s/1580970,"fix(报告): 测试计划报告总结富文本渲染调整 + +--bug=1046672 --user=白奇 报告总结中包含表格、任务列表等格式,导出pdf后格式未导出 https://www.tapd.cn/55049933/s/1580970","diff --git a/frontend/src/components/pure/ms-rich-text/MsRichText.vue b/frontend/src/components/pure/ms-rich-text/MsRichText.vue +index 59055e3ce09a..4b8d5d7038ec 100644 +--- a/frontend/src/components/pure/ms-rich-text/MsRichText.vue ++++ b/frontend/src/components/pure/ms-rich-text/MsRichText.vue +@@ -34,8 +34,6 @@ + ExtensionCode, + ExtensionCodeBlock, + ExtensionColor, +- ExtensionColumn, +- ExtensionColumns, + ExtensionCommands, + ExtensionDocument, + ExtensionDraggable, +diff --git a/frontend/src/views/test-plan/report/detail/exportPDF.vue b/frontend/src/views/test-plan/report/detail/exportPDF.vue +index 5da4b1459fa0..70fad42ee813 100644 +--- a/frontend/src/views/test-plan/report/detail/exportPDF.vue ++++ b/frontend/src/views/test-plan/report/detail/exportPDF.vue +@@ -108,16 +108,12 @@ + :share-id=""shareId"" + is-preview + /> +-
    +-
    ++
    ++ ++
    ++
    ++ ++
    +
    +
    +
    +@@ -132,6 +128,7 @@ + import dayjs from 'dayjs'; + + import MsChart from '@/components/pure/chart/index.vue'; ++ import MsRichText from '@/components/pure/ms-rich-text/MsRichText.vue'; + import type { MsTableColumn } from '@/components/pure/ms-table/type'; + import { lastExecuteResultMap } from '@/components/business/ms-case-associate/utils'; + import { IconType } from '@/views/api-test/report/component/reportStatus.vue'; +@@ -784,13 +781,17 @@ + // 可能存在多个自定义卡片 + customCardRef.value.forEach((item) => { + if (item) { +- customCardImages = customCardImages.concat(Array.from(item.querySelectorAll('img'))); ++ customCardImages = customCardImages.concat( ++ Array.from(item.querySelectorAll('img')).filter((e) => e.className !== 'ProseMirror-separator') ++ ); + } + }); + } + if (summaryRef.value[0]) { + // 只有一个总结 +- summaryImages = Array.from(summaryRef.value[0].querySelectorAll('img')); ++ summaryImages = Array.from(summaryRef.value[0].querySelectorAll('img')).filter( ++ (e) => e.className !== 'ProseMirror-separator' ++ ); + } + if (customCardImages.length > 0 || summaryImages.length > 0) { + let loadedImageCount = 0; +@@ -996,4 +997,16 @@ + :deep(#ms-table-footer-wrapper) { + @apply hidden; + } ++ .rich-wrapper { ++ @apply border-none; ++ :deep(.halo-rich-text-editor) { ++ @apply !p-0; ++ .editor-header { ++ @apply hidden; ++ } ++ .tiptap { ++ @apply !p-0; ++ } ++ } ++ } + " +components,https://github.com/angular/components,4183fbc0004a622180e667c245dcf012a394034f,Kristiyan Kostadinov,2016-11-12 03:55:43,fix(button): improved tap responsiveness on mobile (#1792),"* fix(button): improved tap responsiveness on mobile + +Improves the tap responsiveness of buttons on mobile by replacing the `::after` overlay with a DOM node that prevents the default touch action. +Previously, the `::after` overlay would capture the first tap, causing the button to have to tapped twice in order to fire it's click handler.","fix(button): improved tap responsiveness on mobile (#1792) + +* fix(button): improved tap responsiveness on mobile + +Improves the tap responsiveness of buttons on mobile by replacing the `::after` overlay with a DOM node that prevents the default touch action. +Previously, the `::after` overlay would capture the first tap, causing the button to have to tapped twice in order to fire it's click handler. + +Fixes #1316.","diff --git a/src/lib/button/_button-base.scss b/src/lib/button/_button-base.scss +index 33e3cd162b60..43473767f550 100644 +--- a/src/lib/button/_button-base.scss ++++ b/src/lib/button/_button-base.scss +@@ -3,24 +3,6 @@ + @import '../core/style/button-common'; + + +-// Applies a focus style to an md-button element. +-@mixin md-button-focus { +- &::after { +- // The button spec calls for focus on raised buttons (and FABs) to be indicated with a +- // black, 12% opacity shade over the normal color (for both light and dark themes). +- // We do this by placing an :after pseudo-element with the appropriate shade over the button. +- position: absolute; +- top: 0; +- left: 0; +- bottom: 0; +- right: 0; +- content: ''; +- background-color: rgba(black, 0.12); +- border-radius: inherit; +- pointer-events: none; +- } +-} +- + // Flat and raised button standards + $md-button-padding: 0 16px !default; + $md-button-min-width: 88px !default; +@@ -74,7 +56,9 @@ $md-mini-fab-padding: 8px !default; + } + + &.md-button-focus { +- @include md-button-focus(); ++ .md-button-focus-overlay { ++ opacity: 1; ++ } + } + } + +diff --git a/src/lib/button/_button-theme.scss b/src/lib/button/_button-theme.scss +index 8ae3e6322f54..682bbaacbac7 100644 +--- a/src/lib/button/_button-theme.scss ++++ b/src/lib/button/_button-theme.scss +@@ -7,15 +7,15 @@ + $accent: map-get($theme, accent); + $warn: map-get($theme, warn); + +- &.md-primary::after { ++ &.md-primary .md-button-focus-overlay { + background-color: md-color($primary, 0.12); + } + +- &.md-accent::after { ++ &.md-accent .md-button-focus-overlay { + background-color: md-color($accent, 0.12); + } + +- &.md-warn::after { ++ &.md-warn .md-button-focus-overlay { + background-color: md-color($warn, 0.12); + } + } +diff --git a/src/lib/button/button.html b/src/lib/button/button.html +index 99e784458c79..a82eb530bbfd 100644 +--- a/src/lib/button/button.html ++++ b/src/lib/button/button.html +@@ -4,3 +4,5 @@ + [md-ripple-trigger]=""getHostElement()"" + [md-ripple-color]=""isRoundButton() ? 'rgba(255, 255, 255, 0.2)' : ''"" + md-ripple-background-color=""rgba(0, 0, 0, 0)"">
    ++ ++
    +diff --git a/src/lib/button/button.scss b/src/lib/button/button.scss +index 92f3278ef83f..f625ff974e80 100644 +--- a/src/lib/button/button.scss ++++ b/src/lib/button/button.scss +@@ -10,11 +10,13 @@ + // Only flat buttons and icon buttons (not raised or fabs) have a hover style. + &:hover { + // Use the same visual treatment for hover as for focus. +- @include md-button-focus(); ++ .md-button-focus-overlay { ++ opacity: 1; ++ } + } + + &[disabled]:hover { +- &.md-primary, &.md-accent, &.md-warn, &::after { ++ &.md-primary, &.md-accent, &.md-warn, .md-button-focus-overlay { + background-color: transparent; + } + } +@@ -56,7 +58,7 @@ + } + + // The ripple container should match the bounds of the entire button. +-.md-button-ripple { ++.md-button-ripple, .md-button-focus-overlay { + position: absolute; + top: 0; + left: 0; +@@ -64,6 +66,18 @@ + right: 0; + } + ++// Overlay to be used as a tint. Note that the same effect can be achieved by using a pseudo ++// element, however we use a proper DOM element in order to be able to disable the default ++// touch action. This makes the buttons more responsive on touch devices. ++.md-button-focus-overlay { ++ // The button spec calls for focus on raised buttons (and FABs) to be indicated with a ++ // black, 12% opacity shade over the normal color (for both light and dark themes). ++ background-color: rgba(black, 0.12); ++ border-radius: inherit; ++ pointer-events: none; ++ opacity: 0; ++} ++ + // For round buttons, the ripple container should clip child ripples to a circle. + .md-button-ripple-round { + border-radius: 50%;" +WordPress-Android,https://github.com/wordpress-mobile/WordPress-Android,1c78c85a0318c664e9cb71ad25014902f6299066,Petros Paraskevopoulos,2021-04-06 15:09:34,Build: Remove backup download available feature flag,"Since it has been already two weeks after the release of the +'Jetpack Section' project, this feature flag can be now safely removed.","Build: Remove backup download available feature flag + +Since it has been already two weeks after the release of the +'Jetpack Section' project, this feature flag can be now safely removed.","diff --git a/WordPress/build.gradle b/WordPress/build.gradle +index b0aa50910da1..d1fe704f02e0 100644 +--- a/WordPress/build.gradle ++++ b/WordPress/build.gradle +@@ -75,7 +75,6 @@ android { + buildConfigField ""boolean"", ""FEATURE_ANNOUNCEMENT_AVAILABLE"", ""false"" + buildConfigField ""boolean"", ""ENABLE_FEATURE_CONFIGURATION"", ""true"" + buildConfigField ""boolean"", ""MY_SITE_IMPROVEMENTS"", ""false"" +- buildConfigField ""boolean"", ""BACKUP_DOWNLOAD_AVAILABLE"", ""false"" + buildConfigField ""boolean"", ""SEEN_UNSEEN_WITH_COUNTER"", ""false"" + buildConfigField ""boolean"", ""RESTORE_AVAILABLE"", ""false"" + buildConfigField ""boolean"", ""LIKES_ENHANCEMENTS"", ""false"" +diff --git a/WordPress/src/main/java/org/wordpress/android/ui/activitylog/list/ActivityLogListItem.kt b/WordPress/src/main/java/org/wordpress/android/ui/activitylog/list/ActivityLogListItem.kt +index ec2907835469..3f40b5c15544 100644 +--- a/WordPress/src/main/java/org/wordpress/android/ui/activitylog/list/ActivityLogListItem.kt ++++ b/WordPress/src/main/java/org/wordpress/android/ui/activitylog/list/ActivityLogListItem.kt +@@ -3,7 +3,6 @@ package org.wordpress.android.ui.activitylog.list + import androidx.annotation.DrawableRes + import org.wordpress.android.R + import org.wordpress.android.fluxc.model.activity.ActivityLogModel +-import org.wordpress.android.ui.activitylog.list.ActivityLogListItem.Icon.HISTORY + import org.wordpress.android.ui.activitylog.list.ActivityLogListItem.Icon.MORE + import org.wordpress.android.ui.activitylog.list.ActivityLogListItem.ViewType.EVENT + import org.wordpress.android.ui.activitylog.list.ActivityLogListItem.ViewType.FOOTER +@@ -45,7 +44,6 @@ sealed class ActivityLogListItem(val type: ViewType) { + constructor( + model: ActivityLogModel, + rewindDisabled: Boolean = false, +- backupDownloadFeatureEnabled: Boolean, + restoreFeatureEnabled: Boolean + ) : this( + model.activityID, +@@ -57,8 +55,8 @@ sealed class ActivityLogListItem(val type: ViewType) { + model.rewindID, + model.published, + isButtonVisible = !rewindDisabled && model.rewindable ?: false, +- buttonIcon = if (backupDownloadFeatureEnabled) MORE else HISTORY, +- showMoreMenu = backupDownloadFeatureEnabled, ++ buttonIcon = MORE, ++ showMoreMenu = true, + launchRestoreWizard = restoreFeatureEnabled + ) + +diff --git a/WordPress/src/main/java/org/wordpress/android/util/config/BackupDownloadFeatureConfig.kt b/WordPress/src/main/java/org/wordpress/android/util/config/BackupDownloadFeatureConfig.kt +deleted file mode 100644 +index ea127927e0ca..000000000000 +--- a/WordPress/src/main/java/org/wordpress/android/util/config/BackupDownloadFeatureConfig.kt ++++ /dev/null +@@ -1,21 +0,0 @@ +-package org.wordpress.android.util.config +- +-import org.wordpress.android.BuildConfig +-import org.wordpress.android.annotation.Feature +-import org.wordpress.android.util.config.BackupDownloadFeatureConfig.Companion.BACKUP_DOWNLOAD_FLOW +-import javax.inject.Inject +- +-/** +- * Configuration of the 'Jetpack Backup Download' feature. +- */ +-@Feature(remoteField = BACKUP_DOWNLOAD_FLOW, defaultValue = true) +-class BackupDownloadFeatureConfig +-@Inject constructor(appConfig: AppConfig) : FeatureConfig( +- appConfig, +- BuildConfig.BACKUP_DOWNLOAD_AVAILABLE, +- BACKUP_DOWNLOAD_FLOW +-) { +- companion object { +- const val BACKUP_DOWNLOAD_FLOW = ""backup_download_flow"" +- } +-} +diff --git a/WordPress/src/main/java/org/wordpress/android/viewmodel/activitylog/ActivityLogDetailViewModel.kt b/WordPress/src/main/java/org/wordpress/android/viewmodel/activitylog/ActivityLogDetailViewModel.kt +index fa6e5b2b4293..0d19149a7f0e 100644 +--- a/WordPress/src/main/java/org/wordpress/android/viewmodel/activitylog/ActivityLogDetailViewModel.kt ++++ b/WordPress/src/main/java/org/wordpress/android/viewmodel/activitylog/ActivityLogDetailViewModel.kt +@@ -12,7 +12,6 @@ import org.wordpress.android.ui.activitylog.detail.ActivityLogDetailModel + import org.wordpress.android.ui.activitylog.detail.ActivityLogDetailNavigationEvents + import org.wordpress.android.util.AppLog + import org.wordpress.android.util.AppLog.T.ACTIVITY_LOG +-import org.wordpress.android.util.config.BackupDownloadFeatureConfig + import org.wordpress.android.util.config.RestoreFeatureConfig + import org.wordpress.android.util.toFormattedDateString + import org.wordpress.android.util.toFormattedTimeString +@@ -28,8 +27,7 @@ class ActivityLogDetailViewModel + @Inject constructor( + val dispatcher: Dispatcher, + private val activityLogStore: ActivityLogStore, +- private val restoreFeatureConfig: RestoreFeatureConfig, +- private val backupDownloadFeatureConfig: BackupDownloadFeatureConfig ++ private val restoreFeatureConfig: RestoreFeatureConfig + ) : ViewModel() { + lateinit var site: SiteModel + lateinit var activityLogId: String +@@ -61,7 +59,7 @@ class ActivityLogDetailViewModel + this.areButtonsVisible = areButtonsVisible + + _restoreVisible.value = areButtonsVisible +- _downloadBackupVisible.value = areButtonsVisible && backupDownloadFeatureConfig.isEnabled() ++ _downloadBackupVisible.value = areButtonsVisible + + if (activityLogId != _item.value?.activityID) { + _item.value = activityLogStore +diff --git a/WordPress/src/main/java/org/wordpress/android/viewmodel/activitylog/ActivityLogViewModel.kt b/WordPress/src/main/java/org/wordpress/android/viewmodel/activitylog/ActivityLogViewModel.kt +index 2befd2f15192..bee98df4242d 100644 +--- a/WordPress/src/main/java/org/wordpress/android/viewmodel/activitylog/ActivityLogViewModel.kt ++++ b/WordPress/src/main/java/org/wordpress/android/viewmodel/activitylog/ActivityLogViewModel.kt +@@ -33,7 +33,6 @@ import org.wordpress.android.ui.utils.UiString.UiStringResWithParams + import org.wordpress.android.ui.utils.UiString.UiStringText + import org.wordpress.android.util.AppLog + import org.wordpress.android.util.analytics.ActivityLogTracker +-import org.wordpress.android.util.config.BackupDownloadFeatureConfig + import org.wordpress.android.util.config.RestoreFeatureConfig + import org.wordpress.android.util.toFormattedDateString + import org.wordpress.android.util.toFormattedTimeString +@@ -71,7 +70,6 @@ class ActivityLogViewModel @Inject constructor( + private val getBackupDownloadStatusUseCase: GetBackupDownloadStatusUseCase, + private val postDismissBackupDownloadUseCase: PostDismissBackupDownloadUseCase, + private val resourceProvider: ResourceProvider, +- private val backupDownloadFeatureConfig: BackupDownloadFeatureConfig, + private val dateUtils: DateUtils, + private val activityLogTracker: ActivityLogTracker, + private val jetpackCapabilitiesUseCase: JetpackCapabilitiesUseCase, +@@ -209,7 +207,6 @@ class ActivityLogViewModel @Inject constructor( + val currentItem = ActivityLogListItem.Event( + model, + withRestoreProgressItem || withBackupDownloadProgressItem, +- backupDownloadFeatureConfig.isEnabled(), + restoreFeatureConfig.isEnabled() + ) + val lastItem = items.lastOrNull() as? ActivityLogListItem.Event +diff --git a/WordPress/src/test/java/org/wordpress/android/viewmodel/activitylog/ActivityLogDetailViewModelTest.kt b/WordPress/src/test/java/org/wordpress/android/viewmodel/activitylog/ActivityLogDetailViewModelTest.kt +index c9205ef2f2f1..24d7be545b37 100644 +--- a/WordPress/src/test/java/org/wordpress/android/viewmodel/activitylog/ActivityLogDetailViewModelTest.kt ++++ b/WordPress/src/test/java/org/wordpress/android/viewmodel/activitylog/ActivityLogDetailViewModelTest.kt +@@ -22,7 +22,6 @@ import org.wordpress.android.fluxc.tools.FormattableContent + import org.wordpress.android.fluxc.tools.FormattableRange + import org.wordpress.android.ui.activitylog.detail.ActivityLogDetailModel + import org.wordpress.android.ui.activitylog.detail.ActivityLogDetailNavigationEvents +-import org.wordpress.android.util.config.BackupDownloadFeatureConfig + import org.wordpress.android.util.config.RestoreFeatureConfig + import org.wordpress.android.viewmodel.Event + import java.util.Date +@@ -35,7 +34,6 @@ class ActivityLogDetailViewModelTest { + @Mock private lateinit var activityLogStore: ActivityLogStore + @Mock private lateinit var site: SiteModel + @Mock private lateinit var restoreFeatureConfig: RestoreFeatureConfig +- @Mock private lateinit var backupDownloadFeatureConfig: BackupDownloadFeatureConfig + private lateinit var viewModel: ActivityLogDetailViewModel + + private val areButtonsVisible = true +@@ -77,8 +75,7 @@ class ActivityLogDetailViewModelTest { + viewModel = ActivityLogDetailViewModel( + dispatcher, + activityLogStore, +- restoreFeatureConfig, +- backupDownloadFeatureConfig ++ restoreFeatureConfig + ) + viewModel.activityLogItem.observeForever { lastEmittedItem = it } + viewModel.restoreVisible.observeForever { restoreVisible = it } +@@ -112,24 +109,6 @@ class ActivityLogDetailViewModelTest { + assertEquals(false, downloadBackupVisible) + } + +- @Test +- fun `given backup download feature is disabled, when view model starts, then download backup button is shown`() { +- whenever(backupDownloadFeatureConfig.isEnabled()).thenReturn(false) +- +- viewModel.start(site, activityID, true) +- +- assertEquals(false, downloadBackupVisible) +- } +- +- @Test +- fun `given backup download feature is enabled, when view model starts, then download backup button is shown`() { +- whenever(backupDownloadFeatureConfig.isEnabled()).thenReturn(true) +- +- viewModel.start(site, activityID, true) +- +- assertEquals(true, downloadBackupVisible) +- } +- + @Test + fun emitsUIModelOnStart() { + whenever(activityLogStore.getActivityLogForSite(site)).thenReturn(listOf(activityLogModel)) +diff --git a/WordPress/src/test/java/org/wordpress/android/viewmodel/activitylog/ActivityLogViewModelTest.kt b/WordPress/src/test/java/org/wordpress/android/viewmodel/activitylog/ActivityLogViewModelTest.kt +index fd88d4a3cd8e..fd48823db2b2 100644 +--- a/WordPress/src/test/java/org/wordpress/android/viewmodel/activitylog/ActivityLogViewModelTest.kt ++++ b/WordPress/src/test/java/org/wordpress/android/viewmodel/activitylog/ActivityLogViewModelTest.kt +@@ -56,7 +56,6 @@ import org.wordpress.android.ui.utils.UiString.UiStringRes + import org.wordpress.android.ui.utils.UiString.UiStringResWithParams + import org.wordpress.android.ui.utils.UiString.UiStringText + import org.wordpress.android.util.analytics.ActivityLogTracker +-import org.wordpress.android.util.config.BackupDownloadFeatureConfig + import org.wordpress.android.util.config.RestoreFeatureConfig + import org.wordpress.android.viewmodel.Event + import org.wordpress.android.viewmodel.ResourceProvider +@@ -112,7 +111,6 @@ class ActivityLogViewModelTest { + @Mock private lateinit var getRestoreStatusUseCase: GetRestoreStatusUseCase + @Mock private lateinit var getBackupDownloadStatusUseCase: GetBackupDownloadStatusUseCase + @Mock private lateinit var resourceProvider: ResourceProvider +- @Mock private lateinit var backupDownloadFeatureConfig: BackupDownloadFeatureConfig + @Mock private lateinit var dateUtils: DateUtils + @Mock private lateinit var activityLogTracker: ActivityLogTracker + @Mock private lateinit var jetpackCapabilitiesUseCase: JetpackCapabilitiesUseCase +@@ -143,7 +141,6 @@ class ActivityLogViewModelTest { + getBackupDownloadStatusUseCase, + postDismissBackupDownloadUseCase, + resourceProvider, +- backupDownloadFeatureConfig, + dateUtils, + activityLogTracker, + jetpackCapabilitiesUseCase, +@@ -1622,21 +1619,18 @@ class ActivityLogViewModelTest { + private fun firstItem(rewindDisabled: Boolean) = ActivityLogListItem.Event( + model = activityList[0], + rewindDisabled = rewindDisabled, +- backupDownloadFeatureEnabled = false, + restoreFeatureEnabled = false + ) + + private fun secondItem(rewindDisabled: Boolean) = ActivityLogListItem.Event( + model = activityList[1], + rewindDisabled = rewindDisabled, +- backupDownloadFeatureEnabled = false, + restoreFeatureEnabled = false + ) + + private fun thirdItem(rewindDisabled: Boolean) = ActivityLogListItem.Event( + model = activityList[2], + rewindDisabled = rewindDisabled, +- backupDownloadFeatureEnabled = false, + restoreFeatureEnabled = false + )" +medusa,https://github.com/medusajs/medusa,c16df9383c08288f3643fde7aadad1becb2e4c9d,olivermrbl,2022-01-11 21:24:08,chore(release): Publish,"- create-medusa-app@0.0.6 +- gatsby-source-medusa@0.0.47 +- @medusajs/medusa-cli@1.1.27 +- medusa-file-minio@1.0.4 +- medusa-file-s3@1.0.12 +- medusa-file-spaces@1.1.37 +- @medusajs/medusa-js@1.0.10 +- medusa-payment-adyen@1.1.39 +- medusa-payment-klarna@1.1.39 +- medusa-payment-manual@1.0.16 +- medusa-payment-paypal@1.0.38 +- medusa-payment-stripe@1.1.38 +- medusa-plugin-add-ons@1.1.37 +- medusa-plugin-brightpearl@1.1.43 +- medusa-plugin-contentful@1.1.40 +- medusa-plugin-economic@1.1.37 +- medusa-plugin-mailchimp@1.1.37 +- medusa-plugin-permissions@1.1.37 +- medusa-plugin-restock-notification@0.0.30 +- medusa-plugin-segment@1.1.40 +- medusa-plugin-sendgrid@1.1.38 +- medusa-plugin-slack-notification@1.1.37 +- medusa-plugin-twilio-sms@1.1.37 +- medusa-plugin-wishlist@1.1.37 +- medusa-react@0.1.3 +- medusa-source-shopify@1.0.3 +- medusa-test-utils@1.1.37 +- @medusajs/medusa@1.1.62","chore(release): Publish + + - create-medusa-app@0.0.6 + - gatsby-source-medusa@0.0.47 + - @medusajs/medusa-cli@1.1.27 + - medusa-file-minio@1.0.4 + - medusa-file-s3@1.0.12 + - medusa-file-spaces@1.1.37 + - @medusajs/medusa-js@1.0.10 + - medusa-payment-adyen@1.1.39 + - medusa-payment-klarna@1.1.39 + - medusa-payment-manual@1.0.16 + - medusa-payment-paypal@1.0.38 + - medusa-payment-stripe@1.1.38 + - medusa-plugin-add-ons@1.1.37 + - medusa-plugin-brightpearl@1.1.43 + - medusa-plugin-contentful@1.1.40 + - medusa-plugin-economic@1.1.37 + - medusa-plugin-mailchimp@1.1.37 + - medusa-plugin-permissions@1.1.37 + - medusa-plugin-restock-notification@0.0.30 + - medusa-plugin-segment@1.1.40 + - medusa-plugin-sendgrid@1.1.38 + - medusa-plugin-slack-notification@1.1.37 + - medusa-plugin-twilio-sms@1.1.37 + - medusa-plugin-wishlist@1.1.37 + - medusa-react@0.1.3 + - medusa-source-shopify@1.0.3 + - medusa-test-utils@1.1.37 + - @medusajs/medusa@1.1.62","diff --git a/packages/create-medusa-app/CHANGELOG.md b/packages/create-medusa-app/CHANGELOG.md +index d360f9248012c..c99546bef540e 100644 +--- a/packages/create-medusa-app/CHANGELOG.md ++++ b/packages/create-medusa-app/CHANGELOG.md +@@ -3,6 +3,17 @@ + All notable changes to this project will be documented in this file. + See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ++## [0.0.6](https://github.com/medusajs/medusa/compare/create-medusa-app@0.0.5...create-medusa-app@0.0.6) (2022-01-11) ++ ++ ++### Features ++ ++* **create-medusa-app:** add medusa.express ([#981](https://github.com/medusajs/medusa/issues/981)) ([bbc16d6](https://github.com/medusajs/medusa/commit/bbc16d6b115fb389ee0fe58d909e74a162686163)) ++ ++ ++ ++ ++ + ## [0.0.5](https://github.com/medusajs/medusa/compare/create-medusa-app@0.0.3...create-medusa-app@0.0.5) (2021-10-18) + + **Note:** Version bump only for package create-medusa-app +diff --git a/packages/create-medusa-app/package.json b/packages/create-medusa-app/package.json +index a66cd06935dbc..6a101b2cc44f8 100644 +--- a/packages/create-medusa-app/package.json ++++ b/packages/create-medusa-app/package.json +@@ -1,6 +1,6 @@ + { + ""name"": ""create-medusa-app"", +- ""version"": ""0.0.5"", ++ ""version"": ""0.0.6"", + ""main"": ""dist/index.js"", + ""bin"": ""cli.js"", + ""license"": ""MIT"", +diff --git a/packages/gatsby-source-medusa/CHANGELOG.md b/packages/gatsby-source-medusa/CHANGELOG.md +index 0bffd9a0eb4d9..9c64986d947f6 100644 +--- a/packages/gatsby-source-medusa/CHANGELOG.md ++++ b/packages/gatsby-source-medusa/CHANGELOG.md +@@ -3,6 +3,14 @@ + All notable changes to this project will be documented in this file. + See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ++## [0.0.47](https://github.com/medusajs/medusa/compare/gatsby-source-medusa@0.0.46...gatsby-source-medusa@0.0.47) (2022-01-11) ++ ++**Note:** Version bump only for package gatsby-source-medusa ++ ++ ++ ++ ++ + ## [0.0.46](https://github.com/medusajs/medusa/compare/gatsby-source-medusa@0.0.45...gatsby-source-medusa@0.0.46) (2021-12-29) + + **Note:** Version bump only for package gatsby-source-medusa +diff --git a/packages/gatsby-source-medusa/package.json b/packages/gatsby-source-medusa/package.json +index 6e14f1dcd178e..82c88863045b6 100644 +--- a/packages/gatsby-source-medusa/package.json ++++ b/packages/gatsby-source-medusa/package.json +@@ -1,6 +1,6 @@ + { + ""name"": ""gatsby-source-medusa"", +- ""version"": ""0.0.46"", ++ ""version"": ""0.0.47"", + ""description"": ""Gatsby source plugin for building websites using Medusa Commerce as a data source"", + ""scripts"": { + ""test"": ""jest --watchAll"", +diff --git a/packages/medusa-cli/CHANGELOG.md b/packages/medusa-cli/CHANGELOG.md +index bc4681382a54c..e690025eb736d 100644 +--- a/packages/medusa-cli/CHANGELOG.md ++++ b/packages/medusa-cli/CHANGELOG.md +@@ -3,6 +3,14 @@ + All notable changes to this project will be documented in this file. + See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ++## [1.1.27](https://github.com/medusajs/medusa/compare/@medusajs/medusa-cli@1.1.26...@medusajs/medusa-cli@1.1.27) (2022-01-11) ++ ++**Note:** Version bump only for package @medusajs/medusa-cli ++ ++ ++ ++ ++ + ## [1.1.26](https://github.com/medusajs/medusa/compare/@medusajs/medusa-cli@1.1.25...@medusajs/medusa-cli@1.1.26) (2021-12-29) + + **Note:** Version bump only for package @medusajs/medusa-cli +diff --git a/packages/medusa-cli/package.json b/packages/medusa-cli/package.json +index c643de4a3c9ea..f31912c9b4401 100644 +--- a/packages/medusa-cli/package.json ++++ b/packages/medusa-cli/package.json +@@ -1,6 +1,6 @@ + { + ""name"": ""@medusajs/medusa-cli"", +- ""version"": ""1.1.26"", ++ ""version"": ""1.1.27"", + ""description"": ""Command Line interface for Medusa Commerce"", + ""main"": ""dist/index.js"", + ""bin"": { +diff --git a/packages/medusa-file-minio/CHANGELOG.md b/packages/medusa-file-minio/CHANGELOG.md +index bfa0728f867e3..bcc6ab61b6de4 100644 +--- a/packages/medusa-file-minio/CHANGELOG.md ++++ b/packages/medusa-file-minio/CHANGELOG.md +@@ -3,6 +3,14 @@ + All notable changes to this project will be documented in this file. + See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ++## [1.0.4](https://github.com/medusajs/medusa/compare/medusa-file-minio@1.0.3...medusa-file-minio@1.0.4) (2022-01-11) ++ ++**Note:** Version bump only for package medusa-file-minio ++ ++ ++ ++ ++ + ## [1.0.3](https://github.com/medusajs/medusa/compare/medusa-file-minio@1.0.2...medusa-file-minio@1.0.3) (2021-12-29) + + **Note:** Version bump only for package medusa-file-minio +diff --git a/packages/medusa-file-minio/package.json b/packages/medusa-file-minio/package.json +index 3bf6b75537c1d..32ffc81580cf4 100644 +--- a/packages/medusa-file-minio/package.json ++++ b/packages/medusa-file-minio/package.json +@@ -1,6 +1,6 @@ + { + ""name"": ""medusa-file-minio"", +- ""version"": ""1.0.3"", ++ ""version"": ""1.0.4"", + ""description"": ""MinIO server file connector for Medusa"", + ""main"": ""index.js"", + ""repository"": { +@@ -40,7 +40,7 @@ + ""body-parser"": ""^1.19.0"", + ""express"": ""^4.17.1"", + ""medusa-core-utils"": ""^1.1.31"", +- ""medusa-test-utils"": ""^1.1.36"" ++ ""medusa-test-utils"": ""^1.1.37"" + }, + ""gitHead"": ""3bbd1e8507e00bc471de6ae3c30207999a4a4011"" + } +diff --git a/packages/medusa-file-s3/CHANGELOG.md b/packages/medusa-file-s3/CHANGELOG.md +index e84470ec3e35d..61b51c8feab38 100644 +--- a/packages/medusa-file-s3/CHANGELOG.md ++++ b/packages/medusa-file-s3/CHANGELOG.md +@@ -3,6 +3,14 @@ + All notable changes to this project will be documented in this file. + See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ++## [1.0.12](https://github.com/medusajs/medusa/compare/medusa-file-s3@1.0.11...medusa-file-s3@1.0.12) (2022-01-11) ++ ++**Note:** Version bump only for package medusa-file-s3 ++ ++ ++ ++ ++ + ## [1.0.11](https://github.com/medusajs/medusa/compare/medusa-file-s3@1.0.10...medusa-file-s3@1.0.11) (2021-12-29) + + **Note:** Version bump only for package medusa-file-s3 +diff --git a/packages/medusa-file-s3/package.json b/packages/medusa-file-s3/package.json +index 62a4d739ef22c..b28291ff33f1a 100644 +--- a/packages/medusa-file-s3/package.json ++++ b/packages/medusa-file-s3/package.json +@@ -1,6 +1,6 @@ + { + ""name"": ""medusa-file-s3"", +- ""version"": ""1.0.11"", ++ ""version"": ""1.0.12"", + ""description"": ""AWS s3 file connector for Medusa"", + ""main"": ""index.js"", + ""repository"": { +@@ -41,7 +41,7 @@ + ""body-parser"": ""^1.19.0"", + ""express"": ""^4.17.1"", + ""medusa-core-utils"": ""^1.1.31"", +- ""medusa-test-utils"": ""^1.1.36"" ++ ""medusa-test-utils"": ""^1.1.37"" + }, + ""gitHead"": ""81a7ff73d012fda722f6e9ef0bd9ba0232d37808"" + } +diff --git a/packages/medusa-file-spaces/CHANGELOG.md b/packages/medusa-file-spaces/CHANGELOG.md +index 3ee85dbd6145a..d6a1dff16b659 100644 +--- a/packages/medusa-file-spaces/CHANGELOG.md ++++ b/packages/medusa-file-spaces/CHANGELOG.md +@@ -3,6 +3,14 @@ + All notable changes to this project will be documented in this file. + See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ++## [1.1.37](https://github.com/medusajs/medusa/compare/medusa-file-spaces@1.1.36...medusa-file-spaces@1.1.37) (2022-01-11) ++ ++**Note:** Version bump only for package medusa-file-spaces ++ ++ ++ ++ ++ + ## [1.1.36](https://github.com/medusajs/medusa/compare/medusa-file-spaces@1.1.35...medusa-file-spaces@1.1.36) (2021-12-29) + + **Note:** Version bump only for package medusa-file-spaces +diff --git a/packages/medusa-file-spaces/package.json b/packages/medusa-file-spaces/package.json +index 7b3dff430d5be..74cc000737da9 100644 +--- a/packages/medusa-file-spaces/package.json ++++ b/packages/medusa-file-spaces/package.json +@@ -1,6 +1,6 @@ + { + ""name"": ""medusa-file-spaces"", +- ""version"": ""1.1.36"", ++ ""version"": ""1.1.37"", + ""description"": ""Digital Ocean Spaces file connector for Medusa"", + ""main"": ""index.js"", + ""repository"": { +@@ -41,7 +41,7 @@ + ""body-parser"": ""^1.19.0"", + ""express"": ""^4.17.1"", + ""medusa-core-utils"": ""^1.1.31"", +- ""medusa-test-utils"": ""^1.1.36"", ++ ""medusa-test-utils"": ""^1.1.37"", + ""stripe"": ""^8.50.0"" + }, + ""gitHead"": ""81a7ff73d012fda722f6e9ef0bd9ba0232d37808"" +diff --git a/packages/medusa-js/CHANGELOG.md b/packages/medusa-js/CHANGELOG.md +index 03acd1b82b4e1..24bb840cb2664 100644 +--- a/packages/medusa-js/CHANGELOG.md ++++ b/packages/medusa-js/CHANGELOG.md +@@ -3,6 +3,19 @@ + All notable changes to this project will be documented in this file. + See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ++## [1.0.10](https://github.com/medusajs/medusa-js/compare/@medusajs/medusa-js@1.0.9...@medusajs/medusa-js@1.0.10) (2022-01-11) ++ ++ ++### Bug Fixes ++ ++* client admin endpoints ([#956](https://github.com/medusajs/medusa-js/issues/956)) ([2efab08](https://github.com/medusajs/medusa-js/commit/2efab08040917a2971852d741b82f86134dda075)) ++* medusa-js admin endpoint types ([#968](https://github.com/medusajs/medusa-js/issues/968)) ([7cc3640](https://github.com/medusajs/medusa-js/commit/7cc36407962f4cc2b3ddc33ace0e2ffb8cc61c1b)) ++* Type in AdminProductListTagsRes to use tags instead of types ([#958](https://github.com/medusajs/medusa-js/issues/958)) ([0ac52b7](https://github.com/medusajs/medusa-js/commit/0ac52b70fa23d9aa3ba6b5e220943ed15db4e643)) ++ ++ ++ ++ ++ + ## [1.0.9](https://github.com/medusajs/medusa-js/compare/@medusajs/medusa-js@1.0.8...@medusajs/medusa-js@1.0.9) (2021-12-29) + + **Note:** Version bump only for package @medusajs/medusa-js +diff --git a/packages/medusa-js/package.json b/packages/medusa-js/package.json +index 0cb8b47fa8bde..f904a295427b3 100644 +--- a/packages/medusa-js/package.json ++++ b/packages/medusa-js/package.json +@@ -1,6 +1,6 @@ + { + ""name"": ""@medusajs/medusa-js"", +- ""version"": ""1.0.9"", ++ ""version"": ""1.0.10"", + ""description"": ""Client for Medusa Commerce Rest API"", + ""main"": ""./dist/index.js"", + ""types"": ""./dist/index.d.ts"", +@@ -15,7 +15,7 @@ + ""author"": ""Oliver Juhl"", + ""license"": ""MIT"", + ""dependencies"": { +- ""@medusajs/medusa"": ""^1.1.61"", ++ ""@medusajs/medusa"": ""^1.1.62"", + ""axios"": ""^0.24.0"", + ""form-data"": ""^4.0.0"", + ""retry-axios"": ""^2.6.0"" +diff --git a/packages/medusa-payment-adyen/CHANGELOG.md b/packages/medusa-payment-adyen/CHANGELOG.md +index 834b31a6b08a5..01e2849b44106 100644 +--- a/packages/medusa-payment-adyen/CHANGELOG.md ++++ b/packages/medusa-payment-adyen/CHANGELOG.md +@@ -3,6 +3,14 @@ + All notable changes to this project will be documented in this file. + See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ++## [1.1.39](https://github.com/medusajs/medusa/compare/medusa-payment-adyen@1.1.38...medusa-payment-adyen@1.1.39) (2022-01-11) ++ ++**Note:** Version bump only for package medusa-payment-adyen ++ ++ ++ ++ ++ + ## [1.1.38](https://github.com/medusajs/medusa/compare/medusa-payment-adyen@1.1.37...medusa-payment-adyen@1.1.38) (2021-12-29) + + **Note:** Version bump only for package medusa-payment-adyen +diff --git a/packages/medusa-payment-adyen/package.json b/packages/medusa-payment-adyen/package.json +index cc0b6db792723..226620bb54c19 100644 +--- a/packages/medusa-payment-adyen/package.json ++++ b/packages/medusa-payment-adyen/package.json +@@ -1,6 +1,6 @@ + { + ""name"": ""medusa-payment-adyen"", +- ""version"": ""1.1.38"", ++ ""version"": ""1.1.39"", + ""description"": ""Adyen Payment provider for Medusa Commerce"", + ""main"": ""index.js"", + ""repository"": { +@@ -24,7 +24,7 @@ + ""cross-env"": ""^7.0.2"", + ""eslint"": ""^6.8.0"", + ""jest"": ""^25.5.2"", +- ""medusa-test-utils"": ""^1.1.36"" ++ ""medusa-test-utils"": ""^1.1.37"" + }, + ""scripts"": { + ""build"": ""babel src -d ."", +diff --git a/packages/medusa-payment-klarna/CHANGELOG.md b/packages/medusa-payment-klarna/CHANGELOG.md +index 920d2bb5429e3..a6b194f91138f 100644 +--- a/packages/medusa-payment-klarna/CHANGELOG.md ++++ b/packages/medusa-payment-klarna/CHANGELOG.md +@@ -3,6 +3,14 @@ + All notable changes to this project will be documented in this file. + See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ++## [1.1.39](https://github.com/medusajs/medusa/compare/medusa-payment-klarna@1.1.38...medusa-payment-klarna@1.1.39) (2022-01-11) ++ ++**Note:** Version bump only for package medusa-payment-klarna ++ ++ ++ ++ ++ + ## [1.1.38](https://github.com/medusajs/medusa/compare/medusa-payment-klarna@1.1.37...medusa-payment-klarna@1.1.38) (2021-12-29) + + **Note:** Version bump only for package medusa-payment-klarna +diff --git a/packages/medusa-payment-klarna/package.json b/packages/medusa-payment-klarna/package.json +index 2a96873c82725..7a3f71552132d 100644 +--- a/packages/medusa-payment-klarna/package.json ++++ b/packages/medusa-payment-klarna/package.json +@@ -1,6 +1,6 @@ + { + ""name"": ""medusa-payment-klarna"", +- ""version"": ""1.1.38"", ++ ""version"": ""1.1.39"", + ""description"": ""Klarna Payment provider for Medusa Commerce"", + ""main"": ""index.js"", + ""repository"": { +@@ -41,7 +41,7 @@ + ""body-parser"": ""^1.19.0"", + ""express"": ""^4.17.1"", + ""medusa-core-utils"": ""^1.1.31"", +- ""medusa-test-utils"": ""^1.1.36"" ++ ""medusa-test-utils"": ""^1.1.37"" + }, + ""gitHead"": ""3bbd1e8507e00bc471de6ae3c30207999a4a4011"" + } +diff --git a/packages/medusa-payment-manual/CHANGELOG.md b/packages/medusa-payment-manual/CHANGELOG.md +index 93502fe44da52..8a7f634340ec7 100644 +--- a/packages/medusa-payment-manual/CHANGELOG.md ++++ b/packages/medusa-payment-manual/CHANGELOG.md +@@ -3,6 +3,14 @@ + All notable changes to this project will be documented in this file. + See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ++## [1.0.16](https://github.com/medusajs/medusa/compare/medusa-payment-manual@1.0.15...medusa-payment-manual@1.0.16) (2022-01-11) ++ ++**Note:** Version bump only for package medusa-payment-manual ++ ++ ++ ++ ++ + ## [1.0.15](https://github.com/medusajs/medusa/compare/medusa-payment-manual@1.0.14...medusa-payment-manual@1.0.15) (2021-12-29) + + **Note:** Version bump only for package medusa-payment-manual +diff --git a/packages/medusa-payment-manual/package.json b/packages/medusa-payment-manual/package.json +index 69ab67f3c10ff..ae19a0c87d084 100644 +--- a/packages/medusa-payment-manual/package.json ++++ b/packages/medusa-payment-manual/package.json +@@ -1,6 +1,6 @@ + { + ""name"": ""medusa-payment-manual"", +- ""version"": ""1.0.15"", ++ ""version"": ""1.0.16"", + ""description"": ""A dummy payment provider to be used for testing or manual payments"", + ""main"": ""index.js"", + ""repository"": { +@@ -25,7 +25,7 @@ + ""cross-env"": ""^5.2.1"", + ""eslint"": ""^6.8.0"", + ""jest"": ""^25.5.2"", +- ""medusa-test-utils"": ""^1.1.36"" ++ ""medusa-test-utils"": ""^1.1.37"" + }, + ""scripts"": { + ""build"": ""babel src -d . --ignore **/__tests__"", +diff --git a/packages/medusa-payment-paypal/CHANGELOG.md b/packages/medusa-payment-paypal/CHANGELOG.md +index 44c2e750eeee3..074dcc8909653 100644 +--- a/packages/medusa-payment-paypal/CHANGELOG.md ++++ b/packages/medusa-payment-paypal/CHANGELOG.md +@@ -3,6 +3,14 @@ + All notable changes to this project will be documented in this file. + See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ++## [1.0.38](https://github.com/medusajs/medusa/compare/medusa-payment-paypal@1.0.37...medusa-payment-paypal@1.0.38) (2022-01-11) ++ ++**Note:** Version bump only for package medusa-payment-paypal ++ ++ ++ ++ ++ + ## [1.0.37](https://github.com/medusajs/medusa/compare/medusa-payment-paypal@1.0.36...medusa-payment-paypal@1.0.37) (2021-12-29) + + **Note:** Version bump only for package medusa-payment-paypal +diff --git a/packages/medusa-payment-paypal/package.json b/packages/medusa-payment-paypal/package.json +index 0fc36fa5fa3f6..e3ba89ab9ef42 100644 +--- a/packages/medusa-payment-paypal/package.json ++++ b/packages/medusa-payment-paypal/package.json +@@ -1,6 +1,6 @@ + { + ""name"": ""medusa-payment-paypal"", +- ""version"": ""1.0.37"", ++ ""version"": ""1.0.38"", + ""description"": ""Paypal Payment provider for Meduas Commerce"", + ""main"": ""index.js"", + ""repository"": { +@@ -27,7 +27,7 @@ + ""eslint"": ""^6.8.0"", + ""jest"": ""^25.5.2"", + ""medusa-interfaces"": ""^1.1.32"", +- ""medusa-test-utils"": ""^1.1.36"" ++ ""medusa-test-utils"": ""^1.1.37"" + }, + ""scripts"": { + ""build"": ""babel src -d . --ignore **/__tests__,**/__mocks__"", +diff --git a/packages/medusa-payment-stripe/CHANGELOG.md b/packages/medusa-payment-stripe/CHANGELOG.md +index a53094d9b3f94..94ac6b13edbe9 100644 +--- a/packages/medusa-payment-stripe/CHANGELOG.md ++++ b/packages/medusa-payment-stripe/CHANGELOG.md +@@ -3,6 +3,14 @@ + All notable changes to this project will be documented in this file. + See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ++## [1.1.38](https://github.com/medusajs/medusa/compare/medusa-payment-stripe@1.1.37...medusa-payment-stripe@1.1.38) (2022-01-11) ++ ++**Note:** Version bump only for package medusa-payment-stripe ++ ++ ++ ++ ++ + ## [1.1.37](https://github.com/medusajs/medusa/compare/medusa-payment-stripe@1.1.36...medusa-payment-stripe@1.1.37) (2021-12-29) + + **Note:** Version bump only for package medusa-payment-stripe +diff --git a/packages/medusa-payment-stripe/package.json b/packages/medusa-payment-stripe/package.json +index bcf7e0f3be7b3..6d07f9b34763a 100644 +--- a/packages/medusa-payment-stripe/package.json ++++ b/packages/medusa-payment-stripe/package.json +@@ -1,6 +1,6 @@ + { + ""name"": ""medusa-payment-stripe"", +- ""version"": ""1.1.37"", ++ ""version"": ""1.1.38"", + ""description"": ""Stripe Payment provider for Meduas Commerce"", + ""main"": ""index.js"", + ""repository"": { +@@ -26,7 +26,7 @@ + ""cross-env"": ""^5.2.1"", + ""eslint"": ""^6.8.0"", + ""jest"": ""^25.5.2"", +- ""medusa-test-utils"": ""^1.1.36"" ++ ""medusa-test-utils"": ""^1.1.37"" + }, + ""scripts"": { + ""build"": ""babel src -d . --ignore **/__tests__"", +diff --git a/packages/medusa-plugin-add-ons/CHANGELOG.md b/packages/medusa-plugin-add-ons/CHANGELOG.md +index fb37d0206ca4e..4301b152b8c63 100644 +--- a/packages/medusa-plugin-add-ons/CHANGELOG.md ++++ b/packages/medusa-plugin-add-ons/CHANGELOG.md +@@ -3,6 +3,14 @@ + All notable changes to this project will be documented in this file. + See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ++## [1.1.37](https://github.com/medusajs/medusa/compare/medusa-plugin-add-ons@1.1.36...medusa-plugin-add-ons@1.1.37) (2022-01-11) ++ ++**Note:** Version bump only for package medusa-plugin-add-ons ++ ++ ++ ++ ++ + ## [1.1.36](https://github.com/medusajs/medusa/compare/medusa-plugin-add-ons@1.1.35...medusa-plugin-add-ons@1.1.36) (2021-12-29) + + **Note:** Version bump only for package medusa-plugin-add-ons +diff --git a/packages/medusa-plugin-add-ons/package.json b/packages/medusa-plugin-add-ons/package.json +index 180e7c865ae59..a525bcbfee7ce 100644 +--- a/packages/medusa-plugin-add-ons/package.json ++++ b/packages/medusa-plugin-add-ons/package.json +@@ -1,6 +1,6 @@ + { + ""name"": ""medusa-plugin-add-ons"", +- ""version"": ""1.1.36"", ++ ""version"": ""1.1.37"", + ""description"": ""Add-on plugin for Medusa Commerce"", + ""main"": ""index.js"", + ""repository"": { +@@ -25,7 +25,7 @@ + ""cross-env"": ""^7.0.2"", + ""eslint"": ""^6.8.0"", + ""jest"": ""^25.5.2"", +- ""medusa-test-utils"": ""^1.1.36"" ++ ""medusa-test-utils"": ""^1.1.37"" + }, + ""scripts"": { + ""build"": ""babel src -d . --ignore **/__tests__"", +diff --git a/packages/medusa-plugin-brightpearl/CHANGELOG.md b/packages/medusa-plugin-brightpearl/CHANGELOG.md +index 8f2a439d97f17..a205a8f49fba1 100644 +--- a/packages/medusa-plugin-brightpearl/CHANGELOG.md ++++ b/packages/medusa-plugin-brightpearl/CHANGELOG.md +@@ -3,6 +3,14 @@ + All notable changes to this project will be documented in this file. + See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ++## [1.1.43](https://github.com/medusajs/medusa/compare/medusa-plugin-brightpearl@1.1.42...medusa-plugin-brightpearl@1.1.43) (2022-01-11) ++ ++**Note:** Version bump only for package medusa-plugin-brightpearl ++ ++ ++ ++ ++ + ## [1.1.42](https://github.com/medusajs/medusa/compare/medusa-plugin-brightpearl@1.1.41...medusa-plugin-brightpearl@1.1.42) (2021-12-29) + + **Note:** Version bump only for package medusa-plugin-brightpearl +diff --git a/packages/medusa-plugin-brightpearl/package.json b/packages/medusa-plugin-brightpearl/package.json +index 5ae3d9f253051..698ec24e4ebb2 100644 +--- a/packages/medusa-plugin-brightpearl/package.json ++++ b/packages/medusa-plugin-brightpearl/package.json +@@ -1,6 +1,6 @@ + { + ""name"": ""medusa-plugin-brightpearl"", +- ""version"": ""1.1.42"", ++ ""version"": ""1.1.43"", + ""description"": ""Brightpearl plugin for Medusa Commerce"", + ""main"": ""index.js"", + ""repository"": { +@@ -28,7 +28,7 @@ + ""eslint"": ""^6.8.0"", + ""jest"": ""^25.5.2"", + ""medusa-interfaces"": ""^1.1.32"", +- ""medusa-test-utils"": ""^1.1.36"", ++ ""medusa-test-utils"": ""^1.1.37"", + ""prettier"": ""^2.0.5"" + }, + ""scripts"": { +diff --git a/packages/medusa-plugin-contentful/CHANGELOG.md b/packages/medusa-plugin-contentful/CHANGELOG.md +index 3eeaff2454b3c..338db9d19ac65 100644 +--- a/packages/medusa-plugin-contentful/CHANGELOG.md ++++ b/packages/medusa-plugin-contentful/CHANGELOG.md +@@ -3,6 +3,14 @@ + All notable changes to this project will be documented in this file. + See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ++## [1.1.40](https://github.com/medusajs/medusa/compare/medusa-plugin-contentful@1.1.39...medusa-plugin-contentful@1.1.40) (2022-01-11) ++ ++**Note:** Version bump only for package medusa-plugin-contentful ++ ++ ++ ++ ++ + ## [1.1.39](https://github.com/medusajs/medusa/compare/medusa-plugin-contentful@1.1.38...medusa-plugin-contentful@1.1.39) (2021-12-29) + + **Note:** Version bump only for package medusa-plugin-contentful +diff --git a/packages/medusa-plugin-contentful/package.json b/packages/medusa-plugin-contentful/package.json +index a4c2ef70b8c26..72f1df4380c84 100644 +--- a/packages/medusa-plugin-contentful/package.json ++++ b/packages/medusa-plugin-contentful/package.json +@@ -1,6 +1,6 @@ + { + ""name"": ""medusa-plugin-contentful"", +- ""version"": ""1.1.39"", ++ ""version"": ""1.1.40"", + ""description"": ""Contentful plugin for Medusa Commerce"", + ""main"": ""index.js"", + ""repository"": { +@@ -40,7 +40,7 @@ + ""contentful-management"": ""^5.27.1"", + ""express"": ""^4.17.1"", + ""medusa-core-utils"": ""^1.1.31"", +- ""medusa-test-utils"": ""^1.1.36"", ++ ""medusa-test-utils"": ""^1.1.37"", + ""redis"": ""^3.0.2"" + }, + ""gitHead"": ""3bbd1e8507e00bc471de6ae3c30207999a4a4011"" +diff --git a/packages/medusa-plugin-economic/CHANGELOG.md b/packages/medusa-plugin-economic/CHANGELOG.md +index d0999899fb542..3efec34299d45 100644 +--- a/packages/medusa-plugin-economic/CHANGELOG.md ++++ b/packages/medusa-plugin-economic/CHANGELOG.md +@@ -3,6 +3,14 @@ + All notable changes to this project will be documented in this file. + See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ++## [1.1.37](https://github.com/medusajs/medusa/compare/medusa-plugin-economic@1.1.36...medusa-plugin-economic@1.1.37) (2022-01-11) ++ ++**Note:** Version bump only for package medusa-plugin-economic ++ ++ ++ ++ ++ + ## [1.1.36](https://github.com/medusajs/medusa/compare/medusa-plugin-economic@1.1.35...medusa-plugin-economic@1.1.36) (2021-12-29) + + **Note:** Version bump only for package medusa-plugin-economic +diff --git a/packages/medusa-plugin-economic/package-lock.json b/packages/medusa-plugin-economic/package-lock.json +index 9fca219d9dd06..e853af6d57748 100644 +--- a/packages/medusa-plugin-economic/package-lock.json ++++ b/packages/medusa-plugin-economic/package-lock.json +@@ -1,6 +1,6 @@ + { + ""name"": ""medusa-plugin-economic"", +- ""version"": ""1.1.36"", ++ ""version"": ""1.1.37"", + ""lockfileVersion"": 1, + ""requires"": true, + ""dependencies"": { +diff --git a/packages/medusa-plugin-economic/package.json b/packages/medusa-plugin-economic/package.json +index fe3f95e3fb1c2..e3b1397a3a908 100644 +--- a/packages/medusa-plugin-economic/package.json ++++ b/packages/medusa-plugin-economic/package.json +@@ -1,6 +1,6 @@ + { + ""name"": ""medusa-plugin-economic"", +- ""version"": ""1.1.36"", ++ ""version"": ""1.1.37"", + ""description"": ""E-conomic financial reporting"", + ""main"": ""index.js"", + ""repository"": { +@@ -40,7 +40,7 @@ + ""body-parser"": ""^1.19.0"", + ""express"": ""^4.17.1"", + ""medusa-core-utils"": ""^1.1.31"", +- ""medusa-test-utils"": ""^1.1.36"", ++ ""medusa-test-utils"": ""^1.1.37"", + ""moment"": ""^2.27.0"" + }, + ""gitHead"": ""3bbd1e8507e00bc471de6ae3c30207999a4a4011"" +diff --git a/packages/medusa-plugin-mailchimp/CHANGELOG.md b/packages/medusa-plugin-mailchimp/CHANGELOG.md +index 72aa1c476f823..c02d3bff2f95e 100644 +--- a/packages/medusa-plugin-mailchimp/CHANGELOG.md ++++ b/packages/medusa-plugin-mailchimp/CHANGELOG.md +@@ -3,6 +3,14 @@ + All notable changes to this project will be documented in this file. + See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ++## [1.1.37](https://github.com/medusajs/medusa/compare/medusa-plugin-mailchimp@1.1.36...medusa-plugin-mailchimp@1.1.37) (2022-01-11) ++ ++**Note:** Version bump only for package medusa-plugin-mailchimp ++ ++ ++ ++ ++ + ## [1.1.36](https://github.com/medusajs/medusa/compare/medusa-plugin-mailchimp@1.1.35...medusa-plugin-mailchimp@1.1.36) (2021-12-29) + + **Note:** Version bump only for package medusa-plugin-mailchimp +diff --git a/packages/medusa-plugin-mailchimp/package.json b/packages/medusa-plugin-mailchimp/package.json +index ebbf160c29ede..2a62ecb0255f3 100644 +--- a/packages/medusa-plugin-mailchimp/package.json ++++ b/packages/medusa-plugin-mailchimp/package.json +@@ -1,6 +1,6 @@ + { + ""name"": ""medusa-plugin-mailchimp"", +- ""version"": ""1.1.36"", ++ ""version"": ""1.1.37"", + ""description"": ""Mailchimp newsletter subscriptions"", + ""main"": ""index.js"", + ""repository"": { +@@ -41,7 +41,7 @@ + ""express"": ""^4.17.1"", + ""mailchimp-api-v3"": ""^1.14.0"", + ""medusa-core-utils"": ""^1.1.31"", +- ""medusa-test-utils"": ""^1.1.36"" ++ ""medusa-test-utils"": ""^1.1.37"" + }, + ""gitHead"": ""c46300d58fbfd0b2dc2c02745ae143e6247e885b"" + } +diff --git a/packages/medusa-plugin-permissions/CHANGELOG.md b/packages/medusa-plugin-permissions/CHANGELOG.md +index 90d21449bbedd..1f255096c8b74 100644 +--- a/packages/medusa-plugin-permissions/CHANGELOG.md ++++ b/packages/medusa-plugin-permissions/CHANGELOG.md +@@ -3,6 +3,14 @@ + All notable changes to this project will be documented in this file. + See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ++## [1.1.37](https://github.com/medusajs/medusa/compare/medusa-plugin-permissions@1.1.36...medusa-plugin-permissions@1.1.37) (2022-01-11) ++ ++**Note:** Version bump only for package medusa-plugin-permissions ++ ++ ++ ++ ++ + ## [1.1.36](https://github.com/medusajs/medusa/compare/medusa-plugin-permissions@1.1.35...medusa-plugin-permissions@1.1.36) (2021-12-29) + + **Note:** Version bump only for package medusa-plugin-permissions +diff --git a/packages/medusa-plugin-permissions/package.json b/packages/medusa-plugin-permissions/package.json +index 17994c24ce939..7897223185e22 100644 +--- a/packages/medusa-plugin-permissions/package.json ++++ b/packages/medusa-plugin-permissions/package.json +@@ -1,6 +1,6 @@ + { + ""name"": ""medusa-plugin-permissions"", +- ""version"": ""1.1.36"", ++ ""version"": ""1.1.37"", + ""description"": ""Role permission for Medusa core"", + ""main"": ""dist/index.js"", + ""repository"": { +@@ -33,7 +33,7 @@ + }, + ""dependencies"": { + ""medusa-core-utils"": ""^1.1.31"", +- ""medusa-test-utils"": ""^1.1.36"", ++ ""medusa-test-utils"": ""^1.1.37"", + ""mongoose"": ""^5.8.0"" + }, + ""gitHead"": ""c46300d58fbfd0b2dc2c02745ae143e6247e885b"" +diff --git a/packages/medusa-plugin-restock-notification/CHANGELOG.md b/packages/medusa-plugin-restock-notification/CHANGELOG.md +index cac0db06c4bad..113f73d846e4d 100644 +--- a/packages/medusa-plugin-restock-notification/CHANGELOG.md ++++ b/packages/medusa-plugin-restock-notification/CHANGELOG.md +@@ -3,6 +3,14 @@ + All notable changes to this project will be documented in this file. + See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ++## [0.0.30](https://github.com/medusajs/medusa/compare/medusa-plugin-restock-notification@0.0.29...medusa-plugin-restock-notification@0.0.30) (2022-01-11) ++ ++**Note:** Version bump only for package medusa-plugin-restock-notification ++ ++ ++ ++ ++ + ## [0.0.29](https://github.com/medusajs/medusa/compare/medusa-plugin-restock-notification@0.0.28...medusa-plugin-restock-notification@0.0.29) (2021-12-29) + + **Note:** Version bump only for package medusa-plugin-restock-notification +diff --git a/packages/medusa-plugin-restock-notification/package.json b/packages/medusa-plugin-restock-notification/package.json +index ee81582a951cc..c8c19c4701aa4 100644 +--- a/packages/medusa-plugin-restock-notification/package.json ++++ b/packages/medusa-plugin-restock-notification/package.json +@@ -1,6 +1,6 @@ + { + ""name"": ""medusa-plugin-restock-notification"", +- ""version"": ""0.0.29"", ++ ""version"": ""0.0.30"", + ""main"": ""index.js"", + ""repository"": { + ""type"": ""git"", +@@ -18,7 +18,7 @@ + ""cross-env"": ""^5.2.1"", + ""eslint"": ""^6.8.0"", + ""jest"": ""^25.5.2"", +- ""medusa-test-utils"": ""^1.1.36"", ++ ""medusa-test-utils"": ""^1.1.37"", + ""pg"": ""^8.5.1"", + ""ulid"": ""^2.3.0"" + }, +diff --git a/packages/medusa-plugin-segment/CHANGELOG.md b/packages/medusa-plugin-segment/CHANGELOG.md +index 138fc89c9a19f..2de3c5166489d 100644 +--- a/packages/medusa-plugin-segment/CHANGELOG.md ++++ b/packages/medusa-plugin-segment/CHANGELOG.md +@@ -3,6 +3,14 @@ + All notable changes to this project will be documented in this file. + See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ++## [1.1.40](https://github.com/medusajs/medusa/compare/medusa-plugin-segment@1.1.39...medusa-plugin-segment@1.1.40) (2022-01-11) ++ ++**Note:** Version bump only for package medusa-plugin-segment ++ ++ ++ ++ ++ + ## [1.1.39](https://github.com/medusajs/medusa/compare/medusa-plugin-segment@1.1.38...medusa-plugin-segment@1.1.39) (2021-12-29) + + **Note:** Version bump only for package medusa-plugin-segment +diff --git a/packages/medusa-plugin-segment/package.json b/packages/medusa-plugin-segment/package.json +index adfab26198555..dba47d7293c08 100644 +--- a/packages/medusa-plugin-segment/package.json ++++ b/packages/medusa-plugin-segment/package.json +@@ -1,6 +1,6 @@ + { + ""name"": ""medusa-plugin-segment"", +- ""version"": ""1.1.39"", ++ ""version"": ""1.1.40"", + ""description"": ""Segment Analytics"", + ""main"": ""index.js"", + ""repository"": { +@@ -40,7 +40,7 @@ + ""body-parser"": ""^1.19.0"", + ""express"": ""^4.17.1"", + ""medusa-core-utils"": ""^1.1.31"", +- ""medusa-test-utils"": ""^1.1.36"" ++ ""medusa-test-utils"": ""^1.1.37"" + }, + ""gitHead"": ""3bbd1e8507e00bc471de6ae3c30207999a4a4011"" + } +diff --git a/packages/medusa-plugin-sendgrid/CHANGELOG.md b/packages/medusa-plugin-sendgrid/CHANGELOG.md +index 3fc87a0a0e69e..2a9a1c5c9ebd1 100644 +--- a/packages/medusa-plugin-sendgrid/CHANGELOG.md ++++ b/packages/medusa-plugin-sendgrid/CHANGELOG.md +@@ -3,6 +3,14 @@ + All notable changes to this project will be documented in this file. + See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ++## [1.1.38](https://github.com/medusajs/medusa/compare/medusa-plugin-sendgrid@1.1.37...medusa-plugin-sendgrid@1.1.38) (2022-01-11) ++ ++**Note:** Version bump only for package medusa-plugin-sendgrid ++ ++ ++ ++ ++ + ## [1.1.37](https://github.com/medusajs/medusa/compare/medusa-plugin-sendgrid@1.1.36...medusa-plugin-sendgrid@1.1.37) (2021-12-29) + + **Note:** Version bump only for package medusa-plugin-sendgrid +diff --git a/packages/medusa-plugin-sendgrid/package.json b/packages/medusa-plugin-sendgrid/package.json +index eba93ad1c050e..07d7e500f3567 100644 +--- a/packages/medusa-plugin-sendgrid/package.json ++++ b/packages/medusa-plugin-sendgrid/package.json +@@ -1,6 +1,6 @@ + { + ""name"": ""medusa-plugin-sendgrid"", +- ""version"": ""1.1.37"", ++ ""version"": ""1.1.38"", + ""description"": ""SendGrid transactional emails"", + ""main"": ""index.js"", + ""repository"": { +@@ -40,7 +40,7 @@ + ""body-parser"": ""^1.19.0"", + ""express"": ""^4.17.1"", + ""medusa-core-utils"": ""^1.1.31"", +- ""medusa-test-utils"": ""^1.1.36"" ++ ""medusa-test-utils"": ""^1.1.37"" + }, + ""gitHead"": ""3bbd1e8507e00bc471de6ae3c30207999a4a4011"" + } +diff --git a/packages/medusa-plugin-slack-notification/CHANGELOG.md b/packages/medusa-plugin-slack-notification/CHANGELOG.md +index 33da0edf53908..0298156838c01 100644 +--- a/packages/medusa-plugin-slack-notification/CHANGELOG.md ++++ b/packages/medusa-plugin-slack-notification/CHANGELOG.md +@@ -3,6 +3,14 @@ + All notable changes to this project will be documented in this file. + See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ++## [1.1.37](https://github.com/medusajs/medusa/compare/medusa-plugin-slack-notification@1.1.36...medusa-plugin-slack-notification@1.1.37) (2022-01-11) ++ ++**Note:** Version bump only for package medusa-plugin-slack-notification ++ ++ ++ ++ ++ + ## [1.1.36](https://github.com/medusajs/medusa/compare/medusa-plugin-slack-notification@1.1.35...medusa-plugin-slack-notification@1.1.36) (2021-12-29) + + **Note:** Version bump only for package medusa-plugin-slack-notification +diff --git a/packages/medusa-plugin-slack-notification/package-lock.json b/packages/medusa-plugin-slack-notification/package-lock.json +index 9fca219d9dd06..e853af6d57748 100644 +--- a/packages/medusa-plugin-slack-notification/package-lock.json ++++ b/packages/medusa-plugin-slack-notification/package-lock.json +@@ -1,6 +1,6 @@ + { + ""name"": ""medusa-plugin-economic"", +- ""version"": ""1.1.36"", ++ ""version"": ""1.1.37"", + ""lockfileVersion"": 1, + ""requires"": true, + ""dependencies"": { +diff --git a/packages/medusa-plugin-slack-notification/package.json b/packages/medusa-plugin-slack-notification/package.json +index 236ff9194f202..74d90056b3bbb 100644 +--- a/packages/medusa-plugin-slack-notification/package.json ++++ b/packages/medusa-plugin-slack-notification/package.json +@@ -1,6 +1,6 @@ + { + ""name"": ""medusa-plugin-slack-notification"", +- ""version"": ""1.1.36"", ++ ""version"": ""1.1.37"", + ""description"": ""Slack notifications"", + ""main"": ""index.js"", + ""repository"": { +@@ -40,7 +40,7 @@ + ""body-parser"": ""^1.19.0"", + ""express"": ""^4.17.1"", + ""medusa-core-utils"": ""^1.1.31"", +- ""medusa-test-utils"": ""^1.1.36"", ++ ""medusa-test-utils"": ""^1.1.37"", + ""moment"": ""^2.27.0"" + }, + ""gitHead"": ""c46300d58fbfd0b2dc2c02745ae143e6247e885b"" +diff --git a/packages/medusa-plugin-twilio-sms/CHANGELOG.md b/packages/medusa-plugin-twilio-sms/CHANGELOG.md +index bc8014566dd97..251269b330abe 100644 +--- a/packages/medusa-plugin-twilio-sms/CHANGELOG.md ++++ b/packages/medusa-plugin-twilio-sms/CHANGELOG.md +@@ -3,6 +3,14 @@ + All notable changes to this project will be documented in this file. + See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ++## [1.1.37](https://github.com/medusajs/medusa/compare/medusa-plugin-twilio-sms@1.1.36...medusa-plugin-twilio-sms@1.1.37) (2022-01-11) ++ ++**Note:** Version bump only for package medusa-plugin-twilio-sms ++ ++ ++ ++ ++ + ## [1.1.36](https://github.com/medusajs/medusa/compare/medusa-plugin-twilio-sms@1.1.35...medusa-plugin-twilio-sms@1.1.36) (2021-12-29) + + **Note:** Version bump only for package medusa-plugin-twilio-sms +diff --git a/packages/medusa-plugin-twilio-sms/package.json b/packages/medusa-plugin-twilio-sms/package.json +index 6a9103811cf4c..c6d5fbfdacb4f 100644 +--- a/packages/medusa-plugin-twilio-sms/package.json ++++ b/packages/medusa-plugin-twilio-sms/package.json +@@ -1,6 +1,6 @@ + { + ""name"": ""medusa-plugin-twilio-sms"", +- ""version"": ""1.1.36"", ++ ""version"": ""1.1.37"", + ""main"": ""index.js"", + ""repository"": { + ""type"": ""git"", +@@ -36,7 +36,7 @@ + ""@babel/plugin-transform-classes"": ""^7.9.5"", + ""body-parser"": ""^1.19.0"", + ""medusa-core-utils"": ""^1.1.31"", +- ""medusa-test-utils"": ""^1.1.36"", ++ ""medusa-test-utils"": ""^1.1.37"", + ""twilio"": ""^3.49.1"" + }, + ""gitHead"": ""c46300d58fbfd0b2dc2c02745ae143e6247e885b"" +diff --git a/packages/medusa-plugin-wishlist/CHANGELOG.md b/packages/medusa-plugin-wishlist/CHANGELOG.md +index 24b0733ed6d3f..e53c14155e8bd 100644 +--- a/packages/medusa-plugin-wishlist/CHANGELOG.md ++++ b/packages/medusa-plugin-wishlist/CHANGELOG.md +@@ -3,6 +3,14 @@ + All notable changes to this project will be documented in this file. + See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ++## [1.1.37](https://github.com/medusajs/medusa/compare/medusa-plugin-wishlist@1.1.36...medusa-plugin-wishlist@1.1.37) (2022-01-11) ++ ++**Note:** Version bump only for package medusa-plugin-wishlist ++ ++ ++ ++ ++ + ## [1.1.36](https://github.com/medusajs/medusa/compare/medusa-plugin-wishlist@1.1.35...medusa-plugin-wishlist@1.1.36) (2021-12-29) + + **Note:** Version bump only for package medusa-plugin-wishlist +diff --git a/packages/medusa-plugin-wishlist/package.json b/packages/medusa-plugin-wishlist/package.json +index 4230e4bb98152..70a0734ea75e2 100644 +--- a/packages/medusa-plugin-wishlist/package.json ++++ b/packages/medusa-plugin-wishlist/package.json +@@ -1,6 +1,6 @@ + { + ""name"": ""medusa-plugin-wishlist"", +- ""version"": ""1.1.36"", ++ ""version"": ""1.1.37"", + ""description"": ""Provides /customers/:id/wishlist to add items to a customr's wishlist"", + ""main"": ""index.js"", + ""repository"": { +@@ -39,7 +39,7 @@ + ""cors"": ""^2.8.5"", + ""express"": ""^4.17.1"", + ""medusa-core-utils"": ""^1.1.31"", +- ""medusa-test-utils"": ""^1.1.36"" ++ ""medusa-test-utils"": ""^1.1.37"" + }, + ""gitHead"": ""3bbd1e8507e00bc471de6ae3c30207999a4a4011"" + } +diff --git a/packages/medusa-react/CHANGELOG.md b/packages/medusa-react/CHANGELOG.md +index 97d656c405909..bf2ed80f543dd 100644 +--- a/packages/medusa-react/CHANGELOG.md ++++ b/packages/medusa-react/CHANGELOG.md +@@ -3,6 +3,14 @@ + All notable changes to this project will be documented in this file. + See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ++## [0.1.3](https://github.com/medusajs/medusa/compare/medusa-react@0.1.2...medusa-react@0.1.3) (2022-01-11) ++ ++**Note:** Version bump only for package medusa-react ++ ++ ++ ++ ++ + ## [0.1.2](https://github.com/medusajs/medusa/compare/medusa-react@0.1.1...medusa-react@0.1.2) (2021-12-29) + + **Note:** Version bump only for package medusa-react +diff --git a/packages/medusa-react/package.json b/packages/medusa-react/package.json +index a2482b22dba6c..204e78c1908ca 100644 +--- a/packages/medusa-react/package.json ++++ b/packages/medusa-react/package.json +@@ -1,5 +1,5 @@ + { +- ""version"": ""0.1.2"", ++ ""version"": ""0.1.3"", + ""license"": ""MIT"", + ""main"": ""dist/index.js"", + ""typings"": ""dist/index.d.ts"", +@@ -83,8 +83,8 @@ + ""typescript"": ""^4.5.2"" + }, + ""dependencies"": { +- ""@medusajs/medusa"": ""^1.1.61"", +- ""@medusajs/medusa-js"": ""^1.0.9"", ++ ""@medusajs/medusa"": ""^1.1.62"", ++ ""@medusajs/medusa-js"": ""^1.0.10"", + ""lodash"": ""^4.17.21"", + ""lodash-es"": ""^4.17.21"", + ""react-query"": ""^3.31.0"" +diff --git a/packages/medusa-source-shopify/CHANGELOG.md b/packages/medusa-source-shopify/CHANGELOG.md +index 55b3f2700890e..972ff64e1198f 100644 +--- a/packages/medusa-source-shopify/CHANGELOG.md ++++ b/packages/medusa-source-shopify/CHANGELOG.md +@@ -3,6 +3,14 @@ + All notable changes to this project will be documented in this file. + See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ++## [1.0.3](https://github.com/medusajs/medusa/compare/medusa-source-shopify@1.0.2...medusa-source-shopify@1.0.3) (2022-01-11) ++ ++**Note:** Version bump only for package medusa-source-shopify ++ ++ ++ ++ ++ + ## [1.0.2](https://github.com/medusajs/medusa/compare/medusa-source-shopify@1.0.1...medusa-source-shopify@1.0.2) (2021-12-29) + + **Note:** Version bump only for package medusa-source-shopify +diff --git a/packages/medusa-source-shopify/package.json b/packages/medusa-source-shopify/package.json +index ece5fe4c5c578..75ae0779155f4 100644 +--- a/packages/medusa-source-shopify/package.json ++++ b/packages/medusa-source-shopify/package.json +@@ -1,6 +1,6 @@ + { + ""name"": ""medusa-source-shopify"", +- ""version"": ""1.0.2"", ++ ""version"": ""1.0.3"", + ""description"": ""Source plugin that allows users to import products from a Shopify store"", + ""main"": ""index.js"", + ""repository"": { +@@ -30,7 +30,7 @@ + ""lodash"": ""^4.17.21"", + ""medusa-core-utils"": ""^1.1.31"", + ""medusa-interfaces"": ""^1.1.32"", +- ""medusa-test-utils"": ""^1.1.36"" ++ ""medusa-test-utils"": ""^1.1.37"" + }, + ""devDependencies"": { + ""@babel/cli"": ""^7.15.4"", +diff --git a/packages/medusa-test-utils/CHANGELOG.md b/packages/medusa-test-utils/CHANGELOG.md +index fdc0dc2efdda2..3c8e8500b101d 100644 +--- a/packages/medusa-test-utils/CHANGELOG.md ++++ b/packages/medusa-test-utils/CHANGELOG.md +@@ -3,6 +3,14 @@ + All notable changes to this project will be documented in this file. + See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ++## [1.1.37](https://github.com/medusajs/medusa/compare/medusa-test-utils@1.1.36...medusa-test-utils@1.1.37) (2022-01-11) ++ ++**Note:** Version bump only for package medusa-test-utils ++ ++ ++ ++ ++ + ## [1.1.36](https://github.com/medusajs/medusa/compare/medusa-test-utils@1.1.35...medusa-test-utils@1.1.36) (2021-12-29) + + **Note:** Version bump only for package medusa-test-utils +diff --git a/packages/medusa-test-utils/package.json b/packages/medusa-test-utils/package.json +index e4187cb8e0603..913f0d7697565 100644 +--- a/packages/medusa-test-utils/package.json ++++ b/packages/medusa-test-utils/package.json +@@ -1,6 +1,6 @@ + { + ""name"": ""medusa-test-utils"", +- ""version"": ""1.1.36"", ++ ""version"": ""1.1.37"", + ""description"": ""Test utils for Medusa"", + ""main"": ""dist/index.js"", + ""repository"": { +diff --git a/packages/medusa/CHANGELOG.md b/packages/medusa/CHANGELOG.md +index ea9c879e34b2b..8c685455cb672 100644 +--- a/packages/medusa/CHANGELOG.md ++++ b/packages/medusa/CHANGELOG.md +@@ -3,6 +3,24 @@ + All notable changes to this project will be documented in this file. + See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ++## [1.1.62](https://github.com/medusajs/medusa/compare/@medusajs/medusa@1.1.61...@medusajs/medusa@1.1.62) (2022-01-11) ++ ++ ++### Bug Fixes ++ ++* Adds default currency to store currencies on create ([#982](https://github.com/medusajs/medusa/issues/982)) ([a0a21d1](https://github.com/medusajs/medusa/commit/a0a21d15efeda56d4245aa6937f4d67c673e5ab3)) ++* api claim types + tests ([#967](https://github.com/medusajs/medusa/issues/967)) ([d365839](https://github.com/medusajs/medusa/commit/d365839a086ba116f320b49880d621452ee4b301)) ++* Type in AdminProductListTagsRes to use tags instead of types ([#958](https://github.com/medusajs/medusa/issues/958)) ([0ac52b7](https://github.com/medusajs/medusa/commit/0ac52b70fa23d9aa3ba6b5e220943ed15db4e643)) ++ ++ ++### Features ++ ++* expand store product filtering ([#973](https://github.com/medusajs/medusa/issues/973)) ([f61eaee](https://github.com/medusajs/medusa/commit/f61eaeec12529919b74b64a35f26b6b42f24fa7b)) ++ ++ ++ ++ ++ + ## [1.1.61](https://github.com/medusajs/medusa/compare/@medusajs/medusa@1.1.60...@medusajs/medusa@1.1.61) (2021-12-29) + + **Note:** Version bump only for package @medusajs/medusa +diff --git a/packages/medusa/package.json b/packages/medusa/package.json +index 9b8375a029d80..4e15046d24745 100644 +--- a/packages/medusa/package.json ++++ b/packages/medusa/package.json +@@ -1,6 +1,6 @@ + { + ""name"": ""@medusajs/medusa"", +- ""version"": ""1.1.61"", ++ ""version"": ""1.1.62"", + ""description"": ""E-commerce for JAMstack"", + ""main"": ""dist/index.js"", + ""bin"": { +@@ -48,7 +48,7 @@ + }, + ""dependencies"": { + ""@hapi/joi"": ""^16.1.8"", +- ""@medusajs/medusa-cli"": ""^1.1.26"", ++ ""@medusajs/medusa-cli"": ""^1.1.27"", + ""@types/lodash"": ""^4.14.168"", + ""awilix"": ""^4.2.3"", + ""body-parser"": ""^1.19.0"", +@@ -73,7 +73,7 @@ + ""joi-objectid"": ""^3.0.1"", + ""jsonwebtoken"": ""^8.5.1"", + ""medusa-core-utils"": ""^1.1.31"", +- ""medusa-test-utils"": ""^1.1.36"", ++ ""medusa-test-utils"": ""^1.1.37"", + ""morgan"": ""^1.9.1"", + ""multer"": ""^1.4.2"", + ""passport"": ""^0.4.0""," +bytebase,https://github.com/bytebase/bytebase,f21ebee81c1a9e0dd8a504dfd1755e78284cbe78,rebelice,2022-09-20 15:20:29,chore(sql-review): re-implement column no null and fix all MySQL advisor unit tests (#2735),"* chore(sql-review): re-implement column no null and fix all MySQL advisor unit tests + +* test: fix tests","chore(sql-review): re-implement column no null and fix all MySQL advisor unit tests (#2735) + +* chore(sql-review): re-implement column no null and fix all MySQL advisor unit tests + +* test: fix tests","diff --git a/plugin/advisor/advisor.go b/plugin/advisor/advisor.go +index 896fcc073702c3..a50485223eba6f 100644 +--- a/plugin/advisor/advisor.go ++++ b/plugin/advisor/advisor.go +@@ -94,9 +94,6 @@ const ( + // MySQLColumnDisallowChanging is an advisor type for MySQL disallow CHANGE COLUMN statement. + MySQLColumnDisallowChanging Type = ""bb.plugin.advisor.mysql.column.disallow-change"" + +- // MySQLColumnExists is an advisor type for MySQL column existence. +- MySQLColumnExists Type = ""bb.plugin.advisor.mysql.column.exists"" +- + // MySQLColumnDisallowChangingOrder is an advisor type for MySQL disallow changing column order. + MySQLColumnDisallowChangingOrder Type = ""bb.plugin.advisor.mysql.column.disallow-changing-order"" + +@@ -121,18 +118,12 @@ const ( + // MySQLTableDropNamingConvention is an advisor type for MySQL table drop with naming convention. + MySQLTableDropNamingConvention Type = ""bb.plugin.advisor.mysql.table.drop-naming-convention"" + +- // MySQLTableExists is an advisor type for MySQL table existence. +- MySQLTableExists Type = ""bb.plugin.advisor.mysql.table.exists"" +- + // MySQLTableCommentConvention is an advisor for MySQL table comment convention. + MySQLTableCommentConvention Type = ""bb.plugin.advisor.mysql.table.comment"" + + // MySQLTableDisallowCreateTableAs is an advisor type for MySQL disallow CREATE TABLE ... AS ... statement. + MySQLTableDisallowCreateTableAs Type = ""bb.plugin.advisor.mysql.table.disallow-create-table-as"" + +- // MySQLTableNotExists is an advisor for MySQL table name conflict check. +- MySQLTableNotExists Type = ""bb.plugin.advisor.mysql.table.not-exists"" +- + // MySQLDatabaseAllowDropIfEmpty is an advisor type for MySQL only allow drop empty database. + MySQLDatabaseAllowDropIfEmpty Type = ""bb.plugin.advisor.mysql.database.drop-empty-database"" + +@@ -145,9 +136,6 @@ const ( + // MySQLIndexKeyNumberLimit is an advisor type for MySQL index key number limit. + MySQLIndexKeyNumberLimit Type = ""bb.plugin.advisor.mysql.index.key-number-limit"" + +- // MySQLIndexNotExists is an advisor type for MySQL index name conflict check. +- MySQLIndexNotExists Type = ""bb.plugin.advisor.mysql.index.not-exists"" +- + // MySQLCharsetAllowlist is an advisor type for MySQL charset allowlist. + MySQLCharsetAllowlist Type = ""bb.plugin.advisor.mysql.charset.allowlist"" + +diff --git a/plugin/advisor/catalog/walk_through.go b/plugin/advisor/catalog/walk_through.go +index 6ed136da207019..873339fa4c7cac 100644 +--- a/plugin/advisor/catalog/walk_through.go ++++ b/plugin/advisor/catalog/walk_through.go +@@ -1105,6 +1105,12 @@ func (d *databaseState) parse(stmts string) ([]tidbast.StmtNode, *WalkThroughErr + if err != nil { + return nil, NewParseError(err.Error()) + } ++ ++ // sikp the setting line stage ++ if len(nodeList) == 0 { ++ return nodeList, nil ++ } ++ + sqlList, err := parser.SplitMultiSQL(parser.MySQL, stmts) + if err != nil { + return nil, NewParseError(err.Error()) +diff --git a/plugin/advisor/mysql/advisor_charset_allowlist_test.go b/plugin/advisor/mysql/advisor_charset_allowlist_test.go +index 0741b3aec96057..4a6f6845507971 100644 +--- a/plugin/advisor/mysql/advisor_charset_allowlist_test.go ++++ b/plugin/advisor/mysql/advisor_charset_allowlist_test.go +@@ -48,37 +48,27 @@ func TestCharsetAllowlist(t *testing.T) { + }, + }, + { +- Statement: `ALTER TABLE t CHARSET ascii`, ++ Statement: ` ++ CREATE TABLE t(a int); ++ ALTER TABLE t CHARSET ascii`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.DisabledCharset, + Title: ""charset.allowlist"", + Content: ""\""ALTER TABLE t CHARSET ascii\"" used disabled charset 'ascii'"", +- Line: 1, +- }, +- }, +- }, +- { +- Statement: `CREATE DATABASE d CHARSET ascii`, +- Want: []advisor.Advice{ +- { +- Status: advisor.Warn, +- Code: advisor.DisabledCharset, +- Title: ""charset.allowlist"", +- Content: ""\""CREATE DATABASE d CHARSET ascii\"" used disabled charset 'ascii'"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER DATABASE d CHARSET ascii`, ++ Statement: `ALTER DATABASE test CHARSET ascii`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.DisabledCharset, + Title: ""charset.allowlist"", +- Content: ""\""ALTER DATABASE d CHARSET ascii\"" used disabled charset 'ascii'"", ++ Content: ""\""ALTER DATABASE test CHARSET ascii\"" used disabled charset 'ascii'"", + Line: 1, + }, + }, +@@ -96,38 +86,44 @@ func TestCharsetAllowlist(t *testing.T) { + }, + }, + { +- Statement: `ALTER TABLE t ADD COLUMN a varchar(255) CHARSET ascii`, ++ Statement: ` ++ CREATE TABLE t(b int); ++ ALTER TABLE t ADD COLUMN a varchar(255) CHARSET ascii`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.DisabledCharset, + Title: ""charset.allowlist"", + Content: ""\""ALTER TABLE t ADD COLUMN a varchar(255) CHARSET ascii\"" used disabled charset 'ascii'"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER TABLE t MODIFY COLUMN a varchar(255) CHARSET ascii`, ++ Statement: ` ++ CREATE TABLE t(a int); ++ ALTER TABLE t MODIFY COLUMN a varchar(255) CHARSET ascii`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.DisabledCharset, + Title: ""charset.allowlist"", + Content: ""\""ALTER TABLE t MODIFY COLUMN a varchar(255) CHARSET ascii\"" used disabled charset 'ascii'"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER TABLE t CHANGE COLUMN a a varchar(255) CHARSET ascii`, ++ Statement: ` ++ CREATE TABLE t(a int); ++ ALTER TABLE t CHANGE COLUMN a a varchar(255) CHARSET ascii`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.DisabledCharset, + Title: ""charset.allowlist"", + Content: ""\""ALTER TABLE t CHANGE COLUMN a a varchar(255) CHARSET ascii\"" used disabled charset 'ascii'"", +- Line: 1, ++ Line: 3, + }, + }, + }, +diff --git a/plugin/advisor/mysql/advisor_column_auto_increment_must_integer_test.go b/plugin/advisor/mysql/advisor_column_auto_increment_must_integer_test.go +index f129bcf410e2fb..e6110e6f168e5e 100644 +--- a/plugin/advisor/mysql/advisor_column_auto_increment_must_integer_test.go ++++ b/plugin/advisor/mysql/advisor_column_auto_increment_must_integer_test.go +@@ -34,38 +34,44 @@ func TestColumnAutoIncrementMustInteger(t *testing.T) { + }, + }, + { +- Statement: `ALTER TABLE t ADD COLUMN a varchar(255) AUTO_INCREMENT`, ++ Statement: ` ++ CREATE TABLE t(b int); ++ ALTER TABLE t ADD COLUMN a varchar(255) AUTO_INCREMENT`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.AutoIncrementColumnNotInteger, + Title: ""column.auto-increment-must-integer"", + Content: ""Auto-increment column `t`.`a` requires integer type"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER TABLE t MODIFY COLUMN a varchar(255) AUTO_INCREMENT`, ++ Statement: ` ++ CREATE TABLE t(a int); ++ ALTER TABLE t MODIFY COLUMN a varchar(255) AUTO_INCREMENT`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.AutoIncrementColumnNotInteger, + Title: ""column.auto-increment-must-integer"", + Content: ""Auto-increment column `t`.`a` requires integer type"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER TABLE t CHANGE COLUMN b a varchar(255) AUTO_INCREMENT`, ++ Statement: ` ++ CREATE TABLE t(b int); ++ ALTER TABLE t CHANGE COLUMN b a varchar(255) AUTO_INCREMENT`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.AutoIncrementColumnNotInteger, + Title: ""column.auto-increment-must-integer"", + Content: ""Auto-increment column `t`.`a` requires integer type"", +- Line: 1, ++ Line: 3, + }, + }, + }, +diff --git a/plugin/advisor/mysql/advisor_column_comment_convention_test.go b/plugin/advisor/mysql/advisor_column_comment_convention_test.go +index 3f71810a3c863b..d1717ce095f98a 100644 +--- a/plugin/advisor/mysql/advisor_column_comment_convention_test.go ++++ b/plugin/advisor/mysql/advisor_column_comment_convention_test.go +@@ -47,50 +47,58 @@ func TestColumnCommentConvention(t *testing.T) { + }, + }, + { +- Statement: `ALTER TABLE t ADD COLUMN b int`, ++ Statement: ` ++ CREATE TABLE t(a int COMMENT 'comment'); ++ ALTER TABLE t ADD COLUMN b int`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.NoColumnComment, + Title: ""column.comment"", + Content: ""Column `t`.`b` requires comments"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER TABLE t CHANGE COLUMN a b int`, ++ Statement: ` ++ CREATE TABLE t(a int COMMENT 'this is comment'); ++ ALTER TABLE t CHANGE COLUMN a b int`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.NoColumnComment, + Title: ""column.comment"", + Content: ""Column `t`.`b` requires comments"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER TABLE t MODIFY COLUMN b int`, ++ Statement: ` ++ CREATE TABLE t(b int COMMENT 'It is comment'); ++ ALTER TABLE t MODIFY COLUMN b int`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.NoColumnComment, + Title: ""column.comment"", + Content: ""Column `t`.`b` requires comments"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER TABLE t MODIFY COLUMN b int COMMENT 'abcdefghiakljhakljdsfalugelkhnabsdguelkadf'`, ++ Statement: ` ++ CREATE TABLE t(b int COMMENT 'It is COMMENT'); ++ ALTER TABLE t MODIFY COLUMN b int COMMENT 'abcdefghiakljhakljdsfalugelkhnabsdguelkadf'`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.ColumnCommentTooLong, + Title: ""column.comment"", + Content: ""The length of column `t`.`b` comment should be within 20 characters"", +- Line: 1, ++ Line: 3, + }, + }, + }, +diff --git a/plugin/advisor/mysql/advisor_column_disallow_changing_order_test.go b/plugin/advisor/mysql/advisor_column_disallow_changing_order_test.go +index 447b766828efec..ee8b9d8bedecc6 100644 +--- a/plugin/advisor/mysql/advisor_column_disallow_changing_order_test.go ++++ b/plugin/advisor/mysql/advisor_column_disallow_changing_order_test.go +@@ -11,7 +11,9 @@ import ( + func TestColumnDisallowChangingOrder(t *testing.T) { + tests := []advisor.TestCase{ + { +- Statement: `ALTER TABLE t MODIFY COLUMN a int`, ++ Statement: ` ++ CREATE TABLE t(a int); ++ ALTER TABLE t MODIFY COLUMN a int`, + Want: []advisor.Advice{ + { + Status: advisor.Success, +@@ -22,50 +24,58 @@ func TestColumnDisallowChangingOrder(t *testing.T) { + }, + }, + { +- Statement: `ALTER TABLE t MODIFY COLUMN a int FIRST`, ++ Statement: ` ++ CREATE TABLE t(a int); ++ ALTER TABLE t MODIFY COLUMN a int FIRST`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.ChangeColumnOrder, + Title: ""column.disallow-changing-order"", + Content: ""\""ALTER TABLE t MODIFY COLUMN a int FIRST\"" changes column order"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER TABLE t CHANGE COLUMN a1 a int FIRST`, ++ Statement: ` ++ CREATE TABLE t(b int, a1 int); ++ ALTER TABLE t CHANGE COLUMN a1 a int FIRST`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.ChangeColumnOrder, + Title: ""column.disallow-changing-order"", + Content: ""\""ALTER TABLE t CHANGE COLUMN a1 a int FIRST\"" changes column order"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER TABLE t MODIFY COLUMN a int AFTER b`, ++ Statement: ` ++ CREATE TABLE t(a int, b int); ++ ALTER TABLE t MODIFY COLUMN a int AFTER b`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.ChangeColumnOrder, + Title: ""column.disallow-changing-order"", + Content: ""\""ALTER TABLE t MODIFY COLUMN a int AFTER b\"" changes column order"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER TABLE t CHANGE COLUMN a1 a int AFTER b`, ++ Statement: ` ++ CREATE TABLE t(a1 int, b int); ++ ALTER TABLE t CHANGE COLUMN a1 a int AFTER b`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.ChangeColumnOrder, + Title: ""column.disallow-changing-order"", + Content: ""\""ALTER TABLE t CHANGE COLUMN a1 a int AFTER b\"" changes column order"", +- Line: 1, ++ Line: 3, + }, + }, + }, +diff --git a/plugin/advisor/mysql/advisor_column_disallow_changing_test.go b/plugin/advisor/mysql/advisor_column_disallow_changing_test.go +index 596d001c91881c..b9ba66c87bfe46 100644 +--- a/plugin/advisor/mysql/advisor_column_disallow_changing_test.go ++++ b/plugin/advisor/mysql/advisor_column_disallow_changing_test.go +@@ -11,7 +11,9 @@ import ( + func TestColumnDisallowChanging(t *testing.T) { + tests := []advisor.TestCase{ + { +- Statement: `ALTER TABLE t ADD COLUMN a int`, ++ Statement: ` ++ CREATE TABLE t(b int); ++ ALTER TABLE t ADD COLUMN a int`, + Want: []advisor.Advice{ + { + Status: advisor.Success, +@@ -22,14 +24,16 @@ func TestColumnDisallowChanging(t *testing.T) { + }, + }, + { +- Statement: `ALTER TABLE t CHANGE COLUMN b a int`, ++ Statement: ` ++ CREATE TABLE t(b int); ++ ALTER TABLE t CHANGE COLUMN b a int`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.UseChangeColumnStatement, + Title: ""column.disallow-change"", + Content: ""\""ALTER TABLE t CHANGE COLUMN b a int\"" contains CHANGE COLUMN statement"", +- Line: 1, ++ Line: 3, + }, + }, + }, +diff --git a/plugin/advisor/mysql/advisor_column_no_null.go b/plugin/advisor/mysql/advisor_column_no_null.go +index 16697f64664774..9ffeee2f7f2387 100644 +--- a/plugin/advisor/mysql/advisor_column_no_null.go ++++ b/plugin/advisor/mysql/advisor_column_no_null.go +@@ -2,10 +2,12 @@ package mysql + + import ( + ""fmt"" ++ ""sort"" + + ""github.com/pingcap/tidb/parser/ast"" + + ""github.com/bytebase/bytebase/plugin/advisor"" ++ ""github.com/bytebase/bytebase/plugin/advisor/catalog"" + ""github.com/bytebase/bytebase/plugin/advisor/db"" + ) + +@@ -35,14 +37,55 @@ func (*ColumnNoNullAdvisor) Check(ctx advisor.Context, statement string) ([]advi + return nil, err + } + checker := &columnNoNullChecker{ +- level: level, +- title: string(ctx.Rule.Type), ++ level: level, ++ title: string(ctx.Rule.Type), ++ columnSet: make(map[string]columnName), ++ catalog: ctx.Catalog, + } + + for _, stmtNode := range root { + (stmtNode).Accept(checker) + } + ++ return checker.generateAdvice(), nil ++} ++ ++type columnNoNullChecker struct { ++ adviceList []advisor.Advice ++ level advisor.Status ++ title string ++ columnSet map[string]columnName ++ catalog *catalog.Finder ++} ++ ++func (checker columnNoNullChecker) generateAdvice() []advisor.Advice { ++ var columnList []columnName ++ for _, column := range checker.columnSet { ++ columnList = append(columnList, column) ++ } ++ sort.Slice(columnList, func(i, j int) bool { ++ if columnList[i].line != columnList[j].line { ++ return columnList[i].line < columnList[j].line ++ } ++ return columnList[i].columnName < columnList[j].columnName ++ }) ++ ++ for _, column := range columnList { ++ col := checker.catalog.Final.FindColumn(&catalog.ColumnFind{ ++ TableName: column.tableName, ++ ColumnName: column.columnName, ++ }) ++ if col != nil && col.Nullable { ++ checker.adviceList = append(checker.adviceList, advisor.Advice{ ++ Status: checker.level, ++ Code: advisor.ColumnCanNotNull, ++ Title: checker.title, ++ Content: fmt.Sprintf(""`%s`.`%s` can not have NULL value"", column.tableName, column.columnName), ++ Line: column.line, ++ }) ++ } ++ } ++ + if len(checker.adviceList) == 0 { + checker.adviceList = append(checker.adviceList, advisor.Advice{ + Status: advisor.Success, +@@ -51,13 +94,7 @@ func (*ColumnNoNullAdvisor) Check(ctx advisor.Context, statement string) ([]advi + Content: """", + }) + } +- return checker.adviceList, nil +-} +- +-type columnNoNullChecker struct { +- adviceList []advisor.Advice +- level advisor.Status +- title string ++ return checker.adviceList + } + + type columnName struct { +@@ -66,19 +103,23 @@ type columnName struct { + line int + } + ++func (c columnName) name() string { ++ return fmt.Sprintf(""%s.%s"", c.tableName, c.columnName) ++} ++ + // Enter implements the ast.Visitor interface. +-func (v *columnNoNullChecker) Enter(in ast.Node) (ast.Node, bool) { +- var columns []columnName ++func (checker *columnNoNullChecker) Enter(in ast.Node) (ast.Node, bool) { + switch node := in.(type) { + // CREATE TABLE + case *ast.CreateTableStmt: + for _, column := range node.Cols { +- if canNull(column) { +- columns = append(columns, columnName{ +- tableName: node.Table.Name.String(), +- columnName: column.Name.Name.String(), +- line: column.OriginTextPosition(), +- }) ++ col := columnName{ ++ tableName: node.Table.Name.O, ++ columnName: column.Name.Name.O, ++ line: column.OriginTextPosition(), ++ } ++ if _, exists := checker.columnSet[col.name()]; !exists { ++ checker.columnSet[col.name()] = col + } + } + // ALTER TABLE +@@ -88,37 +129,29 @@ func (v *columnNoNullChecker) Enter(in ast.Node) (ast.Node, bool) { + // ADD COLUMNS + case ast.AlterTableAddColumns: + for _, column := range spec.NewColumns { +- if canNull(column) { +- columns = append(columns, columnName{ +- tableName: node.Table.Name.String(), +- columnName: column.Name.Name.String(), +- line: node.OriginTextPosition(), +- }) ++ col := columnName{ ++ tableName: node.Table.Name.O, ++ columnName: column.Name.Name.O, ++ line: node.OriginTextPosition(), ++ } ++ if _, exists := checker.columnSet[col.name()]; !exists { ++ checker.columnSet[col.name()] = col + } + } + // CHANGE COLUMN + case ast.AlterTableChangeColumn: +- if canNull(spec.NewColumns[0]) { +- columns = append(columns, columnName{ +- tableName: node.Table.Name.String(), +- columnName: spec.NewColumns[0].Name.Name.String(), +- line: node.OriginTextPosition(), +- }) ++ col := columnName{ ++ tableName: node.Table.Name.O, ++ columnName: spec.NewColumns[0].Name.Name.O, ++ line: node.OriginTextPosition(), ++ } ++ if _, exists := checker.columnSet[col.name()]; !exists { ++ checker.columnSet[col.name()] = col + } + } + } + } + +- for _, column := range columns { +- v.adviceList = append(v.adviceList, advisor.Advice{ +- Status: v.level, +- Code: advisor.ColumnCanNotNull, +- Title: v.title, +- Content: fmt.Sprintf(""`%s`.`%s` can not have NULL value"", column.tableName, column.columnName), +- Line: column.line, +- }) +- } +- + return in, false + } + +diff --git a/plugin/advisor/mysql/advisor_column_no_null_test.go b/plugin/advisor/mysql/advisor_column_no_null_test.go +index 29d320ac9efbe9..bbbc984ba7a545 100644 +--- a/plugin/advisor/mysql/advisor_column_no_null_test.go ++++ b/plugin/advisor/mysql/advisor_column_no_null_test.go +@@ -65,19 +65,25 @@ func TestColumnNoNull(t *testing.T) { + }, + }, + { +- Statement: ""ALTER TABLE book ADD COLUMN (id int, name varchar(255) NOT NULL)"", ++ Statement: ` ++ CREATE TABLE book(a int NOT NULL); ++ ALTER TABLE book ADD COLUMN (id int, name varchar(255) NOT NULL); ++ `, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.ColumnCanNotNull, + Title: ""column.no-null"", + Content: ""`book`.`id` can not have NULL value"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: ""ALTER TABLE book ADD COLUMN (id int PRIMARY KEY, name varchar(255) NOT NULL)"", ++ Statement: ` ++ CREATE TABLE book(a int NOT NULL); ++ ALTER TABLE book ADD COLUMN (id int PRIMARY KEY, name varchar(255) NOT NULL); ++ `, + Want: []advisor.Advice{ + { + Status: advisor.Success, +@@ -88,19 +94,24 @@ func TestColumnNoNull(t *testing.T) { + }, + }, + { +- Statement: ""ALTER TABLE book CHANGE COLUMN id name varchar(255)"", ++ Statement: ` ++ CREATE TABLE book(id int NOT NULL); ++ ALTER TABLE book CHANGE COLUMN id name varchar(255); ++ `, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.ColumnCanNotNull, + Title: ""column.no-null"", + Content: ""`book`.`name` can not have NULL value"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: ""ALTER TABLE book CHANGE COLUMN id name varchar(255) NOT NULL"", ++ Statement: ` ++ CREATE TABLE book(id int NOT NULL); ++ ALTER TABLE book CHANGE COLUMN id name varchar(255) NOT NULL;`, + Want: []advisor.Advice{ + { + Status: advisor.Success, +diff --git a/plugin/advisor/mysql/advisor_column_set_default_for_not_null_test.go b/plugin/advisor/mysql/advisor_column_set_default_for_not_null_test.go +index 95bc9a1db5c1c9..79903d3e28ce88 100644 +--- a/plugin/advisor/mysql/advisor_column_set_default_for_not_null_test.go ++++ b/plugin/advisor/mysql/advisor_column_set_default_for_not_null_test.go +@@ -67,82 +67,96 @@ func TestColumnSetDefaultForNotNull(t *testing.T) { + }, + }, + { +- Statement: `ALTER TABLE book ADD COLUMN id int PRIMARY KEY`, ++ Statement: ` ++ CREATE TABLE book(a int); ++ ALTER TABLE book ADD COLUMN id int PRIMARY KEY`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.NotNullColumnWithNullDefault, + Title: ""column.set-default-for-not-null"", + Content: ""Column `book`.`id` is NOT NULL but has NULL default value"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER TABLE book ADD COLUMN id int NOT NULL`, ++ Statement: ` ++ CREATE TABLE book(a int); ++ ALTER TABLE book ADD COLUMN id int NOT NULL`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.NotNullColumnWithNullDefault, + Title: ""column.set-default-for-not-null"", + Content: ""Column `book`.`id` is NOT NULL but has NULL default value"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER TABLE book MODIFY COLUMN id int NOT NULL`, ++ Statement: ` ++ CREATE TABLE book(id int); ++ ALTER TABLE book MODIFY COLUMN id int NOT NULL`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.NotNullColumnWithNullDefault, + Title: ""column.set-default-for-not-null"", + Content: ""Column `book`.`id` is NOT NULL but has NULL default value"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER TABLE book MODIFY COLUMN id int PRIMARY KEY`, ++ Statement: ` ++ CREATE TABLE book(id int); ++ ALTER TABLE book MODIFY COLUMN id int PRIMARY KEY`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.NotNullColumnWithNullDefault, + Title: ""column.set-default-for-not-null"", + Content: ""Column `book`.`id` is NOT NULL but has NULL default value"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER TABLE book CHANGE COLUMN uid id int PRIMARY KEY`, ++ Statement: ` ++ CREATE TABLE book(uid int); ++ ALTER TABLE book CHANGE COLUMN uid id int PRIMARY KEY`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.NotNullColumnWithNullDefault, + Title: ""column.set-default-for-not-null"", + Content: ""Column `book`.`id` is NOT NULL but has NULL default value"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER TABLE book CHANGE COLUMN uid id int NOT NULL`, ++ Statement: ` ++ CREATE TABLE book(uid int); ++ ALTER TABLE book CHANGE COLUMN uid id int NOT NULL`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.NotNullColumnWithNullDefault, + Title: ""column.set-default-for-not-null"", + Content: ""Column `book`.`id` is NOT NULL but has NULL default value"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER TABLE book +- CHANGE COLUMN uid id int NOT NULL DEFAULT 0, +- MODIFY COLUMN id int PRIMARY KEY DEFAULT 0, +- ADD COLUMN name varchar(20) NOT NULL DEFAULT '' ++ Statement: ` ++ CREATE TABLE book(uid int, id int); ++ ALTER TABLE book ++ CHANGE COLUMN uid uid int NOT NULL DEFAULT 0, ++ MODIFY COLUMN id int PRIMARY KEY DEFAULT 0, ++ ADD COLUMN name varchar(20) NOT NULL DEFAULT '' + `, + Want: []advisor.Advice{ + { +diff --git a/plugin/advisor/mysql/advisor_column_type_restriction_test.go b/plugin/advisor/mysql/advisor_column_type_restriction_test.go +index 8d3689beb624e5..16cde6578f8932 100644 +--- a/plugin/advisor/mysql/advisor_column_type_restriction_test.go ++++ b/plugin/advisor/mysql/advisor_column_type_restriction_test.go +@@ -51,47 +51,51 @@ func TestColumnTypeRestriction(t *testing.T) { + }, + }, + { +- Statement: `ALTER TABLE t add COLUMN (a JSON, b BLOB, c TEXT)`, ++ Statement: ` ++ CREATE TABLE t(d int); ++ ALTER TABLE t add COLUMN (a JSON, b BLOB, c TEXT)`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.DisabledColumnType, + Title: ""column.type-restriction"", + Content: ""Disallow column type JSON but column `t`.`a` is"", +- Line: 1, ++ Line: 3, + }, + { + Status: advisor.Warn, + Code: advisor.DisabledColumnType, + Title: ""column.type-restriction"", + Content: ""Disallow column type BLOB but column `t`.`b` is"", +- Line: 1, ++ Line: 3, + }, + { + Status: advisor.Warn, + Code: advisor.DisabledColumnType, + Title: ""column.type-restriction"", + Content: ""Disallow column type TEXT but column `t`.`c` is"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER TABLE t CHANGE COLUMN c a JSON, MODIFY b BLOB`, ++ Statement: ` ++ CREATE TABLE t(c int, b int); ++ ALTER TABLE t CHANGE COLUMN c a JSON, MODIFY b BLOB`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.DisabledColumnType, + Title: ""column.type-restriction"", + Content: ""Disallow column type JSON but column `t`.`a` is"", +- Line: 1, ++ Line: 3, + }, + { + Status: advisor.Warn, + Code: advisor.DisabledColumnType, + Title: ""column.type-restriction"", + Content: ""Disallow column type BLOB but column `t`.`b` is"", +- Line: 1, ++ Line: 3, + }, + }, + }, +diff --git a/plugin/advisor/mysql/advisor_database_drop_empty_db_test.go b/plugin/advisor/mysql/advisor_database_drop_empty_db_test.go +index 362d6c118b5cbf..38a1b103bb8420 100644 +--- a/plugin/advisor/mysql/advisor_database_drop_empty_db_test.go ++++ b/plugin/advisor/mysql/advisor_database_drop_empty_db_test.go +@@ -20,18 +20,6 @@ func TestMySQLDatabaseAllowDropIfEmpty(t *testing.T) { + }, + }, + }, +- { +- Statement: ""DROP DATABASE IF EXISTS foo"", +- Want: []advisor.Advice{ +- { +- Status: advisor.Error, +- Code: advisor.NotCurrentDatabase, +- Title: ""database.drop-empty-database"", +- Content: ""Database `foo` that is trying to be deleted is not the current database `test`"", +- Line: 1, +- }, +- }, +- }, + } + + advisor.RunSQLReviewRuleTests(t, tests, &DatabaseAllowDropIfEmptyAdvisor{}, &advisor.SQLReviewRule{ +diff --git a/plugin/advisor/mysql/advisor_index_key_number_limit_test.go b/plugin/advisor/mysql/advisor_index_key_number_limit_test.go +index 91fc3210b46621..61fca79af759bb 100644 +--- a/plugin/advisor/mysql/advisor_index_key_number_limit_test.go ++++ b/plugin/advisor/mysql/advisor_index_key_number_limit_test.go +@@ -40,38 +40,44 @@ func TestIndexKeyNumberLimit(t *testing.T) { + }, + }, + { +- Statement: `CREATE INDEX idx ON t(a, b, c, d, e, f, g)`, ++ Statement: ` ++ CREATE TABLE t(a int, b int, c int, d int, e int, f int, g int); ++ CREATE INDEX idx ON t(a, b, c, d, e, f, g)`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.IndexKeyNumberExceedsLimit, + Title: ""index.key-number-limit"", + Content: ""The number of index `idx` in table `t` should be not greater than 5"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER TABLE t ADD UNIQUE KEY uk (a, b, c, d, e, f, g)`, ++ Statement: ` ++ CREATE TABLE t(a int, b int, c int, d int, e int, f int, g int); ++ ALTER TABLE t ADD UNIQUE KEY uk (a, b, c, d, e, f, g)`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.IndexKeyNumberExceedsLimit, + Title: ""index.key-number-limit"", + Content: ""The number of index `uk` in table `t` should be not greater than 5"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER TABLE t ADD FOREIGN KEY uk (a, b, c, d, e, f, g) REFERENCES t1(a, b, c, d, e, f, g)`, ++ Statement: ` ++ CREATE TABLE t(a int, b int, c int, d int, e int, f int, g int); ++ ALTER TABLE t ADD FOREIGN KEY uk (a, b, c, d, e, f, g) REFERENCES t1(a, b, c, d, e, f, g)`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.IndexKeyNumberExceedsLimit, + Title: ""index.key-number-limit"", + Content: ""The number of index `uk` in table `t` should be not greater than 5"", +- Line: 1, ++ Line: 3, + }, + }, + }, +diff --git a/plugin/advisor/mysql/advisor_index_no_duplicate_column_test.go b/plugin/advisor/mysql/advisor_index_no_duplicate_column_test.go +index a133b853c63064..614cac2f3a3df7 100644 +--- a/plugin/advisor/mysql/advisor_index_no_duplicate_column_test.go ++++ b/plugin/advisor/mysql/advisor_index_no_duplicate_column_test.go +@@ -36,62 +36,72 @@ func TestIndexNoDuplicateColumn(t *testing.T) { + }, + }, + { +- Statement: `CREATE INDEX idx_a on t(a, a)`, ++ Statement: ` ++ CREATE TABLE t(a int); ++ CREATE INDEX idx_a on t(a, a)`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.DuplicateColumnInIndex, + Title: ""index.no-duplicate-column"", + Content: ""INDEX `idx_a` has duplicate column `t`.`a`"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER TABLE t ADD INDEX idx_a (a, a)`, ++ Statement: ` ++ CREATE TABLE t(a int); ++ ALTER TABLE t ADD INDEX idx_a (a, a)`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.DuplicateColumnInIndex, + Title: ""index.no-duplicate-column"", + Content: ""INDEX `idx_a` has duplicate column `t`.`a`"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER TABLE t ADD PRIMARY KEY pk_a (a, a)`, ++ Statement: ` ++ CREATE TABLE t(a int); ++ ALTER TABLE t ADD PRIMARY KEY pk_a (a, a)`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.DuplicateColumnInIndex, + Title: ""index.no-duplicate-column"", + Content: ""PRIMARY KEY `pk_a` has duplicate column `t`.`a`"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER TABLE t ADD UNIQUE KEY uk_a (a, a)`, ++ Statement: ` ++ CREATE TABLE t(a int); ++ ALTER TABLE t ADD UNIQUE KEY uk_a (a, a)`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.DuplicateColumnInIndex, + Title: ""index.no-duplicate-column"", + Content: ""UNIQUE KEY `uk_a` has duplicate column `t`.`a`"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER TABLE t ADD FOREIGN KEY fk_a (a, a) REFERENCES t1(a, b)`, ++ Statement: ` ++ CREATE TABLE t(a int); ++ ALTER TABLE t ADD FOREIGN KEY fk_a (a, a) REFERENCES t1(a, b)`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.DuplicateColumnInIndex, + Title: ""index.no-duplicate-column"", + Content: ""FOREIGN KEY `fk_a` has duplicate column `t`.`a`"", +- Line: 1, ++ Line: 3, + }, + }, + }, +diff --git a/plugin/advisor/mysql/advisor_index_not_exists.go b/plugin/advisor/mysql/advisor_index_not_exists.go +deleted file mode 100644 +index f2fc69373e032a..00000000000000 +--- a/plugin/advisor/mysql/advisor_index_not_exists.go ++++ /dev/null +@@ -1,129 +0,0 @@ +-package mysql +- +-// Framework code is generated by the generator. +- +-import ( +- ""fmt"" +- +- ""github.com/pingcap/tidb/parser/ast"" +- +- ""github.com/bytebase/bytebase/plugin/advisor"" +- ""github.com/bytebase/bytebase/plugin/advisor/catalog"" +- ""github.com/bytebase/bytebase/plugin/advisor/db"" +-) +- +-var ( +- _ advisor.Advisor = (*IndexNotExistsAdvisor)(nil) +- _ ast.Visitor = (*indexNotExistsChecker)(nil) +-) +- +-func init() { +- advisor.Register(db.MySQL, advisor.MySQLIndexNotExists, &IndexNotExistsAdvisor{}) +- advisor.Register(db.TiDB, advisor.MySQLIndexNotExists, &IndexNotExistsAdvisor{}) +-} +- +-// IndexNotExistsAdvisor is the advisor checking for index name conflict check. +-type IndexNotExistsAdvisor struct { +-} +- +-// Check checks for index name conflict check. +-func (*IndexNotExistsAdvisor) Check(ctx advisor.Context, statement string) ([]advisor.Advice, error) { +- stmtList, errAdvice := parseStatement(statement, ctx.Charset, ctx.Collation) +- if errAdvice != nil { +- return errAdvice, nil +- } +- +- level, err := advisor.NewStatusBySQLReviewRuleLevel(ctx.Rule.Level) +- if err != nil { +- return nil, err +- } +- checker := &indexNotExistsChecker{ +- level: level, +- title: string(ctx.Rule.Type), +- catalog: ctx.Catalog, +- } +- +- for _, stmt := range stmtList { +- checker.text = stmt.Text() +- checker.line = stmt.OriginTextPosition() +- (stmt).Accept(checker) +- } +- +- if len(checker.adviceList) == 0 { +- checker.adviceList = append(checker.adviceList, advisor.Advice{ +- Status: advisor.Success, +- Code: advisor.Ok, +- Title: ""OK"", +- Content: """", +- }) +- } +- return checker.adviceList, nil +-} +- +-type indexNotExistsChecker struct { +- adviceList []advisor.Advice +- level advisor.Status +- title string +- text string +- line int +- catalog *catalog.Finder +-} +- +-// Enter implements the ast.Visitor interface. +-func (checker *indexNotExistsChecker) Enter(in ast.Node) (ast.Node, bool) { +- type indexData struct { +- table string +- index string +- } +- var indexList []indexData +- switch node := in.(type) { +- case *ast.AlterTableStmt: +- for _, spec := range node.Specs { +- if spec.Tp == ast.AlterTableAddConstraint { +- switch spec.Constraint.Tp { +- case ast.ConstraintUniq, +- ast.ConstraintUniqIndex, +- ast.ConstraintUniqKey, +- ast.ConstraintIndex, +- ast.ConstraintKey: +- if spec.Constraint.Name != """" && +- !spec.Constraint.IfNotExists && +- checker.indexExists(node.Table.Name.O, spec.Constraint.Name) { +- indexList = append(indexList, indexData{ +- table: node.Table.Name.O, +- index: spec.Constraint.Name, +- }) +- } +- } +- } +- } +- case *ast.CreateIndexStmt: +- if node.IndexName != """" && !node.IfNotExists && checker.indexExists(node.Table.Name.O, node.IndexName) { +- indexList = append(indexList, indexData{ +- table: node.Table.Name.O, +- index: node.IndexName, +- }) +- } +- } +- +- for _, index := range indexList { +- checker.adviceList = append(checker.adviceList, advisor.Advice{ +- Status: checker.level, +- Code: advisor.IndexExists, +- Title: checker.title, +- Content: fmt.Sprintf(""Index `%s` in table `%s` exists"", index.index, index.table), +- Line: checker.line, +- }) +- } +- return in, false +-} +- +-// Leave implements the ast.Visitor interface. +-func (*indexNotExistsChecker) Leave(in ast.Node) (ast.Node, bool) { +- return in, true +-} +- +-func (checker *indexNotExistsChecker) indexExists(table string, index string) bool { +- _, idx := checker.catalog.Origin.FindIndex(&catalog.IndexFind{TableName: table, IndexName: index}) +- return idx != nil +-} +diff --git a/plugin/advisor/mysql/advisor_index_not_exists_test.go b/plugin/advisor/mysql/advisor_index_not_exists_test.go +deleted file mode 100644 +index 1ee131ce1c4eff..00000000000000 +--- a/plugin/advisor/mysql/advisor_index_not_exists_test.go ++++ /dev/null +@@ -1,79 +0,0 @@ +-package mysql +- +-// Framework code is generated by the generator. +- +-import ( +- ""testing"" +- +- ""github.com/bytebase/bytebase/plugin/advisor"" +-) +- +-func TestIndexNotExists(t *testing.T) { +- tests := []advisor.TestCase{ +- { +- Statement: `CREATE INDEX idx on t(a)`, +- Want: []advisor.Advice{ +- { +- Status: advisor.Success, +- Code: advisor.Ok, +- Title: ""OK"", +- Content: """", +- }, +- }, +- }, +- { +- Statement: `CREATE INDEX old_index on tech_book(a)`, +- Want: []advisor.Advice{ +- { +- Status: advisor.Warn, +- Code: advisor.IndexExists, +- Title: ""index.not-exists"", +- Content: ""Index `old_index` in table `tech_book` exists"", +- Line: 1, +- }, +- }, +- }, +- { +- Statement: `ALTER TABLE tech_book ADD CONSTRAINT old_uk UNIQUE KEY (a)`, +- Want: []advisor.Advice{ +- { +- Status: advisor.Warn, +- Code: advisor.IndexExists, +- Title: ""index.not-exists"", +- Content: ""Index `old_uk` in table `tech_book` exists"", +- Line: 1, +- }, +- }, +- }, +- { +- Statement: `ALTER TABLE tech_book ADD UNIQUE KEY old_uk (a)`, +- Want: []advisor.Advice{ +- { +- Status: advisor.Warn, +- Code: advisor.IndexExists, +- Title: ""index.not-exists"", +- Content: ""Index `old_uk` in table `tech_book` exists"", +- Line: 1, +- }, +- }, +- }, +- { +- Statement: `ALTER TABLE tech_book ADD KEY old_index (a)`, +- Want: []advisor.Advice{ +- { +- Status: advisor.Warn, +- Code: advisor.IndexExists, +- Title: ""index.not-exists"", +- Content: ""Index `old_index` in table `tech_book` exists"", +- Line: 1, +- }, +- }, +- }, +- } +- +- advisor.RunSQLReviewRuleTests(t, tests, &IndexNotExistsAdvisor{}, &advisor.SQLReviewRule{ +- Type: advisor.SchemaRuleIndexNotExists, +- Level: advisor.SchemaRuleLevelWarning, +- Payload: """", +- }, advisor.MockMySQLDatabase) +-} +diff --git a/plugin/advisor/mysql/advisor_index_pk_type_test.go b/plugin/advisor/mysql/advisor_index_pk_type_test.go +index 34ee6446050528..7e8a978b6f2c4d 100644 +--- a/plugin/advisor/mysql/advisor_index_pk_type_test.go ++++ b/plugin/advisor/mysql/advisor_index_pk_type_test.go +@@ -90,19 +90,23 @@ func TestIndexPkType(t *testing.T) { + }, + // ALTER TABLE ADD COLUMN OPTION PRIMARY KEY + { +- Statement: `ALTER TABLE t ADD COLUMN id VARCHAR(5) PRIMARY KEY`, ++ Statement: ` ++ CREATE TABLE t(a int); ++ ALTER TABLE t ADD COLUMN id VARCHAR(5) PRIMARY KEY`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.IndexPKType, + Title: ""index.pk-type"", + Content: ""Columns in primary key must be INT/BIGINT but `t`.`id` is varchar(5)"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER TABLE t ADD COLUMN id INT PRIMARY KEY`, ++ Statement: ` ++ CREATE TABLE t(a int); ++ ALTER TABLE t ADD COLUMN id INT PRIMARY KEY`, + Want: []advisor.Advice{ + { + Status: advisor.Success, +@@ -114,38 +118,44 @@ func TestIndexPkType(t *testing.T) { + }, + // ALTER TABLE ADD COLUMN ADD PRIAMRY KEY CONSTRAINT + { +- Statement: `ALTER TABLE t ADD COLUMN id VARCHAR(5), ADD PRIMARY KEY (id)`, ++ Statement: ` ++ CREATE TABLE t(a int); ++ ALTER TABLE t ADD COLUMN id VARCHAR(5), ADD PRIMARY KEY (id)`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.IndexPKType, + Title: ""index.pk-type"", + Content: ""Columns in primary key must be INT/BIGINT but `t`.`id` is varchar(5)"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER TABLE t ADD COLUMN id INT, ADD COLUMN id2 VARCHAR(5), ADD COLUMN id3 VARCHAR(5), ADD PRIMARY KEY (id, id2, id3)`, ++ Statement: ` ++ CREATE TABLE t(a int); ++ ALTER TABLE t ADD COLUMN id INT, ADD COLUMN id2 VARCHAR(5), ADD COLUMN id3 VARCHAR(5), ADD PRIMARY KEY (id, id2, id3)`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.IndexPKType, + Title: ""index.pk-type"", + Content: ""Columns in primary key must be INT/BIGINT but `t`.`id2` is varchar(5)"", +- Line: 1, ++ Line: 3, + }, + { + Status: advisor.Warn, + Code: advisor.IndexPKType, + Title: ""index.pk-type"", + Content: ""Columns in primary key must be INT/BIGINT but `t`.`id3` is varchar(5)"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER TABLE t ADD COLUMN id INT, ADD COLUMN id2 BIGINT, ADD PRIMARY KEY (id, id2)`, ++ Statement: ` ++ CREATE TABLE t(a int); ++ ALTER TABLE t ADD COLUMN id INT, ADD COLUMN id2 BIGINT, ADD PRIMARY KEY (id, id2)`, + Want: []advisor.Advice{ + { + Status: advisor.Success, +@@ -156,7 +166,9 @@ func TestIndexPkType(t *testing.T) { + }, + }, + { +- Statement: `ALTER TABLE t ADD COLUMN id BIGINT, ADD PRIMARY KEY (id)`, ++ Statement: ` ++ CREATE TABLE t(a int); ++ ALTER TABLE t ADD COLUMN id BIGINT, ADD PRIMARY KEY (id)`, + Want: []advisor.Advice{ + { + Status: advisor.Success, +@@ -230,19 +242,23 @@ func TestIndexPkType(t *testing.T) { + }, + // ALTER TABLE MODIFY COLUMN + { +- Statement: `ALTER TABLE t MODIFY COLUMN id VARCHAR(5) PRIMARY KEY;`, ++ Statement: ` ++ CREATE TABLE t(id int); ++ ALTER TABLE t MODIFY COLUMN id VARCHAR(5) PRIMARY KEY;`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.IndexPKType, + Title: ""index.pk-type"", + Content: ""Columns in primary key must be INT/BIGINT but `t`.`id` is varchar(5)"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER TABLE t MODIFY COLUMN id INT(5) PRIMARY KEY;`, ++ Statement: ` ++ CREATE TABLE t(id int); ++ ALTER TABLE t MODIFY COLUMN id INT(5) PRIMARY KEY;`, + Want: []advisor.Advice{ + { + Status: advisor.Success, +@@ -254,19 +270,23 @@ func TestIndexPkType(t *testing.T) { + }, + // ALTER TABLE CHANGE COLUMN + { +- Statement: `ALTER TABLE t CHANGE COLUMN id id2 VARCHAR(5) PRIMARY KEY`, ++ Statement: ` ++ CREATE TABLE t(id int); ++ ALTER TABLE t CHANGE COLUMN id id2 VARCHAR(5) PRIMARY KEY`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.IndexPKType, + Title: ""index.pk-type"", + Content: ""Columns in primary key must be INT/BIGINT but `t`.`id2` is varchar(5)"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER TABLE t CHANGE COLUMN id id2 INT(5) PRIMARY KEY`, ++ Statement: ` ++ CREATE TABLE t(id int); ++ ALTER TABLE t CHANGE COLUMN id id2 INT(5) PRIMARY KEY`, + Want: []advisor.Advice{ + { + Status: advisor.Success, +diff --git a/plugin/advisor/mysql/advisor_index_type_no_blob_test.go b/plugin/advisor/mysql/advisor_index_type_no_blob_test.go +index 2502a79ee53c2d..53397ef18dfd68 100644 +--- a/plugin/advisor/mysql/advisor_index_type_no_blob_test.go ++++ b/plugin/advisor/mysql/advisor_index_type_no_blob_test.go +@@ -114,71 +114,79 @@ func TestIndexTypeNoBlob(t *testing.T) { + }, + // ALTER TABLE ADD COLUMN ADD CONSTRAINT + { +- Statement: `ALTER TABLE t ADD COLUMN b BLOB, ADD COLUMN id INT, ADD PRIMARY KEY(b(1), id)`, ++ Statement: ` ++ CREATE TABLE t(a int); ++ ALTER TABLE t ADD COLUMN b BLOB, ADD COLUMN id INT, ADD PRIMARY KEY(b(1), id)`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.IndexTypeNoBlob, + Title: ""index.type-no-blob"", + Content: ""Columns in index must not be BLOB but `t`.`b` is blob"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER TABLE t ADD COLUMN b BLOB, ADD COLUMN mb MEDIUMBLOB, ADD COLUMN lb LONGBLOB, ADD COLUMN id INT, ADD UNIQUE INDEX(b(1), mb(2), lb(3), id)`, ++ Statement: ` ++ CREATE TABLE t(a int); ++ ALTER TABLE t ADD COLUMN b BLOB, ADD COLUMN mb MEDIUMBLOB, ADD COLUMN lb LONGBLOB, ADD COLUMN id INT, ADD UNIQUE INDEX(b(1), mb(2), lb(3), id)`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.IndexTypeNoBlob, + Title: ""index.type-no-blob"", + Content: ""Columns in index must not be BLOB but `t`.`b` is blob"", +- Line: 1, ++ Line: 3, + }, + { + Status: advisor.Warn, + Code: advisor.IndexTypeNoBlob, + Title: ""index.type-no-blob"", + Content: ""Columns in index must not be BLOB but `t`.`mb` is mediumblob"", +- Line: 1, ++ Line: 3, + }, + { + Status: advisor.Warn, + Code: advisor.IndexTypeNoBlob, + Title: ""index.type-no-blob"", + Content: ""Columns in index must not be BLOB but `t`.`lb` is longblob"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER TABLE t ADD COLUMN b BLOB, ADD COLUMN mb MEDIUMBLOB, ADD COLUMN lb LONGBLOB, ADD COLUMN id INT, ADD INDEX(b(1), mb(2), lb(3), id)`, ++ Statement: ` ++ CREATE TABLE t(a int); ++ ALTER TABLE t ADD COLUMN b BLOB, ADD COLUMN mb MEDIUMBLOB, ADD COLUMN lb LONGBLOB, ADD COLUMN id INT, ADD INDEX(b(1), mb(2), lb(3), id)`, + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.IndexTypeNoBlob, + Title: ""index.type-no-blob"", + Content: ""Columns in index must not be BLOB but `t`.`b` is blob"", +- Line: 1, ++ Line: 3, + }, + { + Status: advisor.Warn, + Code: advisor.IndexTypeNoBlob, + Title: ""index.type-no-blob"", + Content: ""Columns in index must not be BLOB but `t`.`mb` is mediumblob"", +- Line: 1, ++ Line: 3, + }, + { + Status: advisor.Warn, + Code: advisor.IndexTypeNoBlob, + Title: ""index.type-no-blob"", + Content: ""Columns in index must not be BLOB but `t`.`lb` is longblob"", +- Line: 1, ++ Line: 3, + }, + }, + }, + { +- Statement: `ALTER TABLE t ADD COLUMN b BLOB, ADD COLUMN mb MEDIUMBLOB, ADD COLUMN lb LONGBLOB, ADD COLUMN id INT, ADD INDEX(id)`, ++ Statement: ` ++ CREATE TABLE t(a int); ++ ALTER TABLE t ADD COLUMN b BLOB, ADD COLUMN mb MEDIUMBLOB, ADD COLUMN lb LONGBLOB, ADD COLUMN id INT, ADD INDEX(id)`, + Want: []advisor.Advice{ + { + Status: advisor.Success, +diff --git a/plugin/advisor/mysql/advisor_migration_compatibility_test.go b/plugin/advisor/mysql/advisor_migration_compatibility_test.go +index d035334e35ff50..74359ca1bd691c 100644 +--- a/plugin/advisor/mysql/advisor_migration_compatibility_test.go ++++ b/plugin/advisor/mysql/advisor_migration_compatibility_test.go +@@ -11,37 +11,37 @@ import ( + func TestBasic(t *testing.T) { + tests := []advisor.TestCase{ + { +- Statement: ""DROP DATABASE d1"", ++ Statement: ""DROP DATABASE test"", + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.CompatibilityDropDatabase, + Title: ""schema.backward-compatibility"", +- Content: ""\""DROP DATABASE d1\"" may cause incompatibility with the existing data and code"", ++ Content: ""\""DROP DATABASE test\"" may cause incompatibility with the existing data and code"", + Line: 1, + }, + }, + }, + { +- Statement: ""DROP TABLE t1"", ++ Statement: ""DROP TABLE tech_book"", + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.CompatibilityDropTable, + Title: ""schema.backward-compatibility"", +- Content: ""\""DROP TABLE t1\"" may cause incompatibility with the existing data and code"", ++ Content: ""\""DROP TABLE tech_book\"" may cause incompatibility with the existing data and code"", + Line: 1, + }, + }, + }, + { +- Statement: ""RENAME TABLE t1 to t2"", ++ Statement: ""RENAME TABLE tech_book to t2"", + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.CompatibilityRenameTable, + Title: ""schema.backward-compatibility"", +- Content: ""\""RENAME TABLE t1 to t2\"" may cause incompatibility with the existing data and code"", ++ Content: ""\""RENAME TABLE tech_book to t2\"" may cause incompatibility with the existing data and code"", + Line: 1, + }, + }, +@@ -59,19 +59,19 @@ func TestBasic(t *testing.T) { + }, + }, + { +- Statement: ""CREATE UNIQUE INDEX idx1 ON t1 (f1)"", ++ Statement: ""CREATE UNIQUE INDEX idx1 ON tech_book (id)"", + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.CompatibilityAddUniqueKey, + Title: ""schema.backward-compatibility"", +- Content: ""\""CREATE UNIQUE INDEX idx1 ON t1 (f1)\"" may cause incompatibility with the existing data and code"", ++ Content: ""\""CREATE UNIQUE INDEX idx1 ON tech_book (id)\"" may cause incompatibility with the existing data and code"", + Line: 1, + }, + }, + }, + { +- Statement: ""DROP TABLE t1;DROP TABLE t2;"", ++ Statement: ""CREATE TABLE t1(a int);DROP TABLE t1;DROP TABLE tech_book;"", + Want: []advisor.Advice{ + { + Status: advisor.Warn, +@@ -84,7 +84,7 @@ func TestBasic(t *testing.T) { + Status: advisor.Warn, + Code: advisor.CompatibilityDropTable, + Title: ""schema.backward-compatibility"", +- Content: ""\""DROP TABLE t2;\"" may cause incompatibility with the existing data and code"", ++ Content: ""\""DROP TABLE tech_book;\"" may cause incompatibility with the existing data and code"", + Line: 1, + }, + }, +@@ -129,7 +129,7 @@ func TestBasic(t *testing.T) { + func TestAlterTable(t *testing.T) { + tests := []advisor.TestCase{ + { +- Statement: ""ALTER TABLE t1 ADD f1 TEXT"", ++ Statement: ""ALTER TABLE tech_book ADD f1 TEXT"", + Want: []advisor.Advice{ + { + Status: advisor.Success, +@@ -140,103 +140,103 @@ func TestAlterTable(t *testing.T) { + }, + }, + { +- Statement: ""ALTER TABLE t1 RENAME COLUMN f1 to f2"", ++ Statement: ""ALTER TABLE tech_book RENAME COLUMN id to f2"", + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.CompatibilityRenameColumn, + Title: ""schema.backward-compatibility"", +- Content: ""\""ALTER TABLE t1 RENAME COLUMN f1 to f2\"" may cause incompatibility with the existing data and code"", ++ Content: ""\""ALTER TABLE tech_book RENAME COLUMN id to f2\"" may cause incompatibility with the existing data and code"", + Line: 1, + }, + }, + }, + { +- Statement: ""ALTER TABLE t1 DROP COLUMN f1"", ++ Statement: ""ALTER TABLE tech_book DROP COLUMN id"", + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.CompatibilityDropColumn, + Title: ""schema.backward-compatibility"", +- Content: ""\""ALTER TABLE t1 DROP COLUMN f1\"" may cause incompatibility with the existing data and code"", ++ Content: ""\""ALTER TABLE tech_book DROP COLUMN id\"" may cause incompatibility with the existing data and code"", + Line: 1, + }, + }, + }, + { +- Statement: ""ALTER TABLE t1 ADD PRIMARY KEY (f1)"", ++ Statement: ""ALTER TABLE tech_book DROP PRIMARY KEY;ALTER TABLE tech_book ADD PRIMARY KEY (id)"", + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.CompatibilityAddPrimaryKey, + Title: ""schema.backward-compatibility"", +- Content: ""\""ALTER TABLE t1 ADD PRIMARY KEY (f1)\"" may cause incompatibility with the existing data and code"", ++ Content: ""\""ALTER TABLE tech_book ADD PRIMARY KEY (id)\"" may cause incompatibility with the existing data and code"", + Line: 1, + }, + }, + }, + { +- Statement: ""ALTER TABLE t1 ADD UNIQUE (f1)"", ++ Statement: ""ALTER TABLE tech_book ADD UNIQUE (id)"", + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.CompatibilityAddUniqueKey, + Title: ""schema.backward-compatibility"", +- Content: ""\""ALTER TABLE t1 ADD UNIQUE (f1)\"" may cause incompatibility with the existing data and code"", ++ Content: ""\""ALTER TABLE tech_book ADD UNIQUE (id)\"" may cause incompatibility with the existing data and code"", + Line: 1, + }, + }, + }, + { +- Statement: ""ALTER TABLE t1 ADD UNIQUE KEY (f1)"", ++ Statement: ""ALTER TABLE tech_book ADD UNIQUE KEY (id)"", + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.CompatibilityAddUniqueKey, + Title: ""schema.backward-compatibility"", +- Content: ""\""ALTER TABLE t1 ADD UNIQUE KEY (f1)\"" may cause incompatibility with the existing data and code"", ++ Content: ""\""ALTER TABLE tech_book ADD UNIQUE KEY (id)\"" may cause incompatibility with the existing data and code"", + Line: 1, + }, + }, + }, + { +- Statement: ""ALTER TABLE t1 ADD UNIQUE INDEX (f1)"", ++ Statement: ""ALTER TABLE tech_book ADD UNIQUE INDEX (id)"", + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.CompatibilityAddUniqueKey, + Title: ""schema.backward-compatibility"", +- Content: ""\""ALTER TABLE t1 ADD UNIQUE INDEX (f1)\"" may cause incompatibility with the existing data and code"", ++ Content: ""\""ALTER TABLE tech_book ADD UNIQUE INDEX (id)\"" may cause incompatibility with the existing data and code"", + Line: 1, + }, + }, + }, + { +- Statement: ""ALTER TABLE t1 ADD FOREIGN KEY (f1) REFERENCES t2(f2)"", ++ Statement: ""ALTER TABLE tech_book ADD FOREIGN KEY (id) REFERENCES t2(f2)"", + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.CompatibilityAddForeignKey, + Title: ""schema.backward-compatibility"", +- Content: ""\""ALTER TABLE t1 ADD FOREIGN KEY (f1) REFERENCES t2(f2)\"" may cause incompatibility with the existing data and code"", ++ Content: ""\""ALTER TABLE tech_book ADD FOREIGN KEY (id) REFERENCES t2(f2)\"" may cause incompatibility with the existing data and code"", + Line: 1, + }, + }, + }, + { +- Statement: ""ALTER TABLE t1 ADD CHECK (f1 > 0)"", ++ Statement: ""ALTER TABLE tech_book ADD CHECK (id > 0)"", + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.CompatibilityAddCheck, + Title: ""schema.backward-compatibility"", +- Content: ""\""ALTER TABLE t1 ADD CHECK (f1 > 0)\"" may cause incompatibility with the existing data and code"", ++ Content: ""\""ALTER TABLE tech_book ADD CHECK (id > 0)\"" may cause incompatibility with the existing data and code"", + Line: 1, + }, + }, + }, + { +- Statement: ""ALTER TABLE t1 ADD CHECK (f1 > 0) NOT ENFORCED"", ++ Statement: ""ALTER TABLE tech_book ADD CHECK (id > 0) NOT ENFORCED"", + Want: []advisor.Advice{ + { + Status: advisor.Success, +@@ -246,19 +246,19 @@ func TestAlterTable(t *testing.T) { + }, + }, + { +- Statement: ""ALTER TABLE t1 ALTER CHECK chk1 ENFORCED"", ++ Statement: ""ALTER TABLE tech_book ALTER CHECK chk1 ENFORCED"", + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.CompatibilityAlterCheck, + Title: ""schema.backward-compatibility"", +- Content: ""\""ALTER TABLE t1 ALTER CHECK chk1 ENFORCED\"" may cause incompatibility with the existing data and code"", ++ Content: ""\""ALTER TABLE tech_book ALTER CHECK chk1 ENFORCED\"" may cause incompatibility with the existing data and code"", + Line: 1, + }, + }, + }, + { +- Statement: ""ALTER TABLE t1 ALTER CHECK chk1 NOT ENFORCED"", ++ Statement: ""ALTER TABLE tech_book ALTER CHECK chk1 NOT ENFORCED"", + Want: []advisor.Advice{ + { + Status: advisor.Success, +@@ -268,19 +268,19 @@ func TestAlterTable(t *testing.T) { + }, + }, + { +- Statement: ""ALTER TABLE t1 ADD CONSTRAINT CHECK (f1 > 0)"", ++ Statement: ""ALTER TABLE tech_book ADD CONSTRAINT CHECK (id > 0)"", + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.CompatibilityAddCheck, + Title: ""schema.backward-compatibility"", +- Content: ""\""ALTER TABLE t1 ADD CONSTRAINT CHECK (f1 > 0)\"" may cause incompatibility with the existing data and code"", ++ Content: ""\""ALTER TABLE tech_book ADD CONSTRAINT CHECK (id > 0)\"" may cause incompatibility with the existing data and code"", + Line: 1, + }, + }, + }, + { +- Statement: ""ALTER TABLE t1 ADD CONSTRAINT CHECK (f1 > 0) NOT ENFORCED"", ++ Statement: ""ALTER TABLE tech_book ADD CONSTRAINT CHECK (id > 0) NOT ENFORCED"", + Want: []advisor.Advice{ + { + Status: advisor.Success, +@@ -291,13 +291,13 @@ func TestAlterTable(t *testing.T) { + }, + }, + { +- Statement: ""ALTER TABLE t1 RENAME TO t2"", ++ Statement: ""ALTER TABLE tech_book RENAME TO t2"", + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.CompatibilityRenameTable, + Title: ""schema.backward-compatibility"", +- Content: ""\""ALTER TABLE t1 RENAME TO t2\"" may cause incompatibility with the existing data and code"", ++ Content: ""\""ALTER TABLE tech_book RENAME TO t2\"" may cause incompatibility with the existing data and code"", + Line: 1, + }, + }, +@@ -314,61 +314,61 @@ func TestAlterTable(t *testing.T) { + func TestAlterTableChangeColumnType(t *testing.T) { + tests := []advisor.TestCase{ + { +- Statement: ""ALTER TABLE t1 CHANGE f1 f2 TEXT"", ++ Statement: ""ALTER TABLE tech_book CHANGE name f2 TEXT"", + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.CompatibilityAlterColumn, + Title: ""schema.backward-compatibility"", +- Content: ""\""ALTER TABLE t1 CHANGE f1 f2 TEXT\"" may cause incompatibility with the existing data and code"", ++ Content: ""\""ALTER TABLE tech_book CHANGE name f2 TEXT\"" may cause incompatibility with the existing data and code"", + Line: 1, + }, + }, + }, + { +- Statement: ""ALTER TABLE t1 MODIFY f1 TEXT"", ++ Statement: ""ALTER TABLE tech_book MODIFY name TEXT"", + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.CompatibilityAlterColumn, + Title: ""schema.backward-compatibility"", +- Content: ""\""ALTER TABLE t1 MODIFY f1 TEXT\"" may cause incompatibility with the existing data and code"", ++ Content: ""\""ALTER TABLE tech_book MODIFY name TEXT\"" may cause incompatibility with the existing data and code"", + Line: 1, + }, + }, + }, + { +- Statement: ""ALTER TABLE t1 MODIFY f1 TEXT NULL"", ++ Statement: ""ALTER TABLE tech_book MODIFY name TEXT NULL"", + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.CompatibilityAlterColumn, + Title: ""schema.backward-compatibility"", +- Content: ""\""ALTER TABLE t1 MODIFY f1 TEXT NULL\"" may cause incompatibility with the existing data and code"", ++ Content: ""\""ALTER TABLE tech_book MODIFY name TEXT NULL\"" may cause incompatibility with the existing data and code"", + Line: 1, + }, + }, + }, + { +- Statement: ""ALTER TABLE t1 MODIFY f1 TEXT NOT NULL"", ++ Statement: ""ALTER TABLE tech_book MODIFY name TEXT NOT NULL"", + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.CompatibilityAlterColumn, + Title: ""schema.backward-compatibility"", +- Content: ""\""ALTER TABLE t1 MODIFY f1 TEXT NOT NULL\"" may cause incompatibility with the existing data and code"", ++ Content: ""\""ALTER TABLE tech_book MODIFY name TEXT NOT NULL\"" may cause incompatibility with the existing data and code"", + Line: 1, + }, + }, + }, + { +- Statement: ""ALTER TABLE t1 MODIFY f1 TEXT COMMENT 'bla'"", ++ Statement: ""ALTER TABLE tech_book MODIFY name TEXT COMMENT 'bla'"", + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.CompatibilityAlterColumn, + Title: ""schema.backward-compatibility"", +- Content: ""\""ALTER TABLE t1 MODIFY f1 TEXT COMMENT 'bla'\"" may cause incompatibility with the existing data and code"", ++ Content: ""\""ALTER TABLE tech_book MODIFY name TEXT COMMENT 'bla'\"" may cause incompatibility with the existing data and code"", + Line: 1, + }, + }, +diff --git a/plugin/advisor/mysql/advisor_naming_column_test.go b/plugin/advisor/mysql/advisor_naming_column_test.go +index 5510efa4b19b6b..4cf6bc2953f87e 100644 +--- a/plugin/advisor/mysql/advisor_naming_column_test.go ++++ b/plugin/advisor/mysql/advisor_naming_column_test.go +@@ -63,7 +63,7 @@ func TestNamingColumnConvention(t *testing.T) { + }, + }, + { +- Statement: `ALTER TABLE book RENAME COLUMN creatorId TO creator_id;`, ++ Statement: `ALTER TABLE tech_book RENAME COLUMN id TO creator_id;`, + Want: []advisor.Advice{ + { + Status: advisor.Success, +@@ -92,7 +92,7 @@ func TestNamingColumnConvention(t *testing.T) { + }, + }, + { +- Statement: `ALTER TABLE book CHANGE COLUMN creatorId creator_id int;`, ++ Statement: `ALTER TABLE tech_book CHANGE COLUMN id creator_id int;`, + Want: []advisor.Advice{ + { + Status: advisor.Success, +@@ -103,7 +103,7 @@ func TestNamingColumnConvention(t *testing.T) { + }, + }, + { +- Statement: `ALTER TABLE book DROP COLUMN contentString;`, ++ Statement: `ALTER TABLE tech_book DROP COLUMN id;`, + Want: []advisor.Advice{ + { + Status: advisor.Success, +diff --git a/plugin/advisor/mysql/advisor_naming_index_convention_test.go b/plugin/advisor/mysql/advisor_naming_index_convention_test.go +index 131da855f24780..77534f2413e4f9 100644 +--- a/plugin/advisor/mysql/advisor_naming_index_convention_test.go ++++ b/plugin/advisor/mysql/advisor_naming_index_convention_test.go +@@ -111,7 +111,7 @@ func TestNamingIndexConvention(t *testing.T) { + }, + }, + { +- Statement: ""CREATE TABLE tech_book(id INT PRIMARY KEY, name VARCHAR(20), INDEX idx_tech_book_name (name))"", ++ Statement: ""CREATE TABLE tech_book_copy(id INT PRIMARY KEY, name VARCHAR(20), INDEX idx_tech_book_copy_name (name))"", + Want: []advisor.Advice{ + { + Status: advisor.Success, +@@ -122,7 +122,7 @@ func TestNamingIndexConvention(t *testing.T) { + }, + }, + { +- Statement: ""CREATE TABLE tech_book(id INT PRIMARY KEY, name VARCHAR(20), INDEX (name))"", ++ Statement: ""CREATE TABLE tech_book_copy(id INT PRIMARY KEY, name VARCHAR(20), INDEX (name))"", + Want: []advisor.Advice{ + { + Status: advisor.Success, +diff --git a/plugin/advisor/mysql/advisor_naming_table_test.go b/plugin/advisor/mysql/advisor_naming_table_test.go +index 623875c3a6d9e7..d97f7fe91f18f9 100644 +--- a/plugin/advisor/mysql/advisor_naming_table_test.go ++++ b/plugin/advisor/mysql/advisor_naming_table_test.go +@@ -27,7 +27,7 @@ func TestMySQLNamingTableConvention(t *testing.T) { + }, + }, + { +- Statement: ""CREATE TABLE tech_book(id int, name varchar(255))"", ++ Statement: ""CREATE TABLE tech_book_copy(id int, name varchar(255))"", + Want: []advisor.Advice{ + { + Status: advisor.Success, +@@ -50,7 +50,7 @@ func TestMySQLNamingTableConvention(t *testing.T) { + }, + }, + { +- Statement: ""ALTER TABLE techBook RENAME TO TechBook"", ++ Statement: ""ALTER TABLE tech_book RENAME TO TechBook"", + Want: []advisor.Advice{ + { + Status: advisor.Error, +@@ -62,7 +62,7 @@ func TestMySQLNamingTableConvention(t *testing.T) { + }, + }, + { +- Statement: ""ALTER TABLE techBook RENAME TO tech_book"", ++ Statement: ""ALTER TABLE tech_book RENAME TO tech_book_copy"", + Want: []advisor.Advice{ + { + Status: advisor.Success, +@@ -73,7 +73,7 @@ func TestMySQLNamingTableConvention(t *testing.T) { + }, + }, + { +- Statement: ""RENAME TABLE techBook TO tech_book, literaryBook TO LiteraryBook"", ++ Statement: ""RENAME TABLE tech_book TO tech_book_copy, tech_book_copy TO LiteraryBook"", + Want: []advisor.Advice{ + { + Status: advisor.Error, +@@ -85,7 +85,7 @@ func TestMySQLNamingTableConvention(t *testing.T) { + }, + }, + { +- Statement: ""RENAME TABLE techBook TO TechBook, literaryBook TO LiteraryBook"", ++ Statement: ""CREATE TABLE literary_book(a int);RENAME TABLE tech_book TO TechBook, literary_book TO LiteraryBook"", + Want: []advisor.Advice{ + { + Status: advisor.Error, +@@ -104,7 +104,7 @@ func TestMySQLNamingTableConvention(t *testing.T) { + }, + }, + { +- Statement: ""RENAME TABLE techBook TO tech_book, literaryBook TO literary_book"", ++ Statement: ""CREATE TABLE literary_book(a int);RENAME TABLE tech_book TO tech_book_copy, literary_book TO literary_book_copy"", + Want: []advisor.Advice{ + { + Status: advisor.Success, +diff --git a/plugin/advisor/mysql/advisor_naming_unique_key_convention_test.go b/plugin/advisor/mysql/advisor_naming_unique_key_convention_test.go +index 1be026e3c92e65..e7549562a95281 100644 +--- a/plugin/advisor/mysql/advisor_naming_unique_key_convention_test.go ++++ b/plugin/advisor/mysql/advisor_naming_unique_key_convention_test.go +@@ -111,7 +111,7 @@ func TestNamingUKConvention(t *testing.T) { + }, + }, + { +- Statement: ""CREATE TABLE tech_book(id INT PRIMARY KEY, name VARCHAR(20), UNIQUE INDEX uk_tech_book_name (name))"", ++ Statement: ""CREATE TABLE book(id INT PRIMARY KEY, name VARCHAR(20), UNIQUE INDEX uk_book_name (name))"", + Want: []advisor.Advice{ + { + Status: advisor.Success, +@@ -122,7 +122,7 @@ func TestNamingUKConvention(t *testing.T) { + }, + }, + { +- Statement: ""CREATE TABLE tech_book(id INT PRIMARY KEY, name VARCHAR(20), UNIQUE KEY (name))"", ++ Statement: ""CREATE TABLE book(id INT PRIMARY KEY, name VARCHAR(20), UNIQUE KEY (name))"", + Want: []advisor.Advice{ + { + Status: advisor.Success, +@@ -133,7 +133,7 @@ func TestNamingUKConvention(t *testing.T) { + }, + }, + { +- Statement: ""CREATE TABLE tech_book(id INT PRIMARY KEY, name VARCHAR(20), UNIQUE INDEX (name))"", ++ Statement: ""CREATE TABLE book(id INT PRIMARY KEY, name VARCHAR(20), UNIQUE INDEX (name))"", + Want: []advisor.Advice{ + { + Status: advisor.Success, +diff --git a/plugin/advisor/mysql/advisor_stmt_where_required_test.go b/plugin/advisor/mysql/advisor_stmt_where_required_test.go +index 6e7556a52a1916..9d19c72b0c02a5 100644 +--- a/plugin/advisor/mysql/advisor_stmt_where_required_test.go ++++ b/plugin/advisor/mysql/advisor_stmt_where_required_test.go +@@ -9,7 +9,7 @@ import ( + func TestWhereRequirement(t *testing.T) { + tests := []advisor.TestCase{ + { +- Statement: ""INSERT INTO t values (1)"", ++ Statement: ""INSERT INTO tech_book(id) values (1)"", + Want: []advisor.Advice{ + { + Status: advisor.Success, +@@ -20,31 +20,31 @@ func TestWhereRequirement(t *testing.T) { + }, + }, + { +- Statement: ""DELETE FROM t1"", ++ Statement: ""DELETE FROM tech_book"", + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.StatementNoWhere, + Title: ""statement.where.require"", +- Content: ""\""DELETE FROM t1\"" requires WHERE clause"", ++ Content: ""\""DELETE FROM tech_book\"" requires WHERE clause"", + Line: 1, + }, + }, + }, + { +- Statement: ""UPDATE t1 SET a = 1"", ++ Statement: ""UPDATE tech_book SET id = 1"", + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.StatementNoWhere, + Title: ""statement.where.require"", +- Content: ""\""UPDATE t1 SET a = 1\"" requires WHERE clause"", ++ Content: ""\""UPDATE tech_book SET id = 1\"" requires WHERE clause"", + Line: 1, + }, + }, + }, + { +- Statement: ""DELETE FROM t1 WHERE a > 0"", ++ Statement: ""DELETE FROM tech_book WHERE id > 0"", + Want: []advisor.Advice{ + { + Status: advisor.Success, +@@ -55,7 +55,7 @@ func TestWhereRequirement(t *testing.T) { + }, + }, + { +- Statement: ""UPDATE t1 SET a = 1 WHERE a > 10"", ++ Statement: ""UPDATE tech_book SET id = 1 WHERE id > 10"", + Want: []advisor.Advice{ + { + Status: advisor.Success, +@@ -66,19 +66,19 @@ func TestWhereRequirement(t *testing.T) { + }, + }, + { +- Statement: ""SELECT a FROM t"", ++ Statement: ""SELECT id FROM tech_book"", + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.StatementNoWhere, + Title: ""statement.where.require"", +- Content: ""\""SELECT a FROM t\"" requires WHERE clause"", ++ Content: ""\""SELECT id FROM tech_book\"" requires WHERE clause"", + Line: 1, + }, + }, + }, + { +- Statement: ""SELECT a FROM t WHERE a > 0"", ++ Statement: ""SELECT id FROM tech_book WHERE id > 0"", + Want: []advisor.Advice{ + { + Status: advisor.Success, +@@ -89,13 +89,13 @@ func TestWhereRequirement(t *testing.T) { + }, + }, + { +- Statement: ""SELECT a FROM t WHERE a > (SELECT max(id) FROM user)"", ++ Statement: ""SELECT id FROM tech_book WHERE id > (SELECT max(id) FROM tech_book)"", + Want: []advisor.Advice{ + { + Status: advisor.Warn, + Code: advisor.StatementNoWhere, + Title: ""statement.where.require"", +- Content: ""\""SELECT a FROM t WHERE a > (SELECT max(id) FROM user)\"" requires WHERE clause"", ++ Content: ""\""SELECT id FROM tech_book WHERE id > (SELECT max(id) FROM tech_book)\"" requires WHERE clause"", + Line: 1, + }, + }, +diff --git a/plugin/advisor/mysql/advisor_table_disallow_create_table_as_test.go b/plugin/advisor/mysql/advisor_table_disallow_create_table_as_test.go +index a3a5992311f732..f271249b3279ad 100644 +--- a/plugin/advisor/mysql/advisor_table_disallow_create_table_as_test.go ++++ b/plugin/advisor/mysql/advisor_table_disallow_create_table_as_test.go +@@ -13,7 +13,7 @@ func TestTableDisallowCreateTableAs(t *testing.T) { + { + Statement: `CREATE TABLE t AS + ( +- SELECT * FROM tbl ++ SELECT * FROM tech_book + ) + `, + Want: []advisor.Advice{ +@@ -39,7 +39,7 @@ func TestTableDisallowCreateTableAs(t *testing.T) { + }, + }, + { +- Statement: `CREATE TABLE t LIKE tbl`, ++ Statement: `CREATE TABLE t LIKE tech_book`, + Want: []advisor.Advice{ + { + Status: advisor.Success, +diff --git a/plugin/advisor/mysql/advisor_table_exists.go b/plugin/advisor/mysql/advisor_table_exists.go +deleted file mode 100644 +index 55e42a4e31baab..00000000000000 +--- a/plugin/advisor/mysql/advisor_table_exists.go ++++ /dev/null +@@ -1,124 +0,0 @@ +-package mysql +- +-// Framework code is generated by the generator. +- +-import ( +- ""fmt"" +- +- ""github.com/pingcap/tidb/parser/ast"" +- +- ""github.com/bytebase/bytebase/plugin/advisor"" +- ""github.com/bytebase/bytebase/plugin/advisor/catalog"" +- ""github.com/bytebase/bytebase/plugin/advisor/db"" +-) +- +-var ( +- _ advisor.Advisor = (*TableExistsAdvisor)(nil) +- _ ast.Visitor = (*tableExistsChecker)(nil) +-) +- +-func init() { +- advisor.Register(db.MySQL, advisor.MySQLTableExists, &TableExistsAdvisor{}) +- advisor.Register(db.TiDB, advisor.MySQLTableExists, &TableExistsAdvisor{}) +-} +- +-// TableExistsAdvisor is the advisor checking for table existence.. +-type TableExistsAdvisor struct { +-} +- +-// Check checks for table existence.. +-func (*TableExistsAdvisor) Check(ctx advisor.Context, statement string) ([]advisor.Advice, error) { +- stmtList, errAdvice := parseStatement(statement, ctx.Charset, ctx.Collation) +- if errAdvice != nil { +- return errAdvice, nil +- } +- +- level, err := advisor.NewStatusBySQLReviewRuleLevel(ctx.Rule.Level) +- if err != nil { +- return nil, err +- } +- checker := &tableExistsChecker{ +- level: level, +- title: string(ctx.Rule.Type), +- catalog: ctx.Catalog, +- } +- +- for _, stmt := range stmtList { +- checker.text = stmt.Text() +- checker.line = stmt.OriginTextPosition() +- (stmt).Accept(checker) +- } +- +- if len(checker.adviceList) == 0 { +- checker.adviceList = append(checker.adviceList, advisor.Advice{ +- Status: advisor.Success, +- Code: advisor.Ok, +- Title: ""OK"", +- Content: """", +- }) +- } +- return checker.adviceList, nil +-} +- +-type tableExistsChecker struct { +- adviceList []advisor.Advice +- level advisor.Status +- title string +- text string +- line int +- catalog *catalog.Finder +-} +- +-// Enter implements the ast.Visitor interface. +-func (checker *tableExistsChecker) Enter(in ast.Node) (ast.Node, bool) { +- var tableList []string +- switch node := in.(type) { +- case *ast.InsertStmt: +- if name, ok := getInsertTableName(node.Table); ok { +- tableList = append(tableList, name) +- } +- case *ast.AlterTableStmt: +- tableList = append(tableList, node.Table.Name.O) +- case *ast.CreateTableStmt: +- if node.ReferTable != nil && sameDatabase(node.ReferTable.Schema.O, checker.catalog.Origin.DatabaseName()) { +- tableList = append(tableList, node.ReferTable.Name.O) +- } +- } +- +- for _, table := range tableList { +- if checker.catalog.Origin.FindTable(&catalog.TableFind{TableName: table}) == nil { +- checker.adviceList = append(checker.adviceList, advisor.Advice{ +- Status: checker.level, +- Code: advisor.TableNotExists, +- Title: checker.title, +- Content: fmt.Sprintf(""Table `%s` not exists, related statement: \""%s\"""", table, checker.text), +- Line: checker.line, +- }) +- } +- } +- +- return in, false +-} +- +-// Leave implements the ast.Visitor interface. +-func (*tableExistsChecker) Leave(in ast.Node) (ast.Node, bool) { +- return in, true +-} +- +-func sameDatabase(a string, b string) bool { +- if a == """" || b == """" { +- return true +- } +- return a == b +-} +- +-func getInsertTableName(table *ast.TableRefsClause) (string, bool) { +- source, isTableSource := table.TableRefs.Left.(*ast.TableSource) +- nilRight := table.TableRefs.Right == nil +- if isTableSource && nilRight { +- if tableName, ok := source.Source.(*ast.TableName); ok { +- return tableName.Name.O, true +- } +- } +- return """", false +-} +diff --git a/plugin/advisor/mysql/advisor_table_exists_test.go b/plugin/advisor/mysql/advisor_table_exists_test.go +deleted file mode 100644 +index 9a27af07be6b8f..00000000000000 +--- a/plugin/advisor/mysql/advisor_table_exists_test.go ++++ /dev/null +@@ -1,111 +0,0 @@ +-package mysql +- +-// Framework code is generated by the generator. +- +-import ( +- ""testing"" +- +- ""github.com/bytebase/bytebase/plugin/advisor"" +-) +- +-func TestTableExists(t *testing.T) { +- tests := []advisor.TestCase{ +- { +- Statement: `INSERT INTO tech_book values (1)`, +- Want: []advisor.Advice{ +- { +- Status: advisor.Success, +- Code: advisor.Ok, +- Title: ""OK"", +- Content: """", +- }, +- }, +- }, +- { +- Statement: `INSERT INTO t values (1)`, +- Want: []advisor.Advice{ +- { +- Status: advisor.Warn, +- Code: advisor.TableNotExists, +- Title: ""table.exists"", +- Content: ""Table `t` not exists, related statement: \""INSERT INTO t values (1)\"""", +- Line: 1, +- }, +- }, +- }, +- { +- Statement: `ALTER TABLE t ADD COLUMN a int`, +- Want: []advisor.Advice{ +- { +- Status: advisor.Warn, +- Code: advisor.TableNotExists, +- Title: ""table.exists"", +- Content: ""Table `t` not exists, related statement: \""ALTER TABLE t ADD COLUMN a int\"""", +- Line: 1, +- }, +- }, +- }, +- { +- Statement: `CREATE TABLE t_copy LIKE t`, +- Want: []advisor.Advice{ +- { +- Status: advisor.Warn, +- Code: advisor.TableNotExists, +- Title: ""table.exists"", +- Content: ""Table `t` not exists, related statement: \""CREATE TABLE t_copy LIKE t\"""", +- Line: 1, +- }, +- }, +- }, +- { +- Statement: `ALTER TABLE tech_book RENAME TO tech`, +- Want: []advisor.Advice{ +- { +- Status: advisor.Success, +- Code: advisor.Ok, +- Title: ""OK"", +- Content: """", +- }, +- }, +- }, +- { +- Statement: `CREATE TABLE tech_book_copy LIKE tech_book`, +- Want: []advisor.Advice{ +- { +- Status: advisor.Success, +- Code: advisor.Ok, +- Title: ""OK"", +- Content: """", +- }, +- }, +- }, +- { +- Statement: `CREATE TABLE tech_book_copy AS SELECT * from t`, +- Want: []advisor.Advice{ +- { +- Status: advisor.Success, +- Code: advisor.Ok, +- Title: ""OK"", +- Content: """", +- }, +- }, +- }, +- { +- Statement: `CREATE TABLE tech_book_copy (a int)`, +- Want: []advisor.Advice{ +- { +- Status: advisor.Success, +- Code: advisor.Ok, +- Title: ""OK"", +- Content: """", +- }, +- }, +- }, +- } +- +- advisor.RunSQLReviewRuleTests(t, tests, &TableExistsAdvisor{}, &advisor.SQLReviewRule{ +- Type: advisor.SchemaRuleTableExists, +- Level: advisor.SchemaRuleLevelWarning, +- Payload: """", +- }, advisor.MockMySQLDatabase) +-} +diff --git a/plugin/advisor/mysql/advisor_table_not_exists.go b/plugin/advisor/mysql/advisor_table_not_exists.go +deleted file mode 100644 +index bd8f3ab83cfd5a..00000000000000 +--- a/plugin/advisor/mysql/advisor_table_not_exists.go ++++ /dev/null +@@ -1,96 +0,0 @@ +-package mysql +- +-// Framework code is generated by the generator. +- +-import ( +- ""fmt"" +- +- ""github.com/pingcap/tidb/parser/ast"" +- +- ""github.com/bytebase/bytebase/plugin/advisor"" +- ""github.com/bytebase/bytebase/plugin/advisor/catalog"" +- ""github.com/bytebase/bytebase/plugin/advisor/db"" +-) +- +-var ( +- _ advisor.Advisor = (*TableNotExistsAdvisor)(nil) +- _ ast.Visitor = (*tableNotExistsChecker)(nil) +-) +- +-func init() { +- advisor.Register(db.MySQL, advisor.MySQLTableNotExists, &TableNotExistsAdvisor{}) +- advisor.Register(db.TiDB, advisor.MySQLTableNotExists, &TableNotExistsAdvisor{}) +-} +- +-// TableNotExistsAdvisor is the advisor checking for table name conflict check. +-type TableNotExistsAdvisor struct { +-} +- +-// Check checks for table name conflict check. +-func (*TableNotExistsAdvisor) Check(ctx advisor.Context, statement string) ([]advisor.Advice, error) { +- stmtList, errAdvice := parseStatement(statement, ctx.Charset, ctx.Collation) +- if errAdvice != nil { +- return errAdvice, nil +- } +- +- level, err := advisor.NewStatusBySQLReviewRuleLevel(ctx.Rule.Level) +- if err != nil { +- return nil, err +- } +- checker := &tableNotExistsChecker{ +- level: level, +- title: string(ctx.Rule.Type), +- catalog: ctx.Catalog, +- } +- +- for _, stmt := range stmtList { +- checker.text = stmt.Text() +- checker.line = stmt.OriginTextPosition() +- (stmt).Accept(checker) +- } +- +- if len(checker.adviceList) == 0 { +- checker.adviceList = append(checker.adviceList, advisor.Advice{ +- Status: advisor.Success, +- Code: advisor.Ok, +- Title: ""OK"", +- Content: """", +- }) +- } +- return checker.adviceList, nil +-} +- +-type tableNotExistsChecker struct { +- adviceList []advisor.Advice +- level advisor.Status +- title string +- text string +- line int +- catalog *catalog.Finder +-} +- +-// Enter implements the ast.Visitor interface. +-func (checker *tableNotExistsChecker) Enter(in ast.Node) (ast.Node, bool) { +- if node, ok := in.(*ast.CreateTableStmt); ok { +- if !node.IfNotExists && checker.tableExists(node.Table.Name.O) { +- checker.adviceList = append(checker.adviceList, advisor.Advice{ +- Status: checker.level, +- Code: advisor.TableExists, +- Title: checker.title, +- Content: fmt.Sprintf(""Table `%s` exists"", node.Table.Name.O), +- Line: node.OriginTextPosition(), +- }) +- } +- } +- +- return in, false +-} +- +-// Leave implements the ast.Visitor interface. +-func (*tableNotExistsChecker) Leave(in ast.Node) (ast.Node, bool) { +- return in, true +-} +- +-func (checker *tableNotExistsChecker) tableExists(table string) bool { +- return checker.catalog.Origin.FindTable(&catalog.TableFind{TableName: table}) != nil +-} +diff --git a/plugin/advisor/mysql/advisor_table_not_exists_test.go b/plugin/advisor/mysql/advisor_table_not_exists_test.go +deleted file mode 100644 +index 1127777e7ea02a..00000000000000 +--- a/plugin/advisor/mysql/advisor_table_not_exists_test.go ++++ /dev/null +@@ -1,54 +0,0 @@ +-package mysql +- +-// Framework code is generated by the generator. +- +-import ( +- ""testing"" +- +- ""github.com/bytebase/bytebase/plugin/advisor"" +-) +- +-func TestTableNotExists(t *testing.T) { +- tests := []advisor.TestCase{ +- { +- Statement: `CREATE TABLE t(a int)`, +- Want: []advisor.Advice{ +- { +- Status: advisor.Success, +- Code: advisor.Ok, +- Title: ""OK"", +- Content: """", +- }, +- }, +- }, +- { +- Statement: `CREATE TABLE tech_book(a int)`, +- Want: []advisor.Advice{ +- { +- Status: advisor.Warn, +- Code: advisor.TableExists, +- Title: ""table.not-exists"", +- Content: ""Table `tech_book` exists"", +- Line: 1, +- }, +- }, +- }, +- { +- Statement: `CREATE TABLE IF NOT EXISTS tech_book(a int)`, +- Want: []advisor.Advice{ +- { +- Status: advisor.Success, +- Code: advisor.Ok, +- Title: ""OK"", +- Content: """", +- }, +- }, +- }, +- } +- +- advisor.RunSQLReviewRuleTests(t, tests, &TableNotExistsAdvisor{}, &advisor.SQLReviewRule{ +- Type: advisor.SchemaRuleTableNotExists, +- Level: advisor.SchemaRuleLevelWarning, +- Payload: """", +- }, advisor.MockMySQLDatabase) +-} +diff --git a/plugin/advisor/mysql/advisor_table_require_pk_test.go b/plugin/advisor/mysql/advisor_table_require_pk_test.go +index aafa355cdbdaca..af135c874ac281 100644 +--- a/plugin/advisor/mysql/advisor_table_require_pk_test.go ++++ b/plugin/advisor/mysql/advisor_table_require_pk_test.go +@@ -118,7 +118,7 @@ func TestRequirePK(t *testing.T) { + }, + { + // Use MockCatalogService +- Statement: `ALTER TABLE t CHANGE COLUMN id uid INT`, ++ Statement: `ALTER TABLE tech_book CHANGE COLUMN id uid INT`, + Want: []advisor.Advice{ + { + Status: advisor.Success, +@@ -142,7 +142,7 @@ func TestRequirePK(t *testing.T) { + }, + { + // Use MockCatalogService +- Statement: `ALTER TABLE t MODIFY COLUMN id INT PRIMARY KEY`, ++ Statement: `ALTER TABLE tech_book MODIFY COLUMN id INT`, + Want: []advisor.Advice{ + { + Status: advisor.Success, +@@ -179,7 +179,7 @@ func TestRequirePK(t *testing.T) { + }, + { + // Use MockCatalogService +- Statement: `ALTER TABLE tech_book DROP COLUMN id, DROP COLUMN name`, ++ Statement: `ALTER TABLE tech_book ADD COLUMN a int, DROP COLUMN id, DROP COLUMN name`, + Want: []advisor.Advice{ + { + Status: advisor.Error, +@@ -192,7 +192,7 @@ func TestRequirePK(t *testing.T) { + }, + { + // Use MockCatalogService +- Statement: `ALTER TABLE tech_book DROP COLUMN uid, DROP COLUMN name`, ++ Statement: `ALTER TABLE tech_book DROP COLUMN name`, + Want: []advisor.Advice{ + { + Status: advisor.Success, +@@ -205,7 +205,7 @@ func TestRequirePK(t *testing.T) { + { + // Use MockCatalogService + Statement: `ALTER TABLE tech_book CHANGE COLUMN id uid int; +- ALTER TABLE tech_book DROP COLUMN uid, DROP COLUMN name`, ++ ALTER TABLE tech_book ADD COLUMN a int, DROP COLUMN uid, DROP COLUMN name`, + Want: []advisor.Advice{ + { + Status: advisor.Error, +diff --git a/plugin/advisor/mysql/advisor_use_innodb_test.go b/plugin/advisor/mysql/advisor_use_innodb_test.go +index 4f8007204759fc..370844b1175184 100644 +--- a/plugin/advisor/mysql/advisor_use_innodb_test.go ++++ b/plugin/advisor/mysql/advisor_use_innodb_test.go +@@ -43,7 +43,7 @@ func TestUseInnoDB(t *testing.T) { + }, + }, + { +- Statement: ""ALTER TABLE book ENGINE = INNODB"", ++ Statement: ""ALTER TABLE tech_book ENGINE = INNODB"", + Want: []advisor.Advice{ + { + Status: advisor.Success, +@@ -54,13 +54,13 @@ func TestUseInnoDB(t *testing.T) { + }, + }, + { +- Statement: ""ALTER TABLE book ENGINE = CSV"", ++ Statement: ""ALTER TABLE tech_book ENGINE = CSV"", + Want: []advisor.Advice{ + { + Status: advisor.Error, + Code: advisor.NotInnoDBEngine, + Title: ""engine.mysql.use-innodb"", +- Content: ""\""ALTER TABLE book ENGINE = CSV\"" doesn't use InnoDB engine"", ++ Content: ""\""ALTER TABLE tech_book ENGINE = CSV\"" doesn't use InnoDB engine"", + Line: 1, + }, + }, +diff --git a/plugin/advisor/sql_review.go b/plugin/advisor/sql_review.go +index 75398e5ad7f37c..21d9eee4a8219f 100644 +--- a/plugin/advisor/sql_review.go ++++ b/plugin/advisor/sql_review.go +@@ -64,8 +64,6 @@ const ( + SchemaRuleTableNoFK SQLReviewRuleType = ""table.no-foreign-key"" + // SchemaRuleTableDropNamingConvention require only the table following the naming convention can be deleted. + SchemaRuleTableDropNamingConvention SQLReviewRuleType = ""table.drop-naming-convention"" +- // SchemaRuleTableExists require the table existence. +- SchemaRuleTableExists SQLReviewRuleType = ""table.exists"" + // SchemaRuleTableCommentConvention enforce the table comment convention. + SchemaRuleTableCommentConvention SQLReviewRuleType = ""table.comment"" + // SchemaRuleTableNotExists check the table name conflict. +@@ -81,8 +79,6 @@ const ( + SchemaRuleColumnSetDefaultForNotNull SQLReviewRuleType = ""column.set-default-for-not-null"" + // SchemaRuleColumnDisallowChange disallow CHANGE COLUMN statement. + SchemaRuleColumnDisallowChange SQLReviewRuleType = ""column.disallow-change"" +- // SchemaRuleColumnExists require the column existence. +- SchemaRuleColumnExists SQLReviewRuleType = ""column.exists"" + // SchemaRuleColumnDisallowChangingOrder disallow changing column order. + SchemaRuleColumnDisallowChangingOrder SQLReviewRuleType = ""column.disallow-changing-order"" + // SchemaRuleColumnCommentConvention enforce the column comment convention. +@@ -106,8 +102,6 @@ const ( + SchemaRuleIndexPKType SQLReviewRuleType = ""index.pk-type"" + // SchemaRuleIndexTypeNoBlob enforce the type restriction of columns in index. + SchemaRuleIndexTypeNoBlob SQLReviewRuleType = ""index.type-no-blob"" +- // SchemaRuleIndexNotExists check the index name conflict. +- SchemaRuleIndexNotExists SQLReviewRuleType = ""index.not-exists"" + + // SchemaRuleCharsetAllowlist enforce the charset allowlist. + SchemaRuleCharsetAllowlist SQLReviewRuleType = ""charset.allowlist"" +@@ -675,11 +669,6 @@ func getAdvisorTypeByRule(ruleType SQLReviewRuleType, engine db.Type) (Type, err + case db.MySQL, db.TiDB: + return MySQLColumnDisallowChanging, nil + } +- case SchemaRuleColumnExists: +- switch engine { +- case db.MySQL, db.TiDB: +- return MySQLColumnExists, nil +- } + case SchemaRuleColumnDisallowChangingOrder: + switch engine { + case db.MySQL, db.TiDB: +@@ -719,11 +708,6 @@ func getAdvisorTypeByRule(ruleType SQLReviewRuleType, engine db.Type) (Type, err + case db.MySQL, db.TiDB: + return MySQLTableDropNamingConvention, nil + } +- case SchemaRuleTableExists: +- switch engine { +- case db.MySQL, db.TiDB: +- return MySQLTableExists, nil +- } + case SchemaRuleTableCommentConvention: + switch engine { + case db.MySQL, db.TiDB: +@@ -773,11 +757,6 @@ func getAdvisorTypeByRule(ruleType SQLReviewRuleType, engine db.Type) (Type, err + case db.MySQL, db.TiDB: + return MySQLIndexTypeNoBlob, nil + } +- case SchemaRuleIndexNotExists: +- switch engine { +- case db.MySQL, db.TiDB: +- return MySQLIndexNotExists, nil +- } + } + return Fake, errors.Errorf(""unknown SQL review rule type %v for %v"", ruleType, engine) + } +diff --git a/plugin/advisor/utils_for_tests.go b/plugin/advisor/utils_for_tests.go +index 3929a5ca65f5a2..91a5a8f339e419 100644 +--- a/plugin/advisor/utils_for_tests.go ++++ b/plugin/advisor/utils_for_tests.go +@@ -125,9 +125,14 @@ func RunSQLReviewRuleTests( + Charset: """", + Collation: """", + Rule: rule, +- Catalog: catalog.NewFinder(database, &catalog.FinderContext{CheckIntegrity: true}), + } + for _, tc := range tests { ++ finder := catalog.NewFinder(database, &catalog.FinderContext{CheckIntegrity: true}) ++ if database.DbType == db.MySQL || database.DbType == db.TiDB { ++ err := finder.WalkThrough(tc.Statement) ++ require.NoError(t, err, tc.Statement) ++ } ++ ctx.Catalog = finder + adviceList, err := adv.Check(ctx, tc.Statement) + require.NoError(t, err) + assert.Equal(t, tc.Want, adviceList, tc.Statement) +diff --git a/tests/sql_review_test.go b/tests/sql_review_test.go +index e2f27cef275602..df02707ae6a2f8 100644 +--- a/tests/sql_review_test.go ++++ b/tests/sql_review_test.go +@@ -517,26 +517,26 @@ func TestSQLReviewForMySQL(t *testing.T) { + }, + }, + { +- statement: ""DELETE FROM t"", ++ statement: ""DELETE FROM tech_book"", + result: []api.TaskCheckResult{ + { + Status: api.TaskCheckStatusError, + Namespace: api.AdvisorNamespace, + Code: advisor.StatementNoWhere.Int(), + Title: ""statement.where.require"", +- Content: ""\""DELETE FROM t\"" requires WHERE clause"", ++ Content: ""\""DELETE FROM tech_book\"" requires WHERE clause"", + }, + }, + }, + { +- statement: ""DELETE FROM t WHERE a like `%abc`"", ++ statement: ""DELETE FROM tech_book WHERE name like `%abc`"", + result: []api.TaskCheckResult{ + { + Status: api.TaskCheckStatusError, + Namespace: api.AdvisorNamespace, + Code: advisor.StatementLeadingWildcardLike.Int(), + Title: ""statement.where.no-leading-wildcard-like"", +- Content: ""\""DELETE FROM t WHERE a like `%abc`\"" uses leading wildcard LIKE"", ++ Content: ""\""DELETE FROM tech_book WHERE name like `%abc`\"" uses leading wildcard LIKE"", + }, + }, + }, +@@ -598,7 +598,7 @@ func TestSQLReviewForMySQL(t *testing.T) { + }, + }, + { +- statement: ""DELETE FROM t WHERE a = (SELECT max(id) FROM user WHERE name = 'bytebase')"", ++ statement: ""DELETE FROM tech_book WHERE a = (SELECT max(id) FROM tech_book WHERE name = 'bytebase')"", + result: []api.TaskCheckResult{ + { + Status: api.TaskCheckStatusSuccess,"