Start lock down stratum work #7573
Draft
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 is an experiment to see what would be needed in order to lock down the use of "loadable" strata.
It also just an exercise for me to go through and review how loadable strata are used.
In my mind strata should only be used to populate trait values. From the docs:
In many cases, we also access loadable stratum properties that don't apply to traits (for example -
WebMapServiceCatalogItem.validLayers-terriajs/lib/Models/Catalog/Ows/WebMapServiceCatalogItem.ts
Lines 259 to 274 in 30654f1
Most usage of loadable strata like this can be easily refactored by creating extra traits - for example
terriajs/lib/Traits/TraitsClasses/WebMapServiceCatalogItemTraits.ts
Lines 227 to 233 in 1cc022d
Which means we can now avoid using the stratum directly
terriajs/lib/Models/Catalog/Ows/WebMapServiceCatalogItem.ts
Lines 260 to 272 in 1cc022d
There are also a number of patterns that end up using these lodable strata properties directly
createMembersfunction that sits in a loadable stratumdiscreteTimesis also usually from within a loadable stratumFuture work
GetCapabilitieson a server with many layers - or loading CKAN datasetsTodo
WebMapTileServiceCatalogItem