Skip to content

How to use this in another application #24

@jmarantz

Description

@jmarantz

I have a deployment flow that works for me technically, but it's not perfect, and I'd like to confirm it's acceptable from a license perspective.

What I have done (experimentally) is capture the compiled JS from https://pfau-software.de/json-viewer/dist/iife/index.js, and build those bytes into a C++ string which i can then inject into served HTML.

I added the copyright into the served JS, above the compiled JS:

// Hierarchical Json viewer from https://www.npmjs.com/package/@andypf/json-viewer and
// https://github.com/andypf/json-viewer.
//
// This minified version was downloaded on Jan 24, 2025 from
// https://pfau-software.de/json-viewer/dist/iife/index.js.

/*

MIT License

Copyright (c) 2023 Andreas Pfau

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

*/


(()=>{var oe=Object.defineProperty...

Is this an acceptable way to incorporate this JS into an application, from a license point of view?

I mentioned above that this isn't technically perfect either. I think I might prefer to run with unoptimized JavaScript, for 2 reasons:

  1. It would be easier to reason about json-viewer's security properties if I was looking at readable JS
  2. If a bug or other issue comes up it would be easier to debug or hack if it was human readable.

I know a fair bit of JS but I have not worked with React or your build flow, and I'm not clear on what your build flow is. Is there a way to generate a monolithic piece of human-readable JS, that I could use in place of the minified version?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions