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

standalone mode can't be devDependancy #624

Closed
Eomm opened this issue Apr 26, 2023 · 5 comments
Closed

standalone mode can't be devDependancy #624

Eomm opened this issue Apr 26, 2023 · 5 comments

Comments

@Eomm
Copy link
Member

Eomm commented Apr 26, 2023

The last fastify release fastify/fastify@4.16.0...4.16.3 shows how the standalone mode now requires fjs as a dependency instead of a dev-dependancy because of this requirement:

  const { dependencies } = require('fast-json-stringify/lib/standalone')

https://github.com/fastify/fastify/blob/b3ebbdc1ab363233b7728d2bcb4a5b8fe64ccfb3/lib/error-serializer.js#L5

I think the standalone mode was designed to produce a js file that can run without fjs

ref: #617

@mcollina
Copy link
Member

cc @ivan-tymoshenko

@ivan-tymoshenko
Copy link
Member

ivan-tymoshenko commented Apr 26, 2023

Sorry for breaking things. The problem is that to run a standalone code, you need a bunch of other dependencies to install. I decided to wrap and reexport only required entities.

I think the standalone mode was designed to produce a js file that can run without fjs

The main purpose is to optimize the cold start.

@Eomm is that a problem?

@Eomm
Copy link
Member Author

Eomm commented Apr 26, 2023

No, it is not - the readme is updated tho

I wonder if we have other options to make it fully standalone

@ivan-tymoshenko
Copy link
Member

ivan-tymoshenko commented Apr 26, 2023

If the standalone code needs Ajv for validation - then no.
If the standalone code doesn't need Ajv for validation - yes, by printing half of the library to the standalone file.

This way of dealing with it is more flexible. We can use any dep library in the runtime.
Example: #612

@Eomm
Copy link
Member Author

Eomm commented Apr 27, 2023

Yeah - there is no clue on this

@Eomm Eomm closed this as not planned Won't fix, can't repro, duplicate, stale Apr 27, 2023
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

3 participants