Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

Beagle-Web-Core doesn't work with Angular 6 #262

Closed
Tiagoperes opened this issue Oct 2, 2020 · 4 comments
Closed

Beagle-Web-Core doesn't work with Angular 6 #262

Tiagoperes opened this issue Oct 2, 2020 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@Tiagoperes
Copy link
Contributor

Tiagoperes commented Oct 2, 2020

Beagle Web version:

Steps To Reproduce

  1. Create a project with Angular 6
  2. Install Beagle-Angular in the project
  3. Create the Beagle config
  4. Try to run it

The current behavior

The compilation will fail stating that @zup-it/beagle-web-core/beagle-tree/index.d.ts references the type Iterator with 3 arguments, but it accepts only 1.

It happens because beagle-web-core is compiled using a much more recent version of Typescript, one that automatically adds these unnecessary arguments to the Iterator, which is not supported by the Typescript version used by Angular 6.

The only safe way to compile code correctly for old versions of Angular is to downgrade the Typescript version used by the beagle-web-core to the same one used by Angular 6.

The expected behavior

Expected to compile successfully

@Tiagoperes Tiagoperes added the bug Something isn't working label Oct 2, 2020
@Tiagoperes Tiagoperes changed the title Beagle-Web-Core doesn't work with projrcts using old versions of typescript Beagle-Web-Core doesn't work with Angular 6 Oct 2, 2020
@Tiagoperes Tiagoperes self-assigned this Oct 2, 2020
@Tiagoperes
Copy link
Contributor Author

As of october 2nd 2020, we decided not to support Angular 6.

By supporting Angular 7.0.0 and beyond, we need to support typescript version 3.1.1.

@Tiagoperes
Copy link
Contributor Author

Tiagoperes commented Oct 5, 2020

Today I tried to downgrade the typescript version to 3.1.1. Since lots of our dependencies depends on more recent versions of typescript, I had to also downgrade them, here's a summary:

  • Jest: from 25.1 to 23.6
  • Nock: from 12 to 10

This is about 2 years in time.

These changes required some code alterations that can be checked here: https://github.com/ZupIT/beagle-web-core/tree/fix/typescript-downgrade

I don't like downgrading so far into the past, but I was ok with it, considering our goal. I'm not ok with it now, I just saw that eslint doesn't work with typescript 3.1.1, at least not since the first release of @typescript/es-lint.

Not having eslint or using an alpha version of the plugin is a big no-no for me. For this reason, I will patch this problem for the next version and, later, I'll try to find a solution that doesn't involve downgrading anything.

@Tiagoperes
Copy link
Contributor Author

Tiagoperes commented Oct 5, 2020

@Tiagoperes
Copy link
Contributor Author

I'm closing this issue since the problem with old versions of Angular has been solved. I opened a new issue stating the current problem which is guaranteeing our code is compatible with old versions of TS: #272

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant