Skip to content
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 extendSession extension point to web and desktop #3179

Merged
merged 1 commit into from
Sep 14, 2022

Conversation

garrettjstevens
Copy link
Collaborator

This adds an extension point to web and desktop that allows the session to be extended. You can use this to add more—or override exisiting—state, views, or actions to the session. I can be used from plugins like this:

pluginManager.addToExtensionPoint(
  'Core-extendSession',
  (sessionModel: IAnyModelType) =>
    sessionModel
      .props({
        // additional model state here
      })
      .views((self) => ({
        // additional views here
      }))
      .actions((self) => ({
        // additional actions here
      })),
)

@garrettjstevens garrettjstevens self-assigned this Sep 12, 2022
@github-actions github-actions bot added the needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) label Sep 12, 2022
@codecov
Copy link

codecov bot commented Sep 12, 2022

Codecov Report

Merging #3179 (d6356e5) into main (a7e7da9) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #3179      +/-   ##
==========================================
+ Coverage   59.47%   59.49%   +0.02%     
==========================================
  Files         671      671              
  Lines       28635    28637       +2     
  Branches     6928     6928              
==========================================
+ Hits        17030    17039       +9     
+ Misses      11283    11276       -7     
  Partials      322      322              
Impacted Files Coverage Δ
...roducts/jbrowse-desktop/src/sessionModelFactory.ts 6.59% <100.00%> (+0.34%) ⬆️
products/jbrowse-web/src/sessionModelFactory.ts 59.45% <100.00%> (+0.12%) ⬆️
...ments/src/SNPCoverageAdapter/SNPCoverageAdapter.ts 58.00% <0.00%> (+0.66%) ⬆️
plugins/alignments/src/BamAdapter/BamAdapter.ts 72.97% <0.00%> (+0.90%) ⬆️
packages/core/ui/SnackbarModel.ts 90.47% <0.00%> (+23.80%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@cmdcolin
Copy link
Collaborator

I think this should be fine! might want to add it to the docs for extension points

@cmdcolin cmdcolin merged commit fdb9dc5 into main Sep 14, 2022
@cmdcolin cmdcolin deleted the extend_session_model branch September 14, 2022 17:58
@cmdcolin cmdcolin added enhancement New feature or request internal and removed needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) labels Sep 14, 2022
cmdcolin pushed a commit that referenced this pull request Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request internal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants