Git Product home page Git Product logo

nyg-jam3's Introduction

Jam3 Generator stable

Jam3 Frontend App Generator with no build configuration and no prompts.

Usage

The nyg generator is designed to function similar to yeoman. To get it running, simply follow these steps:

npm i nyg -g
npm i nyg-jam3 -g
cd your-project-directory
nyg nyg-jam3

Developer Contribution Guide

Contribute with boilerplate

  1. Go to /templates
  2. Run npm i
  3. Ready to go, everything is inside that folder

Contribute with the generation

  1. Review /index.js, everything is there

If you are looking to contribute to the generator it is important to read the Developer Contribution Guide

Main scripts

In the template, you can run:

npm start

Runs the app in development mode.
Open http://localhost:3000 to view it in the browser.

You will automatically see the changes in your app after modifying your code, we are using HMR. You will also see build errors and warnings in the console as well as the browser.

npm run build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the random hash strings in order to avoid server-side caching. (example: main.df8fsdfs.js)
By default, it also includes a service worker so that your app loads from local cache on future visits.

Before creating the production build, make sure removing everything you don't need. There are many samples in the generator to avoid prompting at the beginning of the project.

Your app is ready to be deployed.

npm test

Runs the test watcher in an interactive mode.
By default, it runs tests on the files that have changed since the last commit.

Read more about testing.

npm run release

To release new versions we are using standard-version.

Steps:

  1. When PRs/commits land to your master branch, select the Squash and Merge option.
  2. Add a title and body that follows the Conventional Commits Specification.
  3. Run $ git checkout master; git pull origin master
  4. Run $ npm run release
  5. Run $ git push --follow-tags origin master && npm publish

Developer Guide

We are using react-scripts as a base. You can checkout their User Guide. Everything here applies to the generator.

You can check out our Developer Guides to know more about the features and customizations.

nyg-jam3's People

Contributors

iranreyes avatar namniak avatar donghyukjacobjang avatar jmckinnell avatar alemesa avatar kaeyangtheg avatar sdantuoni avatar

Stargazers

Nacho A. avatar Robert Fernandez  avatar Carsten Heisterkamp avatar Ben M avatar Keefe Ho avatar  avatar Jeff Ong avatar Jérémie Boulay avatar Shrey Sharma avatar  avatar Ragu Sivanandha avatar

Watchers

Edgard Zavarezzi de Carvalho avatar tony valderrama avatar Miguel Moraleda avatar Corstiaan avatar M. Nowak avatar James Cloos avatar Gabriel Magalhães dos Santos avatar Kaiyi Wong avatar  avatar Edwin Luijten avatar William Chen avatar Keita Abe avatar Mark McQuillan avatar Ben M avatar Jhon Escobar avatar Henrique Penteado Kujawski Périgo avatar Victor  avatar  avatar Leroy Korterink avatar Ragu Sivanandha avatar Richard avatar Caio Velenosi avatar Mauricio Lopez avatar Marco Brotas avatar Marcelo Rodriguez avatar Eduardo Maldonado Fonseca Silva avatar Brian Nguyen avatar Wenchen Li avatar Bonnie Pham avatar Colin MacLachlan avatar  avatar  avatar Amna Azhar avatar  avatar Artem Leznikov avatar Geraldine Inzaghi avatar  avatar Nirav avatar

nyg-jam3's Issues

Integrate a default error handling system

To manage the errors in the sites we have a couple ways to do it. The simpler way is to filter all of them using window.error and componentdidcatch and decide what to do with them.

A more robust is to use a monitoring library but it adds more async code to the page. I don't like at least is need it

Fork this project using Preact

Like everyone knows Preact is just ~3kb compared with the ~45kb of React. For small projects that don't require all the React architecture, we have Preact as a solution. There are more alternatives.

https://github.com/developit/preact/wiki/Differences-to-React

Note: We can think too about adding a prompt to this generator to switch to Preact, depending on how complex may be, will be better to keep it simple and just fork it and create another generator

Accelerate the builds

Here we have a couple strategies to do:

  1. Don't re-compress assets
  2. Use the AutoDllPlugin (already an issue #39)
  3. Move the used dev-dependencies that we actually use into dependencies and run the production build only with the dependencies (npm install --production)

Load async reducers

When the application grows and becomes more complex, sometimes the actions and reducers for asynchronous pages are really large. In that scenario, we want to include them also in the async chunk and load them asynchronously.

Exclude completely the polyfills

Currently, we have control only over a few polyfills, the idea is to extract all the polyfills of the app and load them just if the browser needs them.

Add base Link component

Base link

Add base link component with the best practices.

Markup

Use <a class="" label="" href=""></a>

Accessibility

Must include label

Performance

  1. The external links (target="_blank") must include rel="noopener"
  2. The external link will include a prefetch tag when the user over the link. (<a rel=prefetch href=''></a>)

Add wiki to the generator

Add wiki with info related to the generator.

Have in mind that the wiki won't be cloned/generated, just the README

Include a default sitemap.xml

There are many tools that generates it, because the app is not server rendered we need to rendered first before run the tools, there are many ways like react-snapshots or react-snap

Reuse fb-messenger's default client-side unsupported page with handling

  • i think we can reuse unsupported-webpack.config.js from prj-fb-messenger-redesign to generate the bundle
  • as well as unsupported-utils.js
  • we might want to separate device-matrix.json into supported and unsupported sections, sometimes it necessary to specify which browsers are unsupported (like IE browsers, .etc), while everything else can fall through as a maybe supported

Add base button component

Base button

Add base button component with the best practices.

Markup

Use <button></button>

Accessibility

Include aria-label

Server Side Rendering

The idea is to start with a simple server rendering that will render only the main layout (App shell), this includes navbar, footer, hamburger menu and the rest will be lazy loaded (or wait for React to render the components).

Critical CSS

Evaluate if is needed to use a critical-css solution or just with the common css bundle is ok

Create codeship pipeline for the generator

Create pipeline where:
2. Include slack notification
3. Run unit-tests, if they are added
5. Run Pagespeed (async)
6. Run Lighthouse (async)
7. Run Page Validator (html-validator, needs react-snap or similar solution)
8. Unused CSS
9. Run Security tests (security scripts, npm packages review)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.