Safe Framework (React 15 / Material-UI 0.x era)
The `safe-framework` package, currently at version `0.0.45`, is a JavaScript framework built on a foundational stack from the React 15.x and Material-UI 0.x era. Its core functionality likely revolves around providing UI components and utilities, integrating with older versions of `material-ui` for Google's Material Design principles and `react-leaflet` for map-based interfaces. Key peer dependencies like `react@^15.4.0` (released November 2016), `material-ui@^0.16.5`, and the now-deprecated `react-tap-event-plugin` (deprecated as of React 16.4) firmly place this framework in a significantly older ecosystem. Given its `0.0.x` version and reliance on unmaintained dependencies, this project is considered abandoned, with no ongoing development, bug fixes, or security updates. It is distinct from other projects sharing the 'safe framework' name, such as those related to supply chain security or AI agent frameworks.
Common errors
-
Uncaught Invariant Violation: injectTapEventPlugin(): Can only be called once.
cause `react-tap-event-plugin` is being called multiple times in a React 15 context, or a new React version is being used.fixEnsure `injectTapEventPlugin()` is called exactly once at the entry point of your application. If using React 16+, remove `react-tap-event-plugin` entirely. -
Error: Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.
cause Attempting to render a `safe-framework` or Material-UI v0.x component that is either not correctly imported, or its API has drastically changed in a newer React context.fixVerify all imports are correct and that you are using a React 15 compatible environment. If encountering this in a modern React setup, the components are fundamentally incompatible and require re-implementation. -
Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object.
cause Often seen when mixing CommonJS `require()` with ES module `import` for modules that provide a default export, or trying to use components designed for React 15 in a different React version's context.fixEnsure consistent module import styles (`import` vs `require`). Verify that the component's export type matches the import statement. More broadly, this indicates fundamental incompatibility with current React if trying to use this framework.
Warnings
- breaking This package is incompatible with modern React (v16+) and its ecosystem. React has undergone significant architectural changes, including Context API, Hooks, Concurrent Mode, and changes to event systems, making direct upgrades impossible.
- deprecated All core peer dependencies (React 15.x, Material-UI 0.x, react-tap-event-plugin, Radium) are long deprecated and unmaintained. 'react-tap-event-plugin' is specifically noted as incompatible with React 16.4 and higher.
- breaking The `injectTapEventPlugin()` call, crucial for Material-UI v0.x's touch event handling, causes errors in React 16+ due to changes in React's internal event system.
- gotcha Using unmaintained software with very old dependencies can introduce significant security vulnerabilities, as known exploits in these versions will not be patched. This poses a supply chain risk.
- gotcha The low version number (0.0.45) coupled with the outdated dependencies indicates that this project was likely an internal or experimental framework that never reached maturity or stable release.
Install
-
npm install safe-framework -
yarn add safe-framework -
pnpm add safe-framework
Imports
- App
import { App } from 'safe-framework';import App from 'safe-framework/lib/App';
- SomeMaterialComponent
import { SomeMaterialComponent } from 'material-ui';import { SomeMaterialComponent } from 'safe-framework/lib/material-components'; - MapComponent
import { MapComponent } from 'react-leaflet';import { MapComponent } from 'safe-framework/lib/map';
Quickstart
import React from 'react';
import ReactDOM from 'react-dom';
import injectTapEventPlugin from 'react-tap-event-plugin';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import getMuiTheme from 'material-ui/styles/getMuiTheme';
import { Card, CardText } from 'material-ui/Card';
import RaisedButton from 'material-ui/RaisedButton';
// Required for Material-UI v0.x touch events
injectTapEventPlugin();
const App = () => (
<MuiThemeProvider muiTheme={getMuiTheme()}>
<div style={{ padding: 20 }}>
<h1>Welcome to Safe Framework (Legacy Demo)</h1>
<Card>
<CardText>
This is a demonstration of a basic component setup using
the `safe-framework`'s underlying Material-UI v0.x dependencies.
This example uses React {React.version} and Material-UI {process.env.MATERIAL_UI_VERSION ?? '0.x'}.
</CardText>
</Card>
<RaisedButton label="Click Me" primary={true} style={{ marginTop: 20 }} />
<p style={{ marginTop: 20, fontSize: '0.8em', color: '#666' }}>
Note: This framework is built on very old dependencies and is not maintained.
Modern React and Material-UI versions are incompatible with this setup.
</p>
</div>
</MuiThemeProvider>
);
ReactDOM.render(
<App />,
document.getElementById('root')
);