Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Typescript #516

Closed
44 of 49 tasks
herberthenrique opened this issue Dec 9, 2019 · 6 comments
Closed
44 of 49 tasks

[RFC] Typescript #516

herberthenrique opened this issue Dec 9, 2019 · 6 comments
Labels
help wanted Looking for contributions 📝 RFC Request for comment 🛠️ tech Changes to the tech stack or infrastructure
Milestone

Comments

@herberthenrique
Copy link
Contributor

herberthenrique commented Dec 9, 2019

Suggested technology

- What technology do you suggest we start using?
Type System, TypeScript

- What problem does it solve?
Having type system inside Circuit UI we want to solve problems like:

  1. Strict typing
    Everything stays the way we define it. Need a variable to always be a number? It’ll always be a number, then.

  2. Structural typing
    Indispensable when you care about fully defining the actual structure you use. JavaScript allows for a lot of strange things to be done, so relying on a specific structure is a much safer solution.

  3. Type annotations
    A handy way of saying explicitly what type should be used.

  4. Type inference
    Implicit typing performed by TypeScript itself so that your developers don’t need to provide types where the compiler can find them on its own.

According to StackOverflow’s 2019 survey, TypeScript is currently one of the most loved programming languages, tied with Python:

Alternatives

What are the alternatives you've explored? Why choose one over the other?
We can use Flow for typing, but the community is not going on this direction and the library isn't been using in favor

Potential downsides

The biggest downside is related to the learning curves of new developers.
Learning type system if you only worked before with dynamic languages is kind of confusing.

Components to be migrated (WIP):

@herberthenrique herberthenrique added feature A new feature or enhancement 📝 RFC Request for comment labels Dec 9, 2019
@herberthenrique herberthenrique changed the title [RFC] Typescript migration [RFC] Typescript Dec 9, 2019
@fernandofleury
Copy link
Contributor

Let's make it happen!

@connor-baer
Copy link
Member

connor-baer commented Dec 10, 2019

Let's share (and vote on?) this RFC at the next global web chapter sync. I believe that most of the team is very much in favor of moving to TypeScript.

@herberthenrique I see that you created a checklist of components. Do you plan to migrate each component individually? How do you plan to handle the initial configuration? Have you investigated if all of our tooling supports TypeScript (I'm thinking about Emotion, Storybook, Jest and Eslint/Prettier here)?

@fernandofleury
Copy link
Contributor

@connor-baer I was planning we could create some spikes for the bootstrap and do it while I'm there at the São Paulo office next week

@hleote
Copy link
Contributor

hleote commented Dec 11, 2019

@herberthenrique nice RFC 👍 💯

I've used some time on setting up the initial configuration, unfortunately didn't had time to finish it...

As @connor-baer mentions above, the biggest challenge I've faced when doing this was integrating typescript's initial config with all the tooling already being used by circuit-ui...

I probably will need some help from someone that knows the project better than I do... 🙂

@connor-baer connor-baer added roadmap 🛠️ tech Changes to the tech stack or infrastructure and removed feature A new feature or enhancement labels Dec 11, 2019
@connor-baer
Copy link
Member

@hleote That's exciting! Could you push your initial configuration to a branch please so we can use it as a starting point?

@connor-baer connor-baer added the help wanted Looking for contributions label Sep 1, 2020
@connor-baer connor-baer added the good first issue A beginner-friendly task label Dec 1, 2020
@connor-baer connor-baer removed the good first issue A beginner-friendly task label Feb 24, 2021
@connor-baer connor-baer modified the milestones: v2.x, v3.x Jun 29, 2021
@connor-baer
Copy link
Member

We've effectively migrated most components to TypeScript. The few remaining components will be deprecated or rewritten from scratch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Looking for contributions 📝 RFC Request for comment 🛠️ tech Changes to the tech stack or infrastructure
Projects
None yet
Development

No branches or pull requests

4 participants