Adding XAML Support and Upgrading to TurboModule for Windows#1025
Adding XAML Support and Upgrading to TurboModule for Windows#1025protikbiswas100 wants to merge 39 commits intoreact-native-datetimepicker:masterfrom
Conversation
- Implement DatePicker TurboModule with promise-based API - Implement TimePicker TurboModule with promise-based API - Add JavaScript wrapper (DateTimePickerWindows) for imperative API - Add TurboModule specs matching Android pattern - Register TurboModules via AddAttributedModules() - Update documentation with TurboModule usage examples - Export DateTimePickerWindows from main index.js This provides feature parity with Android's imperative DateTimePickerAndroid.open() API.
- Fix circular import in DateTimePickerWindows.js (was importing from itself instead of .windows file) - Change TurboModuleRegistry.getEnforcing() to get() for Windows specs to handle test environments - Update Jest snapshot to include DateTimePickerWindows export All tests now passing (22/22)
- Created TimePickerFabric.cpp/h implementing ContentIslandComponentView - Registered RNTimePickerWindows as Fabric component - Fixed DateTimePickerWindows.open() to return promise result - Updated ReactPackageProvider to register TimePicker Fabric component - Added TimePickerFabric files to vcxproj build configuration This enables XAML TimePicker control to work with React Native's new architecture (Fabric) on Windows platform.
|
@protikbiswas100 In the video attached there is no date time picker ui please check and add |
added a demo video |
- Add main.cpp with wWinMain entry point for native Win32 window creation - Remove XAML/IDL dependencies (App.xaml, MainPage.xaml, App.idl, MainPage.idl) - Update DateTimePickerDemo.vcxproj to use standard Application configuration (not UWP) - Remove AppContainerApplication and ApplicationType properties - Simplify project structure: removed UWP manifest and asset references - Update entry point from App::OnLaunched to wWinMain(HINSTANCE, HINSTANCE, PWSTR, int) - Implement WindowProc message handler for WM_DESTROY and WM_SIZE events - Initialize React Native host directly in C++ code - Use direct Windows API calls (RegisterClass, CreateWindowEx, ShowWindow) - Maintain full compatibility with DateTimePicker component and React Native Windows - Update example/index.js entry point to DateTimePickerDemo component This provides a cleaner, simpler Win32 application structure without UWP overhead, while maintaining full React Native and DateTimePicker functionality.
|
@protikbiswas100 why does the video text says "web preview" ? Can you please record with entire windows app window so that the close button is visible and update the js ui with correct text details. |
I copied and pasted the app.tsx code from some place else, I will do it afresh and reupload the video |
…ependencies - Replaced App/MainPage UWP classes with clean Win32 entry point - Changed from UWP to Win32 application type in vcxproj - Updated to use ReactNativeAppBuilder instead of XAML framework - Converted to use Composition-based CppApp props (not UWP) - Added proper Win32 headers and resource files - Removed XAML, IDL, and manifest files - Clean C++ only codebase
- Added DateTimePickerDemo.rc with version info and icon resources - Added small.ico application icon (16x16 minimal icon) - Updated resource.h with proper Win32 resource definitions - Updated vcxproj to include ResourceCompile and icon - Updated vcxproj.filters to organize resource files This completes the UWP to Win32 conversion by adding standard Win32 resource files that were removed during the migration.
|
/azp run PR |
protikbiswas100
left a comment
There was a problem hiding this comment.
addressed all review comments in next commit
Added review commit2 Co-authored-by: Sundaram Ramaswamy <suramaswamy@microsoft.com>
added review comments2 Co-authored-by: Sundaram Ramaswamy <suramaswamy@microsoft.com>
- Updated solution file name from date-time-picker-example.sln to DateTimePickerDemo.sln - Fixed Windows dependency project path to be relative to sourceDir - Added proper project configuration for example app with android, ios, and windows platforms - Paths are now correctly relative to package root for proper resolution - Auto-linking now works successfully
…s 0.79 - Update DateTimePickerWindows native module for Fabric architecture - Add FabricModule.cpp with DLL exports for non-packaged apps - Add WinRTStubs.cpp for WinRT activation in non-packaged Win32 apps - Add Windows App SDK bootstrap initialization for unpackaged apps - Update vcxproj files with conditional Fabric/XAML compilation - Add Directory.Build.props for proper build configuration - Add index.windows.js for Windows-specific app entry point - Update AutolinkedNativeModules for Fabric package provider - Add postinstall script to patch RNW codegen version mismatch Build requirements: - Visual Studio 2022 with C++ and UWP workloads - Windows SDK 10.0.22621.0 or later - React Native Windows 0.79.5 - Windows App SDK 1.7+
|
@luancurti please review this PR |
Summary
Test Plan
Created a sample DateTimePicker app to demonstrate usage, ran the app using
yarn react-native run-windows --arch x64date_time_picker_demo.mp4
What's required for testing (prerequisites)? NA
What are the steps to reproduce (after prerequisites)? NA
Compatibility
Checklist
README.mdexample/App.js)