Skip to content

Conversation

@sourcegraph-wk
Copy link

Problem

An entrypoint import can be defined as an import within lib/src that imports a file within lib/*.dart (the entrypoints of a dart package). These imports are always unnecessary, and can contribute to slower dart build performance.

Solution

This PR naively removes every entrypoint import within the repo, and updates the gha-dart/.../checks.yaml to the latest version. In order to merge this PR a few manual changes must be performed:

  • Navigate to every file which has analysis errors caused from the missing import. Rely on intellisense to import the necessary symbol from the specific file, not the entrypoint import
  • Implement the no_entrypoint_imports additional-checks option in [email protected] that was added in this PR. This will prevent new entrypoint imports from getting added once this PR merges

Our request to teams is to perform the above tasks, so we can default enable the no_entrypoint_imports check for all gha-dart consumers. Please reach out to #support-frontend-dx for any questions or issues

QA

  • This pr is heavily dependant on the analysis server, and as such CI passes should be sufficient

Created by Sourcegraph batch change Workiva/no_entrypoint_imports.

@sydneyjodon-wk sydneyjodon-wk marked this pull request as ready for review August 6, 2025 23:09
annawatson-wk
annawatson-wk previously approved these changes Aug 6, 2025
Copy link

@annawatson-wk annawatson-wk left a comment

Choose a reason for hiding this comment

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

+10, CI passes

Copy link
Contributor

@greglittlefield-wf greglittlefield-wf left a comment

Choose a reason for hiding this comment

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

Just a couple small comments, otherwise LGTM!

// ignore: unused_shown_name
import 'package:over_react/over_react.dart'
show PropDescriptor, PropsMeta;
import 'package:over_react/over_react.dart' show PropDescriptor, PropsMeta;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be updated to a src import?

Copy link
Contributor

Choose a reason for hiding this comment

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

ohh good catch :loading:

import 'package:over_react/src/util/css_value_util.dart';
import 'package:platform_detect/platform_detect.dart';

import '../../react_dom.dart' as react_dom;
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we make this a package: import instead of a relative path?

Copy link
Contributor

Choose a reason for hiding this comment

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

should I move the react_dom.dart file into src and re-export it from lib?

Copy link
Contributor

Choose a reason for hiding this comment

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

because that file is lib/react_dom.dart so I couldn't get a src import

Copy link
Contributor

Choose a reason for hiding this comment

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

Ohh is this the same file as package:over_react/react_dom.dart? Yeah, if you wouldn't mind, I think that'd be better

ReactElement;
import 'package:w_common/disposable.dart';

import '../../../react_dom.dart' as react_dom;
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as above

Copy link
Contributor

@greglittlefield-wf greglittlefield-wf left a comment

Choose a reason for hiding this comment

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

+10

@greglittlefield-wf
Copy link
Contributor

@Workiva/release-management-p

Copy link

@rmconsole-wf rmconsole-wf left a comment

Choose a reason for hiding this comment

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

+1 from RM

@btr-rmconsole-5 btr-rmconsole-5 bot merged commit cd2465d into master Aug 7, 2025
10 checks passed
@btr-rmconsole-5 btr-rmconsole-5 bot deleted the batch/no_entrypoint_imports/over_react branch August 7, 2025 22:35
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.

6 participants