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

Platform.isLinux and company should be const #35705

Closed
Hixie opened this issue Jan 18, 2019 · 7 comments
Closed

Platform.isLinux and company should be const #35705

Hixie opened this issue Jan 18, 2019 · 7 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug

Comments

@Hixie
Copy link
Contributor

Hixie commented Jan 18, 2019

We'd like to have code that does something like this:

// these are giant maps
const Map mac = {...};
const Map windows = {...};
const Map linux = {...};

convert(foo) {
  if (Platform.isMac)
    return mac[foo];
  if (Platform.isLinux)
    return linux[foo];
  if (Platform.isWindows)
    return windows[foo];
  return null;
}

We only want to ship the maps that apply to the current platform; we'd like the others to tree-shake out.

@Hixie
Copy link
Contributor Author

Hixie commented Jan 18, 2019

cc @gspencergoog

@kevmoo kevmoo added library-io area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. labels Jan 18, 2019
@sortie
Copy link
Contributor

sortie commented Jan 21, 2019

Hi. I'm the new maintainer of dart:io. I actually ran into this issue the other day, I agree it would be nice for them to be const.

@sortie sortie added the type-enhancement A request for a change that isn't a bug label Jan 21, 2019
@zoechi
Copy link
Contributor

zoechi commented Jan 21, 2019

Seems to be related to #31969

@gspencergoog
Copy link
Contributor

Any idea on where this issue is in the priorities for the SDK? This would be pretty useful, especially now that flutter is expanding to more platforms.

@sortie sortie self-assigned this May 29, 2019
@sortie sortie added the P1 A high priority bug; for example, a single project is unusable or has many test failures label May 29, 2019
@sortie
Copy link
Contributor

sortie commented May 29, 2019

Hi Greg. I'm hoping to do some work on this issue this quarter so flutter for web is better supported. I'm writing up a plan and will be sharing it.

@franklinyow
Copy link
Contributor

@sortie Please re-evaluate this and do one of the following:

  1. Add it to a milestone if it is still P1
  2. Change priority label and add milestone if no longer P1
  3. Close, if this issue is no longer needed

@sortie sortie added P2 A bug or feature request we're likely to work on and removed P1 A high priority bug; for example, a single project is unusable or has many test failures labels Aug 11, 2020
@sstrickl
Copy link
Contributor

After 2c0484c and a4cb6ab, this should be the case for AOT-compiled programs in Dart. For Flutter, after flutter/flutter#127567 landed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

7 participants