update paths to shared resources in clock app

RESOLVED FIXED

Status

Firefox OS
Gaia::Clock
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: Jovan Gerodetti, Assigned: Jovan Gerodetti)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

2 years ago
Can we move the clock app into the apps directory so we can build it? 
Apps in the dead_apps directory can't be build right now.
Flags: needinfo?(bfrancis)
(Assignee)

Updated

2 years ago
Blocks: 1270728
The build system on the kanikani branch of Gaia currently packages the apps in the apps/ folder as chrome. That isn't what we want for the apps we want to turn into web content. I think we may need to figure out a new deployment model for web apps which enables us to host them on the web somewhere rather than package them up.

This is probably a wider topic we should discuss in the B2G meeting tomorrow.
Flags: needinfo?(bfrancis)
(Assignee)

Comment 2

2 years ago
Okay I understand that. But right now we need a solution to import shared scripts. How can we achieve that?

The clock app relies on some scripts from the shared/js folder.
Flags: needinfo?(bfrancis)
One option might be to just directly link to scripts in ../../shared/ and deploy all the web apps and shared folder to mozilla-b2g.github.io (like http://benfrancis.github.io/gaia/). I wonder how much we could get working as static web content without the build system. This would work because all the web apps would share the same origin with the shared folder, that isn't a great long term solution for security purposes but could allow us to get started.
Flags: needinfo?(bfrancis)
(Assignee)

Comment 4

2 years ago
okay I will give that a try.
(Assignee)

Comment 5

2 years ago
So I looked into changing the paths to "../../shared/js/*" but the clock app is using requireJS, which seems to be unable to resolve the paths. 

it just concats the basepath "dead_apps/clock/js" with e.g. "../../shared/js/accessibility_helper.js". 
What can we do to avoide this?
Flags: needinfo?(bfrancis)
(Assignee)

Updated

2 years ago
Summary: Move clock app from dead_apps to apps directory → update paths to shared resources in clock app

Comment 6

2 years ago
Created attachment 8750453 [details] [review]
[gaia] TitanNano:fix_1270736 > mozilla-b2g:kanikani
(Assignee)

Comment 7

2 years ago
I don't know why, but I can't set the review flag in the autolander patch... Can you check this and tell me if it's okay? 

With this paths I can load all the resources now.
Flags: needinfo?(bfrancis)
(Assignee)

Updated

2 years ago
Flags: needinfo?(bfrancis)
(Assignee)

Comment 8

2 years ago
Comment on attachment 8750453 [details] [review]
[gaia] TitanNano:fix_1270736 > mozilla-b2g:kanikani

With this patch it is possible to load all required resources for the clock app. I'm not sure if L10n also works correctly but I addjusted the paths for the language files in the same way as all other paths.

I know this is not a ideal solution, but until we split the shared resources into npm packages, we can use it to test and fix the clock app.
This approach looks good to me.

Alberto has been experimenting with the clock app as an example of a web app outside of the main Gaia repository that we can ship as a default app. You can see it mostly working here https://albertopq.github.io/gaia-clock/

I don't necessarily think we should move the Clock app itself out of the Gaia repository, but you two should discuss the approach he took to do this.
Flags: needinfo?(bfrancis) → needinfo?(apastor)
(Assignee)

Comment 10

2 years ago
Alberto, how about we merge your work into the gaia repo. since Bug 1270532 landed we can distribute it through gh-pages.

Your current repo seems to work pretty well and I'd like to help fixing the remaining problems.

What do you think about that?
Yeah, that makes sense. I'm still not sure how to resolve the '/shared' issue. Pointing to '../shared' seems like the easiest way, but in the long term we should externalize those files in external libraries.

Jovan, would you mind to apply the work done in my repo to the dead_apps/clock folder? We can probably skip the shared/bower stuff right now, and fix that issue in the future.

Thanks!
Flags: needinfo?(apastor)
(Assignee)

Comment 12

2 years ago
Alberto, I updated my PR, can you review it?
Flags: needinfo?(apastor)
Assignee: nobody → titannanomail
Flags: needinfo?(apastor)
Comment on attachment 8750453 [details] [review]
[gaia] TitanNano:fix_1270736 > mozilla-b2g:kanikani

Left a couple of comments in github, but r=me as soon as those are fixed. Thanks a lot, Jovan! Nice work!
Attachment #8750453 - Flags: review+
Blocks: 1274928
Hey Jovan, how is it going with this bug? Do you want me to help? Thanks!
Flags: needinfo?(titannanomail)
(Assignee)

Comment 15

2 years ago
No I think it's no problem. 
I just don't have time at the moment. Maybe I can fix the patch on the weekend :)
Flags: needinfo?(titannanomail)
(Assignee)

Updated

2 years ago
Attachment #8750453 - Flags: review+ → review?(apastor)
Hey Jovan! Why are input_areas.css and buttons.css added to this commit? Shouldn't we just point to the shared ones? At the other hand, I still don't see a comment with the bug number in [1].
I'm happy to r+ this as soon as that gets fixed. Thanks!

[1] https://github.com/mozilla-b2g/gaia/pull/34298#discussion-diff-64186734R24
Flags: needinfo?(titannanomail)
(Assignee)

Comment 17

2 years ago
I updated the PR.
Flags: needinfo?(titannanomail)
Comment on attachment 8750453 [details] [review]
[gaia] TitanNano:fix_1270736 > mozilla-b2g:kanikani

Thanks Jovan!
Attachment #8750453 - Flags: review?(apastor) → review+
(Assignee)

Comment 19

2 years ago
are you going to merge the PR?
Flags: needinfo?(apastor)
kanikani: https://github.com/mozilla-b2g/gaia/commit/d8aa9a662f3f5250d155883495f29d7724d78ab3
Status: UNCONFIRMED → RESOLVED
Last Resolved: 2 years ago
Flags: needinfo?(apastor)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.