Skip to content

Commit d03e8e6

Browse files
committed
Initial work on the new JavaScript port
1 parent 551bf74 commit d03e8e6

121 files changed

Lines changed: 38835 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Ports/JavaScriptPort/LICENSE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
JavaScriptPort and its dedicated fixtures are licensed under the PolyForm Noncommercial License 1.0.0.
2+
3+
Official license text:
4+
[https://polyformproject.org/licenses/noncommercial/1.0.0/](https://polyformproject.org/licenses/noncommercial/1.0.0/)
5+
6+
This license boundary applies to files inside `Ports/JavaScriptPort/**` unless a file states otherwise.

Ports/JavaScriptPort/NOTICE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This subtree is intentionally licensed separately from the parent Codename One repository.
2+
3+
Files in `Ports/JavaScriptPort/**` are licensed under PolyForm Noncommercial 1.0.0 and must not inherit the parent repository's standard source-file license headers.

Ports/JavaScriptPort/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
JavaScriptPort is the browser-runtime work area for the new Codename One JavaScript port.
2+
3+
Scope of this bootstrap:
4+
- imported HTML5/runtime code from the existing TeaVM port as the behavioral/source baseline
5+
- PolyForm-licensed port boundary under `Ports/JavaScriptPort/**`
6+
- ParparVM-oriented smoke fixtures under `Ports/JavaScriptPort/tests/**`
7+
- executable translator/runtime coverage through the local ParparVM test suite in `vm/tests`
8+
9+
License boundary:
10+
- `Ports/JavaScriptPort/**` is licensed under PolyForm Noncommercial 1.0.0
11+
- dedicated smoke fixtures under `Ports/JavaScriptPort/tests/**` use the same license boundary
12+
- the rest of the repository remains under its existing licensing
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Copyright (c) 2026 Codename One and contributors.
3+
* Licensed under the PolyForm Noncommercial License 1.0.0.
4+
* You may use this file only in compliance with that license.
5+
* The license notice for this subtree is available in Ports/JavaScriptPort/LICENSE.md.
6+
*/
7+
package com.codename1.impl;
8+
9+
import com.codename1.impl.html5.HTML5Implementation;
10+
import com.codename1.impl.html5.JavaScriptPortBootstrap;
11+
import com.codename1.impl.html5.URLProxifier;
12+
import com.codename1.ui.Display;
13+
14+
public class ImplementationFactory {
15+
private static ImplementationFactory instance = new ImplementationFactory();
16+
17+
protected ImplementationFactory() {
18+
}
19+
20+
public static ImplementationFactory getInstance() {
21+
return instance;
22+
}
23+
24+
public static void setInstance(ImplementationFactory factory) {
25+
instance = factory;
26+
}
27+
28+
public Object createImplementation() {
29+
HTML5Implementation implementation = new HTML5Implementation();
30+
implementation.setUrlProxifier(new URLProxifier() {
31+
@Override
32+
public String proxifyURL(String url) {
33+
return JavaScriptPortBootstrap.proxifyUrl(Display.getInstance(), url);
34+
}
35+
});
36+
return implementation;
37+
}
38+
}

0 commit comments

Comments
 (0)