-
Notifications
You must be signed in to change notification settings - Fork 13
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
Compile everything to ES5 #394
Conversation
@@ -5,6 +5,6 @@ export class Paragraph extends BlockAnnotation { | |||
static vendorPrefix = "offset"; | |||
|
|||
get rank() { | |||
return (super.rank * 3) / 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now hardcoded instead of relying on the superclass
@@ -8,6 +8,6 @@ export class Paragraph extends BlockAnnotation<GlobalAttributes> { | |||
static type = "p"; | |||
|
|||
get rank() { | |||
return (super.rank * 3) / 2; | |||
return 15; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mentions that it is generated automatically, where / how? Do I need to update anything beyond what I've already done to ensure this won't get wiped out in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's generated by a script we run manually. I don't anticipate us needing to run it again anytime soon? it just scrapes the html tag spec to generate annotation classes and like...unless they add a bunch of new tags I think we'd probably do any updates by hand
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the lines to change FWIW:
@@ -1,6 +1,7 @@ | |||
{ | |||
"extends": "../../../tsconfig.json", | |||
"compilerOptions": { | |||
"lib": ["dom", "dom.iterable", "es6"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
URLSearchParams needs these to be treated as iterable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The HTML annotations are generated by code in the scripts
directory
Comparing commonmark-spec: current against baselineThere's a 99.99% confidence that the time to execute this benchmark increased by 223.183ms ~ 640.693ms.
Comparing commonmark-spec equality: current against baselineThere's a 99.99% confidence that the time to execute this benchmark increased by 76.683ms ~ 163.991ms.
Comparing degenerate-markdown: current against baselineThere's a 99.999% confidence that the time to execute this benchmark increased by 474.560ms ~ 798.350ms.
Comparing degenerate-markdown equality: current against baselineWe're seeing with ~99.999% confidence that there is an increase in time between 506.480ms ~ 856.267ms, which isn't shown in the table below. We'll try to track down what functions became slower, but this is expected due to changes in the underlying data structures
|
Note for the above: the ES5 compilation has caused a lot of function names to change from the point of view of the profiler, so we should ignore all of the function stats listed above. The complete baseline comparison ( |
Well that's not great 😞 |
@neilius it's to be expected FWIW. We're still working on optimizations, but may need to change what we optimize. I think we can fiddle with some more |
Ahh, it's probably the |
@neilius and I are going to try to figure out a different way forward for this that doesn't involve taking performance for everyone. |
I'm closing this in favor of an alternate approach that we'll handle on internal repos. |
In trying to implement some custom annotations, I came up against the dreaded
Class constructor ... cannot be invoked without 'new'
error when trying to subclass theBlockAnnotation
. After beating my head against the wall trying all kinds of different Babel / webpack configs and a number of discussions with @tim-evans, I think this is the way forward to ensure the widest range of compatibility for the library generally, and it will conveniently fix the issues I'm coming up against when creating custom annotations.Please discuss and let me know if you think this is a bad idea or if you have concerns with this approach!