Skip to content

Deprecate FileSystemProvider and RenderNodeProvider #1108

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

Conversation

d-ronnqvist
Copy link
Contributor

Bug/issue #, if applicable:

Summary

This deprecates FileSystemProvider and RenderNodeProvider. They each had their issues.

The clearest sign that FileSystemProvider was a poor API is that both call sites had to reimplement tree traversal to use it:

  • FileSystemRenderNodeProvider implemented its own breadth first traversal to iterate over the files.
  • StaticHostableTransformer had ~80 LOC of private recursive functions to iterate over the files and determine what their relative paths are.

The issues with RenderNodeProvider are more subtle. Ignoring the issues with the API naming;

  • getProblems() was never called, so conforming types created diagnostics that was never presented to the user.
  • The issues represented by getProblems() was unexpected errors rather that user-facing diagnostics, so Problem isn't an appropriate type for this information.
  • There's only one type that conforms to RenderNodeProvider (not even other conforming types in tests).

What the NavigatorIndex.Builder actually needs would have been better described by some Sequence<RenderNode>.

Dependencies

None.

Testing

Nothing in particular. This isn't a user-facing change.

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • Added tests
  • Ran the ./bin/test script and it succeeded
  • [ ] Updated documentation if necessary Not applicable

@d-ronnqvist d-ronnqvist added the code cleanup Code cleanup *without* user facing changes label Dec 2, 2024
Copy link
Contributor

@patshaughnessy patshaughnessy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a great improvement 👍

@d-ronnqvist
Copy link
Contributor Author

@swift-ci please test

@d-ronnqvist
Copy link
Contributor Author

@swift-ci please test

@d-ronnqvist d-ronnqvist merged commit d82da96 into swiftlang:main Dec 4, 2024
2 checks passed
@d-ronnqvist d-ronnqvist deleted the deprecate-file-system-provider branch December 4, 2024 13:32
compnerd added a commit that referenced this pull request Dec 4, 2024
atrick pushed a commit that referenced this pull request Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code cleanup Code cleanup *without* user facing changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants