Skip to content
This repository was archived by the owner on Feb 8, 2024. It is now read-only.

Enable babel-plugin-styled-components in production and tests#697

Merged
gzdunek merged 1 commit intomasterfrom
gzdunek/enable-styled-components-plugin
Mar 25, 2022
Merged

Enable babel-plugin-styled-components in production and tests#697
gzdunek merged 1 commit intomasterfrom
gzdunek/enable-styled-components-plugin

Conversation

@gzdunek
Copy link
Copy Markdown
Contributor

@gzdunek gzdunek commented Mar 25, 2022

Since this plugin was only enabled in the development, css prop worked locally but didn't work in the bundled app.

The plugin also improves bundle size a bit (2.36 MiB vs 2.38 MiB previously).

Copy link
Copy Markdown
Member

@ravicious ravicious left a comment

Choose a reason for hiding this comment

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

Tested this with the web UI by running the following command from packages/teleport and it looks like it doesn't break anything.

yarn g-start --config $(pwd)/webpack.prod.config.js --target=https://localhost:3080/web

plugins: [
...plugins,
'babel-plugin-styled-components',
['babel-plugin-styled-components', { displayName: true, ssr: false }],
Copy link
Copy Markdown
Member

@ravicious ravicious Mar 25, 2022

Choose a reason for hiding this comment

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

Wow, displayName is amazing for Teleterm where adding React DevTools is a bit of a pain. 🙏

This option enhances the attached CSS class name on each component with richer output to help identify your components in the DOM without React DevTools. In your page source you'll see: <button class="Button-asdf123 asdf123" /> instead of just <button class="asdf123" />.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

True, but I just want to add that there is no change for generated classnames.
This plugin generated displayName by default (so { displayName: true } in dev mode doesn't change anything - I added it for informative purposes).

@gzdunek
Copy link
Copy Markdown
Contributor Author

gzdunek commented Mar 25, 2022

Tested this with the web UI by running the following command from packages/teleterm and it looks like it doesn't break anything.

Probably you mean packages/teleport :)

@gzdunek gzdunek force-pushed the gzdunek/enable-styled-components-plugin branch from eeedcaa to e33ad3c Compare March 25, 2022 17:03
@gzdunek gzdunek merged commit 6613248 into master Mar 25, 2022
@gzdunek gzdunek deleted the gzdunek/enable-styled-components-plugin branch March 25, 2022 17:12
ravicious added a commit that referenced this pull request Apr 27, 2022
* Take `localClusterUri` into account in `QuickInput` (#679)

* Display cluster name for each connection

* Automatically try to connect a connection when possible

* Update connection icon

* Always use root cluster URI to obtain `documentsService` in `useServerConnect`

* Don't close the tab on non-zero exit code

* Autocomplete database names for tsh proxy db

* Change placeholder text in `ClusterAdd`

* Show leaf cluster name when possible in Connections list

* Hide kubes and apps

* Force `TopBar` items to take full height

* Change shortcut to open `QuickInput`

* Update electron-builder to 23.0.3

Versions lower than 23.0.2 don't work on newest macOS, see:

* electron-userland/electron-builder#6732
* electron-userland/electron-builder#6606

* remove `Navigator` code (#685)

* Prevent breaking layout on long cluster name (#688)

* Show username when possible in identity list (#687)

* Update command for updating proto files

* Update protobufs for Teleterm (LoginRequest params)

This commit removes a bunch of unused protobufs and also updates some of
those that got updated on the teleterm branch in the teleport repo.

The biggest change from all of them is that LoginRequest now has oneof
on Sso and Local. [1] This is because a login request should have either
Sso or Local params, but not both at the same time.

The previous implementation called both `setSso` and `setLogin` on the same
object. This no longer works with the use of `oneof`, because calling `setLogin`
after `setSso` would clear the `Sso` params. [2]

[1] gravitational/teleport#10286 (comment)
[2] https://developers.google.com/protocol-buffers/docs/proto3#oneof_features

* Render ssh menu item as `NavLink` only when URL is provided

* Use connection dropdown instead of modal for supplying SSH username

* Adjust `Identity` layout, combine `logout` and `clusterRemove` into a single action

* Change command `cluster-remove` to `cluster-logout`

* Apply `Identity` design changes

* Enable `babel-plugin-styled-components` in production and tests (#697)

* Make connections icon bigger

* Properly use `css` prop

Co-authored-by: Grzegorz Zdunek <gzdunek@users.noreply.github.com>
Co-authored-by: Grzegorz Zdunek <grzegorz.zdunek@goteleport.com>
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.

3 participants