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

Provide the ability to re-order imports #1

Closed
Dan503 opened this issue Sep 23, 2018 · 3 comments
Closed

Provide the ability to re-order imports #1

Dan503 opened this issue Sep 23, 2018 · 3 comments
Labels
breaking change This issue introduces a breaking change that requires a new major version to be released new feature New feature or request

Comments

@Dan503
Copy link
Owner

Dan503 commented Sep 23, 2018

In CSS the order that styles are written in matters significantly.

Currently, if you use gulp-file-loader to load scss files. You have no easy way of adjusting the order that the modules are loaded in. This is a pretty big problem for a language where order is so critically important.

@Dan503 Dan503 added new feature New feature or request in progress This issue is currently being worked on labels Sep 23, 2018
Dan503 added a commit that referenced this issue Sep 25, 2018
This was an attempt at fixing this issue:
#3

I needed to do most of this work as part of fixing this issue anyway:
#1

I successfully managed to get the compiler to only run if the paths matched, but then I completely changed the format of the output and it didn't change the format of the output because the paths were still all the same. >_<

I think I will just close issue #3. The only way I can make sure it works is if I go almost all the way to creating the file but stop just short of outputting something.
Dan503 added a commit that referenced this issue Sep 26, 2018
This is my initial attempt at solving this issue:
#1

I haven't tested it yet, hopefully it works.
Dan503 added a commit that referenced this issue Sep 26, 2018
If a file is removed from the file system and order retention is enabled, it is now also removed from the output file.

#1
@Dan503 Dan503 added ready for release Work on this issues is done and is just waiting to be released to npm and removed in progress This issue is currently being worked on labels Sep 26, 2018
@Dan503
Copy link
Owner Author

Dan503 commented Sep 26, 2018

Still need to update the readme with new instructions about how to use the new feature.

  1. Apply retainOrder: true setting
  2. Save the output in git
  3. Move lines up and down inside the file
  4. File imports that no longer exist will be removed
  5. New file imports will be added to the bottom of the list.

@Dan503 Dan503 added needs documentation The documentation needs to be updated to accommodate this issue development complete The technical development work required for this issue is complete ready for release Work on this issues is done and is just waiting to be released to npm breaking change This issue introduces a breaking change that requires a new major version to be released and removed ready for release Work on this issues is done and is just waiting to be released to npm development complete The technical development work required for this issue is complete needs documentation The documentation needs to be updated to accommodate this issue labels Sep 27, 2018
@Dan503
Copy link
Owner Author

Dan503 commented Sep 28, 2018

I needed to introduce a breaking change to get this feature working.

Before, you were able to use $path in your format setting as many times as you wanted. This made it incredibly difficult to explain in regex where one import began and another one ended due to how many types of characters are allowed to be used in a file name.

To simplify this, I have restricted the $path placeholder to only being used once per format setting. I can't really think of a reason why you would need to announce a path more than once per file so I don't see any issues arising from this.

Even though I highly doubt anyone has used the $path setting more than once in a format setting, this is still a breaking change so it needs to be treated as such.

Dan503 added a commit that referenced this issue Sep 28, 2018
@Dan503 Dan503 removed ready for release Work on this issues is done and is just waiting to be released to npm labels Sep 29, 2018
@Dan503 Dan503 closed this as completed Sep 29, 2018
@Dan503
Copy link
Owner Author

Dan503 commented Sep 29, 2018

Fixed in v2.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change This issue introduces a breaking change that requires a new major version to be released new feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant