-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
fix: add syntax entry points to fix lazy load bug #238
Conversation
Fixes #237 The bundler cannot recognize the requires in the stylelint library for syntaxes, due to the lazy loads in the form `importLazy('package')` obscuring the require that is taking place. This patch adds each syntax as its own entry point to bypass this limitation. It will no longer be necessary when targeting stylelint 14. see: https://github.com/stylelint/stylelint/blob/13.13.1/lib/syntaxes/index.js
The tests are passing in CI, but I noticed this warning: (same on all 3 CI platforms) Looking at the CI run, I see:
|
I encountered this warning when initially configuring esbuild; the issue is that if you add server.js as an external dependency, the build errors out because it is also an entry point. I didn't see a way to configure different external dependencies per entry point, and it doesn't look like this warning results in any problematic behaviour. |
Thanks, I'm fine with this... I'll update my local and run the tests locally on some test repos I have this PR Hopefully this will help confirm that a follow up release works as expected Will report back here shortly |
Running
I also get some VS Code warnings on each of the tests, these can be ignored, I think:
The test errors are: 1.
2.
Unsure why these fail locally, will read and look a little closer |
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.
Thank you for the quick fix.
I've just run the above again on my laptop, same results. The above results were on an M1 Mac, these additional results on an Intel Mac |
@ntwb This discrepancy in test results between running tests in the project directory and elsewhere makes me wonder if we should find a way to have the tests enforce testing against the bundled stylelint and a local copy? If that had been the case, I think this whole bug would have been avoided entirely. That, or removing the bundled stylelint entirely per #36. |
I've tested it locally and everything works fine. I'm using macOS. |
If you have a globally installed stylelint, this extension will use it, so there may be differences in behavior. I don't have stylelint installed globally. |
Same here. @ntwb I have a feeling that the errors you're running into might be independent of this specific fix; I'm not at my computer right at this moment so I can't check for certain. Earlier, I made a copy of the syntax test folder and ran VS Code in it with this fix in it and the behaviour seemed to be what it should be, or at the very least what it was before the bundling update. |
In the meantime, should we merge this and throw out a patch release? I think we should make an issue or two to address the tests not covering all real-life scenarios or having different results in different contexts. |
Edit: Ignore the above, can do it after the PR is merged and release shipped |
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.
💯
Merged, bumped version to 0.87.3, updated changelog, cut a release, and published to the marketplace! |
✅ Testing v0.86.3Same results per local tests above, all good, thanks @adalinesimonian |
Fixes #237
The bundler cannot recognize the requires in the stylelint library for syntaxes, due to the lazy loads in the form
importLazy('package')
obscuring the require that is taking place.This patch adds each syntax as its own entry point to bypass this limitation. It will no longer be necessary when targeting stylelint 14.
see: https://github.com/stylelint/stylelint/blob/13.13.1/lib/syntaxes/index.js