Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@sassoftware/create-react-restaf-viya-app
Advanced tools
a cli for creating react+restaf based apps for Viya
create-react-app from Facebook is a very popular cli for jump starting developing react apps.One of its key features is the Hot Module Replacement which recompiles and updates the display as the code is being updated.
Additionally when developing Viya apps the code needs to access SAS Viya using the REST APIs.
This extension of create-react-app is designed to help developer's building react apps using restaf library and its companions:
There is a fully functional demo in the demo directory of this repository. It uses material-ui as the primary UI framework.
The application is authenticated using authorization_code flow.
npx create-react-viya-app react-appname --webapp webapp-name --title webapp-title --script scriptTags-file
Only the react-appname is required. The optional parameters are:
webapp -- this is the user-friendly application name. Defaults to viyademo
title -- The text for the title tag in index.html. Defaults to SAS/Viya Application
script -- a file which has some HTML script tags to be inserted into index.html - defaults is a comment line
Set the following in the .env file:
Some defaults:
For more detailed configuration ioptions see See https://github.com/sassoftware/restaf-server/wiki
Run this command to have HMR enabled
cd to-the-app-directory
yarn dev
Run this command( no HMR)
cd to-the-app-directory
yarn build
yarn app
Then use the created app just as you would any app created with create-react-app
By default a react context named AppContext is created.
To access the data code something like this:
import React,{useContext} from 'react';
import AppContext from '../providers/AppContext';
let appContext = useContext(AppContext);
let {store, appOptions} = appContext;
let {appenv, logonPayload} = appOptions;
The store is the restaf store object that you will use to make the API calls.
These two libraries are part of the installed dependencies. To access them in your react components do these as follows:
let restaf = require('@sassoftware/restaf/dist/restaf.js');
let restaflib = require('@sassoftware/restaflib/dist/restaflib.js');
or
import * as restaf from '@sassoftware/restaf/dist/restaf.js';
import * as restaflib from import * as restaf from '@sassoftware/restaf/dist/restaflib.js';
In all probablity you will not refer directly to restaf in your code. You will use the store object in the AppContext(see above). This value is set as part of the application setup.
FAQs
a cli for creating react+restaf based apps for Viya
The npm package @sassoftware/create-react-restaf-viya-app receives a total of 0 weekly downloads. As such, @sassoftware/create-react-restaf-viya-app popularity was classified as not popular.
We found that @sassoftware/create-react-restaf-viya-app demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.