systems and capabilities #1477
Replies: 8 comments 3 replies
-
Case study: TODO AppSay we are creating a reusable todo app,
And declares itself a system (FASTN.ftd of todo app):
Now if Alternative 1:
Alternative 2:
|
Beta Was this translation helpful? Give feedback.
-
We can also use systems as a capability token, like to make http request, technically we do not need any setting but we can make our processor require a capability token which is only available if a dependency has requested http system and main package has passed that system to the dependency. Maybe we can also allow an optional system requirement, main will have to say dependency not allowed to make it clear it needs a dependency and main as explicitly decided not to pass it. Capability can also decide to what domain, and how many request per day/page view, total size etc etc. You need cookie, you ask for it and so on. |
Beta Was this translation helpful? Give feedback.
-
Since we are going to require many small files for each capability and it may get cluttered, maybe we should also allow:
As inline modules in |
Beta Was this translation helpful? Give feedback.
-
If a capability does not require any configuration, eg http, maybe we can say |
Beta Was this translation helpful? Give feedback.
-
Since we are talking of capabilities, maybe passing all capabilities that are imported to every dependency is not a good default. Maybe we should explicitly name |
Beta Was this translation helpful? Give feedback.
-
amitu.com
Note: it is not necessary
Also if there are no overwrites, the
ds.fastn.com
This will lead to auto import of the actual module that implements doc-site.com
The some-other-package-implementing-dsShould also say it implements ds.fastn.com:
|
Beta Was this translation helpful? Give feedback.
-
Some thoughtsCan we omit the
|
Beta Was this translation helpful? Give feedback.
-
Proposal: Auto-importing system package using
|
Beta Was this translation helpful? Give feedback.
-
We can extend the https://github.com/orgs/fastn-stack/discussions/1470 discussion, by saying we have "systems", and design-system is one such system, and systems can be required or provided.
We introduce a new package type called "system" (
system: true
, can be added in anyfastn.package
).So
design-system
package is created with:Any package can require this:
Or we can do (this our decision):
In
system: ds
we are sayingds
is auto imported and available to all modules inside this package.And the main package has to provide/meet all requirements or all packages used directly or indirectly:
If any dependency of amitu.com accesses
ds
auto imported global variable, they will seeamitu.com/ds
.The actual contract would be kept in a special module
system
in everysystem
package, egfastn-community.github.io/design-system/system
exists as a module, andamitu.com/ds
has to now "implement" this module.The minimal
ds.ftd
inamitu.com
would be:Tho if that is all you want you can also do:
And avoid creating that 2 line file. Tho all our templates will include the two line file, possibly overwrite some common settings like site name, logo etc.
Beta Was this translation helpful? Give feedback.
All reactions