
Product
Introducing Module Reachability: Focus on the Vulnerabilities That Matter
Module Reachability filters out unreachable CVEs so you can focus on vulnerabilities that actually matter to your application.
@commercetools-frontend/application-shell
Advanced tools
React component to bootstrap the general MC application logic
@commercetools-frontend/application-shell
This module contains the main React component <ApplicationShell>
for
building MC applications.
It also provides a set of complementary components to provide additional features to the application.
$ npm install --save @commercetools-frontend/application-shell
/**
* This is the entry point of an application.
* See `@commercetools-frontend/application-shell` for usage.
*/
import React from 'react';
import { Provider as StoreProvider } from 'react-redux';
import ApplicationShell, {
reduxStore,
setupGlobalErrorListener,
} from '@commercetools-frontend/application-shell';
import { Sdk } from '@commercetools-frontend/sdk';
import * as globalActions from '@commercetools-frontend/actions-global';
import PageNotFound from '@commercetools-local/core/components/page-not-found';
import * as i18n from '@commercetools-frontend/i18n';
import trackingEventWhitelist from './tracking-whitelist';
// Ensure to setup the global error listener before any React component renders
// in order to catch possible errors on rendering/mounting.
setupGlobalErrorListener(reduxStore.dispatch);
const EntryPoint = () => (
<StoreProvider store={reduxStore}>
<ApplicationShell
i18n={i18n}
configuration={window.app}
trackingEventWhitelist={trackingEventWhitelist}
onRegisterErrorListeners={() => {
Sdk.Get.errorHandler = error =>
handleActionError(error, 'sdk')(reduxStore.dispatch);
}}
render={() => (
<Switch>
<Route path="/:projectKey/dashboard" component={AsyncDashboard} />
<Route path="/:projectKey/products" component={AsyncProducts} />
{/* Define a catch-all route */}
<Route component={PageNotFound} />
</Switch>
)}
/>
</StoreProvider>
);
EntryPoint.displayName = 'EntryPoint';
ReactDOM.render(<EntryPoint />, document.getElementById('root'));
Props | Type | Required | Default | Description |
---|---|---|---|---|
i18n | object | ✅ | - | An object containing all the translated messages per locale ({ "en": { "Welcome": "Welcome" }, "de": { "Welcome": "Wilkommen" }} ). |
configuration | object | ✅ | - | The current window.app . |
render | func | ✅ | - | The function to render the application specific part. This function is executed only when the application specific part needs to be rendered. |
trackingEventWhitelist | object | ✅ | - | An object containing a map of tracking events (this mapping is required for backwards compatibility, it might be removed in the future) |
onRegisterErrorListeners | func | ✅ | - | A callback function to setup global event listeners, called when the ApplicationShell is mounted |
FAQs
React component to bootstrap the general MC application logic
The npm package @commercetools-frontend/application-shell receives a total of 1,865 weekly downloads. As such, @commercetools-frontend/application-shell popularity was classified as popular.
We found that @commercetools-frontend/application-shell demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers 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.
Product
Module Reachability filters out unreachable CVEs so you can focus on vulnerabilities that actually matter to your application.
Company News
Socket is bringing best-in-class reachability analysis into the platform — cutting false positives, accelerating triage, and cementing our place as the leader in software supply chain security.
Product
Socket is introducing a new way to organize repositories and apply repository-specific security policies.