Discussion:
[dart-misc] 1.20 Referencing content from packages dir
Greg Lowe
2016-10-07 09:14:03 UTC
Permalink
Hi All,

Now that the packages dir is gone in 1.20, what is the correct way to refer
to resources in dependencies.

i.e. in the past I could add the following to an html file to import a
script from the foo package:

<script src="packages/foo/bar.js"><script>

This doesn't work with 1.20 anymore as the packages dir does not exist. I
can fix this via pub get --packages-dir.

However I'm wondering what the "official" solution for this is.

Cheers,
Greg.
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
'Lasse R.H. Nielsen' via Dart Misc
2016-10-07 10:51:42 UTC
Permalink
You can resolve a package URI to a non-package name using

Uri actualURI =
await Isolate.resolvePackageUri(Uri.parse("package:foo/bar.js"));

That allows you to dynamically create a link to a file in a package.

If you want to statically make a reference to it, you need to know where
the file is *deployed*. That might very well be in a package directory, but
that depends entirely on how you deploy your web application to a web
server.

(I'm not familiar enough with "pub server" to say what it does, if that is
what you are using).

/L
Post by Greg Lowe
Hi All,
Now that the packages dir is gone in 1.20, what is the correct way to
refer to resources in dependencies.
i.e. in the past I could add the following to an html file to import a
<script src="packages/foo/bar.js"><script>
This doesn't work with 1.20 anymore as the packages dir does not exist. I
can fix this via pub get --packages-dir.
However I'm wondering what the "official" solution for this is.
Cheers,
Greg.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
Lasse R.H. Nielsen - ***@google.com
'Faith without judgement merely degrades the spirit divine'
Google Denmark ApS - Frederiksborggade 20B, 1 sal - 1360 KÞbenhavn K
- Denmark - CVR nr. 28 86 69 84
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
'Samuel Rawlins' via Dart Misc
2016-10-07 13:13:39 UTC
Permalink
This article goes very in-depth into the why, the how, the when, etc. of
the packages dir, and now how to get resources out of your package.

http://news.dartlang.org/2016/08/so-long-symlinks.html

Ultimately, Lasse's recommendation is the simplest.

On Fri, Oct 7, 2016 at 3:51 AM, 'Lasse R.H. Nielsen' via Dart Misc <
Post by 'Lasse R.H. Nielsen' via Dart Misc
You can resolve a package URI to a non-package name using
Uri actualURI =
await Isolate.resolvePackageUri(Uri.parse("package:foo/bar.js"));
That allows you to dynamically create a link to a file in a package.
If you want to statically make a reference to it, you need to know where
the file is *deployed*. That might very well be in a package directory, but
that depends entirely on how you deploy your web application to a web
server.
(I'm not familiar enough with "pub server" to say what it does, if that is
what you are using).
/L
Post by Greg Lowe
Hi All,
Now that the packages dir is gone in 1.20, what is the correct way to
refer to resources in dependencies.
i.e. in the past I could add the following to an html file to import a
<script src="packages/foo/bar.js"><script>
This doesn't work with 1.20 anymore as the packages dir does not exist. I
can fix this via pub get --packages-dir.
However I'm wondering what the "official" solution for this is.
Cheers,
Greg.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
'Faith without judgement merely degrades the spirit divine'
Google Denmark ApS - Frederiksborggade 20B, 1 sal - 1360 KÞbenhavn K
- Denmark - CVR nr. 28 86 69 84
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Greg Lowe
2016-10-07 21:59:57 UTC
Permalink
Thanks for the info.

I think that there may be a lot of apps that will stop working with pub
serve once 1.20 is released.

For example anyone who uses the react package and follows the example in
the readme will have this problem. https://pub.dartlang.org/packages/react

However `pub build` continues to work as this seems to copy resources into
`build/web`.

I had assumed that some "magic" would be added to `pub serve` to serve
`packages/*` files from the pub cache. This would mean that users with
static package links can continue with their existing development workflow.

If this change is intentional rather than an oversight then it's probably
worth reaching out to maintainers of packages like react, and asking them
to update their docs. Otherwise there will likely be a lot of confused end
users.

