Skip to content

feat: standalone mode #18

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

Merged
merged 11 commits into from
Aug 23, 2022
Merged

feat: standalone mode #18

merged 11 commits into from
Aug 23, 2022

Conversation

Eomm
Copy link
Member

@Eomm Eomm commented Aug 21, 2022

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Member

@climba03003 climba03003 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I though about how can we provide a seamless experience between development and production.

For example, can we provide some default function for storeFunction and restoreFunction?
Why can't we write when file not exist? and use written file when possible?

Can we provide some build tools for the standalone feature, so the developer do not required to start fastify for just build the file in their CI/CD pipeline.

@Eomm
Copy link
Member Author

Eomm commented Aug 22, 2022

Why can't we write when file not exist? and use written file when possible?

We can but I think it is out of scope of this module.
It is possible to build a specific schemaController that does it, all the API are in place

@Eomm Eomm force-pushed the standalone-feat branch from 0c15984 to c56931f Compare August 22, 2022 07:06
@Eomm Eomm requested a review from Uzlopak August 22, 2022 17:11
Copy link
Contributor

@Uzlopak Uzlopak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typings are missing

Co-authored-by: Uzlopak <aras.abbasi@googlemail.com>
@Eomm
Copy link
Member Author

Eomm commented Aug 22, 2022

typings are missing

I don't know how to do it due to the nature of this feature: require('@fastify/fast-json-stringify-compiler/standalone').

Could you guide me?

@Uzlopak
Copy link
Contributor

Uzlopak commented Aug 22, 2022

You can create a standalone.d.ts next to the standalone.js.

@Eomm
Copy link
Member Author

Eomm commented Aug 22, 2022

You can create a standalone.d.ts next to the standalone.js.

Do you have any more hints?

  test/types/standalone.test.ts:12:0
  ✖   6:15  This expression is not callable.
  Type typeof import("/Users/mspigolon/workspace/fast-json-stringify-compiler/standalone") has no call signatures.  
  ✖  12:0   Parameter type SerializerCompiler is not identical to argument type any.                                                                            
  ✖  14:15  This expression is not callable.
  Type typeof import("/Users/mspigolon/workspace/fast-json-stringify-compiler/standalone") has no call signatures.  
  ✖  21:0   Parameter type SerializerCompiler is not identical to argument type any.                                                                            

  standalone.d.ts:16:45
  ✖  16:45  Parameter Options implicitly has an any type.                                                                                                       

  5 errors

@Uzlopak
Copy link
Contributor

Uzlopak commented Aug 22, 2022

I thought I am in my own repo

05a7660

@Uzlopak
Copy link
Contributor

Uzlopak commented Aug 22, 2022

@Eomm
standalone-feat...suggestion

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Co-authored-by: Ivan Tymoshenko <bugagashenkj@gmail.com>
@Eomm Eomm merged commit 032756e into main Aug 23, 2022
@Eomm Eomm deleted the standalone-feat branch August 23, 2022 16:09
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 this pull request may close these issues.

5 participants