Skip to content

Commit

Permalink
fix: include Routes components in generated React module
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 579871094
  • Loading branch information
Extended Component Library Team authored and copybara-github committed Nov 6, 2023
1 parent 9676a62 commit 1ed2275
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
2 changes: 0 additions & 2 deletions build/make_react.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ import {RequestErrorEvent} from '../base/events.js';
`; // Import new event types here (TS compiler will complain otherwise).

for (const {name: className, tagName, events, path, members} of components) {
if (className.startsWith('Route')) continue;

const classAlias = className + 'WC';
const eventMapping = printEventMapping(events ?? []);
content += `
Expand Down
38 changes: 38 additions & 0 deletions src/react/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,44 @@ export const PlaceReviews = createComponent({
react: React,
});

import {RouteDataProvider as RouteDataProviderWC} from '../route_building_blocks/route_data_provider/route_data_provider.js';

export const RouteDataProvider = createComponent({
tagName: 'gmpx-route-data-provider',
elementClass: RouteDataProviderWC,
react: React,
events: {
'onRequestError': 'gmpx-requesterror' as EventName<RequestErrorEvent>,
},
});

import {RouteMarker as RouteMarkerWC} from '../route_building_blocks/route_marker/route_marker.js';

export const RouteMarker = createComponent({
tagName: 'gmpx-route-marker',
elementClass: RouteMarkerWC,
react: React,
});

import {RouteOverview as RouteOverviewWC} from '../route_overview/route_overview.js';

export const RouteOverview = createComponent({
tagName: 'gmpx-route-overview',
elementClass: RouteOverviewWC,
react: React,
events: {
'onRequestError': 'gmpx-requesterror' as EventName<RequestErrorEvent>,
},
});

import {RoutePolyline as RoutePolylineWC} from '../route_building_blocks/route_polyline/route_polyline.js';

export const RoutePolyline = createComponent({
tagName: 'gmpx-route-polyline',
elementClass: RoutePolylineWC,
react: React,
});

import {SplitLayout as SplitLayoutWC} from '../split_layout/split_layout.js';

export const SplitLayout = createComponent({
Expand Down

0 comments on commit 1ed2275

Please sign in to comment.