Skip to content

Angular 14 compatibility? #1973

@ghost

Description

Is your feature request related to a problem? Please describe.

@jsonforms/angular has a peer-dependency on Angular 12 or 13, but the project I'm working in has already upgraded to Angular 14. This means I can't install jsonforms without --force or --legacy-peer-deps which are both pretty crude tools, that could mask other problems I need to see.

>npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: @angular/[email protected]
npm ERR! node_modules/@angular/core
npm ERR!   @angular/core@"14.0.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/core@"^12.0.0 || ^13.0.0" from @jsonforms/[email protected]
npm ERR! node_modules/@jsonforms/angular
npm ERR!   @jsonforms/angular@"3.0.0-beta.5" from the root project

The other package @jsonforms/angular-material also depends on angular 12 or 13, but I wouldn't be using that myself. (I'm making custom renderers, so I don't need the default material ones.) These are specified here and here respectively.

Describe the solution you'd like

Widen the Angular dependencies for @jsonforms/angular (and @jsonforms/angular-material) to "^12.0.0 || ^13.0.0 || ^14.0.0"? After a cursory search through the code, I only see some @NgModule, @Component, @Directive decorator usage, or other simple-looking things, so I think this would just work without any other changes needed? (But I'm not an expert in angular or jsonforms! 😅 My experiment branch seems to work OK in the project I work in.)

Describe alternatives you've considered

Npm install with --force or --legacy-peer-deps, but that can mask real problems. 😬

Framework

Angular

RendererSet

Other (please specify in the Additional context field)

Additional context

I'd be making my own renderers, since our project isn't just using vanilla material, so I don't think I'd depend on any of the default renderers? (But I don't know if the parent JsonFormsControl counts as a 'renderer' for the 'RendererSet' question.) Like this:

// more imports here...
import { JsonFormsAngularService, JsonFormsControl } from '@jsonforms/angular';

@Component({
  selector: 'app-my-jsonforms-text-renderer',
  template: `<!-- my template in here... -->`,
})
export class MyJsonformsTextRenderer extends JsonFormsControl implements OnInit, OnChanges {
  constructor(jsonformsService: JsonFormsAngularService) {
    super(jsonformsService);
  }

  static tester: RankedTester = rankWith(42, isStringControl);

  // other code here...
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions