-
Notifications
You must be signed in to change notification settings - Fork 0
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
Clone document on addStatic. #14
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #14 +/- ##
==========================================
+ Coverage 98.27% 98.40% +0.12%
==========================================
Files 2 2
Lines 116 125 +9
==========================================
+ Hits 114 123 +9
Misses 2 2
Continue to review full report in Codecov by Sentry.
|
@dlongley |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
We should drop the testing for node 16 and bump the suggestion in the package.json (if any) to node 18+. |
Co-authored-by: Dave Longley <[email protected]>
Co-authored-by: Dave Longley <[email protected]>
@dlongley while bumping engines we had previously agreed is not major is adding a new method that is node >= 17 only and only supported in somewhat recent browsers breaking and hence a major change? |
Given our package.json "node recommendation" policy, it's not a breaking change. We've just gotten behind on upgrading this particular package's expected node value here. We only support LTS+. So we could do the The supported browsers and node versions are "current" and LTS+, and think we're good there for the https://caniuse.com/?search=structuredClone If people need to polyfill this in old browsers I imagine they're already doing so in their build pipelines or should be. As a matter of policy, our individual libraries do not provide support for legacy platforms. |
|
At a minimum, I think the changelog should note support or a polyfill for |
- Update supported Node.js version in README. - Add notes about document being cloned. - Add docs for `addStatic`. - Update changelog with more details about cloning and potential need for a polyfill.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not convinced this is needed, but we'll try it out, and adjust the API if needed.
This seems like the easiest solution to the document mutation issue.
If we don't want a dep we could use
JSON.parse(JSON.stringify(document))
as the jsonld doc should be just JSON.