Giter VIP home page Giter VIP logo

boilersuit's Introduction

Become the TypeScript Wizard at Your Company

boilersuit's People

Contributors

mattpocock avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

ddaniel-dt

boilersuit's Issues

Make suit add PropTypes

Having thought about proptypes, the best way for suit to handle them is to put them in and change their names, but allow you to comment them out. That's a tricky implementation.

Add saga generators

Create a saga generator if "saga": { }.

This saga generator should not be controlled by // @suit-start and // @suit-end, since it needs to be customisable. It should just plonk a commented-out version of the boilerplate in a function by the correct name does not exist.

Add an option to restrict the version number

Future changes to boilersuit may cause bugs in previous suit.json files. That means we need to have some way of restricting which versions of suit can be used for different files.

Ideally, you will keep a version of suit in npm for each project, and not have it globally. This would solve this issue.

Add a --force option

Sometimes you need to suit up, forcing everything to update without watching afterwards. suit up --force

No dependency check

After generating a suit of actions/reducers from a clean boilerplate, the selector attempts to use selectDomain and fromJS without ensuring they are imported first.

Make reducers use `// @suit-name only` tags

This is crucial for when you want to import your own logic into the reducers. Rewriting the whole reducer each time is not good enough for how extensible we want reducers to be.

Suit eject

Create a command which ejects suit from a subdirectory, so it deletes the suit file and removes any // @suit-line, // @suit-start and // @suit-end

Add dispatch functions to PropTypes

These can be added as traditional // @suit-start, // @suit-end pieces, as their proptype never changes.

In fact, no they can't - they still need to be commented out by the user if they have a pre-commit linter.

This is preventing the Prop_Types release from being ready. Should be done next week.

Keep all 'write' functions pure

Currently, there is some console.logging going on in the main functions. Need to abstract those out to somewhere else, to keep the write functions just string replacements.

Import Syntax: (original: Handling duplicate suits)

Imagine that if you wanted to define a new API action, you could define it in a suit folder with getTweets.json.

You would write the API call yourself, passing back a payload that would be given to the onsuccess action.

That means that throughout your app, in the suit.json files, you could just import the ones you wanted in an array:

{
  "import": [
    "getTweets",
    "getFacebookLikes"
  ]
}

This would solve two big issues: duplicate suit.json files, and those endless apiClient.js files you find where the API methods are just listed out. Instead, we should couple them to our suits so it's easier to see how they flow into the state.

Make Readme Clearer

This issue can be for any readme suggestions.

As of now:

Make clear that the suit.json needs to be in the root of the container folder you want to add reducers/actions etc to.

suit rm / remove

Remove a suit.json file and all of the suit-managed parts of the files in its container

Add support for Typescript and Flow

It would be really cool to be able to specify Flow or Typescript in the suit up command, automagically generating and associating interfaces and types in the appropriate places. Something like suit up --flow.

Extend to environments beyond react-boilerplate

Currently, we are rather bound to the folder structure of react-boilerplate, and its pattern of segmented containers. How would suit handle a plain redux environment? Where would the suit.json file go?

Boilersuit thrives in regimented folder structures. Once we have an idea of a folder structure for a plain redux project, we can get started extending it.

Add 'merge' and 'concat' alongside 'set'

Currently, boilersuit is quite poor at working with arrays and objects. This comes from an issue in prod where I am considering merging two objects, but realising that suit can't cope with it.

A simple change:

{
  "actionName": {
    "describe": "Merges two objects together, and concats two arrays",
    "merge": {
      "anObject": "payload.otherObject"
    },
    "concat": {
      "anArray": ["anArray", "payload.otherArray"]
    }
  }
}

suit overwrite

suit overwrite <folder>

A potentially dangerous command which would entirely overwrite a directory's existing reducers. Useful for when you want to gut out existing code and replace it with suit-managed code.

Hold a version of the suit.json file in a .suit folder for comparison

Currently, when the suitfile updates it has no idea of what has changed. This means it goes in and re-renders everything. On a large, sprawling project, this could be very detrimental on first load.

This proposal would add a folder in each container marked .suit, which would hold a file called suit.old.json. This file would be the previous version of the suit file. This means that when the actual suit file changes, it can be compared with suit.old.json and only the actual things that have changed get updated.

This will give us a huge perf improvement, as well as adding a folder for adding more metadata in the future if necessary.

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.