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

chore: update fastify to ^5.0.0 #169

Merged
merged 2 commits into from
Oct 18, 2024
Merged

chore: update fastify to ^5.0.0 #169

merged 2 commits into from
Oct 18, 2024

Conversation

Fdawgs
Copy link
Member

@Fdawgs Fdawgs commented Sep 18, 2024

See fastify/fastify#5694

Checklist

@mcollina
Copy link
Member

@Fdawgs can you take a look at why this is failing?

@gurgunday
Copy link
Member

Not sure why there is node 10, 16 here?

🚭 Syntax detected in the module is incompatible with the module kind according to the package.json or file extension. This is an error in Node and may cause problems in some bundlers. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/UnexpectedModuleSyntax.md


┌───────────────────┬──────────────────────────────────┐
│                   │ "@fastify/type-provider-typebox" │
├───────────────────┼──────────────────────────────────┤
│ node10            │ 🟢                               │
├───────────────────┼──────────────────────────────────┤
│ node16 (from CJS) │ 🚭 Unexpected module syntax      │
├───────────────────┼──────────────────────────────────┤
│ node16 (from ESM) │ 🟢 (ESM)                         │
├───────────────────┼──────────────────────────────────┤
│ bundler           │ 🟢                               │
└───────────────────┴──────────────────────────────────┘

@Fdawgs
Copy link
Member Author

Fdawgs commented Oct 17, 2024

Issue is that the dist/cjs/index.js file built when running build:cjs has ESM import syntax in it:

"use strict";
import { TypeCompiler } from '@sinclair/typebox/compiler';
import { Value } from '@sinclair/typebox/value';
export * from '@sinclair/typebox';
export const TypeBoxValidatorCompiler = ({ schema, httpPart }) => {
    const typeCheck = TypeCompiler.Compile(schema);
    return (value) => {
        const converted = httpPart === 'body' ? value : Value.Convert(schema, value);
        if (typeCheck.Check(converted)) {
            return { value: converted };
        }
        const errors = [...typeCheck.Errors(converted)];
        return {
            error: errors.map((error) => ({
                message: `${error.message}`,
                instancePath: error.path
            }))
        };
    };
};

Since the last successful release on September 4th, TypeScript 5.6 released, so that may have broken it?
I know TypeScript doesn't follow semver and they put breaking changes in minor releases.

@Fdawgs
Copy link
Member Author

Fdawgs commented Oct 17, 2024

Yep, if i pin typescript to 5.4.5 instead of ^5.4.5 then it's fine.

image

@climba03003
Copy link
Member

I recommend always use ~ for TypeScript since TypeScript use x.y as major version and .z for patch.

@Fdawgs Fdawgs merged commit 739876a into main Oct 18, 2024
53 checks passed
@Fdawgs Fdawgs deleted the chore/mass branch October 18, 2024 09:03
peruukki added a commit to peruukki/feast that referenced this pull request Nov 16, 2024
Lock the TypeScript minor version by using `~` instead of `^` in the
version specifier, see
fastify/fastify-type-provider-typebox#169 (comment).

After upgrading, the TypeScript compiler complained that the `long`
package has no default export. Related fixes:

- Add the latest `long` version as a direct dependency since our code
  uses it directly; no compilation errors with the latest version

- The `long` package exports a `Long` class, so use a capital first
  letter in the import name to match that

Also after upgrading, we get this warning when running `yarn build` but
it can be ignored for now:

```
WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <5.2.0

YOUR TYPESCRIPT VERSION: 5.6.3

Please only submit bug reports when using the officially supported version.
```
peruukki added a commit to peruukki/feast that referenced this pull request Nov 23, 2024
Lock the TypeScript minor version by using `~` instead of `^` in the
version specifier, see
fastify/fastify-type-provider-typebox#169 (comment).

After upgrading, the TypeScript compiler complained that the `long`
package has no default export. Related fixes:

- Add the latest `long` version as a direct dependency since our code
  uses it directly; no compilation errors with the latest version

- The `long` package exports a `Long` class, so use a capital first
  letter in the import name to match that

Signed-off-by: Harri Lehtola <peruukki@hotmail.com>
peruukki added a commit to peruukki/feast that referenced this pull request Nov 28, 2024
Lock the TypeScript minor version by using `~` instead of `^` in the
version specifier, see
fastify/fastify-type-provider-typebox#169 (comment).

After upgrading, the TypeScript compiler complained that the `long`
package has no default export. Related fixes:

- Add the latest `long` version as a direct dependency since our code
  uses it directly; no compilation errors with the latest version

- The `long` package exports a `Long` class, so use a capital first
  letter in the import name to match that

Signed-off-by: Harri Lehtola <peruukki@hotmail.com>
dmartinol pushed a commit to feast-dev/feast that referenced this pull request Dec 1, 2024
Lock the TypeScript minor version by using `~` instead of `^` in the
version specifier, see
fastify/fastify-type-provider-typebox#169 (comment).

After upgrading, the TypeScript compiler complained that the `long`
package has no default export. Related fixes:

- Add the latest `long` version as a direct dependency since our code
  uses it directly; no compilation errors with the latest version

- The `long` package exports a `Long` class, so use a capital first
  letter in the import name to match that

Signed-off-by: Harri Lehtola <peruukki@hotmail.com>
lokeshrangineni pushed a commit to lokeshrangineni/feast that referenced this pull request Dec 2, 2024
)

Lock the TypeScript minor version by using `~` instead of `^` in the
version specifier, see
fastify/fastify-type-provider-typebox#169 (comment).

After upgrading, the TypeScript compiler complained that the `long`
package has no default export. Related fixes:

- Add the latest `long` version as a direct dependency since our code
  uses it directly; no compilation errors with the latest version

- The `long` package exports a `Long` class, so use a capital first
  letter in the import name to match that

Signed-off-by: Harri Lehtola <peruukki@hotmail.com>
tmihalac pushed a commit to tmihalac/feast that referenced this pull request Dec 3, 2024
)

Lock the TypeScript minor version by using `~` instead of `^` in the
version specifier, see
fastify/fastify-type-provider-typebox#169 (comment).

After upgrading, the TypeScript compiler complained that the `long`
package has no default export. Related fixes:

- Add the latest `long` version as a direct dependency since our code
  uses it directly; no compilation errors with the latest version

- The `long` package exports a `Long` class, so use a capital first
  letter in the import name to match that

Signed-off-by: Harri Lehtola <peruukki@hotmail.com>
Signed-off-by: Theodor Mihalache <tmihalac@redhat.com>
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.

4 participants