Tokamak/Sources/TokamakGTK/Tokens
filip-sakel 4d211af563
Add '_spi(TokamakCore)' to ideally internal public members. (#386)
Adds `_spi(TokamakCore)` to the modules:
1. TokamakCore
2. TokamakDOM
3. TokamakGTK
4. TokamakStaticHTML

The attribute is applied to:
1. All `View` bodies in TokamakCore — either primitive or regular like `Color`
2. `ViewDeferredToRenderer` bodies
4. `ParentView` `children` members
5. `View` modifiers (such as  `_onMount(perform:)`)
6. Other members of types (like `Color._withScheme`, and `_AnyApp._launch`) 

The attribute semantics (from my brief testing)
1. It can only be applied to `public` declarations
2. It ensures that every SPI declaration is exposed only by other SPI declarations (i.e. `@_spi(Module) public enum A {}; public var a: A` is illegal)
3. Regularly importing a library prohibits clients from accessing SPI declarations that are not protocol witnesses (with an error).
4. Regularly importing a library "discourages" clients from accessing SPI protocol witnesses by hiding them from the autocompletion suggestions (i.e. users can still access `body` of `Text`, but autocompletion hides it).
5. For a declaration marked with `@_spi(Module)`, a client has to write `@_spi(Module) import Library` in order to normally access such SPI declarations.

* Add '_spi(TokamakCore)' to ideally internal public members.

* Remove `_spi` attribute on '_ConditionalContent'.

* Remove spi from 'Path._PathBox', 'Font._Font', and '_TupleScene.body'.

* Remove spi from types.

* Remove trailing whitespace.

* Apply spi to 'View' modifiers.

* Add _spi imports.

* Introduce 'PrimitiveView'.

* Remove 'PrimitiveView' conformances outside of TokamakCore.

* Fix `PrimitiveView` default implementation.

* Remove "BubbleCore" references.
2021-03-08 18:49:05 +00:00
..
BuiltinColors.swift Add '_spi(TokamakCore)' to ideally internal public members. (#386) 2021-03-08 18:49:05 +00:00