Skip to content

Instantly share code, notes, and snippets.

@mattkelley
Last active August 29, 2017 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattkelley/2f3247cf391afdacbb0b8bc20ad07324 to your computer and use it in GitHub Desktop.
Save mattkelley/2f3247cf391afdacbb0b8bc20ad07324 to your computer and use it in GitHub Desktop.
Frontend talk notes

Extending webpack dev server routes:

Problem: Needed a development ONLY page, hosted on same protocol/host/port for creating auth tokens. If we want to use webstorage, protocol/host/port much match, otherwise the token will not be availible, unlike cookie storage

Why use webStorage?

Simpler API, not need to require a 3rd party cookie parsing library. More importantly, webStorage exposes events for changes made to the store, offering better user experience than storing JWT in cookies

Reference: https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API#Responding_to_storage_changes_with_the_StorageEvent

Class properties transform

Gist example: https://gist.github.com/mattkelley/bca487e5cfead073d6a5d9597e4fd92a

Proposal: https://github.com/tc39/proposal-class-fields

Babel transform: https://babeljs.io/docs/plugins/transform-class-properties/

Component Folder pattern

Styled-components: https://www.styled-components.com/

Medium article: https://medium.com/styled-components/component-folder-pattern-ee42df37ec68

Swagger mock server or Jest snapshots

If time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment