Skip to content

Remove unused files and dependencies with Knip#1494

Merged
zetter-rpf merged 82 commits into
mainfrom
knip
Jun 11, 2026
Merged

Remove unused files and dependencies with Knip#1494
zetter-rpf merged 82 commits into
mainfrom
knip

Conversation

@zetter-rpf

@zetter-rpf zetter-rpf commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

This uses the Knip tool to remove unused code and dependencies, similar to https://github.com/RaspberryPiFoundation/editor-standalone/pull/770.

It seems that most removals are due to:

  • Code that was copied when this project was split from editor-standalone that was never used
  • Packages that are no longer needed as dependencies as we don't directly use them (but they may be still installed as dependencies of dependencies)
  • Packages that were installed by default as part of the ejecting of 'create react app'.

I've tested the build locally from classroom and editor and all project types are working as expected.

This takes us from around 2540 dependencies (170 direct) to 2264 (132 direct), although doesn't change the build size that much as the dependencies were unused.

@zetter-rpf zetter-rpf temporarily deployed to previews/1494/merge June 10, 2026 11:33 — with GitHub Actions Inactive
@zetter-rpf zetter-rpf changed the title Knip Remove unused files and dependencies with Knip Jun 10, 2026
@zetter-rpf zetter-rpf temporarily deployed to previews/1494/merge June 10, 2026 15:10 — with GitHub Actions Inactive
@cursor cursor Bot temporarily deployed to previews/1494/merge June 10, 2026 15:20 Inactive
@cursor cursor Bot temporarily deployed to previews/1494/merge June 10, 2026 15:27 Inactive
@cursor cursor Bot temporarily deployed to previews/1494/merge June 10, 2026 15:37 Inactive
@cursor cursor Bot temporarily deployed to previews/1494/merge June 10, 2026 15:38 Inactive
@cursor cursor Bot temporarily deployed to previews/1494/merge June 10, 2026 15:39 Inactive
@zetter-rpf zetter-rpf temporarily deployed to previews/1494/merge June 11, 2026 10:45 — with GitHub Actions Inactive
zetter-rpf and others added 21 commits June 11, 2026 11:45
The project seems to run fine without them
It looks like many of these are in editor-standalone so may have been copied when the project was split
This is done in the webcomponent js
Note that this is already a dependency of code-mirror so we don't need to include it here
Note that sentry/react sentry still has this as a depedency so it will remain installed
Co-authored-by: Chris Zetter <zetter-rpf@users.noreply.github.com>
Co-authored-by: Chris Zetter <zetter-rpf@users.noreply.github.com>
Co-authored-by: Chris Zetter <zetter-rpf@users.noreply.github.com>
cursoragent and others added 16 commits June 11, 2026 11:45
Co-authored-by: Chris Zetter <zetter-rpf@users.noreply.github.com>
Co-authored-by: Chris Zetter <zetter-rpf@users.noreply.github.com>
Co-authored-by: Chris Zetter <zetter-rpf@users.noreply.github.com>
Co-authored-by: Chris Zetter <zetter-rpf@users.noreply.github.com>
Co-authored-by: Chris Zetter <zetter-rpf@users.noreply.github.com>
Co-authored-by: Chris Zetter <zetter-rpf@users.noreply.github.com>
Co-authored-by: Chris Zetter <zetter-rpf@users.noreply.github.com>
Co-authored-by: Chris Zetter <zetter-rpf@users.noreply.github.com>
Co-authored-by: Chris Zetter <zetter-rpf@users.noreply.github.com>
Co-authored-by: Chris Zetter <zetter-rpf@users.noreply.github.com>
Co-authored-by: Chris Zetter <zetter-rpf@users.noreply.github.com>
Co-authored-by: Chris Zetter <zetter-rpf@users.noreply.github.com>
Co-authored-by: Chris Zetter <zetter-rpf@users.noreply.github.com>
Co-authored-by: Chris Zetter <zetter-rpf@users.noreply.github.com>
Co-authored-by: Chris Zetter <zetter-rpf@users.noreply.github.com>
Co-authored-by: Chris Zetter <zetter-rpf@users.noreply.github.com>
@zetter-rpf zetter-rpf temporarily deployed to previews/1494/merge June 11, 2026 10:45 — with GitHub Actions Inactive
@zetter-rpf zetter-rpf marked this pull request as ready for review June 11, 2026 10:55
Copilot AI review requested due to automatic review settings June 11, 2026 10:55
@zetter-rpf zetter-rpf temporarily deployed to previews/1494/merge June 11, 2026 10:56 — with GitHub Actions Inactive
We could keep knip and include it as a build in the future, but for now we've got value from it by running it for the first time.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Cleans up the editor-ui codebase by removing unused source files, styles, build helpers, and dependencies identified via Knip (primarily legacy CRA/ejected-Cra artifacts and unused code carried over from editor-standalone).

Changes:

  • Removed unused runtime/dev dependencies and updated yarn.lock accordingly.
  • Deleted unused application/util/redux files and unused SCSS stylesheets.
  • Simplified some module exports (Redux slices, components, Cypress helpers) to reflect actual usage.

Reviewed changes

Copilot reviewed 26 out of 27 changed files in this pull request and generated no comments.

Show a summary per file
File Description
yarn.lock Lockfile updated to reflect dependency removals/additions.
package.json Removed unused deps/devDeps; added TypeScript-related dev tooling deps.
src/utils/sentry.js Removed unused Sentry initialization module.
src/utils/reportWebVitals.js Removed unused web-vitals reporting helper.
src/utils/defaultProjects.js Removed unused HTML default project helpers/exports; retained Python defaults.
src/redux/WebComponentSlice.js Removed unused Redux slice.
src/redux/WebComponentAuthSlice.js Adjusted slice visibility/exports to only expose used actions.
src/redux/InstructionsSlice.js Adjusted slice visibility/export style without changing reducer behavior.
src/redux/EditorSlice.js Adjusted slice visibility and pruned exported actions list to those in use.
src/hooks/useUserFont.js Removed unused hook.
src/hooks/useRequiresUser.js Removed unused hook.
src/components/Menus/Sidebar/DownloadPanel/DownloadPanel.jsx Switched to internal const component while keeping default export.
src/components/Editor/NewInputPanelButton/NewInputPanelButton.jsx Removed unused component.
src/assets/stylesheets/rpf_design_system/typography.scss Removed unused stylesheet.
src/assets/stylesheets/ProjectListTable.scss Removed unused stylesheet.
src/assets/stylesheets/ProjectListItem.scss Removed unused stylesheet.
src/assets/stylesheets/ProjectIndexPagination.scss Removed unused stylesheet.
src/assets/stylesheets/ProjectIndexHeader.scss Removed unused stylesheet.
src/assets/stylesheets/LoginMenu.scss Removed unused stylesheet.
src/assets/stylesheets/LandingPage.scss Removed unused stylesheet.
cypress/helpers/scratch.js Reduced exported helper surface to what’s used.
cypress/helpers/editor.js Reduced exported helper surface and removed unused HTML-runner helper functions.
config/webpackDevServer.config.js Removed unused CRA-derived dev-server config helper.
config/svgo.config.js Removed unused SVGO config file.
config/pnpTs.js Removed unused PnP TypeScript resolver helper.
config/modules.js Removed unused CRA module-resolution helper.
config/getHttpsConfig.js Removed unused CRA HTTPS config helper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@DNR500 DNR500 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good :-)

@zetter-rpf zetter-rpf merged commit d763f69 into main Jun 11, 2026
7 checks passed
@zetter-rpf zetter-rpf deleted the knip branch June 11, 2026 11:19
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.

4 participants