Skip to content

Commit

Permalink
Merge pull request #670 from opentripplanner/reduce-bundle-size
Browse files Browse the repository at this point in the history
Reduce Bundle Size pt 1
  • Loading branch information
daniel-heppner-ibigroup authored Oct 14, 2022
2 parents c479916 + 8fd319f commit 7ba4850
Show file tree
Hide file tree
Showing 14 changed files with 71 additions and 2,466 deletions.
2 changes: 1 addition & 1 deletion lib/components/admin/call-record.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable react/prop-types */
import { Circle } from '@styled-icons/fa-solid/Circle'
import { Clock } from '@styled-icons/fa-regular'
import { Clock } from '@styled-icons/fa-regular/Clock'
import { differenceInMilliseconds, format } from 'date-fns'
import { Phone } from '@styled-icons/fa-solid/Phone'
import { PhoneAlt } from '@styled-icons/fa-solid/PhoneAlt'
Expand Down
12 changes: 5 additions & 7 deletions lib/components/admin/call-taker-controls.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import { connect } from 'react-redux'
import { GraduationCap } from '@styled-icons/fa-solid/GraduationCap'
import { History } from '@styled-icons/fa-solid/History'
import { injectIntl, IntlShape, WrappedComponentProps } from 'react-intl'
import { Phone } from '@styled-icons/fa-solid/Phone'
import { Plus } from '@styled-icons/fa-solid/Plus'
import { Stop } from '@styled-icons/fa-solid/Stop'
import React, { Component } from 'react'

import * as apiActions from '../../actions/api'
import * as callTakerActions from '../../actions/call-taker'
import * as fieldTripActions from '../../actions/field-trip'
import * as uiActions from '../../actions/ui'
import {
GraduationCap,
History,
Phone,
Plus,
Stop
} from '@styled-icons/fa-solid'
import { isModuleEnabled, Modules } from '../../util/config'

import {
Expand Down
2 changes: 1 addition & 1 deletion lib/components/admin/draggable-window.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Times } from '@styled-icons/fa-solid'
import { Times } from '@styled-icons/fa-solid/Times'
import Draggable, { DraggableProps } from 'react-draggable'
import React, { HTMLAttributes, ReactNode } from 'react'

Expand Down
2 changes: 1 addition & 1 deletion lib/components/admin/field-trip-notes.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable react/prop-types */
import { Badge, Button as BsButton } from 'react-bootstrap'
import { Plus } from '@styled-icons/fa-solid/Plus'
import { StickyNote } from '@styled-icons/fa-regular'
import { StickyNote } from '@styled-icons/fa-regular/StickyNote'
import { Trash } from '@styled-icons/fa-solid/Trash'
import React, { Component } from 'react'
import styled from 'styled-components'
Expand Down
2 changes: 1 addition & 1 deletion lib/components/form/date-time-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { CaretUp } from '@styled-icons/fa-solid/CaretUp'
import { Clock } from '@styled-icons/fa-regular/Clock'
import { connect } from 'react-redux'
import { injectIntl } from 'react-intl'
import { PencilAlt } from '@styled-icons/fa-solid'
import { PencilAlt } from '@styled-icons/fa-solid/PencilAlt'
import { toDate } from 'date-fns-tz'
import PropTypes from 'prop-types'
import React, { Component } from 'react'
Expand Down
4 changes: 3 additions & 1 deletion lib/components/form/settings-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
/* eslint-disable jsx-a11y/no-static-element-interactions */
/* eslint-disable jsx-a11y/click-events-have-key-events */
import { Button } from 'react-bootstrap'
import { CaretDown, CaretUp, PencilAlt } from '@styled-icons/fa-solid'
import { CaretDown } from '@styled-icons/fa-solid/CaretDown'
import { CaretUp } from '@styled-icons/fa-solid/CaretUp'
import { connect } from 'react-redux'
import { PencilAlt } from '@styled-icons/fa-solid/PencilAlt'
import { useIntl } from 'react-intl'
import coreUtils from '@opentripplanner/core-utils'
import PropTypes from 'prop-types'
Expand Down
13 changes: 1 addition & 12 deletions lib/components/map/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { setMapillaryId } from '../../actions/map'
import DefaultMap from './default-map'
import LegDiagram from './leg-diagram'
import MapillaryFrame from './mapillary-frame'
import StylizedMap from './stylized-map'

class Map extends Component {
constructor() {
Expand All @@ -19,16 +18,6 @@ class Map extends Component {
}
}

getComponentForView(view) {
// TODO: allow a 'CUSTOM' type
switch (view.type) {
case 'DEFAULT':
return <DefaultMap />
case 'STYLIZED':
return <StylizedMap />
}
}

render() {
const { activeMapillaryImage, diagramLeg, mapConfig, setMapillaryId } =
this.props
Expand All @@ -52,7 +41,7 @@ class Map extends Component {
i === this.state.activeViewIndex ? 'visible' : 'hidden'
}}
>
{this.getComponentForView(view)}
<DefaultMap />
</div>
)
})}
Expand Down
143 changes: 0 additions & 143 deletions lib/components/map/stylized-map.js

This file was deleted.

3 changes: 2 additions & 1 deletion lib/components/mobile/batch-results-screen.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
/* eslint-disable react/prop-types */
import { ArrowsAlt } from '@styled-icons/fa-solid/ArrowsAlt'
import { Button } from 'react-bootstrap'
import { connect } from 'react-redux'
import { FormattedMessage } from 'react-intl'
import { ListUl } from '@styled-icons/fa-solid/ListUl'
import coreUtils from '@opentripplanner/core-utils'
import React from 'react'
import styled, { css } from 'styled-components'

import * as uiActions from '../../actions/ui'
import { ArrowsAlt, ListUl } from '@styled-icons/fa-solid'
import {
getActiveItineraries,
getActiveSearch,
Expand Down
2 changes: 1 addition & 1 deletion lib/components/user/back-to-trip-planner.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ArrowLeft } from '@styled-icons/fa-solid'
import { ArrowLeft } from '@styled-icons/fa-solid/ArrowLeft'
import { FormattedMessage } from 'react-intl'
import React from 'react'
import styled from 'styled-components'
Expand Down
2 changes: 0 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import SettingsPreview from './components/form/settings-preview'
import SwitchButton from './components/form/switch-button'
import DefaultMap from './components/map/default-map'
import Map from './components/map/map'
import StylizedMap from './components/map/stylized-map'
import DefaultItinerary from './components/narrative/default/default-itinerary'
import MetroItinerary from './components/narrative/metro/metro-itinerary'
import ItineraryCarousel from './components/narrative/itinerary-carousel'
Expand Down Expand Up @@ -69,7 +68,6 @@ export {
LocationField,
PlanTripButton,
SettingsPreview,
StylizedMap,
SwitchButton,

// map components
Expand Down
2 changes: 0 additions & 2 deletions lib/util/mailables.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { format } from 'date-fns'
import blobStream from 'blob-stream'

import PDFDocument from './PDFDocumentWithTables'

/**
* Fields use to construct PDF letter. The nested arrays
* correspond to rows of inputs in the form layout.
Expand Down
7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@opentripplanner/geocoder": "^1.3.0",
"@opentripplanner/humanize-distance": "^1.2.0",
"@opentripplanner/icons": "^1.2.5",
"@opentripplanner/itinerary-body": "^4.1.0",
"@opentripplanner/itinerary-body": "^4.1.1",
"@opentripplanner/location-field": "1.12.7",
"@opentripplanner/location-icon": "^1.4.0",
"@opentripplanner/park-and-ride-overlay": "^2.0.1",
Expand All @@ -66,10 +66,7 @@
"clone": "^2.1.0",
"connected-react-router": "^6.8.0",
"copy-to-clipboard": "^3.0.8",
"country-flag-icons": "^1.4.19",
"currency-formatter": "^1.4.2",
"d3-selection": "^1.3.0",
"d3-zoom": "^1.7.1",
"date-fns": "^2.23.0",
"date-fns-tz": "^1.1.4",
"deepmerge": "^4.2.2",
Expand Down Expand Up @@ -120,7 +117,6 @@
"seamless-immutable": "^7.1.3",
"styled-components": "^5.0.0",
"tinycolor2": "^1.4.2",
"transitive-js": "^0.14.1",
"yup": "^0.29.3"
},
"devDependencies": {
Expand Down Expand Up @@ -170,6 +166,7 @@
"husky": "^6.0.0",
"jest-transform-stub": "^2.0.0",
"jest-yaml-transform": "^0.2.0",
"json-loader": "^0.5.7",
"lint-staged": "^11.1.2",
"nock": "^9.0.9",
"patch-package": "^6.4.7",
Expand Down
Loading

0 comments on commit 7ba4850

Please sign in to comment.