On Sun, Nov 26, 2017 at 10:40 AM, Svein-Erik Løken <sv...@jacilla.no> wrote:

> Source code:
>

> @Contribute(JavaScriptStackSource.class)
> public static void addMyStack(MappedConfiguration<String,
> JavaScriptStack> configuration) {
>     configuration.addInstance("react", ReactStack.class);
> }
>
> @Contribute(JavaScriptStack.class)
> @Core
> public static void addAppModules(OrderedConfiguration<StackExtension>
> configuration) {
>     configuration.add("react", StackExtension.module("react"));
> }
>

These look correct. ^^^


> public class ReactStack implements JavaScriptStack {
>     private final AssetSource assetSource;
>
>     public ReactStack(final AssetSource assetSource) {
>         this.assetSource = assetSource;
>     }
>
>     public List<Asset> getJavaScriptLibraries() {
>         List<Asset> ret = new ArrayList<>();
>         ret.add(assetSource.getClasspathAsset("/META-INF/
> assets/react.min.js"));
>         return ret;
>     }
>
>     @Override
>     public List<String> getModules() {
>         List<String> ret = new ArrayList<>();
>         ret.add("react");
>         return ret;
>     }
>

I believe your error was having the getModules() method above return a list
with 'react'. According to its JavaDoc, getModules() must return the
modules on which this stack depends. It doesn't actually depend on the
'react' module. Please try having that method return an empty List and tell
us what happens.

You may also need to move react.min.js to
/META-INF/modules/react/react.min.js.

Reply via email to