Skip to content

Collection of updates #1239

@atkulp

Description

@atkulp

General information

Background

I've been working on porting some older company-specific tweaks we made to json-editor to the latest version so we can hopefully stop maintaining our own fork. I have a version that addresses the following:

  1. Increases performance by deferring rendering of array elements, while still being able to display titles for non-active tabs. This uses an option and must be opted in for now
  2. I added a Typescript types file (index.d.ts) for an easier time.
  3. Came across a few edge case bugs in my testing which I fixed with null checks and default values
  4. Added a flag to translate (default version) so you can choose to fall back to the key or not
  5. Changed a spot with JSON.stringify being called twice to reuse first

Notes

  • I rewrote several of the utility functions for performance but haven't switched them over. I wanted some review to be sure I'm not introducing different behavior
  • I think we should hash and cache the compiled templates but I didn't actually benchmark what that might gain. Easy enough to add though
  • We should update to a newer version of eslint (8.29.0) which uses a newer version of globals (v13.15.0). I didn't want to chance different errors/warnings so left it for now and added an exception to the .eslint file

Some of these changes came from an earlier fork by @j2jensen.

Summary

PR is here. Thanks for taking the time to review it. I might be interested in helping out to review other PR's or whatever's needed on the project going forward.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions