-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Update loom to v1 #4544
Update loom to v1 #4544
Conversation
👋 It looks like you're updating JavaScript packages that are known You can deduplicate them with the
A duplicate React version may cause an invalid hook call warning. React context providers usually use module-scoped globals as their |
size-limit report
|
// them to work here either | ||
configuration.jestModuleMapper?.hook((moduleMapper) => { | ||
// them to work in jest tests either | ||
configuration.jestModuleNameMapper?.hook((moduleMapper) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should everything else follow suit moduleMapper
=> moduleNameMapper
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the naming of the argument isn't suuuper important as it's highly localised. I think leaving as moduleMapper gets the point across.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small comment, but
WHY are these changes introduced?
Updating loom to v1
WHAT is this pull request doing?
require()
andexport
and thus mixed cjs and esm and relied on transpiling to sort it out which i think is silly.How to 🎩
mv build build-og
yarn
to update dependencies, run ayarn clean
to delete the build folderyarn build
to generate a new builddiff -ru -x '*.tsbuildinfo' build-og build
to compare the old and new build output.What about loom-plugin-build-extended?
An excellent question, how good of you to ask.
loom-plugin-build-extended
includes support for loading scss files using node-sass. Its rollup plugin for handling styles is based upon the styles rollup plugin in polaris-react. However I am choosing not to remove this repo's styles plugin in favour of loom-plugin-build-extended.This is because we're intending to replace
node-sass
withdart-sass
inloom-plugin-build-extended
in the near future. For most projects, that's completely fine - they fix any migration from node-sass to dart-sass and they're good. However polaris-react ships a sass public api that needs to be understandable in apps that use node-sass (as sewing-kit still ships with node-sass) and within the polaris-react codebase.Migrating this codebase to dart-sass is possible, however it raises deprecation warnings in the publicly used functions that can only be fixed by migrating the codebase to dart-sass and those changes will throw errors when used by apps that leverage node-sass.
In order to migrate this codebase to dart-sass we need to either: remove the public sass API, or make sure that all consuming apps have migrated to use dart-sass using sewing-kit's dartSassLoader experiment (this is huge effort and a pain, just remove the public sass api please).
In order to not be in a place where this codebase is constantly raising deprecation warnings that can't be fixed without breaking consumers it's better to leave polaris-react using node-sass for the time being. Which means sticking with it having its own style loader.