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

Webpack 5 support #1579

Open
mhauens opened this issue Jun 8, 2021 · 26 comments
Open

Webpack 5 support #1579

mhauens opened this issue Jun 8, 2021 · 26 comments

Comments

@mhauens
Copy link

mhauens commented Jun 8, 2021

As preact-cli is still using webpack@4.46.0, ist there a plan to upgrade to latest webpack 5 version?

@rschristian
Copy link
Member

As far as I know there is no current plan in motion for doing so, no. It'd certainly be a nice-to-have, but there's at least a few dependencies that need some work / reevaluation and are holding us back from updating as they're not compatible. And that's not taking into account the work needed to make that upgrade happen, or if anyone is willing to do it.

Most active development is over on WMR at the moment.

@adroitwhiz
Copy link

Webpack v4 is broken on Node 17 and up with no plans to fix it (webpack/webpack#14532), so if preact-cli is in fact unmaintained and there's no work being put into upgrading to Webpack 5, an official deprecation notice would be nice.

@rschristian
Copy link
Member

Preact-CLI isn't necessarily unmaintained, as you can see via the commit history, work has been done recently. But keeping up with the rapidly changing Webpack ecosystem is extremely time consuming on the small group of volunteer maintainers (see preactjs/wmr#867 (comment) for some great context)

I don't think anyone is ready to deprecate yet (or I haven't heard anything at least) but community contributions are certainly always welcome. If anyone has some experience or wants to put together a PR, I'm sure people would be happy to review.

I believe I had a WIP sitting around, so I might be able to take a look at it over the coming week.

Appreciate the heads-up on that Webpack issue! Good to know that might be a problem.

@ForsakenHarmony
Copy link
Member

Webpack v4 is broken on Node 17 and up with no plans to fix it (webpack/webpack#14532), so if preact-cli is in fact unmaintained and there's no work being put into upgrading to Webpack 5, an official deprecation notice would be nice.

As long as it works with Node 16 I don't see any reason to do so right now, Node 17 is "Current" and will never be LTS. ("Production applications should only use Active LTS or Maintenance LTS releases.").

With Node 18 however, things might change, and it would suck if we can't support it.

This was referenced Jan 29, 2022
Merged
meyer added a commit to jsxstyle/jsxstyle that referenced this issue Jun 4, 2022
Looks like webpack 5 support isn’t arriving anytime soon: preactjs/preact-cli#1579
@FrantzUml

This comment was marked as off-topic.

@rschristian

This comment was marked as off-topic.

@FrantzUml

This comment was marked as off-topic.

@rschristian

This comment was marked as off-topic.

@rschristian
Copy link
Member

Bit of a status update for any who are curious: v4 is coming along, hopefully to be published in the next couple of months.

If anyone is interested in trying out a prerelease version and providing feedback, it can be installed by executing the following:

$ [npm install / yarn add] https://gitpkg.now.sh/preactjs/preact-cli/packages/cli\?next

An unrefined set of changelogs can be found here: https://github.com/preactjs/preact-cli/tree/next/.changeset

Let me know if there's any comments, concerns, issues, etc.

Thanks!

@niknah
Copy link

niknah commented Jan 2, 2023

https://gitpkg.now.sh/preactjs/preact-cli/packages/cli\?next` is serving blank pages for me.

I'm using the default project created from...
npx preact-cli create default my-project

@rschristian
Copy link
Member

rschristian commented Jan 2, 2023

https://gitpkg.now.sh/preactjs/preact-cli/packages/cli\?next` is serving blank pages for me.

I'm using the default project created from...

npx preact-cli create default my-project

Did you read through the change logs and make the necessary adjustments? That project creation command is for v3 as are the templates.

This is not even a prerelease of v4, hence the installation straight from GitHub (or rather, from a site that supports installing from a GitHub monorepo). The templates therefore might not match up, you'll need to go by the change log or provide some more info. It could be a bug.

Edit: You might be able to use the next branch for the default template, not sure: npx preact-cli create preactjs-templates/default#next my-project

@niknah
Copy link

niknah commented Jan 2, 2023

Yes, preactjs-tempates/defaultnext works.

@oteoe
Copy link

oteoe commented Jan 9, 2023

https://gitpkg.now.sh/preactjs/preact-cli/packages/cli?next` is serving blank pages for me.
I'm using the default project created from...
npx preact-cli create default my-project

Did you read through the change logs and make the necessary adjustments? That project creation command is for v3 as are the templates.

This is not even a prerelease of v4, hence the installation straight from GitHub (or rather, from a site that supports installing from a GitHub monorepo). The templates therefore might not match up, you'll need to go by the change log or provide some more info. It could be a bug.

Edit: You might be able to use the next branch for the default template, not sure: npx preact-cli create preactjs-templates/default#next my-project

any hints on when can we expect a prerelease of v4?

@rschristian
Copy link
Member

rschristian commented Jan 9, 2023

I could maybe try to get one out today.

@oteoe
Copy link

oteoe commented Jan 9, 2023

I could maybe try to get one out today.

That would be great, would be happy to test

@rschristian
Copy link
Member

rschristian commented Jan 9, 2023

Well alright, 4.0.0-next.1 has been published on NPM!

Some getting started notes:

  • We have a brand-new project initializer that is much faster than the old and will automatically consume the correct (next) branches for the templates. You can run $ [npm init / yarn create] preact-cli <template> <project-name> to use it.
  • Some of the flags have changed, make sure to review the README.md
  • The underlying Webpack config obviously has changed a fair bit. If you're making use of a preact.config.js, please do comment it all out and figure out the adjustments you need to make after you have a working project.
  • <% preact.headEnd %> and <% preact.bodyEnd %> are no longer supported in your template.html! There is an error message with instructions if you've kept it around, but please do be aware that you'll need to swap it out with the new template. You can find it here and new projects will copy it automatically. As with v3, if you don't have a copy in your project, no worries. CLI brings its own and will use that instead. So if you don't need or want to make alterations it's not an issue.

Again, an unrefined set of changelogs if you want to read through the precise changes and justification behind them: https://github.com/preactjs/preact-cli/tree/next/.changeset

Of course, this is prerelease software so there might be issues here and there. If you encounter them, please let me know! I'd love to fix them.

Thanks everyone!

Edit: And do be aware, this does not mean the API is finalized! There may (and likely will) be breaking changes between these next versions.

@oteoe

This comment was marked as off-topic.

@rschristian

This comment was marked as off-topic.

@giulianopiovezan
Copy link

Hi @rschristian, any updates about v4 to be stable and realeased?

@rschristian
Copy link
Member

rschristian commented Apr 17, 2023

Hi @rschristian, any updates about v4 to be stable and realeased?

Well, so far I've only gotten feedback from a single individual -- without people testing, I'm not super thrilled about pushing out as stable. Have you been using the prerelease? Any issues, comments, concerns?

There are some things I'd like to change yet, but that depends on finding large blocks of free time.

I'm not planning on causing too much in the way of breakage between the prerelease and stable, so certainly use it now if you aren't already.

@maitrungduc1410
Copy link

maitrungduc1410 commented Apr 29, 2023

hope to see this available soon, our team is building a microfrontend framework that supports multiple UI lib/framework and Preact is our next target.

Module Federation's only available from Webpack 5

@rschristian
Copy link
Member

hope to see this available soon, our team is building a microfrontend framework that supports multiple UI lib/framework and Preact is our next target.

Module Federation's only available from Webpack 5

Not that this should inhibit you anyways, but microfrontends are quite near to being the opposite of Preact-CLI's target... I think it's quite unlikely whatever you're building a) makes sense to use with Preact-CLI and b) is implementable without extensive hacking of the config.

I'm not entirely sure how a frontend framework would be integrated in without other frameworks in the very same space, but sounds neat though!

@kentr

This comment was marked as off-topic.

@rschristian

This comment was marked as off-topic.

@kentr

This comment was marked as off-topic.

@rschristian

This comment was marked as off-topic.

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

No branches or pull requests

10 participants