Closed Bug 1013720 Opened 10 years ago Closed 10 years ago

Bundle JS folder for components at build time

Categories

(Firefox OS Graveyard :: Gaia::Build, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
2.0 S2 (23may)

People

(Reporter: kgrandon, Assigned: kgrandon)

References

Details

(Whiteboard: [p=2],[systemsfe])

Attachments

(1 file)

It would be useful to bundle the js/ folder inside of a component during build time for more complex standalone components.

For the grid example we have several JS files that should be loaded by the component if possible, so we should explore doing so.
Attached file Github pull request
Yuren - could you take a quick look at this? The test is rather brittle due to the current mocks, but I'm not really sure what's best to do there. It seems like we may want to be able to create a more realistic directory object?
Attachment #8426004 - Flags: review?(yurenju.mozilla)
Comment on attachment 8426004 [details] [review]
Github pull request

reassign to George since I got too much review requests :-/
Attachment #8426004 - Flags: review?(yurenju.mozilla) → review?(gduan)
Hi Kevin,
This patch looks good to me,
but I'm wondering, the only folder of component we don't copy is "examples", right?
Why not just set an ignoring list (only example so far) and copy the rest of resource into shared?
Flags: needinfo?(kgrandon)
I think that may be an option in the future, but I think whitelisting is generally a better practice for now as we might be adding a test/ folder into each component, or other folders we don't want to be on the device.
Flags: needinfo?(kgrandon)
Comment on attachment 8426004 [details] [review]
Github pull request

The unit test should be able to filter out unnecessary files. However, there's still some issues of the mockUtils.getFile(), the append function doesn't work. I'll file another bug to fix it.

For the rest parts, it looks good. r=gduan
Attachment #8426004 - Flags: review?(gduan) → review+
Thanks a lot! https://github.com/mozilla-b2g/gaia/commit/50c0a91798dbe02c08961f3fee5ce2ebe8d7f9ab
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: