Decouple some model implementations from the app targets - Round 2 - #24349
Merged
Conversation
I don't remember why in the context of the #24165 work this gave problem, other than it wouldn't compile. Given the types being compared as `String`, using Swift's `==` seems like a better solution anyway.
This unblocks finding the `xcdatamodeld` once both `ContextManager` and the Core Data schema are part of the same framework.
This way, once it's in the WordPressData framework, it'll be accessible by consumers.
The `Notification` model is littered with functionality that has to do with the view layer. To move `Notification` to WordPressData in a timely fashion, we need to separate the model description from all that other logic.
That's where they're used, and they're not needed in WordPressData.
It will go into WordPressData next
Again, this simplifies moving to WordPressData without having to carry along additional dependencies
mokagio
requested review from
crazytonyli and
kean
and removed request for
crazytonyli
March 28, 2025 00:36
Collaborator
Generated by 🚫 Danger |
Contributor
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 26816 | |
| Version | PR #24349 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | 98d8a87 | |
| Installation URL | 02gco75j843d8 |
Contributor
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 26816 | |
| Version | PR #24349 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | 98d8a87 | |
| Installation URL | 2fd3kntqpatao |
mokagio
enabled auto-merge
March 28, 2025 02:40
kean
approved these changes
Mar 28, 2025
kean
left a comment
Contributor
There was a problem hiding this comment.
Approved, left a couple of nits.
| /// Header Blocks Transient Storage. | ||
| /// | ||
| fileprivate var cachedHeaderContentGroup: FormattableContentGroup? | ||
| public var cachedHeaderContentGroup: FormattableContentGroup? |
Contributor
There was a problem hiding this comment.
(nit) Let's extract NotificationsFormattableContentCache (or similar name) and document that it's for internal purposes. I'd suggest doing in a separate PR (or never).
| private extension ContextManager { | ||
| static func createPersistentContainer(storeURL: URL, modelName: String) -> NSPersistentContainer { | ||
| guard var modelFileURL = Bundle.main.url(forResource: "WordPress", withExtension: "momd") else { | ||
| guard var modelFileURL = Bundle(for: ContextManager.self).url(forResource: "WordPress", withExtension: "momd") else { |
Contributor
There was a problem hiding this comment.
Just noting this change. I tested it and it works as Bundle(for: ContextManager.self) returns Bundle.main. I'm not sure if this change belongs in this PR, but I don't have strong feelings about. If it gets merged as part of it, it's totally fine.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


Same rationale as #24331. Part of #24165. The end goal is to have the diff in #24242 to be as little as possible, so that we can easily identify issues.
I added rationales in the commit messages, and commit by commit is likely the best way to review the changes.