Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Babel updates: compile helpers, plugins; add plugins #164

Merged
merged 10 commits into from
Aug 13, 2019
Merged

Conversation

katydecorah
Copy link
Contributor

@katydecorah katydecorah commented Aug 5, 2019

This PR is part of an action item from the IE11 bug postmortem.

  • Makes babel compile src/helpers and src/plugins files, these were previously copied over.
    • While rolling out 0.19.3, repos that used the version-sort helper were failing on IE11 due to an arrow function. I was able to get around it by adding dr-ui to the babelInclude in those repos.
    • This PR fixes that at the source by adding the transform arrow functions plugin.
    • We don't have a src/data dir, so that is removed fro the build script.
  • Add object assign plugin to properly polyfill object.assign.
  • Clean up
    • Adding react version to eslint config to satisfy a warning from the react eslint plugin
    • Updated package.json to point at dr-ui repo rather than old frontend-documentation repo
  • Adds eslint-plugin-es to fail if we use any features that we don't have babel set up to compile
    • And turns off any rules that we know to compile as expected. We can adjust these as needed or as we add more babel plugins.

To confirm these new Babel changes are working on IE11, I did the following:

  1. Ran npm run build
  2. Locally installed the dr-ui build in the vector-tiles repo.
  3. Ran npm start and tested in IE11 Browserstack, especially a page using the note component.

No hurry in reviewing this PR.

@colleenmcginnis colleenmcginnis requested review from colleenmcginnis and removed request for danswick August 9, 2019 20:33
Copy link
Contributor

@colleenmcginnis colleenmcginnis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested these changes in /ios-sdk. Versions are being sorted correctly and notes look correct in IE11. @katydecorah it's up to you if you want @danswick to take a look, too!

Copy link
Contributor

@colleenmcginnis colleenmcginnis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wait. All works as expected on start, but I'm seeing a similar error as I was seeing in #165 when I build:

[17:37:22 Batfish] Error: Webpack compilation error.

../dr-ui/pkg/back-to-top-button/index.js
Module build failed: ReferenceError: Unknown plugin "babel-plugin-transform-react-remove-prop-types" specified in "base" at 4, attempted to resolve relative to "/path/to/folder/dr-ui/pkg/back-to-top-button"
    at Array.map (<anonymous>)

Katy DeCorah added 2 commits August 12, 2019 09:18
* master:
  [Search] Enable babel polyfill on `Search` component (#165)
  [BackToTopButton] use `window.scroll(x-coord, y-coord)`  (#167)
  Create a note "flavor" for new products or features (#162)
  [docs] Update webhook staging urls (#161)
@katydecorah
Copy link
Contributor Author

@colleenmcginnis I updated this PR with master (which now has the erroring plugin from #165 ) and confirmed:

  • npm run build is successful with /ios
  • site loads locally in IE 11
  • site loads locally in an older browser (Firefox 44)

Copy link
Contributor

@colleenmcginnis colleenmcginnis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works as expected for me after the most recent changes! Thanks @katydecorah 💃

@katydecorah katydecorah merged commit 32a12f4 into master Aug 13, 2019
@katydecorah katydecorah deleted the lint-es branch August 13, 2019 20:59
katydecorah pushed a commit that referenced this pull request Aug 14, 2019
* master:
  [babel] Add babel config to helpers and plugins, add eslint plugins (#164)
  [Search] Enable babel polyfill on `Search` component (#165)
  [BackToTopButton] use `window.scroll(x-coord, y-coord)`  (#167)
katydecorah pushed a commit that referenced this pull request Aug 14, 2019
* master:
  [babel] Add babel config to helpers and plugins, add eslint plugins (#164)
  [Search] Enable babel polyfill on `Search` component (#165)
  [BackToTopButton] use `window.scroll(x-coord, y-coord)`  (#167)
katydecorah pushed a commit that referenced this pull request Aug 16, 2019
* master: (24 commits)
  0.20.1
  Prepare 0.20.1
  0.20.0
  Prepare 0.20.0
  Prevent src/components/syntax-highlighters from being adding to pkg
  Update WarningImage in GLWrapper
  Update CHANGELOG.md
  Add syntax highlighting functions (#172)
  Add `GLWrapper` and `DemoIframe` components. (#166)
  compress svg
  update *-image themes and clean up svg, make IE11 friendly, set default `size` & make it a number
  [babel] Add babel config to helpers and plugins, add eslint plugins (#164)
  [Search] Enable babel polyfill on `Search` component (#165)
  [BackToTopButton] use `window.scroll(x-coord, y-coord)`  (#167)
  Create a note "flavor" for new products or features (#162)
  [docs] Update webhook staging urls (#161)
  0.19.3
  Update CHANGELOG.md
  [Note] replace Object.assign with a function (#159)
  0.19.2
  ...
katydecorah pushed a commit that referenced this pull request Sep 3, 2019
* master:
  Add Browser component (#177)
  [test-cases app] create `npm run start-legacy` to test in IE11 (#178)
  Create a video component (#176)
  0.20.1
  Prepare 0.20.1
  0.20.0
  Prepare 0.20.0
  Prevent src/components/syntax-highlighters from being adding to pkg
  Update WarningImage in GLWrapper
  Update CHANGELOG.md
  Add syntax highlighting functions (#172)
  Add `GLWrapper` and `DemoIframe` components. (#166)
  compress svg
  update *-image themes and clean up svg, make IE11 friendly, set default `size` & make it a number
  [babel] Add babel config to helpers and plugins, add eslint plugins (#164)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants