Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

break: condense and deprecate redundant styling-related props #473

Merged
merged 4 commits into from
Aug 6, 2024

Conversation

jessicamcinchak
Copy link
Member

@jessicamcinchak jessicamcinchak commented Aug 2, 2024

Our styling-related props haven't always been so consistent, so let's tidy them up with a v1 release in mind & flag some as deprecated.

Here's a quick overview of exisitng & changing style-related props based on various modes/functionalities:

  • Drawing
    • drawColor (string) - fill automatically applied at 20% (used to be 10%)
    • drawPointColor (string) now deprecated - it's only possible to set a single drawType at a time anyways, so drawColor is sufficient
    • drawFillColor (string) now deprecated
    • drawPointer (enum)
  • Showing a center map marker (based on lat,lng props not geojson)
    • markerColor (string)
    • markerImage (enum)
  • Displaying GeoJSON data
    • geojsonColor (string)
    • geojsonFill (boolean) - 20% if true
  • Showing OS Features at point
    • featureColor (string)
    • featureFill (boolean) - 20% if true
    • featureBorderNone (string) now deprecated

Any other votes for deprecation or refactoring?

Copy link

netlify bot commented Aug 2, 2024

Deploy Preview for oslmap ready!

Name Link
🔨 Latest commit 078204e
🔍 Latest deploy log https://app.netlify.com/sites/oslmap/deploys/66b21bfdf058290008909c61
😎 Deploy Preview https://deploy-preview-473--oslmap.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@jessicamcinchak jessicamcinchak marked this pull request as ready for review August 6, 2024 12:47
@@ -88,6 +88,9 @@ export class MyMap extends LitElement {
@property({ type: String })
drawType: DrawTypeEnum = "Polygon";

/**
* @deprecated - please set `drawColor` regardless of `drawType`
*/
Copy link
Member Author

@jessicamcinchak jessicamcinchak Aug 6, 2024

Choose a reason for hiding this comment

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

My thinking is we'll do a NPM prerelease with the @deprecated annotations, then fully remove them ahead of the stable release - sound like a decent plan?

Copy link
Contributor

Choose a reason for hiding this comment

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

Perfect!

@jessicamcinchak jessicamcinchak changed the title break: condense and deprecate styling-related props break: condense and deprecate redundant styling-related props Aug 6, 2024
@jessicamcinchak jessicamcinchak requested a review from a team August 6, 2024 12:53
Copy link
Contributor

@DafyddLlyr DafyddLlyr left a comment

Choose a reason for hiding this comment

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

Super helpful and clear PR description thanks 🙌

let featureColor = feature.get("color") || this.geojsonColor; // Use the geojsonColor if no color property exists

// Read color from geojson feature `properties` if set or fallback to prop
let featureColor = feature.get("color") || this.geojsonColor;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: It looks like this could actually be a const?

Another "pre v1" task might be to set up linting here to catch a few of these type of things?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep great shout - will handle in a followup PR 👍

@jessicamcinchak jessicamcinchak merged commit 03b57d7 into main Aug 6, 2024
5 checks passed
@jessicamcinchak jessicamcinchak deleted the jess/condense-draw-style-props branch August 6, 2024 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants