You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Esther-Melaine Quansah <es...@lucidworks.com> on 2015/09/10 17:03:23 UTC

Debugging Angular JS Application

Hi, 

Is there a way for me to debug and modify Angular JS code in the Solr Admin UI without needing to completely rebuild the server and clearing browser cache?

Thanks,
Esther

Re: Debugging Angular JS Application

Posted by Upayavira <uv...@odoko.co.uk>.

On Thu, Sep 10, 2015, at 04:03 PM, Esther-Melaine Quansah wrote:
> Hi, 
> 
> Is there a way for me to debug and modify Angular JS code in the Solr
> Admin UI without needing to completely rebuild the server and clearing
> browser cache?

I just edit the files in server/solr-webapp/webapp, and refresh my
browser when I edit them. I've never had any issue with that, doing most
of my development in Chrome, because I find its dev tools to be better.

I then rsync those files into webapp/web in order to commit them.

Upayavira

Re: Debugging Angular JS Application

Posted by Upayavira <uv...@odoko.co.uk>.

On Thu, Sep 10, 2015, at 10:52 PM, Erik Hatcher wrote:
> Upayavira, could you give this a try and see if this works (patch is for
> trunk): https://issues.apache.org/jira/browse/SOLR-8035
> <https://issues.apache.org/jira/browse/SOLR-8035>

Will look :-)
 
> And when do we make the Angular UI the default?   :)

When people tell me it is looking good enough!!

I'm gonna commit some exception handling improvements shortly. I've also
got collections UI stuff looking good (create/delete collection,
create/delete alias - I just want to add add/delete replica then it is
done). With that, I'd be happy for the UI to be default in 5.4. I'd
also, when doing that, find a place in the UI to make a link to the old
UI, relatively prominently, so that if people find things wrong, then
they can still get stuff done.

Upayavira

Re: Debugging Angular JS Application

Posted by Erik Hatcher <er...@gmail.com>.
Upayavira, could you give this a try and see if this works (patch is for trunk): https://issues.apache.org/jira/browse/SOLR-8035 <https://issues.apache.org/jira/browse/SOLR-8035>

And when do we make the Angular UI the default?   :)

	Erik





> On Sep 10, 2015, at 12:26 PM, Upayavira <uv...@odoko.co.uk> wrote:
> 
> That would be fantastic, Erik. I've got a somewhat complex setup where I
> rsync between folders. Being able to serve directly from the SVN
> location would be very handy.
> 
> Upayavira
> 
> On Thu, Sep 10, 2015, at 04:58 PM, Erik Hatcher wrote:
>> With the exploded structure, maybe we can move the webapp source
>> underneath server/solr-webapp (and let the build just fill in the binary
>> Java stuff, and avoid overwriting anything).  Then we can keep the source
>> in the same place as the “dist”, keeping it nice and DRY and easily
>> debuggable/refreshable-without-a-build?   Would that work?
>> 
>> 	Erik
>> 
>> 
>> 
>> 
>>> On Sep 10, 2015, at 11:36 AM, Shawn Heisey <ap...@elyograg.org> wrote:
>>> 
>>> On 9/10/2015 9:03 AM, Esther-Melaine Quansah wrote:
>>>> Is there a way for me to debug and modify Angular JS code in the Solr Admin UI without needing to completely rebuild the server and clearing browser cache?
>>> 
>>> I'm not sure about browser caching.  That might be a problem, but if it
>>> is, it's going to be a problem regardless of Solr version.  In Firefox,
>>> holding down the shift key while you click the reload button (or
>>> pressing Shift-F5 in Windows) should invalidate the cache for the page
>>> you're on, so you don't need to dive into Options to clear the cache. 
>>> Other browsers should have something similar, but it might not be
>>> exactly the same key(s).
>>> 
>>> In Solr 5.2.x, the code you're talking about is in the war file, which
>>> gets extracted to server/solr-webapp/webapp.  You can modify the
>>> extracted contents.  I think that if that directory already exists on
>>> startup, jetty skips the extraction, so your changes might survive a
>>> restart ... but I am not positive, you'd have to test.
>>> 
>>> Starting with Solr 5.3.x, the war file is gone.  The application is
>>> pre-extracted in server/solr-webapp/webapp.  Any changes you make to the
>>> application will definitely survive a Solr restart.
>>> 
>>> So if you just change the running copy of the server that you downloaded
>>> or built, you can modify the Angular code and test the changes.  If it's
>>> 5.3, I *know* that your changes won't be overwritten when you restart
>>> Solr, and if it's 5.2, I *think* they won't be overwritten.
>>> 
>>> Thanks,
>>> Shawn
>>> 
>> 


Re: Debugging Angular JS Application

Posted by Upayavira <uv...@odoko.co.uk>.
That would be fantastic, Erik. I've got a somewhat complex setup where I
rsync between folders. Being able to serve directly from the SVN
location would be very handy.

Upayavira

On Thu, Sep 10, 2015, at 04:58 PM, Erik Hatcher wrote:
> With the exploded structure, maybe we can move the webapp source
> underneath server/solr-webapp (and let the build just fill in the binary
> Java stuff, and avoid overwriting anything).  Then we can keep the source
> in the same place as the “dist”, keeping it nice and DRY and easily
> debuggable/refreshable-without-a-build?   Would that work?
> 
> 	Erik
> 
> 
> 
> 
> > On Sep 10, 2015, at 11:36 AM, Shawn Heisey <ap...@elyograg.org> wrote:
> > 
> > On 9/10/2015 9:03 AM, Esther-Melaine Quansah wrote:
> >> Is there a way for me to debug and modify Angular JS code in the Solr Admin UI without needing to completely rebuild the server and clearing browser cache?
> > 
> > I'm not sure about browser caching.  That might be a problem, but if it
> > is, it's going to be a problem regardless of Solr version.  In Firefox,
> > holding down the shift key while you click the reload button (or
> > pressing Shift-F5 in Windows) should invalidate the cache for the page
> > you're on, so you don't need to dive into Options to clear the cache. 
> > Other browsers should have something similar, but it might not be
> > exactly the same key(s).
> > 
> > In Solr 5.2.x, the code you're talking about is in the war file, which
> > gets extracted to server/solr-webapp/webapp.  You can modify the
> > extracted contents.  I think that if that directory already exists on
> > startup, jetty skips the extraction, so your changes might survive a
> > restart ... but I am not positive, you'd have to test.
> > 
> > Starting with Solr 5.3.x, the war file is gone.  The application is
> > pre-extracted in server/solr-webapp/webapp.  Any changes you make to the
> > application will definitely survive a Solr restart.
> > 
> > So if you just change the running copy of the server that you downloaded
> > or built, you can modify the Angular code and test the changes.  If it's
> > 5.3, I *know* that your changes won't be overwritten when you restart
> > Solr, and if it's 5.2, I *think* they won't be overwritten.
> > 
> > Thanks,
> > Shawn
> > 
> 

Re: Debugging Angular JS Application

Posted by Erik Hatcher <er...@gmail.com>.
With the exploded structure, maybe we can move the webapp source underneath server/solr-webapp (and let the build just fill in the binary Java stuff, and avoid overwriting anything).  Then we can keep the source in the same place as the “dist”, keeping it nice and DRY and easily debuggable/refreshable-without-a-build?   Would that work?

	Erik




> On Sep 10, 2015, at 11:36 AM, Shawn Heisey <ap...@elyograg.org> wrote:
> 
> On 9/10/2015 9:03 AM, Esther-Melaine Quansah wrote:
>> Is there a way for me to debug and modify Angular JS code in the Solr Admin UI without needing to completely rebuild the server and clearing browser cache?
> 
> I'm not sure about browser caching.  That might be a problem, but if it
> is, it's going to be a problem regardless of Solr version.  In Firefox,
> holding down the shift key while you click the reload button (or
> pressing Shift-F5 in Windows) should invalidate the cache for the page
> you're on, so you don't need to dive into Options to clear the cache. 
> Other browsers should have something similar, but it might not be
> exactly the same key(s).
> 
> In Solr 5.2.x, the code you're talking about is in the war file, which
> gets extracted to server/solr-webapp/webapp.  You can modify the
> extracted contents.  I think that if that directory already exists on
> startup, jetty skips the extraction, so your changes might survive a
> restart ... but I am not positive, you'd have to test.
> 
> Starting with Solr 5.3.x, the war file is gone.  The application is
> pre-extracted in server/solr-webapp/webapp.  Any changes you make to the
> application will definitely survive a Solr restart.
> 
> So if you just change the running copy of the server that you downloaded
> or built, you can modify the Angular code and test the changes.  If it's
> 5.3, I *know* that your changes won't be overwritten when you restart
> Solr, and if it's 5.2, I *think* they won't be overwritten.
> 
> Thanks,
> Shawn
> 


Re: Debugging Angular JS Application

Posted by Shawn Heisey <ap...@elyograg.org>.
On 9/10/2015 9:03 AM, Esther-Melaine Quansah wrote:
> Is there a way for me to debug and modify Angular JS code in the Solr Admin UI without needing to completely rebuild the server and clearing browser cache?

I'm not sure about browser caching.  That might be a problem, but if it
is, it's going to be a problem regardless of Solr version.  In Firefox,
holding down the shift key while you click the reload button (or
pressing Shift-F5 in Windows) should invalidate the cache for the page
you're on, so you don't need to dive into Options to clear the cache. 
Other browsers should have something similar, but it might not be
exactly the same key(s).

In Solr 5.2.x, the code you're talking about is in the war file, which
gets extracted to server/solr-webapp/webapp.  You can modify the
extracted contents.  I think that if that directory already exists on
startup, jetty skips the extraction, so your changes might survive a
restart ... but I am not positive, you'd have to test.

Starting with Solr 5.3.x, the war file is gone.  The application is
pre-extracted in server/solr-webapp/webapp.  Any changes you make to the
application will definitely survive a Solr restart.

So if you just change the running copy of the server that you downloaded
or built, you can modify the Angular code and test the changes.  If it's
5.3, I *know* that your changes won't be overwritten when you restart
Solr, and if it's 5.2, I *think* they won't be overwritten.

Thanks,
Shawn