Skip to content

Guard generics support behind an experiment flag. #1279

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

Merged
merged 1 commit into from
Mar 24, 2024

Conversation

nevkontakte
Copy link
Member

This commit adds support for GOPHERJS_EXPERIMENT environment variable that can be used to enable experimental functionality in the compiler.

Experiment flags can be easily added or removed by updating fields of the internal/experiments.Flags struct. For now, only boolean flags are supported, but it should be easy enough to extend if needed.

Users need to have GOPHERJS_EXPERIMENT=generics set in their environment to enable support. Adding the flag will allow us to merge generics support into the main branch before it's fully production-ready without creating unnecessary confusion for the users.

Updates #1013

@nevkontakte nevkontakte requested a review from flimzy March 23, 2024 20:00
This commit adds support for GOPHERJS_EXPERIMENT environment variable
that can be used to enable experimental functionality in the compiler.

Experiment flags can be easily added or removed by updating fields of
the internal/experiments.Flags struct. For now, only boolean flags are
supported, but it should be easy enough to extend if needed.

Users need to have GOPHERJS_EXPERIMENT=generics set in their environment
to enable support. Adding the flag will allow us to merge generics
support into the main branch before it's fully production-ready without
creating unnecessary confusion for the users.
@@ -204,6 +212,8 @@ jobs:
darwin_smoke:
macos:
xcode: 13.4.1 # Mac OS 12.6.1, see https://circleci.com/docs/using-macos/
environment:
GOPHERJS_EXPERIMENT: generics
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to run our tests (or maybe a subset) both with and without generics support, to ensure we don't break non-generics support during this transition?

Copy link
Member Author

Choose a reason for hiding this comment

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

Running all tests seems prohibitively expensive, considering that they ballooned up to 30m again. But it may be worth having a smoke test of some sort. What do you think would be a reasonable subset?

@@ -0,0 +1,122 @@
// Package experiments managed the list of experimental feature flags supported
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Package experiments managed the list of experimental feature flags supported
// Package experiments manages the list of experimental feature flags supported

@nevkontakte nevkontakte merged commit 7f11cd4 into gopherjs:generics-ng Mar 24, 2024
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