-
Notifications
You must be signed in to change notification settings - Fork 94
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
Major feature: match() #163
Conversation
I know I touched a lot of stuff, but I hope you will find some time to quick-review the PR nevertheless. If you are in a hurry, just check out the changed markdown files to see what changes for the user instead of reviewing the under-the-hood changes 😉 |
docs/BLOCK-CREATION.md
Outdated
* `exclude`: Condition(s) which paths not to match. Might not be present. | ||
* `include`: Condition(s) to override `exclude`. Might not be present. | ||
|
||
If the block is not used within a `match()` then `context.match` will be undefined. |
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.
👍
]) | ||
}) | ||
|
||
test('Postcss works with css() & match()', t => { |
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.
I would add a sass & match test case
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.
Sure 👍
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.
Done. But I added it to the global integration test (packages/webpack/__tests__/integration.test.js
).
28b238e
to
86bcdb7
Compare
Last chance to review this PR. Going to merge it today or tomorrow. Will publish |
I think we should get rid of |
Fair enough. I am not sure if we even need a In this case we would just change our loaders and deprecate |
If it’s only for custom loaders then it’s good enough ;-) |
What do you mean by "if it’s only for custom loaders"? |
Blocks, not loaders ;-) |
I agree - there's not really a need for it any more, and it unnecessarily complicates things in my opinion. I like the |
I pushed a commit to replace all usages of I'd say this can now be published as 1.0 beta. We can introduce a warning message in the next version and remove it completely in the version thereafter. |
Awesome! 🎉 |
Published as |
This is quite a big pull request (sorry!), but it comes with a bunch of neat improvements, I think:
match()
to get rid of inconsistentexclude
/include
options in blocksexclude
/include
options@webpack-blocks/assets
(css()
,file()
&url()
block) changed noticeablyNeeded to touch all blocks for this (😱), but I used this opportunity to improve the block tests a bit and add a few new tests. Also cleaned up some nasty code bits.
Please have a look, do a quick check of the changed code and read the updated docs if you can find some time. I would like to publish this as
1.0.0-beta
.Shout if you disagree with something, I was out on a limb here 😉