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

Scripts: Added chunk filename in webpack config to avoid reading stale files #58176

Conversation

rithik56
Copy link
Contributor

What?

Fixes #55397

Why?

Bug Fix

How?

By adding chunkFileName method in webpack.config.js and appending chunkhash in query params in order to avoid reading stale files from browser cache

Testing Instructions

N/A

Testing Instructions for Keyboard

N/A

Screenshots or screencast

N/A

Copy link

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Type-related labels to choose from: [Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Performance, [Type] Project Management, [Type] Regression, [Type] Security, [Type] WP Core Ticket, Backport from WordPress Core.
  • Labels found: .

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Jan 24, 2024
Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @rithik56! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

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

There CI issues reported, because the webpack config setting added has a typo in it.

Is this branch up to date with changes applied to trunk?

packages/scripts/config/webpack.config.js Outdated Show resolved Hide resolved
@gziolo gziolo added [Tool] WP Scripts /packages/scripts [Type] Bug An existing feature does not function as intended labels Jan 25, 2024
@rithik56
Copy link
Contributor Author

Thanks @gziolo for reviewing the code, I will make the neccessary changes in this PR

@gziolo gziolo changed the title added chunk filename in webpack config to avoid reading stale files f… Scripts: Added chunk filename in webpack config to avoid reading stale files Aug 30, 2024
Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

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

I confirm that it fixes the issue.

Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @rithik56.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: rithik56.

Co-authored-by: gziolo <gziolo@git.wordpress.org>
Co-authored-by: jsnajdr <jsnajdr@git.wordpress.org>
Co-authored-by: johnstonphilip <johnstonphilip@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@gziolo gziolo enabled auto-merge (squash) August 30, 2024 07:49
@gziolo gziolo merged commit 77784ee into WordPress:trunk Aug 30, 2024
59 checks passed
Copy link

Congratulations on your first merged pull request, @rithik56! We'd like to credit you for your contribution in the post announcing the next WordPress release, but we can't find a WordPress.org profile associated with your GitHub account. When you have a moment, visit the following URL and click "link your GitHub account" under "GitHub Username" to link your accounts:

https://profiles.wordpress.org/me/profile/edit/

And if you don't have a WordPress.org account, you can create one on this page:

https://login.wordpress.org/register

Kudos!

@github-actions github-actions bot added this to the Gutenberg 19.2 milestone Aug 30, 2024
bph pushed a commit to bph/gutenberg that referenced this pull request Aug 31, 2024
…e files (WordPress#58176)

* added chunk filename in webpack config to avoid reading stale files from cache

* fixed typo in webpack config

* Update CHANGELOG.md

---------

Co-authored-by: Greg Ziółkowski <grzegorz@gziolo.pl>

Unlinked contributors: rithik56.

Co-authored-by: gziolo <gziolo@git.wordpress.org>
Co-authored-by: jsnajdr <jsnajdr@git.wordpress.org>
Co-authored-by: johnstonphilip <johnstonphilip@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Tool] WP Scripts /packages/scripts [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scripts: Lazy loaded JavaScript files do not break browser cache upon changes
2 participants