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

Design Meeting Notes, 1/8/2021 #42261

Closed
DanielRosenwasser opened this issue Jan 8, 2021 · 1 comment
Closed

Design Meeting Notes, 1/8/2021 #42261

DanielRosenwasser opened this issue Jan 8, 2021 · 1 comment
Labels
Design Notes Notes from our design meetings

Comments

@DanielRosenwasser
Copy link
Member

Origin Types for Unions

#36392

  • Type writer seems to emit weird circularities.
    • Not a blocker? Just fix it.
    • But makes cases more obscure.
    • Seems like these are still regressions
  • Baseline writer is taking advantage of Foo: Foo because Foo is in scope.
  • This isn't related to .d.ts emit or quick info.
    • So this is only internal infrastructure.
  • Downside - .types files won't display what a user sees.
    • Error and quick info tests will do that.
  • If we lack the infra to print .types baselines, we might be doing the wrong thing for .d.ts emit.
  • Around line 142 of typewriter.ts

Capture Constructor.prototype in Emit

#33363

  • Minifiers can't cache Yadda.prototype.
  • Idea: capture into a local variable called Yadda_prototype, minifiers can compact those into something like x.
  • Downside: our own class output gets harder to analyze.
  • Doesn't compression help with file size?
    • Not with parse speed, but yes.
  • Coming back to analyzing - could do some basic analysis for aliasing .prototype
  • In general, we want to be thoughtful about understanding our own emit.
  • We believe gzip should make it "good enough", maybe changes should be made in actual minifiers.

Destructuring Patterns in for-in Loops

#33337

for (var [a, b] in  { "🐛": 100 }) {
    // ....
}
  • We say the emit is invalid.
  • But in ES2015+ it should be valid.
  • What about downlevelIteration?
    • Could imagine a version of the __read helper that could do this.
  • Complicates emit, can be slower.
  • This PR might not be the right thing - but we're open to a PR that removes the error for ES2015+.

Allow Non-super Non-this Code in Derived classes before super()

#29374

  • Does this do any expensive sort of walks?
    • Nope, already doing some work to find top-level super().
  • Seems good - glad to see it finally happen.

Cases for bundledPackageName in 4.2

#41499

  • Was breaky, comes down to if we want to bring it back into the master branch.
  • Big thing is bike-shedding the name.
    • The name has already had its shed bike'd.
  • People want to be able to use paths to dig into bundles.
  • System wants to discourage this sorta thing.
    • System 1 and AMD are still used, sooo.
  • Why can't someone do a post-processing step?
    • We need the information ourselves - doesn't work with incremental mode.
  • How does path mapping work with this?
@DanielRosenwasser DanielRosenwasser added the Design Notes Notes from our design meetings label Jan 8, 2021
@menduz
Copy link

menduz commented Jan 19, 2021

I can probably help with some use cases for "Cases for bundledPackageName in 4.2"

Decentraland used this feature to create libraries. Our runtime supports AMD, like VSCode. And our environment works with the stupidest build process ever: we concatenate AMD files. No webpack, rollup or any other transformation needed.

We also leverage Typescript to do the task of compiling the AMD and also to enable the proper typing of the imports.

The problem this flag solved may be very specific but it made us remove (a ton) of dependencies to analyze the code and post-process it. .d.ts is easy, even regex works. generated .js was very difficult in comparision.

Imagine a library exposing an index file.

It used to generate a code like this

define("index", ....)

And that's ok. Until you need another library, with a file named index.

define("index", ..lib1..)
define("index", ..lib2..)

This flag enabled the compilers to prepend the name of the lib to both the generated code and the .d.ts

define("lib1/index", ..lib1..)
define("lib2/index", ..lib2..)

Why can't someone do a post-processing step?

Oh well, we did. But we reduced the dependency tree and the code surface considerably.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design Notes Notes from our design meetings
Projects
None yet
Development

No branches or pull requests

2 participants