Skip to content

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

Merged
jessicamcinchak merged 4 commits intomainfrom
jess/condense-draw-style-props
Aug 6, 2024
Merged

break: condense and deprecate redundant styling-related props#473
jessicamcinchak merged 4 commits intomainfrom
jess/condense-draw-style-props

Conversation

@jessicamcinchak
Copy link
Copy Markdown
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?

@netlify
Copy link
Copy Markdown

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

/**
* @deprecated - please set `drawColor` regardless of `drawType`
*/
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 👍

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