Skip to content

Commit

Permalink
Merge branch 'main' into feat/endpoint-detection
Browse files Browse the repository at this point in the history
  • Loading branch information
mshabarov authored Jan 7, 2025
2 parents 43d44a0 + bcd7a0d commit 281f16a
Show file tree
Hide file tree
Showing 52 changed files with 1,072 additions and 807 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
*/
public class AtmospherePushConnection implements PushConnection {

public static final String TRANSPORT_KEY = "transport";

/**
* Represents the connection state of a push connection.
*/
Expand Down Expand Up @@ -583,7 +585,7 @@ protected AtmosphereConfiguration() {
* @return the transport mechanism
*/
public final String getTransport() {
return getStringValue("transport");
return getStringValue(TRANSPORT_KEY);
}

/**
Expand All @@ -602,7 +604,7 @@ public final String getFallbackTransport() {
* the transport mechanism
*/
public final void setTransport(String transport) {
setStringValue("transport", transport);
setStringValue(TRANSPORT_KEY, transport);
}

/**
Expand Down Expand Up @@ -667,7 +669,7 @@ public final String getState() {
* @return the transport
*/
public final String getTransport() {
return getStringValue("transport");
return getStringValue(TRANSPORT_KEY);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ private static native boolean hasPromise(Element element, int promiseId)
public void testClientCallableMethodInDom() {
assertServerEventHandlerMethodInDom(
NodeFeatures.CLIENT_DELEGATE_HANDLERS,
element -> assertPublishedMethods(element,
el -> assertPublishedMethods(el,
new String[] { "publishedMethod" }),
"publishedMethod");
}
Expand Down Expand Up @@ -240,26 +240,11 @@ private JsArray<String> getPublishedServerMethods(Element element) {
}
}

private JsArray<String> getPublishedServerMethods(
ServerEventObject object) {
if (object == null) {
return JsCollections.array();
} else {
return object.getMethods();
}
}

private void assertPublishedMethods(Element element, String[] expected) {
assertEventHandlerMethods(() -> getPublishedServerMethods(element),
expected);
}

private void assertPolymerMethods(Element element, String[] expected) {
ServerEventObject object = WidgetUtil.crazyJsoCast(element);
assertEventHandlerMethods(() -> getPublishedServerMethods(object),
expected);
}

private void assertEventHandlerMethods(
Supplier<JsArray<String>> methodsProvider, String... expected) {
JsArray<String> publishedServerMethods = methodsProvider.get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ import { ReactAdapterElement } from "Frontend/generated/flow/ReactAdapter.js";
import React from "react";

class ReactRouterOutletElement extends ReactAdapterElement {
connectedCallback() {
super.connectedCallback();
this.style.display = 'contents';
}

protected render(): React.ReactElement | null {
return <Outlet />;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public class FeatureFlags implements Serializable {

public static final Feature COPILOT_EXPERIMENTAL = new Feature(
"Copilot experimental features", "copilotExperimentalFeatures",
"https://vaadin.com/docs/latest/tools", false, null);
"https://vaadin.com/docs/latest/tools/copilot", false, null);

public static final Feature HILLA_FULLSTACK_SIGNALS = new Feature(
"Hilla Full-stack Signals", "fullstackSignals",
Expand All @@ -90,6 +90,11 @@ public class FeatureFlags implements Serializable {
"https://github.com/vaadin/platform/issues/6626", true,
"com.vaadin.flow.component.dashboard.Dashboard");

public static final Feature CARD_COMPONENT = new Feature("Card component",
"cardComponent",
"https://github.com/vaadin/web-components/issues/5340", true,
"com.vaadin.flow.component.card.Card");

private List<Feature> features = new ArrayList<>();

File propertiesFolder = null;
Expand Down Expand Up @@ -117,6 +122,7 @@ public FeatureFlags(Lookup lookup) {
features.add(new Feature(HILLA_FULLSTACK_SIGNALS));
features.add(new Feature(COPILOT_EXPERIMENTAL));
features.add(new Feature(DASHBOARD_COMPONENT));
features.add(new Feature(CARD_COMPONENT));
loadProperties();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* Callback which allows to handle request to map a client side DOM element to
* the server {@link Element} instance.
*
* @see Node#attachExistingElement(String, Element, ChildElementConsumer)
*
* @author Vaadin Ltd
* @since 1.0
*
Expand Down
36 changes: 0 additions & 36 deletions flow-server/src/main/java/com/vaadin/flow/dom/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -596,40 +596,4 @@ protected void ensureChildHasParent(Element child, boolean internalCheck) {
}
}
}

/**
* Attaches a child element with the given {@code tagName} which is the next
* sibling for the {@code previousSibling}.
* <p>
* The {@code previousSibling} parameter value can be {@code null} which
* means that the very first child with the given {@code tagName} will be
* used to attach (if any).
* <p>
* This method may be used to get a server side element for the client side
* DOM element which has been created on the client side aside of the
* server.
* <p>
* The element is not returned right away since it may not exist at all on
* the client side and its index in the children list is unknown. The
* provided {@code callback} is used instead to provide the mapped
* server-side element in case it has been found or report an error if it
* doesn't exist.
* <p>
* This API is experimental and disabled for public usage.
*
* @param tagName
* the tag name of the element to attach, not {@code null}
* @param previousSibling
* previous sibling, may be {@code null}
* @param callback
* the callback which will be invoked with a server side element
* instance or an error will be reported, not {@code null}
* @return this element
*/
private N attachExistingElement(String tagName, Element previousSibling,
ChildElementConsumer callback) {
getStateProvider().attachExistingElement(getNode(), tagName,
previousSibling, callback);
return getSelf();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@
*/
public class MenuRegistry {

private static final Logger log = LoggerFactory
.getLogger(MenuRegistry.class);

/**
* File routes lazy loading and caching.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ protected Serializable remove(String key) {

@Override
protected boolean mayUpdateFromClient(String key, Serializable value) {
return allowUpdateFromClient(key, value);
return allowUpdateFromClient(key);
}

@Override
Expand All @@ -212,7 +212,7 @@ protected boolean producePutChange(String key, boolean hadValueEarlier,
return super.producePutChange(key, hadValueEarlier, newValue);
}

private boolean allowUpdateFromClient(String key, Serializable value) {
private boolean allowUpdateFromClient(String key) {
AllowUpdate isAllowed = isUpdateFromClientAllowedBeforeFilter(key);
if (!AllowUpdate.NO_EXPLICIT_STATUS.equals(isAllowed)) {
return AllowUpdate.EXPLICITLY_ALLOW.equals(isAllowed);
Expand Down Expand Up @@ -476,19 +476,18 @@ private static Logger getLogger() {

/**
* The method first checks whether the update from client is allowed using
* the method {@link #allowUpdateFromClient(String, Serializable)}. Then if
* it's not allowed then it either throws or returns NO OPERATION runnable
* in case if {@link #updateFromClientFilter} disallows the update (in this
* case it's just an application business logic and we should not throw).
* the method {@link #allowUpdateFromClient(String)}. Then if it's not
* allowed then it either throws or returns NO OPERATION runnable in case if
* {@link #updateFromClientFilter} disallows the update (in this case it's
* just an application business logic and we should not throw).
*
* The logic inside the {@link #allowUpdateFromClient(String, Serializable)}
* check block repeats its own logic to make sure that:
* The logic inside the {@link #allowUpdateFromClient(String)} check block
* repeats its own logic to make sure that:
* <ul>
* <li>It's in sync with
* {@link #allowUpdateFromClient(String, Serializable)} (and
* <li>It's in sync with {@link #allowUpdateFromClient(String)} (and
* {@link #mayUpdateFromClient(String, Serializable)}
* <li>The update is disallowed by the filter (and not some other checks
* that are inside {@link #allowUpdateFromClient(String, Serializable)}
* that are inside {@link #allowUpdateFromClient(String)}
* <ul>
*
* Here is the logic flow:
Expand Down Expand Up @@ -555,7 +554,7 @@ private Runnable doDeferredUpdateFromClient(String key, Serializable value)
// Use private <code>allowUpdateFromClient</code> method instead of
// <code>mayUpdateFromClient</code> which may be overridden
// The logic below
if (!allowUpdateFromClient(key, value)) {
if (!allowUpdateFromClient(key)) {
if (isDisallowedByFilter(key)) {
return () -> {
// nop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,12 @@ private String getRoutes(BeforeEnterEvent event) {
routeTemplates.forEach(
(k, v) -> routeElements.add(routeTemplateToHtml(k, v)));

routeElements.addAll(getClientRoutes(event));
routeElements.addAll(getClientRoutes());
return routeElements.stream().map(Element::outerHtml)
.collect(Collectors.joining());
}

private List<Element> getClientRoutes(BeforeEnterEvent event) {
private List<Element> getClientRoutes() {
return FrontendUtils.getClientRoutes().stream()
.filter(route -> !route.contains("$layout"))
.map(route -> route.replace("$index", ""))
Expand Down
Loading

0 comments on commit 281f16a

Please sign in to comment.