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

feat: environment specific event handlers #2272

Merged
merged 8 commits into from
Apr 4, 2024
Merged

feat: environment specific event handlers #2272

merged 8 commits into from
Apr 4, 2024

Conversation

HigherOrderLogic
Copy link
Contributor

@HigherOrderLogic HigherOrderLogic commented Mar 17, 2024

πŸ”— Linked issue

#1849

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

(updated by @pi0) This PR adds support for the environment-specific event handler filtering.

The conditions can be specified via filenames with .dev, .prod or .prerender or programmatically via env: [] option.

The default conditions to match are dev, prod, prerender or preset name this way we can make event handlers that only work in specific preset only.

--

Add the ablity to exclude a routes in production build by adding the .dev suffix.

I'm not sure if this should also apply to middlewares too.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@HigherOrderLogic HigherOrderLogic changed the title feat: .dev prefix for dev only route feat: .dev suffix for dev only route Mar 18, 2024
@pi0 pi0 changed the title feat: .dev suffix for dev only route feat: environment specific event handlers Apr 4, 2024
@pi0 pi0 changed the title feat: environment specific event handlers feat: environment specific scanned event handlers Apr 4, 2024
@pi0 pi0 marked this pull request as draft April 4, 2024 15:56
@pi0 pi0 changed the title feat: environment specific scanned event handlers feat: environment specific event handlers Apr 4, 2024
@pi0 pi0 marked this pull request as ready for review April 4, 2024 18:21
@pi0 pi0 merged commit c5d550a into nitrojs:main Apr 4, 2024
4 checks passed
@pi0
Copy link
Member

pi0 commented Apr 4, 2024

Thanks!

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