Repository navigation
ecs-architecture: nested features, plugins and entries, with the samples restructured; a virtual list in the todo sample; pnpm 11 - #279
Merged
Conversation
…pace.yaml, lockfiles regenerated, CI from packageManager
…he samples follow The standard and its checker: - src/ is the root feature: its layers hold the foundation, subjects are features in features/, sub-features nest inside what they build on, and a parent uses its sub-features only to aggregate them in its plugins and indexes; test features sit in the test/ of the lowest feature whose tests share them. - A layer's systems are listed by its one plugin, plugin.<feature>-<layer>.ts; the app is features/main, started by entries, entry.<name>.ts, the only modules that run code as they load. - A declaration's private parts are unexported in its file, or in a folder named for it when a test reaches them or the file passes 400 lines; internal/ holds only what several public declarations use. - One export per file everywhere: tests export nothing, and there are no test helper files; tests never make an export public. - Free-form modifiers before the kind (persistent.component.done.ts); diagrams and app folders removed. @adobe/ecs: Plugin.start adds nothing for plugins without systems, so it starts on joined worlds, and takes no config when no plugin asks for one. The todo, particles, transfers, gpu-views and benchmark samples are restructured to the standard.
…) and @adobe/ecs-architecture 0.5.0 (nested features, plugins, entries)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR does three things:
@adobe/ecs-architecture's standard and checker so an app's folder tree shows what each part is and what it builds on.The architecture standard (
ecs/packages/ecs-architecture)Folders
src/is the root feature. Its layers (elements,model,ports,view) hold the foundation: infrastructure or data that isn't a subject of its own.features/, even when it's the only one.features/when it builds on the parent's layers. A parent imports its own sub-features only in its plugins and indexes, to aggregate them, so its users take the whole subtree as one unit.features/ortest/.Public and private
plugin.todos-view/,function.frame/) only when a test reaches it or the file passes 400 lines (checked).internal/holds only what several public declarations use (checked).Plugins, entries and the app
plugin.<feature>-<layer>.ts, which lists them. There are noconstant.systems.tsfiles any more.features/main. Entries,entry.<name>.ts, are the only modules that run code as they load: the page script, worker scripts and node scripts.Tests
test/of the lowest feature whose tests share it.*.test-helper.tsfiles.Other changes
persistent.component.done.ts.ARCHITECTURE.mddiagrams, app folders found by name, and thesystemsandappssettings.New checks: entries,
runs-on-load, plugin naming,parts-reach,internal-single-use,file-too-long,test-exports,test-helper,parent-imports-sub-featureand the nested folder layout.The standard, the agent rules and the guide are updated, and the repo's agent files are regenerated.
@adobe/ecsPlugin.startadds nothing for plugins that have no systems, so it now works on a joined world, which can only add readonly systems. Its config argument may be left out when no plugin asks for one.The samples
rootresource and<virtual-list>are the root's foundation.todosholdsfilter,completionandgenerateas sub-features, andtodosViewcomposes their plugins.model;cpu,gpuandmainare features.cpu.main. Their workers start from entries, and their build tests read Vite's manifest instead of matching file names.Todo sample: a virtual list
The todo list now keeps only the rows in view, plus half a screen above and below, about 30 rows for 10,000 todos. Its new
<virtual-list>element knows nothing of the ECS. It reuses rows that scroll out for those that scroll in, keeps the focused row, and asks the world for a new range only near its edges. At 10K todos, filtering half the todos (laid out) went from 17 ms to 1 ms, and creating and laying out all rows went from ~135 ms to ~9 ms.pnpm 11
Both workspaces pin
pnpm@11.28.12throughpackageManager. Overrides moved intopnpm-workspace.yaml, the lockfiles are regenerated, and CI takes its pnpm version frompackageManager.Versions
@adobe/ecs0.5.1 → 0.5.2: thePlugin.startfix.@adobe/ecs-architecture0.4.0 → 0.5.0: breaking, sinceapps,systemsanddiagramsare removed and the layout is new.@adobe/datapackage changed. The samples are private, so the repo doesn't bump them.Verification
Locally:
ecs-architecture check.ecs-sample-browserruns every sample in a real browser, 13/13.ecs-guide's node tests pass, 44/44.