Skip to content
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 package.json #1091

Closed
wants to merge 1 commit into from
Closed

Update package.json #1091

wants to merge 1 commit into from

Conversation

FDiskas
Copy link

@FDiskas FDiskas commented Oct 25, 2019

Closes #1078

Description

Additional Information

@tysongach
Copy link
Contributor

Can you please provide more detail and documentation around this change? I understand the issue to be around using Parcel with Bourbon; if you know of documentation to link to regarding how they use the main key, that would be valuable.

@FDiskas
Copy link
Author

FDiskas commented Oct 25, 2019

Usually bundlers are resolving packages entry points specified in this main keyword
There is more discussion webpack/webpack#1789 (comment)
Documentation https://docs.npmjs.com/files/package.json#main

@FDiskas
Copy link
Author

FDiskas commented Oct 25, 2019

I believe that this change will help others to use you lib with bundlers like webpack...

@tysongach
Copy link
Contributor

tysongach commented Oct 25, 2019

This is a bit of a brain dump because I don’t fully understand how all of the different JavaScript Sass implementations handle @import and how the main field works…

  • This change—as is—would maybe break our eyeglass integration
    • The entire premise of eyeglass, to me, is basically making @import "bourbon" work
    • Have you tried using eyeglass?
  • This change also sort disregards entirely our index.js file in this repo and it is there to make @import work within node-sass
    • You can read about node-sass's includePaths here
    • So, I also think this change—as is—would break our node-sass integration
  • It seems this change is based entirely around using Dart Sass with Bourbon.
  • I’m not sure just placing the path to our primary Sass manifest magically makes Sass @import work, as you seem to indicate
    • If you have documentation on this, please do share!
    • npm is primarily designed for JavaScript, and I think—generally speaking—most things expect main to point to a JavaScript file to run something
    • Long ago, we had main set to our manifest but Sass @import did not work then
  • A style field was added to our package.json in c10f0bf which points to core/_bourbon.scss, as you’ve done here
    • The impetus for that change and conversation in PR Add style property to package.json, allowing for easier imports. #978 was very similar to this one, which was desire to have @import "bourbon" work in their Node/npm-based workflows. Though, it should be noted that only specific Sass tools support that field.
    • I’m sort of regretting merging that change because I now think sass is a better field than style because Bourbon is pure Sass, not CSS.
  • A completely different approach could be to move the core directly on package build (pre-publish to npm), therefore the import could be something like bourbon/bourbon instead of bourbon/core/bourbon (a step in the right direction, perhaps)
  • I have a hunch the a more robust solution will require us defining specific Sass compiler support and somehow checking for which one is running when someone is trying to use Bourbon…
  • I’m sort of wondering if we even need to support node-sass, given that Dart Sass is now the primary implementation
  • I miss the old days with Ruby Sass was the thing, and @import just worked nicely in Rails apps.

Finally, if you can, please provide instructions for how to test this change. What are the exact steps you took to test this on your end?

@tysongach
Copy link
Contributor

I pulled down your demo repo and manually made this change to Bourbon’s package.json inside node_modules and the issue still persists.

I’m going to close as I’m unable to find any documentation that this fix resolves the issue, and in testing am unable to confirm the fix, as well.

@tysongach tysongach closed this Dec 17, 2019
@FDiskas FDiskas deleted the patch-1 branch December 18, 2019 13:30
@meduzen
Copy link
Contributor

meduzen commented Dec 29, 2019

Side note here:

I’m sort of wondering if we even need to support node-sass, given that Dart Sass is now the primary implementation

This makes me think about something Bourbon maintainers are maybe not aware of: @import is now deprecated and will be removed from SASS in < 2 years, replaced by a module system that’ll require from SASS libraries maintainers to update their code.

On this topic, I recommend:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

can't resolvebourbon
3 participants