You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by ScraM Team <sc...@gmail.com> on 2020/12/07 03:02:51 UTC
NetBeans plugin for TeaVM -- stuck on friend dependency
I'm working on a NetBeans plugin for TeaVM:
https://frequal.com/TeaVM/TeaVMForNetBeans.html
The first feature, hyperlinking to HTML templates from Java code, went
relatively smoothly.
Implementing the next feature is giving me difficulties, I'm hoping someone
on this list can help me solve it. I'm trying to add support for the TeaVM
elements, like <std:foreach> in the HTML editor. I found the Angular
support class "AngularHtmlExtension", which looks similar to what I need:
https://github.com/apache/netbeans/blob/master/webcommon/html.angular/src/org/netbeans/modules/html/angular/AngularHtmlExtension.java
However, I can't get the new TeaVM class I'm writing
(TemplateHtmlExtension) to load and be recognized.
During the build, I get this error, could this be causing the problem?
[INFO] --- nbm-maven-plugin:4.1:manifest (default-manifest) @ teavm4nb ---
[INFO] NBM Plugin generates manifest
[WARNING] Module has friend dependency on org.netbeans.modules.html.editor
but is not listed as a friend.
[WARNING] Module has friend dependency on
org.netbeans.modules.html.editor.lib but is not listed as a friend.
I have tried various versions of the nbm-maven-plugin. I have added and
removed dependencies. I have tried the
'OpenIDE-Module-Module-Dependencies' manifest entry. So far nothing has
worked. I either get:
* Class Not Found exceptions at runtime, or
* The TeaVM HtmlExtension class doesn't load (constructor not called)
Thanks for any advice you can provide.
Re: NetBeans plugin for TeaVM -- stuck on friend dependency
Posted by ScraM Team <sc...@gmail.com>.
Thanks for the Java Frontend Application info. I knew of the
back2brwsr/TeaVM integration, but now I'll look deeper. The debugging
support looks neat.
Opening up the editor APIs sounds great! I look forward to using them.
In the meanwhile I'll focus on some other features in the plugin that don't
need those APIs.
On Tue, Dec 8, 2020 at 10:58 PM Jaroslav Tulach <ja...@gmail.com>
wrote:
> Support for TeaVM's Flavor, great!
>
> There already is some support for TeaVM in Java Frontend Application, btw.
> https://dukescript.com/update/2015/10/24/New-Version-of-Archetypes.html
>
>
> po 7. 12. 2020 v 22:11 odesílatel Matthias Bläsing <
> mblaesing@doppel-helix.eu> napsal:
>
> > Hi,
> >
> > in principle both html.editor and html.editor.lib modules need to be
> > checked and updated to export their API as non-friends.
> >
> > We have several open complaints about the html editor and it might be a
> > good time to open the API up.
> >
>
> Let's open it up. The API is relatively small and there are some tests
> (including tests for HtmlExtension). Just make sure the tests are executed
> in the travis somewhere and open the module up. Add `apichanges.xml` note
> about the API being public.
>
> -jt
>
Re: NetBeans plugin for TeaVM -- stuck on friend dependency
Posted by Jaroslav Tulach <ja...@gmail.com>.
Support for TeaVM's Flavor, great!
There already is some support for TeaVM in Java Frontend Application, btw.
https://dukescript.com/update/2015/10/24/New-Version-of-Archetypes.html
po 7. 12. 2020 v 22:11 odesílatel Matthias Bläsing <
mblaesing@doppel-helix.eu> napsal:
> Hi,
>
> in principle both html.editor and html.editor.lib modules need to be
> checked and updated to export their API as non-friends.
>
> We have several open complaints about the html editor and it might be a
> good time to open the API up.
>
Let's open it up. The API is relatively small and there are some tests
(including tests for HtmlExtension). Just make sure the tests are executed
in the travis somewhere and open the module up. Add `apichanges.xml` note
about the API being public.
-jt
Re: NetBeans plugin for TeaVM -- stuck on friend dependency
Posted by ScraM Team <sc...@gmail.com>.
Thanks for the quick reply.
I'm just starting on the HtmlExtension part of the module, so there is not
much to see. The relevant code is as follows:
import org.netbeans.modules.html.editor.api.gsf.HtmlExtension;
import org.netbeans.modules.html.editor.lib.api.HtmlSource;
@MimeRegistrations({
@MimeRegistration(mimeType = "text/html", service =
HtmlExtension.class),
})
public class TemplateHtmlExtension extends HtmlExtension {
Map<String, List<String>> mapNamespacesToElements = new HashMap<>();
public TemplateHtmlExtension() {
mapNamespacesToElements.put("std", Arrays.asList("foreach"));
}
public Map<String, List<String>> getUndeclaredNamespaces(HtmlSource
source) {
return mapNamespacesToElements;
}
}
And the POM file dependencies on editor and editor lib:
<dependency>
<groupId>org.netbeans.modules</groupId>
<artifactId>org-netbeans-modules-html-editor</artifactId>
<version>RELEASE802</version>
</dependency>
<dependency>
<groupId>org.netbeans.modules</groupId>
<artifactId>org-netbeans-modules-html-editor-lib</artifactId>
<version>RELEASE802</version>
</dependency>
How does the Angular extension access HtmlExtension, is it a friend? If
there is a shortcut that works temporarily (even with a price down the
road) I'd be willing to take it to get the module working sooner.
On Mon, Dec 7, 2020 at 1:11 PM Matthias Bläsing <mb...@doppel-helix.eu>
wrote:
> Hi,
>
> in principle both html.editor and html.editor.lib modules need to be
> checked and updated to export their API as non-friends.
>
> We have several open complaints about the html editor and it might be a
> good time to open the API up.
>
> I saw at least one point we will need to look critically at and maybe
> we also need to accept, that opening the modules API might also mean,
> that we will introduce breaking chanes in the future.
>
> To better understand the need, I'd like to have a look at your module -
> maybe a stop gap measure is possible. Do you have a repository
> available?
>
> Greetings
>
> Matthias
>
> Am Sonntag, den 06.12.2020, 19:02 -0800 schrieb ScraM Team:
> > I'm working on a NetBeans plugin for TeaVM:
> > https://frequal.com/TeaVM/TeaVMForNetBeans.html
> >
> > The first feature, hyperlinking to HTML templates from Java code,
> > went
> > relatively smoothly.
> >
> > Implementing the next feature is giving me difficulties, I'm hoping
> > someone
> > on this list can help me solve it. I'm trying to add support for the
> > TeaVM
> > elements, like <std:foreach> in the HTML editor. I found the Angular
> > support class "AngularHtmlExtension", which looks similar to what I
> > need:
> >
> https://github.com/apache/netbeans/blob/master/webcommon/html.angular/src/org/netbeans/modules/html/angular/AngularHtmlExtension.java
> >
> > However, I can't get the new TeaVM class I'm writing
> > (TemplateHtmlExtension) to load and be recognized.
> >
> > During the build, I get this error, could this be causing the
> > problem?
> >
> > [INFO] --- nbm-maven-plugin:4.1:manifest (default-manifest) @
> > teavm4nb ---
> > [INFO] NBM Plugin generates manifest
> > [WARNING] Module has friend dependency on
> > org.netbeans.modules.html.editor
> > but is not listed as a friend.
> > [WARNING] Module has friend dependency on
> > org.netbeans.modules.html.editor.lib but is not listed as a friend.
> >
> > I have tried various versions of the nbm-maven-plugin. I have added
> > and
> > removed dependencies. I have tried the
> > 'OpenIDE-Module-Module-Dependencies' manifest entry. So far nothing
> > has
> > worked. I either get:
> > * Class Not Found exceptions at runtime, or
> > * The TeaVM HtmlExtension class doesn't load (constructor not called)
> >
> > Thanks for any advice you can provide.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>
Re: NetBeans plugin for TeaVM -- stuck on friend dependency
Posted by Matthias Bläsing <mb...@doppel-helix.eu>.
Hi,
in principle both html.editor and html.editor.lib modules need to be
checked and updated to export their API as non-friends.
We have several open complaints about the html editor and it might be a
good time to open the API up.
I saw at least one point we will need to look critically at and maybe
we also need to accept, that opening the modules API might also mean,
that we will introduce breaking chanes in the future.
To better understand the need, I'd like to have a look at your module -
maybe a stop gap measure is possible. Do you have a repository
available?
Greetings
Matthias
Am Sonntag, den 06.12.2020, 19:02 -0800 schrieb ScraM Team:
> I'm working on a NetBeans plugin for TeaVM:
> https://frequal.com/TeaVM/TeaVMForNetBeans.html
>
> The first feature, hyperlinking to HTML templates from Java code,
> went
> relatively smoothly.
>
> Implementing the next feature is giving me difficulties, I'm hoping
> someone
> on this list can help me solve it. I'm trying to add support for the
> TeaVM
> elements, like <std:foreach> in the HTML editor. I found the Angular
> support class "AngularHtmlExtension", which looks similar to what I
> need:
> https://github.com/apache/netbeans/blob/master/webcommon/html.angular/src/org/netbeans/modules/html/angular/AngularHtmlExtension.java
>
> However, I can't get the new TeaVM class I'm writing
> (TemplateHtmlExtension) to load and be recognized.
>
> During the build, I get this error, could this be causing the
> problem?
>
> [INFO] --- nbm-maven-plugin:4.1:manifest (default-manifest) @
> teavm4nb ---
> [INFO] NBM Plugin generates manifest
> [WARNING] Module has friend dependency on
> org.netbeans.modules.html.editor
> but is not listed as a friend.
> [WARNING] Module has friend dependency on
> org.netbeans.modules.html.editor.lib but is not listed as a friend.
>
> I have tried various versions of the nbm-maven-plugin. I have added
> and
> removed dependencies. I have tried the
> 'OpenIDE-Module-Module-Dependencies' manifest entry. So far nothing
> has
> worked. I either get:
> * Class Not Found exceptions at runtime, or
> * The TeaVM HtmlExtension class doesn't load (constructor not called)
>
> Thanks for any advice you can provide.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists