Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

feat(holocron-module-register-plugin): move to webpack 5 #154

Merged
merged 5 commits into from
Oct 25, 2023

Conversation

code-forger
Copy link
Member

Description

Support webpack 5 in a new major version of the registration plugin

NOTE: this should be released as alpha until its consumed into one-app-bundler and rigorously tested.

How Has This Been Tested?

unit tests, used to build a module locally

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (adding or updating documentation)
  • Dependency update

Checklist:

  • My change requires a change to the documentation and I have updated the documentation accordingly.
  • My changes are in sync with the code style of this project.
  • There aren't any other open Pull Requests for the same issue/update.
  • These changes should be applied to a maintenance branch.
  • This change requires cross browser checks.
  • This change impacts caching for client browsers.
  • This change adds additional environment variable requirements for Holocron users.
  • I have added the Apache 2.0 license header to any new files created.

What is the Impact to Developers Using Holocron?

None, should be perfectly drop in

@PixnBits

This comment was marked as resolved.

@code-forger
Copy link
Member Author

@PixnBits The holocron package should not need a major version bump, only the webpack plugin

@JAdshead JAdshead requested a review from a team October 5, 2023 17:17
@JAdshead JAdshead marked this pull request as draft October 5, 2023 17:17
@code-forger code-forger force-pushed the v2.0.0-alpha-webpack-5 branch 2 times, most recently from 6455ee1 to 3d20f15 Compare October 13, 2023 12:51
@code-forger code-forger changed the title V2.0.0 alpha webpack 5 feat(holocron-module-register-plugin): move to webpack 5 Oct 13, 2023
@code-forger code-forger marked this pull request as ready for review October 13, 2023 13:02
BREAKING CHANGE : This change is breaking as it directely
interacts with webpacks source structure, which is changed in v5
Co-authored-by: Matthew Mallimo <[email protected]>
@@ -130,6 +134,6 @@ describe('HolocronModuleRegisterPlugin', () => {

await waitForWebpack(options);
const fileContents = fs.readFileSync(path.join(buildPath, outputFileName)).toString();
expect(fileContents.endsWith(`Holocron.registerModule("${moduleName}", ${holocronModuleName});})();`)).toBe(true);
expect(fileContents).toContain('Holocron.registerModule("some-module", holocronModule-some-module);');
Copy link
Member

Choose a reason for hiding this comment

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

The kebab-case holocron-some-module can't be right. Isn't that supposed to be a variable name?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, however this tests shows that the plugin takes the name specified. We are specifying a non-camel-case module variable name up on Line 122

I have not changed this, just made the 'snapshot' literal instead of templated, so we can visually see that the name passed is accepted and inserted.

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed in ea09da2

JAdshead
JAdshead previously approved these changes Oct 16, 2023
@code-forger code-forger merged commit e2216d4 into main Oct 25, 2023
4 checks passed
@code-forger code-forger deleted the v2.0.0-alpha-webpack-5 branch October 25, 2023 13:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants