+
Skip to content

Conversation

drzax
Copy link
Member

@drzax drzax commented Jul 30, 2020

Create a selectMlountPoints function which wraps up a bunch of other functionality, including:

  • marking points as used by default
  • not selecting used mounts
  • optional automatic block mount conversion

This is a non-breaking change, but ultimately I think we should encurage use of this function as
the main API method and deprecate or remove some of the other methods that don't handle marking
mount points as used.

There may be better ways to implement this, but it's a start for disucssion.

This also gets pretty close to 100% test coverage.

@drzax drzax requested a review from colingourlay July 30, 2020 23:08
Copy link
Contributor

@colingourlay colingourlay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm down with this.

Is it worth exporting INSTANCE_ID, or better to trust that 'owned' mount points are entirely handled internally?

Also, the pedant in me would change selectMountPoints to selectMounts unless we wanted to apply the "points" terminology to the whole API surface area. I'm not against that (it's probably better), but it'd be a breaking change.

The sooner we address that, and your other API change propositions, the better. Usage is pretty small right now, so it's the best time to make breaking changes.

@drzax
Copy link
Member Author

drzax commented Jul 31, 2020

My instinct on the export of INSTANCE_ID is to keep it private just to keep the API small, but given that it's already exporting isUsedBy which only makes sense if the returned value can be compared against something. I could be convinced either way.

I'd also like make it so the default is to ensure block mounts. That should be fine right? You'd just have to add options for the usage in legacy interactives mentioned.

Happy to go with the original nomenclature, I'll update the function name.

What are your thoughts on removing/privatising other functions? I feel like you're not that into it.

@drzax
Copy link
Member Author

drzax commented Jul 31, 2020

One more thing that doesn't pertain specifically to this pull request, but that I wanted to write down somewhere: something in the build process here isn't handling transpilation of the spread operator correctly. I originally had this line as [...document.querySelectorAll(s)] but it ended up in the built output as [].concat(NodeList) which is an array with a single item (the node list) which then contains the relevant nodes.

It was a hard one to track down and I still don't know how to write a test for it, because it was passing all the tests. Assume there's something up with the babel config, but went with the simpler solution.

@drzax drzax requested a review from colingourlay August 5, 2020 04:22
@drzax
Copy link
Member Author

drzax commented Aug 5, 2020

Gonna merge this soon if there are no other comments.

Still keen to hear what you think about removing some of the other public methods @colingourlay.

@colingourlay
Copy link
Contributor

Still happy with the latest changes. I'm all for trimming the API down, because it'll discourage a wide range of uses that'd be hard to re-focus later. Getting access to selectors was only really useful when the library itself wasn't doing any DOM selection, but now that it does, those kinds of functions can go.

@drzax drzax merged commit 05cd49f into master Aug 5, 2020
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.

2 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载