-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add library syntax and testing #488
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just want to comment on this so I can see if I understand:
You have a config in your library. This is not initially namespaced -- it is just as if the user added their own config they used for a study there (to my knowledge, there's currently no restriction on the library elements, so any config thats valid should be able to be placed there).
When a user specifies a library, it firsts generates a "new config" which takes all the components and sequence objects and adds them as baseComponents with the specified namespace name. For example, if there is a baseComponent called "test-baseComponent", then a new base component in this new config is created with the name $test.components.test-baseComponent". That way, when you are referencing a component in your config, it has something to reference. Its essentially "merging" the library config inside your own config, but namespaces the elements.
This also allows for inheriting the libraryData's components as components or as baseComponents.
So, couple questions:
- Whats the use of a base component in the library config? is it just so that the library config itself can use them? Since it doesnt seem like you're adding specific libraryBaseComponents to the baseComponents of the final config, you're inheriting inside the library first? In other words, you're first generating the full library config so that there are no more "baseComponents" -- each final component of the resulting library config will essentially have all the stand-alone information for that component. (So if a library component inherits a library base component, when the library component is added to the final config, its as if that single library component has all the contents of the library base component coming with it)
- Are there any checks in place for repeating library names in the library folder? Not sure how you'd handle this if you haven't already
Great work!! I like the namespace conventions you used
6ac848e
to
7490dee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small potential change, otherwise looks great
Does this PR close any open issues?
Prelim for #478
Give a longer description of what this PR addresses and why it's needed
This adds libraries, a reusable configuration of components and sequences that can enable sharing of larger component blocks without copy/pasting between configurations.
The
LibraryConfig
is a new JSON schema that represents library objects. The schema looks similar to theStudyConfig
(and reuses lots of the types), but it allows for multiple sequence definitions so that components may be used in 1 sequence and not another. This new schema is documented using typedoc.Provide pictures/videos of the behavior before and after these changes (optional)
New steps panel icon for library components.
Are there any additional TODOs before this PR is ready to go?
TODOs: