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

Angular 12 compatibility #1761

Closed
StefanSchoof opened this issue Jun 10, 2021 · 5 comments · Fixed by #1762
Closed

Angular 12 compatibility #1761

StefanSchoof opened this issue Jun 10, 2021 · 5 comments · Fixed by #1762

Comments

@StefanSchoof
Copy link

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. git clone https://github.com/eclipsesource/jsonforms-angular-seed.git
  2. cd jsonforms-angular-seed
  3. ng update @angular/core@12 @angular/cli@12
  4. get error: "Package "@jsonforms/angular-material" has an incompatible peer dependency to "zone.js" (requires "^0.10.2", would install "0.11.4").
    × Migration failed: Incompatible peer dependencies found.
    Peer dependency warnings when installing dependencies means that those dependencies might not work correctly together.
    You can use the '--force' option to ignore incompatible peer dependencies and instead address these warnings later."
  5. ng update @angular/core@12 @angular/cli@12 --force (works without an error)
  6. npm start
  7. Get the error:
Did you mean './http'?
Requests that should resolve in the current directory need to start with './'.
Requests that start with a name are treated as module requests and resolve within module directories (C:/Users/SSchoof/source/github/jsonforms-angular-seed, node_modules). 
If changing the source code is not an option there is also a resolve options called 'preferRelative' which tries to resolve these kind of requests in the current directory 
too.

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "http": require.resolve("stream-http") }'
        - install 'stream-http'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "http": false }

./node_modules/json-schema-ref-parser/lib/resolvers/http.js:4:14-30 - Error: Module not found: Error: Can't resolve 'https' in 'C:\Users\SSchoof\source\github\jsonforms-angular-seed\node_modules\json-schema-ref-parser\lib\resolvers'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "https": require.resolve("https-browserify") }'
        - install 'https-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "https": false }

Expected behavior
jsonforms is working with latest released angular version

Screenshots
n/a

Browser (please complete the following information):
n/a

Used Setup (please complete the following information):

  • Framework: angular
  • RendererSet: material

Additional context
Add any other context about the problem here.

@StefanSchoof
Copy link
Author

Hi @sdirix,

I saw you created #1762, which resolves the webpack 5 problem, but it looks like a braking change. Since I currently evaluate my options, to integrate jsonforms in a existing Angular 12 app, can you please give me any info about the plans for releasing this change. Should this be part of the 3.0 release? If so, do you plan to put prereleases on npm soon?

@sdirix
Copy link
Member

sdirix commented Jun 14, 2021

Hi @StefanSchoof, first, thank you for the report. As you noticed, the cause of the reported issue lies in the json-schema-ref-parser which we want to remove with #1750.

#1762 should fix the error presented here. While it's a (minor) breaking change, it's only one for the React Material renderers. The Angular renderers never used this functionality anyway. So besides the error going away, you shouldn't notice any difference.

For the final 3.0 release we plan to integrate more changes. However as soon as #1762 is merged we'll definitely do an 3.0 alpha prerelease which can be consumed by you.

@sdirix sdirix added this to the 3.0 milestone Jun 14, 2021
@sdirix sdirix linked a pull request Jun 14, 2021 that will close this issue
@StefanSchoof
Copy link
Author

Thanks, @sdirix for the quick explanation. Then I will try to get my forms to fly.

@sdirix
Copy link
Member

sdirix commented Jun 24, 2021

Hi @StefanSchoof, JSON Forms 3.0.0-alpha.0 is now released containing the removal of the json-schema-ref-parser. You can consume it by referring to the concrete version or simply use the next tag, for example npm install @jsonforms/core@next @jsonforms/angular@next @jsonforms/angular-material@next.

@StefanSchoof
Copy link
Author

Thanks, I found today time to look into it and it is working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants