Skip to content
Source
Sign inSign up
TanStack/intent

perf: import already-loaded modules statically #327

MergedLadyBluenotes(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/327/headmerged by LadyBluenotes(GitHub profile, opens in a new tab)

Showing 3 changed files with 13 additions and 12 deletions.

x
0 of 3 viewed, 3 left
5 additions and 0 deletions.changeset/static-imports-already-loaded.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/intent': patch
+---
+​
+Make the installed package 16 kB smaller and load fewer files in each command. `intent validate` and `intent stale` imported modules a second time through a deferred import, although the same files had already loaded them. Those modules are now imported directly, so the bundle keeps only the parts of `yaml` that Intent uses; behavior does not change.
4 additions and 2 deletionspackages/intent/src/commands/support.tsModified
View file
@@ -4,6 +4,10 @@
import { fail } from '../shared/cli-error.js'
import { resolveProjectContext } from '../core/project-context.js'
import { createIntentFsCache } from '../discovery/fs-cache.js'
+import {
+ findWorkspacePackages,
+ findWorkspaceRoot,
+} from '../setup/workspace-patterns.js'
import type { IntentCoreOptions } from '../core/index.js'
import type { IntentFsCache } from '../discovery/fs-cache.js'
import type {
@@ -192,8 +196,6 @@
​