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

Deprecate ModuleScope.DefineType #445

Merged
merged 2 commits into from
Apr 4, 2019

Conversation

stakx
Copy link
Member

@stakx stakx commented Apr 2, 2019

This is in response to #399 (comment):

[@stakx:] [...] deprecating ModuleScope.DefineType should be fine.

[@jonorossi:] I'm definitely in favour of it, I don't like that others are emitting into the DP assembly [...].

The single known reason for using ModuleScope.DefineType was to allow mocking libraries to create delegate proxies, the enhancements from #436 now provide a cleaner way to do that, so we can go ahead and deprecate ModuleScope.DefineType.

@stakx
Copy link
Member Author

stakx commented Apr 2, 2019

@jonorossi, this might be a good occasion to try out the public API change approval. Happy to wait for your PR (#440) to go in first, then rebase this one.

CHANGELOG.md Outdated Show resolved Hide resolved
@jonorossi
Copy link
Member

@stakx good idea, I'll get #440 sorted.

@jonorossi
Copy link
Member

I've merged #440, you can rebase this pull request now.

@stakx stakx force-pushed the deprecate-modulescope-definetype branch from 17c9102 to 6a77ae7 Compare April 3, 2019 08:16
@stakx stakx force-pushed the deprecate-modulescope-definetype branch from 6a77ae7 to 002b2f7 Compare April 3, 2019 08:17
@stakx
Copy link
Member Author

stakx commented Apr 3, 2019

@jonorossi, seems to work as it should:

Errors, Failures and Warnings

1) Failed : Castle.PublicApiTestCase.PublicApi
  ref/Castle.Core-net35.cs does not match Castle.Core.dll
  Expected string length 303613 but was 303712. Strings differ at index 195077.
  Expected: "...dModuleName { get; }\r\n        public System.Reflection.Emi..."
  But was:  "...dModuleName { get; }\r\n        [System.ObsoleteAttribute("E..."
  ----------------------------------------------^
at Castle.PublicApiTestCase.PublicApi()

Nice! 👍 I'll run this locally later today to see the diff tool pop up & update the public API.

@jonorossi
Copy link
Member

Nice! 👍 I'll run this locally later today to see the diff tool pop up & update the public API.

No diff tool pops up, I think that was a feature of the now obsoleted part of the library, the "approver" part. I wouldn't have wanted that anyway, however you'll see the diff with your git client.

@stakx
Copy link
Member Author

stakx commented Apr 3, 2019

@jonorossi, thanks for the correction, I see now. This is working beautifully.

@jonorossi
Copy link
Member

I expected to see EditorBrowsableAttribute in the API output, however the tool is explicitly written to exclude that attribute: https://github.com/JakeGinnivan/ApiApprover/blob/80f1fd97db4499d7929cc582a5b7f4eb7f85c018/src/PublicApiGenerator/ApiGenerator.cs#L407

It doesn't really worry me since it is trivial but was surprising.

@stakx
Copy link
Member Author

stakx commented Apr 4, 2019

@jonorossi - Would you prefer if we deprecate DelegateProxyGenerator (which you suggested here) at the same time (i.e. as part of this PR), or shall we deal with that in a separate PR?

On second thought, let me retract that question. A separate PR for DelegateProxyGenerator (and possibly more) seems cleaner to me, no need to mix up two different things even though both are related to delegate proxies.

@stakx stakx merged commit c50deb3 into castleproject:master Apr 4, 2019
@jonorossi
Copy link
Member

@stakx I agree, a separate PR done for another release sounds like the way to go.

@jonorossi jonorossi mentioned this pull request Apr 5, 2019
@stakx stakx deleted the deprecate-modulescope-definetype branch April 8, 2019 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants