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

ernnavigation-api

v2.1.0

Published

ERN Generated API for ernnavigation

Downloads

523

Readme

ernnavigation-api

ci

This SDK is automatically generated by Electrode Native API generator.

It uses Swagger to generate bridge code for Android, iOS, and React Native.

Motive

The Electrode Native team wants to make the React Native navigation easier for ERN MiniApps. Currently, there are many navigation frameworks available for React Native in the open source world. Those frameworks work great for a single react native app since there is only one application controlling the entire navigation.

When we talk about MiniApps, we are assuming a modularized structure where you can build multiple MiniApps and run them all inside a native app by being able to communicate to each other easily. Electrode native also emphasise on the fact that it should be possible to build part of an app in native and be able to talk to a MiniApp if needed. In this case the navigation gets trickier as there is no longer a single place/module that controls the navigation or maintains the uniformity of the top/bottom bar, navigation etc between screens. It is also possible with Electrode Native to have a feature built in native to have React Native screens.

All these different use cases have driven us to a new navigation solution that is pre-built inside the container generated by electrode native. This api is a pure interface that will only be functional when an implementation is put in place. Electrode Native during container generation will look for this and api and inject an implementation inside the native container.

Installation

For Node.js

ern

ern add ernnavigation-api

npm

npm install ernnavigation-api

Start developing each page as an independent UI component that can render itself provided it receives all the props passed in inside the initial props. One major difference you will see from a traditional React Native app development to this approach is that, each component needs to be registered with AppRegistry in your index.js file. Find a sample index.js below. Best practice is to append each component with the app name to avoid name collisions when more MiniApps are involved.

import {AppRegistry} from 'react-native';
import Page1 from './Page1';
import Page2 from './Page2';
import PageN from './PageN';
import {name as appName} from './app.json';

AppRegistry.registerComponent(`${appName}`, () => Page1);
AppRegistry.registerComponent(`${appName}_Page2`, () => Page2);
AppRegistry.registerComponent(`${appName}_PageN`, () => PageN);

And to navigate to ${appName}_Page2 the following code can be executed.

import {EnNavigationApi} from 'ernnavigation-api';

EnNavigationApi.requests()
  .navigate({path: `${appName}_Page2`})
  .then(e => {
    console.log('Navigation Succeeded: ', e);
  })
  .catch(e => {
    console.error('Navigation Failed: ', e);
  });

Documentation for API Endpoints

| Method | Description | |-----------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------| | back | Navigates back to a previous route. If the route does not exist, it will be pushed onto the route stack. | | finish | Finishes the route, popping the current route stack from the activities. | | navigate | Navigates to a new route. | | update | Updates the current route. The route path must match the current path. |

Documentation for Models

Contributing

Code in this repository is generated by the ern regen-api command whenever there is a change made to the schema.json file. Please open an issue for any suggestions or improvements that can be made to the api. Also, Feel free to open PR for documentation and code generated using the ern regen-api command.

Native implementation