Skip to content

@shared/ imports render: both bundlers resolve the workspace's shared/ (LY2) - #186

Merged
shinyobjectz merged 1 commit into
mainfrom
shared-imports
Nov 18, 2026
Merged

shinyobjectz merged 1 commit into
mainfrom
shared-imports

Conversation

@shinyobjectz

Copy link
Copy Markdown
Owner

raea's skill tells agents to import shared code as @shared/components/NAME, and the project's tsconfig maps it, so tsc passes. But raea render's bundler took @shared/... for a package, and the composition threw Can't find variable: _shared_components_badge before its first frame (0.1.7, found by an agent on macOS). A relative import of the same file worked.

  • raea_io_home::shared finds the workspace's shared/ the way the engine's loader does: the folder holding .raea/workspace, or that folder's root for a workspace from before shared/. It also finds the file an @shared/ name means, and import() answers both relative and @shared/ imports.
  • runtime/bundle (render, play, the stage) treats @shared/ like any import from outside the edit's folder. The file is copied to ext/shared/ with what it imports, and the import is pointed at the copy. This also covers a project that is a repo of its own.
  • engine/bundle's script resolution (raea run, specs) resolves @shared/ from the importer.
  • A name shared/ doesn't have is refused, naming its importer.
  • import_path moved to raea-io-home with the other path helpers, which keeps raea-runtime-bundle under the 2000-line cap.

Checked

  • raea render of a composition importing @shared/components/badge draws (it threw before).
  • raea run resolves @shared/.
  • A missing name is refused with the file it looked for.
  • raea-io-home, raea-runtime-bundle and raea-bundle tests pass.
  • tools/size.sh and tools/dupes.sh pass on this branch alone.

🤖 Generated with Claude Code

…/ (LY2)

raea's skill tells agents to import shared code as @shared/components/NAME, and the project's tsconfig maps it, so
tsc passes; but raea render's bundler took @shared/... for a package and the composition threw "Can't find variable:
_shared_components_badge" before its first frame (0.1.7, reported by an agent on macOS). A relative import of the same
file worked.

raea_io_home::shared finds the workspace's shared/ as the engine's loader does (the folder holding .raea/workspace;
its root for a workspace from before shared/) and the file an @shared/ name means. runtime/bundle's copy of an edit
treats @shared/ like any import from outside its folder: copied to ext/shared/ with what it imports, the import
pointed at the copy (a project that is its own repo too). engine/bundle's script resolution (raea run, specs) resolves
it from the importer. A name shared/ doesn't have is refused naming its importer, not left to the bundler.

Checked: raea render of a composition importing @shared/components/badge draws (it threw before); raea run resolves
@shared/; a missing name is refused with the file it looked for. raea-io-home, raea-runtime-bundle and raea-bundle
tests pass (new: an_import_of_shared_finds_the_workspace_s_file_from_any_depth,
outside_copies_the_workspace_s_shared_code).
@shinyobjectz
shinyobjectz merged commit dc9dacf into main Nov 18, 2026
4 checks passed
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.

1 participant