-
Notifications
You must be signed in to change notification settings - Fork 45
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
experimental ideas in passing a filesystem to the context. #56
Conversation
lib/src/context.dart
Outdated
@@ -4,7 +4,8 @@ | |||
|
|||
import 'dart:math' as math; | |||
|
|||
import '../path.dart' as p; | |||
import 'package:file/file.dart' as fs; |
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 left a comment on the original issue - I think this is an SDK problem if we can confirm that Uri.base
does something unexpected in the zone with an overridden filesystem.
If we do decide that we need to do something in this package we'll need to find a way to do it without depending on package:file
. This is a very core package in the Dart ecosystem, and maintaining no dependencies is critical.
OK, let me do some testing and get back to you.
One I understand what is happening we can work out what if anything we need
to do with package:file.
Brett.
…On Thu, 12 Dec 2019 at 10:47, Nate Bosch ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In lib/src/context.dart
<#56 (comment)>:
> @@ -4,7 +4,8 @@
import 'dart:math' as math;
-import '../path.dart' as p;
+import 'package:file/file.dart' as fs;
I left a comment on the original issue - I think this is an SDK problem if
we can confirm that Uri.base does something unexpected in the zone with
an overridden filesystem.
If we *do* decide that we need to do something in this package we'll need
to find a way to do it without depending on package:file. This is a *very*
core package in the Dart ecosystem, and maintaining no dependencies is
critical.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#56?email_source=notifications&email_token=AAG32OHABPZLHSKDLLF44EDQYF3YTA5CNFSM4JZO6IBKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCO4WOGI#pullrequestreview-330917657>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAG32OBBP3EOBJQ3I5VU2WLQYF3YTANCNFSM4JZO6IBA>
.
|
So this is untested. This version has a much smaller change set now that I understand the function of a Context. This version feels like it might actually do the job. Comments? |
All unit tests are now passing and no external dependencies. |
I've pushed this PR to start a discussion around #55
I've more work to do but it looks like we could passing an optional filesystem to a context makes a lot of sense.
This then broadly allows path to support multiple file systems as dart does.
We will still need a zone in order to inject a filesystem into the default context.
I think that the logic would be that when 'current' is calling _readCWD that _readCWD would check for a zone key if and only if:
The context is running in a non-root zone.
No file system has been passed.
This is perhaps a little limiting as there may be circumstances where you want to pass a filesystem to a context and then still overload it using a zone.
If that is the case then we should simply say that if the zone has a filesystem key (e.g. #path.filesystem) then we should always use that filesystem.
Thoughts?
I will look to push sample code with a zone in the next few days.
Brett