Code Monkey home page Code Monkey logo

brazilian_states's Introduction

I'm Davi, a full-stack JS developer

My name is Davi, I'm a tech lead at Mobly and full stack JS Developer for 6 years.

My Skill Set

Frontend

React Bootstrap CSS3 HTML5 JavaScript TypeScript Chart.js Vue.js Redux AngularJS Webpack gulp.js Firebase Jest

Backend

Java TypeScript MongoDB Node.js Express.js PostgreSQL NestJS MySQL Redis Spring RabbitMQ Firebase Jest

DevOps

AWS GCP Docker Kubernetes Linux Git Bash

Connect with me


Github Stats




brazilian_states's People

Contributors

davidecarvalho avatar dependabot[bot] avatar lopes-gustavo avatar renovate-bot avatar renovate[bot] avatar richard-rhsr avatar suissa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

brazilian_states's Issues

Regions

Add regions feature

  • Get a list of regions
  • Get one region with all its states
    • Get one region with all its states, and each state with its cities within
  • Get the region based on the name of the state
    • Get only the the region name
    • Get only the region name with its states
    • Get only the region name with its states and each state with its cities
  • Get the region based on the name of the city
    • Get only the region name
    • Get only the region name with its states
    • Get only the region name with its states and each state with its cities
    • Get only the region name with the name of the state that this city belongs

Grooming - promisify methods

Check if promisifying intern data flow will increase performance
Promisify memoization checking
Promisifying memoization add
Promisifying intern method to find the data (not memoized data)

Refactor memoization

Now a days, memoization is just copy-paste code shared between all the functions. Transforming it into a decorator should be the best option

Remover as dependências do repositório

Cria um arquivo na raiz do projeto chamado .gitignore
Adiciona uma linha com node_modules
Depois remove do histórico:

git rm -r --cached node_modules
git commit -m "Remover as dependências do repositório, closes #2"
git push origin master

Breaking changes

Since we are using TS now, I started to realized some things:

  • multiples returns are not good. It just make documentation worse and it's worse for the developers to know right away what is current type of the variable
  • It's better only to return the full json instead. With es6 destructuring it's not that hard to get the wanted value

So I'm taking off shouldReturnEntireJson and it will always return the entire json.

Memoization of method getCityState

Cache the results to increase performance if the method gets the same parameter multiple times.
Since the range of the results is always the same, memoization sounds like a good thing

Normalize city name

When using this lib, the dev can accidentally put the city name in a way it's not totally equal to the json name (like it's in uppercase, or in lowercase)
Make the lib smart enough to normalize it before starting to find, this way the dev will have more ways to find it.

  • Normalize case
  • Normalize accent
    Maybe normalize special characters, if it's too hard, can be done on a later time.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update dependency documentation to v14

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
lib/package.json
  • @types/lodash ^4.14.119
  • lodash ^4.17.13
  • remove-accents ^0.4.2
  • @babel/cli 7.5.5
  • @babel/core 7.5.5
  • @babel/polyfill 7.4.4
  • @babel/preset-env 7.5.5
  • @babel/preset-typescript 7.3.3
  • @babel/register 7.5.5
  • @types/jest 24.9.1
  • babel-core 7.0.0-bridge.0
  • babel-jest 24.9.0
  • benchmark 2.1.4
  • chai 4.2.0
  • copyfiles 2.1.1
  • coveralls 3.1.1
  • documentation 13.2.5
  • jest 24.9.0
  • nodemon 1.19.1
  • nyc 11.9.0
  • rimraf 3.0.2
  • tslint 5.18.0
  • typescript 3.5.3
package.json
  • @types/lodash ^4.14.119
  • lodash ^4.17.13
  • remove-accents ^0.4.2
  • @babel/cli 7.5.5
  • @babel/core 7.5.5
  • @babel/polyfill 7.4.4
  • @babel/preset-env 7.5.5
  • @babel/preset-typescript 7.3.3
  • @babel/register 7.5.5
  • @types/jest 24.9.1
  • babel-core 7.0.0-bridge.0
  • babel-jest 24.9.0
  • benchmark 2.1.4
  • chai 4.2.0
  • copyfiles 2.1.1
  • coveralls 3.1.1
  • documentation 13.2.5
  • jest 26.6.3
  • nodemon 2.0.17
  • nyc 11.9.0
  • prettier ^2.7.1
  • rimraf 3.0.2
  • tslint 5.18.0
  • typescript 3.5.3
travis
.travis.yml
  • node 9.11.1

  • Check this box to trigger a request for Renovate to run again on this repository

Grooming - Separate webservice from npm package

Npm packages should not contain much dependencies. Putting the webservice inside the npm package only for the purpose of "if you need it, there is this option too" is not a good idea.

Maybe separate into two repos, this way the package will not have unused dependencies

Memoization of method getStateCities

Cache the results to increase performance if the method gets the same parameter multiple times.
Since the range of the results is always the same, memoization sounds like a good thing

Eager memoization

Right now, memoization is made on demand, in other words, if you make a call for a city or a state, it will be cached so consecutive calls can be faster.
But, and if the dev wants it already cached? Creating something like ‘’eagerMemoization()’’ sounds nice.

  • Create eager memoization, so the lib can be started and cached right from the start, instead of beeing on demand.

Trocar de Flow para TS

Flow acabou não sendo uma boa opção. Ambiente muito lento, tooling ruim e pouca comunidade não fazem dele uam boa opção, trocar para TS talvez seja melhor.
Provavelmente usarei TS com Babel, porque quero apenas a tipagem e Babel consegue me ajudar mais porque tem mais features disponíveis.
Usar TSC apenas para gerar arquivos .d.ts

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.