Cheers,
Greg.
Post by 'Samuel Rawlins' via Dart Misc
This article goes very in-depth into the why, the how, the when, etc. of
the packages dir, and now how to get resources out of your package.
http://news.dartlang.org/2016/08/so-long-symlinks.html
Ultimately, Lasse's recommendation is the simplest.
On Fri, Oct 7, 2016 at 3:51 AM, 'Lasse R.H. Nielsen' via Dart Misc <
Post by 'Lasse R.H. Nielsen' via Dart Misc
You can resolve a package URI to a non-package name using
Uri actualURI =
await Isolate.resolvePackageUri(Uri.parse("package:foo/bar.js"));
That allows you to dynamically create a link to a file in a package.
If you want to statically make a reference to it, you need to know where
the file is *deployed*. That might very well be in a package directory, but
that depends entirely on how you deploy your web application to a web
server.
(I'm not familiar enough with "pub server" to say what it does, if that
is what you are using).
/L
Post by Greg Lowe
Hi All,
Now that the packages dir is gone in 1.20, what is the correct way to
refer to resources in dependencies.
i.e. in the past I could add the following to an html file to import a
<script src="packages/foo/bar.js"><script>
This doesn't work with 1.20 anymore as the packages dir does not exist.
I can fix this via pub get --packages-dir.
However I'm wondering what the "official" solution for this is.
Cheers,
Greg.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to
http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google
Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send
--
'Faith without judgement merely degrades the spirit divine'
Google Denmark ApS - Frederiksborggade 20B, 1 sal - 1360 KÞbenhavn K
- Denmark - CVR nr. 28 86 69 84
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
'Bob Nystrom' via Dart Misc
2016-10-07 22:23:28 UTC
Permalink
Post by Greg Lowe
I think that there may be a lot of apps that will stop working with pub
serve once 1.20 is released.
There *shouldn't* be if we did our jobs right.
Post by Greg Lowe
For example anyone who uses the react package and follows the example in
the readme will have this problem. https://pub.dartlang.org/packages/react
However `pub build` continues to work as this seems to copy resources into
`build/web`.
Yup.
Post by Greg Lowe
I had assumed that some "magic" would be added to `pub serve` to serve
`packages/*` files from the pub cache. This would mean that users with
static package links can continue with their existing development workflow.
That magic is and has always been there 🎆. Pub never needed to look inside
the "packages" directory since it created it in the first place. Pub serve
and pub build look for where the referenced package actually is. The
"packages" directory is just a way to bake that same indirection into the
file system. Pub doesn't need it since pub itself is the canonical source
of truth in the first place.

Cheers!

– bob
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Istvan Soos
2016-10-07 22:30:08 UTC
Permalink
On Sat, Oct 8, 2016 at 12:23 AM, 'Bob Nystrom' via Dart Misc <
Post by 'Bob Nystrom' via Dart Misc
That magic is and has always been there 🎆. Pub never needed to look
inside the "packages" directory since it created it in the first place. Pub
serve and pub build look for where the referenced package actually is. The
"packages" directory is just a way to bake that same indirection into the
file system. Pub doesn't need it since pub itself is the canonical source
of truth in the first place.
With that, what is the suggested way for vendoring the dependencies into a
controlled rcs?

Cheers,
Istvan
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
'Bob Nystrom' via Dart Misc
2016-10-07 23:05:10 UTC
Permalink
Post by Istvan Soos
With that, what is the suggested way for vendoring the dependencies into a
controlled rcs?
"Vendor", "dependency", and "rcs" are incantations that summon different
beasts in different lands. Can you give me some details on what you mean by
them?

– bob
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Istvan Soos
2016-10-08 04:43:08 UTC
Permalink
It is simple, really: if we want to have a git or svn repository, where we
store both the dart sdk binaries and also the library dependencies, what is
the suggested layout for it, and what tools would you suggest to maintain
it (e.g. fetch and upgrade versions)?

In other words, how to achieve fully repeatable builds (that don't suck) in
the absence of internet connection inside the build environment.

Thanks,
Istvan

On Sat, Oct 8, 2016 at 1:05 AM, 'Bob Nystrom' via Dart Misc <
Post by 'Bob Nystrom' via Dart Misc
Post by Istvan Soos
With that, what is the suggested way for vendoring the dependencies into
a controlled rcs?
"Vendor", "dependency", and "rcs" are incantations that summon different
beasts in different lands. Can you give me some details on what you mean by
them?
– bob
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
'Bob Nystrom' via Dart Misc
2016-10-10 21:41:18 UTC
Permalink
Post by Istvan Soos
It is simple, really: if we want to have a git or svn repository, where we
store both the dart sdk binaries and also the library dependencies, what is
the suggested layout for it, and what tools would you suggest to maintain
it (e.g. fetch and upgrade versions)?
In other words, how to achieve fully repeatable builds (that don't suck)
in the absence of internet connection inside the build environment.
The *easiest* way is just:

- Check in the lockfile.
- Do a successful pub get at least once on the machine that won't be on
the Internet.

The first step is enough to lock down all of the data needed to define a
reproducible build. The second ensures the needed artifacts are on the
machine in its package cache so it doesn't need to hit the network again.

If that doesn't work for you, and you don't want to rely on pub for
downloading and caching packages, I don't have a recommended workflow.

Cheers!

– bob
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Istvan Soos
2016-10-10 21:59:12 UTC
Permalink
On Mon, Oct 10, 2016 at 11:41 PM, 'Bob Nystrom' via Dart Misc
The first step is enough to lock down all of the data needed to define a reproducible build. The second ensures the needed artifacts are on the machine in its package cache so it doesn't need to hit the network again.
If that doesn't work for you, and you don't want to rely on pub for downloading and caching packages, I don't have a recommended workflow.
This is pretty disappointing, and may become a show-stopper for a
project I was hoping to get implemented in Dart. I hope you can
suggest a reasonable way for resolving this. Java, Go, even node.js
can operate with vendored dependencies, without much issues, please
don't make this hard in Dart.

Istvan
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
'Bob Nystrom' via Dart Misc
2016-10-10 22:48:00 UTC
Permalink
Post by Istvan Soos
This is pretty disappointing, and may become a show-stopper for a
project I was hoping to get implemented in Dart. I hope you can
suggest a reasonable way for resolving this.
I'm not suggesting there are no reasonable ways, just that *I* don't have
any recommendations for them. In my uses of pub, I don't vendor things
manually since I'm happy to rely on the pub cache. Other users may have
different needs and may be able to help you better.

I think pub does have the primitives you need (machine readable and
writable lockfiles, path dependencies, dependency overrides, etc.) in order
to solve your problem, but I don't know the best way to combine them since
I haven't needed to.

Cheers!

– bob
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Greg Lowe
2016-10-10 22:49:19 UTC
Permalink
@Istvan

Should be pretty easy to put together a script which reads the ".packages"
file, copies all of the packages into a "third_party" directory within your
project, then create a new ".packages" file which points to "third_party"
instead of ".pub_cache".

Whenever you want to update the dependencies run pub get, then the
third_party script, then commit.
Post by Istvan Soos
On Mon, Oct 10, 2016 at 11:41 PM, 'Bob Nystrom' via Dart Misc
Post by 'Bob Nystrom' via Dart Misc
The first step is enough to lock down all of the data needed to define a
reproducible build. The second ensures the needed artifacts are on the
machine in its package cache so it doesn't need to hit the network again.
Post by 'Bob Nystrom' via Dart Misc
If that doesn't work for you, and you don't want to rely on pub for
downloading and caching packages, I don't have a recommended workflow.
This is pretty disappointing, and may become a show-stopper for a
project I was hoping to get implemented in Dart. I hope you can
suggest a reasonable way for resolving this. Java, Go, even node.js
can operate with vendored dependencies, without much issues, please
don't make this hard in Dart.
Istvan
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Istvan Soos
2016-10-12 08:00:34 UTC
Permalink
That would make sense. However, I'm hoping for a 'pub vendor' command
instead of a third-party script. Would the pub team take it if
somebody writes it?

Thanks,
Istvan
Post by Greg Lowe
@Istvan
Should be pretty easy to put together a script which reads the ".packages"
file, copies all of the packages into a "third_party" directory within your
project, then create a new ".packages" file which points to "third_party"
instead of ".pub_cache".
Whenever you want to update the dependencies run pub get, then the
third_party script, then commit.
Post by Istvan Soos
On Mon, Oct 10, 2016 at 11:41 PM, 'Bob Nystrom' via Dart Misc
Post by 'Bob Nystrom' via Dart Misc
The first step is enough to lock down all of the data needed to define a
reproducible build. The second ensures the needed artifacts are on the
machine in its package cache so it doesn't need to hit the network again.
If that doesn't work for you, and you don't want to rely on pub for
downloading and caching packages, I don't have a recommended workflow.
This is pretty disappointing, and may become a show-stopper for a
project I was hoping to get implemented in Dart. I hope you can
suggest a reasonable way for resolving this. Java, Go, even node.js
can operate with vendored dependencies, without much issues, please
don't make this hard in Dart.
Istvan
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
alex
2016-10-12 12:02:51 UTC
Permalink
I'm not sure I understand correctly your needs Istvan but on a machine with
internet you can fetch (pub get) dependencies into a local folder by
modifying PUB_CACHE

$ export PUB_CACHE=./dependencies
$ pub get

You have then all your dependencies within your project (that could even
decide to check-in, arg!) that you can copy to a machine that has no
internet connection and perform tests and build or access dependencies
assets in a consistent ways. Regarding non dart dependencies (sdk), it is
up to you.
I just know that this way I was able to install/update a local dart server
on a machine that does not have (regularly) internet connection just by
copying my folder
Post by Istvan Soos
That would make sense. However, I'm hoping for a 'pub vendor' command
instead of a third-party script. Would the pub team take it if
somebody writes it?
Thanks,
Istvan
Post by Greg Lowe
@Istvan
Should be pretty easy to put together a script which reads the
".packages"
Post by Greg Lowe
file, copies all of the packages into a "third_party" directory within
your
Post by Greg Lowe
project, then create a new ".packages" file which points to
"third_party"
Post by Greg Lowe
instead of ".pub_cache".
Whenever you want to update the dependencies run pub get, then the
third_party script, then commit.
Post by Istvan Soos
On Mon, Oct 10, 2016 at 11:41 PM, 'Bob Nystrom' via Dart Misc
Post by 'Bob Nystrom' via Dart Misc
The first step is enough to lock down all of the data needed to
define a
Post by Greg Lowe
Post by Istvan Soos
Post by 'Bob Nystrom' via Dart Misc
reproducible build. The second ensures the needed artifacts are on
the
Post by Greg Lowe
Post by Istvan Soos
Post by 'Bob Nystrom' via Dart Misc
machine in its package cache so it doesn't need to hit the network
again.
Post by Greg Lowe
Post by Istvan Soos
Post by 'Bob Nystrom' via Dart Misc
If that doesn't work for you, and you don't want to rely on pub for
downloading and caching packages, I don't have a recommended
workflow.
Post by Greg Lowe
Post by Istvan Soos
This is pretty disappointing, and may become a show-stopper for a
project I was hoping to get implemented in Dart. I hope you can
suggest a reasonable way for resolving this. Java, Go, even node.js
can operate with vendored dependencies, without much issues, please
don't make this hard in Dart.
Istvan
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to
http://www.dartbug.com/new
Post by Greg Lowe
---
You received this message because you are subscribed to the Google
Groups
Post by Greg Lowe
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send
an
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Istvan Soos
2016-10-12 12:48:18 UTC
Permalink
Ah, excellent, this does solve my use case. Thank you!

Istvan
Post by alex
I'm not sure I understand correctly your needs Istvan but on a machine with
internet you can fetch (pub get) dependencies into a local folder by
modifying PUB_CACHE
$ export PUB_CACHE=./dependencies
$ pub get
You have then all your dependencies within your project (that could even
decide to check-in, arg!) that you can copy to a machine that has no
internet connection and perform tests and build or access dependencies
assets in a consistent ways. Regarding non dart dependencies (sdk), it is up
to you.
I just know that this way I was able to install/update a local dart server
on a machine that does not have (regularly) internet connection just by
copying my folder
Post by Istvan Soos
That would make sense. However, I'm hoping for a 'pub vendor' command
instead of a third-party script. Would the pub team take it if
somebody writes it?
Thanks,
Istvan
Post by Greg Lowe
@Istvan
Should be pretty easy to put together a script which reads the ".packages"
file, copies all of the packages into a "third_party" directory within your
project, then create a new ".packages" file which points to
"third_party"
instead of ".pub_cache".
Whenever you want to update the dependencies run pub get, then the
third_party script, then commit.
Post by Istvan Soos
On Mon, Oct 10, 2016 at 11:41 PM, 'Bob Nystrom' via Dart Misc
Post by 'Bob Nystrom' via Dart Misc
The first step is enough to lock down all of the data needed to define a
reproducible build. The second ensures the needed artifacts are on the
machine in its package cache so it doesn't need to hit the network again.
If that doesn't work for you, and you don't want to rely on pub for
downloading and caching packages, I don't have a recommended workflow.
This is pretty disappointing, and may become a show-stopper for a
project I was hoping to get implemented in Dart. I hope you can
suggest a reasonable way for resolving this. Java, Go, even node.js
can operate with vendored dependencies, without much issues, please
don't make this hard in Dart.
Istvan
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to
http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Mark Nordine
2016-10-12 17:31:02 UTC
Permalink
This is a useful little trick. So useful, I think it should be included in
pub documenation somewhere.
Post by alex
I'm not sure I understand correctly your needs Istvan but on a machine
with internet you can fetch (pub get) dependencies into a local folder by
modifying PUB_CACHE
$ export PUB_CACHE=./dependencies
$ pub get
You have then all your dependencies within your project (that could even
decide to check-in, arg!) that you can copy to a machine that has no
internet connection and perform tests and build or access dependencies
assets in a consistent ways. Regarding non dart dependencies (sdk), it is
up to you.
I just know that this way I was able to install/update a local dart server
on a machine that does not have (regularly) internet connection just by
copying my folder
Post by Istvan Soos
That would make sense. However, I'm hoping for a 'pub vendor' command
instead of a third-party script. Would the pub team take it if
somebody writes it?
Thanks,
Istvan
Post by Greg Lowe
@Istvan
Should be pretty easy to put together a script which reads the
".packages"
Post by Greg Lowe
file, copies all of the packages into a "third_party" directory within
your
Post by Greg Lowe
project, then create a new ".packages" file which points to
"third_party"
Post by Greg Lowe
instead of ".pub_cache".
Whenever you want to update the dependencies run pub get, then the
third_party script, then commit.
Post by Istvan Soos
On Mon, Oct 10, 2016 at 11:41 PM, 'Bob Nystrom' via Dart Misc
Post by 'Bob Nystrom' via Dart Misc
The first step is enough to lock down all of the data needed to
define a
Post by Greg Lowe
Post by Istvan Soos
Post by 'Bob Nystrom' via Dart Misc
reproducible build. The second ensures the needed artifacts are on
the
Post by Greg Lowe
Post by Istvan Soos
Post by 'Bob Nystrom' via Dart Misc
machine in its package cache so it doesn't need to hit the network
again.
Post by Greg Lowe
Post by Istvan Soos
Post by 'Bob Nystrom' via Dart Misc
If that doesn't work for you, and you don't want to rely on pub for
downloading and caching packages, I don't have a recommended
workflow.
Post by Greg Lowe
Post by Istvan Soos
This is pretty disappointing, and may become a show-stopper for a
project I was hoping to get implemented in Dart. I hope you can
suggest a reasonable way for resolving this. Java, Go, even node.js
can operate with vendored dependencies, without much issues, please
don't make this hard in Dart.
Istvan
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to
http://www.dartbug.com/new
Post by Greg Lowe
---
You received this message because you are subscribed to the Google
Groups
Post by Greg Lowe
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send
an
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
'Natalie Weizenbaum' via Dart Misc
2016-10-12 17:36:23 UTC
Permalink
I'd accept a pull request that adds "pub vendor".
Post by Mark Nordine
This is a useful little trick. So useful, I think it should be included in
pub documenation somewhere.
Post by alex
I'm not sure I understand correctly your needs Istvan but on a machine
with internet you can fetch (pub get) dependencies into a local folder by
modifying PUB_CACHE
$ export PUB_CACHE=./dependencies
$ pub get
You have then all your dependencies within your project (that could even
decide to check-in, arg!) that you can copy to a machine that has no
internet connection and perform tests and build or access dependencies
assets in a consistent ways. Regarding non dart dependencies (sdk), it is
up to you.
I just know that this way I was able to install/update a local dart
server on a machine that does not have (regularly) internet connection just
by copying my folder
Post by Istvan Soos
That would make sense. However, I'm hoping for a 'pub vendor' command
instead of a third-party script. Would the pub team take it if
somebody writes it?
Thanks,
Istvan
Post by Greg Lowe
@Istvan
Should be pretty easy to put together a script which reads the
".packages"
Post by Greg Lowe
file, copies all of the packages into a "third_party" directory within
your
Post by Greg Lowe
project, then create a new ".packages" file which points to
"third_party"
Post by Greg Lowe
instead of ".pub_cache".
Whenever you want to update the dependencies run pub get, then the
third_party script, then commit.
Post by Istvan Soos
On Mon, Oct 10, 2016 at 11:41 PM, 'Bob Nystrom' via Dart Misc
Post by 'Bob Nystrom' via Dart Misc
The first step is enough to lock down all of the data needed to
define a
Post by Greg Lowe
Post by Istvan Soos
Post by 'Bob Nystrom' via Dart Misc
reproducible build. The second ensures the needed artifacts are on
the
Post by Greg Lowe
Post by Istvan Soos
Post by 'Bob Nystrom' via Dart Misc
machine in its package cache so it doesn't need to hit the network
again.
Post by Greg Lowe
Post by Istvan Soos
Post by 'Bob Nystrom' via Dart Misc
If that doesn't work for you, and you don't want to rely on pub for
downloading and caching packages, I don't have a recommended
workflow.
Post by Greg Lowe
Post by Istvan Soos
This is pretty disappointing, and may become a show-stopper for a
project I was hoping to get implemented in Dart. I hope you can
suggest a reasonable way for resolving this. Java, Go, even node.js
can operate with vendored dependencies, without much issues, please
don't make this hard in Dart.
Istvan
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to
http://www.dartbug.com/new
Post by Greg Lowe
---
You received this message because you are subscribed to the Google
Groups
Post by Greg Lowe
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send
an
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Greg Lowe
2016-10-07 23:02:58 UTC
Permalink
Pub serve is working correctly. Just me jumping to conclusions to
quickly. Apologies for the false alarm. Thanks for your time ;)
Post by 'Bob Nystrom' via Dart Misc
Post by Greg Lowe
I think that there may be a lot of apps that will stop working with pub
serve once 1.20 is released.
There *shouldn't* be if we did our jobs right.
Post by Greg Lowe
For example anyone who uses the react package and follows the example in
the readme will have this problem.
https://pub.dartlang.org/packages/react
However `pub build` continues to work as this seems to copy resources
into `build/web`.
Yup.
Post by Greg Lowe
I had assumed that some "magic" would be added to `pub serve` to serve
`packages/*` files from the pub cache. This would mean that users with
static package links can continue with their existing development workflow.
That magic is and has always been there 🎆. Pub never needed to look
inside the "packages" directory since it created it in the first place. Pub
serve and pub build look for where the referenced package actually is. The
"packages" directory is just a way to bake that same indirection into the
file system. Pub doesn't need it since pub itself is the canonical source
of truth in the first place.
Cheers!
– bob
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Loading...