Closed
Description
Origin Types for Unions
- 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
becauseFoo
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
- Minifiers can't cache
Yadda.prototype
. - Idea: capture into a local variable called
Yadda_prototype
, minifiers can compact those into something likex
. - 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
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.
- Could imagine a version of the
- 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()
- Does this do any expensive sort of walks?
- Nope, already doing some work to find top-level
super()
.
- Nope, already doing some work to find top-level
- Seems good - glad to see it finally happen.
Cases for bundledPackageName
in 4.2
- 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?
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
menduz commentedon 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
And that's ok. Until you need another library, with a file named index.
This flag enabled the compilers to prepend the name of the lib to both the generated code and the
.d.ts
Oh well, we did. But we reduced the dependency tree and the code surface considerably.