Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
@coder/backstage-plugin-devcontainers-react
Advanced tools
Automatically launch fully-contained dev environments with Development Containers, right from Backstage!
Automatically launch fully-contained dev environments with development containers (dev containers), right from Backstage!
Note: While this plugin can be used standalone, it has been designed to be a frontend companion to backstage-plugin-devcontainers-backend
.
This section will walk you through adding the plugin to your Backstage deployment.
Ensure that you have the following ready to go:
devcontainers.json
file. VS Code has a quick-start guide for adding Dev Containers to a repoNote: While this plugin has been developed and published by Coder, no Coder installations are required.
From your Backstage deployment's directory, run the following command:
yarn --cwd packages/app add @coder/backstage-plugin-devcontainers-react
Navigate to the app
directory's EntityPage.tsx
file
Add the DevcontainersProvider
component, as well as any inputs:
// This example modifies the EntityPage.tsx file provided by the
// Backstage scaffolder
import {
type DevcontainersConfig,
DevcontainersProvider,
} from '@coder/backstage-plugin-devcontainers-react';
// The value of tagName must match the tag value that
// backstage-plugin-devcontainers-backend is configured with
const devcontainersConfig: DevcontainersConfig = {
tagName: 'devcontainers',
};
// Example usage - you can place the component in other page
// views as well
const overviewContent = (
<Grid container spacing={3} alignItems="stretch">
{entityWarningContent}
<Grid item md={6} xs={12}>
<DevcontainersProvider config={devcontainersConfig}>
{/* Other content that uses Dev Containers goes here */}
</DevcontainersProvider>
</Grid>
{/* Other grid content omitted */}
</Grid>
);
If you are trying out the Dev Containers functionality, we provide a pre-made ExampleDevcontainersComponent
. You can include it like so:
// Update imports
import {
type DevcontainersConfig,
DevcontainersProvider,
ExampleDevcontainersComponent,
} from '@coder/backstage-plugin-devcontainers-react';
// The value of tagName must match the tag value that
// backstage-plugin-devcontainers-backend is configured with
const devcontainersConfig: DevcontainersConfig = {
tagName: 'devcontainers',
};
// Example usage - you can place the component in other page
// views as well
const overviewContent = (
<Grid container spacing={3} alignItems="stretch">
{entityWarningContent}
<Grid item md={6} xs={12}>
<DevcontainersProvider config={devcontainersConfig}>
<ExampleDevcontainersComponent />
</DevcontainersProvider>
</Grid>
{/* Other grid content omitted */}
</Grid>
);
If you are looking to create your own components, you can import the useDevcontainers
custom hook.
// Inside your custom component's file
import React from 'react';
import { useDevcontainers } from '@coder/backstage-plugin-devcontainers-react';
export const YourComponent = () => {
const state = useDevcontainers();
return (
<>
{state.hasUrl ? (
<>
<p>Your entity supports Dev Containers!</p>
<a href={state.vsCodeUrl}>Click here to launch VS Code</a>
</>
) : (
<p>No Dev Containers plugin tag detected</p>
)}
</>
);
};
// Inside EntityPage.tsx
<DevcontainersProvider config={devcontainersConfig}>
<YourComponent />
</DevcontainersProvider>;
When you click a link to open a Dev Container inside VS Code, you will be prompted to install the official VS Code Dev Containers extension if you don't have it already.
Have an idea for what kinds of components you would like to see? Feel free to open an issue and make a feature request!
While this does not directly apply to the React plugin, there are limits around the backend plugin's support of devcontainer.json
files. Please see the backend plugin's README for more information.
Please see the directory for our API references for additional information.
This plugin is part of the Backstage community. We welcome contributions!
FAQs
Automatically launch fully-contained dev environments with Development Containers, right from Backstage!
The npm package @coder/backstage-plugin-devcontainers-react receives a total of 76 weekly downloads. As such, @coder/backstage-plugin-devcontainers-react popularity was classified as not popular.
We found that @coder/backstage-plugin-devcontainers-react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.