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

Add appendToEntries to allow outside sources to add to the final entries object before compilation #1932

Merged
merged 1 commit into from
Jun 8, 2021

Conversation

dahukish
Copy link
Contributor

@dahukish dahukish commented Jun 2, 2021

Description

Essentially we need a way to expose the final entries generated by this plugin without exposing to much or have to know about anything besides entries. The new callback allows the entries to still be passed to webpack while allowing for optional final edits before compilation. This is currently needed to support HMR properly using sewing-kit.

Related: https://github.com/Shopify/sewing-kit/pull/2686

Type of change

  • Patch: Bug (non-breaking change which fixes an issue)
  • Minor: New feature (non-breaking change which adds functionality)
  • Major: Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have added a changelog entry, prefixed by the type of change noted above (Documentation fix and Test update does not need a changelog as we do not publish new version)

@shopify-shipit shopify-shipit bot deployed to beta-magic-entries June 4, 2021 18:10 Active
@shopify-shipit shopify-shipit bot deployed to beta-magic-entries June 4, 2021 18:58 Active
@dahukish dahukish marked this pull request as ready for review June 4, 2021 21:50
@dahukish dahukish requested a review from a team June 4, 2021 21:50
@dahukish dahukish changed the title WIP Add callback function to allow outside sources to add to the final entries object before compilation Jun 4, 2021
@dahukish dahukish self-assigned this Jun 4, 2021
@dahukish dahukish changed the title Add callback function to allow outside sources to add to the final entries object before compilation Add appendToEntries to allow outside sources to add to the final entries object before compilation Jun 7, 2021
@shopify-shipit shopify-shipit bot deployed to beta-magic-entries June 7, 2021 21:04 Active
Copy link
Contributor

@marutypes marutypes left a comment

Choose a reason for hiding this comment

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

Haven't tophatted but code and approach checks out to me. Would like a bit of documentation around the new callback but otherwise 👍

const name = 'node-virtual-module-entrypoints';
await withWorkspace(name, async ({workspace}) => {
await workspace.write('index.js', ENTRY_A);
await workspace.write('cats.js', CATS_MODULE);
Copy link
Contributor

Choose a reason for hiding this comment

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

🐱 🐈

Copy link
Collaborator

@vsumner vsumner left a comment

Choose a reason for hiding this comment

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

Code makes sense. +1 to what @TheMallen said about documentation.

@dahukish dahukish merged commit d564e87 into main Jun 8, 2021
@dahukish dahukish deleted the beta-magic-entries branch June 8, 2021 18:52
@shopify-shipit shopify-shipit bot temporarily deployed to production June 8, 2021 19:51 Inactive
@shopify-shipit shopify-shipit bot deployed to production-jest-transform-27 June 16, 2021 15:18 Active
@shopify-shipit shopify-shipit bot had a problem deploying to production-graphql-mini-transforms-webpack-5 June 17, 2021 20:37 Failure
@shopify-shipit shopify-shipit bot deployed to production-graphql-mini-transforms-webpack-5 June 17, 2021 21:25 Active
@shopify-shipit shopify-shipit bot temporarily deployed to gem June 23, 2021 20:18 Inactive
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.

3 participants