Skip to content

Conversation

@MauriceAyasse
Copy link
Contributor

Description

This fixes the problem described in #482.

Shared library build files now receive a content hash in their file name (e.g., __federation_shared_react-000ea6e2.js). With this change, it becomes easier to implement a caching solution in the browser. Consequently, the browser can respond to changes in shared libraries when their content changes.

Caching should now be possible; otherwise, this would have a performance impact. Theotther JavaScript chunks already have hashes, so it is only reasonable to add them here as well.

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

@MauriceAyasse MauriceAyasse marked this pull request as draft August 31, 2023 15:03
@chris-muller
Copy link

I couldn't find any information on how this repo accepts contributions. This PR would fix an issue we had in production, is there anything I can do to help get this merged?

@ygj6 @flyfishzy @PeterAlfredLee

@Jiannan-dev
Copy link
Collaborator

I couldn't find any information on how this repo accepts contributions. This PR would fix an issue we had in production, is there anything I can do to help get this merged?

@ygj6 @flyfishzy @PeterAlfredLee

Hi,before a PR can be merged in, it should first be released from draft status.

@MauriceAyasse MauriceAyasse force-pushed the support-shared-lib-hash-name branch from 6dbd1b8 to dfb9cd6 Compare September 8, 2023 11:16
@MauriceAyasse
Copy link
Contributor Author

MauriceAyasse commented Sep 8, 2023

There was a change needed so this PR was still in the draft status.

I changed the parameters of this.emitFile() to only use the name. The file resolution should work with the import.meta.ROLLUP_FILE_URL_referenceId variable, so a custom file name should not be required. As a result, the hash algorithm and resolution of Rollup.js will be used on the shared libraries.

@MauriceAyasse MauriceAyasse marked this pull request as ready for review September 8, 2023 11:34
@Jiannan-dev Jiannan-dev self-requested a review September 24, 2023 05:25
Copy link
Collaborator

@Jiannan-dev Jiannan-dev left a comment

Choose a reason for hiding this comment

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

LGTM

@Jiannan-dev Jiannan-dev merged commit 055c759 into originjs:main Sep 24, 2023
@MauriceAyasse MauriceAyasse deleted the support-shared-lib-hash-name branch September 24, 2023 10:51
@Sultanyaron
Copy link

@ruleeeer Hi, any plans to release this?

@sethsandaru
Copy link

curios for the release date too @ruleeeer , thanks

@Jiannan-dev
Copy link
Collaborator

Jiannan-dev commented Sep 28, 2023

@Sultanyaron @sethsandaru
1.3.2 has been released

@linux-nerd
Copy link

Is there a way to opt out of the hash in the file name?

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.

6 participants