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

Some cleanup #145

Merged
merged 11 commits into from
Jul 30, 2020
Merged

Some cleanup #145

merged 11 commits into from
Jul 30, 2020

Conversation

pirj
Copy link
Member

@pirj pirj commented May 22, 2020

  • Ditch puma and foreman

    Having Foreman for a single process is pointless. Puma is webscale, but
    middleman server works quite fine without it.

  • Rearrange dependencies

    [x] moved bourbon, neat, and slim under dev, only needed to build
    [x] removed hard version specifiers - they are locked anyway
    [x] bumped builder to get rid of ::Fixnum deprecation warning
    [x] changed middleman-syntax to use the released rubygems version
    [x] added rack-contrib, no idea how try_static worked without it
    [x] bumped middleman-livereload to get rid of some warning
    [-] bump middleman* to work with Bundler 2 (middleman 3.x can't) - middleman-deploy is an "old" unsupported extension, and there's no clear path to update. Also source_dir is not defined anymore

  • Ditch docs-template gem - unused?

  • Ditch bower

@pirj pirj self-assigned this May 22, 2020
@pirj pirj requested review from JonRowe and benoittgt May 22, 2020 22:31
@@ -66,5 +66,4 @@ html.no-js lang="en"
br
= image_tag "https://cdn.dnsimple.com/assets/resolving-with-us/logo-dark.png", alt: "DNSimple", style: "width:100px;"
= partial 'google_analytics'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was also tempting to remove this. Not sure if there's any use for analytics 🔍

(document.getElementsByTagName('head')[0] ||
document.getElementsByTagName('body')[0]).appendChild(snd);
})();
</script>
Copy link
Member

@JonRowe JonRowe May 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we wish to stop our participation in seed and dew thats a discussion we can have, but whilst we're still setup with them and open collective receives money from them on our behalf this needs to remain to track that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, my bad. I got confused by this line in the console:

Loading failed for the <script> with source “https://www.seedanddew.com/static/embed.min.js”.

Might be my adblocker.
Where do those support buttons are supposed to appear? Can't see anything even in Incognito.

snd.src = 'https://www.seedanddew.com/static/embed.min.js';
(document.getElementsByTagName('head')[0] ||
document.getElementsByTagName('body')[0]).appendChild(snd);
})();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above

"version": "0.0.0",
"homepage": "https://github.com/rspec/rspec-website",
"authors": [
"Andrew <[email protected]>"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Andrew should be added to the credits somewhere really!

"tests"
],
"dependencies": {
"normalize-css": "~2.1.3"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is still used no?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do, inline:

source/stylesheets/_application.css.scss
1://= normalize
3:@import "normalize";

source/stylesheets/_normalize.css
1:/*! normalize.css v2.0.1 | MIT License | git.io/normalize */

It seems we're far behind the current v8.0.1 :D

@@ -170,17 +161,16 @@ PLATFORMS
DEPENDENCIES
bourbon
builder (~> 3.0)
foreman
bundler (~> 1.17.3)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a version of middleman that supports bundler 2

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't prepared for cleanup & full update, but if you ask for it, sure :D

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the update to Middleman 4:

/Users/pirj/.rvm/gems/[email protected]/gems/middleman-core-4.3.6/lib/middleman-core/extensions.rb:96:in `load': Tried to activate old-style extension: deploy. They are no longer supported. (RuntimeError)

I don't see a clear way to deploy otherwise, might be git push staging master would work.
Also, source_dir in RSpecInfo::Helpers.rspec_documentation_latest(source_dir) is not defined, so probably version fallback is broken.

I'd say there's a lot of work with no tangible benefit. Let's stick with Bundler 1 for now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JonRowe Can you please grant me permissions to push to https://github.com/rspec-staging/rspec-staging.github.io/ 's master?

I intend to rework the deployment in the following way:

  • update middleman and middleman-core to the latest
  • drop middleman-deploy and its configs
  • use Bundler 2
  • make build directory a submodule of this very repository (and will make a note to avoid git initialize --recursive just in case, even though the submodule will be on master with no submodules defined)
  • add info how to add two remotes to that submodule, itself and rspec-staging
  • to publish: prod (cd build; git push prod master), staging (cd build; git push staging master)
  • forget about the staging trick of omitting CNAME, if a "Custom Domain" is not filled in in rspec-staging/rspec-staging.github.io/, it should not redirect to the domain then

I'd love to test how this will work on staging

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, but bare in mind that I'm not sure submodules work with github pages...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like middleman 4.0 update is a major PITA.
The documentation works quite ok
I'm stuck with an endless list of SASS failures:

== Request: /stylesheets/_application.css
       error  build/stylesheets/_application.css
Error: File to import not found or unreadable: bourbon.
        on line 5:1 of source/stylesheets/_application.css.scss
>> @import "bourbon";

   ^

...

== Request: /stylesheets/_application.css
   identical  build/stylesheets/_code.css
       error  build/stylesheets/_application.css
Error: File to import not found or unreadable: bourbon.
        on line 5:1 of source/stylesheets/_application.css.scss
>> @import "bourbon";

   ^

/Users/pirj/source/rspec-dev/repos/rspec.github.io/source/stylesheets/_application.css.scss:5

Besides that, I keep finding new things I'd love to improve, namely ditch neat which is not maintained anymore, and it's been recommended to use flexbox instead.

Even with the current dependencies we're getting quite a lot of:

WARNING: The button mixin is deprecated and will be removed in the next major version release

I don't really feel like fixing all of that at once.

Good to merge as is and address middleman 4/neat removal/css fixes separately?

@pirj pirj force-pushed the cleanup branch 2 times, most recently from b8d1256 to 578edc3 Compare May 24, 2020 15:59
pirj added 10 commits July 27, 2020 00:23
Middleman depend on Bundler 1.x and `bundle` fails if Bundler 2.x is
installed, even if Bundler 1.x is also installed.
 - moved puma and foreman to dev, only needed to locally run
 - moved bourbon, neat, and slim under dev, only needed to build
 - removed hard version specifiers - they are locked anyway
 - bumped builder to get rid of ::Fixnum deprecation warning
 - bumped foreman
 - changed middleman-syntax to use the released rubygems version
 - added rack-contrib, no idea how try_static worked without it
 - bumped middleman-livereload to get rid of some warning
When RACK_ENV was not present:

    missing argument: -e
Having Foreman for a single process is pointless.
Puma is webscale, but `middleman server` works quite fine without it.
Copy link
Member

@JonRowe JonRowe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this still renders with a clean build so it looks ok. I have reverted the bundler changes, bundler 2 works fine with this repo, it just ignores the bundler 1.1 dependency and carries on.

@pirj
Copy link
Member Author

pirj commented Jul 30, 2020

Awesome, thanks!

@benoittgt, good to merge?

@benoittgt
Copy link
Member

benoittgt commented Jul 30, 2020 via email

@pirj pirj merged commit 90a4325 into source Jul 30, 2020
@pirj pirj deleted the cleanup branch July 30, 2020 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants