Skip to content

Commit 44444f6

Browse files
committed
feat(react): new 'page' concept for defining custom endpoints
Instead of opening a node you open a page that calls a named renderer. This allows designing UIs that have a different structure than the AST.
1 parent 95380af commit 44444f6

File tree

28 files changed

+1981
-93
lines changed

28 files changed

+1981
-93
lines changed

.github/workflows/build.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ jobs:
2828
node-version-file: '.nvmrc'
2929
registry-url: 'https://artifacts.itemis.cloud/repository/npm-open/'
3030
scope: '<@modelix>'
31+
- name: Install Playwright Browsers
32+
run: npx playwright install --with-deps
3133
- name: Build
3234
env:
3335
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -44,6 +46,13 @@ jobs:
4446
path: |
4547
*/build/test-results
4648
*/build/reports
49+
- name: Publish test results
50+
uses: EnricoMi/publish-unit-test-result-action@3a74b2957438d0b6e2e61d67b05318aa25c9e6c6 # v2
51+
# Also report in case the build failed
52+
if: always()
53+
with:
54+
files: |
55+
**/test-results/**/*.xml
4756
4857
# Disabled because the repository is private and they need payment
4958
# # Deploy job

gradle/libs.versions.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
99
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
1010

1111
[versions]
12-
modelixCore = "16.5.0"
12+
modelixCore = "16.6.0"
1313
modelixBuildtools="2.0.1"
1414
kotlin = "2.2.21"
1515

@@ -22,8 +22,12 @@ modelix-modelql-untyped = { group = "org.modelix", name = "modelql-untyped", ver
2222
modelix-modelql-html = { group = "org.modelix", name = "modelql-html", version.ref = "modelixCore" }
2323
modelix-model-datastructure = { group = "org.modelix", name = "model-datastructure", version.ref = "modelixCore" }
2424
modelix-mps-model-adapters = { group = "org.modelix.mps", name = "model-adapters", version.ref = "modelixCore" }
25+
modelix-mps-model-adapters-plugin = { group = "org.modelix.mps", name = "mps-model-adapters-plugin", version.ref = "modelixCore" }
26+
modelix-mps-repository-concepts = { group = "org.modelix.mps.modules", name = "repositoryconcepts", version.ref = "modelixCore" }
2527
kotlin-html = "org.jetbrains.kotlinx:kotlinx-html:0.12.0"
2628
modelix-build-tools-lib = { group = "org.modelix.mps", name = "build-tools-lib", version.ref = "modelixBuildtools" }
2729
kotlin-logging = { group = "io.github.oshai", name = "kotlin-logging", version = "7.0.13" }
2830
slf4j-api = { group = "org.slf4j", name = "slf4j-api", version = "2.0.17" }
2931
kotlin-collections-immutable = { group = "org.jetbrains.kotlinx", name = "kotlinx-collections-immutable", version = "0.4.0" }
32+
playwright = { group = "com.microsoft.playwright", name = "playwright", version = "1.55.0" }
33+
testcontainers = { group = "org.testcontainers", name = "testcontainers", version = "1.21.3" }

mps/build.gradle.kts

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,20 @@ plugins {
99

1010
group = "org.modelix.mps.modules"
1111

12+
val repositoryConcepts by configurations.creating
13+
14+
dependencies {
15+
repositoryConcepts(libs.modelix.mps.repository.concepts)
16+
}
17+
18+
val repositoryConceptsFolder = layout.buildDirectory.dir("repositoryConcepts")
19+
val extractRepositoryConcepts = tasks.register("extractRepositoryConcepts", Sync::class) {
20+
from(zipTree({ repositoryConcepts.singleFile }))
21+
into(repositoryConceptsFolder)
22+
}
23+
1224
mpsBuild {
25+
dependsOn(extractRepositoryConcepts)
1326
dependsOn(":editor-common-mps:buildPlugin")
1427
dependsOn(":projectional-editor-ssr-mps:buildPlugin")
1528
dependsOn(":react-ssr-mps:buildPlugin")
@@ -20,18 +33,18 @@ mpsBuild {
2033
search("../editor-common-mps/build/idea-sandbox/plugins/editor-common-mps")
2134
search("../projectional-editor-ssr-mps/build/idea-sandbox/plugins/projectional-editor-ssr-mps")
2235
search("../react-ssr-mps/build/idea-sandbox/plugins/react-ssr-mps")
36+
search(repositoryConceptsFolder.get().asFile.absolutePath)
2337
search("modules")
24-
publication("editor-languages") {
25-
module("org.modelix.mps.webaspect.devkit")
26-
module("org.modelix.mps.webaspect.genplan")
27-
module("org.modelix.mps.notation")
28-
}
2938
publication("baseLanguage-notation") {
3039
module("org.modelix.mps.notation.impl.baseLanguage")
40+
module("org.modelix.mps.react.impl.baseLanguage")
3141
}
32-
publication("react") {
42+
publication("editor-devkit") {
43+
module("org.modelix.mps.notation")
3344
module("org.modelix.mps.react")
3445
module("org.modelix.mps.react.ide")
46+
module("org.modelix.mps.webaspect.devkit")
47+
module("org.modelix.mps.webaspect.genplan")
3548
}
3649
}
3750

mps/modules/org.modelix.mps.react.impl.baseLanguage/models/org.modelix.mps.react.impl.baseLanguage.modelix.mps

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,16 @@
88
<imports>
99
<import index="tpee" ref="r:00000000-0000-4000-0000-011c895902ca(jetbrains.mps.baseLanguage.structure)" />
1010
<import index="1ut2" ref="208eaf68-fd3a-497a-a4b6-4923ff457c3b/java:org.modelix.model.mpsadapters.tomps(org.modelix.mps.editor.common.stubs/)" />
11+
<import index="jh6v" ref="r:f2f39a18-fd23-4090-b7f2-ba8da340eec2(org.modelix.model.repositoryconcepts.structure)" />
1112
<import index="jks5" ref="208eaf68-fd3a-497a-a4b6-4923ff457c3b/java:org.modelix.model.api(org.modelix.mps.editor.common.stubs/)" implicit="true" />
13+
<import index="tpck" ref="r:00000000-0000-4000-0000-011c89590288(jetbrains.mps.lang.core.structure)" implicit="true" />
1214
</imports>
1315
<registry>
1416
<language id="67accce2-9676-4728-9e9c-8b15ea30d924" name="org.modelix.mps.react">
1517
<concept id="8876946878574570414" name="org.modelix.mps.react.structure.ComponentNodeExpression" flags="ng" index="ggAI9" />
18+
<concept id="8876946878574531757" name="org.modelix.mps.react.structure.TextComponent" flags="ng" index="ggXia">
19+
<child id="8876946878574531775" name="value" index="ggXio" />
20+
</concept>
1621
<concept id="8876946878574654557" name="org.modelix.mps.react.structure.PrimitivePropertyValue" flags="ng" index="ghjhU">
1722
<child id="8876946878574654571" name="value" index="ghjhc" />
1823
</concept>
@@ -39,6 +44,40 @@
3944
<property id="8876946878574187995" name="propertyName" index="gn1nW" />
4045
<child id="8876946878574187997" name="value" index="gn1nU" />
4146
</concept>
47+
<concept id="1612157992440222093" name="org.modelix.mps.react.structure.ForEachInteratorVariableReference" flags="ng" index="rqPyE">
48+
<reference id="1612157992440222094" name="forEach" index="rqPyD" />
49+
</concept>
50+
<concept id="1612157992440089595" name="org.modelix.mps.react.structure.ForEachComponent" flags="ng" index="rrkbs">
51+
<child id="1612157992440089646" name="input" index="rrkk9" />
52+
<child id="1612157992440089600" name="component" index="rrkkB" />
53+
</concept>
54+
<concept id="5355184975880615610" name="org.modelix.mps.react.structure.NamedRendererParameter" flags="ng" index="2rzwrA">
55+
<child id="5355184975880615618" name="type" index="2rzwqu" />
56+
</concept>
57+
<concept id="5355184975880615607" name="org.modelix.mps.react.structure.NamedRenderer" flags="ng" index="2rzwrF" />
58+
<concept id="5355184975881978516" name="org.modelix.mps.react.structure.CallNamedRenderer" flags="ng" index="2rDjb8">
59+
<reference id="5355184975881978525" name="renderer" index="2rDjb1" />
60+
<child id="5355184975881978527" name="parameterValues" index="2rDjb3" />
61+
</concept>
62+
<concept id="5355184975880958844" name="org.modelix.mps.react.structure.NamedRendererParameterReference" flags="ng" index="2rHscw">
63+
<reference id="5355184975880958845" name="decl" index="2rHscx" />
64+
</concept>
65+
<concept id="5355184975881056557" name="org.modelix.mps.react.structure.NamedRendererBase" flags="ng" index="2rHO5L">
66+
<child id="5355184975881056561" name="parameters" index="2rHO5H" />
67+
<child id="5355184975881056562" name="components" index="2rHO5I" />
68+
</concept>
69+
<concept id="7186142608857783837" name="org.modelix.mps.react.structure.ContextRepositoryExpression" flags="ng" index="1xZx2W" />
70+
<concept id="7186142608857762387" name="org.modelix.mps.react.structure.Page" flags="ng" index="1xZ$jM">
71+
<child id="7186142608858233588" name="path" index="1xWnhl" />
72+
<child id="7186142608857776878" name="content" index="1xZwLf" />
73+
</concept>
74+
<concept id="7186142608857847244" name="org.modelix.mps.react.structure.PagePath" flags="ng" index="1xZLHH">
75+
<child id="7186142608857857834" name="parts" index="1xZN6b" />
76+
</concept>
77+
<concept id="7186142608857857829" name="org.modelix.mps.react.structure.StaticPagePathPart" flags="ng" index="1xZN64">
78+
<property id="7186142608857857830" name="value" index="1xZN67" />
79+
</concept>
80+
<concept id="793519207835900435" name="org.modelix.mps.react.structure.EmptyContent" flags="ng" index="3ywjYg" />
4281
</language>
4382
<language id="f3061a53-9226-4cc5-a443-f952ceaf5816" name="jetbrains.mps.baseLanguage">
4483
<concept id="1202948039474" name="jetbrains.mps.baseLanguage.structure.InstanceMethodCallOperation" flags="nn" index="liA8E" />
@@ -52,10 +91,26 @@
5291
<concept id="1081236700937" name="jetbrains.mps.baseLanguage.structure.StaticMethodCall" flags="nn" index="2YIFZM">
5392
<reference id="1144433194310" name="classConcept" index="1Pybhc" />
5493
</concept>
94+
<concept id="1068581242875" name="jetbrains.mps.baseLanguage.structure.PlusExpression" flags="nn" index="3cpWs3" />
5595
<concept id="1204053956946" name="jetbrains.mps.baseLanguage.structure.IMethodCall" flags="ngI" index="1ndlxa">
5696
<reference id="1068499141037" name="baseMethodDeclaration" index="37wK5l" />
5797
<child id="1068499141038" name="actualArgument" index="37wK5m" />
5898
</concept>
99+
<concept id="1081773326031" name="jetbrains.mps.baseLanguage.structure.BinaryOperation" flags="nn" index="3uHJSO">
100+
<child id="1081773367579" name="rightExpression" index="3uHU7w" />
101+
<child id="1081773367580" name="leftExpression" index="3uHU7B" />
102+
</concept>
103+
</language>
104+
<language id="7866978e-a0f0-4cc7-81bc-4d213d9375e1" name="jetbrains.mps.lang.smodel">
105+
<concept id="1138055754698" name="jetbrains.mps.lang.smodel.structure.SNodeType" flags="in" index="3Tqbb2">
106+
<reference id="1138405853777" name="concept" index="ehGHo" />
107+
</concept>
108+
<concept id="1138056022639" name="jetbrains.mps.lang.smodel.structure.SPropertyAccess" flags="nn" index="3TrcHB">
109+
<reference id="1138056395725" name="property" index="3TsBF5" />
110+
</concept>
111+
<concept id="1138056282393" name="jetbrains.mps.lang.smodel.structure.SLinkListAccess" flags="nn" index="3Tsc0h">
112+
<reference id="1138056546658" name="link" index="3TtcxE" />
113+
</concept>
59114
</language>
60115
<language id="ceab5195-25ea-4f22-9b92-103b95ca8c0c" name="jetbrains.mps.lang.core">
61116
<concept id="1169194658468" name="jetbrains.mps.lang.core.structure.INamedConcept" flags="ngI" index="TrEIO">
@@ -127,5 +182,67 @@
127182
</node>
128183
</node>
129184
</node>
185+
<node concept="gl9ry" id="6eUjE42h0De">
186+
<property role="TrG5h" value="react.repository" />
187+
<node concept="1xZ$jM" id="6eUjE42q5xy" role="gmrQt">
188+
<node concept="1xZLHH" id="6eUjE42q5x$" role="1xWnhl">
189+
<node concept="1xZN64" id="6eUjE42qNC7" role="1xZN6b">
190+
<property role="1xZN67" value="dependency-analyzer" />
191+
</node>
192+
</node>
193+
<node concept="2rDjb8" id="6eUjE42sp_X" role="1xZwLf">
194+
<ref role="2rDjb1" node="6eUjE42h0Dw" resolve="main" />
195+
<node concept="1xZx2W" id="6eUjE42spA5" role="2rDjb3" />
196+
</node>
197+
</node>
198+
<node concept="3ywjYg" id="6eUjE42q5xx" role="gmrQt" />
199+
<node concept="2rzwrF" id="6eUjE42h0Dw" role="gmrQt">
200+
<property role="TrG5h" value="main" />
201+
<node concept="2rzwrA" id="6eUjE42h0Dz" role="2rHO5H">
202+
<property role="TrG5h" value="repository" />
203+
<node concept="3Tqbb2" id="6eUjE42h0DH" role="2rzwqu">
204+
<ref role="ehGHo" to="jh6v:qmkA5fOskm" resolve="Repository" />
205+
</node>
206+
</node>
207+
<node concept="rrkbs" id="6eUjE42h7AY" role="2rHO5I">
208+
<property role="TrG5h" value="module" />
209+
<node concept="gmrTC" id="6eUjE42hjbe" role="rrkkB">
210+
<property role="gmPZ6" value="html.div" />
211+
<node concept="gn1nE" id="GzuF_KKeEI" role="gn1nH">
212+
<property role="gn1nW" value="class" />
213+
<node concept="ghjhU" id="GzuF_KKeEL" role="gn1nU">
214+
<node concept="Xl_RD" id="GzuF_KKeEK" role="ghjhc">
215+
<property role="Xl_RC" value="module" />
216+
</node>
217+
</node>
218+
</node>
219+
<node concept="ggXia" id="6eUjE42hjf7" role="gn1nJ">
220+
<node concept="3cpWs3" id="6eUjE42hkeR" role="ggXio">
221+
<node concept="2OqwBi" id="6eUjE42hkFH" role="3uHU7w">
222+
<node concept="rqPyE" id="6eUjE42hkeZ" role="2Oq$k0">
223+
<ref role="rqPyD" node="6eUjE42h7AY" resolve="module" />
224+
</node>
225+
<node concept="3TrcHB" id="6eUjE42hl1f" role="2OqNvi">
226+
<ref role="3TsBF5" to="tpck:h0TrG11" resolve="name" />
227+
</node>
228+
</node>
229+
<node concept="Xl_RD" id="6eUjE42hjf9" role="3uHU7B">
230+
<property role="Xl_RC" value="Module:" />
231+
</node>
232+
</node>
233+
</node>
234+
</node>
235+
<node concept="2OqwBi" id="6eUjE42hiY7" role="rrkk9">
236+
<node concept="2rHscw" id="6eUjE42hiNW" role="2Oq$k0">
237+
<ref role="2rHscx" node="6eUjE42h0Dz" resolve="repository" />
238+
</node>
239+
<node concept="3Tsc0h" id="6eUjE42hj7i" role="2OqNvi">
240+
<ref role="3TtcxE" to="jh6v:qmkA5fOskn" resolve="modules" />
241+
</node>
242+
</node>
243+
</node>
244+
</node>
245+
<node concept="3ywjYg" id="6eUjE42h0Dv" role="gmrQt" />
246+
</node>
130247
</model>
131248

mps/modules/org.modelix.mps.react.impl.baseLanguage/org.modelix.mps.react.impl.baseLanguage.msd

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
</facets>
1313
<dependencies>
1414
<dependency reexport="false">f3061a53-9226-4cc5-a443-f952ceaf5816(jetbrains.mps.baseLanguage)</dependency>
15-
<dependency reexport="false">83a7cbdc-dd9d-4dad-be97-957aa1b07375(org.modelix.mps.react.ssr.stubs)</dependency>
15+
<dependency reexport="false">0a7577d1-d4e5-431d-98b1-fae38f9aee80(org.modelix.model.repositoryconcepts)</dependency>
16+
<dependency reexport="false">208eaf68-fd3a-497a-a4b6-4923ff457c3b(org.modelix.mps.editor.common.stubs)</dependency>
1617
</dependencies>
1718
<languageVersions>
1819
<language slang="l:f3061a53-9226-4cc5-a443-f952ceaf5816:jetbrains.mps.baseLanguage" version="12" />
@@ -41,9 +42,9 @@
4142
<module reference="2d3c70e9-aab2-4870-8d8d-6036800e4103(jetbrains.mps.kernel)" version="0" />
4243
<module reference="ceab5195-25ea-4f22-9b92-103b95ca8c0c(jetbrains.mps.lang.core)" version="0" />
4344
<module reference="9ded098b-ad6a-4657-bfd9-48636cfe8bc3(jetbrains.mps.lang.traceable)" version="0" />
45+
<module reference="0a7577d1-d4e5-431d-98b1-fae38f9aee80(org.modelix.model.repositoryconcepts)" version="0" />
4446
<module reference="208eaf68-fd3a-497a-a4b6-4923ff457c3b(org.modelix.mps.editor.common.stubs)" version="0" />
4547
<module reference="472b2a37-8fd8-48c2-911a-4dd23131201d(org.modelix.mps.react.impl.baseLanguage)" version="0" />
46-
<module reference="83a7cbdc-dd9d-4dad-be97-957aa1b07375(org.modelix.mps.react.ssr.stubs)" version="0" />
4748
</dependencyVersions>
4849
</solution>
4950

0 commit comments

Comments
 (0)