-
Notifications
You must be signed in to change notification settings - Fork 163
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
auspice extension architecture #688
Merged
Merged
Conversation
This file contains 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
This commit (and the PR to which it belongs) moves auspice from a component of nextstrain to a stand alone tool which can be extended (e.g. with aesthetic or functional changes). The auspice seen on nextstrain.org will eventually be one such extension.
The splash page can now be replaced by providing a compatable react component.
Babel upgraded to version 7. This allows us to use babel.config.js to have more control over the transpiling behavior. This allows extension JS files living outside of the auspice directory to be processed by babel. There is still a bug related to react-hot-loader when using JS files outside of the auspice dir.
This decouples the main app display from dataset loading. This is needed for extensions which want to have control over dataset loading (e.g. drag-and-drop).
Harcoded paths can be provided by the extension JSON file. This API is experimental and is expected to change in future commits / PRs.
The server code has been slightly re-organised and (hopefully) simplified. The "getAvailable" request now returns both the avilable datasets and narratives. The webpack configs have also been updated such that "npm run build" works again.
Part of a move to a future where auspice.us handles community datasets & narratives, nextstrain.org handles S3 datasets Github pages builds are currently not working as (e.g.) `/dist/bundle.js` should be `dist/bundle.js` But this change would break server builds.
Begin using styled components in auspice to define CSS-in-JS and to utilise a theme which is inherited by multiple components. Future commits will allow this theme to be provided via the extension architecture. Styled components was chosen because it is popular, well supported and uses pure CSS (rather than a similar-but-different syntax). Future commits will gradually remove our usage of global defined styles and seperate CSS files and move towards consistent use of styled components with themes. in the sidebar to define styles and supply them
The nextstrain navbar has been removed and is now part of the nextstrain repository.
Extensions can define a theme which is passed to sidebar components as a "theme" prop available using "styled components". This allows extensions modify the appearence of the sidebar.
Previously the available datasets were included from the server in the response to a "get dataset" request. This forced the server-provided dataset JSON to deviate from the published JSON spec. As auspice becomes used in different websites it's important that the JSON delivered to the client mirrors that delivered to the server.
by specifying the `browserTitle` property in the provided extension JSON
Accessing auspice is now via "node auspice.js" or "auspice" if installed globally. Subcommands are "auspice view", "auspice build" and "auspice develop", each with their own help pages. Code for these commands is found in "cli/" with "src/" being used for the client source code.
see docs/README.md for build instructions etc Everything needs tweaking, but this looks alright and provides the base for subsequent commits.
Github pages sourced from docs/ results in many (docusaurus-generated) files needing to live in that directory. It is confusing to have both these files as well as the docs/ and website/ folders live in the same place. docs/ and docs-src/ separates these concerns.
Content is now ready for release, with notices on most pages explaining the experimental nature of the current implementation.
Releasing auspice to npm no longer uploads the src to a s3 bucket nor triggers nextstrain.org to rebuild (this must be done from within the nextstrain.org repo). When not extended, auspice is focused on local builds therefore is not to be run on Heroku.
The nextstrain-specific features (travis badges, nextstrain logo) have been removed. These could be added back in the future via an extension.
Logging was used throughout development of the "extend" branch.
Update the auspice logo, include it in the docs footer & app splash page. Favicons for docs & app.
During development of the "extend" branch the second tree & tip-frequency fetching had been removed from the server. Full functionality is now restored. (Note that this code is completely separate from that in the nextstrain.org server. We could one day expose this and import it in the nextstrain.org repo.)
These were introduced during rebasing while working on the extend branch due to misconfigured (global) gitconfig (it would replace 8 spaces with a tab character)
Merged following discussion during 2019-01-14 nextstrain meeting |
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.
Prior to this PR auspice was a repository which generated
This PR changes auspice into a stand-alone program separate from nextstrain. Alone, it can be used to display local datasets (similar to before, but with new branding). It may also be extended by injecting code at build time. In this fashion, the viewer used in nextstrain.org will be one particular extended-version of auspice.
This PR also introduces docs for auspice, which are the best place to understand and try out the functionality introduced by this PR. They are located in
./docs-src
and build into a webpage to be run off github pages from./docs
. This page is a working clone of the docs in this branch and is what nextstrain.github.io/auspice will look like when this is merged into master.