-
-
Notifications
You must be signed in to change notification settings - Fork 454
Adding XAML Support and Upgrading to TurboModule for Windows #1025
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Adding XAML Support and Upgrading to TurboModule for Windows #1025
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 |
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)