Skip to main content

Learning Session #3 - January's Meetups

Today I’d like to talk about IT meetups. I’ve been visiting them for quite some time and I think they are really valuable experience. They give us opportunity to hear speeches from experienced developers and meet new people who share the same interests as you.

This is of course another chance to learn something new, so I’d like to share a few things I have learned from them this week in Wrocław. I’ll cover all meetups one by one and describe each speech through bulletpoints.

Let’s start learning, shall we? 😉

1. meet.js – 01/28/2019

Speech #1: “Documenting projects written in JS with JSDoc” by Wojciech Krysiak

Wojtek spoke about importance of documenting projects written in JavaScript. He presented us his and his team’s app: Admin Bro, admin interface for NodeJS apps inspired by Django Admin and alike. I was written in JavaSciript and Wojtek’s team made it crucial to document project for all users.

Quick summary:

- Repository for AdminBro.
- It is especially important to document code written in weakly-typed language and code that is meant to be reused by many developers. That means libraries, frameworks, packages, etc. 
- Documentation for JSDoc.
- After documenting your code you can generate documentation using JSDoc3 generator for JSDoc-ed files.
- Great template for JSDocs created by SoftwareBrothers.
- You can include any other repository inside your GitHub repository using submodules. Authors of AdminBro used it to separate repositories with documentation and application itself to prevent long pull request to review.
- There are several plugins for JSDocs. For example there is Mermaid (enables creating diagrams and charts inside your documentation) and Markdown (enables converting Markdown to HTML).
- JSDoc can be used for typing your JavaScript code. We can use something like @param tag to describe parameter type and even create our own types inside doc comments using @typedef. Experimental check.js option in VS Code is even integrating comments with IDE-level type checking.


Speech #2: “Cypress.io and e2e tests”  by Przemysław Pietrzak

Przemek shared with us his knowledge about e2e testingideology and Cypress.io testing framework. I too had my encounter with Cypress.io when helping my girlfriend with learning testing tools. It was really impressive to see how someone with little knowledge of testing and programming could write first solid tests in just couple of hours! For me it is really intuitive and complex tool.

What I learned:

- Cypress.io is based on chainers – concept of chaining one method with another (all belonging to global cy object) and thus creating chain of events that make the test.
- Cypress.io has something like commands and they are equivalent of page objects in other frameworks. With that we can pre-define functionalities that can be shared by all test cases (like logging to the site).
- Cypress has clear and intuitive panel for navigating through your test and backtracking through them In case of debugging. Each step of test is even provided with before-and-after screenshot of application. 
- Not everything should be covered by e2e tests because they are pretty time-consuming in terms of runtime and maintainability. Sometimes it is better to replace them with unit or integration tests. What definitely should be tested: every user functionality heavily related to business logic, “positive paths”, functionality that has impact on database.
- Test data should be generated randomly (if it’s possible) in terms of all tests.
- Cypress.io has ability to create HTTP spies that mocks backend responses.


2. GraphQL Wrocław #1: REST is history – 01/29/2019

Speech #1: “Advantages of migrating to GraphQL” by Marcin Gębala

I should start by explaining, that GraphQL is a fairly new standard of implementing query executions on your backend. It can be integrated with many languages/platforms including JavaScript, Java, Python, etc.

Long story short:

- GraphQL uses only one endpoint where we send our query as a string using POST.
- It has strong typing, so every data object must have its type defined in the GraphQL schema. GraphQL uses its SDL (Schema Definition Language) for defining schemas and types. 
- We also implement resolvers, which are functions that define how we can obtain our data.
- Making queries is very intuitive and easy:

- We can use GraphQL with Apollo platform which implements GraphQL standard on the Client side (with popular front-end frameworks), Server (with back-end libraries) and also Engine (which gives us stats about our system).
- GraphQL makes our API visible in one place and making changes to it are easy.
- Problems with GraphQL for now: it is fairly new, so best practices are still emerging, differences in implementing with every frameworks, no support for caching.
- Shopify’s tutorial on designing GraphQL API based on their use cases.

Speech #2: “Ariadne: Familiar GraphQL in Python” by Rafał Pitoń

Here Rafał was telling us a story of creating Python server library with GraphQL.

Interesting facts:

- There is not much libraries for creating GraphQL APIs in Python. Most popular are Graphene and GraphQL-Core-Next.
- Above libraries are known for being over-complicated in terms of syntax.
- Ariadne is a library inspired by Apollo Server which very first task is to make using GraphQL conventions easy for user while creating API in Python.
- Syntax of Ariadne is based on Apollo Server’s. We should always learn from the best, shouldn’t we? 😉

That’s all for now. I think you would be too bored if you read all of my meetup story in one place, so I decided to split it into two parts 😉 Next one should be really soon and it will cover TypeScript Wrocław #1 and ng-Wrocław #26.

Till the next time!

Comments

Popular posts from this blog

How I started with Functional Programming

There was a moment during past Learning Sessions when I declared, that I’ll share with you how and why I decided to dive into Functional Programming. And that day is today! I’ll guide you along the path I took to understand basic concepts of FP. My first meaningful encounter with FP was during local Wrocław TypeScript meetup . There I got to hear Józef Flakus telling us about core concepts of the FP. We then got to the concept of FRP and how it is used in MarbleJS, the framework for creating server-side apps. In fact, Józef is the creator of this framework. It was really cool to hear his point of view. Those concepts were entirely new to me, because (as it turned out) I had 100% imperative programming mindset. The second talk that day was authored by Tomasz Ducin. He showed us how we can implement functional composition in TypeScript. It was a brilliant live coding session but… I had no idea what he was talking about 😉 I was examining code created by Tomasz for the entire ...

Learning Session #10

1. Functional Programming Basically all content surrounding FP this time is connected with articles and projects created by Giulio Canti ( @giuliocanti ). For me reading those articles below definitely firmed and expanded my previous knowledge on FP. I would like to give credit to Piotr ( @hasparus ) who introduced me to Giulio’s work after the last Wrocław TypeScript meetup. It was genuinely fascinating, thank you both! >> “fp-ts” library  I think fp-ts today is as famous for TypeScript as Rambda for JavaScript. With it, you can use “popular patterns and abstractions available in most functional languages”. If you are a newbie to FP (like me) and you know TypeScript it may be a good way to get your head around FP concepts through practice. Just play with it a little, create something small, something you know. >> “Getting started with fp-ts” series Aside from fp-ts having a well written official guide, Giulio created a series of articles, that introduce...

Learning Session #2 (12/31 – 01/13)

1. Git >> Free and (almost) unlimited private repositories on GitHub Last week everyone on Twitter was talking about this so I can't just leave that be, right? 😉 What I’m referring to is GitHub announcing free and unlimited private repositories for all users. That’s a great news and I was wondering why this option was not enabled from day one I started using GitHub. I mentioned that this option is “almost” unlimited because free private repository can manage up to three collaborators only. Big projects won’t be able to use those, but at least individual users can now freely hide code they consider shameful 😉 2. React >> React Crash Course by Mosh Hamedani During last two weeks I’ve completed this YouTube crash course by Mosh Hamedani. It is derived from his full course on React and contains first couple of lessons. It think it was a great introduction to the library itself (React is a considered a library, not a framework, isn’t it? 😊). Tutorial ends ...