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

FED-2242 Stop exporting meta #888

Merged
merged 5 commits into from
Feb 16, 2024
Merged

Conversation

greglittlefield-wf
Copy link
Contributor

@greglittlefield-wf greglittlefield-wf commented Feb 15, 2024

Motivation

I noticed when pulling v5_wip into a test project that there were a lot of infos that looked like:

info: The import of 'package:meta/meta.dart' is unnecessary because all of the used elements are also provided by the import of 'package:over_react/over_react.dart'. (unnecessary_import at …)

This is because we export mustCallSuper so we can use it in generated code.

Initially I thought this was going to be okay: #862 (comment)

+export 'package:meta/meta.dart' show mustCallSuper;
@greglittlefield-wf

Oh interesting, this is so that generated code can use @mustCallSuper, right? Could we add a comment here to that effect.

Kind of gross that it has to be exported from over_react and added to its public API, though I don't think it would cause any issues...

And I can't think of any better alternatives, unless we created an alias for it that was named something else, and maybe deprecated (e.g., @Deprecated('For generated use only) const $overReact$mustCallSuper = mustCallSuper;)... Not sure if that's worth the trouble though.

These new lints are definitely enough to make me think it is worth the trouble 🙂.

Changes

Note: diff best reviewed commit-by-commit

  • 9306f6b f236c02 Make ConnectPropsMixin implement builder_helpers.UiProps instead of component_base.UiProps
    • Without this, because of the way things were imported, the generated code was referencing component_base.UiProps.$mustCallSuper, when it needs to reference component_base.UiProps.$mustCallSuper
    • We should have been doing this anyway; this is technically a breaking change for any existing consumers extending only from component_base.UiProps, but we don't really support consumers using the component_base version in declarations, and I don't see any consumers that would be impacted. If there are any that would be impacted, it'd be a compilation error we'd catch in testing.
  • 5399966 Stop exporting package:meta, and use a custom constant instead (I was able to use @protected to help prevent other code from using it)
  • 1cd247b Update generated code
  • fca76c6 Update generated gold files

Release Notes

Review

See CONTRIBUTING.md for more details on review types (+1 / QA +1 / +10) and code review process.

Please review:

QA Checklist

  • Tests were updated and provide good coverage of the changeset and other affected code
  • Manual testing was performed if needed
    • Steps from PR author:
      • Everything analyzes cleanly with these changes (CI passes)
    • Anything falling under manual testing criteria outlined in CONTRIBUTING.md

Merge Checklist

While we perform many automated checks before auto-merging, some manual checks are needed:

  • A Frontend Frameworks Design member has reviewed these changes
  • There are no unaddressed comments - this check can be automated if reviewers use the "Request Changes" feature
  • For release PRs - Version metadata in Rosie comment is correct

@aviary-wf
Copy link

Security Insights

No security relevant content was detected by automated scans.

Action Items

  • Review PR for security impact; comment "security review required" if needed or unsure
  • Verify aviary.yaml coverage of security relevant code

Questions or Comments? Reach out on Slack: #support-infosec.

@greglittlefield-wf greglittlefield-wf marked this pull request as ready for review February 15, 2024 20:26
@rmconsole4-wk rmconsole4-wk changed the title Stop exporting meta FED-2242 Stop exporting meta Feb 15, 2024
@greglittlefield-wf greglittlefield-wf merged commit d3806ed into v5_wip Feb 16, 2024
10 checks passed
@robbecker-wf robbecker-wf deleted the stop-exporting-meta branch February 16, 2024 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants