40 KiB
TODO - Archive
Version History
Version: 1.15.0
TBA
Version: 1.14.0
TBA
Version: 1.13.0
TBA
Version: 1.12.2
- (Commit:
19b12d8) Implement:RNIContextMenuView.cleanupMode. - (Commit:
8be50ac) Implement:RNIContextMenuButton.cleanupMode.
Version: 1.12.1
- (Commit:
77d532a) Bug:ContextMenuView.onPressMenuItemtimeout. - (Commit:
c7b24fa) Bug: Aux. Preview - Layout Jank on Exit Transition- When the exit transition begins, the aux. preview jumps. This is especially noticeable when there's a custom preview.
- During the exit transition, the aux. preview jumps to the target view because it's attached to the platter view. The platter view's contents changes from the custom preview, back to the target view.
Version: 1.12.0
- (Commit:
b0a9cfb) Implement:UIMenu.ElementSize- (Commit:
a657334,7920970,67d5145) Example: Create example formenuPreferredElementSize. - (Commit:
4454f49) Docs: Add documentation stubs formenuPreferredElementSizeandMenuElementSize. - (Commit:
1ed3f1c) Docs: Add examples formenuPreferredElementSizeto example section.
- (Commit:
- (Commit:
b1c048e) Implement:UIMenuElement.Attributes.keepsMenuPresented.- (Commit:
77ecb00) Example: Create example formenuAttributes: ['keepsMenuPresented']. - (Commit:
1ed3f1c) Docs: Add documentation stubs forkeepsMenuPresented. - (Commit:
de92b52) Docs: Add examples forkeepsMenuPresentedto example section.
- (Commit:
-
(Commit:
34b64e6) Make iOS 16 implemented features backwards compatible to prev. Xcode version. -
(Commit:
82c3743) Example: Menu Icons - Advanced SF Symbols customizations- (Commit:
Uncategorized/WIP) Docs: Add example for "advanced SF Symbols customizations" to example section.
- (Commit:
- (Commit:
ed32e8d) Implement:menuSubtitle- (Commit:
171a49a) Docs: Add documentation stubs formenuSubtitle.
- (Commit:
- (Commit:
5e834e1) Implement: MakemenuTitleoptional inRNIMenuItem.- Reverted in Commit:
030a716. - Note: The type property must be required to make
menuTitleoptional.
- Reverted in Commit:
-
(Commit:
7c3fa85) Use subtitle fordiscoverabilityTitleon iOS 13 if there's nodiscoverabilityTitle. -
Task: Test all context menu items.
- Push screen, test items, pop screen, test items, and so on...
- Simulator A: iPhone 8 - iOS 15.2
- Simulator B: iPhone 8 - iOS 16.0
- Device: iPhone XR - iOS 15.1
- Task: Simulator A - Debug — Test all context menu view example items.
- Task: Simulator A - Debug — Test all context menu view test items.
- Task: Simulator A - Debug — Test all context button items.
- Crash due to Commit:
8562755. Revert in Commit:983ec75.
- Crash due to Commit:
- Task: Simulator A - Release — Test all context menu view example items.
- Task: Simulator A - Release — Test all context menu view test items.
- Task: Simulator A - Release — Test all context button items.
- Task: Simulator B - Release — Test all context menu view example items.
- Task: Simulator B - Release — Test all context menu view test items.
- Task: Simulator B - Release — Test all context button items.
-
Task: Device - Release — Test all context menu view example items.
-
Task: Device - Release — Test all context menu view test items.
-
Task: Device - Release — Test all context button items.
- Push screen, test items, pop screen, test items, and so on...
Version: 1.11.0
-
Refactor:
RNIContextMenuandRNIContextMenuViewController-
(Commit:
821657d) Remove:RNIContextMenu.attachToParentVCandRNIContextMenu.detachFromParentVC- Move these to
RNIContextMenuViewandRNIContextMenuButton.
- Move these to
-
(Commit:
82bcde4) Refactor: RenameRNIContextMenuViewControllertoRNINavigationEventsReportingViewController. -
(Commit:
a6210ea) Refactor: RenameRNIContextMenutoRNINavigationEventsChildViewController-
Any classes that conform to this protocol means that it can be notified of navigation events (e.g. push, pop, etc).
-
-
(Commit:
821657d) Refactor:RNINavigationEventsNotifiable— Separations of concerns - Remove unrelated methods (e.g.attachToParentVC,detachFromParentVC).
-
-
(Commit:
42653ae) Refactor: UseRNICleanableProtocol -
Refactor: Re-write
RNIWrapperView-
(Commit:
5bcac3a) Refactor: Extract Delegate to Own File -
(Commit:
97f73d1) Refactor: RenameRNIWrapperViewDelegatetoRNIWrapperViewEventsNotifiable. -
Refactor:
RNIWrapperView- Initial Rewrite- (Commit:
0dcff7a) Refactor: Addshouldprefix to bool configs. - (Commit:
21cc17b) Gloss: Yakshaving - Re-arrange and group related properties into section . - (Commit:
46f6509) Cleanup: RewritedidMoveToWindow. - (Commit:
ff165b8) Refactor: ReplacewillChangeSuperviewanddidChangeSuperviewtoisMovingToParent. - (Commit:
68b068a): Update: Fix potential order of operations bug — Switch call order inRNIWrapperView.onJSComponentWillUnmount, i.e. trigger cleanup at the end. - (Commit:
79a4be8) Update: Change default values — Set all feature flags to false by default.
-
(Commit:
bac3096) Fix: Re-Enable Cleanup - FixcleanupNot Being Invoked. -
(Commit:
13c5236) Refactor:RNIWrapperView- Convert Config Bools to React Props- Convert "config" bool props to react props.
-
(Commit:
e505737) Implement:RNIWrapperView.shouldCreateTouchHandlerForSubviews. -
(Commit:
d058bf4) Implement:RNIWrapperView.shouldCreateTouchHandlerForParentView. -
(Commit:
3e2857b) ImplementRNIWrapperView.isDummyViewbool config. -
Task: Check if
RNIWrapperViewcleans up — Inspect for memory leaks- Push screen and open all context menu that either has a custom menu preview, or aux. preview, and then inspect memory.
- N0:
RNIWrapperViewcount: 0 - N1:
RNIWrapperViewcount: 19 - N2:
RNIWrapperViewcount: 38 - N3:
RNIWrapperViewcount: 55 - N0:
RNIWrapperViewcount: 0 — Go back to home/root. - Result: After going to the root/home, no
RNIWrapperViewinstance remained in memory.
- N0:
- Push screen and open all context menu that either has a custom menu preview, or aux. preview, and then inspect memory.
- (Commit:
b56d516) Implement:RNIWrapperView.shouldAutoDetachSubviews
- (Commit:
-
(Commit:
b7a2ece) Implement:detachedViewslookup table. -
(Commit:
2b86b47) ImplementRNIWrapperView.shouldDelayAutoCleanupOnJSUnmount.
-
-
(Commit:
5ab2e0f) Fix: Memory Leak - Property Animators Retain Cycle. -
(Commit:
406362d) Fix: Memory Leak -UIActionRetain Cycle. -
(Commit:
8be7831) ImplementContextMenuView.shouldEnableAggressiveCleanupprop. -
Task: Test all context menu items — Check if the
RNIWrapperViewrefactor +shouldEnableAggressiveCleanupis causing any problems.- Push screen, test items, pop screen, test items, and so on...
- Task: Test all context menu view items in debug mode.
- Task: Test all context menu button items in debug mode.
- Task: Test all context menu view items in release mode.
- Task: Test all context menu button items in release mode.
- Task: Inspect for memory leaks.
- Results: 13
RNIWrapperViewinstances retained byRNIContextMenuView, but no memory leaks or retain cycles found.
- Results: 13
-
(Commit:
57f817a) Example: Deferred Menu Items - Add alt. usage (i.e. state controller menu config). -
(Commit:
c015098) Implement: Cleanup orphaned deferred menu items. -
Implement: Deferred Menu Elements - Context Menu Button
- (Commit:
5c02acf) Implement:RNIContextMenuButtonModule - (Commit:
de54124) Refactor:ContextMenuButton- Migrate to Native Modules — Replace view manager commands with native modules. - (Commit:
a7b71a3) Remove:ContextMenuButton- View Manager Commands — RemoveRNIContextMenuButtonCommands. - (Commit:
dda3e14) Implement:RNIContextMenuButton-provideDeferredElements - (Commit:
30a9179) Implement:ContextMenuButton.onRequestDeferredElement - (Commit:
26526d0) Example: Context Menu Button - Add example for deferred Menu elements.
- (Commit:
-
Task: Test all context menu items.
- Push screen, test items, pop screen, test items, and so on...
- Simulator: iPhone 8 - iOS 15.2
- Device: iPhone XR
- Task: Simulator - Debug — Test all context menu view example items.
- Task: Simulator - Debug — Test all context menu view test items.
- Task: Simulator - Debug — Test all context button items.
- Task: Post Test — Inspect memory.
- Result: No memory leaks.
-
Task: Simulator - Release — Test all context menu view example items.
-
Task: Simulator - Release — Test all context menu view test items.
-
Task: Simulator - Release — Test all context button items.
-
Task: Post Test — Inspect memory.
-
Task: Device - Debug — Test all context menu view example items.
-
Task: Device - Debug — Test all context menu view test items.
-
Task: Device - Debug — Test all context button items.
-
Task: Post Test — Inspect memory.
-
Task: Device - Release — Test all context menu view example items.
-
Task: Device - Release — Test all context menu view test items.
-
Task: Device - Release — Test all context button items.
- Push screen, test items, pop screen, test items, and so on...
Version: 1.10.1
- (Commit:
cecf70c) Bugfix: Types -MenuAuxiliaryPreviewTransitionConfig - (Commit:
3451290) Bugfix: Layout Bug - Aux. Preview Margin- Fix aux. preview going out of bounds when near edges.
- (Commit:
ffae806) Bugfix: Aux. Preview Exit Transition- Fix bug where the aux. preview's exit transition is not triggered when tapping the menu preview.
- (Commit:
3451290) Bugfix: Deferred Elements - Memory Leak- Trigger cleanup for deferred elements
Version: 1.9.2
TBA
Version: 1.9.1
TBA
Version: 1.9.0
TBA
Version: 1.8.1
TBA
Version: 1.8.0
- (Commit:
d764364) Bugfix: Aux. Preview-Related (WIP) — Touch Event Conflict- Touch events originating from the context menu still propagates down the responder chain — in other words, the touch event passes through the context menu, so its like your touching the background in addition to the context menu.
- As such, if you try to trigger a button in the aux. preview, it will also close the context menu since touching on the background triggers the dismissal of the context menu.
- This can be confirmed by creating a simple
UIButtonand setting it as the aux. view for the context menu. - The
UIButtoncaptures the touch event and does not propagate it further — as such, pressing theUIButtonwill not close the context menu.
- This can be confirmed by creating a simple
- The
TouchableOpacitybutton in aux. preview still receives the touch event butUIKitis not aware that the touch event has already been handled. - Possible fix could be to add a vanilla view to hold the aux. preview — the vanilla view will stop the touch event from propagating at the expense of bloat and memory.
- Wrapping the aux. preview inside another
UIViewdoes not work. - Wrapping the aux. preview inside another
UIButtondoes not work. - Wrapping the aux. preview inside another
UIControldoes not work.
- Wrapping the aux. preview inside another
- Maybe try making a
UIViewsubclass that stops the propagation of the touch event?- Overriding
next:UIResponderandgestureRecognizerShouldBegininRNIWrapperViewdoes nothing. - Overriding
point(inside point: CGPoint, with event: UIEvent?)inRNIWrapperViewdoes nothing.
- Overriding
- Setting
isExclusiveTouchtofalseon the aux. view wrapper, the aux. view container, and the aux. view itself does nothing. - Setting
pointerEventsprop tobox-noneornoneforRNIWrapperViewdoes nothing.- But setting
pointerEventsprop tononefor the root view component returned from therenderAuxillaryPreviewprop does stop the propagation. - However setting it to
box-nonedoes not stop the propagation and still closes the context menu. - This suggests that the problem lies with react native's touch system (i.e.
RCTTouchHandler) not stopping the touch propagation.
- But setting
- Disabling
touchHandler.attachinRNIWrapperView.insertReactSubviewdoes not stop the propagation of the touch event.RCTTouchHandleris a subclass ofUIGestureRecognizer.- Setting
requiresExclusiveTouchTypetotrue/falsedoes nothing. - Setting
cancelsTouchesInViewtotrue/falsedoes nothing. - Becoming the delegate and handling the touch events (e.g. the
gestureRecognizermethods) does nothing whether you choose to returntrue/false.- Overriding
var next: UIResponder?and returningnildoes nothing.
- Overriding
- A custom
UIViewsubclass that wraps the aux. preview withhitTestoverride returningnilorselfstops the propagation from happening.- However the the context menu items, its preview + background, and the aux. preview no longer responds to the touch events — as such it's impossible to close the menu.
- The simplest solution is to just create a dummy gesture recognizer (i.e. dummy because it does not have a selector) and attach it to the aux. preview — the dummy gesture recognizer will handle any bubbling touch events from the aux. preview and stop it from propagating.
- (Commit:
9f682a1) Implement: Aux. Preview-Related (WIP) — RemovetransitionConfigExitfrom aux. preview config. - (Commit:
303cd6f) Implement: Aux. Preview-Related (WIP) — MakeMenuAuxiliaryPreviewConfig.heightoptional. - (Commit:
1432ce9) Implement: Aux. Preview-Related (WIP) — Infer aux. preview height from root view whenMenuAuxiliaryPreviewConfig.heightisnull. - (Commit:
8b25e6f) Refactor: Aux. Preview-Related (WIP) — Isolate aux. preview constraints logic to closure block. - (Commit:
22109e2) Implement: Aux. Preview-Related (WIP) — Impl. logic for determining the aux. preview width. - (Commit:
a9651e3) Implement: Aux. Preview-Related (WIP) — Adjust aux. preview width, i.e. re-impl. fix for sizing + layout bug. - (Commit:
562672d) Implement: Aux. Preview-Related (WIP) — Update logic for aux. preview horizontal alignment, e.g.previewTrailing,previewCenter, andstretchScreen. - (Commit:
5cb72f5) Implement: Example — Add env. flag for enabling/disablingreact-navigation. - (Commit:
75e722e) Bugfix: Re-Enable cleanup for context menu button.
- (Commit:
75e722e) Bugfix: Re-Enable cleanup for Context Menu Button.
Version: 1.7.6
- (Commit:
0c7a91d) Test: Example — Add test for react navigation tabs - (Commit:
5092dab) Bugfix: Fix + re-enable cleanup logic - (Commit:
110dfe4) Refactor: Fix iOS 16 deprecations
Version: 1.7.5
- (Commit:
cde5061) Bugfix: Context menu auxiliary preview not sizing properly in yoga layout-
Layout-Related Bug: The auxiliary preview is sized properly via autolayout (confirmed via setting the background color of the view), but react-native uses the "old size" of the view, i.e. before it was resized via autolayout (e.g. the children of the view will act as if the view's size hasn't changed yet) — In other words, react-native is not aware of the new size of the view.
-
Attempts to fix:
- A. Updating the size via
uiManager.setSizeworks, but causes a temporary layout bug where the aux. preview gets pinned towards the top left part of the screen.- Likely due to the aux. view using it's parent view as the basis for it's layout — i.e. the parent view (
RNIWrapperView) has a style of absolute positioning so it doesn't interfere with layout. - The layout position bug disappears when the context menu preview's position changes (e.g. via dragging the preview) — this likely due to autolayout triggering a layout update to its subviews when you start moving the preview around.
- Unfortunately, manually triggering
layoutSubviewsmethod on the context menu preview (i.e.morphingPlatterView) does not fix the layout position bug. - Triggering
layoutSubviewson the aux. preview also does not fix the layout position bug. - Toggling
RNIWrapperView.autoSetSizeOnLayoutdoes nothing. - Triggering
UIManger.setNeedsLayoutdoes nothing. - Triggering
uiManager.setSizeat a later time (e.g. after the fade in transition) does nothing.
- Likely due to the aux. view using it's parent view as the basis for it's layout — i.e. the parent view (
- B. Updating the aux. view's size via it's shadow view's width and height does nothing (i.e. changing the yoga value for the its width and height does nothing, even after calling
UIManger.setNeedsLayout).- Removing the shadow view for both the aux. view and it's wrapper does nothing and causes layout problems.
- C. As a last resort, a possible temp. solution is to just manually change the size of the aux. view via the style prop in the JS side. This can be done via an event that gets triggered from the native side, whenever we want to change the size of the view.
- D. It turns out, the reason for the aux. preview layout bug is due to the new size being too big — i.e. the new size for the aux. preview is bigger than it's current size, causing it to "overflow" and glitch.
- A. Updating the size via
-
Version: 1.7.2
- Bugfix: Android error (importing/use of iOS-related native components on non-iOS platforms).
- (Commit:
ba00412) Revert platform-specific extensions forContextMenuView, andContextMenuButton. - (Commit:
5fe92e8) Use platform specific exports for native components (i.e.RNIContextMenuView,RNIContextMenuButton).
- (Commit:
- (Commit:
756514b) Implement: Impl.ContextMenuButton.dismissMenu.
Version: 1.7.1
- Bugfix: Android error (importing/use of iOS-related native components on non-iOS platforms).
- (Commit:
e57aabe) RefactorContextMenuViewto use platform-specific extensions. - (Commit:
0acea05) RefactorContextMenuButtonto use platform-specific extensions.
- (Commit:
Version: 1.7.0
- (Commit:
6b606da) Implement: Impl.ContextMenuView.isContextMenuEnabledprop.
Version: 1.6.2
- (Commit:
ce8dbac) Refactor: Add compiler directives to support building using Xcode 12.
Version: 1.6.1
- (Commit:
ca30678) Clenaup: RemoveRNIMenuIcon.ImageLoader- Fix build error due to
RCTImageCache.
- Fix build error due to
- Fix example not building when using "Release" configuration.
- (Commit:
ca30678) Cleanup: RemoveRNIMenuIcon.ImageLoader. - (Commit:
78a7e51) Refactor: Example - Renameindex.jstoindex.ts - (Commit:
8258328) Implement: Create.nvmrc— Use specific node version. - (Commit:
9f6f895) Implement: Updatebuild-ios.ymlto use.nvmrcfor node version.
- (Commit:
Version: 1.6.0
- (Commit:
2c55fdb) Implement: ImplementContextMenuViewContext - (Commit:
05f6c73) Implement: ImplementuseMenuContexthook. - Refactor: Update example to use typescript.
- Commits:
7ec95a5,51a50f6,2e3c05a,104d36d,b84a0db,73ff6f1,be6d40e,3bc8e2a,491874d,9596954,080d44f,497f032,de1f93c,e745dda,7b0c4f1,e714a1f,6483c79,447dd2b,ecd96fc,78a9c10,96877c2,bb3fff9,aea43db,0c5436a,ee446c3,bdee609,e3846d7,827f0bb.
- Commits:
- (Commit:
7045e61) Bugfix: Fix types — MakemenuConfigprop optional. - (Commit:
2310b7e) Bugfix: Fix types — Fix wrong type forMenuConfig.menuAttributes. - (Commit:
52c0459) Bugfix: Fix library exports — Export types fromMenuEvents. - (Commit:
9f4e332) Refactor: RemoveContextMenuButton.wrapNativeComponentProp. - (Commit:
9caf7d7) Implement: ImplementContextMenuButtonContext. - (Commit:
4d063f9) Implement: ImplementuseMenuButtonContexthook.
Version: 1.5.0
- Bugfix: Fix memory leak
- (Commit:
6ddabae) Partially fix memory leak by performing cleanup during reload + when the view is unmounted. - (Commit:
19533b2) UseRNIWrapperViewfor the menu preview. - (Commit:
c45c576) Fix menu preview memory leak,
- (Commit:
-
(Commit:
4c75563) Bugfix: Fix menu action subtitles no longer working on iOS 15.- Example #13 — Setting
discoverabilityTitleno longer does anything.
- In iOS 13, this used to show a subtitle blurb below the menu item title. In iOS 15, it no longer displays the subtitle.
- In iOS 15, there's a new property added called
UIMenuElement.subtitle.
- Example #13 — Setting
- Refactor: Update to use
RNIImageItemfor the menu icons.- Update logic for handling images.
- Copy over
RNIImageItemimpl. fromreact-native-ios-navigator. - Rename
IconConfigtype toIconConfigDeprecated. - Make the
iconproperty accept bothIconConfigDeprecatedandImageItemConfig. - Then in native, map
IconConfigDeprecatedtoImageItemConfig. - Then use
RNIImageItemto create the icon images for the context menu. - Import
RNIImageItemand updateRCTMenuIconto use it.
- Copy over
- (Commit:
836f0a3) Copy overRNIImageItemimpl. fromreact-native-ios-navigator. - (Commit:
97fa40c) Refactor to useRNIImageItemfor menu item icon. - (Commit:
e02d96e) Copy overImageItemConfigtypes fromreact-native-ios-navigator. - (Commit:
e176438) Update types for menu config to acceptImageItemConfig.
- Update logic for handling images.
Version: 1.4.0
- (Commit:
a0b008c) Migrate project to use the new template generated bycreate-react-native-libraryandreact-native-builder-bob.- Example app no longer builds, but the library still works when installed on a newly created react-native app. The example project may be incompatible with Xcode 13.1.
- After migrating the project to the new template, the example app now builds + run on iOS 15.
- (Commit:
d1c8277) Sync: UpdateUIColor+Helpers.swiftto use the newer code inreact-native-ios-context-menu. - (Commit:
59d4faf) Refactor: MigrateExtension+Init-related types to use failable initializers instead of static functions. - (Commit:
7bb8148) Cleanup: UpdateMARKcomments in native code. - (Commit:
873b61a) Cleanup: Cleanup swift types (e.g.NSString->String). - (Commit:
ebfa1cc) Cleanup: RemoveRCTSwiftLog+ usage. - (Commit:
3702dfc) Refactor: ReplaceRCTprefix withRNI. - (Commit:
2102840) Refactor: ExtractRNIContextMenuViewnative component to its own separate file. - (Commit:
3fb4faa) Refactor: ExtractRNIContextMenuButtonnative component to its own separate file. - (Commit:
023f8e7) Implement: Types — Add type declaration forMenuConfigand related types. - (Commit:
6768b32) Implement: Types — Add type declaration forMenuPreviewConfigand related types. - (Commit:
01089f0) Implement: Types — Add type declaration forIconConfigand related types. - (Commit:
0d71080) Refactor: Extract constants (e.g.isContextMenuButtonSupported,isContextMenuViewSupported) to their own separate file.
- Implement: Types — Add type declaration for
ContextMenuView- (Commit:
8c72054) Implement: Types — MigrateContextMenuViewcomponent to use typescript and partially added type declarations. - (Commit:
348d2f9) Implement: Types — Add type declaration forContextMenuViewevents.
- (Commit:
- (Commit:
e0bc64f) Implement: Types — Add type declaration forContextMenuButton - (Commit:
25bf0b2) Implement: Types — Partially add type declaration forActionSheetFallback - (Commit:
47a97bc) Implement: Types — Add type declaration forHelpers
Archived/Abandoned
- Cleanup: Remove print logs.
- Docs: Update documentation sections
-
Remove numbered subsections.
-
Move links to files out of the section title.
-
Temporarily strip out links to section (i.e. replace with
PLACEHOLDER_LINK). -
Add versions table.
-
Remove collapsable sections.
-
- Implement: Add support for targeted previews on text (i.e. similar to safari).
- Implement: Subscribe to
ContextMenuViewevents via event emitter from context.
-
Task: Read apple documentation to find any new changes added.
-
Refactor: Make classes public and accessible outside the library.
-
Refactor: Extract types/components from
RNIWrapperViewto separate files. -
Docs: Add documentation for "Context Menu Preview Auxiliary View".
-
Refactor: Move event-related types to their respective files where they're first used.
-
Refactor: Update Access Modifiers for Classes/Structs — Make classes/structs public so they can be imported by other code.
-
Docs: Update version history.
-
Refactor: Use
react-native-ios-utilities.
-
Test: Try to re-produce the bug where the context menu no longer works after a certain period of time
-
React Native Version:
0.63.4 -
Hide app, wait 1 minute, reopen app, then test context menu
- Test on production mode + simulator: OK
- Test on production mode + Debug Off + simulator: OK
- Test on Production + No Xcode + Simulator: OK
-
Hide app, open contacts, wait 1 minute, reopen app, then test context menu
- Test on production mode + simulator: OK
- Test on production mode + Debug Off + simulator: OK
- Test on Production + No Xcode + Simulator: OK
- Test on production mode + simulator: OK
-
- Bugfix: Running on device + production crashes immediately when context menu is invoked.
- Might be a problem with Xcode beta — Running on iOS 16 simulator works fine on both production mode and debug mode.
- Xcode beta + running on device (iPhone XR + iOS 15.1) causes crashes when the context menu is being created (i.e.
UIContextMenuConfiguration). - Xcode 13 + running on device (iPhone XR + iOS 15.1) works fine.
- Maybe the constructor for
UIContextMenuConfigurationwas changed?- Still crashes when
nilis provided as an argument to all the parameters in the constructor. - Using the constructor that takes no arguments doesn't trigger a crash.
- Still crashes when
- Implement: Provide a default config for
previewConfigwhen arenderPreviewprop is given a value so that there's a default behavior. - Expose
location(in:) - Implement: Re-write image loading logic for
IMAGE_REQUIRE.- Move image loading in the background.
- Add option for: lazy loading.
- Add option for: synchronous loading.
- Add option for: image caching.
-
Implement: iOS 16
UIMenuLeaf- Maybe:
UIEditMenu
-
Refactor: Fabric re-write
-
Task: Create a test library — Playground for making a C++ turbo native module.
-
Task: Figure out how to install
react-native-codegen.- Note: For some weird reason, spaces and special characters in the working directory results in the CLI not finding the module location.
-
Task: Figure out how to setup "code gen" in the library package, i.e.
codegenConfig. -
Task: Create a turbo native module function.
- Run the codegen script:
node ./example/node_modules/react-native/scripts/generate-artifacts.js --path ./example --outputPath ./example/ios- Error:
[Codegen] >>>>> Searching for codegen-enabled libraries in react-native.config.jsCannot find module 'example/react-native.config.js'— The react-native codegen script cannot locate thereact-native.config.jsfile.- The
example/react-native.config.jsfile exists. Could this be a bug? - The
example/node_modules/react-native/scripts/generate-artifacts.jsexecutesexample/node_modules/react-native/scripts/codegen/generate-artifacts-executor.js - Line 219:
const rnConfigFilePath = path.join(appRootDir, rnConfigFileName);— changepath.jointopath.resolve, i.e.const rnConfigFilePath = path.resolve(appRootDir, rnConfigFileName);. - Script now runs. It now generates a
build/generated/iosdirectory containing the dependencies for fabric + turbomodules, as well as c++ artifact generated from our js spec — i.e.RNIosCxxTestSpec.- The directory contains a header file:
RNIosCxxTestSpec.h, and an impl. file:RNIosCxxTestSpec-generated.mm.
- The directory contains a header file:
- Error:
-
Build Error: No member named
RNIosCxxTestSpecin namespacefacebook::react-
The corresponding module spec in
React-Codegenwas created properly. -
Could possibly be a naming issue?
- The js module file is named:
NativeIosCxxTest— it follows theNative<MODULE_NAME>naming convention. - The module is named:
IosCxxTest
- The js module file is named:
-
Fixed by importing the codegen module header, e.g.:
#import <RNIosCxxTestSpec/RNIosCxxTestSpec.h>. -
RCT_EXPORT_MODULE— ThegetTurboModulefunction expects an instance offacebook::react::TurboModule.- In this function, we must return the corresponding
RCTTurboModuleinstance generated via codegen based on our JS spec. - For this project, it is in
React-Codegen/RNIosCxxTestSpec.
- In this function, we must return the corresponding
-
- Run the codegen script:
-
Task: Call swif
-
Task: Make TNM function iOS-only
- What is the best way to do this? One way is to create a dummy no-op/empty implementation for android.
- What happens when there is a mismatch with the TNM declaration between iOS and Android?
- Will the "codegen" CLI care if the "autolinking" configuration is set to only support iOS? In other words, if we set the library to only "autolink" on the iOS platform, will the project importing the library ignore the "codegen" for android side, and not compile it.
- What is the best way to do this? One way is to create a dummy no-op/empty implementation for android.
-
-
- Cleanup: Breaking Change — Remove legacy support for icon config shorthand/shortcut that was added temporarily when migrating between an older version of this library.
- Refactor:
findNodeHandlehas been deprecated due to fabric support.
- Docs: In the
MenuActionObject section, add example object with comments. - Docs: In the
MenuConfigObject section, add example object with comments. - Docs: Create collapsable "Table of Contents"
- Docs: Add
README.mdin example directory
ContextMenuButton: AddSystemImagecomponent for creating aUIImagethat uses SF Icons (Research first if the built-in image component already supports this).ContextMenuButton: Add example forwrapNativeComponentprop, i.e. example for using a different "button" component.
ContextMenuView: Custom Preview - Add support for setting an image as the custom preview. Use the built-inImagereact native component to handle setting the image source + sizing. Receive the image as a child fromRCTContextMenuViewand cast it toRCTImageif necessary. The image will then be wrapped inside a view controller and is set as theUIMenu's preview target. The view should be resized to fit the screen.
- Test:
ContextMenuViewandContextMenuButtonon different react native versions- Test on 0.60
- Test on 0.61
- Test on 0.62
- Test on 0.63.3
- Test on 0.63.4
- Test:
react-native-context-menuuses autolinking for installation. Check if this library will work on older react-native versions prior to 0.60 i.e testContextMenuViewandContextMenuButtonon react native versions older than 0.60- Test on 0.59
- Test on 0.58
- Submit a PR to the RN repo — Update RN template to fix
Undefined Symbol - Update
PreviewConfig.previewSizeto support passing in a size object, e.g.{width: 100, height: 100} - Docs: Fix grammar/spelling errors
- Docs: Test/Fix jump links
- Attach RN touch handler to context menu
- Impl. support for icon weight
-
Implement:
ActionSheetModuleto display an "Action Sheet" menu viaUIAlertController.-
Reference: Article in the apple developer about "Alerts and Action Sheets"
-
Reference: 
ActionSheetIOS JS code. The native module is calledRCTActionSheetManager(link to JS native module, and link to native code) -
Reference: @react-native-menu/menu library has a very good looking
ActionSheetfallback with icons and disabled menu actions.
-
-
ContextMenu: Add support forUIDefferedElement-
In
MenuConfig.menuItemsproperty or in themenuConfigprop, if an object has a property calleddefferedKey, then it means we want to create aUIDefferedElementelement. -
Impl.
onRequestDefferedElementfunction. This function is called whenever aUIDefferedElementitem needs to be loaded.- This function will receive a
defferedKey. This function must return a promise, i.e. either aMenuConfigorMenuActionobject. - If the returned promise is a
MenuActionobject, it will usedefferedKeyfor theactionKeyproperty. - In this function, based on the
defferedKeyit must return a correspondingMenuConfig/MenuActionobject. Ifnullis returned, then it means it failed. - This function is invoked from the native side. Native UI component
NativeCommandsdon't natively support promises, so a workaround must be used based onrequestcallbacks (like the one i used onreact-native-ios-modal). ButNativeModulefunctions has support for proimises built in.- We can use
findNodeHandle(this.nativeCompRef)to get a node handle. Then we can useself.bridge.uiManager.view(forReactTag: node)to get a ref to the component. Then we cast it to the correct type:component as? RCTContextMenuViewand then call the completion function for the correspondingUIDefferedElement, something like:contextMenuView.resolveDefferedMenuElement(for: defferedKey, item: menuElementDict)
- We can use
- We need to create a class to create a
UIDeferredMenuElement. It will extendRNIMenuElementand can be init from a dictionary. Probably name it something like:RCTMenuDefferedItem. It will have one property:defferedKeyRNIMenuItem.createMenufunction must be updated to also handle creating aRCTMenuDefferedItemitem.
- On the native side when we create a
UIDeferredMenuElementwe do this:UIDeferredMenuElement { completion in self.completionDict[defferedKey] = completion }, and then invoke a RN event:self.onRequestDefferedElement([defferedKey: defferedKey]).onRequestDefferedElementevent prop will be invoked. We wait for the promise to return some value and then call aNativeModulefunction.- The
NativeModulefunction will probably look like this:ContextMenuViewModule.resolveDefferedMenuElement({nodeHandle, defferedKey, menuItem}); - Completion handlers will be stored in a dictionary. I'm not sure if I can use
NSMapTable. I can use a plainNSDictionarybut if I accidentally forget to cleanup (i.e. remove the completion handler from the dict) then that completion handler will be retained, causing a memory leak.- Completion handlers, i.e. closures, are reference types. If I assign it to
NSMapTablewithvalueOptions: .weakMemory, will it be automatically be released when it's no longer used? Will it be retained while it's in use or will it be released the moment i add it toNSMapTablebecause nothing is using it? Technically, it is in use because it's inUIDeferredMenuElementargument (so the ref count should increase?)
- Completion handlers, i.e. closures, are reference types. If I assign it to
- This function will receive a
-
- Refactor: Use structs instead of classes for holding configuration for making the menu items.
- Cannot be completed due to protocol class requirement.
Completed Archive
- Docs: First remove all the links that point to the examples directory or links to different section. Highlight them in yellow then replace the highlighted text in the documentation with the new/updated section/examples links.
- Move
ContextMenuViewexamples + tests inexamples/srctoexamples/src/ContextMenuViewthen update documentation links - In the "Examples" section add section for
ContextMenuViewandContextMenuButton, then update the documentation "jump to" heading links - Update and rename Images/Gifs
- Move gifs for
ContextMenuViewin/assetstoassets/ContextMenuView/ - Rename
ContextMenuViewgifs i.e. prefix them with "ContextMenuView" e.g.SimpleExample-1-2-3-4.gifbecomesContextMenuView-SimpleExample-1-2-3-4.gif, etc. - In the
/assets/example-screenshotsfolder, prefix images with "ContextMenuView", e.g.SimpleExample01.pngbecomesContextMenuView-SimpleExample01.png, etc.
- Move gifs for
- Move
- Docs: Add images to steps: Undefined Symbol
- Docs: Make sections collapsabe
- Docs: Fix table layout
- In the "Documentation" section, add
ContextMenuButtonprops. - Finish
onPressMenuItemnativeEventObject section. - Add section for
useActionSheetFallbackprop.
-
ContextMenuView: ExportActionSheetFallbackfunction and add it to the docs. -
ContextMenuView: RenameRCTContextMenuManagertoRCTContextMenuViewManagerand update corresponding js native component -
ContextMenuView: Impl. iOS 14 specific feature:UpdateVisibleMenu -
ContextMenuView: Impl. iOS 14 specific feature:dismissMenu- Try implementing this via
NativeModule
- Try implementing this via
-
ContextMenuView: Custom Preview - Add support for custom previews, i.e by passing a child component toRCTContextMenuView, and wrapping that child inside a view controller and passing it as the preview target inUIMenuconfig. The first child of theRCTContextMenuViewwill be reserved for the custom menu preview. If no child is passed, i.e no custom preview is configured, then the preview target is not set for theUIMenu. The preview view should only be mounted when the menu is visible, and thus, it should support setting the preferred size of the preview target. Test if the preview target can be changed when it's already visible.
ContextMenuButton: Finish initial impl. with 1 working simple exampleContextMenuButton: Add documentation forContextMenuButton
- General: Implement targeted previews
- General: Implement tinted/colored menu icons + config for line weight etc.
- Refactor: Change "ImageType" to "IconType", and "imageValue" to "imageType"
- General: Move menu icon related properties to "icon":
{ icon: { iconType: '', iconValue: '', tint: ''} } ContextMenu— AdddiscoverabilityTitletoUIAction
- Implement
ImageType.ASSETto support: "create an image from an image asset or image file located in your app’s main bundle"- The
imageValuestring fromMenuAction/MenuConfigwill be used to init aUIImage, like:UIImage(named: imageValue)
- The
-
Implement
ImageType.REQUIREto support using images viarequire(path/to/image)-
One way to implement is to use
Image.resolveAssetSource(source);from the RN docs. So we have something like:{ imageType: 'REQUIRE', imageValue: require('path/to/image.png') }.- Reference: Medium Article. Explains how
Image.resolveAssetSourceworks.
- Reference: Medium Article. Explains how
-
Attempted to impl. this but ran into problems: when in debug mode, assets are provided via a local URL via the metro bundler.
-