-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Enable Blob module in UWP #10187
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
Merged
Merged
Enable Blob module in UWP #10187
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
8116b29
Update packages.lock.json
JunielKatarn 61733dc
Merge branch 'main' of github.com:microsoft/react-native-windows into…
JunielKatarn a5e0d10
Update packages.lock.json
JunielKatarn d3bc919
Add Shared project to ReactUWPTestApp solution
JunielKatarn ad9bde5
RNTesterApp.csproj formatting
JunielKatarn 1c3e84f
Enable Blob module in UWP
JunielKatarn 61fcebc
Merge branch 'main' of github.com:microsoft/react-native-windows into…
JunielKatarn b587e11
Change files
JunielKatarn e3351ad
Update packages.lock.json
JunielKatarn 04a9135
Use context property bag for runtime options in MSRN
JunielKatarn c49f031
Remove unused options header
JunielKatarn 8b68704
Merge branch 'main' of github.com:microsoft/react-native-windows into…
JunielKatarn 6b12d9d
Revert ReactUWPTestApp.sln
JunielKatarn f82a8be
Merge branch 'main' of github.com:microsoft/react-native-windows into…
JunielKatarn db94f6c
Update packages.lock.json
JunielKatarn 25545f9
Update packages.lock.json
JunielKatarn e82283f
Use namespace in monolith HTTP module property
JunielKatarn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/react-native-windows-9a3751a7-f0ff-4185-92d1-608aa823c32a.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "prerelease", | ||
| "comment": "Enable Blob module in UWP", | ||
| "packageName": "react-native-windows", | ||
| "email": "julio.rocha@microsoft.com", | ||
| "dependentChangeType": "patch" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -19,8 +19,12 @@ | |||
|
|
||||
| namespace Microsoft::ReactNative { | ||||
|
|
||||
| using winrt::Microsoft::ReactNative::ReactPropertyBag; | ||||
|
|
||||
| namespace { | ||||
|
|
||||
| using winrt::Microsoft::ReactNative::ReactPropertyId; | ||||
|
|
||||
| bool HasPackageIdentity() noexcept { | ||||
| static const bool hasPackageIdentity = []() noexcept { | ||||
| auto packageStatics = winrt::get_activation_factory<winrt::Windows::ApplicationModel::IPackageStatics>( | ||||
|
|
@@ -35,6 +39,13 @@ bool HasPackageIdentity() noexcept { | |||
| return hasPackageIdentity; | ||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just noticing now that this functionality is duplicated in 3 other places:
Consider consolidating into a shared location |
||||
| } | ||||
|
|
||||
| ReactPropertyId<bool> HttpUseMonolithicModuleProperty() noexcept { | ||||
JunielKatarn marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
| static ReactPropertyId<bool> propId{ | ||||
| L"ReactNative.Http" | ||||
| L"UseMonolithicModule"}; | ||||
| return propId; | ||||
| } | ||||
|
|
||||
| } // namespace | ||||
|
|
||||
| std::vector<facebook::react::NativeModuleDescription> GetCoreModules( | ||||
|
|
@@ -50,11 +61,25 @@ std::vector<facebook::react::NativeModuleDescription> GetCoreModules( | |||
| [props = context->Properties()]() { return Microsoft::React::CreateHttpModule(props); }, | ||||
| jsMessageQueue); | ||||
|
|
||||
| if (!ReactPropertyBag(context->Properties()).Get(HttpUseMonolithicModuleProperty())) { | ||||
| modules.emplace_back( | ||||
| Microsoft::React::GetBlobModuleName(), | ||||
| [props = context->Properties()]() { return Microsoft::React::CreateBlobModule(props); }, | ||||
| batchingUIMessageQueue); | ||||
|
|
||||
| modules.emplace_back( | ||||
| Microsoft::React::GetFileReaderModuleName(), | ||||
| [props = context->Properties()]() { return Microsoft::React::CreateFileReaderModule(props); }, | ||||
| batchingUIMessageQueue); | ||||
| } | ||||
|
|
||||
| modules.emplace_back( | ||||
| "Timing", | ||||
| [batchingUIMessageQueue]() { return facebook::react::CreateTimingModule(batchingUIMessageQueue); }, | ||||
| batchingUIMessageQueue); | ||||
|
|
||||
| // Note: `context` is moved to remove the reference from the current scope. | ||||
| // This should either be the last usage of `context`, or the std::move call should happen later in this method. | ||||
| modules.emplace_back( | ||||
| NativeAnimatedModule::name, | ||||
| [context = std::move(context)]() mutable { return std::make_unique<NativeAnimatedModule>(std::move(context)); }, | ||||
|
|
||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.