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
Implement Site.Prototype methods in ES6 syntax #2280 #2356
Conversation
Which solution are you referring to? |
I was referring to this comment: #979 (comment) ESlint doesn't show any parsing errors for me so I assumed it was updated alr. |
I see, so because class fields proposal is accepted in TC39 hence there is no more syntax error complained by Eslint? I briefly searched it and found that class fields seem to not work in IE at all and have about ~92% support globally It's not a big issue, but good to find out more before we make this change. |
I did some search and the browser support for both constructor and class fields are similar, so logically speaking, MarkBind should be able to continue supporting the browsers that we are currently supporting. Javascript class is not supported in IE at all: https://caniuse.com/?search=class. So anyway, our current MarkBind is not supported in IE at all |
Codecov Report
@@ Coverage Diff @@
## master #2356 +/- ##
==========================================
+ Coverage 45.11% 45.16% +0.05%
==========================================
Files 123 123
Lines 5165 5159 -6
Branches 1086 1086
==========================================
Hits 2330 2330
+ Misses 2516 2510 -6
Partials 319 319
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
LGTM
@@ -26,7 +26,7 @@ const addHandler = (site, onePagePath) => (filePath) => { | |||
} | |||
Promise.resolve('').then(async () => { | |||
if (site.isFilepathAPage(filePath) || site.isDependencyOfPage(filePath)) { | |||
return site.rebuildSourceFiles(filePath); |
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.
hmm, maybe there's something wrong here. I'm not sure why we are rebuilding all source files when one file is added/removed. Anyhow, it's not related to this PR.
* Build/copy assets that are specified in filePaths | ||
* @param filePaths a single path or an array of paths corresponding to the assets to build | ||
*/ | ||
buildAsset = delay(this._buildMultipleAssets as () => Bluebird<unknown>, 1000); |
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.
Might cause a type problem in the future when serveUtil.js is migrated to TypeScript, but should be ok for now.
What is the purpose of this pull request?
Resolves #2280 according to solution proposed in #979
Overview of changes:
Site.prototype
methods implemented inSite/index.ts
using ES6 class syntaxAnything you'd like to highlight/discuss:
Testing instructions:
npm run test
Proposed commit message: (wrap lines at 72 characters)
Refactor Site.prototype methods in ES6 syntax
Checklist: ☑️