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 doesn't work without dependencies #552

Closed
2 tasks done
ivan-tymoshenko opened this issue Oct 9, 2022 · 12 comments · Fixed by #617
Closed
2 tasks done

Standalone mode doesn't work without dependencies #552

ivan-tymoshenko opened this issue Oct 9, 2022 · 12 comments · Fixed by #617

Comments

@ivan-tymoshenko
Copy link
Member

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the issue has not already been raised

Issue

Standalone mode is not working without required deps: ajv, fast-uri, ajv-formats, rfdc. Should we use webpack to create a bundle or it's ok?

@climba03003
Copy link
Member

I believe the statement in document is very clear that you need to manually install those dependency in order get it works.
Same applied to ajv standalone mode.

@ivan-tymoshenko
Copy link
Member Author

Maybe it's better to reexport them somehow from fjs, so user will have to install and require only fjs. WDYT?

@climba03003
Copy link
Member

Maybe it's better to reexport them somehow from fjs, so user will have to install and require only fjs. WDYT?

If the dependency is imported from fast-json-stringify.
Then, the usage of compile it prior and eliminate fast-json-stringify as dependency will be gone. It is rare, but it should be a current valid use-case.

@ivan-tymoshenko
Copy link
Member Author

Sorry, I didn't get you.

@climba03003
Copy link
Member

Sorry, I didn't get you.

It means that if I want to compile the stringify function before deploy, and reduce the dependency size.
I don't have to install fast-json-stringify as extra dependency as it did nothing after the compilation of function.

@ivan-tymoshenko
Copy link
Member Author

FJS is a small module. I think the main goal of standalone mode is to reduce compilation time but not the size.

@climba03003
Copy link
Member

FJS is a small module. I think the main goal of standalone mode is to reduce compilation time but not the size.

Valid point, but the movement just reduce a valid use-case that currently support.

@ivan-tymoshenko
Copy link
Member Author

It’s very inconvenient right now. I can’t just update to the new FJS version and recompile. I have to go and check docs or check source code in order to be sure that there is no new dependencies appeared. It may break someone prod if he didn't check it.

@climba03003
Copy link
Member

climba03003 commented Oct 10, 2022

I am not block to either bundle or re-export. Both has the advantages.
We can also toggle between the re-export and direct import. It is not much code dealing with it.

@mcollina
Copy link
Member

I'm -1 to bundle the dependencies. In the standalone code, we could require('fast-json-stringify/runtime.js') that returns all the dependencies.

@Uzlopak
Copy link
Contributor

Uzlopak commented Oct 10, 2022

Cant we use peerDependencies?

@mcollina
Copy link
Member

They won't do if the goal is to have a standalone build that could be run without having fjs in the dependency tree.

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

Successfully merging a pull request may close this issue.

4 participants