npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@imi-thenational/apester-composer

v2.0.1

Published

initial Apester composer component

Downloads

1

Readme

Apester Composer Element

How do I use it? This component is intended to be used to setup pages within PB Admin that can be used for custom power-up settings in Composer. To create the needed pages to power the embed, create a wrapper component in your Fusion repo which only imports and returns this package component - ApesterComposerPowerUpIframe. Each setting for iFrame URL should contain the page url, along with a hash #EDIT, #VIEW or #SEARCH. The component will extract these along with the query parameters that composer appends, and serve up the required edit/search/view ui so editors can add a Apester element to an article. No other props are referenced or needed.

Usage

Each setting for iFrame URL should contain the page url, along with a hash #EDIT, #VIEW or #SEARCH For example, if the URI for your page is apester-composer, the 3 Apester urls will be:

  • http://localhost/pf/apester-composer/?_website={arcSite}#SEARCH
  • http://localhost/pf/apester-composer/?_website={arcSite}#VIEW
  • http://localhost/pf/apester-composer/?_website={arcSite}#EDIT

The component will extract the hash key, along with the query parameters that composer appends. It will then serve up the required edit/search/view user interface, in order for editors to add a Apester element to an article.

To test these, you can use this power=up testing tool.

ARC Code Splitting

This components are intended for use with Composer and are not intended to be used on a page consumed by an end reader. Thus, to improve performance, it is recommended that code splitting be leveraged to include this package only when needed. There are two ways to achieve this: Dynamic Loading and Splitting Components across Fusion Output Type Bundles.

Dynamic Loading

Code splitting via dynamic loading is well documented in React's Code-Splitting documentation found here: https://reactjs.org/docs/code-splitting.html

Using React's Suspense and lazy functions, will automatically load the bundle containing the dynamic import when this component is first rendered. In this way, the package will not be included in the mono-bundle but rather dynamically loaded only when it is needed - when the wrapper component is rendered.

Fusion Output Type Bundle

It is also possible to leverage the fusion feature of creating a separate bundle for each output type to achieve code splitting. To achieve code splitting this way, 2 wrapper components would beed to be created in the component feature directory. The default output type bundle would not include this package so one file should be created called 'default.jsx' which would return only null - no component and no package. One other wrapper component would be created but instead of creating that component in a file called 'default.jsx', it would be created in a file with the name of the alternate output type (perhaps 'composer-powerup.jsx'). Another output type file would need to be declared in the component output-type directory which corresponds to the output-type name ('composer-powerup.jsx' in this example). Pages visited under the default output type would get the default.jsx version of this component in the default bundle - null. Pages visited under the component-powerup output type would get hte component-powerup version of this component - the wrapper component returning the ApesterComposerPowerUpIframe. Thus, the composer-powerup output type can be used for composer settings, to serve up ApesterComposerPowerUpIframe but elsewhere when the default output type is used, such as homepages or article pages, null is returned - not the package or its imports.