Hi all,

These days I was working on some building stuff: reduce dependency, minimize
build layer, check whether the new build tool works correctly, and etc.

All work is related to this question: Is there a simple way to determine
whether a module is included in the layer file?

Here's what I'm doing right now. I found in uncompressed layer files,
modules will be included in the following format:
define({cache:{
'dojo*_base/load': function(){.....},
'dojo*DeferredList': function(){...},
...
)
It looks like the separator for the 1st and 2nd level module names is *. And
the separator for the descendant are /. So I use stupid pattern to search
the uncompressed layer file. For example, if the module is dojo.window, I
will search 'dojo*window': function().
Is this the correct way?

Another way is to create test app. Create an app which depends on the target
module. However, in the source HTML codes, use <script> to include the layer
files. Profile the network when starting the test app, and we should get the
answer. But this way is too time consuming, and definitely not simple.

Best Regards,

Ming Zhe Huang (Archer)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.dojotoolkit.org/pipermail/dojo-contributors/attachments/20110525/7fa34823/attachment-0001.htm

Search Discussions

  • Rawld Gill at May 25, 2011 at 4:01 pm

    On Wednesday 25 May 2011 07:06:27 Ming Zhe Huang wrote:
    Hi all,

    These days I was working on some building stuff: reduce dependency,
    minimize build layer, check whether the new build tool works correctly,
    and etc.

    All work is related to this question: Is there a simple way to determine
    whether a module is included in the layer file?

    Here's what I'm doing right now. I found in uncompressed layer files,
    modules will be included in the following format:
    define({cache:{
    'dojo*_base/load': function(){.....},
    'dojo*DeferredList': function(){...},
    ...
    )
    It looks like the separator for the 1st and 2nd level module names is *.
    And the separator for the descendant are /. So I use stupid pattern to
    search the uncompressed layer file. For example, if the module is
    dojo.window, I will search 'dojo*window': function().
    Is this the correct way?
    fwiw, the pattern is <package-name>*<module-id-within-package>. Internally
    it's termed a "package-qualified name" or pqn. I used it in the design to
    solve the problem of multiple versions of the same package and/or multiple
    packages with the same name. (It's an artifact from the fairly fast evolution
    of the loader last winter that may be unnecessary now.)

    Current docs to follow shortly; older, slightly out-of-date docs are still at
    http://bdframework.org/bdLoad/index.html (warning: out-of-date means sometimes
    wrong given current impl).
    Another way is to create test app. Create an app which depends on the
    target module. However, in the source HTML codes, use <script> to include
    the layer files. Profile the network when starting the test app, and we
    should get the answer. But this way is too time consuming, and definitely
    not simple.
    The easiest way is to look at the build-report.txt in the release dir. It will
    report the contents of each layer.

    Best,
    Rawld

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdojo-contributors @
categoriesdojo
postedMay 25, '11 at 10:06a
activeMay 25, '11 at 4:01p
posts2
users2
websitedojotoolkit.org

2 users in discussion

Rawld Gill: 1 post Ming Zhe Huang: 1 post

People

Translate

site design / logo © 2022 Grokbase