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

feat: webpack test stack #3240

Merged
merged 6 commits into from Aug 31, 2021
Merged

feat: webpack test stack #3240

merged 6 commits into from Aug 31, 2021

Conversation

zekth
Copy link
Member

@zekth zekth commented Aug 7, 2021

Aim to fix: #3158

So i've setup everything in a side test stack because this is not something we want to focus on when developing / fixing issues in fastify. Webpack and webpack-cli are kind of heavy weight packages and we don't want to arm developer experience with those.

Currently the bad version plugin registration will not make the build fail in the current state of fastify. I'm ok to land it this way untill we find a proper solution for the release process.

@github-actions github-actions bot added test Issue or pr related to our testing infrastructure. and removed test Issue or pr related to our testing infrastructure. labels Aug 7, 2021
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

@mcollina
Copy link
Member

mcollina commented Aug 9, 2021

I think we should add a bit of documentation somewhere about this.

@mcollina
Copy link
Member

mcollina commented Aug 9, 2021

(a follow-up PR to fix this would be highly appreciated)

@zekth
Copy link
Member Author

zekth commented Aug 9, 2021

I think we should add a bit of documentation somewhere about this.

This PR was more of a POC to see if the team is ok for the implementation. I'll write a Readme on this bundler folder to explain how it works.


// Untill there is no proper solution for bundlers, the fastify version
// is set to undefined for this context
test('Bundler should work with bad plugin version, undefined version', t => {
Copy link
Member

Choose a reason for hiding this comment

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

Is this test going to pass or not? I'm not sure it would. Maybe we should skip it in case - I want all the CI to stay green.

Copy link
Member Author

Choose a reason for hiding this comment

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

So theorically on a non bundled environment it would fail, but on bundled environment because of the fallback in here:

return pkg.name === 'fastify' ? pkg.version : undefined
it's set to undefined. So it passes.

Copy link
Member

Choose a reason for hiding this comment

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

Can you clarify the comment so that it's clear what we should change here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure

@mcollina
Copy link
Member

mcollina commented Aug 9, 2021

I think a simple solution for the webpack problem might be to store only the major within the source code. This does not create an addition of the maintenance burden and it provides a minimal version of this feature for bundled usage.

@jsumners
Copy link
Member

jsumners commented Aug 9, 2021

I think a simple solution for the webpack problem might be to store only the major within the source code. This does not create an addition of the maintenance burden and it provides a minimal version of this feature for bundled usage.

In my opinion, that's effectively removing the feature. We routinely release new features as part of minor, and sometimes even patch, that define a new minimum version for applications. For example, if you want to access this.server in a decorator you should be specifying 3.17.0 as the minimum supported Fastify version.

@mcollina
Copy link
Member

mcollina commented Aug 9, 2021

I think a simple solution for the webpack problem might be to store only the major within the source code. This does not create an addition of the maintenance burden and it provides a minimal version of this feature for bundled usage.

In my opinion, that's effectively removing the feature. We routinely release new features as part of minor, and sometimes even patch, that define a new minimum version for applications. For example, if you want to access this.server in a decorator you should be specifying 3.17.0 as the minimum supported Fastify version.

I'm happy to completely disable the feature for webpack usage.

@zekth zekth added the test Issue or pr related to our testing infrastructure. label Aug 12, 2021
@zekth
Copy link
Member Author

zekth commented Aug 24, 2021

Do we aim to land it this way and find a solution for the version resolution in a further pr? (should i rebase?)

@github-actions github-actions bot removed the test Issue or pr related to our testing infrastructure. label Aug 24, 2021
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 let's land this as is and then evolve.

@zekth zekth merged commit 1492956 into fastify:main Aug 31, 2021
@zekth zekth deleted the webpack_package branch August 31, 2021 08:03
@github-actions
Copy link

github-actions bot commented Sep 1, 2022

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test webpack bundling
3 participants