Skip to content
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

[XF] Container abstractions - PrismApplication restructure (Breaking) #1288

Merged
merged 28 commits into from
Nov 28, 2017

Conversation

brianlagunas
Copy link
Member

@brianlagunas brianlagunas commented Nov 28, 2017

We have taken a lot of time to completely overhaul how Prism is architected. This will be a major break and there are lots of API changes. Luckily, upgrading is not very difficult.

PrismApplication API Changes - BREAKING

Added new Prism.Ioc namespace to handle DI container abstractions. Interacting with the container is now done via the IContainerProvider and the IContainerRegistry interfaces. The IContainerProvider interface is used to resolve services from the container. The IContainerRegistry is used to register types with the container. Access to the actual DI container can be achieved by using the GetContainer() extension method off of the IContainerRegistry and IContaierProvider interfaces.

Notable changes:

  • Removed ModuleCatalog property
  • Changed signature of ConfigureModuleCatalog() to ConfigureModuleCatalog(IModuleCatalog moduleCatalog)
  • Changed signature of RegisterTypes() to RegisterTypes(IContainerRegistry containterRegistry)
  • Removed CreateContainer() method
  • Removed CreateNavigationService() method
  • Removed CreateLogger() method
  • Removed CreateModuleManager() method
  • Removed CreateModuleCatalog() method
  • Changed order of application initialization process (platform specific types are registered before application types)
  • Container property is now of type IContainerProvider
  • Renamed ConfigureContainer to RegisterRequiredTypes(IContainerRegistry containterRegistry)
  • Renamed RegisterTypeForNavigation to RegisterForNavigation

IModule API Changes - BREAKING

  • Removed Initialize() method
  • Added RegisterTypes(IContainerRegistry containerRegistry) method - used to register types with the container
  • Added OnInitialized() method - used to perform any action after the module has been created, and types have been registered with the container.

ModuleInfo API Changes - BREAKING

  • Removed defaut ctor
  • Changed order of ctor parameters from ModuleInfo(Name, ModuleType, Mode) to ModuleInfo(ModuleType, Name, Mode)

@brianlagunas brianlagunas added this to the Prism 7.0 milestone Nov 28, 2017
@brianlagunas brianlagunas changed the title Container abstractions [XF] Container abstractions - PrismApplication restructure (Breaking) Nov 28, 2017
@dansiegel dansiegel merged commit 57cb55c into master Nov 28, 2017
@brianlagunas brianlagunas deleted the Container-Abstractions branch November 29, 2017 15:36
@JoshuaNovak919
Copy link

Are the docs/samples not updated with this? Everywhere i've looked still seems to use the old way and i'm having trouble setting this up.

@brianlagunas
Copy link
Member Author

no they are not updated.

@JoshuaNovak919
Copy link

Are there any docs on setup for the iOS and Android versions? I'm getting issues with the iOSInitializer etc.

@brianlagunas
Copy link
Member Author

There ae no updated docs at t he movement. You can use the Prism Template Pack for VS to create a new project and see how to update it. Or, if in VS, you can use the VS suggestion lightbulb to walk you through how to fix it.

@JoshuaNovak919
Copy link

I'm on mac. I'll try that. It may help to update the docs or samples before nugets go live in the future when they have breaking changes though. Kind of sucks when I just update the nugets and the whole app breaks without anything to help me fix it.

@JoshuaNovak919
Copy link

Also, it seems the links for the Visual Studio for Mac Addin are broken so I can't get the Prism Template Pack.

@brianlagunas
Copy link
Member Author

In a perfect world where I didn't have a full time job and other responsibilities I would have totally have everything ready at the same time. Unfortunately, I don't have that ability, so it is what it is.

You should follow @PrismLib and it's maintainers on twitter for important messages about these types of things like this blog post:

http://brianlagunas.com/whats-new-in-prism-for-xamarin-forms-7-0/

Or you can check out the release notes for the release here:

https://github.com/PrismLibrary/Prism/releases/tag/7.0.0-Forms

We provided as much information as we could with the time we had.

The community also is helping with posts like this:

https://xamgirl.com/updating-prism-7-0-xamarin-forms/

Never just upgrade a Nuget package. Always read the release notes first. This is a bad habit that NuGet has trained people to do.

@brianlagunas
Copy link
Member Author

Mac is a pain in the ass, and not something I spend a lot of time on supporting.

@JoshuaNovak919
Copy link

Yeah I get you're busy and I really appreciate everything. Prism is amazing. I usually do check changes, but I didn't realize there were just hardly and docs and no samples on how to update. I guess i'll just try and find something in the links you sent or just roll it back until someone puts some docs or samples somewhere.

@dansiegel
Copy link
Member

Suffice it to say, the official Prism template addin update and QuickStart templates will be available in VSMac at the same time and for the same blocking reason.

@lock
Copy link

lock bot commented Jan 28, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants