SlideShare a Scribd company logo
1 of 57
From Back-end to Front-end
Kiev 2018MongoDB Compass Plugins
1. Compass Feature Tour
2. Where can my plugin fit into Compass?
3. How can my plugin fit into Compass?
4. Example
Kiev 2018MongoDB Compass Plugins
Feature Tour
Kiev 2018MongoDB Compass Plugins
Why write a plugin?
● Limitless potential: Customized charts, specific DB
commands, show cluster health, and more...
● Can solve your specific problems. Plugins can be
as personalized as you like.
● Can use plugins to share views, tools, or debug
● It is fun and easy!
Kiev 2018MongoDB Compass Plugins
Where does my plugin fit
visually into Compass?
Kiev 2018MongoDB Compass Plugins
1. Header.Item
2. Instance.Tab
3. Database.Tab
4. Collection.Tab
5. CollectionHUD.item (Heads Up Display)
Plugin Roles
Kiev 2018MongoDB Compass Plugins
Database.Tab
● Purpose:
○ Large database-level feature. Right now we just have
a list of collections.
● Potential Plugins:
○ System.profile Charts
○ List all users
Kiev 2018MongoDB Compass Plugins
Header.Item
● Purpose:
○ Top-level: display global information (e.g. MongoDB
version, topology)
● UI Considerations:
○ Header space is very small
○ Lengthy information should be hidden until asked for
● Potential Plugins:
○ Current user information
Kiev 2018MongoDB Compass Plugins
Instance.Tab
● Purpose:
○ Large instance-level features (e.g. real time server
stats). Currently have “Databases” and “Performance”.
● Potential Plugins:
○ Cluster Health
○ List of All Users
Kiev 2018MongoDB Compass Plugins
Collection.Tab
● Purpose:
○ Large collection-level features (e.g. CRUD, Explain
Plan, or schema analysis)
● Potential Plugin:
○ Object size histogram of schema sample
Kiev 2018MongoDB Compass Plugins
CollectionHUD.Item
● Purpose:
○ Display statistical information relevant to a collection
● UI Considerations:
○ Should not distract users from the main content of the
collection body
○ Should be text-based
● Potential Plugin:
○ Mongotop / server statistics
Kiev 2018MongoDB Compass Plugins
What makes up a plugin?
Compass and any plugins are React
applications.
Kiev 2018MongoDB Compass Plugins
React
React is a framework made up of Stores,
Components, and Actions.
● Stores are “smart”, they keep track of
state information and pass it to the
Components.
● Components are “dumb”, they just
receive data from the store and render it.
● Actions are how components
communicate with the store to trigger
changes.
Kiev 2018MongoDB Compass Plugins
Actions
● Events triggered when a user performs an action.
● Can be button clicks, link clicks, text entry, etc.
● Actions are sent from Components and listened to by
Stores.
Kiev 2018MongoDB Compass Plugins
Components
● Components make up the User Interface.
● This is where you use JSX to define what the plugin
should look like.
● Styles are imported from a local .less file with the
same name as the component.
Kiev 2018MongoDB Compass Plugins
Stores
● Reflux/Redux Stores that hold the application state.
● Each plugin can listen to other stores/have its state
changes listened to by others.
● Flow of data:
○ Actions should be listened to by stores
○ Stores should be subscribed to by components
Kiev 2018MongoDB Compass Plugins
The AppRegistry
● Holds all Compass + plugin actions, components,
and stores
○ All plugins must register with the AppRegistry.
● Information flows from Compass to plugins and back
through the AppRegistry.
● It is available to all Plugins globally by calling
global.hadronApp.appRegistry.
Kiev 2018MongoDB Compass Plugins
Lifecycle Hooks
How do Compass and my plugin
become aware of each other?
Kiev 2018MongoDB Compass Plugins
activate(): Tell Compass about the plugin
● Compass will look in the plugins directory.
○ ~/.mongodb/compass/plugins on OSX
● It will call the activate method in the root index.js.
● The plugin should register its actions, components, and
stores with the AppRegistry in this method.
● This is where you specify what role you want your
plugin to occupy.
whoami/src/index.js
Kiev 2018MongoDB Compass Plugins
onActivated(appReg): Tell plugin about Compass
● When all plugin registration is completed, the
onActivated method is called on any registered store.
● In this method, the plugin can get and listen to any stores
in Compass or another plugin.
● Guarantees everything has been registered before any
plugin tries to get anything from the registry.
whoami/src/stores/store.js
Kiev 2018MongoDB Compass Plugins
The AppRegistry will emit events
● data-service-connected
● collection-changed
● database-changed
● query-changed
… or any other events you want to add!
Kiev 2018MongoDB Compass Plugins
My First Compass Plugin
Kiev 2018MongoDB Compass Plugins
Who is the current user?
● Since it’s global to the Compass instance, it can take
the role Header.Item
● The connectionStatus DB command lists
authenticated users and their roles.
Final Product
Final Product
Kiev 2018MongoDB Compass Plugins
Step 0: Get the Template
Kiev 2018MongoDB Compass Plugins
~/.mongodb/compass/plugins $
> npm install -g khaos
> khaos create mongodb-js/compass-plugin ./whoami
> git init && git add . && git commit -m “init”
> npm install
Compass without plugin
Compass with unchanged plugin
Plugin running standalone
Kiev 2018MongoDB Compass Plugins
Step 1: The Store
Kiev 2018MongoDB Compass Plugins
src/stores/store.js:
● We set the initial state to empty.
● onActivated: when the DataService is connected, we
want to run the connectionStatus command.
● When the command returns, we set the state to the
results.
Kiev 2018MongoDB Compass Plugins
appRegistry.on('data-service-connected', (error, dataService) => {
if (!error) {
dataService.command(
'admin',
{connectionStatus : 1},
(err, res) => {
if (!err && res.authInfo && res.authInfo.authenticatedUsers) {
this.setState({
user: res.authInfo.authenticatedUsers[0].user,
role: res.authInfo.authenticatedUserRoles[0].role
})
} else {
this.setState({user: null, role: null});
}
}
);
}
});
getInitialState() {
return {
user: null, role: null
};
}
Call DB command on activationInitialize State
Kiev 2018MongoDB Compass Plugins
Step 2: The Component
Kiev 2018MongoDB Compass Plugins
src/components/whoami/whoami.jsx
● The store state will be passed to the component as
this.props.user and this.props.role
● Component must render the username and role
● If not provided, render “no user”
Kiev 2018MongoDB Compass Plugins
static propTypes = {
user: PropTypes.string.isRequired,
role: PropTypes.string.isRequired
};
static defaultProps = {
user: null, role: null
};
render() {
if (!this.props.user) {
return (
<div className={classnames(styles.root)}>
<FontAwesome name="user-times"/>
No User
</div>
);
}
return (
<div className={classnames(styles.root)}>
<FontAwesome name="user"/>
<i> {this.props.user}:{this.props.role}</i>
</div>
);
}
Define and
Set Default Props Render Props
Kiev 2018MongoDB Compass Plugins
Step 3: The Actions
(not used in this plugin)
Kiev 2018MongoDB Compass Plugins
Step 4: Styles
Kiev 2018MongoDB Compass Plugins
src/components/whoami/whoami.less
● Every component has a .less file with the same name
located in the same directory
● In this case just want to remove the colors.
.root {
background: #0e83cd;
color: @pw;
padding: 2.4rem;
}
Kiev 2018MongoDB Compass Plugins
Run It Standalone!
Kiev 2018MongoDB Compass Plugins
Kiev 2018MongoDB Compass Plugins
Run Compass!
A PLUGIN!
Kiev 2018MongoDB Compass Plugins
Writing a Plugin is Easy!
● We are here to help!
○ Email team-compass@mongodb.com
● All plugin documentation:
○ https://docs.mongodb.com/compass/master/plugin
s/creating-compass-plugins
● The “whoami” plugin + these slides are on GitHub
○ https://github.com/aherlihy/compass-plugins-talk
Kiev 2018MongoDB Compass Plugins
Security Restrictions
● Accessing network resources over any protocol
outside of the DB connection. This includes network
access via NodeJS or DOM APIs such as
XMLHttpRequest.
● Accessing the filesystem outside of DOM APIs
such as IndexedDB.
● Spawning child processes.
Kiev 2018MongoDB Compass Plugins
Future Plans
● We encourage everyone to share their plugins!
● MongoDB can provide marketing and support
● When there are enough plugins there will be a plugin
marketplace
● Until then, MongoDB can list the plugins the same way
we list community drivers
THANK YOU!
THANKS FOR COMING!
Anna Herlihy
anna@mongodb.com
@annaisworking

More Related Content

Similar to JS Fest 2018. Anna Herlihy. How to Write a Compass Plugin

Fundamental concepts of react js
Fundamental concepts of react jsFundamental concepts of react js
Fundamental concepts of react jsStephieJohn
 
Rapid Prototyping with TurboGears2
Rapid Prototyping with TurboGears2Rapid Prototyping with TurboGears2
Rapid Prototyping with TurboGears2Alessandro Molina
 
Taming the Legacy Beast: Turning wild old code into a sleak new thoroughbread.
Taming the Legacy Beast: Turning wild old code into a sleak new thoroughbread.Taming the Legacy Beast: Turning wild old code into a sleak new thoroughbread.
Taming the Legacy Beast: Turning wild old code into a sleak new thoroughbread.Chris Laning
 
Graph processing at scale using spark &amp; graph frames
Graph processing at scale using spark &amp; graph framesGraph processing at scale using spark &amp; graph frames
Graph processing at scale using spark &amp; graph framesRon Barabash
 
Everything You Need To Know About AngularJS
Everything You Need To Know About AngularJSEverything You Need To Know About AngularJS
Everything You Need To Know About AngularJSSina Mirhejazi
 
Angular.js for beginners
Angular.js for beginners Angular.js for beginners
Angular.js for beginners Basia Madej
 
Turbogears2 tutorial to create mvc app
Turbogears2 tutorial to create mvc appTurbogears2 tutorial to create mvc app
Turbogears2 tutorial to create mvc appfRui Apps
 
From Back to Front: Rails To React Family
From Back to Front: Rails To React FamilyFrom Back to Front: Rails To React Family
From Back to Front: Rails To React FamilyKhor SoonHin
 
Guvnor presentation jervis liu
Guvnor presentation jervis liuGuvnor presentation jervis liu
Guvnor presentation jervis liujbossug
 
Tech Talk - Overview of Dash framework for building dashboards
Tech Talk - Overview of Dash framework for building dashboardsTech Talk - Overview of Dash framework for building dashboards
Tech Talk - Overview of Dash framework for building dashboardsAppsilon Data Science
 
How to increase the ui performance of apps designed using react
How to increase the ui performance of apps designed using react How to increase the ui performance of apps designed using react
How to increase the ui performance of apps designed using react MoonTechnolabsPvtLtd
 
Hypermedia APIs from Event-Driven CQRS Systems
Hypermedia APIs from Event-Driven CQRS SystemsHypermedia APIs from Event-Driven CQRS Systems
Hypermedia APIs from Event-Driven CQRS SystemsMatt Bishop
 
GDSC NITS Presents Kickstart into ReactJS
GDSC NITS Presents Kickstart into ReactJSGDSC NITS Presents Kickstart into ReactJS
GDSC NITS Presents Kickstart into ReactJSPratik Majumdar
 
Raising ux bar with offline first design
Raising ux bar with offline first designRaising ux bar with offline first design
Raising ux bar with offline first designKyrylo Reznykov
 
Lagom : Reactive microservice framework
Lagom : Reactive microservice frameworkLagom : Reactive microservice framework
Lagom : Reactive microservice frameworkFabrice Sznajderman
 
EuroPython 2013 - FAST, DOCUMENTED AND RELIABLE JSON BASED WEBSERVICES WITH P...
EuroPython 2013 - FAST, DOCUMENTED AND RELIABLE JSON BASED WEBSERVICES WITH P...EuroPython 2013 - FAST, DOCUMENTED AND RELIABLE JSON BASED WEBSERVICES WITH P...
EuroPython 2013 - FAST, DOCUMENTED AND RELIABLE JSON BASED WEBSERVICES WITH P...Alessandro Molina
 

Similar to JS Fest 2018. Anna Herlihy. How to Write a Compass Plugin (20)

Fundamental concepts of react js
Fundamental concepts of react jsFundamental concepts of react js
Fundamental concepts of react js
 
Rapid Prototyping with TurboGears2
Rapid Prototyping with TurboGears2Rapid Prototyping with TurboGears2
Rapid Prototyping with TurboGears2
 
Taming the Legacy Beast: Turning wild old code into a sleak new thoroughbread.
Taming the Legacy Beast: Turning wild old code into a sleak new thoroughbread.Taming the Legacy Beast: Turning wild old code into a sleak new thoroughbread.
Taming the Legacy Beast: Turning wild old code into a sleak new thoroughbread.
 
Graph processing at scale using spark &amp; graph frames
Graph processing at scale using spark &amp; graph framesGraph processing at scale using spark &amp; graph frames
Graph processing at scale using spark &amp; graph frames
 
Everything You Need To Know About AngularJS
Everything You Need To Know About AngularJSEverything You Need To Know About AngularJS
Everything You Need To Know About AngularJS
 
Angular.js for beginners
Angular.js for beginners Angular.js for beginners
Angular.js for beginners
 
Turbogears2 tutorial to create mvc app
Turbogears2 tutorial to create mvc appTurbogears2 tutorial to create mvc app
Turbogears2 tutorial to create mvc app
 
20120308 droid4me-paug presentation
20120308 droid4me-paug presentation20120308 droid4me-paug presentation
20120308 droid4me-paug presentation
 
From Back to Front: Rails To React Family
From Back to Front: Rails To React FamilyFrom Back to Front: Rails To React Family
From Back to Front: Rails To React Family
 
Guvnor presentation jervis liu
Guvnor presentation jervis liuGuvnor presentation jervis liu
Guvnor presentation jervis liu
 
Tech Talk - Overview of Dash framework for building dashboards
Tech Talk - Overview of Dash framework for building dashboardsTech Talk - Overview of Dash framework for building dashboards
Tech Talk - Overview of Dash framework for building dashboards
 
Redux workshop
Redux workshopRedux workshop
Redux workshop
 
How to increase the ui performance of apps designed using react
How to increase the ui performance of apps designed using react How to increase the ui performance of apps designed using react
How to increase the ui performance of apps designed using react
 
Hypermedia APIs from Event-Driven CQRS Systems
Hypermedia APIs from Event-Driven CQRS SystemsHypermedia APIs from Event-Driven CQRS Systems
Hypermedia APIs from Event-Driven CQRS Systems
 
GDSC NITS Presents Kickstart into ReactJS
GDSC NITS Presents Kickstart into ReactJSGDSC NITS Presents Kickstart into ReactJS
GDSC NITS Presents Kickstart into ReactJS
 
Raising ux bar with offline first design
Raising ux bar with offline first designRaising ux bar with offline first design
Raising ux bar with offline first design
 
Lagom : Reactive microservice framework
Lagom : Reactive microservice frameworkLagom : Reactive microservice framework
Lagom : Reactive microservice framework
 
EuroPython 2013 - FAST, DOCUMENTED AND RELIABLE JSON BASED WEBSERVICES WITH P...
EuroPython 2013 - FAST, DOCUMENTED AND RELIABLE JSON BASED WEBSERVICES WITH P...EuroPython 2013 - FAST, DOCUMENTED AND RELIABLE JSON BASED WEBSERVICES WITH P...
EuroPython 2013 - FAST, DOCUMENTED AND RELIABLE JSON BASED WEBSERVICES WITH P...
 
Web dynpro
Web dynproWeb dynpro
Web dynpro
 
AngularJS Workshop
AngularJS WorkshopAngularJS Workshop
AngularJS Workshop
 

More from JSFestUA

JS Fest 2019/Autumn. Роман Савіцький. Webcomponents & lit-element in production
JS Fest 2019/Autumn. Роман Савіцький. Webcomponents & lit-element in productionJS Fest 2019/Autumn. Роман Савіцький. Webcomponents & lit-element in production
JS Fest 2019/Autumn. Роман Савіцький. Webcomponents & lit-element in productionJSFestUA
 
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript PerformanceJS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript PerformanceJSFestUA
 
JS Fest 2019/Autumn. Alexandre Gomes. Embrace the "react fatigue"
JS Fest 2019/Autumn. Alexandre Gomes. Embrace the "react fatigue"JS Fest 2019/Autumn. Alexandre Gomes. Embrace the "react fatigue"
JS Fest 2019/Autumn. Alexandre Gomes. Embrace the "react fatigue"JSFestUA
 
JS Fest 2019/Autumn. Anton Cherednikov. Choreographic or orchestral architect...
JS Fest 2019/Autumn. Anton Cherednikov. Choreographic or orchestral architect...JS Fest 2019/Autumn. Anton Cherednikov. Choreographic or orchestral architect...
JS Fest 2019/Autumn. Anton Cherednikov. Choreographic or orchestral architect...JSFestUA
 
JS Fest 2019/Autumn. Adam Leos. So why do you need to know Algorithms and Dat...
JS Fest 2019/Autumn. Adam Leos. So why do you need to know Algorithms and Dat...JS Fest 2019/Autumn. Adam Leos. So why do you need to know Algorithms and Dat...
JS Fest 2019/Autumn. Adam Leos. So why do you need to know Algorithms and Dat...JSFestUA
 
JS Fest 2019/Autumn. Marko Letic. Saving the world with JavaScript: A Data Vi...
JS Fest 2019/Autumn. Marko Letic. Saving the world with JavaScript: A Data Vi...JS Fest 2019/Autumn. Marko Letic. Saving the world with JavaScript: A Data Vi...
JS Fest 2019/Autumn. Marko Letic. Saving the world with JavaScript: A Data Vi...JSFestUA
 
JS Fest 2019/Autumn. Александр Товмач. JAMstack
JS Fest 2019/Autumn. Александр Товмач. JAMstackJS Fest 2019/Autumn. Александр Товмач. JAMstack
JS Fest 2019/Autumn. Александр Товмач. JAMstackJSFestUA
 
JS Fest 2019/Autumn. Дмитрий Жарков. Blockchainize your SPA or Integrate Java...
JS Fest 2019/Autumn. Дмитрий Жарков. Blockchainize your SPA or Integrate Java...JS Fest 2019/Autumn. Дмитрий Жарков. Blockchainize your SPA or Integrate Java...
JS Fest 2019/Autumn. Дмитрий Жарков. Blockchainize your SPA or Integrate Java...JSFestUA
 
JS Fest 2019/Autumn. Maciej Treder. Angular Schematics - Develop for developers
JS Fest 2019/Autumn. Maciej Treder. Angular Schematics - Develop for developersJS Fest 2019/Autumn. Maciej Treder. Angular Schematics - Develop for developers
JS Fest 2019/Autumn. Maciej Treder. Angular Schematics - Develop for developersJSFestUA
 
JS Fest 2019/Autumn. Kyle Boss. A Tinder Love Story: Create a Wordpress Blog ...
JS Fest 2019/Autumn. Kyle Boss. A Tinder Love Story: Create a Wordpress Blog ...JS Fest 2019/Autumn. Kyle Boss. A Tinder Love Story: Create a Wordpress Blog ...
JS Fest 2019/Autumn. Kyle Boss. A Tinder Love Story: Create a Wordpress Blog ...JSFestUA
 
JS Fest 2019/Autumn. Андрей Старовойт. Зачем нужен тип "true" в TypeScript?
JS Fest 2019/Autumn. Андрей Старовойт. Зачем нужен тип "true" в TypeScript?JS Fest 2019/Autumn. Андрей Старовойт. Зачем нужен тип "true" в TypeScript?
JS Fest 2019/Autumn. Андрей Старовойт. Зачем нужен тип "true" в TypeScript?JSFestUA
 
JS Fest 2019/Autumn. Eyal Eizenberg. Tipping the Scale
JS Fest 2019/Autumn. Eyal Eizenberg. Tipping the ScaleJS Fest 2019/Autumn. Eyal Eizenberg. Tipping the Scale
JS Fest 2019/Autumn. Eyal Eizenberg. Tipping the ScaleJSFestUA
 
JS Fest 2019/Autumn. Sota Ohara. Сreate own server less CMS from scratch
JS Fest 2019/Autumn. Sota Ohara. Сreate own server less CMS from scratchJS Fest 2019/Autumn. Sota Ohara. Сreate own server less CMS from scratch
JS Fest 2019/Autumn. Sota Ohara. Сreate own server less CMS from scratchJSFestUA
 
JS Fest 2019/Autumn. Джордж Евтушенко. Как стать программистом, которого хотят
JS Fest 2019/Autumn. Джордж Евтушенко. Как стать программистом, которого хотятJS Fest 2019/Autumn. Джордж Евтушенко. Как стать программистом, которого хотят
JS Fest 2019/Autumn. Джордж Евтушенко. Как стать программистом, которого хотятJSFestUA
 
JS Fest 2019/Autumn. Алексей Орленко. Node.js N-API for Rust
JS Fest 2019/Autumn. Алексей Орленко. Node.js N-API for RustJS Fest 2019/Autumn. Алексей Орленко. Node.js N-API for Rust
JS Fest 2019/Autumn. Алексей Орленко. Node.js N-API for RustJSFestUA
 
JS Fest 2019/Autumn. Daniel Ostrovsky. Falling in love with decorators ES6/Ty...
JS Fest 2019/Autumn. Daniel Ostrovsky. Falling in love with decorators ES6/Ty...JS Fest 2019/Autumn. Daniel Ostrovsky. Falling in love with decorators ES6/Ty...
JS Fest 2019/Autumn. Daniel Ostrovsky. Falling in love with decorators ES6/Ty...JSFestUA
 
JS Fest 2019/Autumn. Андрей Андрийко. Гексагональна архітектура в Nodejs проекті
JS Fest 2019/Autumn. Андрей Андрийко. Гексагональна архітектура в Nodejs проектіJS Fest 2019/Autumn. Андрей Андрийко. Гексагональна архітектура в Nodejs проекті
JS Fest 2019/Autumn. Андрей Андрийко. Гексагональна архітектура в Nodejs проектіJSFestUA
 
JS Fest 2019/Autumn. Борис Могила. Svelte. Почему нам не нужно run-time ядро
JS Fest 2019/Autumn. Борис Могила. Svelte. Почему нам не нужно run-time ядроJS Fest 2019/Autumn. Борис Могила. Svelte. Почему нам не нужно run-time ядро
JS Fest 2019/Autumn. Борис Могила. Svelte. Почему нам не нужно run-time ядроJSFestUA
 
JS Fest 2019/Autumn. Виталий Кухар. Сравнение кластеризации HTTP, TCP и UDP н...
JS Fest 2019/Autumn. Виталий Кухар. Сравнение кластеризации HTTP, TCP и UDP н...JS Fest 2019/Autumn. Виталий Кухар. Сравнение кластеризации HTTP, TCP и UDP н...
JS Fest 2019/Autumn. Виталий Кухар. Сравнение кластеризации HTTP, TCP и UDP н...JSFestUA
 
JS Fest 2019. Виктор Турский. 6 способов взломать твое JavaScript приложение
JS Fest 2019. Виктор Турский. 6 способов взломать твое JavaScript приложениеJS Fest 2019. Виктор Турский. 6 способов взломать твое JavaScript приложение
JS Fest 2019. Виктор Турский. 6 способов взломать твое JavaScript приложениеJSFestUA
 

More from JSFestUA (20)

JS Fest 2019/Autumn. Роман Савіцький. Webcomponents & lit-element in production
JS Fest 2019/Autumn. Роман Савіцький. Webcomponents & lit-element in productionJS Fest 2019/Autumn. Роман Савіцький. Webcomponents & lit-element in production
JS Fest 2019/Autumn. Роман Савіцький. Webcomponents & lit-element in production
 
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript PerformanceJS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
 
JS Fest 2019/Autumn. Alexandre Gomes. Embrace the "react fatigue"
JS Fest 2019/Autumn. Alexandre Gomes. Embrace the "react fatigue"JS Fest 2019/Autumn. Alexandre Gomes. Embrace the "react fatigue"
JS Fest 2019/Autumn. Alexandre Gomes. Embrace the "react fatigue"
 
JS Fest 2019/Autumn. Anton Cherednikov. Choreographic or orchestral architect...
JS Fest 2019/Autumn. Anton Cherednikov. Choreographic or orchestral architect...JS Fest 2019/Autumn. Anton Cherednikov. Choreographic or orchestral architect...
JS Fest 2019/Autumn. Anton Cherednikov. Choreographic or orchestral architect...
 
JS Fest 2019/Autumn. Adam Leos. So why do you need to know Algorithms and Dat...
JS Fest 2019/Autumn. Adam Leos. So why do you need to know Algorithms and Dat...JS Fest 2019/Autumn. Adam Leos. So why do you need to know Algorithms and Dat...
JS Fest 2019/Autumn. Adam Leos. So why do you need to know Algorithms and Dat...
 
JS Fest 2019/Autumn. Marko Letic. Saving the world with JavaScript: A Data Vi...
JS Fest 2019/Autumn. Marko Letic. Saving the world with JavaScript: A Data Vi...JS Fest 2019/Autumn. Marko Letic. Saving the world with JavaScript: A Data Vi...
JS Fest 2019/Autumn. Marko Letic. Saving the world with JavaScript: A Data Vi...
 
JS Fest 2019/Autumn. Александр Товмач. JAMstack
JS Fest 2019/Autumn. Александр Товмач. JAMstackJS Fest 2019/Autumn. Александр Товмач. JAMstack
JS Fest 2019/Autumn. Александр Товмач. JAMstack
 
JS Fest 2019/Autumn. Дмитрий Жарков. Blockchainize your SPA or Integrate Java...
JS Fest 2019/Autumn. Дмитрий Жарков. Blockchainize your SPA or Integrate Java...JS Fest 2019/Autumn. Дмитрий Жарков. Blockchainize your SPA or Integrate Java...
JS Fest 2019/Autumn. Дмитрий Жарков. Blockchainize your SPA or Integrate Java...
 
JS Fest 2019/Autumn. Maciej Treder. Angular Schematics - Develop for developers
JS Fest 2019/Autumn. Maciej Treder. Angular Schematics - Develop for developersJS Fest 2019/Autumn. Maciej Treder. Angular Schematics - Develop for developers
JS Fest 2019/Autumn. Maciej Treder. Angular Schematics - Develop for developers
 
JS Fest 2019/Autumn. Kyle Boss. A Tinder Love Story: Create a Wordpress Blog ...
JS Fest 2019/Autumn. Kyle Boss. A Tinder Love Story: Create a Wordpress Blog ...JS Fest 2019/Autumn. Kyle Boss. A Tinder Love Story: Create a Wordpress Blog ...
JS Fest 2019/Autumn. Kyle Boss. A Tinder Love Story: Create a Wordpress Blog ...
 
JS Fest 2019/Autumn. Андрей Старовойт. Зачем нужен тип "true" в TypeScript?
JS Fest 2019/Autumn. Андрей Старовойт. Зачем нужен тип "true" в TypeScript?JS Fest 2019/Autumn. Андрей Старовойт. Зачем нужен тип "true" в TypeScript?
JS Fest 2019/Autumn. Андрей Старовойт. Зачем нужен тип "true" в TypeScript?
 
JS Fest 2019/Autumn. Eyal Eizenberg. Tipping the Scale
JS Fest 2019/Autumn. Eyal Eizenberg. Tipping the ScaleJS Fest 2019/Autumn. Eyal Eizenberg. Tipping the Scale
JS Fest 2019/Autumn. Eyal Eizenberg. Tipping the Scale
 
JS Fest 2019/Autumn. Sota Ohara. Сreate own server less CMS from scratch
JS Fest 2019/Autumn. Sota Ohara. Сreate own server less CMS from scratchJS Fest 2019/Autumn. Sota Ohara. Сreate own server less CMS from scratch
JS Fest 2019/Autumn. Sota Ohara. Сreate own server less CMS from scratch
 
JS Fest 2019/Autumn. Джордж Евтушенко. Как стать программистом, которого хотят
JS Fest 2019/Autumn. Джордж Евтушенко. Как стать программистом, которого хотятJS Fest 2019/Autumn. Джордж Евтушенко. Как стать программистом, которого хотят
JS Fest 2019/Autumn. Джордж Евтушенко. Как стать программистом, которого хотят
 
JS Fest 2019/Autumn. Алексей Орленко. Node.js N-API for Rust
JS Fest 2019/Autumn. Алексей Орленко. Node.js N-API for RustJS Fest 2019/Autumn. Алексей Орленко. Node.js N-API for Rust
JS Fest 2019/Autumn. Алексей Орленко. Node.js N-API for Rust
 
JS Fest 2019/Autumn. Daniel Ostrovsky. Falling in love with decorators ES6/Ty...
JS Fest 2019/Autumn. Daniel Ostrovsky. Falling in love with decorators ES6/Ty...JS Fest 2019/Autumn. Daniel Ostrovsky. Falling in love with decorators ES6/Ty...
JS Fest 2019/Autumn. Daniel Ostrovsky. Falling in love with decorators ES6/Ty...
 
JS Fest 2019/Autumn. Андрей Андрийко. Гексагональна архітектура в Nodejs проекті
JS Fest 2019/Autumn. Андрей Андрийко. Гексагональна архітектура в Nodejs проектіJS Fest 2019/Autumn. Андрей Андрийко. Гексагональна архітектура в Nodejs проекті
JS Fest 2019/Autumn. Андрей Андрийко. Гексагональна архітектура в Nodejs проекті
 
JS Fest 2019/Autumn. Борис Могила. Svelte. Почему нам не нужно run-time ядро
JS Fest 2019/Autumn. Борис Могила. Svelte. Почему нам не нужно run-time ядроJS Fest 2019/Autumn. Борис Могила. Svelte. Почему нам не нужно run-time ядро
JS Fest 2019/Autumn. Борис Могила. Svelte. Почему нам не нужно run-time ядро
 
JS Fest 2019/Autumn. Виталий Кухар. Сравнение кластеризации HTTP, TCP и UDP н...
JS Fest 2019/Autumn. Виталий Кухар. Сравнение кластеризации HTTP, TCP и UDP н...JS Fest 2019/Autumn. Виталий Кухар. Сравнение кластеризации HTTP, TCP и UDP н...
JS Fest 2019/Autumn. Виталий Кухар. Сравнение кластеризации HTTP, TCP и UDP н...
 
JS Fest 2019. Виктор Турский. 6 способов взломать твое JavaScript приложение
JS Fest 2019. Виктор Турский. 6 способов взломать твое JavaScript приложениеJS Fest 2019. Виктор Турский. 6 способов взломать твое JavaScript приложение
JS Fest 2019. Виктор Турский. 6 способов взломать твое JavaScript приложение
 

Recently uploaded

ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationRosabel UA
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsManeerUddin
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptshraddhaparab530
 

Recently uploaded (20)

ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translation
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture hons
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.ppt
 

JS Fest 2018. Anna Herlihy. How to Write a Compass Plugin

  • 1. From Back-end to Front-end
  • 2. Kiev 2018MongoDB Compass Plugins 1. Compass Feature Tour 2. Where can my plugin fit into Compass? 3. How can my plugin fit into Compass? 4. Example
  • 3. Kiev 2018MongoDB Compass Plugins Feature Tour
  • 4. Kiev 2018MongoDB Compass Plugins Why write a plugin? ● Limitless potential: Customized charts, specific DB commands, show cluster health, and more... ● Can solve your specific problems. Plugins can be as personalized as you like. ● Can use plugins to share views, tools, or debug ● It is fun and easy!
  • 5. Kiev 2018MongoDB Compass Plugins Where does my plugin fit visually into Compass?
  • 6. Kiev 2018MongoDB Compass Plugins 1. Header.Item 2. Instance.Tab 3. Database.Tab 4. Collection.Tab 5. CollectionHUD.item (Heads Up Display) Plugin Roles
  • 7. Kiev 2018MongoDB Compass Plugins Database.Tab ● Purpose: ○ Large database-level feature. Right now we just have a list of collections. ● Potential Plugins: ○ System.profile Charts ○ List all users
  • 8.
  • 9. Kiev 2018MongoDB Compass Plugins Header.Item ● Purpose: ○ Top-level: display global information (e.g. MongoDB version, topology) ● UI Considerations: ○ Header space is very small ○ Lengthy information should be hidden until asked for ● Potential Plugins: ○ Current user information
  • 10.
  • 11. Kiev 2018MongoDB Compass Plugins Instance.Tab ● Purpose: ○ Large instance-level features (e.g. real time server stats). Currently have “Databases” and “Performance”. ● Potential Plugins: ○ Cluster Health ○ List of All Users
  • 12.
  • 13.
  • 14. Kiev 2018MongoDB Compass Plugins Collection.Tab ● Purpose: ○ Large collection-level features (e.g. CRUD, Explain Plan, or schema analysis) ● Potential Plugin: ○ Object size histogram of schema sample
  • 15.
  • 16. Kiev 2018MongoDB Compass Plugins CollectionHUD.Item ● Purpose: ○ Display statistical information relevant to a collection ● UI Considerations: ○ Should not distract users from the main content of the collection body ○ Should be text-based ● Potential Plugin: ○ Mongotop / server statistics
  • 17. Kiev 2018MongoDB Compass Plugins What makes up a plugin? Compass and any plugins are React applications.
  • 18. Kiev 2018MongoDB Compass Plugins React React is a framework made up of Stores, Components, and Actions. ● Stores are “smart”, they keep track of state information and pass it to the Components. ● Components are “dumb”, they just receive data from the store and render it. ● Actions are how components communicate with the store to trigger changes.
  • 19. Kiev 2018MongoDB Compass Plugins Actions ● Events triggered when a user performs an action. ● Can be button clicks, link clicks, text entry, etc. ● Actions are sent from Components and listened to by Stores.
  • 20. Kiev 2018MongoDB Compass Plugins Components ● Components make up the User Interface. ● This is where you use JSX to define what the plugin should look like. ● Styles are imported from a local .less file with the same name as the component.
  • 21. Kiev 2018MongoDB Compass Plugins Stores ● Reflux/Redux Stores that hold the application state. ● Each plugin can listen to other stores/have its state changes listened to by others. ● Flow of data: ○ Actions should be listened to by stores ○ Stores should be subscribed to by components
  • 22. Kiev 2018MongoDB Compass Plugins The AppRegistry ● Holds all Compass + plugin actions, components, and stores ○ All plugins must register with the AppRegistry. ● Information flows from Compass to plugins and back through the AppRegistry. ● It is available to all Plugins globally by calling global.hadronApp.appRegistry.
  • 23. Kiev 2018MongoDB Compass Plugins Lifecycle Hooks How do Compass and my plugin become aware of each other?
  • 24. Kiev 2018MongoDB Compass Plugins activate(): Tell Compass about the plugin ● Compass will look in the plugins directory. ○ ~/.mongodb/compass/plugins on OSX ● It will call the activate method in the root index.js. ● The plugin should register its actions, components, and stores with the AppRegistry in this method. ● This is where you specify what role you want your plugin to occupy.
  • 26. Kiev 2018MongoDB Compass Plugins onActivated(appReg): Tell plugin about Compass ● When all plugin registration is completed, the onActivated method is called on any registered store. ● In this method, the plugin can get and listen to any stores in Compass or another plugin. ● Guarantees everything has been registered before any plugin tries to get anything from the registry.
  • 28. Kiev 2018MongoDB Compass Plugins The AppRegistry will emit events ● data-service-connected ● collection-changed ● database-changed ● query-changed … or any other events you want to add!
  • 29. Kiev 2018MongoDB Compass Plugins My First Compass Plugin
  • 30. Kiev 2018MongoDB Compass Plugins Who is the current user? ● Since it’s global to the Compass instance, it can take the role Header.Item ● The connectionStatus DB command lists authenticated users and their roles.
  • 31.
  • 34. Kiev 2018MongoDB Compass Plugins Step 0: Get the Template
  • 35. Kiev 2018MongoDB Compass Plugins ~/.mongodb/compass/plugins $ > npm install -g khaos > khaos create mongodb-js/compass-plugin ./whoami > git init && git add . && git commit -m “init” > npm install
  • 36.
  • 40. Kiev 2018MongoDB Compass Plugins Step 1: The Store
  • 41. Kiev 2018MongoDB Compass Plugins src/stores/store.js: ● We set the initial state to empty. ● onActivated: when the DataService is connected, we want to run the connectionStatus command. ● When the command returns, we set the state to the results.
  • 42. Kiev 2018MongoDB Compass Plugins appRegistry.on('data-service-connected', (error, dataService) => { if (!error) { dataService.command( 'admin', {connectionStatus : 1}, (err, res) => { if (!err && res.authInfo && res.authInfo.authenticatedUsers) { this.setState({ user: res.authInfo.authenticatedUsers[0].user, role: res.authInfo.authenticatedUserRoles[0].role }) } else { this.setState({user: null, role: null}); } } ); } }); getInitialState() { return { user: null, role: null }; } Call DB command on activationInitialize State
  • 43. Kiev 2018MongoDB Compass Plugins Step 2: The Component
  • 44. Kiev 2018MongoDB Compass Plugins src/components/whoami/whoami.jsx ● The store state will be passed to the component as this.props.user and this.props.role ● Component must render the username and role ● If not provided, render “no user”
  • 45. Kiev 2018MongoDB Compass Plugins static propTypes = { user: PropTypes.string.isRequired, role: PropTypes.string.isRequired }; static defaultProps = { user: null, role: null }; render() { if (!this.props.user) { return ( <div className={classnames(styles.root)}> <FontAwesome name="user-times"/> No User </div> ); } return ( <div className={classnames(styles.root)}> <FontAwesome name="user"/> <i> {this.props.user}:{this.props.role}</i> </div> ); } Define and Set Default Props Render Props
  • 46. Kiev 2018MongoDB Compass Plugins Step 3: The Actions (not used in this plugin)
  • 47. Kiev 2018MongoDB Compass Plugins Step 4: Styles
  • 48. Kiev 2018MongoDB Compass Plugins src/components/whoami/whoami.less ● Every component has a .less file with the same name located in the same directory ● In this case just want to remove the colors. .root { background: #0e83cd; color: @pw; padding: 2.4rem; }
  • 49. Kiev 2018MongoDB Compass Plugins Run It Standalone!
  • 51. Kiev 2018MongoDB Compass Plugins Run Compass!
  • 53. Kiev 2018MongoDB Compass Plugins Writing a Plugin is Easy! ● We are here to help! ○ Email team-compass@mongodb.com ● All plugin documentation: ○ https://docs.mongodb.com/compass/master/plugin s/creating-compass-plugins ● The “whoami” plugin + these slides are on GitHub ○ https://github.com/aherlihy/compass-plugins-talk
  • 54. Kiev 2018MongoDB Compass Plugins Security Restrictions ● Accessing network resources over any protocol outside of the DB connection. This includes network access via NodeJS or DOM APIs such as XMLHttpRequest. ● Accessing the filesystem outside of DOM APIs such as IndexedDB. ● Spawning child processes.
  • 55. Kiev 2018MongoDB Compass Plugins Future Plans ● We encourage everyone to share their plugins! ● MongoDB can provide marketing and support ● When there are enough plugins there will be a plugin marketplace ● Until then, MongoDB can list the plugins the same way we list community drivers
  • 57. THANKS FOR COMING! Anna Herlihy anna@mongodb.com @annaisworking