
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@sitecore-feaas/clientside
Advanced tools
This module renders the component and populates it with data. It also supports efficient update of component for the new data.
This module renders the component and populates it with data. It also supports efficient update of component for the new data.
data
attribute. import FEAASComponent from 'feeas-components-clientside/dist/react';
// provide html template directly
<FEAASComponent template={`<p>Hello <var data-path="user.name" /></p>`} data={{user: {name: "World"}}} />
// fetch component from the cloud
<FEAASComponent component="..." version="..." revision="production" hostname="..." data={{user: {name: "World"}}} />
import * as FEAAS from 'feeas-components-clientside'
// or <script src="//feaas-components.sitecore.cloud/clientside/latest.min.js"></script>
// will define FEAASComponent global variable
// Fetch component from the cloud, returns element immediately
// Use FEAAS.renderComponentPromise to await for fetch request
// Optionally accepts 2nd argument, element to render to
const element = FEAAS.renderComponent({
library: '...',
component: '...',
version: '...',
revision: 'production',
hostname: '...',
data: { user: { name: 'World' } }
})
// inject element into DOM
// will be empty until content is fetched, but will automatically re-render
document.body.appendChild(element)
// update element with new data
FEAAS.renderComponent(
{
data: { user: { name: 'Universe' } }
},
element
)
// ALTERNATIVELY: provide html template directly
const element = FEAAS.renderComponent(
{
template: `<p>Hello <var data-path="user.name" /></p>`,
data: { user: { name: 'World' } }
}
//, element // optionally provide target element here a
)
// inject element into DOM
document.body.appendChild(element)
// update data in the element
FEAAS.renderComponent(
{
data: { user: { name: 'Universe' } }
},
element
)
Components use styele guide, a stylesheet shared per tenant. In short, it has to be included on the page. Stylesheets
are cached with immutable
Cache-Control, meaning that the browser will never attempt to re-fetch them if it was cached
once. That ensures the fastest rendering time on final website. The small price to pay is to use Clientside on the page,
that will invalidate the stylesheet automatically.
Placing stylesheet into HTML is benefitial to get the fasted loading speed. This allow browser to start fetching the css before it has finished loading, parsing and executing js.
<!-- Use id=`feaas-stylesheet` for Clientside to deal with invalidation -->
<link rel='stylesheet' id='feaas-stylesheet' href='https://components.sitecore.cloud/styles/:tenant_id/published.css' />
<!-- Include Clientside on the page OR as npm import inside your own code -->
<script src="//feaas-components.sitecore.cloud/clientside/latest.min.js"></script>
Loading styles from javascript is as simple as calling loadStyles
function. It is safe to use this method together
with HTML inclusion, the stylesheet will not be loaded twice.
import * as FEAAS from 'feeas-components-clientside'
// Load stylesheet (will automatically add it )
FEAAS.loadStyles(':tenant_id')
FAQs
This module renders the component and populates it with data. It also supports efficient update of component for the new data.
The npm package @sitecore-feaas/clientside receives a total of 21,728 weekly downloads. As such, @sitecore-feaas/clientside popularity was classified as popular.
We found that @sitecore-feaas/clientside 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.