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

Use named import for fast-json-patch update to 2.2.0 #1464

Conversation

tomalec
Copy link

@tomalec tomalec commented Aug 8, 2019

Description

  • Changed default import to named import for fast-json-patch
  • Updated fast-json-patch back to the current 2.2.0

Motivation and Context

As reported at Starcounter-Jack/JSON-Patch#233 and #1460 (Fixes #1460) there was a problem initializing Swagger with latest fast-json-patch. It occurred to be related to backward incompatible change related to undocumented default export. We will revert this change, and release a new version to support this and many other projects that are currently using import jsonPatch from 'fast-json-patch'.

However, we recommend to use named or star imports:

import { applyPatch } from 'fast-json-patch'
import * as jsonPatch from `fast-json-patch'

Those worked with old versions, works fine with 2.2.0, and we plan long term support for such import.
So you can use it with current versions without a need to wait for our fix.

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • No code changes (changes to documentation, CI, metadata, etc)
  • Dependency changes (any modification to dependencies in package.json)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project. - at least I hope so, I haven't found any guidelines, nor CONTRIBUTING.md
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed. - I tried running npm test locally, but they were failing even on master :(

no to use undocumented default export.
Fixes swagger-api#1460
Now it should work fine with named imports.
Copy link
Contributor

@tim-lai tim-lai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tomalec Thanks for the PR! It's been awhile, but can you rebase, resolve merge conflicts, and apply suggestions. One is a lint error. Once done, this PR will be merged.

src/specmap/lib/index.js Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
tomalec and others added 2 commits June 12, 2020 10:47
Co-authored-by: Tim Lai <timothy.lai@gmail.com>
Co-authored-by: Tim Lai <timothy.lai@gmail.com>
@tomalec
Copy link
Author

tomalec commented Jun 12, 2020

@tim-lai thanks for the review.
All comments addressed.

@tim-lai
Copy link
Contributor

tim-lai commented Jun 12, 2020

@tomalec please resolve merge conflicts as well. Thanks!

@char0n char0n self-assigned this Jun 19, 2020
@char0n char0n added this to the M3 milestone Jun 19, 2020
char0n added a commit that referenced this pull request Jun 19, 2020
Along with that update fast-json-patch to v2.2.1

Refs #1464
@char0n
Copy link
Member

char0n commented Jun 19, 2020

@tomalec thank you for reporting this! Closing this PR in favor of #1564

@char0n char0n closed this Jun 19, 2020
char0n added a commit that referenced this pull request Jun 19, 2020
Along with that update fast-json-patch to v2.2.1

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

Successfully merging this pull request may close these issues.

Swagger Client Initialisation is failing.
3 participants