Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@zengenti/contensis-react-base
Advanced tools
Turbocharge your React web apps with Contensis. This package handles all dependencies for creating full featured web apps in React with Contensis and Site View. Routing is driven by Site View, Redux is used for global state management and server-side rend
Everything you need to get started with React and Contensis.
Handles web app routing with Contensis Site View and component rendering based on a loaded Content Type entry in Contensis, Redux application store creation and all the major application dependencies to get going, with server side rendering and an Express web server.
This version introduces React v17. React is very sensitive to having multiple versions installed at the same time.
Many projects upgrading to v3.0 of contensis-react-base
are likely to be using an older version of Storybook which when installed along with React 17 results in multiple versions of React being installed and resulting in the app not rendering giving a react console error.
You will need to upgrade your version of Storybook to be >= 6.1 which has support for React 17. Further reading
TLDR: Storybook have provided a simple way to upgrade. Run npx sb upgrade
when upgrading to v3.0 of contensis-react-base
. You should also ensure you are running the latest version of webpack or webpack@4 to prevent futher errors when loading Storybook.
If you are still getting react errors after this, check your project for other dependencies to remove/update that rely on older versions of react
The core of your Contensis React application is in package @zengenti/contensis-react-base
this must be installed as a 'production' dependency, i.e. lives in the dependencies
section of your package.json
The package handles things such as:
All of the essential 'boilerplate' code to work on React apps with Contensis is contained in a package that can be controlled and maintained in one place. Allowing us to provide a high quality, standardised and consistent experience for all projects.
The package does not handle things like:
You will have imports available from the following packages:
Default export ZengentiAppServer
which has a .start()
function attached for use when loading the application via the server-side entrypoint
Named export { ReactApp }
provides a ready-made instance of a root <App>
component to provide as the first argument to ZengentiAppServer.start()
All TypeScript models are exported from here and should be imported in your app from the default package @zengenti/contensis-react-base
Default export ClientApp
which is a class when instantiated with new ClientApp
accepts two constructor arguments similar to ZengentiAppServer.start()
except for use when loading the application via the client-side entrypoint
For use when using the newer Content Types and Entries based forms module
Contains a named export of { store }
if you require a handle on the created redux store object anywhere in your app
Named export of { RouteLoader }
which is our primary component responsible for initiating all the routing actions and triggering the specific api calls to Contensis to load all route-derived data into the app's redux store and render the appropriate component for any retrieved content.
For use when using the built-in search package for driving features like site search, listings and minilists in your app. React hooks and Higher order components are exported to wrap your components and inject additional props for handling all the required interactions inside your bespoke components.
For use when interactions are required with Contensis users for example user registration or login. React hooks and Higher order components are exported for common user interactions inside app components.
Some simple utility functions to save repetion of common functions in our app code
ZenInfo
page to show certain build and expose configuration parameters. Something we usually include with every deployed site and served at /zenInfo
route.You should not import files from any other place than the packages / subpackages mentioned in this README. e.g. using imports like @zengenti/contensis-react-base/cjs/client
or @zengenti/contensis-react-base/models/*
is not recommended as it will not provide you with the best build output and they could change in future and would not be reflected in the semantic versioning having the potential to cause problems in future.
Sometimes VSCode may import the reference automatically from an unsupported place. You should check when committing your code that all imports are referenced correctly.
As of v2.5.0 TypeScript declarations are available to use, and will also benefit applications written in JavaScript
All models are exported with the default package @zengenti/contensis-react-base
When importing Types to use in your own TypeScript project, try to always use the root import path e.g. import { ModelName } from '@zengenti/contensis-react-base';
We have switched to using @loadable/components
for our code splitting and to get the best experience, so should you. You will need to swap out the existing react-loadable
Babel and Webpack plugins and then convert your existing react-loadable
code to use their @loadable/components
syntax. Read more here
npm install
- install dependencies so we can get startednpm run build
- build the library bundles that will be published with the packageConventional commit messages are expected.
FAQs
Turbocharge your React web apps with Contensis. This package handles all dependencies for creating full featured web apps in React with Contensis and Site View. Routing is driven by Site View, Redux is used for global state management and server-side rend
The npm package @zengenti/contensis-react-base receives a total of 775 weekly downloads. As such, @zengenti/contensis-react-base popularity was classified as not popular.
We found that @zengenti/contensis-react-base demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.