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

Make the client usable in browser and server #213

Open
joneubank opened this issue Jun 18, 2024 · 0 comments
Open

Make the client usable in browser and server #213

joneubank opened this issue Jun 18, 2024 · 0 comments

Comments

@joneubank
Copy link
Contributor

joneubank commented Jun 18, 2024

The validation library and Lectern client are both meant to be runnable in browser or on a server. This will enable the creation of UIs that can validate data vs a Dictionary as users enter it in forms or without submitting data to a server. This will enable a lot of UI tooling.

This is currently not possible due to the use of Node specific libraries which cannot be used in browser. There are two libraries that need removing:

  1. winston - used in the client logger
  2. vm - used in the validation library to run script validation's in an isolated context

Proposed Changes

Removing Winston - Logging

The logger implementation can be removed from the client. We can selectively include console logging.
If there are specific processes where we want logging to occur, we need ot make this configurable for the invoking software. First, we need to define a Logger interface that our server can implement. The client can then accept a Logger as an optional parameter. This configuration should also allow for specification of log level.

Removing VM - Scripts

We need to remove script conditionals anyways, so the solution here is to not publish anymore versions of the Lectern Client that run script validations.

@joneubank joneubank changed the title Make the client usable in browser and server (remove NodeJS specific libraries, depends on removing script restrictions) Make the client usable in browser and server Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant