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

Remove AMD? #23

Open
giuem opened this issue Feb 12, 2019 · 3 comments
Open

Remove AMD? #23

giuem opened this issue Feb 12, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@giuem
Copy link

giuem commented Feb 12, 2019

As this article said,

AMD is no longer a popular format, making it a likely distant fourth contender to ES Modules, CommonJS and globals. The problems AMD solves have been moved elsewhere - typically into the realm of module bundlers like Webpack and Rollup. Instead of asynchronous loading as a feature of our chosen module formats, it's an implementation detail of our chosen bundler.

We can remove AMD to save bytes as the article mentioned.

function DisqusJS(config) {}
// attempt to export for CommonJS
try { module.exports = DisqusJS; } catch (e) {}  
@SukkaW SukkaW pinned this issue Feb 17, 2019
@SukkaW SukkaW unpinned this issue Feb 17, 2019
@SukkaW SukkaW added the enhancement New feature or request label May 23, 2019
@SukkaW
Copy link
Owner

SukkaW commented Nov 4, 2019

AMD will be removed after v1.3.0

@giuem
Copy link
Author

giuem commented Nov 5, 2019

And enable babel loose mode will save a few bytes since code is cleaner. It also brings performance improvement. (e.g. for...of)

gulp.task('minify-js', () => gulp.src('src/**/*.js')
    .pipe(babel({
        "presets": [
            ["@babel/env", {
                "targets": configs.browsers,
+               "loose": true
            }]
        ]
    }))

BTW, I strongly recommend use bundlesize to trace the bundle size changes.

@kidonng
Copy link

kidonng commented Jul 11, 2020

AMD will be removed after v1.3.0

8 months later it is still there 🕊️

- try { module.exports = DisqusJS; } catch (e) { }
+ export { DisqusJS }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants