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

Breaking change since ESBuild >0.16 chore commit #55

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

deviljin112
Copy link

@deviljin112 deviljin112 commented Nov 30, 2023

Pull Request Description

ESBuild build got bumped in this commit db0059b leading to a breaking change.
ESBuild 0.17 introduced a breaking (backwards-incompatible) change to .build() - SEE HERE
Chore commit was blindly merged breaking the watch and build commands.
This basically makes it work with latest esbuild and simplifies the build-bundle.js.

(Edit side note: I used npm hence the lock file. Welcome to delete or ignore it. The main important part is the build-bundle.js)

Pull Request Checklist:

  • Have you followed the guidelines in our contributing document and Code of Conduct?
  • Have you checked to ensure there aren't other open for the same update/change?
  • Have you built and tested the resource in-game after the relevant change?

@deviljin112
Copy link
Author

deviljin112 commented Nov 30, 2023

Just tested with Yarn and it seems to break. I'm investigating the cause and will update this PR with a fix for yarn

Its actually due to this #32
I suggest ignoring this PR and rolling back on the ESBuild version until FiveM updates node.

@Gittified
Copy link

@itschip I think this can be implemented now, will prevent people from getting errors in build mode. Since updating it or not won't have any effect on #32 anyway, better fix manual builds.

Copy link

@Gittified Gittified left a comment

Choose a reason for hiding this comment

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

Looks good overall, possibly needs some changes.

if (IS_WATCH_MODE) {
await context.watch();
} else {
await context.rebuild();

Choose a reason for hiding this comment

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

I'm not entirely sure if esbuild logs errors internally, even though this does happen when using watch mode. Maybe it would be safe to still add a check like we had before.

console.error(`[ESBuild] Bundle failed with ${errors.length} errors`);
process.exit(1);
if (IS_WATCH_MODE) {
await context.watch();

Choose a reason for hiding this comment

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

Redundant await

Suggested change
await context.watch();
context.watch();

Choose a reason for hiding this comment

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

Not sure if we want to include a package-lock.json, I'll let @itschip decide that I guess

@itschip
Copy link
Member

itschip commented Feb 5, 2024

Seems like you've installed some packages with npm instead of yarn. Please remove the package-lock file and install again with yarn to update the yarn.lock file :P

@Gittified
Copy link

Seems like you've installed some packages with npm instead of yarn. Please remove the package-lock file and install again with yarn to update the yarn.lock file :P

This PR is pretty old, so if you want I'll make a new one with the requested changes. I doubt the author is still active 😄

@deviljin112
Copy link
Author

deviljin112 commented Feb 5, 2024

I'm alive and kicking. I just didn't reply to the original comments - must have lost them in the email spam.

Just tested with Yarn and it seems to break. I'm investigating the cause and will update this PR with a fix for yarn

Its actually due to this #32 I suggest ignoring this PR and rolling back on the ESBuild version until FiveM updates node.

I've left a comment explaining that this PR can be ignored until ESBuild version is increased by FiveM. Since the node version is unsupported by peer dependencies etc.

I can make changes if needed but yeah as per above.

Edit: Instead the version of ESBuild should be rolled back since its a breaking change and FiveM doesn't support it.

@Gittified
Copy link

I'm alive and kicking. I just didn't reply to the original comments - must have lost them in the email spam.

Just tested with Yarn and it seems to break. I'm investigating the cause and will update this PR with a fix for yarn
Its actually due to this #32 I suggest ignoring this PR and rolling back on the ESBuild version until FiveM updates node.

I've left a comment explaining that this PR can be ignored until ESBuild version is increased by FiveM. Since the node version is unsupported by peer dependencies etc.

I can make changes if needed but yeah as per above.

Edit: Instead the version of ESBuild should be rolled back since its a breaking change and FiveM doesn't support it.

We can roll back the version of ESBuild, but I'm quite sure that NPWD is not meant to be built on the server in the first place. Thus, I think it would be fine, but I also agree that the impact of downgrading is pretty much nothing, so I'm going to agree.

@deviljin112
Copy link
Author

deviljin112 commented Feb 5, 2024

While NPWD may not be impacted - this repo is meant to act as a boilerplate (as far as I understand) which in its current form it isn't, therefore it shouldn't be public and/or exist. Most beginners/average users will be met with frustration and errors, as the issue when using this standalone is not obvious since its the FiveM Node version at fault.

I'm also going to say on a whim that NPWD probably has its own esbuild stuff in its repo and is not using this either directly or indirectly in any shape or form, hence rolling back on the esbuild will not impact NPWD.

Best approach (imo) would be to roll it back close this PR and mention that this ESBuild version is a strict dependency linking to this PR and the discussion.

I hope that clarifies why I left the discussion open :)

@Gittified
Copy link

I totally forgot that this was about the boilerplate, my apologies 😂

Your solution is good, I agree.

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.

3 participants